diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/Makefile b/perf/impl/js-libp2p/v1.0-native-x25519/Makefile deleted file mode 100644 index a1e077cdc..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -DOCKER_IMAGE := node:20-alpine -DOCKER_RUN := docker run --rm -v "$(shell pwd)":/usr/src/myapp -w /usr/src/myapp $(DOCKER_IMAGE) - -all: perf - -perf: - $(DOCKER_RUN) npm ci - -clean: - rm -rf node_modules - -.PHONY: all clean perf diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/index.js b/perf/impl/js-libp2p/v1.0-native-x25519/index.js deleted file mode 100644 index d3391774c..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/index.js +++ /dev/null @@ -1,109 +0,0 @@ -import { noise } from './noise/dist/src/index.js' -import { yamux } from '@chainsafe/libp2p-yamux' -import { tcp } from '@libp2p/tcp' -import { multiaddr } from '@multiformats/multiaddr' -import { createLibp2p } from 'libp2p' -import { perf } from '@libp2p/perf' -import { parseArgs } from 'node:util' - -const argv = parseArgs({ - options: { - 'run-server': { - type: 'string', - default: 'false' - }, - 'server-address': { - type: 'string', - default: '127.0.0.1:8000' - }, - transport: { - type: 'string', - default: 'tcp' - }, - 'upload-bytes': { - type: 'string', - default: '0' - }, - 'download-bytes': { - type: 'string', - default: '10000000000' - } - } -}) - -/** - * @param {boolean} runServer - * @param {string} serverIpAddress - * @param {string} transport - * @param {number} uploadBytes - * @param {number} downloadBytes - */ -export async function main (runServer, serverIpAddress, transport, uploadBytes, downloadBytes) { - const { host, port } = splitHostPort(serverIpAddress) - - const config = { - transports: [ - tcp() - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - noise() - ], - connectionManager: { - minConnections: 0 - }, - services: { - perf: perf() - } - } - - if (runServer) { - Object.assign(config, { - addresses: { - listen: [ - // #TODO: right now we only support tcp - `/ip4/${host}/tcp/${port}` - ] - } - }) - } - - const node = await createLibp2p(config) - - await node.start() - - if (!runServer) { - for await (const output of node.services.perf.measurePerformance(multiaddr(`/ip4/${host}/tcp/${port}`), uploadBytes, downloadBytes)) { - // eslint-disable-next-line no-console - console.log(JSON.stringify(output)) - } - - await node.stop() - } -} - -/** - * @param {string} address - * @returns { host: string, port?: string } - */ -function splitHostPort (address) { - try { - const parts = address.split(':') - const host = parts[0] - const port = parts[1] - return { - host, - port - } - } catch (error) { - throw Error('Invalid server address') - } -} - -main(argv.values['run-server'] === 'true', argv.values['server-address'], argv.values.transport, Number(argv.values['upload-bytes']), Number(argv.values['download-bytes'])).catch((err) => { - // eslint-disable-next-line no-console - console.error(err) - process.exit(1) -}) diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/index.min.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/index.min.js deleted file mode 100644 index 1361cbd93..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/index.min.js +++ /dev/null @@ -1,51 +0,0 @@ -(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.ChainsafeLibp2PNoise = factory()}(typeof self !== 'undefined' ? self : this, function () { -"use strict";var ChainsafeLibp2PNoise=(()=>{var xu=Object.create;var On=Object.defineProperty;var mu=Object.getOwnPropertyDescriptor;var bu=Object.getOwnPropertyNames;var vu=Object.getPrototypeOf,wu=Object.prototype.hasOwnProperty;var ht=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Lt=(t,e)=>{for(var r in e)On(t,r,{get:e[r],enumerable:!0})},ha=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of bu(e))!wu.call(t,i)&&i!==r&&On(t,i,{get:()=>e[i],enumerable:!(n=mu(e,i))||n.enumerable});return t};var zt=(t,e,r)=>(r=t!=null?xu(vu(t)):{},ha(e||!t||!t.__esModule?On(r,"default",{value:t,enumerable:!0}):r,t)),Eu=t=>ha(On({},"__esModule",{value:!0}),t);var xa=ht((og,ga)=>{"use strict";function ya(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function Lu(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return ya(t,r)}catch{r.message=t.message,r.stack=t.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(t)),ya(new i,r)}}ga.exports=Lu});var lt=ht((dm,O0)=>{O0.exports={options:{usePureJavaScript:!1}}});var V0=ht((pm,F0)=>{var eo={};F0.exports=eo;var M0={};eo.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=fd(t,e);else{var i=0,s=e.length,o=e.charAt(0),a=[0];for(i=0;i0;)a.push(f%s),f=f/s|0}for(i=0;t[i]===0&&i=0;--i)n+=e[a[i]]}if(r){var u=new RegExp(".{1,"+r+"}","g");n=n.match(u).join(`\r -`)}return n};eo.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=M0[e];if(!r){r=M0[e]=[];for(var n=0;n>=8;for(;f>0;)o.push(f&255),f>>=8}for(var u=0;t[u]===s&&u0;)s.push(a%n),a=a/n|0}var c="";for(r=0;t.at(r)===0&&r=0;--r)c+=e[s[r]];return c}});var Ct=ht((ym,G0)=>{var H0=lt(),q0=V0(),b=G0.exports=H0.util=H0.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){b.nextTick=process.nextTick,typeof setImmediate=="function"?b.setImmediate=setImmediate:b.setImmediate=b.nextTick;return}if(typeof setImmediate=="function"){b.setImmediate=function(){return setImmediate.apply(void 0,arguments)},b.nextTick=function(a){return setImmediate(a)};return}if(b.setImmediate=function(a){setTimeout(a,0)},typeof window<"u"&&typeof window.postMessage=="function"){let a=function(c){if(c.source===window&&c.data===t){c.stopPropagation();var f=e.slice();e.length=0,f.forEach(function(u){u()})}};var o=a,t="forge.setImmediate",e=[];b.setImmediate=function(c){e.push(c),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",a,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,i=document.createElement("div"),e=[];new MutationObserver(function(){var c=e.slice();e.length=0,c.forEach(function(f){f()})}).observe(i,{attributes:!0});var s=b.setImmediate;b.setImmediate=function(c){Date.now()-r>15?(r=Date.now(),s(c)):(e.push(c),e.length===1&&i.setAttribute("a",n=!n))}}b.nextTick=b.setImmediate})();b.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;b.globalScope=function(){return b.isNodejs?globalThis:typeof self>"u"?window:self}();b.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};b.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};b.isArrayBufferView=function(t){return t&&b.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function bn(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}b.ByteBuffer=ro;function ro(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(b.isArrayBuffer(t)||b.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;rud&&(this.data.substr(0,1),this._constructedStringLength=0)};b.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};b.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};b.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};b.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};b.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};b.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(b.encodeUtf8(t))};b.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};b.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};b.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};b.ByteStringBuffer.prototype.putInt=function(t,e){bn(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};b.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};b.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};b.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};b.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};b.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};b.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};b.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};b.ByteStringBuffer.prototype.copy=function(){var t=b.createBuffer(this.data);return t.read=this.read,t};b.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};b.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};b.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};b.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};b.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};b.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};b.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};b.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};b.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};b.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};b.DataBuffer.prototype.putInt=function(t,e){bn(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};b.DataBuffer.prototype.putSignedInt=function(t,e){return bn(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};b.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};b.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};b.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};b.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};b.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};b.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};b.DataBuffer.prototype.copy=function(){return new b.DataBuffer(this)};b.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};b.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};b.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};b.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};b.xorBytes=function(t,e,r){for(var n="",i="",s="",o=0,a=0;r>0;--r,++o)i=t.charCodeAt(o)^e.charCodeAt(o),a>=10&&(n+=s,s="",a=0),s+=String.fromCharCode(i),++a;return n+=s,n};b.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Xe=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],z0="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";b.encode64=function(t,e){for(var r="",n="",i,s,o,a=0;a>2),r+=Ze.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=Ze.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":Ze.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};b.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,i,s,o=0;o>4),i!==64&&(e+=String.fromCharCode((n&15)<<4|i>>2),s!==64&&(e+=String.fromCharCode((i&3)<<6|s)));return e};b.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};b.decodeUtf8=function(t){return decodeURIComponent(escape(t))};b.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:q0.encode,decode:q0.decode}};b.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};b.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s>2),r+=Ze.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=Ze.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":Ze.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};b.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,s,o,a,c=0,f=r;c>4,o!==64&&(n[f++]=(s&15)<<4|o>>2,a!==64&&(n[f++]=(o&3)<<6|a));return e?f-r:n.subarray(0,f)};b.binary.base58.encode=function(t,e){return b.binary.baseN.encode(t,z0,e)};b.binary.base58.decode=function(t,e){return b.binary.baseN.decode(t,z0,e)};b.text={utf8:{},utf16:{}};b.text.utf8.encode=function(t,e,r){t=b.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s"u"&&(r=["web","flash"]);var i,s=!1,o=null;for(var a in r){i=r[a];try{if(i==="flash"||i==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),s=i==="flash"}(i==="web"||i==="both")&&(e[0]=localStorage,n=t.apply(this,e),s=!0)}catch(c){o=c}if(s)break}if(!s)throw o;return n};b.setItem=function(t,e,r,n,i){gi(ld,arguments,i)};b.getItem=function(t,e,r,n){return gi(dd,arguments,n)};b.removeItem=function(t,e,r,n){gi(pd,arguments,n)};b.clearItems=function(t,e,r){gi(yd,arguments,r)};b.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};b.format=function(t){for(var e=/%./g,r,n,i=0,s=[],o=0;r=e.exec(t);){n=t.substring(o,e.lastIndex-2),n.length>0&&s.push(n),o=e.lastIndex;var a=r[0][1];switch(a){case"s":case"o":i");break;case"%":s.push("%");break;default:s.push("<%"+a+"?>")}}return s.push(t.substring(o)),s.join("")};b.formatNumber=function(t,e,r,n){var i=t,s=isNaN(e=Math.abs(e))?2:e,o=r===void 0?",":r,a=n===void 0?".":n,c=i<0?"-":"",f=parseInt(i=Math.abs(+i||0).toFixed(s),10)+"",u=f.length>3?f.length%3:0;return c+(u?f.substr(0,u)+a:"")+f.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+a)+(s?o+Math.abs(i-f).toFixed(s).slice(2):"")};b.formatSize=function(t){return t>=1073741824?t=b.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=b.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=b.formatNumber(t/1024,0)+" KiB":t=b.formatNumber(t,0)+" bytes",t};b.bytesFromIP=function(t){return t.indexOf(".")!==-1?b.bytesFromIPv4(t):t.indexOf(":")!==-1?b.bytesFromIPv6(t):null};b.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=b.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1))}e.push(s)}if(r.length>0){var c=r[n];c.end-c.start>0&&(e.splice(c.start,c.end-c.start+1,""),c.start===0&&e.unshift(""),c.end===7&&e.push(""))}return e.join(":")};b.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in b&&!t.update)return e(null,b.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return b.cores=navigator.hardwareConcurrency,e(null,b.cores);if(typeof Worker>"u")return b.cores=1,e(null,b.cores);if(typeof Blob>"u")return b.cores=2,e(null,b.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(o){for(var a=Date.now(),c=a+4;Date.now()g.st&&u.stu.st&&g.st{var vn=lt();vn.pki=vn.pki||{};var so=$0.exports=vn.pki.oids=vn.oids=vn.oids||{};function k(t,e){so[t]=e,so[e]=t}function ft(t,e){so[t]=e}k("1.2.840.113549.1.1.1","rsaEncryption");k("1.2.840.113549.1.1.4","md5WithRSAEncryption");k("1.2.840.113549.1.1.5","sha1WithRSAEncryption");k("1.2.840.113549.1.1.7","RSAES-OAEP");k("1.2.840.113549.1.1.8","mgf1");k("1.2.840.113549.1.1.9","pSpecified");k("1.2.840.113549.1.1.10","RSASSA-PSS");k("1.2.840.113549.1.1.11","sha256WithRSAEncryption");k("1.2.840.113549.1.1.12","sha384WithRSAEncryption");k("1.2.840.113549.1.1.13","sha512WithRSAEncryption");k("1.3.101.112","EdDSA25519");k("1.2.840.10040.4.3","dsa-with-sha1");k("1.3.14.3.2.7","desCBC");k("1.3.14.3.2.26","sha1");k("1.3.14.3.2.29","sha1WithRSASignature");k("2.16.840.1.101.3.4.2.1","sha256");k("2.16.840.1.101.3.4.2.2","sha384");k("2.16.840.1.101.3.4.2.3","sha512");k("2.16.840.1.101.3.4.2.4","sha224");k("2.16.840.1.101.3.4.2.5","sha512-224");k("2.16.840.1.101.3.4.2.6","sha512-256");k("1.2.840.113549.2.2","md2");k("1.2.840.113549.2.5","md5");k("1.2.840.113549.1.7.1","data");k("1.2.840.113549.1.7.2","signedData");k("1.2.840.113549.1.7.3","envelopedData");k("1.2.840.113549.1.7.4","signedAndEnvelopedData");k("1.2.840.113549.1.7.5","digestedData");k("1.2.840.113549.1.7.6","encryptedData");k("1.2.840.113549.1.9.1","emailAddress");k("1.2.840.113549.1.9.2","unstructuredName");k("1.2.840.113549.1.9.3","contentType");k("1.2.840.113549.1.9.4","messageDigest");k("1.2.840.113549.1.9.5","signingTime");k("1.2.840.113549.1.9.6","counterSignature");k("1.2.840.113549.1.9.7","challengePassword");k("1.2.840.113549.1.9.8","unstructuredAddress");k("1.2.840.113549.1.9.14","extensionRequest");k("1.2.840.113549.1.9.20","friendlyName");k("1.2.840.113549.1.9.21","localKeyId");k("1.2.840.113549.1.9.22.1","x509Certificate");k("1.2.840.113549.1.12.10.1.1","keyBag");k("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");k("1.2.840.113549.1.12.10.1.3","certBag");k("1.2.840.113549.1.12.10.1.4","crlBag");k("1.2.840.113549.1.12.10.1.5","secretBag");k("1.2.840.113549.1.12.10.1.6","safeContentsBag");k("1.2.840.113549.1.5.13","pkcs5PBES2");k("1.2.840.113549.1.5.12","pkcs5PBKDF2");k("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");k("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");k("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");k("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");k("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");k("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");k("1.2.840.113549.2.7","hmacWithSHA1");k("1.2.840.113549.2.8","hmacWithSHA224");k("1.2.840.113549.2.9","hmacWithSHA256");k("1.2.840.113549.2.10","hmacWithSHA384");k("1.2.840.113549.2.11","hmacWithSHA512");k("1.2.840.113549.3.7","des-EDE3-CBC");k("2.16.840.1.101.3.4.1.2","aes128-CBC");k("2.16.840.1.101.3.4.1.22","aes192-CBC");k("2.16.840.1.101.3.4.1.42","aes256-CBC");k("2.5.4.3","commonName");k("2.5.4.4","surname");k("2.5.4.5","serialNumber");k("2.5.4.6","countryName");k("2.5.4.7","localityName");k("2.5.4.8","stateOrProvinceName");k("2.5.4.9","streetAddress");k("2.5.4.10","organizationName");k("2.5.4.11","organizationalUnitName");k("2.5.4.12","title");k("2.5.4.13","description");k("2.5.4.15","businessCategory");k("2.5.4.17","postalCode");k("2.5.4.42","givenName");k("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");k("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");k("2.16.840.1.113730.1.1","nsCertType");k("2.16.840.1.113730.1.13","nsComment");ft("2.5.29.1","authorityKeyIdentifier");ft("2.5.29.2","keyAttributes");ft("2.5.29.3","certificatePolicies");ft("2.5.29.4","keyUsageRestriction");ft("2.5.29.5","policyMapping");ft("2.5.29.6","subtreesConstraint");ft("2.5.29.7","subjectAltName");ft("2.5.29.8","issuerAltName");ft("2.5.29.9","subjectDirectoryAttributes");ft("2.5.29.10","basicConstraints");ft("2.5.29.11","nameConstraints");ft("2.5.29.12","policyConstraints");ft("2.5.29.13","basicConstraints");k("2.5.29.14","subjectKeyIdentifier");k("2.5.29.15","keyUsage");ft("2.5.29.16","privateKeyUsagePeriod");k("2.5.29.17","subjectAltName");k("2.5.29.18","issuerAltName");k("2.5.29.19","basicConstraints");ft("2.5.29.20","cRLNumber");ft("2.5.29.21","cRLReason");ft("2.5.29.22","expirationDate");ft("2.5.29.23","instructionCode");ft("2.5.29.24","invalidityDate");ft("2.5.29.25","cRLDistributionPoints");ft("2.5.29.26","issuingDistributionPoint");ft("2.5.29.27","deltaCRLIndicator");ft("2.5.29.28","issuingDistributionPoint");ft("2.5.29.29","certificateIssuer");ft("2.5.29.30","nameConstraints");k("2.5.29.31","cRLDistributionPoints");k("2.5.29.32","certificatePolicies");ft("2.5.29.33","policyMappings");ft("2.5.29.34","policyConstraints");k("2.5.29.35","authorityKeyIdentifier");ft("2.5.29.36","policyConstraints");k("2.5.29.37","extKeyUsage");ft("2.5.29.46","freshestCRL");ft("2.5.29.54","inhibitAnyPolicy");k("1.3.6.1.4.1.11129.2.4.2","timestampList");k("1.3.6.1.5.5.7.1.1","authorityInfoAccess");k("1.3.6.1.5.5.7.3.1","serverAuth");k("1.3.6.1.5.5.7.3.2","clientAuth");k("1.3.6.1.5.5.7.3.3","codeSigning");k("1.3.6.1.5.5.7.3.4","emailProtection");k("1.3.6.1.5.5.7.3.8","timeStamping")});var En=ht((xm,Y0)=>{var xt=lt();Ct();xi();var F=Y0.exports=xt.asn1=xt.asn1||{};F.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};F.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};F.create=function(t,e,r,n,i){if(xt.util.isArray(n)){for(var s=[],o=0;oe){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}var gd=function(t,e){var r=t.getByte();if(e--,r!==128){var n,i=r&128;if(!i)n=r;else{var s=r&127;wn(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}};F.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof t=="string"&&(t=xt.util.createBuffer(t));var r=t.length(),n=mi(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=r,i.remaining=t.length(),i}return n};function mi(t,e,r,n){var i;wn(t,e,2);var s=t.getByte();e--;var o=s&192,a=s&31;i=t.length();var c=gd(t,e);if(e-=i-t.length(),c!==void 0&&c>e){if(n.strict){var f=new Error("Too few bytes to read ASN.1 value.");throw f.available=t.length(),f.remaining=e,f.requested=c,f}c=e}var u,h,l=(s&32)===32;if(l)if(u=[],c===void 0)for(;;){if(wn(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}i=t.length(),u.push(mi(t,e,r+1,n)),e-=i-t.length()}else for(;c>0;)i=t.length(),u.push(mi(t,c,r+1,n)),e-=i-t.length(),c-=i-t.length();if(u===void 0&&o===F.Class.UNIVERSAL&&a===F.Type.BITSTRING&&(h=t.bytes(c)),u===void 0&&n.decodeBitStrings&&o===F.Class.UNIVERSAL&&a===F.Type.BITSTRING&&c>1){var g=t.read,d=e,p=0;if(a===F.Type.BITSTRING&&(wn(t,e,1),p=t.getByte(),e--),p===0)try{i=t.length();var y={strict:!0,decodeBitStrings:!0},x=mi(t,e,r+1,y),v=i-t.length();e-=v,a==F.Type.BITSTRING&&v++;var m=x.tagClass;v===c&&(m===F.Class.UNIVERSAL||m===F.Class.CONTEXT_SPECIFIC)&&(u=[x])}catch{}u===void 0&&(t.read=g,e=d)}if(u===void 0){if(c===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=e}if(a===F.Type.BMPSTRING)for(u="";c>0;c-=2)wn(t,e,2),u+=String.fromCharCode(t.getInt16()),e-=2;else u=t.getBytes(c),e-=c}var A=h===void 0?null:{bitStringContents:h};return F.create(o,a,l,u,A)}F.toDer=function(t){var e=xt.util.createBuffer(),r=t.tagClass|t.type,n=xt.util.createBuffer(),i=!1;if("bitStringContents"in t&&(i=!0,t.original&&(i=F.equals(t,t.original))),i)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var s=0;s1&&(t.value.charCodeAt(0)===0&&!(t.value.charCodeAt(1)&128)||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var o=n.length(),a="";do a+=String.fromCharCode(o&255),o=o>>>8;while(o>0);e.putByte(a.length|128);for(var s=a.length-1;s>=0;--s)e.putByte(a.charCodeAt(s))}return e.putBuffer(n),e};F.oidToDer=function(t){var e=t.split("."),r=xt.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,i,s,o,a=2;a>>7,n||(o|=128),i.push(o),n=!1;while(s>0);for(var c=i.length-1;c>=0;--c)r.putByte(i[c])}return r};F.derToOid=function(t){var e;typeof t=="string"&&(t=xt.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;)r=t.getByte(),n=n<<7,r&128?n+=r&127:(e+="."+(n+r),n=0);return e};F.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),s=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=0;if(t.length>11){var c=t.charAt(10),f=10;c!=="+"&&c!=="-"&&(a=parseInt(t.substr(10,2),10),f+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,0),f&&(c=t.charAt(f),c==="+"||c==="-")){var u=parseInt(t.substr(f+1,2),10),h=parseInt(t.substr(f+4,2),10),l=u*60+h;l*=6e4,c==="+"?e.setTime(+e-l):e.setTime(+e+l)}return e};F.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),o=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),c=0,f=0,u=!1;t.charAt(t.length-1)==="Z"&&(u=!0);var h=t.length-5,l=t.charAt(h);if(l==="+"||l==="-"){var g=parseInt(t.substr(h+1,2),10),d=parseInt(t.substr(h+4,2),10);f=g*60+d,f*=6e4,l==="+"&&(f*=-1),u=!0}return t.charAt(14)==="."&&(c=parseFloat(t.substr(14),10)*1e3),u?(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,c),e.setTime(+e+f)):(e.setFullYear(r,n,i),e.setHours(s,o,a,c)),e};F.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};F.derToInteger=function(t){typeof t=="string"&&(t=xt.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};F.validate=function(t,e,r,n){var i=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(i=!0,e.value&&xt.util.isArray(e.value))for(var s=0,o=0;i&&o0&&(n+=` -`);for(var i="",s=0;s1?n+="0x"+xt.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var f=t.value.charCodeAt(0);f==1?n+=" (1 unused bit shown)":f>1&&(n+=" ("+f+" unused bits shown)")}}else if(t.type===F.Type.OCTETSTRING)W0.test(t.value)||(n+="("+t.value+") "),n+="0x"+xt.util.bytesToHex(t.value);else if(t.type===F.Type.UTF8)try{n+=xt.util.decodeUtf8(t.value)}catch(u){if(u.message==="URI malformed")n+="0x"+xt.util.bytesToHex(t.value)+" (malformed UTF8)";else throw u}else t.type===F.Type.PRINTABLESTRING||t.type===F.Type.IA5String?n+=t.value:W0.test(t.value)?n+="0x"+xt.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var ao=ht((mm,Z0)=>{var Nt=lt();Ct();Z0.exports=Nt.cipher=Nt.cipher||{};Nt.cipher.algorithms=Nt.cipher.algorithms||{};Nt.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Nt.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Nt.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};Nt.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Nt.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Nt.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};Nt.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),Nt.cipher.algorithms[t]=e};Nt.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in Nt.cipher.algorithms?Nt.cipher.algorithms[t]:null};var oo=Nt.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};oo.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=Nt.util.createBuffer(),this.output=t.output||Nt.util.createBuffer(),this.mode.start(e)};oo.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};oo.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var fo=ht((bm,X0)=>{var Dt=lt();Ct();Dt.cipher=Dt.cipher||{};var nt=X0.exports=Dt.cipher.modes=Dt.cipher.modes||{};nt.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};nt.ecb.prototype.start=function(t){};nt.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};nt.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};nt.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=bi(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};nt.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};nt.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=bi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=bi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.ofb.prototype.decrypt=nt.ofb.prototype.encrypt;nt.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=bi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}vi(this._inBlock)};nt.ctr.prototype.decrypt=nt.ctr.prototype.encrypt;nt.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0,this._R=3774873600};nt.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=Dt.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=Dt.util.createBuffer(t.additionalData):r=Dt.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=Dt.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(co(n*8)))}this._inBlock=this._j0.slice(0),vi(this._inBlock),this._partialBytes=0,r=Dt.util.createBuffer(r),this._aDataLength=co(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};nt.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),vi(this._inBlock)};nt.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),vi(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};nt.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=t[n]>>>(7-r%8)*4&15,s=this._m[r][i];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};nt.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};nt.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,s=new Array(i),o=0;o>>1,i=new Array(r);i[n]=t.slice(0);for(var s=n>>>1;s>0;)this.pow(i[2*s],i[s]=[]),s>>=1;for(s=2;s4){var r=t;t=Dt.util.createBuffer();for(var n=0;n{var pt=lt();ao();fo();Ct();tc.exports=pt.aes=pt.aes||{};pt.aes.startEncrypting=function(t,e,r,n){var i=wi({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i};pt.aes.createEncryptionCipher=function(t,e){return wi({key:t,output:null,decrypt:!1,mode:e})};pt.aes.startDecrypting=function(t,e,r,n){var i=wi({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i};pt.aes.createDecryptionCipher=function(t,e){return wi({key:t,output:null,decrypt:!0,mode:e})};pt.aes.Algorithm=function(t,e){lo||J0();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(n,i){return ho(r._w,n,i,!1)},decrypt:function(n,i){return ho(r._w,n,i,!0)}}}),r._init=!1};pt.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=pt.util.createBuffer(e);else if(pt.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=pt.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^a&255^99,Gt[r]=a,uo[a]=r,c=t[a],i=t[r],s=t[i],o=t[s],f=c<<24^a<<16^a<<8^(a^c),u=(i^s^o)<<24^(r^o)<<16^(r^s^o)<<8^(r^i^o);for(var h=0;h<4;++h)cr[h][r]=f,ue[h][a]=u,f=f<<24|f>>>8,u=u<<24|u>>>8;r===0?r=n=1:(r=i^t[t[t[i^o]]],n^=t[t[n]])}}function j0(t,e){for(var r=t.slice(0),n,i=1,s=r.length,o=s+6+1,a=Vr*o,c=s;c>>16&255]<<24^Gt[n>>>8&255]<<16^Gt[n&255]<<8^Gt[n>>>24]^Q0[i]<<24,i++):s>6&&c%s===4&&(n=Gt[n>>>24]<<24^Gt[n>>>16&255]<<16^Gt[n>>>8&255]<<8^Gt[n&255]),r[c]=r[c-s]^n;if(e){var f,u=ue[0],h=ue[1],l=ue[2],g=ue[3],d=r.slice(0);a=r.length;for(var c=0,p=a-Vr;c>>24]]^h[Gt[f>>>16&255]]^l[Gt[f>>>8&255]]^g[Gt[f&255]];r=d}return r}function ho(t,e,r,n){var i=t.length/4-1,s,o,a,c,f;n?(s=ue[0],o=ue[1],a=ue[2],c=ue[3],f=uo):(s=cr[0],o=cr[1],a=cr[2],c=cr[3],f=Gt);var u,h,l,g,d,p,y;u=e[0]^t[0],h=e[n?3:1]^t[1],l=e[2]^t[2],g=e[n?1:3]^t[3];for(var x=3,v=1;v>>24]^o[h>>>16&255]^a[l>>>8&255]^c[g&255]^t[++x],p=s[h>>>24]^o[l>>>16&255]^a[g>>>8&255]^c[u&255]^t[++x],y=s[l>>>24]^o[g>>>16&255]^a[u>>>8&255]^c[h&255]^t[++x],g=s[g>>>24]^o[u>>>16&255]^a[h>>>8&255]^c[l&255]^t[++x],u=d,h=p,l=y;r[0]=f[u>>>24]<<24^f[h>>>16&255]<<16^f[l>>>8&255]<<8^f[g&255]^t[++x],r[n?3:1]=f[h>>>24]<<24^f[l>>>16&255]<<16^f[g>>>8&255]<<8^f[u&255]^t[++x],r[2]=f[l>>>24]<<24^f[g>>>16&255]<<16^f[u>>>8&255]<<8^f[h&255]^t[++x],r[n?1:3]=f[g>>>24]<<24^f[u>>>16&255]<<16^f[h>>>8&255]<<8^f[l&255]^t[++x]}function wi(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=pt.cipher.createDecipher(r,t.key):n=pt.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof pt.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var nc=ht((wm,rc)=>{var vt=lt();ao();fo();Ct();rc.exports=vt.des=vt.des||{};vt.des.startEncrypting=function(t,e,r,n){var i=Ei({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};vt.des.createEncryptionCipher=function(t,e){return Ei({key:t,output:null,decrypt:!1,mode:e})};vt.des.startDecrypting=function(t,e,r,n){var i=Ei({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};vt.des.createDecryptionCipher=function(t,e){return Ei({key:t,output:null,decrypt:!0,mode:e})};vt.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(n,i){return ec(r._keys,n,i,!1)},decrypt:function(n,i){return ec(r._keys,n,i,!0)}}}),r._init=!1};vt.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=vt.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=Ad(e),this._init=!0}};ye("DES-ECB",vt.cipher.modes.ecb);ye("DES-CBC",vt.cipher.modes.cbc);ye("DES-CFB",vt.cipher.modes.cfb);ye("DES-OFB",vt.cipher.modes.ofb);ye("DES-CTR",vt.cipher.modes.ctr);ye("3DES-ECB",vt.cipher.modes.ecb);ye("3DES-CBC",vt.cipher.modes.cbc);ye("3DES-CFB",vt.cipher.modes.cfb);ye("3DES-OFB",vt.cipher.modes.ofb);ye("3DES-CTR",vt.cipher.modes.ctr);function ye(t,e){var r=function(){return new vt.des.Algorithm(t,e)};vt.cipher.registerAlgorithm(t,r)}var xd=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],md=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],bd=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],vd=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],wd=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],Ed=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],Sd=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],Bd=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function Ad(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],a=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],l=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],d=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],p=t.length()>8?3:1,y=[],x=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,m,A=0;A>>4^B)&252645135,B^=m,S^=m<<4,m=(B>>>-16^S)&65535,S^=m,B^=m<<-16,m=(S>>>2^B)&858993459,B^=m,S^=m<<2,m=(B>>>-16^S)&65535,S^=m,B^=m<<-16,m=(S>>>1^B)&1431655765,B^=m,S^=m<<1,m=(B>>>8^S)&16711935,S^=m,B^=m<<8,m=(S>>>1^B)&1431655765,B^=m,S^=m<<1,m=S<<8|B>>>20&240,S=B<<24|B<<8&16711680|B>>>8&65280|B>>>24&240,B=m;for(var R=0;R>>26,B=B<<2|B>>>26):(S=S<<1|S>>>27,B=B<<1|B>>>27),S&=-15,B&=-15;var _=e[S>>>28]|r[S>>>24&15]|n[S>>>20&15]|i[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|a[S>>>4&15],O=c[B>>>28]|f[B>>>24&15]|u[B>>>20&15]|h[B>>>16&15]|l[B>>>12&15]|g[B>>>8&15]|d[B>>>4&15];m=(O>>>16^_)&65535,y[v++]=_^m,y[v++]=O^m<<16}}return y}function ec(t,e,r,n){var i=t.length===32?3:9,s;i===3?s=n?[30,-2,-2]:[0,32,2]:s=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,a=e[0],c=e[1];o=(a>>>4^c)&252645135,c^=o,a^=o<<4,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,a=a<<1|a>>>31,c=c<<1|c>>>31;for(var f=0;f>>4|c<<28)^t[l+1];o=a,a=c,c=o^(md[g>>>24&63]|vd[g>>>16&63]|Ed[g>>>8&63]|Bd[g&63]|xd[d>>>24&63]|bd[d>>>16&63]|wd[d>>>8&63]|Sd[d&63])}o=a,a=c,c=o}a=a>>>1|a<<31,c=c>>>1|c<<31,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(a>>>4^c)&252645135,c^=o,a^=o<<4,r[0]=a,r[1]=c}function Ei(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=vt.cipher.createDecipher(r,t.key):n=vt.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof vt.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var fr=ht((Em,ic)=>{var Si=lt();ic.exports=Si.md=Si.md||{};Si.md.algorithms=Si.md.algorithms||{}});var oc=ht((Sm,sc)=>{var Ne=lt();fr();Ct();var Cd=sc.exports=Ne.hmac=Ne.hmac||{};Cd.create=function(){var t=null,e=null,r=null,n=null,i={};return i.start=function(s,o){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in Ne.md.algorithms)e=Ne.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else e=s;if(o===null)o=t;else{if(typeof o=="string")o=Ne.util.createBuffer(o);else if(Ne.util.isArray(o)){var a=o;o=Ne.util.createBuffer();for(var c=0;ce.blockLength&&(e.start(),e.update(o.bytes()),o=e.digest()),r=Ne.util.createBuffer(),n=Ne.util.createBuffer(),f=o.length();for(var c=0;c{});var cc=ht((Cm,ac)=>{var $t=lt();oc();fr();Ct();var Id=$t.pkcs5=$t.pkcs5||{},De;$t.util.isNodejs&&!$t.options.usePureJavaScript&&(De=Bi());ac.exports=$t.pbkdf2=Id.pbkdf2=function(t,e,r,n,i,s){if(typeof i=="function"&&(s=i,i=null),$t.util.isNodejs&&!$t.options.usePureJavaScript&&De.pbkdf2&&(i===null||typeof i!="object")&&(De.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?De.pbkdf2Sync.length===4?De.pbkdf2(t,e,r,n,function(m,A){if(m)return s(m);s(null,A.toString("binary"))}):De.pbkdf2(t,e,r,n,i,function(m,A){if(m)return s(m);s(null,A.toString("binary"))}):De.pbkdf2Sync.length===4?De.pbkdf2Sync(t,e,r,n).toString("binary"):De.pbkdf2Sync(t,e,r,n,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in $t.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=$t.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var a=new Error("Derived key is too long.");if(s)return s(a);throw a}var c=Math.ceil(n/o),f=n-(c-1)*o,u=$t.hmac.create();u.start(i,t);var h="",l,g,d;if(!s){for(var p=1;p<=c;++p){u.start(null,null),u.update(e),u.update($t.util.int32ToBytes(p)),l=d=u.digest().getBytes();for(var y=2;y<=r;++y)u.start(null,null),u.update(d),g=u.digest().getBytes(),l=$t.util.xorBytes(l,g,o),d=g;h+=pc)return s(null,h);u.start(null,null),u.update(e),u.update($t.util.int32ToBytes(p)),l=d=u.digest().getBytes(),y=2,v()}function v(){if(y<=r)return u.start(null,null),u.update(d),g=u.digest().getBytes(),l=$t.util.xorBytes(l,g,o),d=g,++y,$t.util.setImmediate(v);h+=p{var Ci=lt();Ct();var fc=uc.exports=Ci.pem=Ci.pem||{};fc.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r -`,n;if(t.procType&&(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=Ai(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=Ai(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=Ai(n)),t.headers)for(var i=0;i65&&o!==-1){var a=e[o];a===","?(++o,e=e.substr(0,o)+`\r - `+e.substr(o)):e=e.substr(0,o)+`\r -`+a+e.substr(o+1),s=i-o-1,o=-1,++i}else(e[i]===" "||e[i]===" "||e[i]===",")&&(o=i);return e}function Td(t){return t.replace(/^\s+/,"")}});var xc=ht((Tm,gc)=>{var ge=lt();fr();Ct();var dc=gc.exports=ge.sha256=ge.sha256||{};ge.md.sha256=ge.md.algorithms.sha256=dc;dc.create=function(){pc||_d();var t=null,e=ge.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),lc(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=ge.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(yo.substr(0,n.blockLength-o));for(var a,c,f=n.fullMessageLength[0]*8,u=0;u>>0,f+=c,i.putInt32(f>>>0),f=a>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};lc(h,r,i);var l=ge.util.createBuffer();return l.putInt32(h.h0),l.putInt32(h.h1),l.putInt32(h.h2),l.putInt32(h.h3),l.putInt32(h.h4),l.putInt32(h.h5),l.putInt32(h.h6),l.putInt32(h.h7),l},n};var yo=null,pc=!1,yc=null;function _d(){yo="\x80",yo+=ge.util.fillString("\0",64),yc=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],pc=!0}function lc(t,e,r){for(var n,i,s,o,a,c,f,u,h,l,g,d,p,y,x,v=r.length();v>=64;){for(f=0;f<16;++f)e[f]=r.getInt32();for(;f<64;++f)n=e[f-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=e[f-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[f]=n+e[f-7]+i+e[f-16]|0;for(u=t.h0,h=t.h1,l=t.h2,g=t.h3,d=t.h4,p=t.h5,y=t.h6,x=t.h7,f=0;f<64;++f)o=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),a=y^d&(p^y),s=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),c=u&h|l&(u^h),n=x+o+a+yc[f]+e[f],i=s+c,x=y,y=p,p=d,d=g+n>>>0,g=l,l=h,h=u,u=n+i>>>0;t.h0=t.h0+u|0,t.h1=t.h1+h|0,t.h2=t.h2+l|0,t.h3=t.h3+g|0,t.h4=t.h4+d|0,t.h5=t.h5+p|0,t.h6=t.h6+y|0,t.h7=t.h7+x|0,v-=64}}});var bc=ht((_m,mc)=>{var xe=lt();Ct();var Ii=null;xe.util.isNodejs&&!xe.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Ii=Bi());var Ld=mc.exports=xe.prng=xe.prng||{};Ld.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();e.pools=n,e.pool=0,e.generate=function(f,u){if(!u)return e.generateSync(f);var h=e.plugin.cipher,l=e.plugin.increment,g=e.plugin.formatKey,d=e.plugin.formatSeed,p=xe.util.createBuffer();e.key=null,y();function y(x){if(x)return u(x);if(p.length()>=f)return u(null,p.getBytes(f));if(e.generated>1048575&&(e.key=null),e.key===null)return xe.util.nextTick(function(){s(y)});var v=h(e.key,e.seed);e.generated+=v.length,p.putBytes(v),e.key=g(h(e.key,l(e.seed))),e.seed=d(h(e.key,e.seed)),xe.util.setImmediate(y)}},e.generateSync=function(f){var u=e.plugin.cipher,h=e.plugin.increment,l=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var d=xe.util.createBuffer();d.length()1048575&&(e.key=null),e.key===null&&o();var p=u(e.key,e.seed);e.generated+=p.length,d.putBytes(p),e.key=l(u(e.key,h(e.seed))),e.seed=g(u(e.key,e.seed))}return d.getBytes(f)};function s(f){if(e.pools[0].messageLength>=32)return a(),f();var u=32-e.pools[0].messageLength<<5;e.seedFile(u,function(h,l){if(h)return f(h);e.collect(l),a(),f()})}function o(){if(e.pools[0].messageLength>=32)return a();var f=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(f)),a()}function a(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var f=e.plugin.md.create();f.update(e.keyBytes);for(var u=1,h=0;h<32;++h)e.reseeds%u===0&&(f.update(e.pools[h].digest().getBytes()),e.pools[h].start()),u=u<<1;e.keyBytes=f.digest().getBytes(),f.start(),f.update(e.keyBytes);var l=f.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(l),e.generated=0}function c(f){var u=null,h=xe.util.globalScope,l=h.crypto||h.msCrypto;l&&l.getRandomValues&&(u=function(S){return l.getRandomValues(S)});var g=xe.util.createBuffer();if(u)for(;g.length()>16),v+=(x&32767)<<16,v+=x>>15,v=(v&2147483647)+(v>>31),A=v&4294967295;for(var y=0;y<3;++y)m=A>>>(y<<3),m^=Math.floor(Math.random()*256),g.putByte(m&255)}return g.getBytes(f)}return Ii?(e.seedFile=function(f,u){Ii.randomBytes(f,function(h,l){if(h)return u(h);u(null,l.toString())})},e.seedFileSync=function(f){return Ii.randomBytes(f).toString()}):(e.seedFile=function(f,u){try{u(null,c(f))}catch(h){u(h)}},e.seedFileSync=c),e.collect=function(f){for(var u=f.length,h=0;h>l&255);e.collect(h)},e.registerWorker=function(f){if(f===self)e.seedFile=function(h,l){function g(d){var p=d.data;p.forge&&p.forge.prng&&(self.removeEventListener("message",g),l(p.forge.prng.err,p.forge.prng.bytes))}self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:h}}})};else{var u=function(h){var l=h.data;l.forge&&l.forge.prng&&e.seedFile(l.forge.prng.needed,function(g,d){f.postMessage({forge:{prng:{err:g,bytes:d}}})})};f.addEventListener("message",u)}},e}});var Sn=ht((Lm,go)=>{var kt=lt();po();xc();bc();Ct();(function(){if(kt.random&&kt.random.getBytes){go.exports=kt.random;return}(function(t){var e={},r=new Array(4),n=kt.util.createBuffer();e.formatKey=function(h){var l=kt.util.createBuffer(h);return h=new Array(4),h[0]=l.getInt32(),h[1]=l.getInt32(),h[2]=l.getInt32(),h[3]=l.getInt32(),kt.aes._expandKey(h,!1)},e.formatSeed=function(h){var l=kt.util.createBuffer(h);return h=new Array(4),h[0]=l.getInt32(),h[1]=l.getInt32(),h[2]=l.getInt32(),h[3]=l.getInt32(),h},e.cipher=function(h,l){return kt.aes._updateBlock(h,l,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=kt.md.sha256;function i(){var h=kt.prng.create(e);return h.getBytes=function(l,g){return h.generate(l,g)},h.getBytesSync=function(l){return h.generate(l)},h}var s=i(),o=null,a=kt.util.globalScope,c=a.crypto||a.msCrypto;if(c&&c.getRandomValues&&(o=function(h){return c.getRandomValues(h)}),kt.options.usePureJavaScript||!kt.util.isNodejs&&!o){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var f="";for(var u in navigator)try{typeof navigator[u]=="string"&&(f+=navigator[u])}catch{}s.collect(f),f=null}t&&(t().mousemove(function(h){s.collectInt(h.clientX,16),s.collectInt(h.clientY,16)}),t().keypress(function(h){s.collectInt(h.charCode,8)}))}if(!kt.random)kt.random=s;else for(var u in s)kt.random[u]=s[u];kt.random.createInstance=i,go.exports=kt.random})(typeof jQuery<"u"?jQuery:null)})()});var Sc=ht((Rm,Ec)=>{var Wt=lt();Ct();var xo=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],vc=[1,2,3,5],Rd=function(t,e){return t<>16-e},Nd=function(t,e){return(t&65535)>>e|t<<16-e&65535};Ec.exports=Wt.rc2=Wt.rc2||{};Wt.rc2.expandKey=function(t,e){typeof t=="string"&&(t=Wt.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),i=e,s=Math.ceil(i/8),o=255>>(i&7),a;for(a=n;a<128;a++)r.putByte(xo[r.at(a-1)+r.at(a-n)&255]);for(r.setAt(128-s,xo[r.at(128-s)&o]),a=127-s;a>=0;a--)r.setAt(a,xo[r.at(a+1)^r.at(a+s)]);return r};var wc=function(t,e,r){var n=!1,i=null,s=null,o=null,a,c,f,u,h=[];for(t=Wt.rc2.expandKey(t,e),f=0;f<64;f++)h.push(t.getInt16Le());r?(a=function(d){for(f=0;f<4;f++)d[f]+=h[u]+(d[(f+3)%4]&d[(f+2)%4])+(~d[(f+3)%4]&d[(f+1)%4]),d[f]=Rd(d[f],vc[f]),u++},c=function(d){for(f=0;f<4;f++)d[f]+=h[d[(f+3)%4]&63]}):(a=function(d){for(f=3;f>=0;f--)d[f]=Nd(d[f],vc[f]),d[f]-=h[u]+(d[(f+3)%4]&d[(f+2)%4])+(~d[(f+3)%4]&d[(f+1)%4]),u--},c=function(d){for(f=3;f>=0;f--)d[f]-=h[d[(f+3)%4]&63]});var l=function(d){var p=[];for(f=0;f<4;f++){var y=i.getInt16Le();o!==null&&(r?y^=o.getInt16Le():o.putInt16Le(y)),p.push(y&65535)}u=r?0:63;for(var x=0;x=8;)l([[5,a],[1,c],[6,a],[1,c],[5,a]])},finish:function(d){var p=!0;if(r)if(d)p=d(8,i,!r);else{var y=i.length()===8?8:8-i.length();i.fillWithByte(y,y)}if(p&&(n=!0,g.update()),!r&&(p=i.length()===0,p))if(d)p=d(8,s,!r);else{var x=s.length(),v=s.at(x-1);v>x?p=!1:s.truncate(v)}return p}},g};Wt.rc2.startEncrypting=function(t,e,r){var n=Wt.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};Wt.rc2.createEncryptionCipher=function(t,e){return wc(t,e,!0)};Wt.rc2.startDecrypting=function(t,e,r){var n=Wt.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};Wt.rc2.createDecryptionCipher=function(t,e){return wc(t,e,!1)}});var Li=ht((Nm,Rc)=>{var mo=lt();Rc.exports=mo.jsbn=mo.jsbn||{};var ke,Dd=0xdeadbeefcafe,Bc=(Dd&16777215)==15715070;function D(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}mo.jsbn.BigInteger=D;function ot(){return new D(null)}function kd(t,e,r,n,i,s){for(;--s>=0;){var o=e*this.data[t++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=o&67108863}return i}function Pd(t,e,r,n,i,s){for(var o=e&32767,a=e>>15;--s>=0;){var c=this.data[t]&32767,f=this.data[t++]>>15,u=a*c+f*o;c=o*c+((u&32767)<<15)+r.data[n]+(i&1073741823),i=(c>>>30)+(u>>>15)+a*f+(i>>>30),r.data[n++]=c&1073741823}return i}function Ac(t,e,r,n,i,s){for(var o=e&16383,a=e>>14;--s>=0;){var c=this.data[t]&16383,f=this.data[t++]>>14,u=a*c+f*o;c=o*c+((u&16383)<<14)+r.data[n]+i,i=(c>>28)+(u>>14)+a*f,r.data[n++]=c&268435455}return i}typeof navigator>"u"?(D.prototype.am=Ac,ke=28):Bc&&navigator.appName=="Microsoft Internet Explorer"?(D.prototype.am=Pd,ke=30):Bc&&navigator.appName!="Netscape"?(D.prototype.am=kd,ke=26):(D.prototype.am=Ac,ke=28);D.prototype.DB=ke;D.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function Od(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}function Qe(t){var e=ot();return e.fromInt(t),e}function Md(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,i=!1,s=0;--n>=0;){var o=r==8?t[n]&255:Ic(t,n);if(o<0){t.charAt(n)=="-"&&(i=!0);continue}i=!1,s==0?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB)}r==8&&t[0]&128&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}function Vd(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(a>a)>0&&(i=!0,s=Cc(n));o>=0;)a>(a+=this.DB-e)):(n=this.data[o]>>(a-=e)&r,a<=0&&(a+=this.DB,--o)),n>0&&(i=!0),i&&(s+=Cc(n));return i?s:"0"}function Hd(){var t=ot();return D.ZERO.subTo(this,t),t}function qd(){return this.s<0?this.negate():this}function zd(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}function _i(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function Gd(){return this.t<=0?0:this.DB*(this.t-1)+_i(this.data[this.t-1]^this.s&this.DM)}function $d(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}function Wd(t,e){for(var r=t;r=0;--a)e.data[a+s+1]=this.data[a]>>n|o,o=(this.data[a]&i)<=0;--a)e.data[a]=0;e.data[s]=o,e.t=this.t+s+1,e.s=this.s,e.clamp()}function Zd(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,i=this.DB-n,s=(1<>n;for(var o=r+1;o>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}function Qd(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}function jd(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,u=s.data[f-1];if(u!=0){var h=u*(1<1?s.data[f-2]>>this.F2:0),l=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(x,r)),D.ONE.dlShiftTo(f,x),x.subTo(s,s);s.t=0;){var v=r.data[--p]==u?this.DM:Math.floor(r.data[p]*l+(r.data[p-1]+d)*g);if((r.data[p]+=s.am(0,v,r,y,0,f))0&&r.rShiftTo(c,r),o<0&&D.ZERO.subTo(r,r)}}}function tp(t){var e=ot();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(D.ZERO)>0&&t.subTo(e,e),e}function ur(t){this.m=t}function ep(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function rp(t){return t}function np(t){t.divRemTo(this.m,null,t)}function ip(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function sp(t,e){t.squareTo(e),this.reduce(e)}ur.prototype.convert=ep;ur.prototype.revert=rp;ur.prototype.reduce=np;ur.prototype.mulTo=ip;ur.prototype.sqrTo=sp;function op(){if(this.t<1)return 0;var t=this.data[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function hr(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}function cp(t){var e=ot();return t.copyTo(e),this.reduce(e),e}function fp(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function up(t,e){t.squareTo(e),this.reduce(e)}function hp(t,e,r){t.multiplyTo(e,r),this.reduce(r)}hr.prototype.convert=ap;hr.prototype.revert=cp;hr.prototype.reduce=fp;hr.prototype.mulTo=hp;hr.prototype.sqrTo=up;function lp(){return(this.t>0?this.data[0]&1:this.s)==0}function dp(t,e){if(t>4294967295||t<1)return D.ONE;var r=ot(),n=ot(),i=e.convert(this),s=_i(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,i,r);else{var o=r;r=n,n=o}return e.revert(r)}function pp(t,e){var r;return t<256||e.isEven()?r=new ur(e):r=new hr(e),this.exp(t,r)}D.prototype.copyTo=Kd;D.prototype.fromInt=Od;D.prototype.fromString=Md;D.prototype.clamp=Fd;D.prototype.dlShiftTo=$d;D.prototype.drShiftTo=Wd;D.prototype.lShiftTo=Yd;D.prototype.rShiftTo=Zd;D.prototype.subTo=Xd;D.prototype.multiplyTo=Qd;D.prototype.squareTo=Jd;D.prototype.divRemTo=jd;D.prototype.invDigit=op;D.prototype.isEven=lp;D.prototype.exp=dp;D.prototype.toString=Vd;D.prototype.negate=Hd;D.prototype.abs=qd;D.prototype.compareTo=zd;D.prototype.bitLength=Gd;D.prototype.mod=tp;D.prototype.modPowInt=pp;D.ZERO=Qe(0);D.ONE=Qe(1);function yp(){var t=ot();return this.copyTo(t),t}function gp(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}function mp(){return this.t==0?this.s:this.data[0]<<16>>16}function bp(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function vp(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function wp(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=Qe(r),i=ot(),s=ot(),o="";for(this.divRemTo(n,i,s);i.signum()>0;)o=(r+s.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,s);return s.intValue().toString(t)+o}function Ep(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,s=0,o=0,a=0;a=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(o,0)),i&&D.ZERO.subTo(this,this)}function Sp(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(D.ONE.shiftLeft(t-1),vo,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(D.ONE.shiftLeft(t-1),this);else{var n=new Array,i=t&7;n.length=(t>>3)+1,e.nextBytes(n),i>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function Ap(t){return this.compareTo(t)==0}function Cp(t){return this.compareTo(t)<0?this:t}function Ip(t){return this.compareTo(t)>0?this:t}function Tp(t,e,r){var n,i,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),t&255||(t>>=8,e+=8),t&15||(t>>=4,e+=4),t&3||(t>>=2,e+=2),t&1||++e,e}function Op(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}function Wp(t){var e=ot();return this.addTo(t,e),e}function Yp(t){var e=ot();return this.subTo(t,e),e}function Zp(t){var e=ot();return this.multiplyTo(t,e),e}function Xp(t){var e=ot();return this.divRemTo(t,e,null),e}function Qp(t){var e=ot();return this.divRemTo(t,null,e),e}function Jp(t){var e=ot(),r=ot();return this.divRemTo(t,e,r),new Array(e,r)}function jp(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function ty(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}function Bn(){}function Lc(t){return t}function ey(t,e,r){t.multiplyTo(e,r)}function ry(t,e){t.squareTo(e)}Bn.prototype.convert=Lc;Bn.prototype.revert=Lc;Bn.prototype.mulTo=ey;Bn.prototype.sqrTo=ry;function ny(t){return this.exp(t,new Bn)}function iy(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=ot();return t.copyTo(e),this.reduce(e),e}function ay(t){return t}function cy(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function fy(t,e){t.squareTo(e),this.reduce(e)}function uy(t,e,r){t.multiplyTo(e,r),this.reduce(r)}zr.prototype.convert=oy;zr.prototype.revert=ay;zr.prototype.reduce=cy;zr.prototype.mulTo=uy;zr.prototype.sqrTo=fy;function hy(t,e){var r=t.bitLength(),n,i=Qe(1),s;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new ur(e):e.isEven()?s=new zr(e):s=new hr(e);var o=new Array,a=3,c=n-1,f=(1<1){var u=ot();for(s.sqrTo(o[1],u);a<=f;)o[a]=ot(),s.mulTo(u,o[a-2],o[a]),a+=2}var h=t.t-1,l,g=!0,d=ot(),p;for(r=_i(t.data[h])-1;h>=0;){for(r>=c?l=t.data[h]>>r-c&f:(l=(t.data[h]&(1<0&&(l|=t.data[h-1]>>this.DB+r-c)),a=n;!(l&1);)l>>=1,--a;if((r-=a)<0&&(r+=this.DB,--h),g)o[l].copyTo(i),g=!1;else{for(;a>1;)s.sqrTo(i,d),s.sqrTo(d,i),a-=2;a>0?s.sqrTo(i,d):(p=i,i=d,d=p),s.mulTo(d,o[l],i)}for(;h>=0&&!(t.data[h]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function dy(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}function py(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return D.ZERO;for(var r=t.clone(),n=this.clone(),i=Qe(1),s=Qe(0),o=Qe(0),a=Qe(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!i.isEven()||!s.isEven())&&(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!o.isEven()||!a.isEven())&&(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),s.subTo(a,s)):(n.subTo(r,n),e&&o.subTo(i,o),a.subTo(s,a))}if(n.compareTo(D.ONE)!=0)return D.ZERO;if(a.compareTo(t)>=0)return a.subtract(t);if(a.signum()<0)a.addTo(t,a);else return a;return a.signum()<0?a.add(t):a}var he=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],yy=(1<<26)/he[he.length-1];function gy(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=he[he.length-1]){for(e=0;e=0);var a=s.modPow(n,this);if(a.compareTo(D.ONE)!=0&&a.compareTo(e)!=0){for(var c=1;c++{var me=lt();fr();Ct();var Dc=Pc.exports=me.sha1=me.sha1||{};me.md.sha1=me.md.algorithms.sha1=Dc;Dc.create=function(){kc||by();var t=null,e=me.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),Nc(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=me.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(wo.substr(0,n.blockLength-o));for(var a,c,f=n.fullMessageLength[0]*8,u=0;u>>0,f+=c,i.putInt32(f>>>0),f=a>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};Nc(h,r,i);var l=me.util.createBuffer();return l.putInt32(h.h0),l.putInt32(h.h1),l.putInt32(h.h2),l.putInt32(h.h3),l.putInt32(h.h4),l},n};var wo=null,kc=!1;function by(){wo="\x80",wo+=me.util.fillString("\0",64),kc=!0}function Nc(t,e,r){for(var n,i,s,o,a,c,f,u,h=r.length();h>=64;){for(i=t.h0,s=t.h1,o=t.h2,a=t.h3,c=t.h4,u=0;u<16;++u)n=r.getInt32(),e[u]=n,f=a^s&(o^a),n=(i<<5|i>>>27)+f+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<20;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,f=a^s&(o^a),n=(i<<5|i>>>27)+f+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<32;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<40;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<60;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s&o|a&(s^o),n=(i<<5|i>>>27)+f+c+2400959708+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<80;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+3395469782+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+s|0,t.h2=t.h2+o|0,t.h3=t.h3+a|0,t.h4=t.h4+c|0,h-=64}}});var Mc=ht((km,Oc)=>{var be=lt();Ct();Sn();Uc();var Kc=Oc.exports=be.pkcs1=be.pkcs1||{};Kc.encode_rsa_oaep=function(t,e,r){var n,i,s,o;typeof r=="string"?(n=r,i=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),s?s.start():s=be.md.sha1.create(),o||(o=s);var a=Math.ceil(t.n.bitLength()/8),c=a-2*s.digestLength-2;if(e.length>c){var f=new Error("RSAES-OAEP input message length is too long.");throw f.length=e.length,f.maxLength=c,f}n||(n=""),s.update(n,"raw");for(var u=s.digest(),h="",l=c-e.length,g=0;g>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+o),n+=r.digest().getBytes()}return n.substring(0,e)}});var Fc=ht((Pm,Eo)=>{var Je=lt();Ct();Li();Sn();(function(){if(Je.prime){Eo.exports=Je.prime;return}var t=Eo.exports=Je.prime=Je.prime||{},e=Je.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var i=function(h,l){return h|l};t.generateProbablePrime=function(h,l,g){typeof l=="function"&&(g=l,l={}),l=l||{};var d=l.algorithm||"PRIMEINC";typeof d=="string"&&(d={name:d}),d.options=d.options||{};var p=l.prng||Je.random,y={nextBytes:function(x){for(var v=p.getBytesSync(x.length),m=0;ml&&(h=f(l,g)),h.isProbablePrime(p))return x(null,h);h.dAddOffset(r[d++%8],0)}while(y<0||+new Date-v"u")return o(h,l,g,d);var p=f(h,l),y=g.workers,x=g.workLoad||100,v=x*30/8,m=g.workerScript||"forge/prime.worker.js";if(y===-1)return Je.util.estimateCores(function(S,B){S&&(B=2),y=B-1,A()});A();function A(){y=Math.max(1,y);for(var S=[],B=0;Bh&&(p=f(h,l));var z=p.toString(16);M.target.postMessage({hex:z,workLoad:x}),p.dAddOffset(v,0)}}}}function f(h,l){var g=new e(h,l),d=h-1;return g.testBit(d)||g.bitwiseTo(e.ONE.shiftLeft(d),i,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}function u(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}})()});var Di=ht((Um,Wc)=>{var $=lt();En();Li();xi();Mc();Fc();Sn();Ct();typeof st>"u"&&(st=$.jsbn.BigInteger);var st,So=$.util.isNodejs?Bi():null,E=$.asn1,ne=$.util;$.pki=$.pki||{};Wc.exports=$.pki.rsa=$.rsa=$.rsa||{};var Q=$.pki,vy=[6,4,2,4,2,4,6,2],wy={name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},Ey={name:"RSAPrivateKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},Sy={name:"RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},By=$.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},Ay={name:"DigestInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:E.Class.UNIVERSAL,type:E.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},Cy=function(t){var e;if(t.algorithm in Q.oids)e=Q.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=E.oidToDer(e).getBytes(),i=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]),s=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]);s.value.push(E.create(E.Class.UNIVERSAL,E.Type.OID,!1,n)),s.value.push(E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,""));var o=E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(s),i.value.push(o),E.toDer(i).getBytes()},Gc=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(st.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(st.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new st($.util.bytesToHex($.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(st.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var i=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(s)<0;)i=i.add(e.p);var o=i.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return o=o.multiply(n.modInverse(e.n)).mod(e.n),o};Q.rsa.encrypt=function(t,e,r){var n=r,i,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=$c(t,e,r)):(i=$.util.createBuffer(),i.putBytes(t));for(var o=new st(i.toHex(),16),a=Gc(o,e,n),c=a.toString(16),f=$.util.createBuffer(),u=s-Math.ceil(c.length/2);u>0;)f.putByte(0),--u;return f.putBytes($.util.hexToBytes(c)),f.getBytes()};Q.rsa.decrypt=function(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=i,s}var o=new st($.util.createBuffer(t).toHex(),16);if(o.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var a=Gc(o,e,r),c=a.toString(16),f=$.util.createBuffer(),u=i-Math.ceil(c.length/2);u>0;)f.putByte(0),--u;return f.putBytes($.util.hexToBytes(c)),n!==!1?Ni(f.getBytes(),e,r):f.getBytes()};Q.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||$.random,i={nextBytes:function(a){for(var c=n.getBytesSync(a.length),f=0;f>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+s);return o};Q.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new st(null);r.fromInt(30);for(var n=0,i=function(h,l){return h|l},s=+new Date,o,a=0;t.keys===null&&(e<=0||ac?t.pqState=0:t.num.isProbablePrime(Ty(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(vy[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(st.ONE),t.q1=t.q.subtract(st.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(st.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var u=t.e.modInverse(t.phi);t.keys={privateKey:Q.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Q.rsa.setPublicKey(t.n,t.e)}}o=+new Date,a+=o-s,s=o}return t.keys!==null};Q.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!$.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(Vc("generateKeyPair"))return So.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(a,c,f){if(a)return n(a);n(null,{privateKey:Q.privateKeyFromPem(f),publicKey:Q.publicKeyFromPem(c)})});if(Hc("generateKey")&&Hc("exportKey"))return ne.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:zc(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(a){return ne.globalScope.crypto.subtle.exportKey("pkcs8",a.privateKey)}).then(void 0,function(a){n(a)}).then(function(a){if(a){var c=Q.privateKeyFromAsn1(E.fromDer($.util.createBuffer(a)));n(null,{privateKey:c,publicKey:Q.setRsaPublicKey(c.n,c.e)})}});if(qc("generateKey")&&qc("exportKey")){var i=ne.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:zc(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(a){var c=a.target.result,f=ne.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);f.oncomplete=function(u){var h=u.target.result,l=Q.privateKeyFromAsn1(E.fromDer($.util.createBuffer(h)));n(null,{privateKey:l,publicKey:Q.setRsaPublicKey(l.n,l.e)})},f.onerror=function(u){n(u)}},i.onerror=function(a){n(a)};return}}else if(Vc("generateKeyPairSync")){var s=So.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Q.privateKeyFromPem(s.privateKey),publicKey:Q.publicKeyFromPem(s.publicKey)}}}var o=Q.rsa.createKeyPairGenerationState(t,e,r);if(!n)return Q.rsa.stepKeyPairGenerationState(o,0),o.keys;Iy(o,r,n)};Q.setRsaPublicKey=Q.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,i,s){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(a,c,f){return $c(a,c,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(a,c){return $.pkcs1.encode_rsa_oaep(c,a,s)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(a){return a}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(n,r,!0);return Q.rsa.encrypt(o,r,!0)},r.verify=function(n,i,s,o){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),s==="RSASSA-PKCS1-V1_5"?s={verify:function(c,f){f=Ni(f,r,!0);var u=E.fromDer(f,{parseAllBytes:o._parseAllDigestBytes}),h={},l=[];if(!E.validate(u,Ay,h,l)){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=l,g}var d=E.derToOid(h.algorithmIdentifier);if(!(d===$.oids.md2||d===$.oids.md5||d===$.oids.sha1||d===$.oids.sha224||d===$.oids.sha256||d===$.oids.sha384||d===$.oids.sha512||d===$.oids["sha512-224"]||d===$.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=d,g}if((d===$.oids.md2||d===$.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return c===h.digest}}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:function(c,f){return f=Ni(f,r,!0),c===f}});var a=Q.rsa.decrypt(i,r,!0,!1);return s.verify(n,a,r.n.bitLength())},r};Q.setRsaPrivateKey=Q.rsa.setPrivateKey=function(t,e,r,n,i,s,o,a){var c={n:t,e,d:r,p:n,q:i,dP:s,dQ:o,qInv:a};return c.decrypt=function(f,u,h){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var l=Q.rsa.decrypt(f,c,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:Ni};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(g,d){return $.pkcs1.decode_rsa_oaep(d,g,h)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(g){return g}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(l,c,!1)},c.sign=function(f,u){var h=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:Cy},h=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return f}},h=1);var l=u.encode(f,c.n.bitLength());return Q.rsa.encrypt(l,c,h)},c};Q.wrapRsaPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Q.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,E.toDer(t).getBytes())])};Q.privateKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,wy,e,r)&&(t=E.fromDer($.util.createBuffer(e.privateKey))),e={},r=[],!E.validate(t,Ey,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,s,o,a,c,f,u,h;return i=$.util.createBuffer(e.privateKeyModulus).toHex(),s=$.util.createBuffer(e.privateKeyPublicExponent).toHex(),o=$.util.createBuffer(e.privateKeyPrivateExponent).toHex(),a=$.util.createBuffer(e.privateKeyPrime1).toHex(),c=$.util.createBuffer(e.privateKeyPrime2).toHex(),f=$.util.createBuffer(e.privateKeyExponent1).toHex(),u=$.util.createBuffer(e.privateKeyExponent2).toHex(),h=$.util.createBuffer(e.privateKeyCoefficient).toHex(),Q.setRsaPrivateKey(new st(i,16),new st(s,16),new st(o,16),new st(a,16),new st(c,16),new st(f,16),new st(u,16),new st(h,16))};Q.privateKeyToAsn1=Q.privateKeyToRSAPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,ve(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,ve(t.e)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,ve(t.d)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,ve(t.p)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,ve(t.q)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,ve(t.dP)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,ve(t.dQ)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,ve(t.qInv))])};Q.publicKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,By,e,r)){var n=E.derToOid(e.publicKeyOid);if(n!==Q.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}t=e.rsaPublicKey}if(r=[],!E.validate(t,Sy,e,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var s=$.util.createBuffer(e.publicKeyModulus).toHex(),o=$.util.createBuffer(e.publicKeyExponent).toHex();return Q.setRsaPublicKey(new st(s,16),new st(o,16))};Q.publicKeyToAsn1=Q.publicKeyToSubjectPublicKeyInfo=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Q.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.BITSTRING,!1,[Q.publicKeyToRSAPublicKey(t)])])};Q.publicKeyToRSAPublicKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,ve(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,ve(t.e))])};function $c(t,e,r){var n=$.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=i-11,s}n.putByte(0),n.putByte(r);var o=i-3-t.length,a;if(r===0||r===1){a=r===0?0:255;for(var c=0;c0;){for(var f=0,u=$.random.getBytes(o),c=0;c"u")throw new Error("Encryption block is invalid.");var c=0;if(a===0){c=i-3-n;for(var f=0;f1;){if(s.getByte()!==255){--s.read;break}++c}else if(a===2)for(c=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++c}var u=s.getByte();if(u!==0||c!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function Iy(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),i();function i(){s(t.pBits,function(a,c){if(a)return r(a);if(t.p=c,t.q!==null)return o(a,t.q);s(t.qBits,o)})}function s(a,c){$.prime.generateProbablePrime(a,n,c)}function o(a,c){if(a)return r(a);if(t.q=c,t.p.compareTo(t.q)<0){var f=t.p;t.p=t.q,t.q=f}if(t.p.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)!==0){t.p=null,i();return}if(t.q.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)!==0){t.q=null,s(t.qBits,o);return}if(t.p1=t.p.subtract(st.ONE),t.q1=t.q.subtract(st.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(st.ONE)!==0){t.p=t.q=null,i();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,o);return}var u=t.e.modInverse(t.phi);t.keys={privateKey:Q.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Q.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function ve(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=$.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function Ty(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function Vc(t){return $.util.isNodejs&&typeof So[t]=="function"}function Hc(t){return typeof ne.globalScope<"u"&&typeof ne.globalScope.crypto=="object"&&typeof ne.globalScope.crypto.subtle=="object"&&typeof ne.globalScope.crypto.subtle[t]=="function"}function qc(t){return typeof ne.globalScope<"u"&&typeof ne.globalScope.msCrypto=="object"&&typeof ne.globalScope.msCrypto.subtle=="object"&&typeof ne.globalScope.msCrypto.subtle[t]=="function"}function zc(t){for(var e=$.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{var H=lt();po();En();nc();fr();xi();cc();hc();Sn();Sc();Di();Ct();typeof Yc>"u"&&(Yc=H.jsbn.BigInteger);var Yc,I=H.asn1,tt=H.pki=H.pki||{};Jc.exports=tt.pbe=H.pbe=H.pbe||{};var lr=tt.oids,_y={name:"EncryptedPrivateKeyInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Ly={name:"PBES2Algorithms",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},Ry={name:"pkcs-12PbeParams",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"iterations"}]};tt.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=H.random.getBytesSync(r.saltSize),i=r.count,s=I.integerToDer(i),o,a,c;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var f,u,h;switch(r.algorithm){case"aes128":o=16,f=16,u=lr["aes128-CBC"],h=H.aes.createEncryptionCipher;break;case"aes192":o=24,f=16,u=lr["aes192-CBC"],h=H.aes.createEncryptionCipher;break;case"aes256":o=32,f=16,u=lr["aes256-CBC"],h=H.aes.createEncryptionCipher;break;case"des":o=8,f=8,u=lr.desCBC,h=H.des.createEncryptionCipher;break;default:var l=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw l.algorithm=r.algorithm,l}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),d=Qc(g),p=H.pkcs5.pbkdf2(e,n,i,o,d),y=H.random.getBytesSync(f),x=h(p);x.start(y),x.update(I.toDer(t)),x.finish(),c=x.output.getBytes();var v=Ny(n,s,o,g);a=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(lr.pkcs5PBES2).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(lr.pkcs5PBKDF2).getBytes()),v]),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(u).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,y)])])])}else if(r.algorithm==="3des"){o=24;var m=new H.util.ByteBuffer(n),p=tt.pbe.generatePkcs12Key(e,m,1,i,o),y=tt.pbe.generatePkcs12Key(e,m,2,i,o),x=H.des.createEncryptionCipher(p);x.start(y),x.update(I.toDer(t)),x.finish(),c=x.output.getBytes(),a=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(lr["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,n),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,s.getBytes())])])}else{var l=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw l.algorithm=r.algorithm,l}var A=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[a,I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,c)]);return A};tt.decryptPrivateKeyInfo=function(t,e){var r=null,n={},i=[];if(!I.validate(t,_y,n,i)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=I.derToOid(n.encryptionOid),a=tt.pbe.getCipher(o,n.encryptionParams,e),c=H.util.createBuffer(n.encryptedData);return a.update(c),a.finish()&&(r=I.fromDer(a.output)),r};tt.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:I.toDer(t).getBytes()};return H.pem.encode(r,{maxline:e})};tt.encryptedPrivateKeyFromPem=function(t){var e=H.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return I.fromDer(e.body)};tt.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=tt.wrapRsaPrivateKey(tt.privateKeyToAsn1(t));return n=tt.encryptPrivateKeyInfo(n,e,r),tt.encryptedPrivateKeyToPem(n)}var i,s,o,a;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,s=H.random.getBytesSync(8),a=H.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,s=H.random.getBytesSync(8),a=H.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var f=H.pbe.opensslDeriveBytes(e,s.substr(0,8),o),u=a(f);u.start(s),u.update(I.toDer(tt.privateKeyToAsn1(t))),u.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:H.util.bytesToHex(s).toUpperCase()},body:u.output.getBytes()};return H.pem.encode(h)};tt.decryptRsaPrivateKey=function(t,e){var r=null,n=H.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,o;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,o=H.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,o=H.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,o=H.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,o=H.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,o=H.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,o=function(h){return H.rc2.createDecryptionCipher(h,40)};break;case"RC2-64-CBC":s=8,o=function(h){return H.rc2.createDecryptionCipher(h,64)};break;case"RC2-128-CBC":s=16,o=function(h){return H.rc2.createDecryptionCipher(h,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var a=H.util.hexToBytes(n.dekInfo.parameters),c=H.pbe.opensslDeriveBytes(e,a.substr(0,8),s),f=o(c);if(f.start(a),f.update(H.util.createBuffer(n.body)),f.finish())r=f.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=tt.decryptPrivateKeyInfo(I.fromDer(r),e):r=I.fromDer(r),r!==null&&(r=tt.privateKeyFromAsn1(r)),r};tt.pbe.generatePkcs12Key=function(t,e,r,n,i,s){var o,a;if(typeof s>"u"||s===null){if(!("sha1"in H.md))throw new Error('"sha1" hash algorithm unavailable.');s=H.md.sha1.create()}var c=s.digestLength,f=s.blockLength,u=new H.util.ByteBuffer,h=new H.util.ByteBuffer;if(t!=null){for(a=0;a=0;a--)q=q>>8,q+=_.at(a)+U.at(a),U.setAt(a,q&255);M.putBuffer(U)}m=M,u.putBuffer(B)}return u.truncate(u.length()-i),u};tt.pbe.getCipher=function(t,e,r){switch(t){case tt.oids.pkcs5PBES2:return tt.pbe.getCipherForPBES2(t,e,r);case tt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case tt.oids["pbewithSHAAnd40BitRC2-CBC"]:return tt.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};tt.pbe.getCipherForPBES2=function(t,e,r){var n={},i=[];if(!I.validate(e,Ly,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}if(t=I.derToOid(n.kdfOid),t!==tt.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=I.derToOid(n.encOid),t!==tt.oids["aes128-CBC"]&&t!==tt.oids["aes192-CBC"]&&t!==tt.oids["aes256-CBC"]&&t!==tt.oids["des-EDE3-CBC"]&&t!==tt.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var o=n.kdfSalt,a=H.util.createBuffer(n.kdfIterationCount);a=a.getInt(a.length()<<3);var c,f;switch(tt.oids[t]){case"aes128-CBC":c=16,f=H.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,f=H.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,f=H.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,f=H.des.createDecryptionCipher;break;case"desCBC":c=8,f=H.des.createDecryptionCipher;break}var u=Xc(n.prfOid),h=H.pkcs5.pbkdf2(r,o,a,c,u),l=n.encIv,g=f(h);return g.start(l),g};tt.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},i=[];if(!I.validate(e,Ry,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=H.util.createBuffer(n.salt),a=H.util.createBuffer(n.iterations);a=a.getInt(a.length()<<3);var c,f,u;switch(t){case tt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,f=8,u=H.des.startDecrypting;break;case tt.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,f=8,u=function(p,y){var x=H.rc2.createDecryptionCipher(p,40);return x.start(y,null),x};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=Xc(n.prfOid),l=tt.pbe.generatePkcs12Key(r,o,1,a,c,h);h.start();var g=tt.pbe.generatePkcs12Key(r,o,2,a,f,h);return u(l,g)};tt.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in H.md))throw new Error('"md5" hash algorithm unavailable.');n=H.md.md5.create()}e===null&&(e="");for(var i=[Zc(n,t+e)],s=16,o=1;s{var mt=lt();fr();Ct();var _n=wf.exports=mt.sha512=mt.sha512||{};mt.md.sha512=mt.md.algorithms.sha512=_n;var bf=mt.sha384=mt.sha512.sha384=mt.sha512.sha384||{};bf.create=function(){return _n.create("SHA-384")};mt.md.sha384=mt.md.algorithms.sha384=bf;mt.sha512.sha256=mt.sha512.sha256||{create:function(){return _n.create("SHA-512/256")}};mt.md["sha512/256"]=mt.md.algorithms["sha512/256"]=mt.sha512.sha256;mt.sha512.sha224=mt.sha512.sha224||{create:function(){return _n.create("SHA-512/224")}};mt.md["sha512/224"]=mt.md.algorithms["sha512/224"]=mt.sha512.sha224;_n.create=function(t){if(vf||Yy(),typeof t>"u"&&(t="SHA-512"),!(t in br))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=br[t],r=null,n=mt.util.createBuffer(),i=new Array(80),s=0;s<80;++s)i[s]=new Array(2);var o=64;switch(t){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var a={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength128=[];for(var c=a.messageLengthSize/4,f=0;f>>0,u>>>0];for(var h=a.fullMessageLength.length-1;h>=0;--h)a.fullMessageLength[h]+=u[1],u[1]=u[0]+(a.fullMessageLength[h]/4294967296>>>0),a.fullMessageLength[h]=a.fullMessageLength[h]>>>0,u[0]=u[1]/4294967296>>>0;return n.putBytes(c),mf(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),a},a.digest=function(){var c=mt.util.createBuffer();c.putBytes(n.bytes());var f=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize,u=f&a.blockLength-1;c.putBytes(Fo.substr(0,a.blockLength-u));for(var h,l,g=a.fullMessageLength[0]*8,d=0;d>>0,g+=l,c.putInt32(g>>>0),g=h>>>0;c.putInt32(g);for(var p=new Array(r.length),d=0;d=128;){for(C=0;C<16;++C)e[C][0]=r.getInt32()>>>0,e[C][1]=r.getInt32()>>>0;for(;C<80;++C)L=e[C-2],N=L[0],T=L[1],n=((N>>>19|T<<13)^(T>>>29|N<<3)^N>>>6)>>>0,i=((N<<13|T>>>19)^(T<<3|N>>>29)^(N<<26|T>>>6))>>>0,P=e[C-15],N=P[0],T=P[1],s=((N>>>1|T<<31)^(N>>>8|T<<24)^N>>>7)>>>0,o=((N<<31|T>>>1)^(N<<24|T>>>8)^(N<<25|T>>>7))>>>0,w=e[C-7],K=e[C-16],T=i+w[1]+o+K[1],e[C][0]=n+w[0]+s+K[0]+(T/4294967296>>>0)>>>0,e[C][1]=T>>>0;for(p=t[0][0],y=t[0][1],x=t[1][0],v=t[1][1],m=t[2][0],A=t[2][1],S=t[3][0],B=t[3][1],R=t[4][0],_=t[4][1],O=t[5][0],M=t[5][1],U=t[6][0],q=t[6][1],z=t[7][0],Z=t[7][1],C=0;C<80;++C)f=((R>>>14|_<<18)^(R>>>18|_<<14)^(_>>>9|R<<23))>>>0,u=((R<<18|_>>>14)^(R<<14|_>>>18)^(_<<23|R>>>9))>>>0,h=(U^R&(O^U))>>>0,l=(q^_&(M^q))>>>0,a=((p>>>28|y<<4)^(y>>>2|p<<30)^(y>>>7|p<<25))>>>0,c=((p<<4|y>>>28)^(y<<30|p>>>2)^(y<<25|p>>>7))>>>0,g=(p&x|m&(p^x))>>>0,d=(y&v|A&(y^v))>>>0,T=Z+u+l+Vo[C][1]+e[C][1],n=z+f+h+Vo[C][0]+e[C][0]+(T/4294967296>>>0)>>>0,i=T>>>0,T=c+d,s=a+g+(T/4294967296>>>0)>>>0,o=T>>>0,z=U,Z=q,U=O,q=M,O=R,M=_,T=B+i,R=S+n+(T/4294967296>>>0)>>>0,_=T>>>0,S=m,B=A,m=x,A=v,x=p,v=y,T=i+o,p=n+s+(T/4294967296>>>0)>>>0,y=T>>>0;T=t[0][1]+y,t[0][0]=t[0][0]+p+(T/4294967296>>>0)>>>0,t[0][1]=T>>>0,T=t[1][1]+v,t[1][0]=t[1][0]+x+(T/4294967296>>>0)>>>0,t[1][1]=T>>>0,T=t[2][1]+A,t[2][0]=t[2][0]+m+(T/4294967296>>>0)>>>0,t[2][1]=T>>>0,T=t[3][1]+B,t[3][0]=t[3][0]+S+(T/4294967296>>>0)>>>0,t[3][1]=T>>>0,T=t[4][1]+_,t[4][0]=t[4][0]+R+(T/4294967296>>>0)>>>0,t[4][1]=T>>>0,T=t[5][1]+M,t[5][0]=t[5][0]+O+(T/4294967296>>>0)>>>0,t[5][1]=T>>>0,T=t[6][1]+q,t[6][0]=t[6][0]+U+(T/4294967296>>>0)>>>0,t[6][1]=T>>>0,T=t[7][1]+Z,t[7][0]=t[7][0]+z+(T/4294967296>>>0)>>>0,t[7][1]=T>>>0,V-=128}}});var tu=ht((Cw,jf)=>{var jr=1e3,tn=jr*60,en=tn*60,Sr=en*24,B1=Sr*7,A1=Sr*365.25;jf.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return C1(t);if(r==="number"&&isFinite(t))return e.long?T1(t):I1(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function C1(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*A1;case"weeks":case"week":case"w":return r*B1;case"days":case"day":case"d":return r*Sr;case"hours":case"hour":case"hrs":case"hr":case"h":return r*en;case"minutes":case"minute":case"mins":case"min":case"m":return r*tn;case"seconds":case"second":case"secs":case"sec":case"s":return r*jr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function I1(t){var e=Math.abs(t);return e>=Sr?Math.round(t/Sr)+"d":e>=en?Math.round(t/en)+"h":e>=tn?Math.round(t/tn)+"m":e>=jr?Math.round(t/jr)+"s":t+"ms"}function T1(t){var e=Math.abs(t);return e>=Sr?Vi(t,e,Sr,"day"):e>=en?Vi(t,e,en,"hour"):e>=tn?Vi(t,e,tn,"minute"):e>=jr?Vi(t,e,jr,"second"):t+" ms"}function Vi(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var ru=ht((Iw,eu)=>{function _1(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=tu(),r.destroy=f,Object.keys(t).forEach(u=>{r[u]=t[u]}),r.names=[],r.skips=[],r.formatters={};function e(u){let h=0;for(let l=0;l{if(B==="%%")return"%";A++;let _=r.formatters[R];if(typeof _=="function"){let O=y[A];B=_.call(x,O),y.splice(A,1),A--}return B}),r.formatArgs.call(x,y),(x.log||r.log).apply(x,y)}return p.namespace=u,p.useColors=r.useColors(),p.color=r.selectColor(u),p.extend=n,p.destroy=r.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>l!==null?l:(g!==r.namespaces&&(g=r.namespaces,d=r.enabled(u)),d),set:y=>{l=y}}),typeof r.init=="function"&&r.init(p),p}function n(u,h){let l=r(this.namespace+(typeof h>"u"?":":h)+u);return l.log=this.log,l}function i(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let h,l=(typeof u=="string"?u:"").split(/[\s,]+/),g=l.length;for(h=0;h"-"+h)].join(",");return r.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let h,l;for(h=0,l=r.skips.length;h{Jt.formatArgs=R1;Jt.save=N1;Jt.load=D1;Jt.useColors=L1;Jt.storage=k1();Jt.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Jt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function L1(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function R1(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Hi.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}Jt.log=console.debug||console.log||(()=>{});function N1(t){try{t?Jt.storage.setItem("debug",t):Jt.storage.removeItem("debug")}catch{}}function D1(){let t;try{t=Jt.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function k1(){try{return localStorage}catch{}}Hi.exports=ru()(Jt);var{formatters:P1}=Hi.exports;P1.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var V1={};Lt(V1,{noise:()=>F1,pureJsCrypto:()=>di});function Me(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function rt(t=0){return globalThis.Buffer?.alloc!=null?Me(globalThis.Buffer.alloc(t)):new Uint8Array(t)}function Tt(t=0){return globalThis.Buffer?.allocUnsafe!=null?Me(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}var Su=Math.pow(2,7),Bu=Math.pow(2,14),Au=Math.pow(2,21),Zi=Math.pow(2,28),Xi=Math.pow(2,35),Qi=Math.pow(2,42),Ji=Math.pow(2,49),ct=128,Ht=127;function Be(t){if(tNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Cu(t,e,r=0){switch(Be(t)){case 8:e[r++]=t&255|ct,t/=128;case 7:e[r++]=t&255|ct,t/=128;case 6:e[r++]=t&255|ct,t/=128;case 5:e[r++]=t&255|ct,t/=128;case 4:e[r++]=t&255|ct,t>>>=7;case 3:e[r++]=t&255|ct,t>>>=7;case 2:e[r++]=t&255|ct,t>>>=7;case 1:{e[r++]=t&255,t>>>=7;break}default:throw new Error("unreachable")}return e}function Iu(t,e,r=0){switch(Be(t)){case 8:e.set(r++,t&255|ct),t/=128;case 7:e.set(r++,t&255|ct),t/=128;case 6:e.set(r++,t&255|ct),t/=128;case 5:e.set(r++,t&255|ct),t/=128;case 4:e.set(r++,t&255|ct),t>>>=7;case 3:e.set(r++,t&255|ct),t>>>=7;case 2:e.set(r++,t&255|ct),t>>>=7;case 1:{e.set(r++,t&255),t>>>=7;break}default:throw new Error("unreachable")}return e}function Tu(t,e){let r=t[e],n=0;if(n+=r&Ht,ri+s.length,0));let r=Tt(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return Me(r)}function Rt(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let r=0;for(let n of e)if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.push(n);else if(Fn(n))r+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}prepend(...e){this.prependAll(e)}prependAll(e){let r=0;for(let n of e.reverse())if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.unshift(n);else if(Fn(n))r+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}get(e){let r=da(this.bufs,e);return r.buf[r.index]}set(e,r){let n=da(this.bufs,e);n.buf[n.index]=r}write(e,r=0){if(e instanceof Uint8Array)for(let n=0;n0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,r){let{bufs:n,length:i}=this._subList(e,r);return Bt(n,i)}subarray(e,r){let{bufs:n,length:i}=this._subList(e,r);return n.length===1?n[0]:Bt(n,i)}sublist(e,r){let{bufs:n,length:i}=this._subList(e,r),s=new t;return s.length=i,s.bufs=n,s}_subList(e,r){if(e=e??0,r=r??this.length,e<0&&(e=this.length+e),r<0&&(r=this.length+r),e<0||r>this.length)throw new RangeError("index is out of bounds");if(e===r)return{bufs:[],length:0};if(e===0&&r===this.length)return{bufs:[...this.bufs],length:this.length};let n=[],i=0;for(let s=0;s=c)continue;let f=e>=a&&ea&&r<=c;if(f&&u){if(e===a&&r===c){n.push(o);break}let h=e-a;n.push(o.subarray(h,h+(r-e)));break}if(f){if(e===0){n.push(o);continue}n.push(o.subarray(e-a));continue}if(u){if(r===c){n.push(o);break}n.push(o.subarray(0,r-a));break}n.push(o)}return{bufs:n,length:r-e}}indexOf(e,r=0){if(!Fn(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(r=Number(r??0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),e.length===0)return r>this.length?this.length:r;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let s=256,o=new Int32Array(s);for(let h=0;h=0;l--){let g=this.get(h+l);if(n[l]!==g){u=Math.max(1,l-a[g]);break}}if(u===0)return h}return-1}getInt8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt8(0)}setInt8(e,r){let n=Tt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,r),this.write(n,e)}getInt16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,r)}setInt16(e,r,n){let i=rt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,r,n),this.write(i,e)}getInt32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,r)}setInt32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,r,n),this.write(i,e)}getBigInt64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,r)}setBigInt64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,r,n),this.write(i,e)}getUint8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint8(0)}setUint8(e,r){let n=Tt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,r),this.write(n,e)}getUint16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,r)}setUint16(e,r,n){let i=rt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,r,n),this.write(i,e)}getUint32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,r)}setUint32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,r,n),this.write(i,e)}getBigUint64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,r)}setBigUint64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,r,n),this.write(i,e)}getFloat32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,r)}setFloat32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,r,n),this.write(i,e)}getFloat64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,r)}setFloat64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,r,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof t)||e.bufs.length!==this.bufs.length)return!1;for(let r=0;ri+s.byteLength,0)),n.length=r,n}};function Vn(t){return t[Symbol.asyncIterator]!=null}var Hn=t=>{let e=Be(t),r=Tt(e);return la(t,r),Hn.bytes=e,r};Hn.bytes=0;function nn(t,e){e=e??{};let r=e.lengthEncoder??Hn;function*n(i){let s=r(i.byteLength);s instanceof Uint8Array?yield s:yield*s,i instanceof Uint8Array?yield i:yield*i}return Vn(t)?async function*(){for await(let i of t)yield*n(i)}():function*(){for(let i of t)yield*n(i)}()}nn.single=(t,e)=>{e=e??{};let r=e.lengthEncoder??Hn;return new te(r(t.byteLength),t)};var Br=zt(xa(),1);var Ru=8,Nu=1024*1024*4,er;(function(t){t[t.LENGTH=0]="LENGTH",t[t.DATA=1]="DATA"})(er||(er={}));var ts=t=>{let e=Mn(t);return ts.bytes=Be(e),e};ts.bytes=0;function sn(t,e){let r=new te,n=er.LENGTH,i=-1,s=e?.lengthDecoder??ts,o=e?.maxLengthLength??Ru,a=e?.maxDataLength??Nu;function*c(){for(;r.byteLength>0;){if(n===er.LENGTH)try{if(i=s(r),i<0)throw(0,Br.default)(new Error("invalid message length"),"ERR_INVALID_MSG_LENGTH");if(i>a)throw(0,Br.default)(new Error("message length too long"),"ERR_MSG_DATA_TOO_LONG");let f=s.bytes;r.consume(f),e?.onLength!=null&&e.onLength(i),n=er.DATA}catch(f){if(f instanceof RangeError){if(r.byteLength>o)throw(0,Br.default)(new Error("message length length too long"),"ERR_MSG_LENGTH_TOO_LONG");break}throw f}if(n===er.DATA){if(r.byteLength0)throw(0,Br.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}():function*(){for(let f of t)r.append(f),yield*c();if(r.byteLength>0)throw(0,Br.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}()}sn.fromReader=(t,e)=>{let r=1,n=async function*(){for(;;)try{let{done:s,value:o}=await t.next(r);if(s===!0)return;o!=null&&(yield o)}catch(s){if(s.code==="ERR_UNDER_READ")return{done:!0,value:null};throw s}finally{r=1}}();return sn(n,{...e??{},onLength:s=>{r=s}})};function oe(){let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}var qn=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=r??"ABORT_ERR"}};async function ma(t,e,r){if(e==null)return t;if(e.aborted)return Promise.reject(new qn(r?.errorMessage,r?.errorCode));let n,i=new qn(r?.errorMessage,r?.errorCode);try{return await Promise.race([t,new Promise((s,o)=>{n=()=>{o(i)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var es=class{needNext;haveNext;ended;nextResult;constructor(){this.ended=!1,this.needNext=oe(),this.needNext.resolve(),this.haveNext=oe()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("Have next but next was undefined");let e=this.nextResult;return this.nextResult=void 0,this.needNext.resolve(),this.needNext=oe(),e}async throw(e){return this.ended=!0,e!=null&&this.haveNext.reject(e),{done:!0,value:void 0}}async return(){let e={done:!0,value:void 0};return await this._push(void 0),e}async push(e,r){await this._push(e,r)}async end(e,r){e!=null?await this.throw(e):await this._push(void 0,r)}async _push(e,r){if(e!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");this.nextResult!=null&&await this.needNext.promise,e!=null?this.nextResult={done:!1,value:e}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=oe(),await ma(this.needNext.promise,r?.signal,r)}};function ba(){return new es}var zn=class extends Error{code;constructor(e,r){super(e),this.code=r}},rs=class extends zn{type;constructor(e){super(e,"ABORT_ERR"),this.type="aborted"}};function va(t,e){let r=ba();t.sink(r).catch(async o=>{await r.end(o)}),t.sink=async o=>{for await(let a of o)await r.push(a);await r.end()};let n=t.source;t.source[Symbol.iterator]!=null?n=t.source[Symbol.iterator]():t.source[Symbol.asyncIterator]!=null&&(n=t.source[Symbol.asyncIterator]());let i=new te;return{read:async(o,a)=>{a?.signal?.throwIfAborted();let c,f=new Promise((u,h)=>{c=()=>{h(new rs("Read aborted"))},a?.signal?.addEventListener("abort",c)});try{if(o==null){let{done:h,value:l}=await Promise.race([n.next(),f]);return h===!0?new te:l}for(;i.byteLength{a?.signal?.throwIfAborted(),o instanceof Uint8Array?await r.push(o,a):await r.push(o.subarray(),a)},unwrap:()=>{if(i.byteLength>0){let o=t.source;t.source=async function*(){e?.yieldBytes===!1?yield i:yield*i,yield*o}()}return t}}}var Gn=class extends Error{code;constructor(e,r){super(e),this.code=r}},wa=t=>Mn(t);wa.bytes=0;function ns(t,e={}){let r=va(t,e);return e.maxDataLength!=null&&e.maxLengthLength==null&&(e.maxLengthLength=Be(e.maxDataLength)),{read:async i=>{let s=-1,o=new te,a=e?.lengthDecoder??wa;for(;;){o.append(await r.read(1,i));try{s=a(o)}catch(c){if(c instanceof RangeError)continue;throw c}if(e?.maxLengthLength!=null&&o.byteLength>e.maxLengthLength)throw new Gn("message length length too long","ERR_MSG_LENGTH_TOO_LONG");if(s>-1)break}if(e?.maxDataLength!=null&&s>e.maxDataLength)throw new Gn("message length too long","ERR_MSG_DATA_TOO_LONG");return r.read(s,i)},write:async(i,s)=>{await r.write(nn.single(i,e),s)},writeV:async(i,s)=>{let o=new te(...i.map(a=>nn.single(a,e)));await r.write(o,s)},unwrap:()=>r.unwrap()}}function is(){let t=oe(),e=!1;return{sink:async r=>{if(e)throw new Error("already piped");e=!0,t.resolve(r)},source:async function*(){yield*await t.promise}()}}function Ea(){let t=is(),e=is();return[{source:t.source,sink:e.sink},{source:e.source,sink:t.sink}]}var $n=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},Ar=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new $n(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let r=this.head;this.head=r.next=new $n(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var ss=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function Wn(t={}){return ku(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},t)}function ku(t,e){e=e??{};let r=e.onEnd,n=new Ar,i,s,o,a=oe(),c=async()=>{try{return n.isEmpty()?o?{done:!0}:await new Promise((y,x)=>{s=v=>{s=null,n.push(v);try{y(t(n))}catch(m){x(m)}return i}}):t(n)}finally{n.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=oe()})}},f=y=>s!=null?s(y):(n.push(y),i),u=y=>(n=new Ar,s!=null?s({error:y}):(n.push({error:y}),i)),h=y=>{if(o)return i;if(e?.objectMode!==!0&&y?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return f({done:!1,value:y})},l=y=>o?i:(o=!0,y!=null?u(y):f({done:!0})),g=()=>(n=new Ar,l(),{done:!0}),d=y=>(l(y),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:c,return:g,throw:d,push:h,end:l,get readableLength(){return n.size},onEmpty:async y=>{let x=y?.signal;if(x?.throwIfAborted(),n.isEmpty())return;let v,m;x!=null&&(v=new Promise((A,S)=>{m=()=>{S(new ss)},x.addEventListener("abort",m)}));try{await Promise.race([a.promise,v])}finally{m!=null&&x!=null&&x?.removeEventListener("abort",m)}}},r==null)return i;let p=i;return i={[Symbol.asyncIterator](){return this},next(){return p.next()},throw(y){return p.throw(y),r!=null&&(r(y),r=void 0),{done:!0}},return(){return p.return(),r!=null&&(r(),r=void 0),{done:!0}},push:h,end(y){return p.end(y),r!=null&&(r(y),r=void 0),i},get readableLength(){return p.readableLength},onEmpty:y=>p.onEmpty(y)},i}function Pu(t){return t[Symbol.asyncIterator]!=null}function Uu(...t){let e=[];for(let r of t)Pu(r)||e.push(r);return e.length===t.length?function*(){for(let r of e)yield*r}():async function*(){let r=Wn({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(t.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var Sa=Uu;function Ba(t,...e){if(t==null)throw new Error("Empty pipeline");if(os(t)){let n=t;t=()=>n.source}else if(Ca(t)||Aa(t)){let n=t;t=()=>n}let r=[t,...e];if(r.length>1&&os(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n{let e;for(;t.length>0;)e=t.shift()(e);return e},Aa=t=>t?.[Symbol.asyncIterator]!=null,Ca=t=>t?.[Symbol.iterator]!=null,os=t=>t==null?!1:t.sink!=null&&t.source!=null,Ou=t=>e=>{let r=t.sink(e);if(r?.then!=null){let n=Wn({objectMode:!0});r.then(()=>{n.end()},o=>{n.end(o)});let i,s=t.source;if(Aa(s))i=async function*(){yield*s,n.end()};else if(Ca(s))i=function*(){yield*s,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return Sa(n,i())}return t.source};var Ia=!!globalThis.process?.env?.DUMP_SESSION_KEYS;var Mu=t=>t instanceof Uint8Array;var Ae=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Ta=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Fu=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Fu)throw new Error("Non little-endian hardware is not supported");function Yn(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Zn(t){if(typeof t=="string")t=Yn(t);else if(Mu(t))t=t.slice();else throw new Error(`expected Uint8Array, got ${typeof t}`);return t}var Vu=t=>Object.prototype.toString.call(t)==="[object Object]"&&t.constructor===Object;function _a(t,e){if(e!==void 0&&(typeof e!="object"||!Vu(e)))throw new Error("options must be object or undefined");return Object.assign(t,e)}function rr(t,e){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");if(typeof e=="number"&&t.length!==e)throw new Error(`Uint8Array length ${e} expected`)}function La(t,e){if(t.length!==e.length)throw new Error("equalBytes: Different size of Uint8Arrays");let r=!0;for(let n=0;n(Object.assign(e,t),e);function cs(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,f=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+f,a,n)}function Xn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function fs(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function Cr(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function us(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ra(t,e){Cr(t);let r=e.outputLen;if(t.lengtht[e++]&255|(t[e++]&255)<<8,hs=class{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=Zn(e),rr(e,32);let r=Ot(e,0),n=Ot(e,2),i=Ot(e,4),s=Ot(e,6),o=Ot(e,8),a=Ot(e,10),c=Ot(e,12),f=Ot(e,14);this.r[0]=r&8191,this.r[1]=(r>>>13|n<<3)&8191,this.r[2]=(n>>>10|i<<6)&7939,this.r[3]=(i>>>7|s<<9)&8191,this.r[4]=(s>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|f<<8)&8191,this.r[9]=f>>>5&127;for(let u=0;u<8;u++)this.pad[u]=Ot(e,16+2*u)}process(e,r,n=!1){let i=n?0:2048,{h:s,r:o}=this,a=o[0],c=o[1],f=o[2],u=o[3],h=o[4],l=o[5],g=o[6],d=o[7],p=o[8],y=o[9],x=Ot(e,r+0),v=Ot(e,r+2),m=Ot(e,r+4),A=Ot(e,r+6),S=Ot(e,r+8),B=Ot(e,r+10),R=Ot(e,r+12),_=Ot(e,r+14),O=s[0]+(x&8191),M=s[1]+((x>>>13|v<<3)&8191),U=s[2]+((v>>>10|m<<6)&8191),q=s[3]+((m>>>7|A<<9)&8191),z=s[4]+((A>>>4|S<<12)&8191),Z=s[5]+(S>>>1&8191),C=s[6]+((S>>>14|B<<2)&8191),N=s[7]+((B>>>11|R<<5)&8191),T=s[8]+((R>>>8|_<<8)&8191),L=s[9]+(_>>>5|i),w=0,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V,s[3]=W,s[4]=Y,s[5]=et,s[6]=X,s[7]=J,s[8]=dt,s[9]=ut}finalize(){let{h:e,pad:r}=this,n=new Uint16Array(10),i=e[1]>>>13;e[1]&=8191;for(let a=2;a<10;a++)e[a]+=i,i=e[a]>>>13,e[a]&=8191;e[0]+=i*5,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,n[0]=e[0]+5,i=n[0]>>>13,n[0]&=8191;for(let a=1;a<10;a++)n[a]=e[a]+i,i=n[a]>>>13,n[a]&=8191;n[9]-=8192;let s=(i^1)-1;for(let a=0;a<10;a++)n[a]&=s;s=~s;for(let a=0;a<10;a++)e[a]=e[a]&s|n[a];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let o=e[0]+r[0];e[0]=o&65535;for(let a=1;a<8;a++)o=(e[a]+r[a]|0)+(o>>>16)|0,e[a]=o&65535}update(e){us(this);let{buffer:r,blockLen:n}=this;e=Zn(e);let i=e.length;for(let s=0;s>>0,e[s++]=n[o]>>>8;return e}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}};function Hu(t){let e=(n,i)=>t(i).update(Zn(n)).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}var Na=Hu(t=>new hs(t));var qu=Yn("expand 16-byte k"),zu=Yn("expand 32-byte k"),Gu=Ae(qu),$u=Ae(zu);function G(t,e){return t<>>32-e}function ls(t){return t.byteOffset%4===0}var Qn=64,Wu=16,ka=2**32-1,Da=new Uint32Array;function Yu(t,e,r,n,i,s,o,a){let c=i.length,f=new Uint8Array(Qn),u=Ae(f),h=ls(i)&&ls(s),l=h?Ae(i):Da,g=h?Ae(s):Da;for(let d=0;d=ka)throw new Error("arx: counter overflow");let p=Math.min(Qn,c-d);if(h&&p===Qn){let y=d/4;if(d%4!==0)throw new Error("arx: invalid block position");for(let x=0,v;x{Cr(a),Cr(c),Cr(f);let l=f.length;if(u||(u=new Uint8Array(l)),Cr(u),Xn(h),h<0||h>=ka)throw new Error("arx: counter overflow");if(u.length0;)g.pop().fill(0);return u}}function Ka(t,e,r,n,i,s=20){let o=t[0],a=t[1],c=t[2],f=t[3],u=e[0],h=e[1],l=e[2],g=e[3],d=e[4],p=e[5],y=e[6],x=e[7],v=i,m=r[0],A=r[1],S=r[2],B=o,R=a,_=c,O=f,M=u,U=h,q=l,z=g,Z=d,C=p,N=y,T=x,L=v,w=m,P=A,K=S;for(let W=0;W{t.update(e);let r=e.length%16;r&&t.update(Ju.subarray(r))},ju=new Uint8Array(32);function Ua(t,e,r,n,i){let s=t(e,r,ju),o=Na.create(s);i&&Pa(o,i),Pa(o,n);let a=new Uint8Array(16),c=Ta(a);cs(c,0,BigInt(i?i.length:0),!0),cs(c,8,BigInt(n.length),!0),o.update(a);let f=o.digest();return s.fill(0),f}var Oa=t=>(e,r,n)=>(rr(e,32),rr(r),{encrypt:(s,o)=>{let a=s.length,c=a+16;o?rr(o,c):o=new Uint8Array(c),t(e,r,s,o,1);let f=Ua(t,e,r,o.subarray(0,-16),n);return o.set(f,a),o},decrypt:(s,o)=>{let a=s.length,c=a-16;if(a<16)throw new Error("encrypted data must be at least 16 bytes");o?rr(o,c):o=new Uint8Array(c);let f=s.subarray(0,-16),u=s.subarray(-16),h=Ua(t,e,r,f,n);if(!La(u,h))throw new Error("invalid tag");return t(e,r,f,o,1),o}}),ps=as({blockSize:64,nonceLength:12,tagLength:16},Oa(Xu)),Zg=as({blockSize:64,nonceLength:24,tagLength:16},Oa(Qu));function Jn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function ys(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function on(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Jn(t.outputLen),Jn(t.blockLen)}function Ir(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ma(t,e){ys(t);let r=e.outputLen;if(t.lengtht instanceof Uint8Array;var ti=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ae=(t,e)=>t<<32-e|t>>>e,th=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!th)throw new Error("Non little-endian hardware is not supported");function gs(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Fe(t){if(typeof t=="string"&&(t=gs(t)),!Fa(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function ei(...t){let e=new Uint8Array(t.reduce((n,i)=>n+i.length,0)),r=0;return t.forEach(n=>{if(!Fa(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}var Tr=class{clone(){return this._cloneInto()}},tx={}.toString;function ri(t){let e=n=>t().update(Fe(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function nr(t=32){if(jn&&typeof jn.getRandomValues=="function")return jn.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function eh(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,f=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+f,a,n)}var _r=class extends Tr{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ti(this.buffer)}update(e){Ir(this);let{view:r,buffer:n,blockLen:i}=this;e=Fe(e);let s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let h=o;hu.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h>xs&ni)}:{h:Number(t>>xs&ni)|0,l:Number(t&ni)|0}}function rh(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),ih=(t,e,r)=>t>>>r,sh=(t,e,r)=>t<<32-r|e>>>r,oh=(t,e,r)=>t>>>r|e<<32-r,ah=(t,e,r)=>t<<32-r|e>>>r,ch=(t,e,r)=>t<<64-r|e>>>r-32,fh=(t,e,r)=>t>>>r-32|e<<64-r,uh=(t,e)=>e,hh=(t,e)=>t,lh=(t,e,r)=>t<>>32-r,dh=(t,e,r)=>e<>>32-r,ph=(t,e,r)=>e<>>64-r,yh=(t,e,r)=>t<>>64-r;function gh(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var xh=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),mh=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,bh=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),vh=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,wh=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Eh=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0;var Sh={fromBig:Va,split:rh,toBig:nh,shrSH:ih,shrSL:sh,rotrSH:oh,rotrSL:ah,rotrBH:ch,rotrBL:fh,rotr32H:uh,rotr32L:hh,rotlSH:lh,rotlSL:dh,rotlBH:ph,rotlBL:yh,add:gh,add3L:xh,add3H:mh,add4L:bh,add4H:vh,add5H:Eh,add5L:wh},j=Sh;var[Bh,Ah]=j.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Ve=new Uint32Array(80),He=new Uint32Array(80),ms=class extends _r{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:f,El:u,Fh:h,Fl:l,Gh:g,Gl:d,Hh:p,Hl:y}=this;return[e,r,n,i,s,o,a,c,f,u,h,l,g,d,p,y]}set(e,r,n,i,s,o,a,c,f,u,h,l,g,d,p,y){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=f|0,this.El=u|0,this.Fh=h|0,this.Fl=l|0,this.Gh=g|0,this.Gl=d|0,this.Hh=p|0,this.Hl=y|0}process(e,r){for(let m=0;m<16;m++,r+=4)Ve[m]=e.getUint32(r),He[m]=e.getUint32(r+=4);for(let m=16;m<80;m++){let A=Ve[m-15]|0,S=He[m-15]|0,B=j.rotrSH(A,S,1)^j.rotrSH(A,S,8)^j.shrSH(A,S,7),R=j.rotrSL(A,S,1)^j.rotrSL(A,S,8)^j.shrSL(A,S,7),_=Ve[m-2]|0,O=He[m-2]|0,M=j.rotrSH(_,O,19)^j.rotrBH(_,O,61)^j.shrSH(_,O,6),U=j.rotrSL(_,O,19)^j.rotrBL(_,O,61)^j.shrSL(_,O,6),q=j.add4L(R,U,He[m-7],He[m-16]),z=j.add4H(q,B,M,Ve[m-7],Ve[m-16]);Ve[m]=z|0,He[m]=q|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:f,Dl:u,Eh:h,El:l,Fh:g,Fl:d,Gh:p,Gl:y,Hh:x,Hl:v}=this;for(let m=0;m<80;m++){let A=j.rotrSH(h,l,14)^j.rotrSH(h,l,18)^j.rotrBH(h,l,41),S=j.rotrSL(h,l,14)^j.rotrSL(h,l,18)^j.rotrBL(h,l,41),B=h&g^~h&p,R=l&d^~l&y,_=j.add5L(v,S,R,Ah[m],He[m]),O=j.add5H(_,x,A,B,Bh[m],Ve[m]),M=_|0,U=j.rotrSH(n,i,28)^j.rotrBH(n,i,34)^j.rotrBH(n,i,39),q=j.rotrSL(n,i,28)^j.rotrBL(n,i,34)^j.rotrBL(n,i,39),z=n&s^n&a^s&a,Z=i&o^i&c^o&c;x=p|0,v=y|0,p=g|0,y=d|0,g=h|0,d=l|0,{h,l}=j.add(f|0,u|0,O|0,M|0),f=a|0,u=c|0,a=s|0,c=o|0,s=n|0,o=i|0;let C=j.add3L(M,q,Z);n=j.add3H(C,O,U,z),i=C|0}({h:n,l:i}=j.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=j.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=j.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:f,l:u}=j.add(this.Dh|0,this.Dl|0,f|0,u|0),{h,l}=j.add(this.Eh|0,this.El|0,h|0,l|0),{h:g,l:d}=j.add(this.Fh|0,this.Fl|0,g|0,d|0),{h:p,l:y}=j.add(this.Gh|0,this.Gl|0,p|0,y|0),{h:x,l:v}=j.add(this.Hh|0,this.Hl|0,x|0,v|0),this.set(n,i,s,o,a,c,f,u,h,l,g,d,p,y,x,v)}roundClean(){Ve.fill(0),He.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var bs=ri(()=>new ms);var oi={};Lt(oi,{bitGet:()=>Nh,bitLen:()=>Rh,bitMask:()=>an,bitSet:()=>Dh,bytesToHex:()=>Ce,bytesToNumberBE:()=>Ie,bytesToNumberLE:()=>ce,concatBytes:()=>_e,createHmacDrbg:()=>Es,ensureBytes:()=>yt,equalBytes:()=>_h,hexToBytes:()=>ir,hexToNumber:()=>ws,numberToBytesBE:()=>qe,numberToBytesLE:()=>Te,numberToHexUnpadded:()=>za,numberToVarBytesBE:()=>Th,utf8ToBytes:()=>Lh,validateObject:()=>ee});var qa=BigInt(0),ii=BigInt(1),Ch=BigInt(2),si=t=>t instanceof Uint8Array,Ih=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Ce(t){if(!si(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0)),r=0;return t.forEach(n=>{if(!si(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function _h(t,e){if(t.length!==e.length)return!1;for(let r=0;rqa;t>>=ii,e+=1);return e}function Nh(t,e){return t>>BigInt(e)&ii}var Dh=(t,e,r)=>t|(r?ii:qa)<(Ch<new Uint8Array(t),Ha=t=>Uint8Array.from(t);function Es(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=vs(t),i=vs(t),s=0,o=()=>{n.fill(1),i.fill(0),s=0},a=(...h)=>r(i,n,...h),c=(h=vs())=>{i=a(Ha([0]),h),n=a(),h.length!==0&&(i=a(Ha([1]),h),n=a())},f=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let h=0,l=[];for(;h{o(),c(h);let g;for(;!(g=l(f()));)c();return o(),g}}var kh={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function ee(t,e,r={}){let n=(i,s,o)=>{let a=kh[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);let c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(let[i,s]of Object.entries(e))n(i,s,!1);for(let[i,s]of Object.entries(r))n(i,s,!0);return t}var _t=BigInt(0),bt=BigInt(1),sr=BigInt(2),Ph=BigInt(3),Ss=BigInt(4),Ga=BigInt(5),$a=BigInt(8),Uh=BigInt(9),Kh=BigInt(16);function at(t,e){let r=t%e;return r>=_t?r:e+r}function Bs(t,e,r){if(r<=_t||e<_t)throw new Error("Expected power/modulo > 0");if(r===bt)return _t;let n=bt;for(;e>_t;)e&bt&&(n=n*t%r),t=t*t%r,e>>=bt;return n}function gt(t,e,r){let n=t;for(;e-- >_t;)n*=n,n%=r;return n}function ai(t,e){if(t===_t||e<=_t)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=at(t,e),n=e,i=_t,s=bt,o=bt,a=_t;for(;r!==_t;){let f=n/r,u=n%r,h=i-o*f,l=s-a*f;n=r,r=u,i=o,s=a,o=h,a=l}if(n!==bt)throw new Error("invert: does not exist");return at(i,e)}function Oh(t){let e=(t-bt)/sr,r,n,i;for(r=t-bt,n=0;r%sr===_t;r/=sr,n++);for(i=sr;i(at(t,e)&bt)===bt,Fh=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function As(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Fh.reduce((n,i)=>(n[i]="function",n),e);return ee(t,r)}function Vh(t,e,r){if(r<_t)throw new Error("Expected power > 0");if(r===_t)return t.ONE;if(r===bt)return e;let n=t.ONE,i=e;for(;r>_t;)r&bt&&(n=t.mul(n,i)),i=t.sqr(i),r>>=bt;return n}function Hh(t,e){let r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function Cs(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function ci(t,e,r=!1,n={}){if(t<=_t)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:s}=Cs(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=Mh(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:an(i),ZERO:_t,ONE:bt,create:c=>at(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return _t<=c&&cc===_t,isOdd:c=>(c&bt)===bt,neg:c=>at(-c,t),eql:(c,f)=>c===f,sqr:c=>at(c*c,t),add:(c,f)=>at(c+f,t),sub:(c,f)=>at(c-f,t),mul:(c,f)=>at(c*f,t),pow:(c,f)=>Vh(a,c,f),div:(c,f)=>at(c*ai(f,t),t),sqrN:c=>c*c,addN:(c,f)=>c+f,subN:(c,f)=>c-f,mulN:(c,f)=>c*f,inv:c=>ai(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>Hh(a,c),cmov:(c,f,u)=>u?f:c,toBytes:c=>r?Te(c,s):qe(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?ce(c):Ie(c)}});return Object.freeze(a)}function Ya(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}function Za(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function Is(t){let e=Za(t);return e+Math.ceil(e/2)}function Xa(t,e,r=!1){let n=t.length,i=Za(e),s=Is(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let o=r?Ie(t):ce(t),a=at(o,e-bt)+bt;return r?Te(a,i):qe(a,i)}var zh=BigInt(0),Ts=BigInt(1);function fi(t,e){let r=(i,s)=>{let o=s.negate();return i?o:s},n=i=>{let s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>zh;)s&Ts&&(o=o.add(a)),a=a.double(),s>>=Ts;return o},precomputeWindow(i,s){let{windows:o,windowSize:a}=n(s),c=[],f=i,u=f;for(let h=0;h>=g,y>c&&(y-=l,o+=Ts);let x=p,v=p+Math.abs(y)-1,m=d%2!==0,A=y<0;y===0?u=u.add(r(m,s[x])):f=f.add(r(A,s[v]))}return{p:f,f:u}},wNAFCached(i,s,o,a){let c=i._WINDOW_SIZE||1,f=s.get(i);return f||(f=this.precomputeWindow(i,c),c!==1&&s.set(i,a(f))),this.wNAF(c,f,o)}}}function cn(t){return As(t.Fp),ee(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Cs(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var fe=BigInt(0),Xt=BigInt(1),ui=BigInt(2),Gh=BigInt(8),$h={zip215:!0};function Wh(t){let e=cn(t);return ee(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function hi(t){let e=Wh(t),{Fp:r,n,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,f=ui<{try{return{isValid:!0,value:r.sqrt(L*r.inv(w))}}catch{return{isValid:!1,value:fe}}}),l=e.adjustScalarBytes||(L=>L),g=e.domain||((L,w,P)=>{if(w.length||P)throw new Error("Contexts/pre-hash are not supported");return L}),d=L=>typeof L=="bigint"&&fed(L)&&d(w)&&LL===fe||p(L,f);function x(L,w){if(p(L,w))return L;throw new Error(`Expected valid scalar < ${w}, got ${typeof L} ${L}`)}function v(L){return L===fe?L:x(L,n)}let m=new Map;function A(L){if(!(L instanceof S))throw new Error("ExtendedPoint expected")}class S{constructor(w,P,K,V){if(this.ex=w,this.ey=P,this.ez=K,this.et=V,!y(w))throw new Error("x required");if(!y(P))throw new Error("y required");if(!y(K))throw new Error("z required");if(!y(V))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(w){if(w instanceof S)throw new Error("extended point not allowed");let{x:P,y:K}=w||{};if(!y(P)||!y(K))throw new Error("invalid affine point");return new S(P,K,Xt,u(P*K))}static normalizeZ(w){let P=r.invertBatch(w.map(K=>K.ez));return w.map((K,V)=>K.toAffine(P[V])).map(S.fromAffine)}_setWindowSize(w){this._WINDOW_SIZE=w,m.delete(this)}assertValidity(){let{a:w,d:P}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:K,ey:V,ez:W,et:Y}=this,et=u(K*K),X=u(V*V),J=u(W*W),dt=u(J*J),ut=u(et*w),Ut=u(J*u(ut+X)),Kt=u(dt+u(P*u(et*X)));if(Ut!==Kt)throw new Error("bad point: equation left != right (1)");let It=u(K*V),Vt=u(W*Y);if(It!==Vt)throw new Error("bad point: equation left != right (2)")}equals(w){A(w);let{ex:P,ey:K,ez:V}=this,{ex:W,ey:Y,ez:et}=w,X=u(P*et),J=u(W*V),dt=u(K*et),ut=u(Y*V);return X===J&&dt===ut}is0(){return this.equals(S.ZERO)}negate(){return new S(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:w}=e,{ex:P,ey:K,ez:V}=this,W=u(P*P),Y=u(K*K),et=u(ui*u(V*V)),X=u(w*W),J=P+K,dt=u(u(J*J)-W-Y),ut=X+Y,Ut=ut-et,Kt=X-Y,It=u(dt*Ut),Vt=u(ut*Kt),Se=u(dt*Kt),tr=u(Ut*ut);return new S(It,Vt,tr,Se)}add(w){A(w);let{a:P,d:K}=e,{ex:V,ey:W,ez:Y,et}=this,{ex:X,ey:J,ez:dt,et:ut}=w;if(P===BigInt(-1)){let ia=u((W-V)*(J+X)),sa=u((W+V)*(J-X)),Yi=u(sa-ia);if(Yi===fe)return this.double();let oa=u(Y*ui*ut),aa=u(et*ui*dt),ca=aa+oa,fa=sa+ia,ua=aa-oa,du=u(ca*Yi),pu=u(fa*ua),yu=u(ca*ua),gu=u(Yi*fa);return new S(du,pu,gu,yu)}let Ut=u(V*X),Kt=u(W*J),It=u(et*K*ut),Vt=u(Y*dt),Se=u((V+W)*(X+J)-Ut-Kt),tr=Vt-It,rn=Vt+It,na=u(Kt-P*Ut),fu=u(Se*tr),uu=u(rn*na),hu=u(Se*na),lu=u(tr*rn);return new S(fu,uu,lu,hu)}subtract(w){return this.add(w.negate())}wNAF(w){return _.wNAFCached(this,m,w,S.normalizeZ)}multiply(w){let{p:P,f:K}=this.wNAF(x(w,n));return S.normalizeZ([P,K])[0]}multiplyUnsafe(w){let P=v(w);return P===fe?R:this.equals(R)||P===Xt?this:this.equals(B)?this.wNAF(P).p:_.unsafeLadder(this,P)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return _.unsafeLadder(this,n).is0()}toAffine(w){let{ex:P,ey:K,ez:V}=this,W=this.is0();w==null&&(w=W?Gh:r.inv(V));let Y=u(P*w),et=u(K*w),X=u(V*w);if(W)return{x:fe,y:Xt};if(X!==Xt)throw new Error("invZ was invalid");return{x:Y,y:et}}clearCofactor(){let{h:w}=e;return w===Xt?this:this.multiplyUnsafe(w)}static fromHex(w,P=!1){let{d:K,a:V}=e,W=r.BYTES;w=yt("pointHex",w,W);let Y=w.slice(),et=w[W-1];Y[W-1]=et&-129;let X=ce(Y);X===fe||(P?x(X,f):x(X,r.ORDER));let J=u(X*X),dt=u(J-Xt),ut=u(K*J-V),{isValid:Ut,value:Kt}=h(dt,ut);if(!Ut)throw new Error("Point.fromHex: invalid y coordinate");let It=(Kt&Xt)===Xt,Vt=(et&128)!==0;if(!P&&Kt===fe&&Vt)throw new Error("Point.fromHex: x=0 and x_0=1");return Vt!==It&&(Kt=u(-Kt)),S.fromAffine({x:Kt,y:X})}static fromPrivateKey(w){return U(w).point}toRawBytes(){let{x:w,y:P}=this.toAffine(),K=Te(P,r.BYTES);return K[K.length-1]|=w&Xt?128:0,K}toHex(){return Ce(this.toRawBytes())}}S.BASE=new S(e.Gx,e.Gy,Xt,u(e.Gx*e.Gy)),S.ZERO=new S(fe,Xt,Xt,fe);let{BASE:B,ZERO:R}=S,_=fi(S,a*8);function O(L){return at(L,n)}function M(L){return O(ce(L))}function U(L){let w=a;L=yt("private key",L,w);let P=yt("hashed private key",s(L),2*w),K=l(P.slice(0,w)),V=P.slice(w,2*w),W=M(K),Y=B.multiply(W),et=Y.toRawBytes();return{head:K,prefix:V,scalar:W,point:Y,pointBytes:et}}function q(L){return U(L).pointBytes}function z(L=new Uint8Array,...w){let P=_e(...w);return M(s(g(P,yt("context",L),!!i)))}function Z(L,w,P={}){L=yt("message",L),i&&(L=i(L));let{prefix:K,scalar:V,pointBytes:W}=U(w),Y=z(P.context,K,L),et=B.multiply(Y).toRawBytes(),X=z(P.context,et,W,L),J=O(Y+X*V);v(J);let dt=_e(et,Te(J,r.BYTES));return yt("result",dt,a*2)}let C=$h;function N(L,w,P,K=C){let{context:V,zip215:W}=K,Y=r.BYTES;L=yt("signature",L,2*Y),w=yt("message",w),i&&(w=i(w));let et=ce(L.slice(Y,2*Y)),X,J,dt;try{X=S.fromHex(P,W),J=S.fromHex(L.slice(0,Y),W),dt=B.multiplyUnsafe(et)}catch{return!1}if(!W&&X.isSmallOrder())return!1;let ut=z(V,J.toRawBytes(),X.toRawBytes(),w);return J.add(X.multiplyUnsafe(ut)).subtract(dt).clearCofactor().equals(S.ZERO)}return B._setWindowSize(8),{CURVE:e,getPublicKey:q,sign:Z,verify:N,ExtendedPoint:S,utils:{getExtendedPublicKey:U,randomPrivateKey:()=>o(r.BYTES),precompute(L=8,w=S.BASE){return w._setWindowSize(L),w.multiply(BigInt(3)),w}}}}var fn=BigInt(0),_s=BigInt(1);function Yh(t){return ee(t,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...t})}function Qa(t){let e=Yh(t),{P:r}=e,n=m=>at(m,r),i=e.montgomeryBits,s=Math.ceil(i/8),o=e.nByteLength,a=e.adjustScalarBytes||(m=>m),c=e.powPminus2||(m=>Bs(m,r-BigInt(2),r));function f(m,A,S){let B=n(m*(A-S));return A=n(A-B),S=n(S+B),[A,S]}function u(m){if(typeof m=="bigint"&&fn<=m&&m=fn;C--){let N=B>>C&_s;q^=N,z=f(q,_,M),_=z[0],M=z[1],z=f(q,O,U),O=z[0],U=z[1],q=N;let T=_+O,L=n(T*T),w=_-O,P=n(w*w),K=L-P,V=M+U,W=M-U,Y=n(W*T),et=n(V*w),X=Y+et,J=Y-et;M=n(X*X),U=n(R*n(J*J)),_=n(L*P),O=n(K*(L+n(h*K)))}z=f(q,_,M),_=z[0],M=z[1],z=f(q,O,U),O=z[0],U=z[1];let Z=c(O);return n(_*Z)}function g(m){return Te(n(m),s)}function d(m){let A=yt("u coordinate",m,s);return o===s&&(A[o-1]&=127),ce(A)}function p(m){let A=yt("scalar",m);if(A.length!==s&&A.length!==o)throw new Error(`Expected ${s} or ${o} bytes, got ${A.length}`);return ce(a(A))}function y(m,A){let S=d(A),B=p(m),R=l(S,B);if(R===fn)throw new Error("Invalid private or public key received");return g(R)}let x=g(e.Gu);function v(m){return y(m,x)}return{scalarMult:y,scalarMultBase:v,getSharedSecret:(m,A)=>y(m,A),getPublicKey:m=>v(m),utils:{randomPrivateKey:()=>e.randomBytes(e.nByteLength)},GuBytes:x}}var un=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Ja=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),Cx=BigInt(0),Zh=BigInt(1),Ls=BigInt(2),Xh=BigInt(5),ja=BigInt(10),Qh=BigInt(20),Jh=BigInt(40),t0=BigInt(80);function e0(t){let e=un,n=t*t%e*t%e,i=gt(n,Ls,e)*n%e,s=gt(i,Zh,e)*t%e,o=gt(s,Xh,e)*s%e,a=gt(o,ja,e)*o%e,c=gt(a,Qh,e)*a%e,f=gt(c,Jh,e)*c%e,u=gt(f,t0,e)*f%e,h=gt(u,t0,e)*f%e,l=gt(h,ja,e)*o%e;return{pow_p_5_8:gt(l,Ls,e)*t%e,b2:n}}function r0(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function jh(t,e){let r=un,n=at(e*e*e,r),i=at(n*n*e,r),s=e0(t*i).pow_p_5_8,o=at(t*n*s,r),a=at(e*o*o,r),c=o,f=at(o*Ja,r),u=a===t,h=a===at(-t,r),l=a===at(-t*Ja,r);return u&&(o=c),(h||l)&&(o=f),Wa(o,r)&&(o=at(-o,r)),{isValid:u||h,value:o}}var Le=ci(un,void 0,!0),Rs={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Le,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:bs,randomBytes:nr,adjustScalarBytes:r0,uvRatio:jh},Lr=hi(Rs);function n0(t,e,r){if(e.length>255)throw new Error("Context is too big");return ei(gs("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,e.length]),e,t)}var Ix=hi({...Rs,domain:n0}),Tx=hi({...Rs,domain:n0,prehash:bs}),hn=Qa({P:un,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:t=>{let e=un,{pow_p_5_8:r,b2:n}=e0(t);return at(gt(r,BigInt(3),e)*n,e)},adjustScalarBytes:r0,randomBytes:nr});var tl=(Le.ORDER+BigInt(3))/BigInt(8),_x=Le.pow(Ls,tl),Lx=Le.sqrt(Le.neg(Le.ONE)),Rx=(Le.ORDER-BigInt(5))/BigInt(8),Nx=BigInt(486662);var Dx=Ya(Le,Le.neg(BigInt(486664)));var kx=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Px=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Ux=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Kx=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var Ox=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var li=class extends Tr{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,on(e);let n=Fe(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew li(t,e).update(r).digest();Rr.create=(t,e)=>new li(t,e);function s0(t,e,r){return on(t),r===void 0&&(r=new Uint8Array(t.outputLen)),Rr(t,Fe(r),Fe(e))}var Ns=new Uint8Array([0]),i0=new Uint8Array;function o0(t,e,r,n=32){if(on(t),Jn(n),n>255*t.outputLen)throw new Error("Length should be <= 255*HashLen");let i=Math.ceil(n/t.outputLen);r===void 0&&(r=i0);let s=new Uint8Array(i*t.outputLen),o=Rr.create(t,e),a=o._cloneInto(),c=new Uint8Array(o.outputLen);for(let f=0;ft&e^~t&r,rl=(t,e,r)=>t&e^t&r^e&r,nl=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ze=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ge=new Uint32Array(64),Ds=class extends _r{constructor(){super(64,32,8,!1),this.A=ze[0]|0,this.B=ze[1]|0,this.C=ze[2]|0,this.D=ze[3]|0,this.E=ze[4]|0,this.F=ze[5]|0,this.G=ze[6]|0,this.H=ze[7]|0}get(){let{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let h=0;h<16;h++,r+=4)Ge[h]=e.getUint32(r,!1);for(let h=16;h<64;h++){let l=Ge[h-15],g=Ge[h-2],d=ae(l,7)^ae(l,18)^l>>>3,p=ae(g,17)^ae(g,19)^g>>>10;Ge[h]=p+Ge[h-7]+d+Ge[h-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:f,H:u}=this;for(let h=0;h<64;h++){let l=ae(a,6)^ae(a,11)^ae(a,25),g=u+l+el(a,c,f)+nl[h]+Ge[h]|0,p=(ae(n,2)^ae(n,13)^ae(n,22))+rl(n,i,s)|0;u=f,f=c,c=a,a=o+g|0,o=s,s=i,i=n,n=g+p|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,f=f+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,f,u)}roundClean(){Ge.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Nr=ri(()=>new Ds);var di={hashSHA256(t){return Nr(t)},getHKDF(t,e){let r=s0(Nr,e,t),i=o0(Nr,r,void 0,96),s=i.subarray(0,32),o=i.subarray(32,64),a=i.subarray(64,96);return[s,o,a]},generateX25519KeyPair(){let t=hn.utils.randomPrivateKey();return{publicKey:hn.getPublicKey(t),privateKey:t}},generateX25519KeyPairFromSeed(t){return{publicKey:hn.getPublicKey(t),privateKey:t}},generateX25519SharedKey(t,e){return hn.getSharedSecret(t,e)},chaCha20Poly1305Encrypt(t,e,r,n){return ps(n,e,r).encrypt(t)},chaCha20Poly1305Decrypt(t,e,r,n,i){return ps(n,e,r).decrypt(t,i)}};var a0=di;var Os={};Lt(Os,{base10:()=>fl});function il(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,A=new Uint8Array(m);x!==v;){for(var S=d[x],B=0,R=m-1;(S!==0||B>>0,A[R]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");y=B,x++}for(var _=m-y;_!==m&&A[_]===0;)_++;for(var O=c.repeat(p);_>>0,m=new Uint8Array(v);d[p];){var A=r[d.charCodeAt(p)];if(A===255)return;for(var S=0,B=v-1;(A!==0||S>>0,m[B]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");x=S,p++}if(d[p]!==" "){for(var R=v-x;R!==v&&m[R]===0;)R++;for(var _=new Uint8Array(y+(v-R)),O=y;R!==v;)_[O++]=m[R++];return _}}}function g(d){var p=l(d);if(p)return p;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:l,decode:g}}var sl=il,ol=sl,c0=ol;var s2=new Uint8Array(0);var f0=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var u0=t=>new TextEncoder().encode(t),h0=t=>new TextDecoder().decode(t);var ks=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Ps=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return d0(this,e)}},Us=class{constructor(e){this.decoders=e}or(e){return d0(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},d0=(t,e)=>new Us({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),Ks=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ks(e,r,n),this.decoder=new Ps(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Dr=({name:t,prefix:e,encode:r,decode:n})=>new Ks(t,e,r,n),$e=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=c0(r,e);return Dr({prefix:t,name:e,encode:n,decode:s=>Re(i(s))})},al=(t,e,r,n)=>{let i={};for(let u=0;u=8&&(a-=8,o[f++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},cl=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<Dr({prefix:e,name:t,encode(i){return cl(i,n,r)},decode(i){return al(i,n,r,t)}});var fl=$e({prefix:"9",name:"base10",alphabet:"0123456789"});var Ms={};Lt(Ms,{base16:()=>ul,base16upper:()=>hl});var ul=St({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),hl=St({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Fs={};Lt(Fs,{base2:()=>ll});var ll=St({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Vs={};Lt(Vs,{base256emoji:()=>xl});var p0=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),dl=p0.reduce((t,e,r)=>(t[r]=e,t),[]),pl=p0.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function yl(t){return t.reduce((e,r)=>(e+=dl[r],e),"")}function gl(t){let e=[];for(let r of t){let n=pl[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var xl=Dr({prefix:"\u{1F680}",name:"base256emoji",encode:yl,decode:gl});var Hs={};Lt(Hs,{base32:()=>We,base32hex:()=>wl,base32hexpad:()=>Sl,base32hexpadupper:()=>Bl,base32hexupper:()=>El,base32pad:()=>bl,base32padupper:()=>vl,base32upper:()=>ml,base32z:()=>Al});var We=St({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ml=St({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),bl=St({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),vl=St({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),wl=St({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),El=St({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Sl=St({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Bl=St({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Al=St({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var qs={};Lt(qs,{base36:()=>Cl,base36upper:()=>Il});var Cl=$e({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Il=$e({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var zs={};Lt(zs,{base58btc:()=>Mt,base58flickr:()=>Tl});var Mt=$e({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Tl=$e({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Gs={};Lt(Gs,{base64:()=>kr,base64pad:()=>_l,base64url:()=>Ll,base64urlpad:()=>Rl});var kr=St({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),_l=St({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ll=St({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Rl=St({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var $s={};Lt($s,{base8:()=>Nl});var Nl=St({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Ws={};Lt(Ws,{identity:()=>Dl});var Dl=Dr({prefix:"\0",name:"identity",encode:t=>h0(t),decode:t=>u0(t)});var v2=new TextEncoder,w2=new TextDecoder;var Zs={};Lt(Zs,{identity:()=>Ye});var Ul=x0,y0=128,Kl=127,Ol=~Kl,Ml=Math.pow(2,31);function x0(t,e,r){e=e||[],r=r||0;for(var n=r;t>=Ml;)e[r++]=t&255|y0,t/=128;for(;t&Ol;)e[r++]=t&255|y0,t>>>=7;return e[r]=t|0,x0.bytes=r-n+1,e}var Fl=Ys,Vl=128,g0=127;function Ys(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw Ys.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&g0)<=Vl);return Ys.bytes=s-n,r}var Hl=Math.pow(2,7),ql=Math.pow(2,14),zl=Math.pow(2,21),Gl=Math.pow(2,28),$l=Math.pow(2,35),Wl=Math.pow(2,42),Yl=Math.pow(2,49),Zl=Math.pow(2,56),Xl=Math.pow(2,63),Ql=function(t){return t[ln.decode(t,e),ln.decode.bytes],Pr=(t,e,r=0)=>(ln.encode(t,e,r),e),Ur=t=>ln.encodingLength(t);var pe=(t,e)=>{let r=e.byteLength,n=Ur(t),i=n+Ur(r),s=new Uint8Array(i+r);return Pr(t,s,0),Pr(r,s,n),s.set(e,i),new Kr(t,r,e,s)},pn=t=>{let e=Re(t),[r,n]=dn(e),[i,s]=dn(e.subarray(n)),o=e.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new Kr(r,i,o,e)},m0=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&f0(t.bytes,r.bytes)}},Kr=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var b0=0,td="identity",v0=Re,ed=t=>pe(b0,v0(t)),Ye={code:b0,name:td,encode:v0,digest:ed};var Js={};Lt(Js,{sha256:()=>Ft,sha512:()=>rd});var Qs=({name:t,code:e,encode:r})=>new Xs(t,e,r),Xs=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?pe(this.code,r):r.then(n=>pe(this.code,n))}else throw Error("Unknown type, must be binary type")}};var E0=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Ft=Qs({name:"sha2-256",code:18,encode:E0("SHA-256")}),rd=Qs({name:"sha2-512",code:19,encode:E0("SHA-512")});var S0=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return id(r,js(t),e||Mt.encoder);default:return sd(r,js(t),e||We.encoder)}};var B0=new WeakMap,js=t=>{let e=B0.get(t);if(e==null){let r=new Map;return B0.set(t,r),r}return e},or=class t{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==yn)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==od)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=pe(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&m0(e.multihash,n.multihash)}toString(e){return S0(this,e)}toJSON(){return{"/":S0(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new t(n,i,s,o||A0(n,i,s.bytes))}else if(r[ad]===!0){let{version:n,multihash:i,code:s}=r,o=pn(i);return t.create(n,s,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==yn)throw new Error(`Version 0 CID must use dag-pb (code: ${yn}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=A0(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,yn,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=Re(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new Kr(r.multihashCode,r.digestSize,s,i);return[r.version===0?t.createV0(o):t.createV1(r.codec,o),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,l]=dn(e.subarray(r));return r+=l,h},i=n(),s=yn;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),c=n(),f=r+c,u=f-o;return{version:i,codec:s,multihashCode:a,digestSize:c,multihashSize:u,size:f}}static parse(e,r){let[n,i]=nd(e,r),s=t.decode(i);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return js(s).set(n,e),s}},nd=(t,e)=>{switch(t[0]){case"Q":{let r=e||Mt;return[Mt.prefix,r.decode(`${Mt.prefix}${t}`)]}case Mt.prefix:{let r=e||Mt;return[Mt.prefix,r.decode(t)]}case We.prefix:{let r=e||We;return[We.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},id=(t,e,r)=>{let{prefix:n}=r;if(n!==Mt.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let s=r.encode(t).slice(1);return e.set(n,s),s}else return i},sd=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let s=r.encode(t);return e.set(n,s),s}else return i},yn=112,od=18,A0=(t,e,r)=>{let n=Ur(t),i=n+Ur(e),s=new Uint8Array(i+r.byteLength);return Pr(t,s,0),Pr(e,s,n),s.set(r,i),s},ad=Symbol.for("@ipld/js-cid/CID");var Mr={...Ws,...Fs,...$s,...Os,...Ms,...Hs,...qs,...zs,...Gs,...Vs},K2={...Js,...Zs};function I0(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var C0=I0("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),to=I0("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);let e=Tt(t.length);for(let r=0;r{let e=Tt(2);return new DataView(e.buffer,e.byteOffset,e.byteLength).setUint16(0,t,!1),e};Fr.bytes=2;var gn=t=>{if(t.length<2)throw RangeError("Could not decode int16BE");return t instanceof Uint8Array?new DataView(t.buffer,t.byteOffset,t.byteLength).getUint16(0,!1):t.getUint16(0)};gn.bytes=2;function T0(t){return Bt([t.ne,t.ciphertext],t.ne.length+t.ciphertext.length)}function _0(t){return Bt([t.ne,t.ns,t.ciphertext],t.ne.length+t.ns.length+t.ciphertext.length)}function L0(t){return Bt([t.ns,t.ciphertext],t.ns.length+t.ciphertext.length)}function R0(t){if(t.length<32)throw new Error("Cannot decode stage 0 MessageBuffer: length less than 32 bytes.");return{ne:t.subarray(0,32),ciphertext:t.subarray(32,t.length),ns:rt(0)}}function N0(t){if(t.length<80)throw new Error("Cannot decode stage 1 MessageBuffer: length less than 80 bytes.");return{ne:t.subarray(0,32),ns:t.subarray(32,80),ciphertext:t.subarray(80,t.length)}}function D0(t){if(t.length<48)throw new Error("Cannot decode stage 2 MessageBuffer: length less than 48 bytes.");return{ne:rt(0),ns:t.subarray(0,48),ciphertext:t.subarray(48,t.length)}}var P0=16;function U0(t,e){return async function*(r){for await(let n of r)for(let i=0;in.length&&(s=n.length);let o=t.encrypt(n.subarray(i,s),t.session);e?.encryptedPackets.increment(),yield Bt([Fr(o.byteLength),o],2+o.byteLength)}}}function K0(t,e){return async function*(r){for await(let n of r)for(let i=0;in.length&&(s=n.length),s-P0mr,Ed25519PublicKey:()=>Tn,generateKeyPair:()=>zy,generateKeyPairFromSeed:()=>yf,unmarshalEd25519PrivateKey:()=>Hy,unmarshalEd25519PublicKey:()=>qy});var Gr=32,Pe=64,ki=32;async function tf(){let t=Lr.utils.randomPrivateKey(),e=Lr.getPublicKey(t);return{privateKey:sf(t,e),publicKey:e}}async function ef(t){if(t.length!==ki)throw new TypeError('"seed" must be 32 bytes in length.');if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');let e=t,r=Lr.getPublicKey(e);return{privateKey:sf(e,r),publicKey:r}}async function rf(t,e){let r=t.subarray(0,ki);return Lr.sign(e,r)}async function nf(t,e,r){return Lr.verify(e,r,t)}function sf(t,e){let r=new Uint8Array(Pe);for(let n=0;n>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return dr;if(ePy)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,i=e-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>hf&&(i=0n,++n>hf&&(n=0n))),new t(Number(i),Number(n))}static fromNumber(e){if(e===0)return dr;let r=e<0;r&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new t(n,i)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):dr}},dr=new Zt(0,0);dr.toBigInt=function(){return 0n};dr.zzEncode=dr.zzDecode=function(){return this};dr.length=function(){return 1};var hf=4294967296n;function lf(t){let e=0,r=0;for(let n=0;n191&&a<224?s[o++]=(a&31)<<6|t[e++]&63:a>239&&a<365?(a=((a&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,s[o++]=55296+(a>>10),s[o++]=56320+(a&1023)):s[o++]=(a&15)<<12|(t[e++]&63)<<6|t[e++]&63,o>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,s)),o=0);return i!=null?(o>0&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))}function To(t,e,r){let n=r,i,s;for(let o=0;o>6|192,e[r++]=i&63|128):(i&64512)===55296&&((s=t.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(s&1023),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128);return r-n}function le(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Pi(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var _o=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,le(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw le(this,4);return Pi(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw le(this,4);return Pi(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw le(this,4);let e=cf(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw le(this,4);let e=uf(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw le(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return df(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw le(this,e);this.pos+=e}else do if(this.pos>=this.len)throw le(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Zt(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw le(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw le(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw le(this,8);let e=Pi(this.buf,this.pos+=4),r=Pi(this.buf,this.pos+=4);return new Zt(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Lo(t){return new _o(t instanceof Uint8Array?t:t.subarray())}function pr(t,e){let r=Lo(t);return e.decode(r)}function Ro(t){let e=t??8192,r=e>>>1,n,i=e;return function(o){if(o<1||o>r)return Tt(o);i+o>e&&(n=Tt(e),i=0);let a=n.subarray(i,i+=o);return i&7&&(i=(i|7)+1),a}}var yr=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function No(){}var ko=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},Uy=Ro();function Ky(t){return globalThis.Buffer!=null?Tt(t):Uy(t)}var In=class{len;head;tail;states;constructor(){this.len=0,this.head=new yr(No,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new yr(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new Po((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(An,10,Zt.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=Zt.fromBigInt(e);return this._push(An,r.length(),r)}uint64Number(e){let r=Zt.fromNumber(e);return this._push(An,r.length(),r)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=Zt.fromBigInt(e).zzEncode();return this._push(An,r.length(),r)}sint64Number(e){let r=Zt.fromNumber(e).zzEncode();return this._push(An,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(Do,1,e?1:0)}fixed32(e){return this._push(Cn,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=Zt.fromBigInt(e);return this._push(Cn,4,r.lo)._push(Cn,4,r.hi)}fixed64Number(e){let r=Zt.fromNumber(e);return this._push(Cn,4,r.lo)._push(Cn,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(af,4,e)}double(e){return this._push(ff,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(Do,1,0):this.uint32(r)._push(My,r,e)}string(e){let r=lf(e);return r!==0?this.uint32(r)._push(To,r,e):this._push(Do,1,0)}fork(){return this.states=new ko(this),this.head=this.tail=new yr(No,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new yr(No,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=Ky(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function Do(t,e,r){e[r]=t&255}function Oy(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var Po=class extends yr{next;constructor(e,r){super(Oy,e,r),this.next=void 0}};function An(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function Cn(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function My(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(In.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(Fy,e,t),this},In.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(Vy,e,t),this});function Fy(t,e,r){e.set(t,r)}function Vy(t,e,r){t.length<40?To(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(At(t),r)}function Uo(){return new In}function gr(t,e){let r=Uo();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var Wr;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(Wr||(Wr={}));function Ui(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function Ko(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(s,o){let a=e(s);o.int32(a)},n=function(s){let o=s.int32();return e(o)};return Ui("enum",Wr.VARINT,r,n)}function xr(t,e){return Ui("message",Wr.LENGTH_DELIMITED,t,e)}var wt;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.Secp256k1="Secp256k1"})(wt||(wt={}));var Oo;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.Secp256k1=2]="Secp256k1"})(Oo||(Oo={}));(function(t){t.codec=()=>Ko(Oo)})(wt||(wt={}));var we;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),wt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=wt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(we||(we={}));var Ee;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),wt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=wt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Ee||(Ee={}));var Tn=class{_key;constructor(e){this._key=Yr(e,Gr)}async verify(e,r){return nf(this._key,r,e)}marshal(){return this._key}get bytes(){return we.encode({Type:wt.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Rt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},mr=class{_key;_publicKey;constructor(e,r){this._key=Yr(e,Pe),this._publicKey=Yr(r,Gr)}async sign(e){return rf(this._key,e)}get public(){return new Tn(this._publicKey)}marshal(){return this._key}get bytes(){return Ee.encode({Type:wt.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Rt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=Ye.digest(this.public.bytes);return Mt.encode(e.bytes).substring(1)}async export(e,r="libp2p-key"){if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function Hy(t){if(t.length>Pe){t=Yr(t,Pe+Gr);let n=t.subarray(0,Pe),i=t.subarray(Pe,t.length);return new mr(n,i)}t=Yr(t,Pe);let e=t.subarray(0,Pe),r=t.subarray(Gr);return new mr(e,r)}function qy(t){return t=Yr(t,Gr),new Tn(t)}async function zy(){let{privateKey:t,publicKey:e}=await tf();return new mr(t,e)}async function yf(t){let{privateKey:e,publicKey:r}=await ef(t);return new mr(e,r)}function Yr(t,e){if(t=Uint8Array.from(t??[]),t.length!==e)throw new it(`Key must be a Uint8Array of length ${e}, got ${t.length}`,"ERR_INVALID_KEY_TYPE");return t}var Ib=zt(Ct(),1),Tb=zt(Li(),1),gf=zt(lt(),1);function de(t,e){let r=Uint8Array.from(t.abs().toByteArray());if(r=r[0]===0?r.subarray(1):r,e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Bt([new Uint8Array(e-r.length),r])}return Et(r,"base64url")}function Qt(t){let e=xf(t);return new gf.default.jsbn.BigInteger(Et(e,"base16"),16)}function xf(t,e){let r=At(t,"base64urlpad");if(e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Bt([new Uint8Array(e-r.length),r])}return r}var Gy={"P-256":256,"P-384":384,"P-521":521},$y=Object.keys(Gy),Mb=$y.join(" / ");var zo={};Lt(zo,{MAX_KEY_SIZE:()=>Nn,RsaPrivateKey:()=>Zr,RsaPublicKey:()=>Rn,fromJwk:()=>n1,generateKeyPair:()=>i1,unmarshalRsaPrivateKey:()=>e1,unmarshalRsaPublicKey:()=>r1});var Ln=zt(lt(),1);var Sv=zt(Ef(),1);function Oi(t){if(isNaN(t)||t<=0)throw new it("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return nr(t)}var sv=zt(Di(),1),Ho=zt(lt(),1);function Sf(t,e){return e.map(r=>Qt(t[r]))}function Bf(t){return Ho.default.pki.setRsaPrivateKey(...Sf(t,["n","e","d","p","q","dp","dq","qi"]))}function Af(t){return Ho.default.pki.setRsaPublicKey(...Sf(t,["n","e"]))}var vr={};Lt(vr,{jwkToPkcs1:()=>Xy,jwkToPkix:()=>Jy,pkcs1ToJwk:()=>Zy,pkixToJwk:()=>Qy});var cv=zt(En(),1),fv=zt(Di(),1);var Ue=zt(lt(),1);function Zy(t){let e=Ue.default.asn1.fromDer(Et(t,"ascii")),r=Ue.default.pki.privateKeyFromAsn1(e);return{kty:"RSA",n:de(r.n),e:de(r.e),d:de(r.d),p:de(r.p),q:de(r.q),dp:de(r.dP),dq:de(r.dQ),qi:de(r.qInv),alg:"RS256"}}function Xy(t){if(t.n==null||t.e==null||t.d==null||t.p==null||t.q==null||t.dp==null||t.dq==null||t.qi==null)throw new it("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ue.default.pki.privateKeyToAsn1({n:Qt(t.n),e:Qt(t.e),d:Qt(t.d),p:Qt(t.p),q:Qt(t.q),dP:Qt(t.dp),dQ:Qt(t.dq),qInv:Qt(t.qi)});return At(Ue.default.asn1.toDer(e).getBytes(),"ascii")}function Qy(t){let e=Ue.default.asn1.fromDer(Et(t,"ascii")),r=Ue.default.pki.publicKeyFromAsn1(e);return{kty:"RSA",n:de(r.n),e:de(r.e)}}function Jy(t){if(t.n==null||t.e==null)throw new it("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ue.default.pki.publicKeyToAsn1({n:Qt(t.n),e:Qt(t.e)});return At(Ue.default.asn1.toDer(e).getBytes(),"ascii")}async function Cf(t){let e=await Yt.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await _f(e);return{privateKey:r[0],publicKey:r[1]}}async function qo(t){let r=[await Yt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await jy(t)],n=await _f({privateKey:r[0],publicKey:r[1]});return{privateKey:n[0],publicKey:n[1]}}async function If(t,e){let r=await Yt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),n=await Yt.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(e));return new Uint8Array(n,0,n.byteLength)}async function Tf(t,e,r){let n=await Yt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return Yt.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},n,e,r)}async function _f(t){if(t.privateKey==null||t.publicKey==null)throw new it("Private and public key are required","ERR_INVALID_PARAMETERS");return Promise.all([Yt.get().subtle.exportKey("jwk",t.privateKey),Yt.get().subtle.exportKey("jwk",t.publicKey)])}async function jy(t){return Yt.get().subtle.importKey("jwk",{kty:t.kty,n:t.n,e:t.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}function Lf(t,e,r,n){let i=e?Af(t):Bf(t),s=Et(Uint8Array.from(r),"ascii"),o=n(s,i);return At(o,"ascii")}function Rf(t,e){return Lf(t,!0,e,(r,n)=>n.encrypt(r))}function Nf(t,e){return Lf(t,!1,e,(r,n)=>n.decrypt(r))}function Mi(t){if(t.kty!=="RSA")throw new it("invalid key type","ERR_INVALID_KEY_TYPE");if(t.n==null)throw new it("invalid key modulus","ERR_INVALID_KEY_MODULUS");return At(t.n,"base64url").length*8}var Nn=8192,Rn=class{_key;constructor(e){this._key=e}async verify(e,r){return Tf(this._key,r,e)}marshal(){return vr.jwkToPkix(this._key)}get bytes(){return we.encode({Type:wt.RSA,Data:this.marshal()}).subarray()}encrypt(e){return Rf(this._key,e)}equals(e){return Rt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},Zr=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r}genSecret(){return Oi(16)}async sign(e){return If(this._key,e)}get public(){if(this._publicKey==null)throw new it("public key not provided","ERR_PUBKEY_NOT_PROVIDED");return new Rn(this._publicKey)}decrypt(e){return Nf(this._key,e)}marshal(){return vr.jwkToPkcs1(this._key)}get bytes(){return Ee.encode({Type:wt.RSA,Data:this.marshal()}).subarray()}equals(e){return Rt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=await this.public.hash();return Et(e,"base58btc")}async export(e,r="pkcs-8"){if(r==="pkcs-8"){let n=new Ln.default.util.ByteBuffer(this.marshal()),i=Ln.default.asn1.fromDer(n),s=Ln.default.pki.privateKeyFromAsn1(i),o={algorithm:"aes256",count:1e4,saltSize:128/8,prfAlgorithm:"sha512"};return Ln.default.pki.encryptRsaPrivateKey(s,e,o)}else{if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}}};async function e1(t){let e=vr.pkcs1ToJwk(t);if(Mi(e)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let r=await qo(e);return new Zr(r.privateKey,r.publicKey)}function r1(t){let e=vr.pkixToJwk(t);if(Mi(e)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");return new Rn(e)}async function n1(t){if(Mi(t)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await qo(t);return new Zr(e.privateKey,e.publicKey)}async function i1(t){if(t>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await Cf(t);return new Zr(e.privateKey,e.publicKey)}var Yo={};Lt(Yo,{Secp256k1PrivateKey:()=>kn,Secp256k1PublicKey:()=>Dn,generateKeyPair:()=>g1,unmarshalSecp256k1PrivateKey:()=>p1,unmarshalSecp256k1PublicKey:()=>y1});function s1(t){let e=cn(t);ee(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:o1,hexToBytes:a1}=oi,wr={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){let{Err:e}=wr;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:o1(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=wr,r=typeof t=="string"?a1(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:s}=wr._parseInt(r.subarray(2)),{d:o,l:a}=wr._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){let e=f=>Number.parseInt(f[0],16)&8?"00"+f:f,r=f=>{let u=f.toString(16);return u.length&1?`0${u}`:u},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},Ke=BigInt(0),ie=BigInt(1),_v=BigInt(2),Df=BigInt(3),Lv=BigInt(4);function c1(t){let e=s1(t),{Fp:r}=e,n=e.toBytes||((d,p,y)=>{let x=p.toAffine();return _e(Uint8Array.from([4]),r.toBytes(x.x),r.toBytes(x.y))}),i=e.fromBytes||(d=>{let p=d.subarray(1),y=r.fromBytes(p.subarray(0,r.BYTES)),x=r.fromBytes(p.subarray(r.BYTES,2*r.BYTES));return{x:y,y:x}});function s(d){let{a:p,b:y}=e,x=r.sqr(d),v=r.mul(x,d);return r.add(r.add(v,r.mul(d,p)),y)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(d){return typeof d=="bigint"&&Ker.eql(m,r.ZERO);return v(y)&&v(x)?h.ZERO:new h(y,x,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){let y=r.invertBatch(p.map(x=>x.pz));return p.map((x,v)=>x.toAffine(y[v])).map(h.fromAffine)}static fromHex(p){let y=h.fromAffine(i(yt("pointHex",p)));return y.assertValidity(),y}static fromPrivateKey(p){return h.BASE.multiply(c(p))}_setWindowSize(p){this._WINDOW_SIZE=p,f.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:p,y}=this.toAffine();if(!r.isValid(p)||!r.isValid(y))throw new Error("bad point: x or y not FE");let x=r.sqr(y),v=s(p);if(!r.eql(x,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:p}=this.toAffine();if(r.isOdd)return!r.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){u(p);let{px:y,py:x,pz:v}=this,{px:m,py:A,pz:S}=p,B=r.eql(r.mul(y,S),r.mul(m,v)),R=r.eql(r.mul(x,S),r.mul(A,v));return B&&R}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){let{a:p,b:y}=e,x=r.mul(y,Df),{px:v,py:m,pz:A}=this,S=r.ZERO,B=r.ZERO,R=r.ZERO,_=r.mul(v,v),O=r.mul(m,m),M=r.mul(A,A),U=r.mul(v,m);return U=r.add(U,U),R=r.mul(v,A),R=r.add(R,R),S=r.mul(p,R),B=r.mul(x,M),B=r.add(S,B),S=r.sub(O,B),B=r.add(O,B),B=r.mul(S,B),S=r.mul(U,S),R=r.mul(x,R),M=r.mul(p,M),U=r.sub(_,M),U=r.mul(p,U),U=r.add(U,R),R=r.add(_,_),_=r.add(R,_),_=r.add(_,M),_=r.mul(_,U),B=r.add(B,_),M=r.mul(m,A),M=r.add(M,M),_=r.mul(M,U),S=r.sub(S,_),R=r.mul(M,O),R=r.add(R,R),R=r.add(R,R),new h(S,B,R)}add(p){u(p);let{px:y,py:x,pz:v}=this,{px:m,py:A,pz:S}=p,B=r.ZERO,R=r.ZERO,_=r.ZERO,O=e.a,M=r.mul(e.b,Df),U=r.mul(y,m),q=r.mul(x,A),z=r.mul(v,S),Z=r.add(y,x),C=r.add(m,A);Z=r.mul(Z,C),C=r.add(U,q),Z=r.sub(Z,C),C=r.add(y,v);let N=r.add(m,S);return C=r.mul(C,N),N=r.add(U,z),C=r.sub(C,N),N=r.add(x,v),B=r.add(A,S),N=r.mul(N,B),B=r.add(q,z),N=r.sub(N,B),_=r.mul(O,C),B=r.mul(M,z),_=r.add(B,_),B=r.sub(q,_),_=r.add(q,_),R=r.mul(B,_),q=r.add(U,U),q=r.add(q,U),z=r.mul(O,z),C=r.mul(M,C),q=r.add(q,z),z=r.sub(U,z),z=r.mul(O,z),C=r.add(C,z),U=r.mul(q,C),R=r.add(R,U),U=r.mul(N,C),B=r.mul(Z,B),B=r.sub(B,U),U=r.mul(Z,q),_=r.mul(N,_),_=r.add(_,U),new h(B,R,_)}subtract(p){return this.add(p.negate())}is0(){return this.equals(h.ZERO)}wNAF(p){return g.wNAFCached(this,f,p,y=>{let x=r.invertBatch(y.map(v=>v.pz));return y.map((v,m)=>v.toAffine(x[m])).map(h.fromAffine)})}multiplyUnsafe(p){let y=h.ZERO;if(p===Ke)return y;if(a(p),p===ie)return this;let{endo:x}=e;if(!x)return g.unsafeLadder(this,p);let{k1neg:v,k1:m,k2neg:A,k2:S}=x.splitScalar(p),B=y,R=y,_=this;for(;m>Ke||S>Ke;)m&ie&&(B=B.add(_)),S&ie&&(R=R.add(_)),_=_.double(),m>>=ie,S>>=ie;return v&&(B=B.negate()),A&&(R=R.negate()),R=new h(r.mul(R.px,x.beta),R.py,R.pz),B.add(R)}multiply(p){a(p);let y=p,x,v,{endo:m}=e;if(m){let{k1neg:A,k1:S,k2neg:B,k2:R}=m.splitScalar(y),{p:_,f:O}=this.wNAF(S),{p:M,f:U}=this.wNAF(R);_=g.constTimeNegate(A,_),M=g.constTimeNegate(B,M),M=new h(r.mul(M.px,m.beta),M.py,M.pz),x=_.add(M),v=O.add(U)}else{let{p:A,f:S}=this.wNAF(y);x=A,v=S}return h.normalizeZ([x,v])[0]}multiplyAndAddUnsafe(p,y,x){let v=h.BASE,m=(S,B)=>B===Ke||B===ie||!S.equals(v)?S.multiplyUnsafe(B):S.multiply(B),A=m(this,y).add(m(p,x));return A.is0()?void 0:A}toAffine(p){let{px:y,py:x,pz:v}=this,m=this.is0();p==null&&(p=m?r.ONE:r.inv(v));let A=r.mul(y,p),S=r.mul(x,p),B=r.mul(v,p);if(m)return{x:r.ZERO,y:r.ZERO};if(!r.eql(B,r.ONE))throw new Error("invZ was invalid");return{x:A,y:S}}isTorsionFree(){let{h:p,isTorsionFree:y}=e;if(p===ie)return!0;if(y)return y(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:p,clearCofactor:y}=e;return p===ie?this:y?y(h,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),n(h,this,p)}toHex(p=!0){return Ce(this.toRawBytes(p))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);let l=e.nBitLength,g=fi(h,e.endo?Math.ceil(l/2):l);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function f1(t){let e=cn(t);return ee(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function kf(t){let e=f1(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(C){return KeCe(qe(C,e.nByteLength));function d(C){let N=n>>ie;return C>N}function p(C){return d(C)?a(-C):C}let y=(C,N,T)=>Ie(C.slice(N,T));class x{constructor(N,T,L){this.r=N,this.s=T,this.recovery=L,this.assertValidity()}static fromCompact(N){let T=e.nByteLength;return N=yt("compactSignature",N,T*2),new x(y(N,0,T),y(N,T,2*T))}static fromDER(N){let{r:T,s:L}=wr.toSig(yt("DER",N));return new x(T,L)}assertValidity(){if(!l(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!l(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(N){return new x(this.r,this.s,N)}recoverPublicKey(N){let{r:T,s:L,recovery:w}=this,P=R(yt("msgHash",N));if(w==null||![0,1,2,3].includes(w))throw new Error("recovery id invalid");let K=w===2||w===3?T+e.n:T;if(K>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let V=w&1?"03":"02",W=f.fromHex(V+g(K)),Y=c(K),et=a(-P*Y),X=a(L*Y),J=f.BASE.multiplyAndAddUnsafe(W,et,X);if(!J)throw new Error("point at infinify");return J.assertValidity(),J}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return ir(this.toDERHex())}toDERHex(){return wr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ir(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}let v={isValidPrivateKey(C){try{return u(C),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let C=Is(e.n);return Xa(e.randomBytes(C),e.n)},precompute(C=8,N=f.BASE){return N._setWindowSize(C),N.multiply(BigInt(3)),N}};function m(C,N=!0){return f.fromPrivateKey(C).toRawBytes(N)}function A(C){let N=C instanceof Uint8Array,T=typeof C=="string",L=(N||T)&&C.length;return N?L===i||L===s:T?L===2*i||L===2*s:C instanceof f}function S(C,N,T=!0){if(A(C))throw new Error("first arg must be private key");if(!A(N))throw new Error("second arg must be public key");return f.fromHex(N).multiply(u(C)).toRawBytes(T)}let B=e.bits2int||function(C){let N=Ie(C),T=C.length*8-e.nBitLength;return T>0?N>>BigInt(T):N},R=e.bits2int_modN||function(C){return a(B(C))},_=an(e.nBitLength);function O(C){if(typeof C!="bigint")throw new Error("bigint expected");if(!(Ke<=C&&C<_))throw new Error(`bigint expected < 2^${e.nBitLength}`);return qe(C,e.nByteLength)}function M(C,N,T=U){if(["recovered","canonical"].some(ut=>ut in T))throw new Error("sign() legacy options not supported");let{hash:L,randomBytes:w}=e,{lowS:P,prehash:K,extraEntropy:V}=T;P==null&&(P=!0),C=yt("msgHash",C),K&&(C=yt("prehashed msgHash",L(C)));let W=R(C),Y=u(N),et=[O(Y),O(W)];if(V!=null){let ut=V===!0?w(r.BYTES):V;et.push(yt("extraEntropy",ut))}let X=_e(...et),J=W;function dt(ut){let Ut=B(ut);if(!l(Ut))return;let Kt=c(Ut),It=f.BASE.multiply(Ut).toAffine(),Vt=a(It.x);if(Vt===Ke)return;let Se=a(Kt*a(J+Vt*Y));if(Se===Ke)return;let tr=(It.x===Vt?0:2)|Number(It.y&ie),rn=Se;return P&&d(Se)&&(rn=p(Se),tr^=1),new x(Vt,rn,tr)}return{seed:X,k2sig:dt}}let U={lowS:e.lowS,prehash:!1},q={lowS:e.lowS,prehash:!1};function z(C,N,T=U){let{seed:L,k2sig:w}=M(C,N,T),P=e;return Es(P.hash.outputLen,P.nByteLength,P.hmac)(L,w)}f.BASE._setWindowSize(8);function Z(C,N,T,L=q){let w=C;if(N=yt("msgHash",N),T=yt("publicKey",T),"strict"in L)throw new Error("options.strict was renamed to lowS");let{lowS:P,prehash:K}=L,V,W;try{if(typeof w=="string"||w instanceof Uint8Array)try{V=x.fromDER(w)}catch(It){if(!(It instanceof wr.Err))throw It;V=x.fromCompact(w)}else if(typeof w=="object"&&typeof w.r=="bigint"&&typeof w.s=="bigint"){let{r:It,s:Vt}=w;V=new x(It,Vt)}else throw new Error("PARSE");W=f.fromHex(T)}catch(It){if(It.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(P&&V.hasHighS())return!1;K&&(N=e.hash(N));let{r:Y,s:et}=V,X=R(N),J=c(et),dt=a(X*J),ut=a(Y*J),Ut=f.BASE.multiplyAndAddUnsafe(W,dt,ut)?.toAffine();return Ut?a(Ut.x)===Y:!1}return{CURVE:e,getPublicKey:m,getSharedSecret:S,sign:z,verify:Z,ProjectivePoint:f,Signature:x,utils:v}}function u1(t){return{hash:t,hmac:(e,...r)=>Rr(t,e,ei(...r)),randomBytes:nr}}function Pf(t,e){let r=n=>kf({...t,...u1(n)});return Object.freeze({...r(e),create:r})}var Of=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Uf=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h1=BigInt(1),Go=BigInt(2),Kf=(t,e)=>(t+e/Go)/e;function l1(t){let e=Of,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),f=t*t*t%e,u=f*f*t%e,h=gt(u,r,e)*u%e,l=gt(h,r,e)*u%e,g=gt(l,Go,e)*f%e,d=gt(g,i,e)*g%e,p=gt(d,s,e)*d%e,y=gt(p,a,e)*p%e,x=gt(y,c,e)*y%e,v=gt(x,a,e)*p%e,m=gt(v,r,e)*u%e,A=gt(m,o,e)*d%e,S=gt(A,n,e)*f%e,B=gt(S,Go,e);if(!$o.eql($o.sqr(B),t))throw new Error("Cannot find square root");return B}var $o=ci(Of,void 0,void 0,{sqrt:l1}),Oe=Pf({a:BigInt(0),b:BigInt(7),Fp:$o,n:Uf,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=Uf,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-h1*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=Kf(s*t,e),c=Kf(-n*t,e),f=at(t-a*r-c*i,e),u=at(-a*n-c*s,e),h=f>o,l=u>o;if(h&&(f=e-f),l&&(u=e-u),f>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:f,k2neg:l,k2:u}}}},Nr),Mv=BigInt(0);var Fv=Oe.ProjectivePoint;function Mf(){return Oe.utils.randomPrivateKey()}async function Ff(t,e){let{digest:r}=await Ft.digest(e);try{return Oe.sign(r,t).toDERRawBytes()}catch(n){throw new it(String(n),"ERR_INVALID_INPUT")}}async function Vf(t,e,r){try{let{digest:n}=await Ft.digest(r);return Oe.verify(e,n,t)}catch(n){throw new it(String(n),"ERR_INVALID_INPUT")}}function Hf(t){return Oe.ProjectivePoint.fromHex(t).toRawBytes(!0)}function qf(t){try{Oe.getPublicKey(t,!0)}catch(e){throw new it(String(e),"ERR_INVALID_PRIVATE_KEY")}}function Wo(t){try{Oe.ProjectivePoint.fromHex(t)}catch(e){throw new it(String(e),"ERR_INVALID_PUBLIC_KEY")}}function zf(t){try{return Oe.getPublicKey(t,!0)}catch(e){throw new it(String(e),"ERR_INVALID_PRIVATE_KEY")}}var Dn=class{_key;constructor(e){Wo(e),this._key=e}async verify(e,r){return Vf(this._key,r,e)}marshal(){return Hf(this._key)}get bytes(){return we.encode({Type:wt.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Rt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},kn=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r??zf(e),qf(this._key),Wo(this._publicKey)}async sign(e){return Ff(this._key,e)}get public(){return new Dn(this._publicKey)}marshal(){return this._key}get bytes(){return Ee.encode({Type:wt.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Rt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=await this.public.hash();return Et(e,"base58btc")}async export(e,r="libp2p-key"){if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function p1(t){return new kn(t)}function y1(t){return new Dn(t)}async function g1(){let t=Mf();return new kn(t)}var Er={rsa:zo,ed25519:Mo,secp256k1:Yo};function Gf(t){let e=Object.keys(Er).join(" / ");return new it(`invalid or unsupported key type ${t}. Must be ${e}`,"ERR_UNSUPPORTED_KEY_TYPE")}function $f(t){let e=we.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case wt.RSA:return Er.rsa.unmarshalRsaPublicKey(r);case wt.Ed25519:return Er.ed25519.unmarshalEd25519PublicKey(r);case wt.Secp256k1:return Er.secp256k1.unmarshalSecp256k1PublicKey(r);default:throw Gf(e.Type??"unknown")}}async function Wf(t){let e=Ee.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case wt.RSA:return Er.rsa.unmarshalRsaPrivateKey(r);case wt.Ed25519:return Er.ed25519.unmarshalEd25519PrivateKey(r);case wt.Secp256k1:return Er.secp256k1.unmarshalSecp256k1PrivateKey(r);default:throw Gf(e.Type??"RSA")}}var Yf=Symbol.for("@libp2p/peer-id");var m1=Symbol.for("nodejs.util.inspect.custom"),Zf=Object.values(Mr).map(t=>t.decoder).reduce((t,e)=>t.or(e),Mr.identity.decoder),Xf=114,Zo=36,Xo=37,Pn=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[Yf]=!0;toString(){return this.string==null&&(this.string=Mt.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return or.createV1(Xf,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return Rt(this.multihash.bytes,e);if(typeof e=="string")return b1(e).equals(this);if(e?.multihash?.bytes!=null)return Rt(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[m1](){return`PeerId(${this.toString()})`}},Xr=class extends Pn{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},Qr=class extends Pn{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},Jr=class extends Pn{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function b1(t,e){if(e=e??Zf,t.charAt(0)==="1"||t.charAt(0)==="Q"){let r=pn(Mt.decode(`z${t}`));return t.startsWith("12D")?new Qr({multihash:r}):t.startsWith("16U")?new Jr({multihash:r}):new Xr({multihash:r})}return v1(Zf.decode(t))}function v1(t){try{let e=pn(t);if(e.code===Ye.code){if(e.digest.length===Zo)return new Qr({multihash:e});if(e.digest.length===Xo)return new Jr({multihash:e})}if(e.code===Ft.code)return new Xr({multihash:e})}catch{return w1(or.decode(t))}throw new Error("Supplied PeerID CID is invalid")}function w1(t){if(t==null||t.multihash==null||t.version==null||t.version===1&&t.code!==Xf)throw new Error("Supplied PeerID CID is invalid");let e=t.multihash;if(e.code===Ft.code)return new Xr({multihash:t.multihash});if(e.code===Ye.code){if(e.digest.length===Zo)return new Qr({multihash:t.multihash});if(e.digest.length===Xo)return new Jr({multihash:t.multihash})}throw new Error("Supplied PeerID CID is invalid")}async function Qo(t,e){return t.length===Zo?new Qr({multihash:pe(Ye.code,t),privateKey:e}):t.length===Xo?new Jr({multihash:pe(Ye.code,t),privateKey:e}):new Xr({multihash:await Ft.digest(t),publicKey:t,privateKey:e})}var Fi;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{if(i.lengthDelimited!==!1&&n.fork(),r.webtransportCerthashes!=null)for(let s of r.webtransportCerthashes)n.uint32(10),n.bytes(s);i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={webtransportCerthashes:[]},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:{i.webtransportCerthashes.push(r.bytes());break}default:{r.skipType(o&7);break}}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Fi||(Fi={}));var Un;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.identityKey!=null&&r.identityKey.byteLength>0&&(n.uint32(10),n.bytes(r.identityKey)),r.identitySig!=null&&r.identitySig.byteLength>0&&(n.uint32(18),n.bytes(r.identitySig)),r.extensions!=null&&(n.uint32(34),Fi.codec().encode(r.extensions,n)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={identityKey:rt(0),identitySig:rt(0)},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:{i.identityKey=r.bytes();break}case 2:{i.identitySig=r.bytes();break}case 4:{i.extensions=Fi.codec().decode(r,r.uint32());break}default:{r.skipType(o&7);break}}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Un||(Un={}));async function Qf(t,e,r){let n=await S1(t,Jf(e));if(t.publicKey==null)throw new Error("PublicKey was missing from local PeerId");return E1(t.publicKey,n,r)}function E1(t,e,r){return Un.encode({identityKey:t,identitySig:e,extensions:r??{webtransportCerthashes:[]}}).subarray()}async function S1(t,e){if(t.privateKey==null)throw new Error("PrivateKey was missing from PeerId");return(await Wf(t.privateKey)).sign(e)}async function Jo(t){return Qo(t.identityKey)}function jo(t){return Un.decode(t)}function Jf(t){let e=At("noise-libp2p-static-key:");return Bt([e,t],e.length+t.length)}async function ta(t,e,r){let n=await Qo(e.identityKey);if(!n.equals(r))throw new Error(`Payload identity key ${n.toString()} does not match expected remote peer ${r.toString()}`);let i=Jf(t);if(n.publicKey==null)throw new Error("PublicKey was missing from PeerId");if(e.identitySig==null)throw new Error("Signature was missing from message");if(!await $f(n.publicKey).verify(i,e.identitySig))throw new Error("Static key doesn't match to peer that signed payload!");return n}function Kn(t){return!(!(t instanceof Uint8Array)||t.length!==32)}var jt=zt(nu(),1);jt.default.formatters.b=t=>t==null?"undefined":Mt.baseEncode(t);jt.default.formatters.t=t=>t==null?"undefined":We.baseEncode(t);jt.default.formatters.m=t=>t==null?"undefined":kr.baseEncode(t);jt.default.formatters.p=t=>t==null?"undefined":t.toString();jt.default.formatters.c=t=>t==null?"undefined":t.toString();jt.default.formatters.k=t=>t==null?"undefined":t.toString();jt.default.formatters.a=t=>t==null?"undefined":t.toString();function U1(t){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=t,e.destroy=()=>!0,e.extend=()=>e,e}function iu(t){let e=U1(`${t}:trace`);return jt.default.enabled(`${t}:trace`)&&jt.default.names.map(r=>r.toString()).find(r=>r.includes(":trace"))!=null&&(e=(0,jt.default)(`${t}:trace`)),Object.assign((0,jt.default)(t),{error:(0,jt.default)(`${t}:error`),trace:e})}var Pt=iu("libp2p:noise");var se;Ia?se=Pt:se=Object.assign(()=>{},{enabled:!1,trace:()=>{},error:()=>{}});function su(t){se(`LOCAL_STATIC_PUBLIC_KEY ${Et(t.publicKey,"hex")}`),se(`LOCAL_STATIC_PRIVATE_KEY ${Et(t.privateKey,"hex")}`)}function ea(t){t?(se(`LOCAL_PUBLIC_EPHEMERAL_KEY ${Et(t.publicKey,"hex")}`),se(`LOCAL_PRIVATE_EPHEMERAL_KEY ${Et(t.privateKey,"hex")}`)):se("Missing local ephemeral keys.")}function ou(t){se(`REMOTE_STATIC_PUBLIC_KEY ${Et(t,"hex")}`)}function ra(t){se(`REMOTE_EPHEMERAL_PUBLIC_KEY ${Et(t,"hex")}`)}function au(t){t.cs1&&t.cs2?(se(`CIPHER_STATE_1 ${t.cs1.n.getUint64()} ${Et(t.cs1.k,"hex")}`),se(`CIPHER_STATE_2 ${t.cs2.n.getUint64()} ${Et(t.cs2.k,"hex")}`)):se("Missing cipher state.")}var K1=0,O1=4294967295,M1="Cipherstate has reached maximum n, a new handshake must be performed",qi=class{n;bytes;view;constructor(e=K1){this.n=e,this.bytes=rt(12),this.view=new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength),this.view.setUint32(4,e,!0)}increment(){this.n++,this.view.setUint32(4,this.n,!0)}getBytes(){return this.bytes}getUint64(){return this.n}assertValue(){if(this.n>O1)throw new Error(M1)}};var zi=class{crypto;constructor(e){this.crypto=e}encryptWithAd(e,r,n){let i=this.encrypt(e.k,e.n,r,n);return e.n.increment(),i}decryptWithAd(e,r,n,i){let{plaintext:s,valid:o}=this.decrypt(e.k,e.n,r,n,i);return o&&e.n.increment(),{plaintext:s,valid:o}}hasKey(e){return!this.isEmptyKey(e.k)}createEmptyKey(){return rt(32)}isEmptyKey(e){let r=this.createEmptyKey();return Rt(r,e)}encrypt(e,r,n,i){return r.assertValue(),this.crypto.chaCha20Poly1305Encrypt(i,r.getBytes(),n,e)}encryptAndHash(e,r){let n;return this.hasKey(e.cs)?n=this.encryptWithAd(e.cs,e.h,r):n=r,this.mixHash(e,n),n}decrypt(e,r,n,i,s){r.assertValue();let o=this.crypto.chaCha20Poly1305Decrypt(i,r.getBytes(),n,e,s);return o?{plaintext:o,valid:!0}:{plaintext:rt(0),valid:!1}}decryptAndHash(e,r){let n,i=!0;return this.hasKey(e.cs)?{plaintext:n,valid:i}=this.decryptWithAd(e.cs,e.h,r):n=r,this.mixHash(e,r),{plaintext:n,valid:i}}dh(e,r){try{let n=this.crypto.generateX25519SharedKey(e,r);return n.length===32?n:n.subarray(0,32)}catch(n){let i=n;return Pt.error(i),rt(32)}}mixHash(e,r){e.h=this.getHash(e.h,r)}getHash(e,r){return this.crypto.hashSHA256(Bt([e,r],e.length+r.length))}mixKey(e,r){let[n,i]=this.crypto.getHKDF(e.ck,r);e.cs=this.initializeKey(i),e.ck=n}initializeKey(e){return{k:e,n:new qi}}initializeSymmetric(e){let r=At(e,"utf-8"),n=this.hashProtocolName(r),i=n,s=this.createEmptyKey();return{cs:this.initializeKey(s),ck:i,h:n}}hashProtocolName(e){if(e.length<=32){let r=rt(32);return r.set(e),r}else return this.getHash(e,rt(0))}split(e){let[r,n]=this.crypto.getHKDF(e.ck,rt(0)),i=this.initializeKey(r),s=this.initializeKey(n);return{cs1:i,cs2:s}}writeMessageRegular(e,r){let n=this.encryptWithAd(e,rt(0),r),i=this.createEmptyKey(),s=rt(0);return{ne:i,ns:s,ciphertext:n}}readMessageRegular(e,r){return this.decryptWithAd(e,rt(0),r.ciphertext)}};var Gi=class extends zi{initializeInitiator(e,r,n,i){let s="Noise_XX_25519_ChaChaPoly_SHA256",o=this.initializeSymmetric(s);this.mixHash(o,e);let a=rt(32);return{ss:o,s:r,rs:n,psk:i,re:a}}initializeResponder(e,r,n,i){let s="Noise_XX_25519_ChaChaPoly_SHA256",o=this.initializeSymmetric(s);this.mixHash(o,e);let a=rt(32);return{ss:o,s:r,rs:n,psk:i,re:a}}writeMessageA(e,r,n){let i=rt(0);n!==void 0?e.e=n:e.e=this.crypto.generateX25519KeyPair();let s=e.e.publicKey;this.mixHash(e.ss,s);let o=this.encryptAndHash(e.ss,r);return{ne:s,ns:i,ciphertext:o}}writeMessageB(e,r){e.e=this.crypto.generateX25519KeyPair();let n=e.e.publicKey;this.mixHash(e.ss,n),this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));let i=e.s.publicKey,s=this.encryptAndHash(e.ss,i);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));let o=this.encryptAndHash(e.ss,r);return{ne:n,ns:s,ciphertext:o}}writeMessageC(e,r){let n=e.s.publicKey,i=this.encryptAndHash(e.ss,n);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));let s=this.encryptAndHash(e.ss,r),a={ne:this.createEmptyKey(),ns:i,ciphertext:s},{cs1:c,cs2:f}=this.split(e.ss);return{h:e.ss.h,messageBuffer:a,cs1:c,cs2:f}}readMessageA(e,r){return Kn(r.ne)&&(e.re=r.ne),this.mixHash(e.ss,e.re),this.decryptAndHash(e.ss,r.ciphertext)}readMessageB(e,r){if(Kn(r.ne)&&(e.re=r.ne),this.mixHash(e.ss,e.re),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));let{plaintext:n,valid:i}=this.decryptAndHash(e.ss,r.ns);i&&Kn(n)&&(e.rs=n),this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));let{plaintext:s,valid:o}=this.decryptAndHash(e.ss,r.ciphertext);return{plaintext:s,valid:i&&o}}readMessageC(e,r){let{plaintext:n,valid:i}=this.decryptAndHash(e.ss,r.ns);if(i&&Kn(n)&&(e.rs=n),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));let{plaintext:s,valid:o}=this.decryptAndHash(e.ss,r.ciphertext),{cs1:a,cs2:c}=this.split(e.ss);return{h:e.ss.h,plaintext:s,valid:i&&o,cs1:a,cs2:c}}initSession(e,r,n){let i=this.createEmptyKey(),s=rt(32),o;return e?o=this.initializeInitiator(r,n,s,i):o=this.initializeResponder(r,n,s,i),{hs:o,i:e,mc:0}}sendMessage(e,r,n){let i;if(e.mc===0)i=this.writeMessageA(e.hs,r,n);else if(e.mc===1)i=this.writeMessageB(e.hs,r);else if(e.mc===2){let{h:s,messageBuffer:o,cs1:a,cs2:c}=this.writeMessageC(e.hs,r);i=o,e.h=s,e.cs1=a,e.cs2=c}else if(e.mc>2)if(e.i){if(!e.cs1)throw new Error("CS1 (cipher state) is not defined");i=this.writeMessageRegular(e.cs1,r)}else{if(!e.cs2)throw new Error("CS2 (cipher state) is not defined");i=this.writeMessageRegular(e.cs2,r)}else throw new Error("Session invalid.");return e.mc++,i}recvMessage(e,r){let n=rt(0),i=!1;if(e.mc===0)({plaintext:n,valid:i}=this.readMessageA(e.hs,r));else if(e.mc===1)({plaintext:n,valid:i}=this.readMessageB(e.hs,r));else if(e.mc===2){let{h:s,plaintext:o,valid:a,cs1:c,cs2:f}=this.readMessageC(e.hs,r);n=o,i=a,e.h=s,e.cs1=c,e.cs2=f}return e.mc++,{plaintext:n,valid:i}}};var $i=class{isInitiator;session;remotePeer;remoteExtensions={webtransportCerthashes:[]};payload;connection;xx;staticKeypair;prologue;constructor(e,r,n,i,s,o,a,c){this.isInitiator=e,this.payload=r,this.prologue=n,this.staticKeypair=s,this.connection=o,a&&(this.remotePeer=a),this.xx=c??new Gi(i),this.session=this.xx.initSession(this.isInitiator,this.prologue,this.staticKeypair)}async propose(){if(su(this.session.hs.s),this.isInitiator){Pt.trace("Stage 0 - Initiator starting to send first message.");let e=this.xx.sendMessage(this.session,rt(0));await this.connection.write(T0(e)),Pt.trace("Stage 0 - Initiator finished sending first message."),ea(this.session.hs.e)}else{Pt.trace("Stage 0 - Responder waiting to receive first message...");let e=R0((await this.connection.read()).subarray()),{valid:r}=this.xx.recvMessage(this.session,e);if(!r)throw new ar("xx handshake stage 0 validation fail");Pt.trace("Stage 0 - Responder received first message."),ra(this.session.hs.re)}}async exchange(){if(this.isInitiator){Pt.trace("Stage 1 - Initiator waiting to receive first message from responder...");let e=N0((await this.connection.read()).subarray()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new ar("xx handshake stage 1 validation fail");Pt.trace("Stage 1 - Initiator received the message."),ra(this.session.hs.re),ou(this.session.hs.rs),Pt.trace("Initiator going to check remote's signature...");try{let i=jo(r);this.remotePeer=this.remotePeer||await Jo(i),await ta(this.session.hs.rs,i,this.remotePeer),this.setRemoteNoiseExtension(i.extensions)}catch(i){let s=i;throw new mn(`Error occurred while verifying signed payload: ${s.message}`)}Pt.trace("All good with the signature!")}else{Pt.trace("Stage 1 - Responder sending out first message with signed payload and static key.");let e=this.xx.sendMessage(this.session,this.payload);await this.connection.write(_0(e)),Pt.trace("Stage 1 - Responder sent the second handshake message with signed payload."),ea(this.session.hs.e)}}async finish(){if(this.isInitiator){Pt.trace("Stage 2 - Initiator sending third handshake message.");let e=this.xx.sendMessage(this.session,this.payload);await this.connection.write(L0(e)),Pt.trace("Stage 2 - Initiator sent message with signed payload.")}else{Pt.trace("Stage 2 - Responder waiting for third handshake message...");let e=D0((await this.connection.read()).subarray()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new ar("xx handshake stage 2 validation fail");Pt.trace("Stage 2 - Responder received the message, finished handshake.");try{let i=jo(r);this.remotePeer=this.remotePeer||await Jo(i),await ta(this.session.hs.rs,i,this.remotePeer),this.setRemoteNoiseExtension(i.extensions)}catch(i){let s=i;throw new mn(`Error occurred while verifying signed payload: ${s.message}`)}}au(this.session)}encrypt(e,r){let n=this.getCS(r);return this.xx.encryptWithAd(n,rt(0),e)}decrypt(e,r,n){let i=this.getCS(r,!1);return this.xx.decryptWithAd(i,rt(0),e,n)}getRemoteStaticKey(){return this.session.hs.rs}getCS(e,r=!0){if(!e.cs1||!e.cs2)throw new ar("Handshake not completed properly, cipher state does not exist.");return this.isInitiator?r?e.cs1:e.cs2:r?e.cs2:e.cs1}setRemoteNoiseExtension(e){e&&(this.remoteExtensions=e)}};function cu(t){return{xxHandshakeSuccesses:t.registerCounter("libp2p_noise_xxhandshake_successes_total",{help:"Total count of noise xxHandshakes successes_"}),xxHandshakeErrors:t.registerCounter("libp2p_noise_xxhandshake_error_total",{help:"Total count of noise xxHandshakes errors"}),encryptedPackets:t.registerCounter("libp2p_noise_encrypted_packets_total",{help:"Total count of noise encrypted packets successfully"}),decryptedPackets:t.registerCounter("libp2p_noise_decrypted_packets_total",{help:"Total count of noise decrypted packets"}),decryptErrors:t.registerCounter("libp2p_noise_decrypt_errors_total",{help:"Total count of noise decrypt errors"})}}var Wi=class{protocol="/noise";crypto;prologue;staticKeys;extensions;metrics;constructor(e={}){let{staticNoiseKey:r,extensions:n,crypto:i,prologueBytes:s,metrics:o}=e;this.crypto=i??a0,this.extensions=n,this.metrics=o?cu(o):void 0,r?this.staticKeys=this.crypto.generateX25519KeyPairFromSeed(r):this.staticKeys=this.crypto.generateX25519KeyPair(),this.prologue=s??rt(0)}async secureOutbound(e,r,n){let i=ns(r,{lengthEncoder:Fr,lengthDecoder:gn,maxDataLength:65535}),s=await this.performHandshake({connection:i,isInitiator:!0,localPeer:e,remotePeer:n});return{conn:await this.createSecureConnection(i,s),remoteExtensions:s.remoteExtensions,remotePeer:s.remotePeer}}async secureInbound(e,r,n){let i=ns(r,{lengthEncoder:Fr,lengthDecoder:gn,maxDataLength:65535}),s=await this.performHandshake({connection:i,isInitiator:!1,localPeer:e,remotePeer:n});return{conn:await this.createSecureConnection(i,s),remotePeer:s.remotePeer,remoteExtensions:s.remoteExtensions}}async performHandshake(e){let r=await Qf(e.localPeer,this.staticKeys.publicKey,this.extensions);return this.performXXHandshake(e,r)}async performXXHandshake(e,r){let{isInitiator:n,remotePeer:i,connection:s}=e,o=new $i(n,r,this.prologue,this.crypto,this.staticKeys,s,i);try{await o.propose(),await o.exchange(),await o.finish(),this.metrics?.xxHandshakeSuccesses.increment()}catch(a){if(this.metrics?.xxHandshakeErrors.increment(),a instanceof Error)throw a.message=`Error occurred during XX handshake: ${a.message}`,a}return o}async createSecureConnection(e,r){let[n,i]=Ea(),s=e.unwrap();return await Ba(n,U0(r,this.metrics),s,o=>sn(o,{lengthDecoder:gn}),K0(r,this.metrics),n),i}};function F1(t={}){return()=>new Wi(t)}return Eu(V1);})(); -/*! Bundled license information: - -@noble/ciphers/esm/utils.js: - (*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *) - -@noble/hashes/esm/utils.js: - (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/modular.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/curve.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/edwards.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/montgomery.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/ed25519.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/weierstrass.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/_shortw_utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/secp256k1.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) -*/ -return ChainsafeLibp2PNoise})); diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/basic.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/basic.d.ts deleted file mode 100644 index 5b8bbb19b..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/basic.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type bytes = Uint8Array; -export type bytes32 = Uint8Array; -export type bytes16 = Uint8Array; -export type uint64 = number; -//# sourceMappingURL=basic.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/basic.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/basic.d.ts.map deleted file mode 100644 index eeee2bada..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/basic.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../src/@types/basic.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG,UAAU,CAAA;AAC9B,MAAM,MAAM,OAAO,GAAG,UAAU,CAAA;AAChC,MAAM,MAAM,OAAO,GAAG,UAAU,CAAA;AAEhC,MAAM,MAAM,MAAM,GAAG,MAAM,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/basic.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/basic.js deleted file mode 100644 index f839d2b8c..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/basic.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=basic.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/basic.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/basic.js.map deleted file mode 100644 index aa623d697..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/basic.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"basic.js","sourceRoot":"","sources":["../../../src/@types/basic.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake-interface.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake-interface.d.ts deleted file mode 100644 index 40a820d88..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake-interface.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { bytes } from './basic.js'; -import type { NoiseSession } from './handshake.js'; -import type { NoiseExtensions } from '../proto/payload.js'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export interface IHandshake { - session: NoiseSession; - remotePeer: PeerId; - remoteExtensions: NoiseExtensions; - encrypt: (plaintext: bytes, session: NoiseSession) => bytes; - decrypt: (ciphertext: bytes, session: NoiseSession, dst?: Uint8Array) => { - plaintext: bytes; - valid: boolean; - }; -} -//# sourceMappingURL=handshake-interface.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake-interface.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake-interface.d.ts.map deleted file mode 100644 index 2b64678a8..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake-interface.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake-interface.d.ts","sourceRoot":"","sources":["../../../src/@types/handshake-interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,YAAY,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,eAAe,CAAA;IACjC,OAAO,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,KAAK,KAAK,CAAA;IAC3D,OAAO,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,UAAU,KAAK;QAAE,SAAS,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAA;CAC9G"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake-interface.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake-interface.js deleted file mode 100644 index 6cb504ea8..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake-interface.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=handshake-interface.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake-interface.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake-interface.js.map deleted file mode 100644 index f59aae35f..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake-interface.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake-interface.js","sourceRoot":"","sources":["../../../src/@types/handshake-interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake.d.ts deleted file mode 100644 index 558a55238..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { bytes, bytes32, uint64 } from './basic.js'; -import type { KeyPair } from './libp2p.js'; -import type { Nonce } from '../nonce.js'; -export type Hkdf = [bytes, bytes, bytes]; -export interface MessageBuffer { - ne: bytes32; - ns: bytes; - ciphertext: bytes; -} -export interface CipherState { - k: bytes32; - n: Nonce; -} -export interface SymmetricState { - cs: CipherState; - ck: bytes32; - h: bytes32; -} -export interface HandshakeState { - ss: SymmetricState; - s: KeyPair; - e?: KeyPair; - rs: bytes32; - re: bytes32; - psk: bytes32; -} -export interface NoiseSession { - hs: HandshakeState; - h?: bytes32; - cs1?: CipherState; - cs2?: CipherState; - mc: uint64; - i: boolean; -} -export interface INoisePayload { - identityKey: bytes; - identitySig: bytes; - data: bytes; -} -//# sourceMappingURL=handshake.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake.d.ts.map deleted file mode 100644 index e4a428b8e..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake.d.ts","sourceRoot":"","sources":["../../../src/@types/handshake.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAExC,MAAM,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;AAExC,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAA;IACX,EAAE,EAAE,KAAK,CAAA;IACT,UAAU,EAAE,KAAK,CAAA;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,OAAO,CAAA;IAGV,CAAC,EAAE,KAAK,CAAA;CACT;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,WAAW,CAAA;IACf,EAAE,EAAE,OAAO,CAAA;IACX,CAAC,EAAE,OAAO,CAAA;CACX;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,cAAc,CAAA;IAClB,CAAC,EAAE,OAAO,CAAA;IACV,CAAC,CAAC,EAAE,OAAO,CAAA;IACX,EAAE,EAAE,OAAO,CAAA;IACX,EAAE,EAAE,OAAO,CAAA;IACX,GAAG,EAAE,OAAO,CAAA;CACb;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,cAAc,CAAA;IAClB,CAAC,CAAC,EAAE,OAAO,CAAA;IACX,GAAG,CAAC,EAAE,WAAW,CAAA;IACjB,GAAG,CAAC,EAAE,WAAW,CAAA;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,CAAC,EAAE,OAAO,CAAA;CACX;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,KAAK,CAAA;IAClB,WAAW,EAAE,KAAK,CAAA;IAClB,IAAI,EAAE,KAAK,CAAA;CACZ"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake.js deleted file mode 100644 index 39c1bf13f..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=handshake.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake.js.map deleted file mode 100644 index bed86a99f..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/handshake.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake.js","sourceRoot":"","sources":["../../../src/@types/handshake.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/libp2p.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/libp2p.d.ts deleted file mode 100644 index d573b2ab6..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/libp2p.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { bytes32 } from './basic.js'; -import type { NoiseExtensions } from '../proto/payload.js'; -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter'; -export interface KeyPair { - publicKey: bytes32; - privateKey: bytes32; -} -export interface INoiseConnection extends ConnectionEncrypter { -} -//# sourceMappingURL=libp2p.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/libp2p.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/libp2p.d.ts.map deleted file mode 100644 index 07f8bb308..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/libp2p.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"libp2p.d.ts","sourceRoot":"","sources":["../../../src/@types/libp2p.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAEjF,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB,CAAC,eAAe,CAAC;CAAG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/libp2p.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/libp2p.js deleted file mode 100644 index 9b5e5678e..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/libp2p.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=libp2p.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/libp2p.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/libp2p.js.map deleted file mode 100644 index efd4520e6..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/@types/libp2p.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"libp2p.js","sourceRoot":"","sources":["../../../src/@types/libp2p.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/constants.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/constants.d.ts deleted file mode 100644 index 576fb1857..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/constants.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare const NOISE_MSG_MAX_LENGTH_BYTES = 65535; -export declare const NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG: number; -export declare const DUMP_SESSION_KEYS: boolean; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/constants.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/constants.d.ts.map deleted file mode 100644 index 8bb0fa819..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,QAAQ,CAAA;AAC/C,eAAO,MAAM,sCAAsC,QAAkC,CAAA;AAErF,eAAO,MAAM,iBAAiB,SAAsD,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/constants.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/constants.js deleted file mode 100644 index e1381b284..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/constants.js +++ /dev/null @@ -1,4 +0,0 @@ -export const NOISE_MSG_MAX_LENGTH_BYTES = 65535; -export const NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG = NOISE_MSG_MAX_LENGTH_BYTES - 16; -export const DUMP_SESSION_KEYS = Boolean(globalThis.process?.env?.DUMP_SESSION_KEYS); -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/constants.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/constants.js.map deleted file mode 100644 index d21a05013..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAA;AAC/C,MAAM,CAAC,MAAM,sCAAsC,GAAG,0BAA0B,GAAG,EAAE,CAAA;AAErF,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto.d.ts deleted file mode 100644 index c98b18b9a..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { bytes32, bytes } from './@types/basic.js'; -import type { Hkdf } from './@types/handshake.js'; -import type { KeyPair } from './@types/libp2p.js'; -export interface ICryptoInterface { - hashSHA256: (data: Uint8Array) => Uint8Array; - getHKDF: (ck: bytes32, ikm: Uint8Array) => Hkdf; - generateX25519KeyPair: () => KeyPair; - generateX25519KeyPairFromSeed: (seed: Uint8Array) => KeyPair; - generateX25519SharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Uint8Array; - chaCha20Poly1305Encrypt: (plaintext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32) => bytes; - chaCha20Poly1305Decrypt: (ciphertext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array) => bytes | null; -} -//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto.d.ts.map deleted file mode 100644 index 21fb764ad..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,UAAU,CAAA;IAE5C,OAAO,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,KAAK,IAAI,CAAA;IAE/C,qBAAqB,EAAE,MAAM,OAAO,CAAA;IACpC,6BAA6B,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAA;IAC5D,uBAAuB,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,KAAK,UAAU,CAAA;IAEtF,uBAAuB,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,KAAK,KAAK,CAAA;IACxG,uBAAuB,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,UAAU,KAAK,KAAK,GAAG,IAAI,CAAA;CACnI"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto.js deleted file mode 100644 index d4b4414d0..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto.js.map deleted file mode 100644 index e85268dce..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.browser.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.browser.d.ts deleted file mode 100644 index c819d1f23..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.browser.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const defaultCrypto: import("..").ICryptoInterface; -//# sourceMappingURL=index.browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.browser.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.browser.d.ts.map deleted file mode 100644 index 8ae396c49..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../../../src/crypto/index.browser.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,+BAAe,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.browser.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.browser.js deleted file mode 100644 index 04eea2a62..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.browser.js +++ /dev/null @@ -1,3 +0,0 @@ -import { pureJsCrypto } from './js'; -export const defaultCrypto = pureJsCrypto; -//# sourceMappingURL=index.browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.browser.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.browser.js.map deleted file mode 100644 index e96421aa8..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../../../src/crypto/index.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAEnC,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.d.ts deleted file mode 100644 index cf8aff630..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ICryptoInterface } from '../crypto.js'; -export declare const defaultCrypto: ICryptoInterface; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.d.ts.map deleted file mode 100644 index 5f7efefc8..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crypto/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AA2DpD,eAAO,MAAM,aAAa,EAAE,gBA+E3B,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.js deleted file mode 100644 index bde9ae3dd..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.js +++ /dev/null @@ -1,138 +0,0 @@ -import crypto from 'node:crypto'; -import { newInstance, ChaCha20Poly1305 } from '@chainsafe/as-chacha20poly1305'; -import { digest } from '@chainsafe/as-sha256'; -import { isElectronMain } from 'wherearewe'; -import { pureJsCrypto } from './js.js'; -const ctx = newInstance(); -const asImpl = new ChaCha20Poly1305(ctx); -const CHACHA_POLY1305 = 'chacha20-poly1305'; -const PKCS8_PREFIX = Buffer.from([0x30, 0x2e, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x04, 0x22, 0x04, 0x20]); -const X25519_PREFIX = Buffer.from([0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x03, 0x21, 0x00]); -const nodeCrypto = { - hashSHA256(data) { - return crypto.createHash('sha256').update(data).digest(); - }, - chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - const cipher = crypto.createCipheriv(CHACHA_POLY1305, k, nonce, { - authTagLength: 16 - }); - cipher.setAAD(ad, { plaintextLength: plaintext.byteLength }); - const updated = cipher.update(plaintext); - const final = cipher.final(); - const tag = cipher.getAuthTag(); - const encrypted = Buffer.concat([updated, tag, final], updated.byteLength + tag.byteLength + final.byteLength); - return encrypted; - }, - chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, _dst) { - const authTag = ciphertext.subarray(ciphertext.length - 16); - const text = ciphertext.subarray(0, ciphertext.length - 16); - const decipher = crypto.createDecipheriv(CHACHA_POLY1305, k, nonce, { - authTagLength: 16 - }); - decipher.setAAD(ad, { - plaintextLength: text.byteLength - }); - decipher.setAuthTag(authTag); - const updated = decipher.update(text); - const final = decipher.final(); - if (final.byteLength > 0) { - return Buffer.concat([updated, final], updated.byteLength + final.byteLength); - } - return updated; - } -}; -const asCrypto = { - hashSHA256(data) { - return digest(data); - }, - chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - return asImpl.seal(k, nonce, plaintext, ad); - }, - chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) { - return asImpl.open(k, nonce, ciphertext, ad, dst); - } -}; -// benchmarks show that for chacha20poly1305 -// the as implementation is faster for smaller payloads(<1200) -// and the node implementation is faster for larger payloads -export const defaultCrypto = { - ...pureJsCrypto, - hashSHA256(data) { - return nodeCrypto.hashSHA256(data); - }, - chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - if (plaintext.length < 1200) { - return asCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k); - } - return nodeCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k); - }, - chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) { - if (ciphertext.length < 1200) { - return asCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst); - } - return nodeCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst); - }, - generateX25519KeyPair() { - const { publicKey, privateKey } = crypto.generateKeyPairSync('x25519', { - publicKeyEncoding: { - type: 'spki', - format: 'der' - }, - privateKeyEncoding: { - type: 'pkcs8', - format: 'der' - } - }); - return { - publicKey: publicKey.subarray(X25519_PREFIX.length), - privateKey: privateKey.subarray(PKCS8_PREFIX.length) - }; - }, - generateX25519KeyPairFromSeed(seed) { - const privateKey = crypto.createPrivateKey({ - key: Buffer.concat([ - PKCS8_PREFIX, - seed - ], PKCS8_PREFIX.byteLength + seed.byteLength), - type: 'pkcs8', - format: 'der' - }); - const publicKey = crypto.createPublicKey(privateKey) - .export({ - type: 'spki', - format: 'der' - }).subarray(X25519_PREFIX.length); - return { - publicKey, - privateKey: seed - }; - }, - generateX25519SharedKey(privateKey, publicKey) { - publicKey = Buffer.concat([ - X25519_PREFIX, - publicKey - ], X25519_PREFIX.byteLength + publicKey.byteLength); - privateKey = Buffer.concat([ - PKCS8_PREFIX, - privateKey - ], PKCS8_PREFIX.byteLength + privateKey.byteLength); - return crypto.diffieHellman({ - publicKey: crypto.createPublicKey({ - key: Buffer.from(publicKey, publicKey.byteOffset, publicKey.byteLength), - type: 'spki', - format: 'der' - }), - privateKey: crypto.createPrivateKey({ - key: Buffer.from(privateKey, privateKey.byteOffset, privateKey.byteLength), - type: 'pkcs8', - format: 'der' - }) - }); - } -}; -// no chacha20-poly1305 in electron https://github.com/electron/electron/issues/24024 -if (isElectronMain) { - defaultCrypto.chaCha20Poly1305Encrypt = asCrypto.chaCha20Poly1305Encrypt; - defaultCrypto.chaCha20Poly1305Decrypt = asCrypto.chaCha20Poly1305Decrypt; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.js.map deleted file mode 100644 index 8e5524ac5..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/crypto/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAItC,MAAM,GAAG,GAAG,WAAW,EAAE,CAAA;AACzB,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,GAAG,CAAC,CAAA;AACxC,MAAM,eAAe,GAAG,mBAAmB,CAAA;AAC3C,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AAClI,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,E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AG,QAAQ,CAAC,uBAAuB,CAAA;IACxE,aAAa,CAAC,uBAAuB,GAAG,QAAQ,CAAC,uBAAuB,CAAA;CACzE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/js.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/js.d.ts deleted file mode 100644 index 4020b8611..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/js.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ICryptoInterface } from '../crypto.js'; -export declare const pureJsCrypto: ICryptoInterface; -//# sourceMappingURL=js.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/js.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/js.d.ts.map deleted file mode 100644 index d9693c950..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/js.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"js.d.ts","sourceRoot":"","sources":["../../../src/crypto/js.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpD,eAAO,MAAM,YAAY,EAAE,gBA+C1B,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/js.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/js.js deleted file mode 100644 index b2aa8b079..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/js.js +++ /dev/null @@ -1,43 +0,0 @@ -import { chacha20poly1305 } from '@noble/ciphers/chacha'; -import { x25519 } from '@noble/curves/ed25519'; -import { extract, expand } from '@noble/hashes/hkdf'; -import { sha256 } from '@noble/hashes/sha256'; -export const pureJsCrypto = { - hashSHA256(data) { - return sha256(data); - }, - getHKDF(ck, ikm) { - const prk = extract(sha256, ikm, ck); - const okmU8Array = expand(sha256, prk, undefined, 96); - const okm = okmU8Array; - const k1 = okm.subarray(0, 32); - const k2 = okm.subarray(32, 64); - const k3 = okm.subarray(64, 96); - return [k1, k2, k3]; - }, - generateX25519KeyPair() { - const secretKey = x25519.utils.randomPrivateKey(); - const publicKey = x25519.getPublicKey(secretKey); - return { - publicKey, - privateKey: secretKey - }; - }, - generateX25519KeyPairFromSeed(seed) { - const publicKey = x25519.getPublicKey(seed); - return { - publicKey, - privateKey: seed - }; - }, - generateX25519SharedKey(privateKey, publicKey) { - return x25519.getSharedSecret(privateKey, publicKey); - }, - chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - return chacha20poly1305(k, nonce, ad).encrypt(plaintext); - }, - chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) { - return chacha20poly1305(k, nonce, ad).decrypt(ciphertext, dst); - } -}; -//# sourceMappingURL=js.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/js.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/js.js.map deleted file mode 100644 index a58e0e68d..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/js.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"js.js","sourceRoot":"","sources":["../../../src/crypto/js.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAM7C,MAAM,CAAC,MAAM,YAAY,GAAqB;IAC5C,UAAU,CAAE,IAAgB;QAC1B,OAAO,MAAM,CAAC,IAAI,CAAC,CAAA;IACrB,CAAC;IAED,OAAO,CAAE,EAAW,EAAE,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E,KAAiB,EAAE,EAAc,EAAE,CAAU,EAAE,GAAgB;QAC9G,OAAO,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;IAChE,CAAC;CACF,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/streaming.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/streaming.d.ts deleted file mode 100644 index fcef15b00..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/streaming.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IHandshake } from '../@types/handshake-interface.js'; -import type { MetricsRegistry } from '../metrics.js'; -import type { Transform } from 'it-stream-types'; -import type { Uint8ArrayList } from 'uint8arraylist'; -export declare function encryptStream(handshake: IHandshake, metrics?: MetricsRegistry): Transform>; -export declare function decryptStream(handshake: IHandshake, metrics?: MetricsRegistry): Transform, AsyncIterable>; -//# sourceMappingURL=streaming.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/streaming.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/streaming.d.ts.map deleted file mode 100644 index 4fe6241c7..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/streaming.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../../src/crypto/streaming.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAKpD,wBAAgB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAmBrH;AAGD,wBAAgB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC,CA4BpJ"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/streaming.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/streaming.js deleted file mode 100644 index f09444548..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/streaming.js +++ /dev/null @@ -1,53 +0,0 @@ -import { concat as uint8ArrayConcat } from 'uint8arrays'; -import { NOISE_MSG_MAX_LENGTH_BYTES, NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG } from '../constants.js'; -import { uint16BEEncode } from '../encoder.js'; -const CHACHA_TAG_LENGTH = 16; -// Returns generator that encrypts payload from the user -export function encryptStream(handshake, metrics) { - return async function* (source) { - for await (const chunk of source) { - for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG) { - let end = i + NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG; - if (end > chunk.length) { - end = chunk.length; - } - const data = handshake.encrypt(chunk.subarray(i, end), handshake.session); - metrics?.encryptedPackets.increment(); - yield uint8ArrayConcat([ - uint16BEEncode(data.byteLength), - data - ], 2 + data.byteLength); - } - } - }; -} -// Decrypt received payload to the user -export function decryptStream(handshake, metrics) { - return async function* (source) { - for await (const chunk of source) { - for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES) { - let end = i + NOISE_MSG_MAX_LENGTH_BYTES; - if (end > chunk.length) { - end = chunk.length; - } - if (end - CHACHA_TAG_LENGTH < i) { - throw new Error('Invalid chunk'); - } - const encrypted = chunk.subarray(i, end); - // memory allocation is not cheap so reuse the encrypted Uint8Array - // see https://github.com/ChainSafe/js-libp2p-noise/pull/242#issue-1422126164 - // this is ok because chacha20 reads bytes one by one and don't reread after that - // it's also tested in https://github.com/ChainSafe/as-chacha20poly1305/pull/1/files#diff-25252846b58979dcaf4e41d47b3eadd7e4f335e7fb98da6c049b1f9cd011f381R48 - const dst = chunk.subarray(i, end - CHACHA_TAG_LENGTH); - const { plaintext: decrypted, valid } = handshake.decrypt(encrypted, handshake.session, dst); - if (!valid) { - metrics?.decryptErrors.increment(); - throw new Error('Failed to validate decrypted chunk'); - } - metrics?.decryptedPackets.increment(); - yield decrypted; - } - } - }; -} -//# sourceMappingURL=streaming.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/streaming.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/streaming.js.map deleted file mode 100644 index 0ee2b460a..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/crypto/streaming.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streaming.js","sourceRoot":"","sources":["../../../src/crypto/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,0BAA0B,EAAE,sCAAsC,EAAE,MAAM,iBAAiB,CAAA;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAM9C,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAE5B,wDAAwD;AACxD,MAAM,UAAU,aAAa,CAAE,SAAqB,EAAE,OAAyB;IAC7E,OAAO,KAAK,SAAU,CAAC,EAAE,MAAM;QAC7B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE;YAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC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G,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,iBAAiB,CAAC,CAAA;gBACtD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;gBAC5F,IAAI,CAAC,KAAK,EAAE;oBACV,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,CAAA;oBAClC,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;iBACtD;gBACD,OAAO,EAAE,gBAAgB,CAAC,SAAS,EAAE,CAAA;gBACrC,MAAM,SAAS,CAAA;aAChB;SACF;IACH,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/encoder.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/encoder.d.ts deleted file mode 100644 index d720cce2d..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/encoder.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { bytes } from './@types/basic.js'; -import type { MessageBuffer } from './@types/handshake.js'; -import type { LengthDecoderFunction } from 'it-length-prefixed'; -export declare const uint16BEEncode: { - (value: number): Uint8Array; - bytes: number; -}; -export declare const uint16BEDecode: LengthDecoderFunction; -export declare function encode0(message: MessageBuffer): bytes; -export declare function encode1(message: MessageBuffer): bytes; -export declare function encode2(message: MessageBuffer): bytes; -export declare function decode0(input: bytes): MessageBuffer; -export declare function decode1(input: bytes): MessageBuffer; -export declare function decode2(input: bytes): MessageBuffer; -//# sourceMappingURL=encoder.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/encoder.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/encoder.d.ts.map deleted file mode 100644 index 04b69934b..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/encoder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encoder.d.ts","sourceRoot":"","sources":["../../src/encoder.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAG/D,eAAO,MAAM,cAAc;YAAW,MAAM,GAAG,UAAU;;CAIxD,CAAA;AAGD,eAAO,MAAM,cAAc,EAAE,qBAQ5B,CAAA;AAKD,wBAAgB,OAAO,CAAE,OAAO,EAAE,aAAa,GAAG,KAAK,CAEtD;AAED,wBAAgB,OAAO,CAAE,OAAO,EAAE,aAAa,GAAG,KAAK,CAEtD;AAED,wBAAgB,OAAO,CAAE,OAAO,EAAE,aAAa,GAAG,KAAK,CAEtD;AAED,wBAAgB,OAAO,CAAE,KAAK,EAAE,KAAK,GAAG,aAAa,CAUpD;AAED,wBAAgB,OAAO,CAAE,KAAK,EAAE,KAAK,GAAG,aAAa,CAUpD;AAED,wBAAgB,OAAO,CAAE,KAAK,EAAE,KAAK,GAAG,aAAa,CAUpD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/encoder.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/encoder.js deleted file mode 100644 index 715e2e4f9..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/encoder.js +++ /dev/null @@ -1,58 +0,0 @@ -import { alloc as uint8ArrayAlloc, allocUnsafe as uint8ArrayAllocUnsafe } from 'uint8arrays/alloc'; -import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; -export const uint16BEEncode = (value) => { - const target = uint8ArrayAllocUnsafe(2); - new DataView(target.buffer, target.byteOffset, target.byteLength).setUint16(0, value, false); - return target; -}; -uint16BEEncode.bytes = 2; -export const uint16BEDecode = (data) => { - if (data.length < 2) - throw RangeError('Could not decode int16BE'); - if (data instanceof Uint8Array) { - return new DataView(data.buffer, data.byteOffset, data.byteLength).getUint16(0, false); - } - return data.getUint16(0); -}; -uint16BEDecode.bytes = 2; -// Note: IK and XX encoder usage is opposite (XX uses in stages encode0 where IK uses encode1) -export function encode0(message) { - return uint8ArrayConcat([message.ne, message.ciphertext], message.ne.length + message.ciphertext.length); -} -export function encode1(message) { - return uint8ArrayConcat([message.ne, message.ns, message.ciphertext], message.ne.length + message.ns.length + message.ciphertext.length); -} -export function encode2(message) { - return uint8ArrayConcat([message.ns, message.ciphertext], message.ns.length + message.ciphertext.length); -} -export function decode0(input) { - if (input.length < 32) { - throw new Error('Cannot decode stage 0 MessageBuffer: length less than 32 bytes.'); - } - return { - ne: input.subarray(0, 32), - ciphertext: input.subarray(32, input.length), - ns: uint8ArrayAlloc(0) - }; -} -export function decode1(input) { - if (input.length < 80) { - throw new Error('Cannot decode stage 1 MessageBuffer: length less than 80 bytes.'); - } - return { - ne: input.subarray(0, 32), - ns: input.subarray(32, 80), - ciphertext: input.subarray(80, input.length) - }; -} -export function decode2(input) { - if (input.length < 48) { - throw new Error('Cannot decode stage 2 MessageBuffer: length less than 48 bytes.'); - } - return { - ne: uint8ArrayAlloc(0), - ns: input.subarray(0, 48), - ciphertext: input.subarray(48, input.length) - }; -} -//# sourceMappingURL=encoder.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/encoder.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/encoder.js.map deleted file mode 100644 index ab527c1fd..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/encoder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encoder.js","sourceRoot":"","sources":["../../src/encoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,WAAW,IAAI,qBAAqB,EAAE,MAAM,mBAAmB,CAA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K,CAAC,iEAAiE,CAAC,CAAA;KACnF;IAED,OAAO;QACL,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC;QACtB,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;QACzB,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC;KAC7C,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshake-xx.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshake-xx.d.ts deleted file mode 100644 index 8bde3f774..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshake-xx.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { XX } from './handshakes/xx.js'; -import type { bytes, bytes32 } from './@types/basic.js'; -import type { IHandshake } from './@types/handshake-interface.js'; -import type { NoiseSession } from './@types/handshake.js'; -import type { KeyPair } from './@types/libp2p.js'; -import type { ICryptoInterface } from './crypto.js'; -import type { NoiseExtensions } from './proto/payload.js'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { LengthPrefixedStream } from 'it-length-prefixed-stream'; -export declare class XXHandshake implements IHandshake { - isInitiator: boolean; - session: NoiseSession; - remotePeer: PeerId; - remoteExtensions: NoiseExtensions; - protected payload: bytes; - protected connection: LengthPrefixedStream; - protected xx: XX; - protected staticKeypair: KeyPair; - private readonly prologue; - constructor(isInitiator: boolean, payload: bytes, prologue: bytes32, crypto: ICryptoInterface, staticKeypair: KeyPair, connection: LengthPrefixedStream, remotePeer?: PeerId, handshake?: XX); - propose(): Promise; - exchange(): Promise; - finish(): Promise; - encrypt(plaintext: Uint8Array, session: NoiseSession): bytes; - decrypt(ciphertext: Uint8Array, session: NoiseSession, dst?: Uint8Array): { - plaintext: bytes; - valid: boolean; - }; - getRemoteStaticKey(): bytes; - private getCS; - protected setRemoteNoiseExtension(e: NoiseExtensions | null | undefined): void; -} -//# sourceMappingURL=handshake-xx.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshake-xx.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshake-xx.d.ts.map deleted file mode 100644 index cb8bec51a..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshake-xx.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake-xx.d.ts","sourceRoot":"","sources":["../../src/handshake-xx.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAcvC,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAErE,qBAAa,WAAY,YAAW,UAAU;IACrC,WAAW,EAAE,OAAO,CAAA;IACpB,OAAO,EAAE,YAAY,CAAA;IACrB,UAAU,EAAG,MAAM,CAAA;IACnB,gBAAgB,EAAE,eAAe,CAAiC;IAEzE,SAAS,CAAC,OAAO,EAAE,KAAK,CAAA;IACxB,SAAS,CAAC,UAAU,EAAE,oBAAoB,CAAA;IAC1C,SAAS,CAAC,EAAE,EAAE,EAAE,CAAA;IAChB,SAAS,CAAC,aAAa,EAAE,OAAO,CAAA;IAEhC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;gBAGhC,WAAW,EAAE,OAAO,EACpB,OAAO,EAAE,KAAK,EACd,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,gBAAgB,EACxB,aAAa,EAAE,OAAO,EACtB,UAAU,EAAE,oBAAoB,EAChC,UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,EAAE;IAeH,OAAO,IAAK,OAAO,CAAC,IAAI,CAAC;IAqBzB,QAAQ,IAAK,OAAO,CAAC,IAAI,CAAC;IAiC1B,MAAM,IAAK,OAAO,CAAC,IAAI,CAAC;IA4B9B,OAAO,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,GAAG,KAAK;IAM7D,OAAO,CAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG;QAAE,SAAS,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE;IAM/G,kBAAkB,IAAK,KAAK;IAInC,OAAO,CAAC,KAAK;IAYb,SAAS,CAAC,uBAAuB,CAAE,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;CAKhF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshake-xx.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshake-xx.js deleted file mode 100644 index 373013b03..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshake-xx.js +++ /dev/null @@ -1,140 +0,0 @@ -import { InvalidCryptoExchangeError, UnexpectedPeerError } from '@libp2p/interface/errors'; -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { decode0, decode1, decode2, encode0, encode1, encode2 } from './encoder.js'; -import { XX } from './handshakes/xx.js'; -import { logger, logLocalStaticKeys, logLocalEphemeralKeys, logRemoteEphemeralKey, logRemoteStaticKey, logCipherState } from './logger.js'; -import { decodePayload, getPeerIdFromPayload, verifySignedPayload } from './utils.js'; -export class XXHandshake { - isInitiator; - session; - remotePeer; - remoteExtensions = { webtransportCerthashes: [] }; - payload; - connection; - xx; - staticKeypair; - prologue; - constructor(isInitiator, payload, prologue, crypto, staticKeypair, connection, remotePeer, handshake) { - this.isInitiator = isInitiator; - this.payload = payload; - this.prologue = prologue; - this.staticKeypair = staticKeypair; - this.connection = connection; - if (remotePeer) { - this.remotePeer = remotePeer; - } - this.xx = handshake ?? new XX(crypto); - this.session = this.xx.initSession(this.isInitiator, this.prologue, this.staticKeypair); - } - // stage 0 - async propose() { - logLocalStaticKeys(this.session.hs.s); - if (this.isInitiator) { - logger.trace('Stage 0 - Initiator starting to send first message.'); - const messageBuffer = this.xx.sendMessage(this.session, uint8ArrayAlloc(0)); - await this.connection.write(encode0(messageBuffer)); - logger.trace('Stage 0 - Initiator finished sending first message.'); - logLocalEphemeralKeys(this.session.hs.e); - } - else { - logger.trace('Stage 0 - Responder waiting to receive first message...'); - const receivedMessageBuffer = decode0((await this.connection.read()).subarray()); - const { valid } = this.xx.recvMessage(this.session, receivedMessageBuffer); - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 0 validation fail'); - } - logger.trace('Stage 0 - Responder received first message.'); - logRemoteEphemeralKey(this.session.hs.re); - } - } - // stage 1 - async exchange() { - if (this.isInitiator) { - logger.trace('Stage 1 - Initiator waiting to receive first message from responder...'); - const receivedMessageBuffer = decode1((await this.connection.read()).subarray()); - const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer); - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 1 validation fail'); - } - logger.trace('Stage 1 - Initiator received the message.'); - logRemoteEphemeralKey(this.session.hs.re); - logRemoteStaticKey(this.session.hs.rs); - logger.trace("Initiator going to check remote's signature..."); - try { - const decodedPayload = decodePayload(plaintext); - this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload); - await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer); - this.setRemoteNoiseExtension(decodedPayload.extensions); - } - catch (e) { - const err = e; - throw new UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`); - } - logger.trace('All good with the signature!'); - } - else { - logger.trace('Stage 1 - Responder sending out first message with signed payload and static key.'); - const messageBuffer = this.xx.sendMessage(this.session, this.payload); - await this.connection.write(encode1(messageBuffer)); - logger.trace('Stage 1 - Responder sent the second handshake message with signed payload.'); - logLocalEphemeralKeys(this.session.hs.e); - } - } - // stage 2 - async finish() { - if (this.isInitiator) { - logger.trace('Stage 2 - Initiator sending third handshake message.'); - const messageBuffer = this.xx.sendMessage(this.session, this.payload); - await this.connection.write(encode2(messageBuffer)); - logger.trace('Stage 2 - Initiator sent message with signed payload.'); - } - else { - logger.trace('Stage 2 - Responder waiting for third handshake message...'); - const receivedMessageBuffer = decode2((await this.connection.read()).subarray()); - const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer); - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 2 validation fail'); - } - logger.trace('Stage 2 - Responder received the message, finished handshake.'); - try { - const decodedPayload = decodePayload(plaintext); - this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload); - await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer); - this.setRemoteNoiseExtension(decodedPayload.extensions); - } - catch (e) { - const err = e; - throw new UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`); - } - } - logCipherState(this.session); - } - encrypt(plaintext, session) { - const cs = this.getCS(session); - return this.xx.encryptWithAd(cs, uint8ArrayAlloc(0), plaintext); - } - decrypt(ciphertext, session, dst) { - const cs = this.getCS(session, false); - return this.xx.decryptWithAd(cs, uint8ArrayAlloc(0), ciphertext, dst); - } - getRemoteStaticKey() { - return this.session.hs.rs; - } - getCS(session, encryption = true) { - if (!session.cs1 || !session.cs2) { - throw new InvalidCryptoExchangeError('Handshake not completed properly, cipher state does not exist.'); - } - if (this.isInitiator) { - return encryption ? session.cs1 : session.cs2; - } - else { - return encryption ? session.cs2 : session.cs1; - } - } - setRemoteNoiseExtension(e) { - if (e) { - this.remoteExtensions = e; - } - } -} -//# sourceMappingURL=handshake-xx.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshake-xx.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshake-xx.js.map deleted file mode 100644 index 1b47203b9..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshake-xx.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake-xx.js","sourceRoot":"","sources":["../../src/handshake-xx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC1F,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACnF,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACf,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,YAAY,CAAA;AAUnB,MAAM,OAAO,WAAW;IACf,WAAW,CAAS;IACpB,OAAO,CAAc;IACrB,UAAU,CAAS;IACnB,gBAAgB,GAAoB,EAAE,sBAAsB,EAAE,EAAE,EAAE,CAAA;IAE/D,OAAO,CAAO;IACd,UAAU,CAAsB;IAChC,EAAE,CAAI;IACN,aAAa,CAAS;IAEf,QAAQ,CAAS;IAElC,YACE,WAAoB,EACpB,OAAc,EACd,QAAiB,EACjB,MAAwB,EACxB,aAAsB,EACtB,UAAgC,EAChC,UAAmB,EACnB,SAAc;QAEd,IAA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AAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QAErC,OAAO,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,CAAA;IACvE,CAAC;IAEM,kBAAkB;QACvB,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAA;IAC3B,CAAC;IAEO,KAAK,CAAE,OAAqB,EAAE,UAAU,GAAG,IAAI;QACrD,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChC,MAAM,IAAI,0BAA0B,CAAC,gEAAgE,CAAC,CAAA;SACvG;QAED,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,OAAO,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA;SAC9C;aAAM;YACL,OAAO,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA;SAC9C;IACH,CAAC;IAES,uBAAuB,CAAE,CAAqC;QACtE,IAAI,CAAC,EAAE;YACL,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAA;SAC1B;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/abstract-handshake.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/abstract-handshake.d.ts deleted file mode 100644 index eb1e51754..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/abstract-handshake.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Nonce } from '../nonce.js'; -import type { bytes, bytes32 } from '../@types/basic.js'; -import type { CipherState, MessageBuffer, SymmetricState } from '../@types/handshake.js'; -import type { ICryptoInterface } from '../crypto.js'; -export interface DecryptedResult { - plaintext: bytes; - valid: boolean; -} -export interface SplitState { - cs1: CipherState; - cs2: CipherState; -} -export declare abstract class AbstractHandshake { - crypto: ICryptoInterface; - constructor(crypto: ICryptoInterface); - encryptWithAd(cs: CipherState, ad: Uint8Array, plaintext: Uint8Array): bytes; - decryptWithAd(cs: CipherState, ad: Uint8Array, ciphertext: Uint8Array, dst?: Uint8Array): DecryptedResult; - protected hasKey(cs: CipherState): boolean; - protected createEmptyKey(): bytes32; - protected isEmptyKey(k: bytes32): boolean; - protected encrypt(k: bytes32, n: Nonce, ad: Uint8Array, plaintext: Uint8Array): bytes; - protected encryptAndHash(ss: SymmetricState, plaintext: bytes): bytes; - protected decrypt(k: bytes32, n: Nonce, ad: bytes, ciphertext: bytes, dst?: Uint8Array): DecryptedResult; - protected decryptAndHash(ss: SymmetricState, ciphertext: bytes): DecryptedResult; - protected dh(privateKey: bytes32, publicKey: bytes32): bytes32; - protected mixHash(ss: SymmetricState, data: bytes): void; - protected getHash(a: Uint8Array, b: Uint8Array): bytes32; - protected mixKey(ss: SymmetricState, ikm: bytes32): void; - protected initializeKey(k: bytes32): CipherState; - protected initializeSymmetric(protocolName: string): SymmetricState; - protected hashProtocolName(protocolName: Uint8Array): bytes32; - protected split(ss: SymmetricState): SplitState; - protected writeMessageRegular(cs: CipherState, payload: bytes): MessageBuffer; - protected readMessageRegular(cs: CipherState, message: MessageBuffer): DecryptedResult; -} -//# sourceMappingURL=abstract-handshake.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/abstract-handshake.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/abstract-handshake.d.ts.map deleted file mode 100644 index 0ffc88414..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/abstract-handshake.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-handshake.d.ts","sourceRoot":"","sources":["../../../src/handshakes/abstract-handshake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KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG,eAAe;IAkBzG,SAAS,CAAC,cAAc,CAAE,EAAE,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,GAAG,eAAe;IAYjF,SAAS,CAAC,EAAE,CAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO;IAgB/D,SAAS,CAAC,OAAO,CAAE,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,KAAK,GAAG,IAAI;IAIzD,SAAS,CAAC,OAAO,CAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO;IAKzD,SAAS,CAAC,MAAM,CAAE,EAAE,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI;IAMzD,SAAS,CAAC,aAAa,CAAE,CAAC,EAAE,OAAO,GAAG,WAAW;IAMjD,SAAS,CAAC,mBAAmB,CAAE,YAAY,EAAE,MAAM,GAAG,cAAc;IAWpE,SAAS,CAAC,gBAAgB,CAAE,YAAY,EAAE,UAAU,GAAG,OAAO;IAU9D,SAAS,CAAC,KAAK,CAAE,EAAE,EAAE,cAAc,GAAG,UAAU;IAQhD,SAAS,CAAC,mBAAmB,CAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,GAAG,aAAa;IAQ9E,SAAS,CAAC,kBAAkB,CAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,GAAG,eAAe;CAGxF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/abstract-handshake.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/abstract-handshake.js deleted file mode 100644 index f1d205fe1..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/abstract-handshake.js +++ /dev/null @@ -1,141 +0,0 @@ -import { fromString as uint8ArrayFromString } from 'uint8arrays'; -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; -import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; -import { logger } from '../logger.js'; -import { Nonce } from '../nonce.js'; -export class AbstractHandshake { - crypto; - constructor(crypto) { - this.crypto = crypto; - } - encryptWithAd(cs, ad, plaintext) { - const e = this.encrypt(cs.k, cs.n, ad, plaintext); - cs.n.increment(); - return e; - } - decryptWithAd(cs, ad, ciphertext, dst) { - const { plaintext, valid } = this.decrypt(cs.k, cs.n, ad, ciphertext, dst); - if (valid) - cs.n.increment(); - return { plaintext, valid }; - } - // Cipher state related - hasKey(cs) { - return !this.isEmptyKey(cs.k); - } - createEmptyKey() { - return uint8ArrayAlloc(32); - } - isEmptyKey(k) { - const emptyKey = this.createEmptyKey(); - return uint8ArrayEquals(emptyKey, k); - } - encrypt(k, n, ad, plaintext) { - n.assertValue(); - return this.crypto.chaCha20Poly1305Encrypt(plaintext, n.getBytes(), ad, k); - } - encryptAndHash(ss, plaintext) { - let ciphertext; - if (this.hasKey(ss.cs)) { - ciphertext = this.encryptWithAd(ss.cs, ss.h, plaintext); - } - else { - ciphertext = plaintext; - } - this.mixHash(ss, ciphertext); - return ciphertext; - } - decrypt(k, n, ad, ciphertext, dst) { - n.assertValue(); - const encryptedMessage = this.crypto.chaCha20Poly1305Decrypt(ciphertext, n.getBytes(), ad, k, dst); - if (encryptedMessage) { - return { - plaintext: encryptedMessage, - valid: true - }; - } - else { - return { - plaintext: uint8ArrayAlloc(0), - valid: false - }; - } - } - decryptAndHash(ss, ciphertext) { - let plaintext; - let valid = true; - if (this.hasKey(ss.cs)) { - ({ plaintext, valid } = this.decryptWithAd(ss.cs, ss.h, ciphertext)); - } - else { - plaintext = ciphertext; - } - this.mixHash(ss, ciphertext); - return { plaintext, valid }; - } - dh(privateKey, publicKey) { - try { - const derivedU8 = this.crypto.generateX25519SharedKey(privateKey, publicKey); - if (derivedU8.length === 32) { - return derivedU8; - } - return derivedU8.subarray(0, 32); - } - catch (e) { - const err = e; - logger.error(err); - return uint8ArrayAlloc(32); - } - } - mixHash(ss, data) { - ss.h = this.getHash(ss.h, data); - } - getHash(a, b) { - const u = this.crypto.hashSHA256(uint8ArrayConcat([a, b], a.length + b.length)); - return u; - } - mixKey(ss, ikm) { - const [ck, tempK] = this.crypto.getHKDF(ss.ck, ikm); - ss.cs = this.initializeKey(tempK); - ss.ck = ck; - } - initializeKey(k) { - return { k, n: new Nonce() }; - } - // Symmetric state related - initializeSymmetric(protocolName) { - const protocolNameBytes = uint8ArrayFromString(protocolName, 'utf-8'); - const h = this.hashProtocolName(protocolNameBytes); - const ck = h; - const key = this.createEmptyKey(); - const cs = this.initializeKey(key); - return { cs, ck, h }; - } - hashProtocolName(protocolName) { - if (protocolName.length <= 32) { - const h = uint8ArrayAlloc(32); - h.set(protocolName); - return h; - } - else { - return this.getHash(protocolName, uint8ArrayAlloc(0)); - } - } - split(ss) { - const [tempk1, tempk2] = this.crypto.getHKDF(ss.ck, uint8ArrayAlloc(0)); - const cs1 = this.initializeKey(tempk1); - const cs2 = this.initializeKey(tempk2); - return { cs1, cs2 }; - } - writeMessageRegular(cs, payload) { - const ciphertext = this.encryptWithAd(cs, uint8ArrayAlloc(0), payload); - const ne = this.createEmptyKey(); - const ns = uint8ArrayAlloc(0); - return { ne, ns, ciphertext }; - } - readMessageRegular(cs, message) { - return this.decryptWithAd(cs, uint8ArrayAlloc(0), message.ciphertext); - } -} -//# sourceMappingURL=abstract-handshake.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/abstract-handshake.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/abstract-handshake.js.map deleted file mode 100644 index 757420896..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/abstract-handshake.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-handshake.js","sourceRoot":"","sources":["../../../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O,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAA;SACtD;IACH,CAAC;IAES,KAAK,CAAE,EAAkB;QACjC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAA;QACvE,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAEtC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;IACrB,CAAC;IAES,mBAAmB,CAAE,EAAe,EAAE,OAAc;QAC5D,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;QACtE,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;QAChC,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,CAAC,CAAA;QAE7B,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,CAAA;IAC/B,CAAC;IAES,kBAAkB,CAAE,EAAe,EAAE,OAAsB;QACnE,OAAO,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;IACvE,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/xx.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/xx.d.ts deleted file mode 100644 index bf79dc414..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/xx.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { AbstractHandshake, type DecryptedResult } from './abstract-handshake.js'; -import type { bytes32, bytes } from '../@types/basic.js'; -import type { MessageBuffer, NoiseSession } from '../@types/handshake.js'; -import type { KeyPair } from '../@types/libp2p.js'; -export declare class XX extends AbstractHandshake { - private initializeInitiator; - private initializeResponder; - private writeMessageA; - private writeMessageB; - private writeMessageC; - private readMessageA; - private readMessageB; - private readMessageC; - initSession(initiator: boolean, prologue: bytes32, s: KeyPair): NoiseSession; - sendMessage(session: NoiseSession, message: bytes, ephemeral?: KeyPair): MessageBuffer; - recvMessage(session: NoiseSession, message: MessageBuffer): DecryptedResult; -} -//# sourceMappingURL=xx.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/xx.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/xx.d.ts.map deleted file mode 100644 index 76c3cbdac..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/xx.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx.d.ts","sourceRoot":"","sources":["../../../src/handshakes/xx.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACjF,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAA+B,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACtG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,qBAAa,EAAG,SAAQ,iBAAiB;IACvC,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,YAAY;IAmBpB,OAAO,CAAC,YAAY;IAgBb,WAAW,CAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,YAAY;IAkB7E,WAAW,CAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,aAAa;IAkCvF,WAAW,CAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,GAAG,eAAe;CAkBpF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/xx.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/xx.js deleted file mode 100644 index dbfa58f06..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/xx.js +++ /dev/null @@ -1,162 +0,0 @@ -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { isValidPublicKey } from '../utils.js'; -import { AbstractHandshake } from './abstract-handshake.js'; -export class XX extends AbstractHandshake { - initializeInitiator(prologue, s, rs, psk) { - const name = 'Noise_XX_25519_ChaChaPoly_SHA256'; - const ss = this.initializeSymmetric(name); - this.mixHash(ss, prologue); - const re = uint8ArrayAlloc(32); - return { ss, s, rs, psk, re }; - } - initializeResponder(prologue, s, rs, psk) { - const name = 'Noise_XX_25519_ChaChaPoly_SHA256'; - const ss = this.initializeSymmetric(name); - this.mixHash(ss, prologue); - const re = uint8ArrayAlloc(32); - return { ss, s, rs, psk, re }; - } - writeMessageA(hs, payload, e) { - const ns = uint8ArrayAlloc(0); - if (e !== undefined) { - hs.e = e; - } - else { - hs.e = this.crypto.generateX25519KeyPair(); - } - const ne = hs.e.publicKey; - this.mixHash(hs.ss, ne); - const ciphertext = this.encryptAndHash(hs.ss, payload); - return { ne, ns, ciphertext }; - } - writeMessageB(hs, payload) { - hs.e = this.crypto.generateX25519KeyPair(); - const ne = hs.e.publicKey; - this.mixHash(hs.ss, ne); - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re)); - const spk = hs.s.publicKey; - const ns = this.encryptAndHash(hs.ss, spk); - this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re)); - const ciphertext = this.encryptAndHash(hs.ss, payload); - return { ne, ns, ciphertext }; - } - writeMessageC(hs, payload) { - const spk = hs.s.publicKey; - const ns = this.encryptAndHash(hs.ss, spk); - this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re)); - const ciphertext = this.encryptAndHash(hs.ss, payload); - const ne = this.createEmptyKey(); - const messageBuffer = { ne, ns, ciphertext }; - const { cs1, cs2 } = this.split(hs.ss); - return { h: hs.ss.h, messageBuffer, cs1, cs2 }; - } - readMessageA(hs, message) { - if (isValidPublicKey(message.ne)) { - hs.re = message.ne; - } - this.mixHash(hs.ss, hs.re); - return this.decryptAndHash(hs.ss, message.ciphertext); - } - readMessageB(hs, message) { - if (isValidPublicKey(message.ne)) { - hs.re = message.ne; - } - this.mixHash(hs.ss, hs.re); - if (!hs.e) { - throw new Error('Handshake state `e` param is missing.'); - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re)); - const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns); - if (valid1 && isValidPublicKey(ns)) { - hs.rs = ns; - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs)); - const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext); - return { plaintext, valid: (valid1 && valid2) }; - } - readMessageC(hs, message) { - const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns); - if (valid1 && isValidPublicKey(ns)) { - hs.rs = ns; - } - if (!hs.e) { - throw new Error('Handshake state `e` param is missing.'); - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs)); - const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext); - const { cs1, cs2 } = this.split(hs.ss); - return { h: hs.ss.h, plaintext, valid: (valid1 && valid2), cs1, cs2 }; - } - initSession(initiator, prologue, s) { - const psk = this.createEmptyKey(); - const rs = uint8ArrayAlloc(32); // no static key yet - let hs; - if (initiator) { - hs = this.initializeInitiator(prologue, s, rs, psk); - } - else { - hs = this.initializeResponder(prologue, s, rs, psk); - } - return { - hs, - i: initiator, - mc: 0 - }; - } - sendMessage(session, message, ephemeral) { - let messageBuffer; - if (session.mc === 0) { - messageBuffer = this.writeMessageA(session.hs, message, ephemeral); - } - else if (session.mc === 1) { - messageBuffer = this.writeMessageB(session.hs, message); - } - else if (session.mc === 2) { - const { h, messageBuffer: resultingBuffer, cs1, cs2 } = this.writeMessageC(session.hs, message); - messageBuffer = resultingBuffer; - session.h = h; - session.cs1 = cs1; - session.cs2 = cs2; - } - else if (session.mc > 2) { - if (session.i) { - if (!session.cs1) { - throw new Error('CS1 (cipher state) is not defined'); - } - messageBuffer = this.writeMessageRegular(session.cs1, message); - } - else { - if (!session.cs2) { - throw new Error('CS2 (cipher state) is not defined'); - } - messageBuffer = this.writeMessageRegular(session.cs2, message); - } - } - else { - throw new Error('Session invalid.'); - } - session.mc++; - return messageBuffer; - } - recvMessage(session, message) { - let plaintext = uint8ArrayAlloc(0); - let valid = false; - if (session.mc === 0) { - ({ plaintext, valid } = this.readMessageA(session.hs, message)); - } - else if (session.mc === 1) { - ({ plaintext, valid } = this.readMessageB(session.hs, message)); - } - else if (session.mc === 2) { - const { h, plaintext: resultingPlaintext, valid: resultingValid, cs1, cs2 } = this.readMessageC(session.hs, message); - plaintext = resultingPlaintext; - valid = resultingValid; - session.h = h; - session.cs1 = cs1; - session.cs2 = cs2; - } - session.mc++; - return { plaintext, valid }; - } -} -//# sourceMappingURL=xx.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/xx.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/xx.js.map deleted file mode 100644 index e4e4a1586..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/handshakes/xx.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx.js","sour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l/js-libp2p/v1.0-native-x25519/noise/dist/src/index.d.ts deleted file mode 100644 index 20ec9c473..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { NoiseInit } from './noise.js'; -import type { NoiseExtensions } from './proto/payload.js'; -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter'; -export type { ICryptoInterface } from './crypto.js'; -export { pureJsCrypto } from './crypto/js.js'; -export declare function noise(init?: NoiseInit): () => ConnectionEncrypter; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/index.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/index.d.ts.map deleted file mode 100644 index 4c067ef45..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AACjF,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,wBAAgB,KAAK,CAAE,IAAI,GAAE,SAAc,GAAG,MAAM,mBAAmB,CAAC,eAAe,CAAC,CAEvF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/index.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/index.js deleted file mode 100644 index 83cdd3f49..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import { Noise } from './noise.js'; -export { pureJsCrypto } from './crypto/js.js'; -export function noise(init = {}) { - return () => new Noise(init); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/index.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/index.js.map deleted file mode 100644 index fbdf2daf9..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAKlC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,UAAU,KAAK,CAAE,OAAkB,EAAE;IACzC,OAAO,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/logger.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/logger.d.ts deleted file mode 100644 index 55e6ab35d..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/logger.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { type Logger } from '@libp2p/logger'; -import type { NoiseSession } from './@types/handshake.js'; -import type { KeyPair } from './@types/libp2p.js'; -declare const log: Logger; -export { log as logger }; -export declare function logLocalStaticKeys(s: KeyPair): void; -export declare function logLocalEphemeralKeys(e: KeyPair | undefined): void; -export declare function logRemoteStaticKey(rs: Uint8Array): void; -export declare function logRemoteEphemeralKey(re: Uint8Array): void; -export declare function logCipherState(session: NoiseSession): void; -//# sourceMappingURL=logger.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/logger.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/logger.d.ts.map deleted file mode 100644 index 8873892ba..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/logger.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAU,MAAM,gBAAgB,CAAA;AAGpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAEjD,QAAA,MAAM,GAAG,QAAyB,CAAA;AAElC,OAAO,EAAE,GAAG,IAAI,MAAM,EAAE,CAAA;AAaxB,wBAAgB,kBAAkB,CAAE,CAAC,EAAE,OAAO,GAAG,IAAI,CAGpD;AAED,wBAAgB,qBAAqB,CAAE,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAOnE;AAED,wBAAgB,kBAAkB,CAAE,EAAE,EAAE,UAAU,GAAG,IAAI,CAExD;AAED,wBAAgB,qBAAqB,CAAE,EAAE,EAAE,UAAU,GAAG,IAAI,CAE3D;AAED,wBAAgB,cAAc,CAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CAO3D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/logger.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/logger.js deleted file mode 100644 index daf1e24aa..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/logger.js +++ /dev/null @@ -1,45 +0,0 @@ -import { logger } from '@libp2p/logger'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { DUMP_SESSION_KEYS } from './constants.js'; -const log = logger('libp2p:noise'); -export { log as logger }; -let keyLogger; -if (DUMP_SESSION_KEYS) { - keyLogger = log; -} -else { - keyLogger = Object.assign(() => { }, { - enabled: false, - trace: () => { }, - error: () => { } - }); -} -export function logLocalStaticKeys(s) { - keyLogger(`LOCAL_STATIC_PUBLIC_KEY ${uint8ArrayToString(s.publicKey, 'hex')}`); - keyLogger(`LOCAL_STATIC_PRIVATE_KEY ${uint8ArrayToString(s.privateKey, 'hex')}`); -} -export function logLocalEphemeralKeys(e) { - if (e) { - keyLogger(`LOCAL_PUBLIC_EPHEMERAL_KEY ${uint8ArrayToString(e.publicKey, 'hex')}`); - keyLogger(`LOCAL_PRIVATE_EPHEMERAL_KEY ${uint8ArrayToString(e.privateKey, 'hex')}`); - } - else { - keyLogger('Missing local ephemeral keys.'); - } -} -export function logRemoteStaticKey(rs) { - keyLogger(`REMOTE_STATIC_PUBLIC_KEY ${uint8ArrayToString(rs, 'hex')}`); -} -export function logRemoteEphemeralKey(re) { - keyLogger(`REMOTE_EPHEMERAL_PUBLIC_KEY ${uint8ArrayToString(re, 'hex')}`); -} -export function logCipherState(session) { - if (session.cs1 && session.cs2) { - keyLogger(`CIPHER_STATE_1 ${session.cs1.n.getUint64()} ${uint8ArrayToString(session.cs1.k, 'hex')}`); - keyLogger(`CIPHER_STATE_2 ${session.cs2.n.getUint64()} ${uint8ArrayToString(session.cs2.k, 'hex')}`); - } - else { - keyLogger('Missing cipher state.'); - } -} -//# sourceMappingURL=logger.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/logger.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/logger.js.map deleted file mode 100644 index e408da6b8..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/logger.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAIlD,MAAM,GAAG,GAAG,MAAM,CAAC,cAAc,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AAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE;QAC9B,SAAS,CAAC,kBAAkB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;QACpG,SAAS,CAAC,kBAAkB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;KACrG;SAAM;QACL,SAAS,CAAC,uBAAuB,CAAC,CAAA;KACnC;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/metrics.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/metrics.d.ts deleted file mode 100644 index 4fe5a1280..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/metrics.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Counter, Metrics } from '@libp2p/interface/metrics'; -export type MetricsRegistry = Record; -export declare function registerMetrics(metrics: Metrics): MetricsRegistry; -//# sourceMappingURL=metrics.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/metrics.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/metrics.d.ts.map deleted file mode 100644 index 5d29159ee..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/metrics.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../src/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEjE,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAErD,wBAAgB,eAAe,CAAE,OAAO,EAAE,OAAO,GAAG,eAAe,CA2BlE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/metrics.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/metrics.js deleted file mode 100644 index 1b5123db8..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/metrics.js +++ /dev/null @@ -1,20 +0,0 @@ -export function registerMetrics(metrics) { - return { - xxHandshakeSuccesses: metrics.registerCounter('libp2p_noise_xxhandshake_successes_total', { - help: 'Total count of noise xxHandshakes successes_' - }), - xxHandshakeErrors: metrics.registerCounter('libp2p_noise_xxhandshake_error_total', { - help: 'Total count of noise xxHandshakes errors' - }), - encryptedPackets: metrics.registerCounter('libp2p_noise_encrypted_packets_total', { - help: 'Total count of noise encrypted packets successfully' - }), - decryptedPackets: metrics.registerCounter('libp2p_noise_decrypted_packets_total', { - help: 'Total count of noise decrypted packets' - }), - decryptErrors: metrics.registerCounter('libp2p_noise_decrypt_errors_total', { - help: 'Total count of noise decrypt errors' - }) - }; -} -//# sourceMappingURL=metrics.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/metrics.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/metrics.js.map deleted file mode 100644 index 9c23b331e..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/metrics.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/metrics.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,eAAe,CAAE,OAAgB;IAC/C,OAAO;QACL,oBAAoB,EAAE,OAAO,CAAC,eAAe,CAC3C,0CAA0C,EAAE;YAC1C,IAAI,EAAE,8CAA8C;SACrD,CAAC;QAEJ,iBAAiB,EAAE,OAAO,CAAC,eAAe,CACxC,sCAAsC,EAAE;YACtC,IAAI,EAAE,0CAA0C;SACjD,CAAC;QAEJ,gBAAgB,EAAE,OAAO,CAAC,eAAe,CACvC,sCAAsC,EAAE;YACtC,IAAI,EAAE,qDAAqD;SAC5D,CAAC;QAEJ,gBAAgB,EAAE,OAAO,CAAC,eAAe,CACvC,sCAAsC,EAAE;YACtC,IAAI,EAAE,wCAAwC;SAC/C,CAAC;QAEJ,aAAa,EAAE,OAAO,CAAC,eAAe,CACpC,mCAAmC,EAAE;YACnC,IAAI,EAAE,qCAAqC;SAC5C,CAAC;KACL,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/noise.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/noise.d.ts deleted file mode 100644 index eec4de547..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/noise.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { bytes } from './@types/basic.js'; -import type { INoiseConnection } from './@types/libp2p.js'; -import type { ICryptoInterface } from './crypto.js'; -import type { NoiseExtensions } from './proto/payload.js'; -import type { SecuredConnection } from '@libp2p/interface/connection-encrypter'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { Duplex } from 'it-stream-types'; -export interface NoiseInit { - /** - * x25519 private key, reuse for faster handshakes - */ - staticNoiseKey?: bytes; - extensions?: NoiseExtensions; - crypto?: ICryptoInterface; - prologueBytes?: Uint8Array; - metrics?: Metrics; -} -export declare class Noise implements INoiseConnection { - protocol: string; - crypto: ICryptoInterface; - private readonly prologue; - private readonly staticKeys; - private readonly extensions?; - private readonly metrics?; - constructor(init?: NoiseInit); - /** - * Encrypt outgoing data to the remote party (handshake as initiator) - * - * @param {PeerId} localPeer - PeerId of the receiving peer - * @param {Duplex, AsyncIterable, Promise>} connection - streaming iterable duplex that will be encrypted - * @param {PeerId} remotePeer - PeerId of the remote peer. Used to validate the integrity of the remote peer. - * @returns {Promise} - */ - secureOutbound(localPeer: PeerId, connection: Duplex, AsyncIterable, Promise>, remotePeer?: PeerId): Promise>; - /** - * Decrypt incoming data (handshake as responder). - * - * @param {PeerId} localPeer - PeerId of the receiving peer. - * @param {Duplex, AsyncIterable, Promise>} connection - streaming iterable duplex that will be encryption. - * @param {PeerId} remotePeer - optional PeerId of the initiating peer, if known. This may only exist during transport upgrades. - * @returns {Promise} - */ - secureInbound(localPeer: PeerId, connection: Duplex, AsyncIterable, Promise>, remotePeer?: PeerId): Promise>; - /** - * If Noise pipes supported, tries IK handshake first with XX as fallback if it fails. - * If noise pipes disabled or remote peer static key is unknown, use XX. - * - * @param {HandshakeParams} params - */ - private performHandshake; - private performXXHandshake; - private createSecureConnection; -} -//# sourceMappingURL=noise.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/noise.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/noise.d.ts.map deleted file mode 100644 index 2c15e2952..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/noise.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise.d.ts","sourceRoot":"","sources":["../../src/noise.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAW,MAAM,oBAAoB,CAAA;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC/E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAU,MAAM,iBAAiB,CAAA;AASrD,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAA;IACtB,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,aAAa,CAAC,EAAE,UAAU,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,qBAAa,KAAM,YAAW,gBAAgB;IACrC,QAAQ,SAAW;IACnB,MAAM,EAAE,gBAAgB,CAAA;IAE/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAY;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAiB;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAiB;gBAE7B,IAAI,GAAE,SAAc;IAgBjC;;;;;;;OAOG;IACU,cAAc,CAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;IAwB3M;;;;;;;OAOG;IACU,aAAa,CAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;IAwB1M;;;;;OAKG;YACW,gBAAgB;YAOhB,kBAAkB;YA+BlB,sBAAsB;CAmBrC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/noise.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/noise.js deleted file mode 100644 index 8ad043d2c..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/noise.js +++ /dev/null @@ -1,131 +0,0 @@ -import { decode } from 'it-length-prefixed'; -import { lpStream } from 'it-length-prefixed-stream'; -import { duplexPair } from 'it-pair/duplex'; -import { pipe } from 'it-pipe'; -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { NOISE_MSG_MAX_LENGTH_BYTES } from './constants.js'; -import { defaultCrypto } from './crypto/index.js'; -import { decryptStream, encryptStream } from './crypto/streaming.js'; -import { uint16BEDecode, uint16BEEncode } from './encoder.js'; -import { XXHandshake } from './handshake-xx.js'; -import { registerMetrics } from './metrics.js'; -import { getPayload } from './utils.js'; -export class Noise { - protocol = '/noise'; - crypto; - prologue; - staticKeys; - extensions; - metrics; - constructor(init = {}) { - const { staticNoiseKey, extensions, crypto, prologueBytes, metrics } = init; - this.crypto = crypto ?? defaultCrypto; - this.extensions = extensions; - this.metrics = metrics ? registerMetrics(metrics) : undefined; - if (staticNoiseKey) { - // accepts x25519 private key of length 32 - this.staticKeys = this.crypto.generateX25519KeyPairFromSeed(staticNoiseKey); - } - else { - this.staticKeys = this.crypto.generateX25519KeyPair(); - } - this.prologue = prologueBytes ?? uint8ArrayAlloc(0); - } - /** - * Encrypt outgoing data to the remote party (handshake as initiator) - * - * @param {PeerId} localPeer - PeerId of the receiving peer - * @param {Duplex, AsyncIterable, Promise>} connection - streaming iterable duplex that will be encrypted - * @param {PeerId} remotePeer - PeerId of the remote peer. Used to validate the integrity of the remote peer. - * @returns {Promise} - */ - async secureOutbound(localPeer, connection, remotePeer) { - const wrappedConnection = lpStream(connection, { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - }); - const handshake = await this.performHandshake({ - connection: wrappedConnection, - isInitiator: true, - localPeer, - remotePeer - }); - const conn = await this.createSecureConnection(wrappedConnection, handshake); - return { - conn, - remoteExtensions: handshake.remoteExtensions, - remotePeer: handshake.remotePeer - }; - } - /** - * Decrypt incoming data (handshake as responder). - * - * @param {PeerId} localPeer - PeerId of the receiving peer. - * @param {Duplex, AsyncIterable, Promise>} connection - streaming iterable duplex that will be encryption. - * @param {PeerId} remotePeer - optional PeerId of the initiating peer, if known. This may only exist during transport upgrades. - * @returns {Promise} - */ - async secureInbound(localPeer, connection, remotePeer) { - const wrappedConnection = lpStream(connection, { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - }); - const handshake = await this.performHandshake({ - connection: wrappedConnection, - isInitiator: false, - localPeer, - remotePeer - }); - const conn = await this.createSecureConnection(wrappedConnection, handshake); - return { - conn, - remotePeer: handshake.remotePeer, - remoteExtensions: handshake.remoteExtensions - }; - } - /** - * If Noise pipes supported, tries IK handshake first with XX as fallback if it fails. - * If noise pipes disabled or remote peer static key is unknown, use XX. - * - * @param {HandshakeParams} params - */ - async performHandshake(params) { - const payload = await getPayload(params.localPeer, this.staticKeys.publicKey, this.extensions); - // run XX handshake - return this.performXXHandshake(params, payload); - } - async performXXHandshake(params, payload) { - const { isInitiator, remotePeer, connection } = params; - const handshake = new XXHandshake(isInitiator, payload, this.prologue, this.crypto, this.staticKeys, connection, remotePeer); - try { - await handshake.propose(); - await handshake.exchange(); - await handshake.finish(); - this.metrics?.xxHandshakeSuccesses.increment(); - } - catch (e) { - this.metrics?.xxHandshakeErrors.increment(); - if (e instanceof Error) { - e.message = `Error occurred during XX handshake: ${e.message}`; - throw e; - } - } - return handshake; - } - async createSecureConnection(connection, handshake) { - // Create encryption box/unbox wrapper - const [secure, user] = duplexPair(); - const network = connection.unwrap(); - await pipe(secure, // write to wrapper - encryptStream(handshake, this.metrics), // encrypt data + prefix with message length - network, // send to the remote peer - (source) => decode(source, { lengthDecoder: uint16BEDecode }), // read message length prefix - decryptStream(handshake, this.metrics), // decrypt the incoming data - secure // pipe to the wrapper - ); - return user; - } -} -//# sourceMappingURL=noise.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/noise.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/noise.js.map deleted file mode 100644 index e125940f9..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/noise.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise.js","sourceRoot":"","sources":["../../src/noise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAA6B,MAAM,2BAA2B,CAAA;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAwB,eAAe,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AA6BvC,MAAM,OAAO,KAAK;IACT,QAAQ,GAAG,QAAQ,CAAA;IACnB,MAAM,CAAkB;IAEd,QAAQ,CAAY;IACpB,UAAU,CAAS;IACnB,UAAU,CAAkB;IAC5B,OAAO,CAAkB;IAE1C,YAAa,OAAkB,EAAE;QAC/B,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;QAE3E,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,aA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O,EAAE,iBAAiB,CAAC,SAAS,EAAE,CAAA;YAC3C,IAAI,CAAC,YAAY,KAAK,EAAE;gBACtB,CAAC,CAAC,OAAO,GAAG,uCAAuC,CAAC,CAAC,OAAO,EAAE,CAAA;gBAC9D,MAAM,CAAC,CAAA;aACR;SACF;QAED,OAAO,SAAS,CAAA;IAClB,CAAC;IAEO,KAAK,CAAC,sBAAsB,CAClC,UAA8G,EAC9G,SAAqB;QAErB,sCAAsC;QACtC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,UAAU,EAAc,CAAA;QAC/C,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,CAAA;QAEnC,MAAM,IAAI,CACR,MAAM,EAAE,mBAAmB;QAC3B,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,4CAA4C;QACpF,OAAO,EAAE,0BAA0B;QACnC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC,EAAE,6BAA6B;QAC5F,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,4BAA4B;QACpE,MAAM,CAAC,sBAAsB;SAC9B,CAAA;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/nonce.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/nonce.d.ts deleted file mode 100644 index 662855bd3..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/nonce.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { bytes, uint64 } from './@types/basic.js'; -export declare const MIN_NONCE = 0; -export declare const MAX_NONCE = 4294967295; -/** - * The nonce is an uint that's increased over time. - * Maintaining different representations help improve performance. - */ -export declare class Nonce { - private n; - private readonly bytes; - private readonly view; - constructor(n?: number); - increment(): void; - getBytes(): bytes; - getUint64(): uint64; - assertValue(): void; -} -//# sourceMappingURL=nonce.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/nonce.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/nonce.d.ts.map deleted file mode 100644 index 6e502d077..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/nonce.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nonce.d.ts","sourceRoot":"","sources":["../../src/nonce.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAEtD,eAAO,MAAM,SAAS,IAAI,CAAA;AAO1B,eAAO,MAAM,SAAS,aAAa,CAAA;AAInC;;;GAGG;AACH,qBAAa,KAAK;IAChB,OAAO,CAAC,CAAC,CAAQ;IACjB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;IAC7B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;gBAElB,CAAC,SAAY;IAO1B,SAAS,IAAK,IAAI;IAMlB,QAAQ,IAAK,KAAK;IAIlB,SAAS,IAAK,MAAM;IAIpB,WAAW,IAAK,IAAI;CAKrB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/nonce.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/nonce.js deleted file mode 100644 index 0130475cf..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/nonce.js +++ /dev/null @@ -1,42 +0,0 @@ -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -export const MIN_NONCE = 0; -// For performance reasons, the nonce is represented as a JS `number` -// Although JS `number` can safely represent integers up to 2 ** 53 - 1, we choose to only use -// 4 bytes to store the data for performance reason. -// This is a slight deviation from the noise spec, which describes the max nonce as 2 ** 64 - 2 -// The effect is that this implementation will need a new handshake to be performed after fewer messages are exchanged than other implementations with full uint64 nonces. -// this MAX_NONCE is still a large number of messages, so the practical effect of this is negligible. -export const MAX_NONCE = 0xffffffff; -const ERR_MAX_NONCE = 'Cipherstate has reached maximum n, a new handshake must be performed'; -/** - * The nonce is an uint that's increased over time. - * Maintaining different representations help improve performance. - */ -export class Nonce { - n; - bytes; - view; - constructor(n = MIN_NONCE) { - this.n = n; - this.bytes = uint8ArrayAlloc(12); - this.view = new DataView(this.bytes.buffer, this.bytes.byteOffset, this.bytes.byteLength); - this.view.setUint32(4, n, true); - } - increment() { - this.n++; - // Even though we're treating the nonce as 8 bytes, RFC7539 specifies 12 bytes for a nonce. - this.view.setUint32(4, this.n, true); - } - getBytes() { - return this.bytes; - } - getUint64() { - return this.n; - } - assertValue() { - if (this.n > MAX_NONCE) { - throw new Error(ERR_MAX_NONCE); - } - } -} -//# sourceMappingURL=nonce.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/nonce.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/nonce.js.map deleted file mode 100644 index d663be87f..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/nonce.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nonce.js","sourceRoot":"","sources":["../../src/nonce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAG5D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAA;AAC1B,qEAAqE;AACrE,8FAA8F;AAC9F,oDAAoD;AACpD,+FAA+F;AAC/F,0KAA0K;AAC1K,qGAAqG;AACrG,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAA;AAEnC,MAAM,aAAa,GAAG,sEAAsE,CAAA;AAE5F;;;GAGG;AACH,MAAM,OAAO,KAAK;IACR,CAAC,CAAQ;IACA,KAAK,CAAO;IACZ,IAAI,CAAU;IAE/B,YAAa,CAAC,GAAG,SAAS;QACxB,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,KAAK,GAAG,eAAe,CAAC,EAAE,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QACzF,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;IACjC,CAAC;IAED,SAAS;QACP,IAAI,CAAC,CAAC,EAAE,CAAA;QACR,2FAA2F;QAC3F,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;IACtC,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,CAAC,CAAA;IACf,CAAC;IAED,WAAW;QACT,IAAI,IAAI,CAAC,CAAC,GAAG,SAAS,EAAE;YACtB,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAA;SAC/B;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/proto/payload.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/proto/payload.d.ts deleted file mode 100644 index 9d10fef73..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/proto/payload.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { type Codec } from 'protons-runtime'; -import type { Uint8ArrayList } from 'uint8arraylist'; -export interface NoiseExtensions { - webtransportCerthashes: Uint8Array[]; -} -export declare namespace NoiseExtensions { - const codec: () => Codec; - const encode: (obj: Partial) => Uint8Array; - const decode: (buf: Uint8Array | Uint8ArrayList) => NoiseExtensions; -} -export interface NoiseHandshakePayload { - identityKey: Uint8Array; - identitySig: Uint8Array; - extensions?: NoiseExtensions; -} -export declare namespace NoiseHandshakePayload { - const codec: () => Codec; - const encode: (obj: Partial) => Uint8Array; - const decode: (buf: Uint8Array | Uint8ArrayList) => NoiseHandshakePayload; -} -//# sourceMappingURL=payload.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/proto/payload.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/proto/payload.d.ts.map deleted file mode 100644 index 69519e688..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/proto/payload.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/proto/payload.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,KAAK,EAAyC,MAAM,iBAAiB,CAAA;AAEnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,WAAW,eAAe;IAC9B,sBAAsB,EAAE,UAAU,EAAE,CAAA;CACrC;AAED,yBAAiB,eAAe,CAAC;IAGxB,MAAM,KAAK,QAAO,MAAM,eAAe,CA4C7C,CAAA;IAEM,MAAM,MAAM,QAAS,QAAQ,eAAe,CAAC,KAAG,UAEtD,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,GAAG,cAAc,KAAG,eAEzD,CAAA;CACF;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,UAAU,CAAA;IACvB,WAAW,EAAE,UAAU,CAAA;IACvB,UAAU,CAAC,EAAE,eAAe,CAAA;CAC7B;AAED,yBAAiB,qBAAqB,CAAC;IAG9B,MAAM,KAAK,QAAO,MAAM,qBAAqB,CA6DnD,CAAA;IAEM,MAAM,MAAM,QAAS,QAAQ,qBAAqB,CAAC,KAAG,UAE5D,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,GAAG,cAAc,KAAG,qBAEzD,CAAA;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/proto/payload.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/proto/payload.js deleted file mode 100644 index 6ff217bdf..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/proto/payload.js +++ /dev/null @@ -1,119 +0,0 @@ -/* eslint-disable import/export */ -/* eslint-disable complexity */ -/* eslint-disable @typescript-eslint/no-namespace */ -/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ -/* eslint-disable @typescript-eslint/no-empty-interface */ -import { decodeMessage, encodeMessage, message } from 'protons-runtime'; -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -export var NoiseExtensions; -(function (NoiseExtensions) { - let _codec; - NoiseExtensions.codec = () => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork(); - } - if (obj.webtransportCerthashes != null) { - for (const value of obj.webtransportCerthashes) { - w.uint32(10); - w.bytes(value); - } - } - if (opts.lengthDelimited !== false) { - w.ldelim(); - } - }, (reader, length) => { - const obj = { - webtransportCerthashes: [] - }; - const end = length == null ? reader.len : reader.pos + length; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - obj.webtransportCerthashes.push(reader.bytes()); - break; - } - default: { - reader.skipType(tag & 7); - break; - } - } - } - return obj; - }); - } - return _codec; - }; - NoiseExtensions.encode = (obj) => { - return encodeMessage(obj, NoiseExtensions.codec()); - }; - NoiseExtensions.decode = (buf) => { - return decodeMessage(buf, NoiseExtensions.codec()); - }; -})(NoiseExtensions || (NoiseExtensions = {})); -export var NoiseHandshakePayload; -(function (NoiseHandshakePayload) { - let _codec; - NoiseHandshakePayload.codec = () => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork(); - } - if ((obj.identityKey != null && obj.identityKey.byteLength > 0)) { - w.uint32(10); - w.bytes(obj.identityKey); - } - if ((obj.identitySig != null && obj.identitySig.byteLength > 0)) { - w.uint32(18); - w.bytes(obj.identitySig); - } - if (obj.extensions != null) { - w.uint32(34); - NoiseExtensions.codec().encode(obj.extensions, w); - } - if (opts.lengthDelimited !== false) { - w.ldelim(); - } - }, (reader, length) => { - const obj = { - identityKey: uint8ArrayAlloc(0), - identitySig: uint8ArrayAlloc(0) - }; - const end = length == null ? reader.len : reader.pos + length; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - obj.identityKey = reader.bytes(); - break; - } - case 2: { - obj.identitySig = reader.bytes(); - break; - } - case 4: { - obj.extensions = NoiseExtensions.codec().decode(reader, reader.uint32()); - break; - } - default: { - reader.skipType(tag & 7); - break; - } - } - } - return obj; - }); - } - return _codec; - }; - NoiseHandshakePayload.encode = (obj) => { - return encodeMessage(obj, NoiseHandshakePayload.codec()); - }; - NoiseHandshakePayload.decode = (buf) => { - return decodeMessage(buf, NoiseHandshakePayload.codec()); - }; -})(NoiseHandshakePayload || (NoiseHandshakePayload = {})); -//# sourceMappingURL=payload.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/proto/payload.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/proto/payload.js.map deleted file mode 100644 index d87a4016f..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/proto/payload.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../src/proto/payload.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,+BAA+B;AAC/B,oDAAoD;AACpD,8EAA8E;AAC9E,0DAA0D;AAE1D,OAAO,EAAc,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACnF,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAO5D,MAAM,KAAW,eAAe,CAwD/B;AAxDD,WAAiB,eAAe;IAC9B,IAAI,MAA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A;YACZ,CAAC,CAAC,CAAA;SACH;QAED,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;IAEY,4BAAM,GAAG,CAAC,GAAmC,EAAc,EAAE;QACxE,OAAO,aAAa,CAAC,GAAG,EAAE,qBAAqB,CAAC,KAAK,EAAE,CAAC,CAAA;IAC1D,CAAC,CAAA;IAEY,4BAAM,GAAG,CAAC,GAAgC,EAAyB,EAAE;QAChF,OAAO,aAAa,CAAC,GAAG,EAAE,qBAAqB,CAAC,KAAK,EAAE,CAAC,CAAA;IAC1D,CAAC,CAAA;AACH,CAAC,EAzEgB,qBAAqB,KAArB,qBAAqB,QAyErC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/utils.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/utils.d.ts deleted file mode 100644 index 84d925c27..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/utils.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { type NoiseExtensions, NoiseHandshakePayload } from './proto/payload.js'; -import type { bytes } from './@types/basic.js'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export declare function getPayload(localPeer: PeerId, staticPublicKey: bytes, extensions?: NoiseExtensions): Promise; -export declare function createHandshakePayload(libp2pPublicKey: Uint8Array, signedPayload: Uint8Array, extensions?: NoiseExtensions): bytes; -export declare function signPayload(peerId: PeerId, payload: bytes): Promise; -export declare function getPeerIdFromPayload(payload: NoiseHandshakePayload): Promise; -export declare function decodePayload(payload: bytes | Uint8Array): NoiseHandshakePayload; -export declare function getHandshakePayload(publicKey: bytes): bytes; -/** - * Verifies signed payload, throws on any irregularities. - * - * @param {bytes} noiseStaticKey - owner's noise static key - * @param {bytes} payload - decoded payload - * @param {PeerId} remotePeer - owner's libp2p peer ID - * @returns {Promise} - peer ID of payload owner - */ -export declare function verifySignedPayload(noiseStaticKey: bytes, payload: NoiseHandshakePayload, remotePeer: PeerId): Promise; -export declare function isValidPublicKey(pk: bytes): boolean; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/utils.d.ts.map deleted file mode 100644 index 50f0d9642..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,wBAAsB,UAAU,CAC9B,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,KAAK,EACtB,UAAU,CAAC,EAAE,eAAe,GAC3B,OAAO,CAAC,KAAK,CAAC,CAYhB;AAED,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,UAAU,EAC3B,aAAa,EAAE,UAAU,EACzB,UAAU,CAAC,EAAE,eAAe,GAC3B,KAAK,CAMP;AAED,wBAAsB,WAAW,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAQjF;AAED,wBAAsB,oBAAoB,CAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAE3F;AAED,wBAAgB,aAAa,CAAE,OAAO,EAAE,KAAK,GAAG,UAAU,GAAG,qBAAqB,CAEjF;AAED,wBAAgB,mBAAmB,CAAE,SAAS,EAAE,KAAK,GAAG,KAAK,CAG5D;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,cAAc,EAAE,KAAK,EACrB,OAAO,EAAE,qBAAqB,EAC9B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAyBjB;AAED,wBAAgB,gBAAgB,CAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAUpD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/utils.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/utils.js deleted file mode 100644 index b88ea5ef4..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/utils.js +++ /dev/null @@ -1,74 +0,0 @@ -import { unmarshalPublicKey, unmarshalPrivateKey } from '@libp2p/crypto/keys'; -import { peerIdFromKeys } from '@libp2p/peer-id'; -import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { NoiseHandshakePayload } from './proto/payload.js'; -export async function getPayload(localPeer, staticPublicKey, extensions) { - const signedPayload = await signPayload(localPeer, getHandshakePayload(staticPublicKey)); - if (localPeer.publicKey == null) { - throw new Error('PublicKey was missing from local PeerId'); - } - return createHandshakePayload(localPeer.publicKey, signedPayload, extensions); -} -export function createHandshakePayload(libp2pPublicKey, signedPayload, extensions) { - return NoiseHandshakePayload.encode({ - identityKey: libp2pPublicKey, - identitySig: signedPayload, - extensions: extensions ?? { webtransportCerthashes: [] } - }).subarray(); -} -export async function signPayload(peerId, payload) { - if (peerId.privateKey == null) { - throw new Error('PrivateKey was missing from PeerId'); - } - const privateKey = await unmarshalPrivateKey(peerId.privateKey); - return privateKey.sign(payload); -} -export async function getPeerIdFromPayload(payload) { - return peerIdFromKeys(payload.identityKey); -} -export function decodePayload(payload) { - return NoiseHandshakePayload.decode(payload); -} -export function getHandshakePayload(publicKey) { - const prefix = uint8ArrayFromString('noise-libp2p-static-key:'); - return uint8ArrayConcat([prefix, publicKey], prefix.length + publicKey.length); -} -/** - * Verifies signed payload, throws on any irregularities. - * - * @param {bytes} noiseStaticKey - owner's noise static key - * @param {bytes} payload - decoded payload - * @param {PeerId} remotePeer - owner's libp2p peer ID - * @returns {Promise} - peer ID of payload owner - */ -export async function verifySignedPayload(noiseStaticKey, payload, remotePeer) { - // Unmarshaling from PublicKey protobuf - const payloadPeerId = await peerIdFromKeys(payload.identityKey); - if (!payloadPeerId.equals(remotePeer)) { - throw new Error(`Payload identity key ${payloadPeerId.toString()} does not match expected remote peer ${remotePeer.toString()}`); - } - const generatedPayload = getHandshakePayload(noiseStaticKey); - if (payloadPeerId.publicKey == null) { - throw new Error('PublicKey was missing from PeerId'); - } - if (payload.identitySig == null) { - throw new Error('Signature was missing from message'); - } - const publicKey = unmarshalPublicKey(payloadPeerId.publicKey); - const valid = await publicKey.verify(generatedPayload, payload.identitySig); - if (!valid) { - throw new Error("Static key doesn't match to peer that signed payload!"); - } - return payloadPeerId; -} -export function isValidPublicKey(pk) { - if (!(pk instanceof Uint8Array)) { - return false; - } - if (pk.length !== 32) { - return false; - } - return true; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/utils.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/utils.js.map deleted file mode 100644 index 7e09ad531..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/src/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAwB,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAIhF,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,SAAiB,EACjB,eAAsB,EACtB,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;AACb,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/compliance.spec.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/compliance.spec.d.ts deleted file mode 100644 index dac08d9d2..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/compliance.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=compliance.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/compliance.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/compliance.spec.d.ts.map deleted file mode 100644 index dc9e71995..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/compliance.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.d.ts","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/compliance.spec.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/compliance.spec.js deleted file mode 100644 index 68cfabeb5..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/compliance.spec.js +++ /dev/null @@ -1,11 +0,0 @@ -import tests from '@libp2p/interface-compliance-tests/connection-encryption'; -import { Noise } from '../src/noise.js'; -describe('spec compliance tests', function () { - tests({ - async setup() { - return new Noise(); - }, - async teardown() { } - }); -}); -//# sourceMappingURL=compliance.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/compliance.spec.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/compliance.spec.js.map deleted file mode 100644 index 43ca499a2..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/compliance.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.js","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,0DAA0D,CAAA;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,QAAQ,CAAC,uBAAuB,EAAE;IAChC,KAAK,CAAC;QACJ,KAAK,CAAC,KAAK;YACT,OAAO,IAAI,KAAK,EAAE,CAAA;QACpB,CAAC;QACD,KAAK,CAAC,QAAQ,KAAK,CAAC;KACrB,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/fixtures/peer.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/fixtures/peer.d.ts deleted file mode 100644 index 7a23a4986..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/fixtures/peer.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PeerId } from '@libp2p/interface/peer-id'; -export declare function createPeerIdsFromFixtures(length: number): Promise; -export declare function createPeerIds(length: number): Promise; -//# sourceMappingURL=peer.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/fixtures/peer.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/fixtures/peer.d.ts.map deleted file mode 100644 index f076c8510..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/fixtures/peer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer.d.ts","sourceRoot":"","sources":["../../../test/fixtures/peer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAqBvD,wBAAsB,yBAAyB,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAIlF;AAED,wBAAsB,aAAa,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAQtE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/fixtures/peer.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/fixtures/peer.js deleted file mode 100644 index 307e38c37..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/fixtures/peer.js +++ /dev/null @@ -1,31 +0,0 @@ -import { createEd25519PeerId, createFromJSON } from '@libp2p/peer-id-factory'; -// ed25519 keys -const peers = [{ - id: '12D3KooWH45PiqBjfnEfDfCD6TqJrpqTBJvQDwGHvjGpaWwms46D', - privKey: 'CAESYBtKXrMwawAARmLScynQUuSwi/gGSkwqDPxi15N3dqDHa4T4iWupkMe5oYGwGH3Hyfvd/QcgSTqg71oYZJadJ6prhPiJa6mQx7mhgbAYfcfJ+939ByBJOqDvWhhklp0nqg==', - pubKey: 'CAESIGuE+IlrqZDHuaGBsBh9x8n73f0HIEk6oO9aGGSWnSeq' - }, { - id: '12D3KooWP63uzL78BRMpkQ7augMdNi1h3VBrVWZucKjyhzGVaSi1', - privKey: 'CAESYPxO3SHyfc2578hDmfkGGBY255JjiLuVavJWy+9ivlpsxSyVKf36ipyRGL6szGzHuFs5ceEuuGVrPMg/rW2Ch1bFLJUp/fqKnJEYvqzMbMe4Wzlx4S64ZWs8yD+tbYKHVg==', - pubKey: 'CAESIMUslSn9+oqckRi+rMxsx7hbOXHhLrhlazzIP61tgodW' - }, { - id: '12D3KooWF85R7CM2Wikdtb2sjwnd24e1tgojf3MEWwizmVB8PA6U', - privKey: 'CAESYNXoQ5CnooE939AEqE2JJGPqvhoFJn0xP+j9KwjfOfDkTtPyfn2kJ1gn3uOYTcmoHFU1bbETNtRVuPMi1fmDmqFO0/J+faQnWCfe45hNyagcVTVtsRM21FW48yLV+YOaoQ==', - pubKey: 'CAESIE7T8n59pCdYJ97jmE3JqBxVNW2xEzbUVbjzItX5g5qh' - }, { - id: '12D3KooWPCofiCjhdtezP4eMnqBjjutFZNHjV39F5LWNrCvaLnzT', - privKey: 'CAESYLhUut01XPu+yIPbtZ3WnxOd26FYuTMRn/BbdFYsZE2KxueKRlo9yIAxmFReoNFUKztUU4G2aUiTbqDQaA6i0MDG54pGWj3IgDGYVF6g0VQrO1RTgbZpSJNuoNBoDqLQwA==', - pubKey: 'CAESIMbnikZaPciAMZhUXqDRVCs7VFOBtmlIk26g0GgOotDA' - }]; -export async function createPeerIdsFromFixtures(length) { - return Promise.all(Array.from({ length }).map(async (_, i) => createFromJSON(peers[i]))); -} -export async function createPeerIds(length) { - const peerIds = []; - for (let i = 0; i < length; i++) { - const id = await createEd25519PeerId(); - peerIds.push(id); - } - return peerIds; -} -//# sourceMappingURL=peer.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/fixtures/peer.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/fixtures/peer.js.map deleted file mode 100644 index a0da6c2d9..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/fixtures/peer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer.js","sourceRoot":"","sources":["../../../test/fixtures/peer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAG7E,eAAe;AACf,MAAM,KAAK,GAAG,CAAC;QACb,EAAE,EAAE,sDAAsD;QAC1D,OAAO,EAAE,0IAA0I;QACnJ,MAAM,EAAE,kDAAkD;KAC3D,EAAE;QACD,EAAE,EAAE,sDAAsD;QAC1D,OAAO,EAAE,0IAA0I;QACnJ,MAAM,EAAE,kDAAkD;KAC3D,EAAE;QACD,EAAE,EAAE,sDAAsD;QAC1D,OAAO,EAAE,0IAA0I;QACnJ,MAAM,EAAE,kDAAkD;KAC3D,EAAE;QACD,EAAE,EAAE,sDAAsD;QAC1D,OAAO,EAAE,0IAA0I;QACnJ,MAAM,EAAE,kDAAkD;KAC3D,CAAC,CAAA;AAEF,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAE,MAAc;IAC7D,OAAO,OAAO,CAAC,GAAG,CAChB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CACrE,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAE,MAAc;IACjD,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,MAAM,EAAE,GAAG,MAAM,mBAAmB,EAAE,CAAA;QACtC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;KACjB;IAED,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/handshakes/xx.spec.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/handshakes/xx.spec.d.ts deleted file mode 100644 index 638a8ffa7..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/handshakes/xx.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=xx.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/handshakes/xx.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/handshakes/xx.spec.d.ts.map deleted file mode 100644 index d46c424d4..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/handshakes/xx.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx.spec.d.ts","sourceRoot":"","sources":["../../../test/handshakes/xx.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/handshakes/xx.spec.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/handshakes/xx.spec.js deleted file mode 100644 index 1fb4f4029..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/handshakes/xx.spec.js +++ /dev/null @@ -1,126 +0,0 @@ -import { Buffer } from 'buffer'; -import { expect, assert } from 'aegir/chai'; -import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { pureJsCrypto } from '../../src/crypto/js.js'; -import { XX } from '../../src/handshakes/xx.js'; -import { createHandshakePayload, getHandshakePayload } from '../../src/utils.js'; -import { generateEd25519Keys } from '../utils.js'; -describe('XX Handshake', () => { - const prologue = Buffer.alloc(0); - it('Test creating new XX session', async () => { - try { - const xx = new XX(pureJsCrypto); - const kpInitiator = pureJsCrypto.generateX25519KeyPair(); - xx.initSession(true, prologue, kpInitiator); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('Test get HKDF', () => { - const ckBytes = Buffer.from('4e6f6973655f58585f32353531395f58436861436861506f6c795f53484132353600000000000000000000000000000000000000000000000000000000000000', 'hex'); - const ikm = Buffer.from('a3eae50ea37a47e8a7aa0c7cd8e16528670536dcd538cebfd724fb68ce44f1910ad898860666227d4e8dd50d22a9a64d1c0a6f47ace092510161e9e442953da3', 'hex'); - const ck = Buffer.alloc(32); - ckBytes.copy(ck); - const [k1, k2, k3] = pureJsCrypto.getHKDF(ck, ikm); - expect(uint8ArrayToString(k1, 'hex')).to.equal('cc5659adff12714982f806e2477a8d5ddd071def4c29bb38777b7e37046f6914'); - expect(uint8ArrayToString(k2, 'hex')).to.equal('a16ada915e551ab623f38be674bb4ef15d428ae9d80688899c9ef9b62ef208fa'); - expect(uint8ArrayToString(k3, 'hex')).to.equal('ff67bf9727e31b06efc203907e6786667d2c7a74ac412b4d31a80ba3fd766f68'); - }); - async function doHandshake(xx) { - const kpInit = pureJsCrypto.generateX25519KeyPair(); - const kpResp = pureJsCrypto.generateX25519KeyPair(); - // initiator setup - const libp2pInitKeys = await generateEd25519Keys(); - const initSignedPayload = await libp2pInitKeys.sign(getHandshakePayload(kpInit.publicKey)); - // responder setup - const libp2pRespKeys = await generateEd25519Keys(); - const respSignedPayload = await libp2pRespKeys.sign(getHandshakePayload(kpResp.publicKey)); - // initiator: new XX noise session - const nsInit = xx.initSession(true, prologue, kpInit); - // responder: new XX noise session - const nsResp = xx.initSession(false, prologue, kpResp); - /* STAGE 0 */ - // initiator creates payload - libp2pInitKeys.marshal().slice(0, 32); - const libp2pInitPubKey = libp2pInitKeys.marshal().slice(32, 64); - const payloadInitEnc = createHandshakePayload(libp2pInitPubKey, initSignedPayload); - // initiator sends message - const message = Buffer.concat([Buffer.alloc(0), payloadInitEnc]); - const messageBuffer = xx.sendMessage(nsInit, message); - expect(messageBuffer.ne.length).not.equal(0); - // responder receives message - xx.recvMessage(nsResp, messageBuffer); - /* STAGE 1 */ - // responder creates payload - libp2pRespKeys.marshal().slice(0, 32); - const libp2pRespPubKey = libp2pRespKeys.marshal().slice(32, 64); - const payloadRespEnc = createHandshakePayload(libp2pRespPubKey, respSignedPayload); - const message1 = Buffer.concat([message, payloadRespEnc]); - const messageBuffer2 = xx.sendMessage(nsResp, message1); - expect(messageBuffer2.ne.length).not.equal(0); - expect(messageBuffer2.ns.length).not.equal(0); - // initiator receive payload - xx.recvMessage(nsInit, messageBuffer2); - /* STAGE 2 */ - // initiator send message - const messageBuffer3 = xx.sendMessage(nsInit, Buffer.alloc(0)); - // responder receive message - xx.recvMessage(nsResp, messageBuffer3); - if (nsInit.cs1 == null || nsResp.cs1 == null || nsInit.cs2 == null || nsResp.cs2 == null) { - throw new Error('CipherState missing'); - } - assert(uint8ArrayEquals(nsInit.cs1.k, nsResp.cs1.k)); - assert(uint8ArrayEquals(nsInit.cs2.k, nsResp.cs2.k)); - return { nsInit, nsResp }; - } - it('Test handshake', async () => { - try { - const xx = new XX(pureJsCrypto); - await doHandshake(xx); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('Test symmetric encrypt and decrypt', async () => { - try { - const xx = new XX(pureJsCrypto); - const { nsInit, nsResp } = await doHandshake(xx); - const ad = Buffer.from('authenticated'); - const message = Buffer.from('HelloCrypto'); - if (nsInit.cs1 == null || nsResp.cs1 == null || nsInit.cs2 == null || nsResp.cs2 == null) { - throw new Error('CipherState missing'); - } - const ciphertext = xx.encryptWithAd(nsInit.cs1, ad, message); - assert(!uint8ArrayEquals(Buffer.from('HelloCrypto'), ciphertext), 'Encrypted message should not be same as plaintext.'); - const { plaintext: decrypted, valid } = xx.decryptWithAd(nsResp.cs1, ad, ciphertext); - assert(uint8ArrayEquals(Buffer.from('HelloCrypto'), decrypted), 'Decrypted text not equal to original message.'); - assert(valid); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('Test multiple messages encryption and decryption', async () => { - const xx = new XX(pureJsCrypto); - const { nsInit, nsResp } = await doHandshake(xx); - const ad = Buffer.from('authenticated'); - const message = Buffer.from('ethereum1'); - if (nsInit.cs1 == null || nsResp.cs1 == null || nsInit.cs2 == null || nsResp.cs2 == null) { - throw new Error('CipherState missing'); - } - const encrypted = xx.encryptWithAd(nsInit.cs1, ad, message); - const { plaintext: decrypted } = xx.decryptWithAd(nsResp.cs1, ad, encrypted); - assert.equal('ethereum1', uint8ArrayToString(decrypted, 'utf8'), 'Decrypted text not equal to original message.'); - const message2 = Buffer.from('ethereum2'); - const encrypted2 = xx.encryptWithAd(nsInit.cs1, ad, message2); - const { plaintext: decrypted2 } = xx.decryptWithAd(nsResp.cs1, ad, encrypted2); - assert.equal('ethereum2', uint8ArrayToString(decrypted2, 'utf-8'), 'Decrypted text not equal to original message.'); - }); -}); -//# sourceMappingURL=xx.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/handshakes/xx.spec.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/handshakes/xx.spec.js.map deleted file mode 100644 index c1bd0610e..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/handshakes/xx.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx.spec.js","sourceRoot":"","sources":["../../../test/handshakes/xx.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,EAAE,EAAE,MAAM,4BAA4B,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAIjD,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAEhC,EAAE,CAAC,8BAA8B,EAAE,KAAK,IAAI,EAAE;QAC5C,IAAI;YACF,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,YAAY,CAAC,CAAA;YAE/B,MAAM,WAAW,GAAY,YAAY,CAAC,qBAAqB,EAAE,CAAA;YAEjE,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAA;SAC5C;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,GAAG,GAAG,CAAU,CAAA;YACtB,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;SAC3B;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,eAAe,EAAE,GAA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EAAE,EAAE,QAAQ,CAAC,CAAA;QAC7D,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,EAAE,UAAU,CAAC,CAAA;QAC9E,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,kBAAkB,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,+CAA+C,CAAC,CAAA;IACrH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/index.spec.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/index.spec.d.ts deleted file mode 100644 index b37c2d278..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/index.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/index.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/index.spec.d.ts.map deleted file mode 100644 index 5c897805d..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/index.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../test/index.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/index.spec.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/index.spec.js deleted file mode 100644 index 19e71aa40..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/index.spec.js +++ /dev/null @@ -1,49 +0,0 @@ -import { expect } from 'aegir/chai'; -import { lpStream } from 'it-length-prefixed-stream'; -import { duplexPair } from 'it-pair/duplex'; -import sinon from 'sinon'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { noise } from '../src/index.js'; -import { Noise } from '../src/noise.js'; -import { createPeerIdsFromFixtures } from './fixtures/peer.js'; -function createCounterSpy() { - return sinon.spy({ - increment: () => { }, - reset: () => { } - }); -} -describe('Index', () => { - it('should expose class with tag and required functions', () => { - const noiseInstance = noise()(); - expect(noiseInstance.protocol).to.equal('/noise'); - expect(typeof (noiseInstance.secureInbound)).to.equal('function'); - expect(typeof (noiseInstance.secureOutbound)).to.equal('function'); - }); - it('should collect metrics', async () => { - const [localPeer, remotePeer] = await createPeerIdsFromFixtures(2); - const metricsRegistry = new Map(); - const metrics = { - registerCounter: (name) => { - const counter = createCounterSpy(); - metricsRegistry.set(name, counter); - return counter; - } - }; - const noiseInit = new Noise({ metrics: metrics }); - const noiseResp = new Noise({}); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection, localPeer) - ]); - const wrappedInbound = lpStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - await wrappedOutbound.write(uint8ArrayFromString('test')); - await wrappedInbound.read(); - expect(metricsRegistry.get('libp2p_noise_xxhandshake_successes_total')?.increment.callCount).to.equal(1); - expect(metricsRegistry.get('libp2p_noise_xxhandshake_error_total')?.increment.callCount).to.equal(0); - expect(metricsRegistry.get('libp2p_noise_encrypted_packets_total')?.increment.callCount).to.equal(1); - expect(metricsRegistry.get('libp2p_noise_decrypt_errors_total')?.increment.callCount).to.equal(0); - }); -}); -//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/index.spec.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/index.spec.js.map deleted file mode 100644 index 99a8bffc6..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/index.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.js","sourceR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AC,CAAA;QACpG,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,sCAAsC,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACpG,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,mCAAmC,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACnG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/interop.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/interop.d.ts deleted file mode 100644 index f160cf14e..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/interop.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=interop.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/interop.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/interop.d.ts.map deleted file mode 100644 index 14efbf496..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/interop.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interop.d.ts","sourceRoot":"","sources":["../../test/interop.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/interop.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/interop.js deleted file mode 100644 index 031d7f039..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/interop.js +++ /dev/null @@ -1,93 +0,0 @@ -import fs from 'fs'; -import { yamux } from '@chainsafe/libp2p-yamux'; -import { unmarshalPrivateKey } from '@libp2p/crypto/keys'; -import { createClient } from '@libp2p/daemon-client'; -import { createServer } from '@libp2p/daemon-server'; -import { connectInteropTests } from '@libp2p/interop'; -import { logger } from '@libp2p/logger'; -import { peerIdFromKeys } from '@libp2p/peer-id'; -import { tcp } from '@libp2p/tcp'; -import { multiaddr } from '@multiformats/multiaddr'; -import { execa } from 'execa'; -import { path as p2pd } from 'go-libp2p'; -import { createLibp2p } from 'libp2p'; -import pDefer from 'p-defer'; -import { noise } from '../src/index.js'; -async function createGoPeer(options) { - const controlPort = Math.floor(Math.random() * (50000 - 10000 + 1)) + 10000; - const apiAddr = multiaddr(`/ip4/0.0.0.0/tcp/${controlPort}`); - const log = logger(`go-libp2p:${controlPort}`); - const opts = [ - `-listen=${apiAddr.toString()}`, - '-hostAddrs=/ip4/0.0.0.0/tcp/0' - ]; - if (options.noise === true) { - opts.push('-noise=true'); - } - if (options.key != null) { - opts.push(`-id=${options.key}`); - } - const deferred = pDefer(); - const proc = execa(p2pd(), opts); - proc.stdout?.on('data', (buf) => { - const str = buf.toString(); - log(str); - // daemon has started - if (str.includes('Control socket:')) { - deferred.resolve(); - } - }); - proc.stderr?.on('data', (buf) => { - log.error(buf.toString()); - }); - await deferred.promise; - return { - client: createClient(apiAddr), - stop: async () => { - proc.kill(); - } - }; -} -async function createJsPeer(options) { - let peerId; - if (options.key != null) { - const keyFile = fs.readFileSync(options.key); - const privateKey = await unmarshalPrivateKey(keyFile); - peerId = await peerIdFromKeys(privateKey.public.bytes, privateKey.bytes); - } - const opts = { - peerId, - addresses: { - listen: ['/ip4/0.0.0.0/tcp/0'] - }, - transports: [tcp()], - streamMuxers: [yamux()], - connectionEncryption: [noise()] - }; - const node = await createLibp2p(opts); - const server = createServer(multiaddr('/ip4/0.0.0.0/tcp/0'), node); - await server.start(); - return { - client: createClient(server.getMultiaddr()), - stop: async () => { - await server.stop(); - await node.stop(); - } - }; -} -async function main() { - const factory = { - async spawn(options) { - if (options.type === 'go') { - return createGoPeer(options); - } - return createJsPeer(options); - } - }; - connectInteropTests(factory); -} -main().catch(err => { - console.error(err); // eslint-disable-line no-console - process.exit(1); -}); -//# sourceMappingURL=interop.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/interop.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/interop.js.map deleted file mode 100644 index 28efc87f8..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/interop.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interop.js","sourceRoot":"","sources":["../../test/interop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,YAAY,EAAsB,MAAM,QAAQ,CAAA;AACzD,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAIvC,KAAK,UAAU,YAAY,CAAE,OAAqB;IAChD,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAA;IAC3E,MAA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AO,CAAC,CAAA;QAC9B,CAAC;KACF,CAAA;IAED,mBAAmB,CAAC,OAAO,CAAC,CAAA;AAC9B,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA,CAAC,iCAAiC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/noise.spec.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/noise.spec.d.ts deleted file mode 100644 index f520ec336..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/noise.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=noise.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/noise.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/noise.spec.d.ts.map deleted file mode 100644 index 2e9faaa67..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/noise.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise.spec.d.ts","sourceRoot":"","sources":["../../test/noise.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/noise.spec.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/noise.spec.js deleted file mode 100644 index b8a3acafb..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/noise.spec.js +++ /dev/null @@ -1,182 +0,0 @@ -import { Buffer } from 'buffer'; -import { assert, expect } from 'aegir/chai'; -import { randomBytes } from 'iso-random-stream'; -import { byteStream } from 'it-byte-stream'; -import { lpStream } from 'it-length-prefixed-stream'; -import { duplexPair } from 'it-pair/duplex'; -import sinon from 'sinon'; -import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { NOISE_MSG_MAX_LENGTH_BYTES } from '../src/constants.js'; -import { pureJsCrypto } from '../src/crypto/js.js'; -import { decode0, decode2, encode1, uint16BEDecode, uint16BEEncode } from '../src/encoder.js'; -import { XXHandshake } from '../src/handshake-xx.js'; -import { XX } from '../src/handshakes/xx.js'; -import { Noise } from '../src/noise.js'; -import { createHandshakePayload, getHandshakePayload, getPayload, signPayload } from '../src/utils.js'; -import { createPeerIdsFromFixtures } from './fixtures/peer.js'; -import { getKeyPairFromPeerId } from './utils.js'; -describe('Noise', () => { - let remotePeer, localPeer; - const sandbox = sinon.createSandbox(); - before(async () => { - [localPeer, remotePeer] = await createPeerIdsFromFixtures(2); - }); - afterEach(function () { - sandbox.restore(); - }); - it('should communicate through encrypted streams without noise pipes', async () => { - try { - const noiseInit = new Noise({ staticNoiseKey: undefined, extensions: undefined }); - const noiseResp = new Noise({ staticNoiseKey: undefined, extensions: undefined }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection, localPeer) - ]); - const wrappedInbound = lpStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - await wrappedOutbound.write(Buffer.from('test')); - const response = await wrappedInbound.read(); - expect(uint8ArrayToString(response.slice())).equal('test'); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('should test that secureOutbound is spec compliant', async () => { - const noiseInit = new Noise({ staticNoiseKey: undefined }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, { wrapped, handshake }] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - (async () => { - const wrapped = lpStream(inboundConnection, { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - }); - const prologue = Buffer.alloc(0); - const staticKeys = pureJsCrypto.generateX25519KeyPair(); - const xx = new XX(pureJsCrypto); - const payload = await getPayload(remotePeer, staticKeys.publicKey); - const handshake = new XXHandshake(false, payload, prologue, pureJsCrypto, staticKeys, wrapped, localPeer, xx); - let receivedMessageBuffer = decode0((await wrapped.read()).slice()); - // The first handshake message contains the initiator's ephemeral public key - expect(receivedMessageBuffer.ne.length).equal(32); - xx.recvMessage(handshake.session, receivedMessageBuffer); - // Stage 1 - const { publicKey: libp2pPubKey } = getKeyPairFromPeerId(remotePeer); - const signedPayload = await signPayload(remotePeer, getHandshakePayload(staticKeys.publicKey)); - const handshakePayload = createHandshakePayload(libp2pPubKey, signedPayload); - const messageBuffer = xx.sendMessage(handshake.session, handshakePayload); - await wrapped.write(encode1(messageBuffer)); - // Stage 2 - finish handshake - receivedMessageBuffer = decode2((await wrapped.read()).slice()); - xx.recvMessage(handshake.session, receivedMessageBuffer); - return { wrapped, handshake }; - })() - ]); - const wrappedOutbound = byteStream(outbound.conn); - await wrappedOutbound.write(uint8ArrayFromString('test')); - // Check that noise message is prefixed with 16-bit big-endian unsigned integer - const data = (await wrapped.read()).slice(); - const { plaintext: decrypted, valid } = handshake.decrypt(data, handshake.session); - // Decrypted data should match - expect(uint8ArrayEquals(decrypted, uint8ArrayFromString('test'))).to.be.true(); - expect(valid).to.be.true(); - }); - it('should test large payloads', async function () { - this.timeout(10000); - try { - const noiseInit = new Noise({ staticNoiseKey: undefined }); - const noiseResp = new Noise({ staticNoiseKey: undefined }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection, localPeer) - ]); - const wrappedInbound = byteStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - const largePlaintext = randomBytes(60000); - await wrappedOutbound.write(Buffer.from(largePlaintext)); - const response = await wrappedInbound.read(60000); - expect(response.length).equals(largePlaintext.length); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('should working without remote peer provided in incoming connection', async () => { - try { - const staticKeysInitiator = pureJsCrypto.generateX25519KeyPair(); - const noiseInit = new Noise({ staticNoiseKey: staticKeysInitiator.privateKey }); - const staticKeysResponder = pureJsCrypto.generateX25519KeyPair(); - const noiseResp = new Noise({ staticNoiseKey: staticKeysResponder.privateKey }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection) - ]); - const wrappedInbound = lpStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - await wrappedOutbound.write(Buffer.from('test v2')); - const response = await wrappedInbound.read(); - expect(uint8ArrayToString(response.slice())).equal('test v2'); - if (inbound.remotePeer.publicKey == null || localPeer.publicKey == null || - outbound.remotePeer.publicKey == null || remotePeer.publicKey == null) { - throw new Error('Public key missing from PeerId'); - } - assert(uint8ArrayEquals(inbound.remotePeer.publicKey, localPeer.publicKey)); - assert(uint8ArrayEquals(outbound.remotePeer.publicKey, remotePeer.publicKey)); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('should accept and return Noise extension from remote peer', async () => { - try { - const certhashInit = Buffer.from('certhash data from init'); - const staticKeysInitiator = pureJsCrypto.generateX25519KeyPair(); - const noiseInit = new Noise({ staticNoiseKey: staticKeysInitiator.privateKey, extensions: { webtransportCerthashes: [certhashInit] } }); - const staticKeysResponder = pureJsCrypto.generateX25519KeyPair(); - const certhashResp = Buffer.from('certhash data from respon'); - const noiseResp = new Noise({ staticNoiseKey: staticKeysResponder.privateKey, extensions: { webtransportCerthashes: [certhashResp] } }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection) - ]); - assert(uint8ArrayEquals(inbound.remoteExtensions?.webtransportCerthashes[0] ?? new Uint8Array(), certhashInit)); - assert(uint8ArrayEquals(outbound.remoteExtensions?.webtransportCerthashes[0] ?? new Uint8Array(), certhashResp)); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('should accept a prologue', async () => { - try { - const noiseInit = new Noise({ staticNoiseKey: undefined, crypto: pureJsCrypto, prologueBytes: Buffer.from('Some prologue') }); - const noiseResp = new Noise({ staticNoiseKey: undefined, crypto: pureJsCrypto, prologueBytes: Buffer.from('Some prologue') }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection, localPeer) - ]); - const wrappedInbound = lpStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - await wrappedOutbound.write(Buffer.from('test')); - const response = await wrappedInbound.read(); - expect(uint8ArrayToString(response.slice())).equal('test'); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); -}); -//# sourceMappingURL=noise.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/noise.spec.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/noise.spec.js.map deleted file mode 100644 index 83437cd2c..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/noise.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise.spec.js","sourceRoot":"","sources":["../../test/noise.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EA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AAC,UAAU,EAAE,iBAAiB,EAAE,SAAS,CAAC;aAClE,CAAC,CAAA;YACF,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YAC7C,MAAM,eAAe,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;YAE/C,MAAM,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;YAChD,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC,IAAI,EAAE,CAAA;YAC5C,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;SAC3D;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,GAAG,GAAG,CAAU,CAAA;YACtB,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;SAC3B;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/utils.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/utils.d.ts deleted file mode 100644 index c7109157e..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/utils.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { KeyPair } from '../src/@types/libp2p.js'; -import type { PrivateKey } from '@libp2p/interface/keys'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export declare function generateEd25519Keys(): Promise; -export declare function getKeyPairFromPeerId(peerId: PeerId): KeyPair; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/utils.d.ts.map deleted file mode 100644 index 5d1b75ca9..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../test/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,wBAAsB,mBAAmB,IAAK,OAAO,CAAC,UAAU,CAAC,CAEhE;AAED,wBAAgB,oBAAoB,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAS7D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/utils.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/utils.js deleted file mode 100644 index decf6328f..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/utils.js +++ /dev/null @@ -1,14 +0,0 @@ -import { keys } from '@libp2p/crypto'; -export async function generateEd25519Keys() { - return keys.generateKeyPair('Ed25519', 32); -} -export function getKeyPairFromPeerId(peerId) { - if (peerId.privateKey == null || peerId.publicKey == null) { - throw new Error('PrivateKey or PublicKey missing from PeerId'); - } - return { - privateKey: peerId.privateKey.subarray(0, 32), - publicKey: peerId.publicKey - }; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/utils.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/utils.js.map deleted file mode 100644 index b318263c0..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../test/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAKrC,MAAM,CAAC,KAAK,UAAU,mBAAmB;IACvC,OAAO,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;AAC5C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAE,MAAc;IAClD,IAAI,MAAM,CAAC,UAAU,IAAI,IAAI,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI,EAAE;QACzD,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;KAC/D;IAED,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;QAC7C,SAAS,EAAE,MAAM,CAAC,SAAS;KAC5B,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/xx-handshake.spec.d.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/xx-handshake.spec.d.ts deleted file mode 100644 index 32a0f4c79..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/xx-handshake.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=xx-handshake.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/xx-handshake.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/xx-handshake.spec.d.ts.map deleted file mode 100644 index fa3bf2512..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/xx-handshake.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx-handshake.spec.d.ts","sourceRoot":"","sources":["../../test/xx-handshake.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/xx-handshake.spec.js b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/xx-handshake.spec.js deleted file mode 100644 index a89a68b08..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/xx-handshake.spec.js +++ /dev/null @@ -1,119 +0,0 @@ -import { Buffer } from 'buffer'; -import { assert, expect } from 'aegir/chai'; -import { lpStream } from 'it-length-prefixed-stream'; -import { duplexPair } from 'it-pair/duplex'; -import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; -import { defaultCrypto } from '../src/crypto/index.js'; -import { XXHandshake } from '../src/handshake-xx.js'; -import { getPayload } from '../src/utils.js'; -import { createPeerIdsFromFixtures } from './fixtures/peer.js'; -describe('XX Handshake', () => { - let peerA, peerB, fakePeer; - before(async () => { - [peerA, peerB, fakePeer] = await createPeerIdsFromFixtures(3); - }); - it('should propose, exchange and finish handshake', async () => { - try { - const duplex = duplexPair(); - const connectionFrom = lpStream(duplex[0]); - const connectionTo = lpStream(duplex[1]); - const prologue = Buffer.alloc(0); - const staticKeysInitiator = defaultCrypto.generateX25519KeyPair(); - const staticKeysResponder = defaultCrypto.generateX25519KeyPair(); - const initPayload = await getPayload(peerA, staticKeysInitiator.publicKey); - const handshakeInitiator = new XXHandshake(true, initPayload, prologue, defaultCrypto, staticKeysInitiator, connectionFrom, peerB); - const respPayload = await getPayload(peerB, staticKeysResponder.publicKey); - const handshakeResponder = new XXHandshake(false, respPayload, prologue, defaultCrypto, staticKeysResponder, connectionTo, peerA); - await Promise.all([ - handshakeInitiator.propose(), - handshakeResponder.propose() - ]); - await Promise.all([ - handshakeResponder.exchange(), - handshakeInitiator.exchange() - ]); - await Promise.all([ - handshakeInitiator.finish(), - handshakeResponder.finish() - ]); - const sessionInitator = handshakeInitiator.session; - const sessionResponder = handshakeResponder.session; - // Test shared key - if (sessionInitator.cs1 && sessionResponder.cs1 && sessionInitator.cs2 && sessionResponder.cs2) { - assert(uint8ArrayEquals(sessionInitator.cs1.k, sessionResponder.cs1.k)); - assert(uint8ArrayEquals(sessionInitator.cs2.k, sessionResponder.cs2.k)); - } - else { - assert(false); - } - // Test encryption and decryption - const encrypted = handshakeInitiator.encrypt(Buffer.from('encryptthis'), handshakeInitiator.session); - const { plaintext: decrypted, valid } = handshakeResponder.decrypt(encrypted, handshakeResponder.session); - assert(uint8ArrayEquals(decrypted, Buffer.from('encryptthis'))); - assert(valid); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('Initiator should fail to exchange handshake if given wrong public key in payload', async () => { - try { - const duplex = duplexPair(); - const connectionFrom = lpStream(duplex[0]); - const connectionTo = lpStream(duplex[1]); - const prologue = Buffer.alloc(0); - const staticKeysInitiator = defaultCrypto.generateX25519KeyPair(); - const staticKeysResponder = defaultCrypto.generateX25519KeyPair(); - const initPayload = await getPayload(peerA, staticKeysInitiator.publicKey); - const handshakeInitiator = new XXHandshake(true, initPayload, prologue, defaultCrypto, staticKeysInitiator, connectionFrom, fakePeer); - const respPayload = await getPayload(peerB, staticKeysResponder.publicKey); - const handshakeResponder = new XXHandshake(false, respPayload, prologue, defaultCrypto, staticKeysResponder, connectionTo, peerA); - await Promise.all([ - handshakeInitiator.propose(), - handshakeResponder.propose() - ]); - await Promise.all([ - handshakeResponder.exchange(), - handshakeInitiator.exchange() - ]); - assert(false, 'Should throw exception'); - } - catch (e) { - const err = e; - expect(err.message).equals(`Error occurred while verifying signed payload: Payload identity key ${peerB.toString()} does not match expected remote peer ${fakePeer.toString()}`); - } - }); - it('Responder should fail to exchange handshake if given wrong public key in payload', async () => { - try { - const duplex = duplexPair(); - const connectionFrom = lpStream(duplex[0]); - const connectionTo = lpStream(duplex[1]); - const prologue = Buffer.alloc(0); - const staticKeysInitiator = defaultCrypto.generateX25519KeyPair(); - const staticKeysResponder = defaultCrypto.generateX25519KeyPair(); - const initPayload = await getPayload(peerA, staticKeysInitiator.publicKey); - const handshakeInitiator = new XXHandshake(true, initPayload, prologue, defaultCrypto, staticKeysInitiator, connectionFrom, peerB); - const respPayload = await getPayload(peerB, staticKeysResponder.publicKey); - const handshakeResponder = new XXHandshake(false, respPayload, prologue, defaultCrypto, staticKeysResponder, connectionTo, fakePeer); - await Promise.all([ - handshakeInitiator.propose(), - handshakeResponder.propose() - ]); - await Promise.all([ - handshakeResponder.exchange(), - handshakeInitiator.exchange() - ]); - await Promise.all([ - handshakeInitiator.finish(), - handshakeResponder.finish() - ]); - assert(false, 'Should throw exception'); - } - catch (e) { - const err = e; - expect(err.message).equals(`Error occurred while verifying signed payload: Payload identity key ${peerA.toString()} does not match expected remote peer ${fakePeer.toString()}`); - } - }); -}); -//# sourceMappingURL=xx-handshake.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/xx-handshake.spec.js.map b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/xx-handshake.spec.js.map deleted file mode 100644 index 6b3161d8a..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/test/xx-handshake.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx-handshake.spec.js","sourceRoot":"","sources":["../../test/xx-handshake.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAG9D,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAI,KAAa,EAAE,KAAa,EAAE,QAAgB,CAAA;IAElD,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,GA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C,QAAQ,EAAE;gBAC7B,kBAAkB,CAAC,QAAQ,EAAE;aAC9B,CAAC,CAAA;YAEF,MAAM,OAAO,CAAC,GAAG,CAAC;gBAChB,kBAAkB,CAAC,MAAM,EAAE;gBAC3B,kBAAkB,CAAC,MAAM,EAAE;aAC5B,CAAC,CAAA;YAEF,MAAM,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAA;SACxC;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,GAAG,GAAG,CAAU,CAAA;YACtB,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,uEAAuE,KAAK,CAAC,QAAQ,EAAE,wCAAwC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;SACjL;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/tsconfig.tsbuildinfo deleted file mode 100644 index 901f0c0f3..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/constants.ts","../src/@types/basic.ts","../node_modules/protons-runtime/dist/src/codec.d.ts","../node_modules/uint8arraylist/dist/src/index.d.ts","../node_modules/protons-runtime/dist/src/decode.d.ts","../node_modules/protons-runtime/dist/src/encode.d.ts","../node_modules/protons-runtime/dist/src/codecs/enum.d.ts","../node_modules/protons-runtime/dist/src/codecs/message.d.ts","../node_modules/protons-runtime/dist/src/utils/reader.d.ts","../node_modules/protons-runtime/dist/src/utils/writer.d.ts","../node_modules/protons-runtime/dist/src/index.d.ts","../node_modules/uint8arrays/dist/src/alloc.d.ts","../src/proto/payload.ts","../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface/dist/src/peer-id/index.d.ts","../node_modules/it-stream-types/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-encrypter/index.d.ts","../src/@types/libp2p.ts","../src/nonce.ts","../src/@types/handshake.ts","../src/crypto.ts","../node_modules/uint8arrays/dist/src/concat.d.ts","../node_modules/it-length-prefixed/dist/src/encode.d.ts","../node_modules/it-reader/dist/src/index.d.ts","../node_modules/it-length-prefixed/dist/src/decode.d.ts","../node_modules/it-length-prefixed/dist/src/index.d.ts","../src/encoder.ts","../node_modules/@libp2p/interface/dist/src/errors.d.ts","../node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../node_modules/multiformats/dist/types/src/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../node_modules/multiformats/dist/types/src/varint.d.ts","../node_modules/multiformats/dist/types/src/bytes.d.ts","../node_modules/multiformats/dist/types/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ed25519-class.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/interface.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ecdh.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ephemeral-keys.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/key-stretcher.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/keys.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/rsa-class.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/secp256k1-class.d.ts","../node_modules/@libp2p/interface/dist/src/keys/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/index.d.ts","../node_modules/@libp2p/peer-id/dist/src/index.d.ts","../node_modules/multiformats/dist/types/src/codecs/raw.d.ts","../node_modules/multiformats/dist/types/src/codecs/json.d.ts","../node_modules/multiformats/dist/types/src/bases/base.d.ts","../node_modules/multiformats/dist/types/src/basics.d.ts","../node_modules/uint8arrays/dist/src/util/bases.d.ts","../node_modules/uint8arrays/dist/src/from-string.d.ts","../src/utils.ts","../node_modules/uint8arrays/dist/src/compare.d.ts","../node_modules/uint8arrays/dist/src/equals.d.ts","../node_modules/uint8arrays/dist/src/to-string.d.ts","../node_modules/uint8arrays/dist/src/xor.d.ts","../node_modules/uint8arrays/dist/src/index.d.ts","../node_modules/@libp2p/logger/dist/src/index.d.ts","../src/logger.ts","../src/handshakes/abstract-handshake.ts","../src/handshakes/xx.ts","../src/@types/handshake-interface.ts","../node_modules/it-byte-stream/dist/src/index.d.ts","../node_modules/it-length-prefixed-stream/dist/src/index.d.ts","../src/handshake-xx.ts","../node_modules/it-pair/dist/src/duplex.d.ts","../node_modules/it-pipe/dist/src/index.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/types.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/wasm.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/chacha20poly1305.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/poly1305.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/chacha20.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/index.d.ts","../node_modules/@chainsafe/as-sha256/lib/hashobject.d.ts","../node_modules/@chainsafe/as-sha256/lib/wasm.d.ts","../node_modules/@chainsafe/as-sha256/lib/sha256.d.ts","../node_modules/@chainsafe/as-sha256/lib/index.d.ts","../node_modules/wherearewe/dist/src/index.d.ts","../node_modules/@noble/ciphers/utils.d.ts","../node_modules/@noble/ciphers/chacha.d.ts","../node_modules/@noble/curves/abstract/utils.d.ts","../node_modules/@noble/curves/abstract/modular.d.ts","../node_modules/@noble/curves/abstract/curve.d.ts","../node_modules/@noble/curves/abstract/edwards.d.ts","../node_modules/@noble/curves/abstract/hash-to-curve.d.ts","../node_modules/@noble/curves/abstract/montgomery.d.ts","../node_modules/@noble/curves/ed25519.d.ts","../node_modules/@noble/hashes/utils.d.ts","../node_modules/@noble/hashes/hkdf.d.ts","../node_modules/@noble/hashes/_sha2.d.ts","../node_modules/@noble/hashes/sha256.d.ts","../src/crypto/js.ts","../src/crypto/index.ts","../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-info/index.d.ts","../node_modules/@libp2p/interface/dist/src/content-routing/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/buffer/index.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@libp2p/interface/dist/src/events.d.ts","../node_modules/@libp2p/interface/dist/src/keychain/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-routing/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-store/index.d.ts","../node_modules/@libp2p/interface/dist/src/startable.d.ts","../node_modules/@libp2p/interface/dist/src/stream-handler/index.d.ts","../node_modules/@libp2p/interface/dist/src/topology/index.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/index.d.ts","../node_modules/@libp2p/interface/dist/src/transport/index.d.ts","../node_modules/@libp2p/interface/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection/index.d.ts","../node_modules/@libp2p/interface/dist/src/metrics/index.d.ts","../src/metrics.ts","../src/crypto/streaming.ts","../src/noise.ts","../src/index.ts","../src/crypto/index.browser.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/index.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/connection-encryption/index.d.ts","../test/compliance.spec.ts","../node_modules/@types/chai/index.d.ts","../node_modules/@types/chai-as-promised/index.d.ts","../node_modules/chai-parentheses/index.d.ts","../node_modules/@types/chai-subset/index.d.ts","../node_modules/chai-bites/index.d.ts","../node_modules/@types/chai-string/index.d.ts","../node_modules/aegir/dist/utils/chai.d.ts","../node_modules/@types/sinonjs__fake-timers/index.d.ts","../node_modules/@types/sinon/index.d.ts","../node_modules/@libp2p/peer-id-factory/dist/src/index.d.ts","../test/fixtures/peer.ts","../test/index.spec.ts","../node_modules/it-pushable/dist/src/index.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/config.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/frame.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/stream.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/muxer.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/index.d.ts","../node_modules/@libp2p/daemon-protocol/dist/src/index.d.ts","../node_modules/@libp2p/daemon-protocol/dist/src/stream-handler.d.ts","../node_modules/@libp2p/daemon-client/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/pubsub/index.d.ts","../node_modules/protobufjs/index.d.ts","../node_modules/protobufjs/minimal.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/decoderpc.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message-cache.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/metrics.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/set.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-stats.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/compute-score.d.ts","../node_modules/denque/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/message-deliveries.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/tracer.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/config.d.ts","../node_modules/@libp2p/peer-collections/dist/src/map.d.ts","../node_modules/@libp2p/peer-collections/dist/src/set.d.ts","../node_modules/@libp2p/peer-collections/dist/src/list.d.ts","../node_modules/@libp2p/peer-collections/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/connection-manager/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/registrar/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/key.d.ts","../node_modules/interface-store/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/providers.d.ts","../node_modules/@libp2p/interface-internal/dist/src/address-manager/index.d.ts","../node_modules/progress-events/dist/src/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/record/record.d.ts","../node_modules/@libp2p/kad-dht/dist/src/record/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/index.d.ts","../node_modules/@libp2p/daemon-server/dist/src/index.d.ts","../node_modules/@libp2p/interop/dist/src/connect.d.ts","../node_modules/@libp2p/interop/dist/src/dht/index.d.ts","../node_modules/@libp2p/interop/dist/src/pubsub/index.d.ts","../node_modules/@libp2p/interop/dist/src/relay/index.d.ts","../node_modules/@libp2p/interop/dist/src/streams/index.d.ts","../node_modules/@libp2p/interop/dist/src/index.d.ts","../node_modules/@libp2p/tcp/dist/src/listener.d.ts","../node_modules/@libp2p/tcp/dist/src/index.d.ts","../node_modules/execa/index.d.ts","../node_modules/go-libp2p/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/transport-manager/index.d.ts","../node_modules/libp2p/dist/src/address-manager/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-gater/index.d.ts","../node_modules/libp2p/dist/src/components.d.ts","../node_modules/libp2p/dist/src/connection-manager/auto-dial.d.ts","../node_modules/libp2p/dist/src/connection-manager/connection-pruner.d.ts","../node_modules/eventemitter3/index.d.ts","../node_modules/p-queue/dist/queue.d.ts","../node_modules/p-queue/dist/options.d.ts","../node_modules/p-queue/dist/priority-queue.d.ts","../node_modules/p-queue/dist/index.d.ts","../node_modules/libp2p/dist/src/connection-manager/dial-queue.d.ts","../node_modules/libp2p/dist/src/connection-manager/index.d.ts","../node_modules/libp2p/dist/src/transport-manager.d.ts","../node_modules/@libp2p/interface/dist/src/peer-discovery/index.d.ts","../node_modules/@libp2p/keychain/dist/src/index.d.ts","../node_modules/@libp2p/peer-store/dist/src/index.d.ts","../node_modules/libp2p/dist/src/index.d.ts","../node_modules/p-defer/index.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface-peer-id/dist/src/index.d.ts","../test/interop.ts","../node_modules/iso-random-stream/dist/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/aes/index.d.ts","../node_modules/@libp2p/crypto/dist/src/hmac/index.d.ts","../node_modules/@libp2p/crypto/dist/src/pbkdf2.d.ts","../node_modules/@libp2p/crypto/dist/src/random-bytes.d.ts","../node_modules/@libp2p/crypto/dist/src/index.d.ts","../test/utils.ts","../test/noise.spec.ts","../test/xx-handshake.spec.ts","../test/handshakes/xx.spec.ts","../node_modules/keyv/src/index.d.ts","../node_modules/@types/http-cache-semantics/index.d.ts","../node_modules/@types/responselike/index.d.ts","../node_modules/@types/cacheable-request/index.d.ts","../node_modules/@types/ms/index.d.ts","../node_modules/@types/debug/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/keyv/index.d.ts","../node_modules/@types/linkify-it/index.d.ts","../node_modules/@types/mdurl/encode.d.ts","../node_modules/@types/mdurl/decode.d.ts","../node_modules/@types/mdurl/parse.d.ts","../node_modules/@types/mdurl/format.d.ts","../node_modules/@types/mdurl/index.d.ts","../node_modules/@types/markdown-it/lib/common/utils.d.ts","../node_modules/@types/markdown-it/lib/token.d.ts","../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../node_modules/@types/markdown-it/lib/ruler.d.ts","../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../node_modules/@types/markdown-it/lib/parser_block.d.ts","../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../node_modules/@types/markdown-it/lib/parser_core.d.ts","../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../node_modules/@types/markdown-it/lib/renderer.d.ts","../node_modules/@types/markdown-it/lib/index.d.ts","../node_modules/@types/markdown-it/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/mdast/index.d.ts","../node_modules/@types/minimatch/index.d.ts","../node_modules/@types/minimist/index.d.ts","../node_modules/@types/mocha/index.d.ts","../node_modules/@types/normalize-package-data/index.d.ts","../node_modules/@types/parse-json/index.d.ts","../node_modules/@types/retry/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts","../node_modules/@types/strip-bom/index.d.ts","../node_modules/@types/strip-json-comments/index.d.ts","../node_modules/@types/ungap__structured-clone/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts","../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"1bc2fdadc59c4529e51cd693e1bb45c0f9d6c4cf079b008fa3a17da4cd08af44","signature":"a5b2968580425f209992ad1d8a62ab079d84643e00e0f0b11f65fe6423a643f5"},{"version":"a00b40912153391370bfc844161907779723e82cd2d671b3bebea763212f048e","signature":"35095a100857bdbca3c31ddd6e1eb18259140dee0092d97e631889daf084eaec"},"fd617cc8eec6f43227ab572160bac9d23c723073e83a9b100bd15c758eff34c2","176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d","ec3786b43d68955ecdb12ce679d3bc61b6b25c4d0ac5bcdaf50fa4a746189b98","3155e98b0df0c1523715e8a1c75c8a67c401aeb58d6eccf8bd89d5d775b8c1cf","fa82b7b22d9df87323e31e9e2ad75911028f3e544647fd212424b3c4452fee3f","90aa0b916eef195a17c3dbd621746f82ac7969ecc3dbf27c81ee4c68c5af7f25","9ceec2a882368c0160a8a3879aa0efce0fb985751fc23ff6191006030969cfa4","cad5d6451789234434c28dd2d6a8267b0d64c479b1ad267321faa31ba90d570b","e0e8254f7a1a21b5768beb4dbc9d4574ce67aefa59d88251d16b17c658f2a69e","c33b700f5d0797c331e08b29f8440204e19cf035555ea9111321f881f1b4702a",{"version":"b2d663f1f5da5b395c5dc6ba6dbc633d61580235f82faaca06bf420fcdae46cf","signature":"6744c64cda78d6af7280d69c20ead828fa4296efe0b582548cb10ab66914993d"},"f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc","ef82c906869585495c4db05510ba176e76f56369e32bec8ef2b86d1fa587c0cb",{"version":"1cd9488f96f8d5657d4109a6ae188f65846e905c5b236fdf379c16362e7a60a7","signature":"612bf9cb0b0a7ce6eab9fa9c09da1b1e4e5ec8f6b94f282035bfc89f68d4f3c6"},{"version":"2dec630463aaa98bfbc039a798f1757b9d53fd8ebd1722817b05b4534133d8cb","signature":"1cc2659564153cef042b6a377a36a04d861398d678e7032ec42698d8c80ec77f"},{"version":"ad1764b2c66d631e98be0b8255b410a319857ece25c6e8ae9627a535a0241c6b","signature":"1f66808998faa0d77e425d4c5ae8f481c3234d4b8c1deff001e1af71b4b041f3"},{"version":"c99a598040f64ddf29965a42c440a61492300923e58015c9dbad51a95f245b53","signature":"2f37bd92ed3c6cbac299dbfd79abe367c5e5d72e098abdb8d3e3900badd53e88"},"6af9cf238459fe6d7e2d61cd50a157a6f540905c9793718e0e6e5993ab0cd650","f30cfcfff28ee8f87563225b47239bb07b9b11edd09dda0ea6499b18cca1a30e","0edb8a97ead1fefd337458449050857e80740e31a3f76cffa656262f4e651a50","db8e4b47dd8c22634e3a326e5a5f60aa71a8ad4a0458fc0aadb6951f1c7cdc54","5b7a6d3f5c1b1d94d6cbc6c1e113588e20ae61d583d0d0cb5ec3fd92926d3749",{"version":"9b049b5846d72928c2395497888572c54f9059a27521fdafe26db26a51b8b64f","signature":"464342c22eab0ab0f11401e2486a77f30bd50d59bc5cccdc8bff69392a8aad22"},"1af281fe45ffa0dc1f9939f18e7df291771b3077e30161ec7bd6cd9769e74c5b","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","b9998d79c6cb4e43e9d812fec5ccafbedee623c589904e3e3f0439ef861e25dd","7a6f74294b8fb90f5e3832be21e25898dd81b2a1adc36dda6929813ba4135311","d25e693302c8e284b417884b40dbadffe693b0daff8999a000995114dbf74c49","a1d4ac1b15cd62c7346d976e3a01e6cbcd4f166ea6b7866907d25c5acc832d77","5d40e6a7071d0d1e6e558e17214ff786ecb3ea73e31b25a88c2cbe2435fa1252","c45242078469b9680653d6a0667b23b1b767ec908825a14bfa8bb1dde2e30dae","5dcd218cfe8eb7fd6a1e5668c1a98734ddefe888d17129f8844552dddda2a74d","0564c90e8c2577950a446d6197a3ab7ec433ad5ac98435378e8855427f4cbf24","e1712267198fc3dd7903d0b945d5049fd56d68cadaf986c0adc40235fee43488","df21f5c49d638cbd6bd322eeb5b16d8352ba14ccb88cc9b23a7d8d5c2eaaf659","f6d13788d90394a540d136fb8ba9a0a647d8baa2e51d2ae155d039b031f4717f","88de5467cd5e4c2c1384629806d56ac1215657bddf39ef9f60a0e05beee2b131","ff5820394809bfc32a7e4586ff11b3c07327a0f4c756709aef92f1cd73d6da48","bfe2af20f3ff0579331661ef4c5d2597e0c31a7a0d760e41eaff0502bf064c4d","f52a0e53f79d7fd1c1c55a3cbda59499d4cce75f3188969024cdc286b29ad3ea","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f",{"version":"9b48eef82666050e509dece807d29b825fde4909ac48c7f1cab67390973a03ec","signature":"220216e61adba5829f622fe331a5a99d4aeedcda11c983149ceff8a063d2585f"},"0eff9792dd66a9aef708b34dd51d2e46158ae518db6ab14f54c5a99e8551abe7","66336b5a5d5e897e932cbf1e306ff8ac8a9929971409a8049c8c8a249cd8b57c","a878d4c7237a7af50e96534295fcf723134d70cbb1e9bfd8365266b912aee6ec","1185e162cb22a9bc3e94b2ae2ba35ed943ee69beae5364b38680f7d8587e7d35","23b0b3d88c166dad8d63750b716b921c51053ad54b14a4e7e32fd526033566db","fbacab2238e299ccf6596c3bd404c7dcad2c5a88ecd254a8a38cf2d184a67c75",{"version":"177dfa229223890f5e22db17d46280f2d4a16ca4c9ab73e4bbff4a1fd12300b4","signature":"e8f2522c8a4cf550c9fcc6154869253bd9ece549be7b5aeaaa7b20f73fb5cd83"},{"version":"e82bddfda890f3c83d1ece8c1df0ce57769a2a82b0ff81aff1409b329a460fc2","signature":"3f39c6ba0e49842fc434134519c30a89d3ec16da9701cf4d1113abf2f2ccfa17"},{"version":"a9ed6ff8aa6f2ea797e06d0f8bb03a4f43ab73a8adf133166140ca1ea208b520","signature":"b73dc3c92a3cdfe4144eafad3b73c13787c5cffe4ec5b35cd0467e9a3ede9ec1"},{"version":"b55e067a9546ac1c237571f938f04ae6593e138a2c1a645ed9171dbc36ee764e","signature":"f30884bec83e02740b8a410ecba62ba558f571a554e1b377ac4b83dff125b57e"},"4de66b5983d6286bfe3606cf155a5b21043111389d0b4c7b23d3f4282099f7d4","3968eed4d327e075c2386fad0b39b5ad2fe1892f6409a3bb46660c46f58300a6",{"version":"36be103794251feb6152dd2c8ec5d0e5f841a189c920881bccfe27f7459f54ed","signature":"0cae8a9a58a4d4836626ea63c8e3e699e7bcdab24c31ef39009abaf97c704b1c"},"b1129d7c114eba7c7b155dc809d6371ef86a0738f7ca93b3efef9b796d6168d9","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6","ffff3307a2c3797cdc04d7493e94245c13a646194c87f5bf5d2432995b834cc3","a87bc62d9a6be405f53f883a422efd557775224cd2b6688440cd333aaac27169","3d08777d7a3f5c1899a21dc2bd9f0ca80cfe0badba576cae22f5b47b7f81b3eb","bbbfe3163d9421b837e4e203c24243344be38e4359b6fc15426943454d8949b6","8cf4dc652e929c4de69ce5079b98a0683757b2dde66a7cee93edcb5aa08d5c48","f74d877f1fc949fb61197bf32a41829a83ee6aea528787dc2788378baaaa0ecf","a62a02c433e6fee26404825310ad462433320ef2e9f80fa7b9156135fd975f8f","22f15ae5c80b3e795da92636aa03d8f981811d067d82bff01ca54093c0535ec0","b56d4bc83ec01834829979ad57de59b4947cd62f71b102ab0040b6960d5bdc81","a10213415bf98670b026b77a90c7933594f0b5c34bde5b74e80134fdf0331bba","00cd454fa42dca69cdea08d4cb9698e679ba9a31762c23d905e45ba92269ac3a","58765e8e715155b2940e868ab1534b1bfac7087f6b42f7810ef94cc077d62981","f1c4e4db3e1dd83c3749f174e662de845e1217017ead0c15074e3ba00db67b6e","5aaea3d4b3af0c8339006c30af04eafdeb21b0a1bba2f1d32540ade412ee80a7","eb72bbe04857681ebd08a48d3b0869969c335445c31de53a85f76b4a42b97c92","c8cc38cbba80bfd5719c1b9d7efcd76fc90d4497e8a9aa715db426993274f0ae","49b6ff487f2d72569e361f077397214fea20839712527f5fb9ed8bb877dd7db8","d3043c37eeeb10d8a5c0c2a3b9d72e23a5fed2e9a367c5b4154bc8d9283601f3","58ff317d61b47e8fc6688bd50e6770311691202553f119d1e1d79b64d864e200","cde49e6e1ab8a2b4202958e3267e898489b737198a0599c7d251f94d9dea658b","3c3ca314a2b01902ef19b499be6e052925a849f14e2d9185afb323df3d3a72b6","b4b4af7820e7888cf67beeb95d0d6144b3d854370a7b78a598e80dc268e74249","1e7146a407bf85762b80681cd4aa3b544000e30c9b24d04685dfa69f82a48fd9","a3c42863fed9b49c35144d60aa0b2865b5fede65ea0050a28f45381af6dae035",{"version":"d898e165d52d3df19f98e46a53df138c8e28b1ec7224e75140d419f7bc60c7f0","signature":"8db42cde9161c917ae86f075cb21c16d1fab5965db0c4f4b372b4e7a0276f82e"},{"version":"f2f278cd3ffe7eb472b5daaec63622a32623cdf0d71395dfe60895363af42dc7","signature":"a03bc49af672574771ede656f9c35be60c2ba44f45655aed449e7f9e5efae6aa"},"5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","2cd3b80c4762701c0faffcfaa6f9ba62ab7142260eb2de1b9d1c16f79279fe98","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","285e512c7a0db217a0599e18c462d565fa35be4a5153dd7b80bee88c83e83ddf","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"7ae9dc7dbb58cd843065639707815df85c044babaa0947116f97bdb824d07204","affectsGlobalScope":true},"7aae1df2053572c2cfc2089a77847aadbb38eedbaa837a846c6a49fb37c6e5bd","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"dea4c00820d4fac5e530d4842aed2fb20d6744d75a674b95502cbd433f88bcb0","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"b7eadc0b0cba14ab854122810f330314132c5cfdb7800fceb82d521997a1f5b0","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"2225100373ca3d63bcc7f206e1177152d2e2161285a0bd83c8374db1503a0d1f","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","4a34b074b11c3597fb2ff890bc8f1484375b3b80793ab01f974534808d5777c7",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","86c8c1efb4a8dc35b6270afbea0699e7d2b593ce4f3d68c3d113366e0dbbe7b5","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","4b390c96252610ad4f8b618206794b68ddb26ba12a9ef7bc4bbd7a91f7eba079","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","903812fa2dee0229a8719dcf99f78864c4982094e543f550835ad4418f32412b","010d5afec4b47ea596f6c59a25ce628fa4e31ea15fd51e73d44ca2d72a780be8","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","5558e4604734e02b341074c8ceb8b9cc9cd384927d0afdf611151979674aa50d","c654f65182914e9c6fccea238077f6cfc5619983540f760e72c4fae994ba8a0b","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373",{"version":"19e0cd3c787b3570a7e8c20aa0718062bfb65e97391bd700bf37612569f3fc68","signature":"39c164f8cfdeb33577063044cf89c43c19bb4f79fae41960e0a17c6de26272c5"},{"version":"71d64228c276b302a3366694eccc893f0f87852a47d5403f8e7dece932a57d80","signature":"359839a161afecbb53809ce04c488ae920ecff78baecc1340a00d6510f925085"},{"version":"7df0e86aca945ca17fd7d1ec89900a721cd08a52be3527a973ee304ab0065d69","signature":"6dcaef60eda2d8ce9edd754065e1911f6703207b218b29c6b0ad7b75c40ba39c"},{"version":"aaa8702650fe4efdb8e82d41231add24a0b809b17f55d52009dc469c8ee0b011","signature":"f2dc190b33c1e842552ab4117c29cc960edd8ce2327a22254ec47cbcbdbb91f7"},{"version":"96db0fd5e766faa06d7b4f3ccc7e3b7df29a4c1aa4f116eaec55e5936e321325","signature":"0017550b13ae859f43d4b435fdab5e5035b0d6f7b7959458f30f67e859882d4d"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","e9fd0c57db08c441b0f044449b651e5d9910fa6c7871dbcb4d266b9cd357e2ed",{"version":"bf471b46fd0e07028f318e408bc578f4a3e125333bb545445175e6ba50791ffe","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2","81c6dd936bf342efbb1b1a5440a4300db5d39d70a6ad49ebc91ca7033ae9ce79",{"version":"13acb84a8fa8264d596433ae541c83b13d226a9592e6a26b165002c38132b97a","signature":"e307a4efa11c7f907b4e98ebb9496837e1901f13a19d8b0ed8c51205b09d528f"},{"version":"68a9c7d8574845240bed7f60c6a81b4161fdac9d0deb425e25501711319775f4","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","c8031a5db82b240f801a5684ab693e95e1e06dc76958894fe42d35acbd446f28","1633b84fd3346ad6500a88e7a119ac778bb6f6b2746a3b7b8164c5ef2721822f","49e76985bbdc15fde17a1cbfcc0e8f846424d6d232160fb767d9080bbd08afbe","5c9d5e0cd18c905ee6f6bc6f85b02c4d5b6f64ad08e1181f63785fae04823db3","5abd603c11eeb815a1746ff003233ae03c8f4f34fcf7835742c30fff038d4100","df54eaa5ea53c6bb3a9548bc5d2f6fb22583ea3e8b936a4e8ec5acfd90422ff3","be8d072f400254824429edab10acbe595299b702c97b99cc47f8e8018b7102ff","1a319786bea64c944ba8dd33331090034468efbab9c2fb96552850033d62d8d8","33174450482b921bbf093e3d52f501f7f93b5fd612311aa86e7339f2800162aa","03e385ae2125c9aa9dead008b42a0ab20d0812c26c19ee210d84c2666113f867","688c9dfd2b7114f5f01022abb5b179659f990d5af5924f185c2644ca99fe7b77","932cade1c5802123b5831f332ad8a6297f0f7d14d0ee04f5a774408f393e2200","925a8770415572378b7b62dcd714e744b7ffed86de59bdbe1d25c68d9d1f7f51","38fc2c990835686053591402bd73803ef28e117fa49427763e62636fd16c76ad","85489033e86eba49bfef2ad7330f8bb57cf7ef6aeb341c00ae1a3e5b19a02f4f","d4936633d5453e441ad5ab182efad46a0e1285fe5f9f5c2948cad3e71b7c2c23","a1b60bd2328318dcbec30bdf529dad31a13315ff2df60c8bd71630c58a575b06","e7ad5aa8eb177708949df3abbfe5ccbe7b75c920fb3bdd89426c38c61f239da6","8cc6a35806cd10d448b0f2ab01fe0b6194ca57fdaced2d71781b68e83c55bd88","8f364fec0ef20506aa9cf00b5cd8b620c1c0389687b11a3a32b0b5d4716ad894","5d11703e2c5d4dbe00bbe79f3bc864d178cf8d6ebccc2d1448ea29e93654f029","f4e82c91aac3b61f3ad04f11a44c5b79f724ff8a09281d0afa24a6624633ff25","ed849d616865076f44a41c87f27698f7cdf230290c44bafc71d7c2bc6919b202","7b8b9017156ef8bf3bbe42785fac8956e5c9869f4a494536d7f548a7c1c7d98a","eb2f08ae9c540a5fb60a5edddc0860ca3dad54ec842301ca73441d9e54534af0","763bb8df872cbb8783e29e19bd7a1dea0f88f7fd7398343af38be8509a65df82","687ce021a76c91c0e0b08fa5b828de2916e1b1aa9a23394e8ebc4dd96b8ee776","c286b410193495d067668bcdbd13ea3f3a39001edff02edee248babf2652e563","ba1405da509cc84896a588978efc45400d4f9844ee738d750b59868b1ad1618a","83a1426ac1a9cf144141dfe10d71a68629623a7c28245c9ca0e0352bead501fd","2726c0a6a4a87fad11e6846e6b0b40b8924fbe66340adc512093c4273bc53e4e","c888daaa99fdf6c5712d98605fdcf21cbbaab756a629661a44cac44ede464d37","e044f60686dc70015a3b7e7c64ad0ac5ec5ec101a0aede0782ec077e136b6a65","a232f867897bbecfebf68df575a417af1afd9b5dd3d83fb4d59e0a133a0de93d","228dbc8825b7a45af7d416dee95c0a2162d7cf73ffddfd52357b7e548882bdaa","602baeb62ccf84672ba7afacb5a21b675171282397513cac8f06d3a8634f840c","8970ab047d89c71edf9973609dd62f61bb366abeabbff36a1200103b6c1c605b","36d756189d9295e3a964e5cd45cb8ac965d5d2ada53ed848e08608426c146d69","8bdb5c16e8b9ba625ec08d8189879a6fb47b2c3c458a5d43ebd53a8763b5712e","93597e08900c3ac5ec730c16c4fbe425f7342e1f0420967b2afd90d67a2abee1","af89ab13b40dd28cd91818fc6329914d2b9663591831f032ff0f0cb4a028d4a5","6e6733927ade923e34b243d6fbec1465cfc8ed6edf62c6e09ed00c529f0d93de","83b3a9e85f7967509436fcdfa9be9bd543fb54003a9233c5c0af087e4a2c11c8","dc92d6eccf12395aa1d47afb765d5e4a1cd2639a385db0e3e88e9937ad2b63a3","ffb6e0556a4b5323c8bdf12727d000e8a3633f0552fffc4b779ae88546be2770","1242141c87ba3396bead6f379f6d6778bd38d02017f243aa448d1454a5fdc90e","17a4105ddae0308e19ee8532bdeb76278efa9dc644366060ca644541d3fd831c","913ffa031f7455c53e99c75ae130a046612d2ee0e716ed92707e996cbd3952ea","44e897d02326bf4d8169ea9638fe0a4c53b8f85cc48ae2fcbbb67b2f72c1d805","288fb1b9df77067c3c2675bde87d23d4a3f01bb6f929f854f11bdb68662968ff","b43b5156bc2831b46f6226777e292ff1646b3651ce190708b6228a078d42da4a","c3e77c4aa1097a38dcf4a20a093ce65033a16f3a48dab0ae3c5f6661bc39b11c","93acb99d30b8a22b443bfefb333d15d6310af7bd76a832f9559f7af9535ed2ae","3053e413471eef0274bc90318db14072e6164fbcc77765ab9557a769370382b2","32cbe201bfe8ed7f4c323fb8a3fcfdfb451f22e84d3c49da33ceda2fbf9230be","50d536e2e8bdbb4234b6ade05992aa4227fbf0401aba24922734c3ddb4a3ff11","4e152867a5b1bea2dc6a2921c0196f877630fc144369f8c7b9a69905caa62741","445c1751941d390dedf7667ab0fef01d468089576c07eba15810bf69485e4589","7f2cc72a16a663ab9f8d99bd5658e583251ce0c003bf80a948973e15a7ef9596","6af42c3c33c7123e7b056a6fd272d470914f382fad5e99689fa4991ff610e757","60f7cf25a65631bcfc27276a9b7b584ad13c2a37f871376d5d02e2133bc5fef9","e1c0439c8c796ddfdd08206dfd2cf7a7defec9d83f7b1e873d908489bda18af4","27679e96d1bd38c5938178aaf4abe8627493090b63d6bae2ce8436e6a87ebe4d","a77fbecee25688f568e18b43f8f54195d6c278a2a9a687ada5ab3d2f726524eb","e29f2b3a93ca3392fe29fa8e7b93985e854b44fe28e2b5c113f08296095bd6b7","d27956c8b392088a06d882e1edb58aab4d5cf5ab1229b73f99329ab21f352147","d643518d0b08b3d8d6e7f1fa884bca57ef95caaa1c312abbd9e1d4ed0d51c370","8c15566043b036c0720caf51ca343754e84e34fbaaf4a58d8080cf4ab2d93734","d8c8d41b25ef1827daaff9d84db43593995ce075551e7f4d8f10e316261e86f0","22fcf82dcbb4743dc846e838434ad1c2843cd18476e534dd3b37f85ece99ac73","40924f439552f559ffa4e41d300a411646ac9f3b53e578a012f7c439d36c6a30","7a34c06f5ed61c8108b2b82b7834655f1933d6ead3c9f6ff9d12efee4cb4bcaf","ee24d63f039e5745a279243916c7bb2c3d405bc0158912c0f37471381b467087","459c0ca522af7a412ef771447fe2c558c9a4640cffa4f53bacac05d0378a3ae7","acd5d501223e3a7cdd229b501fce5fb071937b72bd05fa33e543eb21c8ee0aba","f196d5ed4194259ffb797a34001a5edb7a165cd110dc3e4d8f03f11e3531fe9b","683889752b7c95fffd073b82ea76d36b3fe548ef3bb9887eb903676eabd676ff","a439ff9443c77478bb024ea2d96fbc088bccc915adf6bb8aeb9ab21fd737a071","b40afc6ff175241970202125bc1b5996cf5783b2f755977691f8c6522ace9f14","8bfc11f55ca063b10f0335922693ca70885d8f59b20607dd501250d1b1e960db","a884051a029dc34c400dc1dbad39a878935d37ebbea62d357d17b25f0076b578",{"version":"1b1ca1d97df4268847d5c387b1a89c01ec2fdc2062def1216442c8f040dcb660","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"6e0011406961ab3d469f2a7c3fddc41a5c9fb6d9452c47b5389124da846ab07a","df1bbd333631040027035b56cb31093015e59ce977a590500ed09feab109939b","a4f27ea63e3ff26a94b6681967a5276a2df9ddb80ae990df1ad03c0fffb34eca","18418f70457cee30da01c21bc26869ceb1ae65564784136f7fe2f7f2ff8f740f","3d2ec84143e6462a786b5d9ecf06f4f6f67a59a1f16c5a3a5e41721ba8478b7f","892f412f701d356f85cd3cb7d48b87ffecc0d4f85a2005c1d53e5e08414df8b1",{"version":"14261c0d2da587df791a696c8272003a3c5c1d7dd3a91f459092a8ab99759ca3","signature":"23d9dffba690dd7b1cc3986e0d592011a8660f0cb7632037b83b157b659c1510"},{"version":"fec448c28b27f22f30caa8d21162c19760708f9c360af218427e1877e62c5116","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"28ff2e0cd9350ef52ad5d6a77ddf2650d0505bd3d8cb1db66e1e5abf798d0c92","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"86b69f4f564965d8fd203354ebfcc235e37958a8195b600161deb5b9982a4dde","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a","4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","852bcf5d92d819abdf34ba0759c311b61d5dac7b9963a6c3cc4f23b025dee8f3","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[61,62,73,[82,85],91,117,[124,127],130,157,158,[263,267],270,281,282,365,[372,375]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[133,243],[133,134,243],[134,135,136,137,243],[134,243],[243],[139,141,243],[140,243],[79,123,243,251,254,293,296,297,298,299,301,309,310,311,312,317,318],[243,296,298],[243,295,296],[243,294],[243,293,296,298,300],[243,302,304],[243,300,302,308],[243,306],[243,298,301,302,303,304,305,307],[243,298],[64,243,261],[243,298,301],[79,108,161,243,293,296],[123,243],[243,258,285,288],[64,80,243,258,260,283,284,285,287],[64,243,260,284,285,286],[109,243,367,368,369,370],[101,243],[99,243],[102,243],[100,103,104,105,106,107,108,243],[64,71,243],[64,78,79,80,161,162,243,290,291],[64,80,243],[161,243,260,261,290,319,328],[81,243,268],[161,243],[79,161,243,260,261,316],[243,257,261],[161,243,259,261],[243,359,363],[243,362,363],[243,362],[243,359,360,361],[79,80,243],[79,161,243,261],[64,79,80,161,243,260],[78,162,243,260],[213,243,250],[79,161,162,163,243,251,252,253,254,255,256,257,259,261,262],[74,79,108,243],[243,261],[162,243,251],[76,78,243],[79,161,243],[79,162,243,260],[64,79,243,251,261,283],[64,80,243,260,261],[79,243,261],[161,243,251,258,260,261],[243,335],[243,292,330,331,332,333,334],[78,79,162,243,251,254,260,262,317,318,322,323,324,325,327],[79,99,243,255,322],[64,243,326],[79,108,243,252,322],[79,243],[243,313,314,315],[79,108,243],[74,76,78,79,243],[79,161,243,251,254,260,322],[161,243,259,262,336],[161,243,251,259,261,262,337],[159,160,243],[144,243],[147,243],[146,147,148,243],[146,148,149,150,151,243],[153,243],[153,155,243],[213,216,242,243,250,376,377,378],[243,271],[243,380],[243,406],[243,391],[243,395,396,397],[243,394],[243,396],[243,386,392,393,398,401,403,404,405],[243,393,399,400,406],[243,399,402],[243,393,394,399,406],[243,393,406],[243,408],[243,387,388,389,390],[164,243],[200,243],[201,206,234,243],[202,213,214,221,231,242,243],[202,203,213,221,243],[204,243],[205,206,214,222,243],[206,231,239,243],[207,209,213,221,243],[208,243],[209,210,243],[213,243],[211,213,243],[200,213,243],[213,214,215,231,242,243],[213,214,215,228,231,234,243],[198,243,247],[209,213,216,221,231,242,243],[213,214,216,217,221,231,239,242,243],[216,218,231,239,242,243],[164,165,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249],[213,219,243],[220,242,243,247],[209,213,221,231,243],[222,243],[223,243],[200,224,243],[225,241,243,247],[226,243],[227,243],[213,228,229,243],[228,230,243,245],[201,213,231,232,233,234,243],[201,231,233,243],[231,232,243],[234,243],[235,243],[200,231,243],[213,237,238,243],[237,238,243],[206,221,231,239,243],[240,243],[221,241,243],[201,216,227,242,243],[206,243],[231,243,244],[220,243,245],[243,246],[201,206,213,215,224,231,242,243,245,247],[231,243,248],[216,231,243,250],[243,416,455],[243,416,440,455],[243,455],[243,416],[243,416,441,455],[243,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454],[243,441,455],[243,278],[243,459],[213,231,243,250],[243,271,272,273,274,275,276],[243,271,272],[201,202,231,243],[243,320,321],[120,243],[64,80,90,128,243],[64,80,88,90,243],[64,80,90,243],[64,87,89,243],[80,243],[79,161,243,251,254,260,340],[79,163,243,251,253,254,255,259,260,261,262,317,318,322,324,340,342],[243,251,254,255,260,317],[161,243,251,254,260,317],[79,161,243,254,260,261,262,316,340,342,350],[79,161,243,251,254,255,260,261,262,316,317,340,342,344,345,351],[79,81,163,243,253,258,259,260,261,262,322,341,342,343,352,353,354,355,356],[161,243,251,255,259,260,261,262,324,340],[74,243],[99,111,112,113,243],[77,78,243],[77,243],[75,243],[93,243],[76,243],[76,95,243],[78,94,95,96,97,98,243],[74,75,76,77,93,243],[74,75,76,243],[243,346,347,348,349],[243,347],[243,347,348],[71,243],[63,243],[63,71,243],[63,64,243],[63,65,66,67,68,69,70,243],[115,243],[86,115,116,118,119,120,121,243],[99,114,243],[175,179,242,243],[175,231,242,243],[170,243],[172,175,239,242,243],[221,239,243],[243,250],[170,243,250],[172,175,221,242,243],[167,168,171,174,201,213,231,242,243],[167,173,243],[171,175,201,234,242,243,250],[201,243,250],[191,201,243,250],[169,170,243,250],[175,243],[169,170,171,172,173,174,175,176,177,179,180,181,182,183,184,185,186,187,188,189,190,192,193,194,195,196,197,243],[175,182,183,243],[173,175,183,184,243],[174,243],[167,170,175,243],[175,179,183,184,243],[179,243],[173,175,178,242,243],[167,172,173,175,179,182,243],[201,231,243],[170,175,191,201,243,247,250],[62,73,79,84,243],[62,82,83,243],[62,73,81,243],[62,82,84,243],[157,243],[82,85,138,142,143,157,206,243],[62,82,84,85,145,152,154,156,243],[61,64,80,91,122,127,243,263],[62,64,72,84,86,90,243],[62,72,73,79,82,84,85,91,92,117,124,126,127,129,243],[62,72,83,84,85,86,119,122,124,243],[62,72,82,84,117,125,243],[73,81,85,157,243,265],[61,82,84,120,123,243],[243,262],[61,62,72,73,79,80,81,82,85,90,91,117,127,129,130,131,132,158,243,262,263,264],[62,72,243],[64,71,72,243],[62,73,79,86,109,110,116,243],[243,265,269],[79,243,280],[82,84,117,119,120,126,157,201,243,277,372],[116,129,131,243,262,265,266,277,279,281],[109,110,123,161,214,243,266,289,292,329,335,337,338,339,357,358,364],[61,79,91,116,117,119,120,126,128,129,130,131,157,201,243,265,277,279,281,366,372],[79,82,108,243,371],[79,117,119,129,130,131,158,201,243,277,281],[62,73,79,84],[62,82,83],[62,73,81],[62,82,84],[266],[85],[64,80,127,263],[62,84,90],[62,73,79,82,84,85,126,127,129],[62,83,84,85],[62,82,84,125],[73,81,85,157,265],[82,84,123],[262],[62,73,79,80,81,82,85,262],[62],[64,71],[62,73,79],[79],[79,82,108]],"referencedMap":[[137,1],[135,2],[138,3],[136,4],[133,5],[134,5],[139,5],[142,6],[141,7],[140,5],[312,5],[319,8],[299,9],[297,10],[296,11],[301,12],[305,13],[309,14],[307,15],[302,5],[300,5],[308,16],[304,17],[310,18],[311,19],[298,20],[303,5],[284,21],[285,5],[289,22],[288,23],[287,24],[367,5],[368,5],[371,25],[102,26],[100,27],[103,28],[109,29],[101,5],[104,26],[105,30],[106,27],[107,27],[369,5],[370,5],[292,31],[290,30],[291,32],[329,33],[269,34],[268,5],[324,35],[317,36],[318,37],[340,38],[364,39],[360,5],[361,40],[363,41],[359,5],[362,42],[81,43],[342,44],[261,45],[163,46],[92,5],[251,47],[260,48],[252,49],[108,5],[262,50],[354,51],[79,52],[162,53],[253,54],[254,53],[293,55],[255,5],[256,50],[258,56],[286,56],[257,57],[259,58],[330,59],[331,59],[335,60],[332,59],[333,59],[334,59],[328,61],[323,62],[327,63],[326,30],[355,64],[123,65],[316,66],[315,65],[313,65],[314,65],[280,67],[110,68],[356,69],[337,70],[336,71],[160,35],[161,72],[159,35],[145,73],[144,5],[148,74],[149,75],[150,75],[147,5],[151,5],[146,5],[152,76],[155,77],[154,77],[156,78],[153,5],[379,79],[272,80],[276,80],[274,80],[271,5],[381,81],[377,5],[382,5],[383,5],[384,5],[385,47],[386,5],[407,82],[392,83],[398,84],[396,5],[395,85],[397,86],[406,87],[401,88],[403,89],[404,90],[405,91],[399,5],[400,91],[402,91],[394,91],[393,5],[409,92],[388,5],[387,5],[390,83],[391,93],[389,83],[410,5],[411,5],[412,5],[380,5],[164,94],[165,94],[200,95],[201,96],[202,97],[203,98],[204,99],[205,100],[206,101],[207,102],[208,103],[209,104],[210,104],[212,105],[211,106],[213,107],[214,108],[215,109],[199,110],[249,5],[216,111],[217,112],[218,113],[250,114],[219,115],[220,116],[221,117],[222,118],[223,119],[224,120],[225,121],[226,122],[227,123],[228,124],[229,124],[230,125],[231,126],[233,127],[232,128],[234,129],[235,130],[236,131],[237,132],[238,133],[239,134],[240,135],[241,136],[242,137],[243,138],[244,139],[245,140],[246,141],[247,142],[248,143],[413,5],[414,5],[378,144],[415,5],[440,145],[441,146],[416,147],[419,147],[438,145],[439,145],[429,145],[428,148],[426,145],[421,145],[434,145],[432,145],[436,145],[420,145],[433,145],[437,145],[422,145],[423,145],[435,145],[417,145],[424,145],[425,145],[427,145],[431,145],[442,149],[430,145],[418,145],[455,150],[454,5],[449,149],[451,151],[450,149],[443,149],[444,149],[446,149],[448,149],[452,151],[453,151],[445,151],[447,151],[279,152],[278,5],[456,5],[457,5],[458,5],[408,5],[459,5],[460,153],[461,154],[277,155],[166,5],[275,80],[273,156],[306,5],[346,5],[338,157],[339,5],[322,158],[320,159],[321,5],[366,5],[128,32],[129,160],[89,161],[87,162],[90,163],[131,164],[132,164],[283,5],[88,32],[80,5],[376,105],[341,165],[343,166],[344,167],[345,168],[351,169],[352,170],[357,171],[353,172],[113,173],[74,5],[114,174],[75,175],[98,5],[78,176],[93,177],[112,178],[111,178],[95,179],[96,180],[76,5],[99,181],[94,182],[77,183],[97,5],[358,5],[350,184],[348,185],[349,186],[347,5],[325,5],[294,5],[295,11],[63,187],[67,188],[68,189],[65,190],[66,188],[71,191],[69,30],[70,187],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[64,5],[72,5],[118,5],[86,5],[119,5],[116,192],[122,193],[120,192],[115,194],[121,5],[182,195],[189,196],[181,195],[196,197],[173,198],[172,199],[195,200],[190,201],[193,202],[175,203],[174,204],[170,205],[169,206],[192,207],[171,208],[176,209],[177,5],[180,209],[167,5],[198,210],[197,209],[184,211],[185,212],[187,213],[183,214],[186,215],[191,200],[178,216],[179,217],[188,218],[168,219],[194,220],[143,5],[62,5],[127,221],[84,222],[82,223],[61,5],[85,224],[267,225],[158,226],[157,227],[264,228],[91,229],[130,230],[125,231],[126,232],[266,233],[124,234],[263,235],[265,236],[83,237],[73,238],[117,239],[270,240],[281,241],[375,242],[282,243],[365,244],[373,245],[372,246],[374,247]],"exportedModulesMap":[[137,1],[135,2],[138,3],[136,4],[133,5],[134,5],[139,5],[142,6],[141,7],[140,5],[312,5],[319,8],[299,9],[297,10],[296,11],[301,12],[305,13],[309,14],[307,15],[302,5],[300,5],[308,16],[304,17],[310,18],[311,19],[298,20],[303,5],[284,21],[285,5],[289,22],[288,23],[287,24],[367,5],[368,5],[371,25],[102,26],[100,27],[103,28],[109,29],[101,5],[104,26],[105,30],[106,27],[107,27],[369,5],[370,5],[292,31],[290,30],[291,32],[329,33],[269,34],[268,5],[324,35],[317,36],[318,37],[340,38],[364,39],[360,5],[361,40],[363,41],[359,5],[362,42],[81,43],[342,44],[261,45],[163,46],[92,5],[251,47],[260,48],[252,49],[108,5],[262,50],[354,51],[79,52],[162,53],[253,54],[254,53],[293,55],[255,5],[256,50],[258,56],[286,56],[257,57],[259,58],[330,59],[331,59],[335,60],[332,59],[333,59],[334,59],[328,61],[323,62],[327,63],[326,30],[355,64],[123,65],[316,66],[315,65],[313,65],[314,65],[280,67],[110,68],[356,69],[337,70],[336,71],[160,35],[161,72],[159,35],[145,73],[144,5],[148,74],[149,75],[150,75],[147,5],[151,5],[146,5],[152,76],[155,77],[154,77],[156,78],[153,5],[379,79],[272,80],[276,80],[274,80],[271,5],[381,81],[377,5],[382,5],[383,5],[384,5],[385,47],[386,5],[407,82],[392,83],[398,84],[396,5],[395,85],[397,86],[406,87],[401,88],[403,89],[404,90],[405,91],[399,5],[400,91],[402,91],[394,91],[393,5],[409,92],[388,5],[387,5],[390,83],[391,93],[389,83],[410,5],[411,5],[412,5],[380,5],[164,94],[165,94],[200,95],[201,96],[202,97],[203,98],[204,99],[205,100],[206,101],[207,102],[208,103],[209,104],[210,104],[212,105],[211,106],[213,107],[214,108],[215,109],[199,110],[249,5],[216,111],[217,112],[218,113],[250,114],[219,115],[220,116],[221,117],[222,118],[223,119],[224,120],[225,121],[226,122],[227,123],[228,124],[229,124],[230,125],[231,126],[233,127],[232,128],[234,129],[235,130],[236,131],[237,132],[238,133],[239,134],[240,135],[241,136],[242,137],[243,138],[244,139],[245,140],[246,141],[247,142],[248,143],[413,5],[414,5],[378,144],[415,5],[440,145],[441,146],[416,147],[419,147],[438,145],[439,145],[429,145],[428,148],[426,145],[421,145],[434,145],[432,145],[436,145],[420,145],[433,145],[437,145],[422,145],[423,145],[435,145],[417,145],[424,145],[425,145],[427,145],[431,145],[442,149],[430,145],[418,145],[455,150],[454,5],[449,149],[451,151],[450,149],[443,149],[444,149],[446,149],[448,149],[452,151],[453,151],[445,151],[447,151],[279,152],[278,5],[456,5],[457,5],[458,5],[408,5],[459,5],[460,153],[461,154],[277,155],[166,5],[275,80],[273,156],[306,5],[346,5],[338,157],[339,5],[322,158],[320,159],[321,5],[366,5],[128,32],[129,160],[89,161],[87,162],[90,163],[131,164],[132,164],[283,5],[88,32],[80,5],[376,105],[341,165],[343,166],[344,167],[345,168],[351,169],[352,170],[357,171],[353,172],[113,173],[74,5],[114,174],[75,175],[98,5],[78,176],[93,177],[112,178],[111,178],[95,179],[96,180],[76,5],[99,181],[94,182],[77,183],[97,5],[358,5],[350,184],[348,185],[349,186],[347,5],[325,5],[294,5],[295,11],[63,187],[67,188],[68,189],[65,190],[66,188],[71,191],[69,30],[70,187],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[64,5],[72,5],[118,5],[86,5],[119,5],[116,192],[122,193],[120,192],[115,194],[121,5],[182,195],[189,196],[181,195],[196,197],[173,198],[172,199],[195,200],[190,201],[193,202],[175,203],[174,204],[170,205],[169,206],[192,207],[171,208],[176,209],[177,5],[180,209],[167,5],[198,210],[197,209],[184,211],[185,212],[187,213],[183,214],[186,215],[191,200],[178,216],[179,217],[188,218],[168,219],[194,220],[143,5],[127,248],[84,249],[82,250],[85,251],[267,252],[158,253],[157,253],[264,254],[91,255],[130,256],[125,257],[126,258],[266,259],[124,260],[263,261],[265,262],[83,263],[73,264],[117,265],[281,266],[372,267]],"semanticDiagnosticsPerFile":[137,135,138,136,133,134,139,142,141,140,312,319,299,297,296,301,305,309,307,302,300,308,304,310,311,298,303,284,285,289,288,287,367,368,371,102,100,103,109,101,104,105,106,107,369,370,292,290,291,329,269,268,324,317,318,340,364,360,361,363,359,362,81,342,261,163,92,251,260,252,108,262,354,79,162,253,254,293,255,256,258,286,257,259,330,331,335,332,333,334,328,323,327,326,355,123,316,315,313,314,280,110,356,337,336,160,161,159,145,144,148,149,150,147,151,146,152,155,154,156,153,379,272,276,274,271,381,377,382,383,384,385,386,407,392,398,396,395,397,406,401,403,404,405,399,400,402,394,393,409,388,387,390,391,389,410,411,412,380,164,165,200,201,202,203,204,205,206,207,208,209,210,212,211,213,214,215,199,249,216,217,218,250,219,220,221,222,223,224,225,226,227,228,229,230,231,233,232,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,413,414,378,415,440,441,416,419,438,439,429,428,426,421,434,432,436,420,433,437,422,423,435,417,424,425,427,431,442,430,418,455,454,449,451,450,443,444,446,448,452,453,445,447,279,278,456,457,458,408,459,460,461,277,166,275,273,306,346,338,339,322,320,321,366,128,129,89,87,90,131,132,283,88,80,376,341,343,344,345,351,352,357,353,113,74,114,75,98,78,93,112,111,95,96,76,99,94,77,97,358,350,348,349,347,325,294,295,63,67,68,65,66,71,69,70,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,64,72,118,86,119,116,122,120,115,121,182,189,181,196,173,172,195,190,193,175,174,170,169,192,171,176,177,180,167,198,197,184,185,187,183,186,191,178,179,188,168,194,143,62,127,84,82,61,85,267,158,157,264,91,130,125,126,266,124,263,265,83,73,117,270,281,375,282,365,373,372,374],"latestChangedDtsFile":"./test/handshakes/xx.spec.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/package.json b/perf/impl/js-libp2p/v1.0-native-x25519/noise/package.json deleted file mode 100644 index f57d80eba..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/package.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "name": "@chainsafe/libp2p-noise", - "version": "13.0.3", - "author": "ChainSafe ", - "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/ChainSafe/js-libp2p-noise#readme", - "repository": { - "type": "git", - "url": "git+https://github.com/ChainSafe/js-libp2p-noise.git" - }, - "bugs": { - "url": "https://github.com/ChainSafe/js-libp2p-noise/issues" - }, - "keywords": [ - "crypto", - "libp2p", - "noise" - ], - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - }, - "type": "module", - "types": "./dist/src/index.d.ts", - "files": [ - "src", - "dist", - "!dist/test", - "!**/*.tsbuildinfo" - ], - "exports": { - ".": { - "types": "./dist/src/index.d.ts", - "import": "./dist/src/index.js" - } - }, - "eslintConfig": { - "extends": "ipfs", - "parserOptions": { - "sourceType": "module" - }, - "rules": { - "@typescript-eslint/no-unused-vars": "error", - "@typescript-eslint/explicit-function-return-type": "warn", - "@typescript-eslint/strict-boolean-expressions": "off" - }, - "ignorePatterns": [ - "src/proto/payload.js", - "src/proto/payload.d.ts", - "test/fixtures/node-globals.js" - ] - }, - "scripts": { - "bench": "node benchmarks/benchmark.js", - "clean": "aegir clean", - "dep-check": "aegir dep-check", - "build": "aegir build", - "lint": "aegir lint", - "lint:fix": "aegir lint --fix", - "test": "aegir test", - "test:node": "aegir test -t node", - "test:browser": "aegir test -t browser -t webworker", - "test:electron-main": "aegir test -t electron-main", - "test:interop": "aegir test -t node -f dist/test/interop.js", - "docs": "aegir docs", - "proto:gen": "protons ./src/proto/payload.proto", - "prepublish": "npm run build" - }, - "dependencies": { - "@chainsafe/as-chacha20poly1305": "^0.1.0", - "@chainsafe/as-sha256": "^0.4.1", - "@libp2p/crypto": "^2.0.0", - "@libp2p/interface": "^0.1.0", - "@libp2p/logger": "^3.0.0", - "@libp2p/peer-id": "^3.0.0", - "@noble/ciphers": "^0.4.0", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "it-byte-stream": "^1.0.0", - "it-length-prefixed": "^9.0.1", - "it-length-prefixed-stream": "^1.0.0", - "it-pair": "^2.0.6", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.4", - "wherearewe": "^2.0.1" - }, - "devDependencies": { - "@chainsafe/libp2p-yamux": "^5.0.0", - "@libp2p/daemon-client": "^7.0.0", - "@libp2p/daemon-server": "^6.0.0", - "@libp2p/interface-compliance-tests": "^4.0.0", - "@libp2p/interface-peer-id": "^2.0.2", - "@libp2p/interop": "^9.0.0", - "@libp2p/peer-id-factory": "^3.0.0", - "@libp2p/tcp": "^8.0.0", - "@multiformats/multiaddr": "^12.1.0", - "@types/sinon": "^17.0.1", - "aegir": "^40.0.8", - "benchmark": "^2.1.4", - "execa": "^8.0.1", - "go-libp2p": "^1.0.3", - "iso-random-stream": "^2.0.2", - "libp2p": "^0.46.0", - "mkdirp": "^3.0.0", - "p-defer": "^4.0.0", - "protons": "^7.0.0", - "sinon": "^17.0.1" - }, - "browser": { - "./dist/src/crypto/index.js": "./dist/src/crypto/index.browser.js", - "util": false - } -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/@types/basic.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/@types/basic.ts deleted file mode 100644 index 364d1f89e..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/@types/basic.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type bytes = Uint8Array -export type bytes32 = Uint8Array -export type bytes16 = Uint8Array - -export type uint64 = number diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/@types/handshake-interface.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/@types/handshake-interface.ts deleted file mode 100644 index 9b402b1fd..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/@types/handshake-interface.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { bytes } from './basic.js' -import type { NoiseSession } from './handshake.js' -import type { NoiseExtensions } from '../proto/payload.js' -import type { PeerId } from '@libp2p/interface/peer-id' - -export interface IHandshake { - session: NoiseSession - remotePeer: PeerId - remoteExtensions: NoiseExtensions - encrypt: (plaintext: bytes, session: NoiseSession) => bytes - decrypt: (ciphertext: bytes, session: NoiseSession, dst?: Uint8Array) => { plaintext: bytes, valid: boolean } -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/@types/handshake.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/@types/handshake.ts deleted file mode 100644 index ec333b703..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/@types/handshake.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { bytes, bytes32, uint64 } from './basic.js' -import type { KeyPair } from './libp2p.js' -import type { Nonce } from '../nonce.js' - -export type Hkdf = [bytes, bytes, bytes] - -export interface MessageBuffer { - ne: bytes32 - ns: bytes - ciphertext: bytes -} - -export interface CipherState { - k: bytes32 - // For performance reasons, the nonce is represented as a Nonce object - // The nonce is treated as a uint64, even though the underlying `number` only has 52 safely-available bits. - n: Nonce -} - -export interface SymmetricState { - cs: CipherState - ck: bytes32 // chaining key - h: bytes32 // handshake hash -} - -export interface HandshakeState { - ss: SymmetricState - s: KeyPair - e?: KeyPair - rs: bytes32 - re: bytes32 - psk: bytes32 -} - -export interface NoiseSession { - hs: HandshakeState - h?: bytes32 - cs1?: CipherState - cs2?: CipherState - mc: uint64 - i: boolean -} - -export interface INoisePayload { - identityKey: bytes - identitySig: bytes - data: bytes -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/@types/libp2p.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/@types/libp2p.ts deleted file mode 100644 index c20fe9395..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/@types/libp2p.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { bytes32 } from './basic.js' -import type { NoiseExtensions } from '../proto/payload.js' -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter' - -export interface KeyPair { - publicKey: bytes32 - privateKey: bytes32 -} - -export interface INoiseConnection extends ConnectionEncrypter {} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/constants.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/constants.ts deleted file mode 100644 index 7e8105c47..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/constants.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const NOISE_MSG_MAX_LENGTH_BYTES = 65535 -export const NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG = NOISE_MSG_MAX_LENGTH_BYTES - 16 - -export const DUMP_SESSION_KEYS = Boolean(globalThis.process?.env?.DUMP_SESSION_KEYS) diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/crypto.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/crypto.ts deleted file mode 100644 index 108dfee1c..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/crypto.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { bytes32, bytes } from './@types/basic.js' -import type { Hkdf } from './@types/handshake.js' -import type { KeyPair } from './@types/libp2p.js' - -export interface ICryptoInterface { - hashSHA256: (data: Uint8Array) => Uint8Array - - getHKDF: (ck: bytes32, ikm: Uint8Array) => Hkdf - - generateX25519KeyPair: () => KeyPair - generateX25519KeyPairFromSeed: (seed: Uint8Array) => KeyPair - generateX25519SharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Uint8Array - - chaCha20Poly1305Encrypt: (plaintext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32) => bytes - chaCha20Poly1305Decrypt: (ciphertext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array) => bytes | null -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/crypto/index.browser.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/crypto/index.browser.ts deleted file mode 100644 index f691a85c5..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/crypto/index.browser.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { pureJsCrypto } from './js' - -export const defaultCrypto = pureJsCrypto diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/crypto/index.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/crypto/index.ts deleted file mode 100644 index 946799c9b..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/crypto/index.ts +++ /dev/null @@ -1,151 +0,0 @@ -import crypto from 'node:crypto' -import { newInstance, ChaCha20Poly1305 } from '@chainsafe/as-chacha20poly1305' -import { digest } from '@chainsafe/as-sha256' -import { isElectronMain } from 'wherearewe' -import { pureJsCrypto } from './js.js' -import type { KeyPair } from '../@types/libp2p.js' -import type { ICryptoInterface } from '../crypto.js' - -const ctx = newInstance() -const asImpl = new ChaCha20Poly1305(ctx) -const CHACHA_POLY1305 = 'chacha20-poly1305' -const PKCS8_PREFIX = Buffer.from([0x30, 0x2e, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x04, 0x22, 0x04, 0x20]) -const X25519_PREFIX = Buffer.from([0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x03, 0x21, 0x00]) -const nodeCrypto: Pick = { - hashSHA256 (data) { - return crypto.createHash('sha256').update(data).digest() - }, - - chaCha20Poly1305Encrypt (plaintext, nonce, ad, k) { - const cipher = crypto.createCipheriv(CHACHA_POLY1305, k, nonce, { - authTagLength: 16 - }) - cipher.setAAD(ad, { plaintextLength: plaintext.byteLength }) - const updated = cipher.update(plaintext) - const final = cipher.final() - const tag = cipher.getAuthTag() - - const encrypted = Buffer.concat([updated, tag, final], updated.byteLength + tag.byteLength + final.byteLength) - return encrypted - }, - - chaCha20Poly1305Decrypt (ciphertext, nonce, ad, k, _dst) { - const authTag = ciphertext.subarray(ciphertext.length - 16) - const text = ciphertext.subarray(0, ciphertext.length - 16) - const decipher = crypto.createDecipheriv(CHACHA_POLY1305, k, nonce, { - authTagLength: 16 - }) - decipher.setAAD(ad, { - plaintextLength: text.byteLength - }) - decipher.setAuthTag(authTag) - const updated = decipher.update(text) - const final = decipher.final() - if (final.byteLength > 0) { - return Buffer.concat([updated, final], updated.byteLength + final.byteLength) - } - return updated - } -} - -const asCrypto: Pick = { - hashSHA256 (data) { - return digest(data) - }, - chaCha20Poly1305Encrypt (plaintext, nonce, ad, k) { - return asImpl.seal(k, nonce, plaintext, ad) - }, - chaCha20Poly1305Decrypt (ciphertext, nonce, ad, k, dst) { - return asImpl.open(k, nonce, ciphertext, ad, dst) - } -} - -// benchmarks show that for chacha20poly1305 -// the as implementation is faster for smaller payloads(<1200) -// and the node implementation is faster for larger payloads -export const defaultCrypto: ICryptoInterface = { - ...pureJsCrypto, - hashSHA256 (data) { - return nodeCrypto.hashSHA256(data) - }, - chaCha20Poly1305Encrypt (plaintext, nonce, ad, k) { - if (plaintext.length < 1200) { - return asCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) - } - return nodeCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) - }, - chaCha20Poly1305Decrypt (ciphertext, nonce, ad, k, dst) { - if (ciphertext.length < 1200) { - return asCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) - } - return nodeCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) - }, - generateX25519KeyPair (): KeyPair { - const { publicKey, privateKey } = crypto.generateKeyPairSync('x25519', { - publicKeyEncoding: { - type: 'spki', - format: 'der' - }, - privateKeyEncoding: { - type: 'pkcs8', - format: 'der' - } - }) - - return { - publicKey: publicKey.subarray(X25519_PREFIX.length), - privateKey: privateKey.subarray(PKCS8_PREFIX.length) - } - }, - generateX25519KeyPairFromSeed (seed: Uint8Array): KeyPair { - const privateKey = crypto.createPrivateKey({ - key: Buffer.concat([ - PKCS8_PREFIX, - seed - ], PKCS8_PREFIX.byteLength + seed.byteLength), - type: 'pkcs8', - format: 'der' - }) - - const publicKey = crypto.createPublicKey(privateKey) - .export({ - type: 'spki', - format: 'der' - }).subarray(X25519_PREFIX.length) - - return { - publicKey, - privateKey: seed - } - }, - generateX25519SharedKey (privateKey: Uint8Array, publicKey: Uint8Array): Uint8Array { - publicKey = Buffer.concat([ - X25519_PREFIX, - publicKey - ], X25519_PREFIX.byteLength + publicKey.byteLength) - - privateKey = Buffer.concat([ - PKCS8_PREFIX, - privateKey - ], PKCS8_PREFIX.byteLength + privateKey.byteLength) - - return crypto.diffieHellman({ - publicKey: crypto.createPublicKey({ - key: Buffer.from(publicKey, publicKey.byteOffset, publicKey.byteLength), - type: 'spki', - format: 'der' - }), - privateKey: crypto.createPrivateKey({ - key: Buffer.from(privateKey, privateKey.byteOffset, privateKey.byteLength), - type: 'pkcs8', - format: 'der' - }) - }) - } -} - -// no chacha20-poly1305 in electron https://github.com/electron/electron/issues/24024 -if (isElectronMain) { - defaultCrypto.chaCha20Poly1305Encrypt = asCrypto.chaCha20Poly1305Encrypt - defaultCrypto.chaCha20Poly1305Decrypt = asCrypto.chaCha20Poly1305Decrypt -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/crypto/js.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/crypto/js.ts deleted file mode 100644 index e47d4761b..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/crypto/js.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { chacha20poly1305 } from '@noble/ciphers/chacha' -import { x25519 } from '@noble/curves/ed25519' -import { extract, expand } from '@noble/hashes/hkdf' -import { sha256 } from '@noble/hashes/sha256' -import type { bytes, bytes32 } from '../@types/basic.js' -import type { Hkdf } from '../@types/handshake.js' -import type { KeyPair } from '../@types/libp2p.js' -import type { ICryptoInterface } from '../crypto.js' - -export const pureJsCrypto: ICryptoInterface = { - hashSHA256 (data: Uint8Array): Uint8Array { - return sha256(data) - }, - - getHKDF (ck: bytes32, ikm: Uint8Array): Hkdf { - const prk = extract(sha256, ikm, ck) - const okmU8Array = expand(sha256, prk, undefined, 96) - const okm = okmU8Array - - const k1 = okm.subarray(0, 32) - const k2 = okm.subarray(32, 64) - const k3 = okm.subarray(64, 96) - - return [k1, k2, k3] - }, - - generateX25519KeyPair (): KeyPair { - const secretKey = x25519.utils.randomPrivateKey() - const publicKey = x25519.getPublicKey(secretKey) - - return { - publicKey, - privateKey: secretKey - } - }, - - generateX25519KeyPairFromSeed (seed: Uint8Array): KeyPair { - const publicKey = x25519.getPublicKey(seed) - - return { - publicKey, - privateKey: seed - } - }, - - generateX25519SharedKey (privateKey: Uint8Array, publicKey: Uint8Array): Uint8Array { - return x25519.getSharedSecret(privateKey, publicKey) - }, - - chaCha20Poly1305Encrypt (plaintext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32): bytes { - return chacha20poly1305(k, nonce, ad).encrypt(plaintext) - }, - - chaCha20Poly1305Decrypt (ciphertext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array): bytes | null { - return chacha20poly1305(k, nonce, ad).decrypt(ciphertext, dst) - } -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/crypto/streaming.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/crypto/streaming.ts deleted file mode 100644 index c5cc85ea1..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/crypto/streaming.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { concat as uint8ArrayConcat } from 'uint8arrays' -import { NOISE_MSG_MAX_LENGTH_BYTES, NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG } from '../constants.js' -import { uint16BEEncode } from '../encoder.js' -import type { IHandshake } from '../@types/handshake-interface.js' -import type { MetricsRegistry } from '../metrics.js' -import type { Transform } from 'it-stream-types' -import type { Uint8ArrayList } from 'uint8arraylist' - -const CHACHA_TAG_LENGTH = 16 - -// Returns generator that encrypts payload from the user -export function encryptStream (handshake: IHandshake, metrics?: MetricsRegistry): Transform> { - return async function * (source) { - for await (const chunk of source) { - for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG) { - let end = i + NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG - if (end > chunk.length) { - end = chunk.length - } - - const data = handshake.encrypt(chunk.subarray(i, end), handshake.session) - metrics?.encryptedPackets.increment() - - yield uint8ArrayConcat([ - uint16BEEncode(data.byteLength), - data - ], 2 + data.byteLength) - } - } - } -} - -// Decrypt received payload to the user -export function decryptStream (handshake: IHandshake, metrics?: MetricsRegistry): Transform, AsyncIterable> { - return async function * (source) { - for await (const chunk of source) { - for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES) { - let end = i + NOISE_MSG_MAX_LENGTH_BYTES - if (end > chunk.length) { - end = chunk.length - } - - if (end - CHACHA_TAG_LENGTH < i) { - throw new Error('Invalid chunk') - } - const encrypted = chunk.subarray(i, end) - // memory allocation is not cheap so reuse the encrypted Uint8Array - // see https://github.com/ChainSafe/js-libp2p-noise/pull/242#issue-1422126164 - // this is ok because chacha20 reads bytes one by one and don't reread after that - // it's also tested in https://github.com/ChainSafe/as-chacha20poly1305/pull/1/files#diff-25252846b58979dcaf4e41d47b3eadd7e4f335e7fb98da6c049b1f9cd011f381R48 - const dst = chunk.subarray(i, end - CHACHA_TAG_LENGTH) - const { plaintext: decrypted, valid } = handshake.decrypt(encrypted, handshake.session, dst) - if (!valid) { - metrics?.decryptErrors.increment() - throw new Error('Failed to validate decrypted chunk') - } - metrics?.decryptedPackets.increment() - yield decrypted - } - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/encoder.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/encoder.ts deleted file mode 100644 index c149b4c1b..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/encoder.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { alloc as uint8ArrayAlloc, allocUnsafe as uint8ArrayAllocUnsafe } from 'uint8arrays/alloc' -import { concat as uint8ArrayConcat } from 'uint8arrays/concat' -import type { bytes } from './@types/basic.js' -import type { MessageBuffer } from './@types/handshake.js' -import type { LengthDecoderFunction } from 'it-length-prefixed' -import type { Uint8ArrayList } from 'uint8arraylist' - -export const uint16BEEncode = (value: number): Uint8Array => { - const target = uint8ArrayAllocUnsafe(2) - new DataView(target.buffer, target.byteOffset, target.byteLength).setUint16(0, value, false) - return target -} -uint16BEEncode.bytes = 2 - -export const uint16BEDecode: LengthDecoderFunction = (data: Uint8Array | Uint8ArrayList): number => { - if (data.length < 2) throw RangeError('Could not decode int16BE') - - if (data instanceof Uint8Array) { - return new DataView(data.buffer, data.byteOffset, data.byteLength).getUint16(0, false) - } - - return data.getUint16(0) -} -uint16BEDecode.bytes = 2 - -// Note: IK and XX encoder usage is opposite (XX uses in stages encode0 where IK uses encode1) - -export function encode0 (message: MessageBuffer): bytes { - return uint8ArrayConcat([message.ne, message.ciphertext], message.ne.length + message.ciphertext.length) -} - -export function encode1 (message: MessageBuffer): bytes { - return uint8ArrayConcat([message.ne, message.ns, message.ciphertext], message.ne.length + message.ns.length + message.ciphertext.length) -} - -export function encode2 (message: MessageBuffer): bytes { - return uint8ArrayConcat([message.ns, message.ciphertext], message.ns.length + message.ciphertext.length) -} - -export function decode0 (input: bytes): MessageBuffer { - if (input.length < 32) { - throw new Error('Cannot decode stage 0 MessageBuffer: length less than 32 bytes.') - } - - return { - ne: input.subarray(0, 32), - ciphertext: input.subarray(32, input.length), - ns: uint8ArrayAlloc(0) - } -} - -export function decode1 (input: bytes): MessageBuffer { - if (input.length < 80) { - throw new Error('Cannot decode stage 1 MessageBuffer: length less than 80 bytes.') - } - - return { - ne: input.subarray(0, 32), - ns: input.subarray(32, 80), - ciphertext: input.subarray(80, input.length) - } -} - -export function decode2 (input: bytes): MessageBuffer { - if (input.length < 48) { - throw new Error('Cannot decode stage 2 MessageBuffer: length less than 48 bytes.') - } - - return { - ne: uint8ArrayAlloc(0), - ns: input.subarray(0, 48), - ciphertext: input.subarray(48, input.length) - } -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/handshake-xx.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/handshake-xx.ts deleted file mode 100644 index 3b547dc03..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/handshake-xx.ts +++ /dev/null @@ -1,178 +0,0 @@ -import { InvalidCryptoExchangeError, UnexpectedPeerError } from '@libp2p/interface/errors' -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { decode0, decode1, decode2, encode0, encode1, encode2 } from './encoder.js' -import { XX } from './handshakes/xx.js' -import { - logger, - logLocalStaticKeys, - logLocalEphemeralKeys, - logRemoteEphemeralKey, - logRemoteStaticKey, - logCipherState -} from './logger.js' -import { - decodePayload, - getPeerIdFromPayload, - verifySignedPayload -} from './utils.js' -import type { bytes, bytes32 } from './@types/basic.js' -import type { IHandshake } from './@types/handshake-interface.js' -import type { CipherState, NoiseSession } from './@types/handshake.js' -import type { KeyPair } from './@types/libp2p.js' -import type { ICryptoInterface } from './crypto.js' -import type { NoiseExtensions } from './proto/payload.js' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { LengthPrefixedStream } from 'it-length-prefixed-stream' - -export class XXHandshake implements IHandshake { - public isInitiator: boolean - public session: NoiseSession - public remotePeer!: PeerId - public remoteExtensions: NoiseExtensions = { webtransportCerthashes: [] } - - protected payload: bytes - protected connection: LengthPrefixedStream - protected xx: XX - protected staticKeypair: KeyPair - - private readonly prologue: bytes32 - - constructor ( - isInitiator: boolean, - payload: bytes, - prologue: bytes32, - crypto: ICryptoInterface, - staticKeypair: KeyPair, - connection: LengthPrefixedStream, - remotePeer?: PeerId, - handshake?: XX - ) { - this.isInitiator = isInitiator - this.payload = payload - this.prologue = prologue - this.staticKeypair = staticKeypair - this.connection = connection - if (remotePeer) { - this.remotePeer = remotePeer - } - this.xx = handshake ?? new XX(crypto) - this.session = this.xx.initSession(this.isInitiator, this.prologue, this.staticKeypair) - } - - // stage 0 - public async propose (): Promise { - logLocalStaticKeys(this.session.hs.s) - if (this.isInitiator) { - logger.trace('Stage 0 - Initiator starting to send first message.') - const messageBuffer = this.xx.sendMessage(this.session, uint8ArrayAlloc(0)) - await this.connection.write(encode0(messageBuffer)) - logger.trace('Stage 0 - Initiator finished sending first message.') - logLocalEphemeralKeys(this.session.hs.e) - } else { - logger.trace('Stage 0 - Responder waiting to receive first message...') - const receivedMessageBuffer = decode0((await this.connection.read()).subarray()) - const { valid } = this.xx.recvMessage(this.session, receivedMessageBuffer) - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 0 validation fail') - } - logger.trace('Stage 0 - Responder received first message.') - logRemoteEphemeralKey(this.session.hs.re) - } - } - - // stage 1 - public async exchange (): Promise { - if (this.isInitiator) { - logger.trace('Stage 1 - Initiator waiting to receive first message from responder...') - const receivedMessageBuffer = decode1((await this.connection.read()).subarray()) - const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer) - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 1 validation fail') - } - logger.trace('Stage 1 - Initiator received the message.') - logRemoteEphemeralKey(this.session.hs.re) - logRemoteStaticKey(this.session.hs.rs) - - logger.trace("Initiator going to check remote's signature...") - try { - const decodedPayload = decodePayload(plaintext) - this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload) - await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer) - this.setRemoteNoiseExtension(decodedPayload.extensions) - } catch (e) { - const err = e as Error - throw new UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`) - } - logger.trace('All good with the signature!') - } else { - logger.trace('Stage 1 - Responder sending out first message with signed payload and static key.') - const messageBuffer = this.xx.sendMessage(this.session, this.payload) - await this.connection.write(encode1(messageBuffer)) - logger.trace('Stage 1 - Responder sent the second handshake message with signed payload.') - logLocalEphemeralKeys(this.session.hs.e) - } - } - - // stage 2 - public async finish (): Promise { - if (this.isInitiator) { - logger.trace('Stage 2 - Initiator sending third handshake message.') - const messageBuffer = this.xx.sendMessage(this.session, this.payload) - await this.connection.write(encode2(messageBuffer)) - logger.trace('Stage 2 - Initiator sent message with signed payload.') - } else { - logger.trace('Stage 2 - Responder waiting for third handshake message...') - const receivedMessageBuffer = decode2((await this.connection.read()).subarray()) - const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer) - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 2 validation fail') - } - logger.trace('Stage 2 - Responder received the message, finished handshake.') - - try { - const decodedPayload = decodePayload(plaintext) - this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload) - await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer) - this.setRemoteNoiseExtension(decodedPayload.extensions) - } catch (e) { - const err = e as Error - throw new UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`) - } - } - logCipherState(this.session) - } - - public encrypt (plaintext: Uint8Array, session: NoiseSession): bytes { - const cs = this.getCS(session) - - return this.xx.encryptWithAd(cs, uint8ArrayAlloc(0), plaintext) - } - - public decrypt (ciphertext: Uint8Array, session: NoiseSession, dst?: Uint8Array): { plaintext: bytes, valid: boolean } { - const cs = this.getCS(session, false) - - return this.xx.decryptWithAd(cs, uint8ArrayAlloc(0), ciphertext, dst) - } - - public getRemoteStaticKey (): bytes { - return this.session.hs.rs - } - - private getCS (session: NoiseSession, encryption = true): CipherState { - if (!session.cs1 || !session.cs2) { - throw new InvalidCryptoExchangeError('Handshake not completed properly, cipher state does not exist.') - } - - if (this.isInitiator) { - return encryption ? session.cs1 : session.cs2 - } else { - return encryption ? session.cs2 : session.cs1 - } - } - - protected setRemoteNoiseExtension (e: NoiseExtensions | null | undefined): void { - if (e) { - this.remoteExtensions = e - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/handshakes/abstract-handshake.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/handshakes/abstract-handshake.ts deleted file mode 100644 index 308d298c5..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/handshakes/abstract-handshake.ts +++ /dev/null @@ -1,181 +0,0 @@ -import { fromString as uint8ArrayFromString } from 'uint8arrays' -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { concat as uint8ArrayConcat } from 'uint8arrays/concat' -import { equals as uint8ArrayEquals } from 'uint8arrays/equals' -import { logger } from '../logger.js' -import { Nonce } from '../nonce.js' -import type { bytes, bytes32 } from '../@types/basic.js' -import type { CipherState, MessageBuffer, SymmetricState } from '../@types/handshake.js' -import type { ICryptoInterface } from '../crypto.js' - -export interface DecryptedResult { - plaintext: bytes - valid: boolean -} - -export interface SplitState { - cs1: CipherState - cs2: CipherState -} - -export abstract class AbstractHandshake { - public crypto: ICryptoInterface - - constructor (crypto: ICryptoInterface) { - this.crypto = crypto - } - - public encryptWithAd (cs: CipherState, ad: Uint8Array, plaintext: Uint8Array): bytes { - const e = this.encrypt(cs.k, cs.n, ad, plaintext) - cs.n.increment() - - return e - } - - public decryptWithAd (cs: CipherState, ad: Uint8Array, ciphertext: Uint8Array, dst?: Uint8Array): DecryptedResult { - const { plaintext, valid } = this.decrypt(cs.k, cs.n, ad, ciphertext, dst) - if (valid) cs.n.increment() - - return { plaintext, valid } - } - - // Cipher state related - protected hasKey (cs: CipherState): boolean { - return !this.isEmptyKey(cs.k) - } - - protected createEmptyKey (): bytes32 { - return uint8ArrayAlloc(32) - } - - protected isEmptyKey (k: bytes32): boolean { - const emptyKey = this.createEmptyKey() - return uint8ArrayEquals(emptyKey, k) - } - - protected encrypt (k: bytes32, n: Nonce, ad: Uint8Array, plaintext: Uint8Array): bytes { - n.assertValue() - - return this.crypto.chaCha20Poly1305Encrypt(plaintext, n.getBytes(), ad, k) - } - - protected encryptAndHash (ss: SymmetricState, plaintext: bytes): bytes { - let ciphertext - if (this.hasKey(ss.cs)) { - ciphertext = this.encryptWithAd(ss.cs, ss.h, plaintext) - } else { - ciphertext = plaintext - } - - this.mixHash(ss, ciphertext) - return ciphertext - } - - protected decrypt (k: bytes32, n: Nonce, ad: bytes, ciphertext: bytes, dst?: Uint8Array): DecryptedResult { - n.assertValue() - - const encryptedMessage = this.crypto.chaCha20Poly1305Decrypt(ciphertext, n.getBytes(), ad, k, dst) - - if (encryptedMessage) { - return { - plaintext: encryptedMessage, - valid: true - } - } else { - return { - plaintext: uint8ArrayAlloc(0), - valid: false - } - } - } - - protected decryptAndHash (ss: SymmetricState, ciphertext: bytes): DecryptedResult { - let plaintext: bytes; let valid = true - if (this.hasKey(ss.cs)) { - ({ plaintext, valid } = this.decryptWithAd(ss.cs, ss.h, ciphertext)) - } else { - plaintext = ciphertext - } - - this.mixHash(ss, ciphertext) - return { plaintext, valid } - } - - protected dh (privateKey: bytes32, publicKey: bytes32): bytes32 { - try { - const derivedU8 = this.crypto.generateX25519SharedKey(privateKey, publicKey) - - if (derivedU8.length === 32) { - return derivedU8 - } - - return derivedU8.subarray(0, 32) - } catch (e) { - const err = e as Error - logger.error(err) - return uint8ArrayAlloc(32) - } - } - - protected mixHash (ss: SymmetricState, data: bytes): void { - ss.h = this.getHash(ss.h, data) - } - - protected getHash (a: Uint8Array, b: Uint8Array): bytes32 { - const u = this.crypto.hashSHA256(uint8ArrayConcat([a, b], a.length + b.length)) - return u - } - - protected mixKey (ss: SymmetricState, ikm: bytes32): void { - const [ck, tempK] = this.crypto.getHKDF(ss.ck, ikm) - ss.cs = this.initializeKey(tempK) - ss.ck = ck - } - - protected initializeKey (k: bytes32): CipherState { - return { k, n: new Nonce() } - } - - // Symmetric state related - - protected initializeSymmetric (protocolName: string): SymmetricState { - const protocolNameBytes = uint8ArrayFromString(protocolName, 'utf-8') - const h = this.hashProtocolName(protocolNameBytes) - - const ck = h - const key = this.createEmptyKey() - const cs: CipherState = this.initializeKey(key) - - return { cs, ck, h } - } - - protected hashProtocolName (protocolName: Uint8Array): bytes32 { - if (protocolName.length <= 32) { - const h = uint8ArrayAlloc(32) - h.set(protocolName) - return h - } else { - return this.getHash(protocolName, uint8ArrayAlloc(0)) - } - } - - protected split (ss: SymmetricState): SplitState { - const [tempk1, tempk2] = this.crypto.getHKDF(ss.ck, uint8ArrayAlloc(0)) - const cs1 = this.initializeKey(tempk1) - const cs2 = this.initializeKey(tempk2) - - return { cs1, cs2 } - } - - protected writeMessageRegular (cs: CipherState, payload: bytes): MessageBuffer { - const ciphertext = this.encryptWithAd(cs, uint8ArrayAlloc(0), payload) - const ne = this.createEmptyKey() - const ns = uint8ArrayAlloc(0) - - return { ne, ns, ciphertext } - } - - protected readMessageRegular (cs: CipherState, message: MessageBuffer): DecryptedResult { - return this.decryptWithAd(cs, uint8ArrayAlloc(0), message.ciphertext) - } -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/handshakes/xx.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/handshakes/xx.ts deleted file mode 100644 index 61077388f..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/handshakes/xx.ts +++ /dev/null @@ -1,185 +0,0 @@ -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { isValidPublicKey } from '../utils.js' -import { AbstractHandshake, type DecryptedResult } from './abstract-handshake.js' -import type { bytes32, bytes } from '../@types/basic.js' -import type { CipherState, HandshakeState, MessageBuffer, NoiseSession } from '../@types/handshake.js' -import type { KeyPair } from '../@types/libp2p.js' - -export class XX extends AbstractHandshake { - private initializeInitiator (prologue: bytes32, s: KeyPair, rs: bytes32, psk: bytes32): HandshakeState { - const name = 'Noise_XX_25519_ChaChaPoly_SHA256' - const ss = this.initializeSymmetric(name) - this.mixHash(ss, prologue) - const re = uint8ArrayAlloc(32) - - return { ss, s, rs, psk, re } - } - - private initializeResponder (prologue: bytes32, s: KeyPair, rs: bytes32, psk: bytes32): HandshakeState { - const name = 'Noise_XX_25519_ChaChaPoly_SHA256' - const ss = this.initializeSymmetric(name) - this.mixHash(ss, prologue) - const re = uint8ArrayAlloc(32) - - return { ss, s, rs, psk, re } - } - - private writeMessageA (hs: HandshakeState, payload: bytes, e?: KeyPair): MessageBuffer { - const ns = uint8ArrayAlloc(0) - - if (e !== undefined) { - hs.e = e - } else { - hs.e = this.crypto.generateX25519KeyPair() - } - - const ne = hs.e.publicKey - - this.mixHash(hs.ss, ne) - const ciphertext = this.encryptAndHash(hs.ss, payload) - - return { ne, ns, ciphertext } - } - - private writeMessageB (hs: HandshakeState, payload: bytes): MessageBuffer { - hs.e = this.crypto.generateX25519KeyPair() - const ne = hs.e.publicKey - this.mixHash(hs.ss, ne) - - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re)) - const spk = hs.s.publicKey - const ns = this.encryptAndHash(hs.ss, spk) - - this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re)) - const ciphertext = this.encryptAndHash(hs.ss, payload) - - return { ne, ns, ciphertext } - } - - private writeMessageC (hs: HandshakeState, payload: bytes): { messageBuffer: MessageBuffer, cs1: CipherState, cs2: CipherState, h: bytes } { - const spk = hs.s.publicKey - const ns = this.encryptAndHash(hs.ss, spk) - this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re)) - const ciphertext = this.encryptAndHash(hs.ss, payload) - const ne = this.createEmptyKey() - const messageBuffer: MessageBuffer = { ne, ns, ciphertext } - const { cs1, cs2 } = this.split(hs.ss) - - return { h: hs.ss.h, messageBuffer, cs1, cs2 } - } - - private readMessageA (hs: HandshakeState, message: MessageBuffer): DecryptedResult { - if (isValidPublicKey(message.ne)) { - hs.re = message.ne - } - - this.mixHash(hs.ss, hs.re) - return this.decryptAndHash(hs.ss, message.ciphertext) - } - - private readMessageB (hs: HandshakeState, message: MessageBuffer): DecryptedResult { - if (isValidPublicKey(message.ne)) { - hs.re = message.ne - } - - this.mixHash(hs.ss, hs.re) - if (!hs.e) { - throw new Error('Handshake state `e` param is missing.') - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re)) - const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns) - if (valid1 && isValidPublicKey(ns)) { - hs.rs = ns - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs)) - const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext) - return { plaintext, valid: (valid1 && valid2) } - } - - private readMessageC (hs: HandshakeState, message: MessageBuffer): { h: bytes, plaintext: bytes, valid: boolean, cs1: CipherState, cs2: CipherState } { - const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns) - if (valid1 && isValidPublicKey(ns)) { - hs.rs = ns - } - if (!hs.e) { - throw new Error('Handshake state `e` param is missing.') - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs)) - - const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext) - const { cs1, cs2 } = this.split(hs.ss) - - return { h: hs.ss.h, plaintext, valid: (valid1 && valid2), cs1, cs2 } - } - - public initSession (initiator: boolean, prologue: bytes32, s: KeyPair): NoiseSession { - const psk = this.createEmptyKey() - const rs = uint8ArrayAlloc(32) // no static key yet - let hs - - if (initiator) { - hs = this.initializeInitiator(prologue, s, rs, psk) - } else { - hs = this.initializeResponder(prologue, s, rs, psk) - } - - return { - hs, - i: initiator, - mc: 0 - } - } - - public sendMessage (session: NoiseSession, message: bytes, ephemeral?: KeyPair): MessageBuffer { - let messageBuffer: MessageBuffer - if (session.mc === 0) { - messageBuffer = this.writeMessageA(session.hs, message, ephemeral) - } else if (session.mc === 1) { - messageBuffer = this.writeMessageB(session.hs, message) - } else if (session.mc === 2) { - const { h, messageBuffer: resultingBuffer, cs1, cs2 } = this.writeMessageC(session.hs, message) - messageBuffer = resultingBuffer - session.h = h - session.cs1 = cs1 - session.cs2 = cs2 - } else if (session.mc > 2) { - if (session.i) { - if (!session.cs1) { - throw new Error('CS1 (cipher state) is not defined') - } - - messageBuffer = this.writeMessageRegular(session.cs1, message) - } else { - if (!session.cs2) { - throw new Error('CS2 (cipher state) is not defined') - } - - messageBuffer = this.writeMessageRegular(session.cs2, message) - } - } else { - throw new Error('Session invalid.') - } - - session.mc++ - return messageBuffer - } - - public recvMessage (session: NoiseSession, message: MessageBuffer): DecryptedResult { - let plaintext: bytes = uint8ArrayAlloc(0) - let valid = false - if (session.mc === 0) { - ({ plaintext, valid } = this.readMessageA(session.hs, message)) - } else if (session.mc === 1) { - ({ plaintext, valid } = this.readMessageB(session.hs, message)) - } else if (session.mc === 2) { - const { h, plaintext: resultingPlaintext, valid: resultingValid, cs1, cs2 } = this.readMessageC(session.hs, message) - plaintext = resultingPlaintext - valid = resultingValid - session.h = h - session.cs1 = cs1 - session.cs2 = cs2 - } - session.mc++ - return { plaintext, valid } - } -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/index.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/index.ts deleted file mode 100644 index 3a42c8972..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Noise } from './noise.js' -import type { NoiseInit } from './noise.js' -import type { NoiseExtensions } from './proto/payload.js' -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter' -export type { ICryptoInterface } from './crypto.js' -export { pureJsCrypto } from './crypto/js.js' - -export function noise (init: NoiseInit = {}): () => ConnectionEncrypter { - return () => new Noise(init) -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/logger.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/logger.ts deleted file mode 100644 index b44ca7b42..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/logger.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { type Logger, logger } from '@libp2p/logger' -import { toString as uint8ArrayToString } from 'uint8arrays/to-string' -import { DUMP_SESSION_KEYS } from './constants.js' -import type { NoiseSession } from './@types/handshake.js' -import type { KeyPair } from './@types/libp2p.js' - -const log = logger('libp2p:noise') - -export { log as logger } - -let keyLogger: Logger -if (DUMP_SESSION_KEYS) { - keyLogger = log -} else { - keyLogger = Object.assign(() => { /* do nothing */ }, { - enabled: false, - trace: () => {}, - error: () => {} - }) -} - -export function logLocalStaticKeys (s: KeyPair): void { - keyLogger(`LOCAL_STATIC_PUBLIC_KEY ${uint8ArrayToString(s.publicKey, 'hex')}`) - keyLogger(`LOCAL_STATIC_PRIVATE_KEY ${uint8ArrayToString(s.privateKey, 'hex')}`) -} - -export function logLocalEphemeralKeys (e: KeyPair | undefined): void { - if (e) { - keyLogger(`LOCAL_PUBLIC_EPHEMERAL_KEY ${uint8ArrayToString(e.publicKey, 'hex')}`) - keyLogger(`LOCAL_PRIVATE_EPHEMERAL_KEY ${uint8ArrayToString(e.privateKey, 'hex')}`) - } else { - keyLogger('Missing local ephemeral keys.') - } -} - -export function logRemoteStaticKey (rs: Uint8Array): void { - keyLogger(`REMOTE_STATIC_PUBLIC_KEY ${uint8ArrayToString(rs, 'hex')}`) -} - -export function logRemoteEphemeralKey (re: Uint8Array): void { - keyLogger(`REMOTE_EPHEMERAL_PUBLIC_KEY ${uint8ArrayToString(re, 'hex')}`) -} - -export function logCipherState (session: NoiseSession): void { - if (session.cs1 && session.cs2) { - keyLogger(`CIPHER_STATE_1 ${session.cs1.n.getUint64()} ${uint8ArrayToString(session.cs1.k, 'hex')}`) - keyLogger(`CIPHER_STATE_2 ${session.cs2.n.getUint64()} ${uint8ArrayToString(session.cs2.k, 'hex')}`) - } else { - keyLogger('Missing cipher state.') - } -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/metrics.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/metrics.ts deleted file mode 100644 index 8d0b3a4e7..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/metrics.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { Counter, Metrics } from '@libp2p/interface/metrics' - -export type MetricsRegistry = Record - -export function registerMetrics (metrics: Metrics): MetricsRegistry { - return { - xxHandshakeSuccesses: metrics.registerCounter( - 'libp2p_noise_xxhandshake_successes_total', { - help: 'Total count of noise xxHandshakes successes_' - }), - - xxHandshakeErrors: metrics.registerCounter( - 'libp2p_noise_xxhandshake_error_total', { - help: 'Total count of noise xxHandshakes errors' - }), - - encryptedPackets: metrics.registerCounter( - 'libp2p_noise_encrypted_packets_total', { - help: 'Total count of noise encrypted packets successfully' - }), - - decryptedPackets: metrics.registerCounter( - 'libp2p_noise_decrypted_packets_total', { - help: 'Total count of noise decrypted packets' - }), - - decryptErrors: metrics.registerCounter( - 'libp2p_noise_decrypt_errors_total', { - help: 'Total count of noise decrypt errors' - }) - } -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/noise.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/noise.ts deleted file mode 100644 index 3b52bd2a0..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/noise.ts +++ /dev/null @@ -1,193 +0,0 @@ -import { decode } from 'it-length-prefixed' -import { lpStream, type LengthPrefixedStream } from 'it-length-prefixed-stream' -import { duplexPair } from 'it-pair/duplex' -import { pipe } from 'it-pipe' -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { NOISE_MSG_MAX_LENGTH_BYTES } from './constants.js' -import { defaultCrypto } from './crypto/index.js' -import { decryptStream, encryptStream } from './crypto/streaming.js' -import { uint16BEDecode, uint16BEEncode } from './encoder.js' -import { XXHandshake } from './handshake-xx.js' -import { type MetricsRegistry, registerMetrics } from './metrics.js' -import { getPayload } from './utils.js' -import type { bytes } from './@types/basic.js' -import type { IHandshake } from './@types/handshake-interface.js' -import type { INoiseConnection, KeyPair } from './@types/libp2p.js' -import type { ICryptoInterface } from './crypto.js' -import type { NoiseExtensions } from './proto/payload.js' -import type { SecuredConnection } from '@libp2p/interface/connection-encrypter' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { Duplex, Source } from 'it-stream-types' - -interface HandshakeParams { - connection: LengthPrefixedStream - isInitiator: boolean - localPeer: PeerId - remotePeer?: PeerId -} - -export interface NoiseInit { - /** - * x25519 private key, reuse for faster handshakes - */ - staticNoiseKey?: bytes - extensions?: NoiseExtensions - crypto?: ICryptoInterface - prologueBytes?: Uint8Array - metrics?: Metrics -} - -export class Noise implements INoiseConnection { - public protocol = '/noise' - public crypto: ICryptoInterface - - private readonly prologue: Uint8Array - private readonly staticKeys: KeyPair - private readonly extensions?: NoiseExtensions - private readonly metrics?: MetricsRegistry - - constructor (init: NoiseInit = {}) { - const { staticNoiseKey, extensions, crypto, prologueBytes, metrics } = init - - this.crypto = crypto ?? defaultCrypto - this.extensions = extensions - this.metrics = metrics ? registerMetrics(metrics) : undefined - - if (staticNoiseKey) { - // accepts x25519 private key of length 32 - this.staticKeys = this.crypto.generateX25519KeyPairFromSeed(staticNoiseKey) - } else { - this.staticKeys = this.crypto.generateX25519KeyPair() - } - this.prologue = prologueBytes ?? uint8ArrayAlloc(0) - } - - /** - * Encrypt outgoing data to the remote party (handshake as initiator) - * - * @param {PeerId} localPeer - PeerId of the receiving peer - * @param {Duplex, AsyncIterable, Promise>} connection - streaming iterable duplex that will be encrypted - * @param {PeerId} remotePeer - PeerId of the remote peer. Used to validate the integrity of the remote peer. - * @returns {Promise} - */ - public async secureOutbound (localPeer: PeerId, connection: Duplex, AsyncIterable, Promise>, remotePeer?: PeerId): Promise> { - const wrappedConnection = lpStream( - connection, - { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - } - ) - const handshake = await this.performHandshake({ - connection: wrappedConnection, - isInitiator: true, - localPeer, - remotePeer - }) - const conn = await this.createSecureConnection(wrappedConnection, handshake) - - return { - conn, - remoteExtensions: handshake.remoteExtensions, - remotePeer: handshake.remotePeer - } - } - - /** - * Decrypt incoming data (handshake as responder). - * - * @param {PeerId} localPeer - PeerId of the receiving peer. - * @param {Duplex, AsyncIterable, Promise>} connection - streaming iterable duplex that will be encryption. - * @param {PeerId} remotePeer - optional PeerId of the initiating peer, if known. This may only exist during transport upgrades. - * @returns {Promise} - */ - public async secureInbound (localPeer: PeerId, connection: Duplex, AsyncIterable, Promise>, remotePeer?: PeerId): Promise> { - const wrappedConnection = lpStream( - connection, - { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - } - ) - const handshake = await this.performHandshake({ - connection: wrappedConnection, - isInitiator: false, - localPeer, - remotePeer - }) - const conn = await this.createSecureConnection(wrappedConnection, handshake) - - return { - conn, - remotePeer: handshake.remotePeer, - remoteExtensions: handshake.remoteExtensions - } - } - - /** - * If Noise pipes supported, tries IK handshake first with XX as fallback if it fails. - * If noise pipes disabled or remote peer static key is unknown, use XX. - * - * @param {HandshakeParams} params - */ - private async performHandshake (params: HandshakeParams): Promise { - const payload = await getPayload(params.localPeer, this.staticKeys.publicKey, this.extensions) - - // run XX handshake - return this.performXXHandshake(params, payload) - } - - private async performXXHandshake ( - params: HandshakeParams, - payload: bytes - ): Promise { - const { isInitiator, remotePeer, connection } = params - const handshake = new XXHandshake( - isInitiator, - payload, - this.prologue, - this.crypto, - this.staticKeys, - connection, - remotePeer - ) - - try { - await handshake.propose() - await handshake.exchange() - await handshake.finish() - this.metrics?.xxHandshakeSuccesses.increment() - } catch (e: unknown) { - this.metrics?.xxHandshakeErrors.increment() - if (e instanceof Error) { - e.message = `Error occurred during XX handshake: ${e.message}` - throw e - } - } - - return handshake - } - - private async createSecureConnection ( - connection: LengthPrefixedStream, AsyncIterable, Promise>>, - handshake: IHandshake - ): Promise, Source, Promise>> { - // Create encryption box/unbox wrapper - const [secure, user] = duplexPair() - const network = connection.unwrap() - - await pipe( - secure, // write to wrapper - encryptStream(handshake, this.metrics), // encrypt data + prefix with message length - network, // send to the remote peer - (source) => decode(source, { lengthDecoder: uint16BEDecode }), // read message length prefix - decryptStream(handshake, this.metrics), // decrypt the incoming data - secure // pipe to the wrapper - ) - - return user - } -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/nonce.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/nonce.ts deleted file mode 100644 index e19183dd8..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/nonce.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import type { bytes, uint64 } from './@types/basic.js' - -export const MIN_NONCE = 0 -// For performance reasons, the nonce is represented as a JS `number` -// Although JS `number` can safely represent integers up to 2 ** 53 - 1, we choose to only use -// 4 bytes to store the data for performance reason. -// This is a slight deviation from the noise spec, which describes the max nonce as 2 ** 64 - 2 -// The effect is that this implementation will need a new handshake to be performed after fewer messages are exchanged than other implementations with full uint64 nonces. -// this MAX_NONCE is still a large number of messages, so the practical effect of this is negligible. -export const MAX_NONCE = 0xffffffff - -const ERR_MAX_NONCE = 'Cipherstate has reached maximum n, a new handshake must be performed' - -/** - * The nonce is an uint that's increased over time. - * Maintaining different representations help improve performance. - */ -export class Nonce { - private n: uint64 - private readonly bytes: bytes - private readonly view: DataView - - constructor (n = MIN_NONCE) { - this.n = n - this.bytes = uint8ArrayAlloc(12) - this.view = new DataView(this.bytes.buffer, this.bytes.byteOffset, this.bytes.byteLength) - this.view.setUint32(4, n, true) - } - - increment (): void { - this.n++ - // Even though we're treating the nonce as 8 bytes, RFC7539 specifies 12 bytes for a nonce. - this.view.setUint32(4, this.n, true) - } - - getBytes (): bytes { - return this.bytes - } - - getUint64 (): uint64 { - return this.n - } - - assertValue (): void { - if (this.n > MAX_NONCE) { - throw new Error(ERR_MAX_NONCE) - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/proto/payload.proto b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/proto/payload.proto deleted file mode 100644 index cdb2383cb..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/proto/payload.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; - -message NoiseExtensions { - repeated bytes webtransport_certhashes = 1; -} - -message NoiseHandshakePayload { - bytes identity_key = 1; - bytes identity_sig = 2; - optional NoiseExtensions extensions = 4; -} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/proto/payload.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/proto/payload.ts deleted file mode 100644 index 5f8d5100f..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/proto/payload.ts +++ /dev/null @@ -1,152 +0,0 @@ -/* eslint-disable import/export */ -/* eslint-disable complexity */ -/* eslint-disable @typescript-eslint/no-namespace */ -/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ -/* eslint-disable @typescript-eslint/no-empty-interface */ - -import { type Codec, decodeMessage, encodeMessage, message } from 'protons-runtime' -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import type { Uint8ArrayList } from 'uint8arraylist' - -export interface NoiseExtensions { - webtransportCerthashes: Uint8Array[] -} - -export namespace NoiseExtensions { - let _codec: Codec - - export const codec = (): Codec => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork() - } - - if (obj.webtransportCerthashes != null) { - for (const value of obj.webtransportCerthashes) { - w.uint32(10) - w.bytes(value) - } - } - - if (opts.lengthDelimited !== false) { - w.ldelim() - } - }, (reader, length) => { - const obj: any = { - webtransportCerthashes: [] - } - - const end = length == null ? reader.len : reader.pos + length - - while (reader.pos < end) { - const tag = reader.uint32() - - switch (tag >>> 3) { - case 1: { - obj.webtransportCerthashes.push(reader.bytes()) - break - } - default: { - reader.skipType(tag & 7) - break - } - } - } - - return obj - }) - } - - return _codec - } - - export const encode = (obj: Partial): Uint8Array => { - return encodeMessage(obj, NoiseExtensions.codec()) - } - - export const decode = (buf: Uint8Array | Uint8ArrayList): NoiseExtensions => { - return decodeMessage(buf, NoiseExtensions.codec()) - } -} - -export interface NoiseHandshakePayload { - identityKey: Uint8Array - identitySig: Uint8Array - extensions?: NoiseExtensions -} - -export namespace NoiseHandshakePayload { - let _codec: Codec - - export const codec = (): Codec => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork() - } - - if ((obj.identityKey != null && obj.identityKey.byteLength > 0)) { - w.uint32(10) - w.bytes(obj.identityKey) - } - - if ((obj.identitySig != null && obj.identitySig.byteLength > 0)) { - w.uint32(18) - w.bytes(obj.identitySig) - } - - if (obj.extensions != null) { - w.uint32(34) - NoiseExtensions.codec().encode(obj.extensions, w) - } - - if (opts.lengthDelimited !== false) { - w.ldelim() - } - }, (reader, length) => { - const obj: any = { - identityKey: uint8ArrayAlloc(0), - identitySig: uint8ArrayAlloc(0) - } - - const end = length == null ? reader.len : reader.pos + length - - while (reader.pos < end) { - const tag = reader.uint32() - - switch (tag >>> 3) { - case 1: { - obj.identityKey = reader.bytes() - break - } - case 2: { - obj.identitySig = reader.bytes() - break - } - case 4: { - obj.extensions = NoiseExtensions.codec().decode(reader, reader.uint32()) - break - } - default: { - reader.skipType(tag & 7) - break - } - } - } - - return obj - }) - } - - return _codec - } - - export const encode = (obj: Partial): Uint8Array => { - return encodeMessage(obj, NoiseHandshakePayload.codec()) - } - - export const decode = (buf: Uint8Array | Uint8ArrayList): NoiseHandshakePayload => { - return decodeMessage(buf, NoiseHandshakePayload.codec()) - } -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/utils.ts b/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/utils.ts deleted file mode 100644 index 993c9628c..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/noise/src/utils.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { unmarshalPublicKey, unmarshalPrivateKey } from '@libp2p/crypto/keys' -import { peerIdFromKeys } from '@libp2p/peer-id' -import { concat as uint8ArrayConcat } from 'uint8arrays/concat' -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' -import { type NoiseExtensions, NoiseHandshakePayload } from './proto/payload.js' -import type { bytes } from './@types/basic.js' -import type { PeerId } from '@libp2p/interface/peer-id' - -export async function getPayload ( - localPeer: PeerId, - staticPublicKey: bytes, - extensions?: NoiseExtensions -): Promise { - const signedPayload = await signPayload(localPeer, getHandshakePayload(staticPublicKey)) - - if (localPeer.publicKey == null) { - throw new Error('PublicKey was missing from local PeerId') - } - - return createHandshakePayload( - localPeer.publicKey, - signedPayload, - extensions - ) -} - -export function createHandshakePayload ( - libp2pPublicKey: Uint8Array, - signedPayload: Uint8Array, - extensions?: NoiseExtensions -): bytes { - return NoiseHandshakePayload.encode({ - identityKey: libp2pPublicKey, - identitySig: signedPayload, - extensions: extensions ?? { webtransportCerthashes: [] } - }).subarray() -} - -export async function signPayload (peerId: PeerId, payload: bytes): Promise { - if (peerId.privateKey == null) { - throw new Error('PrivateKey was missing from PeerId') - } - - const privateKey = await unmarshalPrivateKey(peerId.privateKey) - - return privateKey.sign(payload) -} - -export async function getPeerIdFromPayload (payload: NoiseHandshakePayload): Promise { - return peerIdFromKeys(payload.identityKey) -} - -export function decodePayload (payload: bytes | Uint8Array): NoiseHandshakePayload { - return NoiseHandshakePayload.decode(payload) -} - -export function getHandshakePayload (publicKey: bytes): bytes { - const prefix = uint8ArrayFromString('noise-libp2p-static-key:') - return uint8ArrayConcat([prefix, publicKey], prefix.length + publicKey.length) -} - -/** - * Verifies signed payload, throws on any irregularities. - * - * @param {bytes} noiseStaticKey - owner's noise static key - * @param {bytes} payload - decoded payload - * @param {PeerId} remotePeer - owner's libp2p peer ID - * @returns {Promise} - peer ID of payload owner - */ -export async function verifySignedPayload ( - noiseStaticKey: bytes, - payload: NoiseHandshakePayload, - remotePeer: PeerId -): Promise { - // Unmarshaling from PublicKey protobuf - const payloadPeerId = await peerIdFromKeys(payload.identityKey) - if (!payloadPeerId.equals(remotePeer)) { - throw new Error(`Payload identity key ${payloadPeerId.toString()} does not match expected remote peer ${remotePeer.toString()}`) - } - const generatedPayload = getHandshakePayload(noiseStaticKey) - - if (payloadPeerId.publicKey == null) { - throw new Error('PublicKey was missing from PeerId') - } - - if (payload.identitySig == null) { - throw new Error('Signature was missing from message') - } - - const publicKey = unmarshalPublicKey(payloadPeerId.publicKey) - - const valid = await publicKey.verify(generatedPayload, payload.identitySig) - - if (!valid) { - throw new Error("Static key doesn't match to peer that signed payload!") - } - - return payloadPeerId -} - -export function isValidPublicKey (pk: bytes): boolean { - if (!(pk instanceof Uint8Array)) { - return false - } - - if (pk.length !== 32) { - return false - } - - return true -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/package-lock.json b/perf/impl/js-libp2p/v1.0-native-x25519/package-lock.json deleted file mode 100644 index 7f8503d48..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/package-lock.json +++ /dev/null @@ -1,1143 +0,0 @@ -{ - "name": "@libp2p/perf-js-libp2p-1-0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@libp2p/perf-js-libp2p-1-0", - "dependencies": { - "@chainsafe/libp2p-noise": "^13.0.3", - "@chainsafe/libp2p-yamux": "^5.0.3", - "@libp2p/perf": "next", - "@libp2p/tcp": "next", - "libp2p": "next" - } - }, - "node_modules/@chainsafe/as-chacha20poly1305": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@chainsafe/as-chacha20poly1305/-/as-chacha20poly1305-0.1.0.tgz", - "integrity": "sha512-BpNcL8/lji/GM3+vZ/bgRWqJ1q5kwvTFmGPk7pxm/QQZDbaMI98waOHjEymTjq2JmdD/INdNBFOVSyJofXg7ew==" - }, - "node_modules/@chainsafe/as-sha256": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.4.1.tgz", - "integrity": "sha512-IqeeGwQihK6Y2EYLFofqs2eY2ep1I2MvQXHzOAI+5iQN51OZlUkrLgyAugu2x86xZewDk5xas7lNczkzFzF62w==" - }, - "node_modules/@chainsafe/is-ip": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@chainsafe/is-ip/-/is-ip-2.0.2.tgz", - "integrity": "sha512-ndGqEMG1W5WkGagaqOZHpPU172AGdxr+LD15sv3WIUvT5oCFUrG1Y0CW/v2Egwj4JXEvSibaIIIqImsm98y1nA==" - }, - "node_modules/@chainsafe/libp2p-noise": { - "version": "13.0.3", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-13.0.3.tgz", - "integrity": "sha512-hzfhKUEx5XHDaC21wgROhTUFelaeYojH3DFYhCvqFnhRPUjmz+WJh2jweKaUlysKTTrEHv+JJob/TDY/IS6fRw==", - "dependencies": { - "@chainsafe/as-chacha20poly1305": "^0.1.0", - "@chainsafe/as-sha256": "^0.4.1", - "@libp2p/crypto": "^2.0.0", - "@libp2p/interface": "^0.1.0", - "@libp2p/logger": "^3.0.0", - "@libp2p/peer-id": "^3.0.0", - "@noble/ciphers": "^0.4.0", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "it-byte-stream": "^1.0.0", - "it-length-prefixed": "^9.0.1", - "it-length-prefixed-stream": "^1.0.0", - "it-pair": "^2.0.6", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.4", - "wherearewe": "^2.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@chainsafe/libp2p-yamux": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-yamux/-/libp2p-yamux-5.0.3.tgz", - "integrity": "sha512-I2g8eJFm4xvyrD9Z8+8RvqpCBqHiFtcOGrl4sQXPkktw0cY5hvXf0knIjOLacoNOdAPKG9MNscT4Vojp+sb6cw==", - "dependencies": { - "@libp2p/interface": "^0.1.0", - "@libp2p/logger": "^3.0.0", - "get-iterator": "^2.0.1", - "it-foreach": "^2.0.3", - "it-pipe": "^3.0.1", - "it-pushable": "^3.2.0", - "uint8arraylist": "^2.4.3" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@chainsafe/netmask": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@chainsafe/netmask/-/netmask-2.0.0.tgz", - "integrity": "sha512-I3Z+6SWUoaljh3TBzCnCxjlUyN8tA+NAk5L6m9IxvCf1BENQTePzPMis97CoN/iMW1St3WN+AWCCRp+TTBRiDg==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.1" - } - }, - "node_modules/@libp2p/crypto": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8.tgz", - "integrity": "sha512-8e5fh6bsJNpSjhrggtlm8QF+BERjelJswIjRS69aKgxp24R4z2kDM4pRYPkfQjXJDLNDtqWtKNmePgX23+QJsA==", - "dependencies": { - "@libp2p/interface": "^0.1.6", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.0.1", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/interface": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6.tgz", - "integrity": "sha512-Lzc5cS/hXuoXhuAbVIxJIHLCYmfPcbU0vVgrpMoiP1Qb2Q3ETU4A46GB8s8mWXgSU6tr9RcqerUqzFYD6+OAag==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.5", - "abortable-iterator": "^5.0.1", - "it-pushable": "^3.2.0", - "it-stream-types": "^2.0.1", - "multiformats": "^12.0.1", - "p-defer": "^4.0.0", - "race-signal": "^1.0.0", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/interface-internal": { - "version": "0.1.9-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-0.1.9-0b4a2ee79.tgz", - "integrity": "sha512-IGrEs9QsJdYYsSOhniUEQzHVtgB7WNyRqMF8g6iVGn/rM1bJd8MM4syczPn7OQQbkAKqoLQL32XzGN2JgzAvZQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-collections": "4.0.8-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/interface-internal/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/logger": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-3.1.0.tgz", - "integrity": "sha512-qJbJBAhxHVsRBtQSOIkSLi0lskUSFjzE+zm0QvoyxzZKSz+mX41mZLbnofPIVOVauoDQ40dXpe7WDUOq8AbiQQ==", - "dependencies": { - "@libp2p/interface": "^0.1.6", - "@multiformats/multiaddr": "^12.1.5", - "debug": "^4.3.4", - "interface-datastore": "^8.2.0", - "multiformats": "^12.0.1" - } - }, - "node_modules/@libp2p/multistream-select": { - "version": "4.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/multistream-select/-/multistream-select-4.0.6-0b4a2ee79.tgz", - "integrity": "sha512-ylXXuNgeizJ8ALRCp3V1eXbfzibt+cJUYyZvrO2GK7sGYDGlRh7T3rNMCHaU7tuXKN92xrD7Owwnk9rNjFtA+g==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "it-length-prefixed": "^9.0.3", - "it-length-prefixed-stream": "^1.1.1", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "p-defer": "^4.0.0", - "uint8-varint": "^2.0.2", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/multistream-select/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-collections": { - "version": "4.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-4.0.8-0b4a2ee79.tgz", - "integrity": "sha512-LYLTIlAWNLsDGlK7dhZ9azqkr9vpq5NbvuqTWAKEv02pFbJlmgIMUtPL6XJeyk2BLiZQtgp/nP6cpdFSPZTrBw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79" - } - }, - "node_modules/@libp2p/peer-collections/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-collections/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-id": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6.tgz", - "integrity": "sha512-iN1Ia5gH2U1V/GOVRmLHmVY6fblxzrOPUoZrMYjHl/K4s+AiI7ym/527WDeQvhQpD7j3TfDwcAYforD2dLGpLw==", - "dependencies": { - "@libp2p/interface": "^0.1.6", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-id-factory": { - "version": "3.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id-factory/-/peer-id-factory-3.0.8-0b4a2ee79.tgz", - "integrity": "sha512-y7JrbVT4+ZAy7KDqwwfoBFHPjR5cBZI8+ySwbuyI1MApVxXjPenJdJZRInxQbUDjqWnQHP8dOa75lXhMowjxVg==", - "dependencies": { - "@libp2p/crypto": "2.0.8-0b4a2ee79", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "multiformats": "^12.1.3", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/crypto": { - "version": "2.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8-0b4a2ee79.tgz", - "integrity": "sha512-k6elAUnxMquhQYpCnlLmuU8NpfVU12XU0hFELsgC4TqKkC1PO7EuagngbjHilzyo1wpSAfaYGjAIjlQfjB50iw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.1.3", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-record": { - "version": "6.0.9-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-6.0.9-0b4a2ee79.tgz", - "integrity": "sha512-oZ7a2TidrdmpQuduqdgsZWPQbUPsGN87RTVg2+pgonSnzBtVV5ezHw9KRdhT/qJV4APlBPlRDv3uQU5/oFnqvA==", - "dependencies": { - "@libp2p/crypto": "2.0.8-0b4a2ee79", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "@libp2p/utils": "4.0.7-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "protons-runtime": "^5.0.0", - "uint8-varint": "^2.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-record/node_modules/@libp2p/crypto": { - "version": "2.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8-0b4a2ee79.tgz", - "integrity": "sha512-k6elAUnxMquhQYpCnlLmuU8NpfVU12XU0hFELsgC4TqKkC1PO7EuagngbjHilzyo1wpSAfaYGjAIjlQfjB50iw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.1.3", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-record/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-record/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-store": { - "version": "9.0.9-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-9.0.9-0b4a2ee79.tgz", - "integrity": "sha512-uiUsWo6RdOSgnmplpmcEWnETKp4SXeKAfEcwURgwpEAXsJhPx9UfY9kXMb4xov6ssfHWF8FnTPhlWSrLmCuO4A==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-collections": "4.0.8-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "@libp2p/peer-id-factory": "3.0.8-0b4a2ee79", - "@libp2p/peer-record": "6.0.9-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "interface-datastore": "^8.2.0", - "it-all": "^3.0.2", - "mortice": "^3.0.1", - "multiformats": "^12.1.3", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-store/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-store/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/perf": { - "version": "2.0.1-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/perf/-/perf-2.0.1-0b4a2ee79.tgz", - "integrity": "sha512-B3pDbyEQ6z0yWkh8vkEZE6HbMabS63BH8Gm3kDHCaZm3n40KoFxqwoBL0Iy82nxk0/20Mc3D/bprqzEj2YUlVw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/interface-internal": "0.1.9-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.3" - } - }, - "node_modules/@libp2p/perf/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/tcp": { - "version": "8.0.13-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/tcp/-/tcp-8.0.13-0b4a2ee79.tgz", - "integrity": "sha512-/KuO1ivDV/L4/lLL4gmvq5vXz/xgK2vt9eV8nuwgwOUqWsJEeMkQbdOwKKajrIc0tnk1OFzXb5Kpua2bML++jQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/utils": "4.0.7-0b4a2ee79", - "@multiformats/mafmt": "^12.1.6", - "@multiformats/multiaddr": "^12.1.10", - "@types/sinon": "^17.0.0", - "stream-to-it": "^0.2.2" - } - }, - "node_modules/@libp2p/tcp/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/utils": { - "version": "4.0.7-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-4.0.7-0b4a2ee79.tgz", - "integrity": "sha512-ZHjjlDvG5j+SDtcYNJUhONflbcHNbwdHZsHZlpjwaYyHb74ZvKzd9O5YJTXoAZyJgN2v0cJ814Pc2ObrjrqpTw==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.2", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "@multiformats/multiaddr-matcher": "^1.1.0", - "get-iterator": "^2.0.1", - "is-loopback-addr": "^2.0.1", - "it-pushable": "^3.2.2", - "it-stream-types": "^2.0.1", - "p-queue": "^7.4.1", - "private-ip": "^3.0.1", - "race-signal": "^1.0.1", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/utils/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@multiformats/mafmt": { - "version": "12.1.6", - "resolved": "https://registry.npmjs.org/@multiformats/mafmt/-/mafmt-12.1.6.tgz", - "integrity": "sha512-tlJRfL21X+AKn9b5i5VnaTD6bNttpSpcqwKVmDmSHLwxoz97fAHaepqFOk/l1fIu94nImIXneNbhsJx/RQNIww==", - "dependencies": { - "@multiformats/multiaddr": "^12.0.0" - } - }, - "node_modules/@multiformats/multiaddr": { - "version": "12.1.10", - "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-12.1.10.tgz", - "integrity": "sha512-Bi3nJ/SE17+te40OLxFOpr9CvRodusZZLYZb3e5a0w9RzQcHzfKnnlfqdysLXZ2W5vXgxCUL/Uhndl51Ff2S+Q==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.1", - "@chainsafe/netmask": "^2.0.0", - "@libp2p/interface": "^0.1.1", - "dns-over-http-resolver": "3.0.0", - "multiformats": "^12.0.1", - "uint8-varint": "^2.0.1", - "uint8arrays": "^4.0.2" - } - }, - "node_modules/@multiformats/multiaddr-matcher": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@multiformats/multiaddr-matcher/-/multiaddr-matcher-1.1.0.tgz", - "integrity": "sha512-B/QbKpAxaHYVXFnbTdTgYqPDxmqoF2RYffwYoOv1MWfi2vBCZLdzmEKUBKv6fQr6s+LJFSHn2j2vczmwMFCQIA==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.1", - "@multiformats/multiaddr": "^12.0.0", - "multiformats": "^12.0.1" - } - }, - "node_modules/@noble/ciphers": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.4.0.tgz", - "integrity": "sha512-xaUaUUDWbHIFSxaQ/pIe+33VG2mfJp6N/KxKLmZr5biWdNznCAmfu24QRhX10BbVAuqOahAoyp0S4M9md6GPDw==", - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/curves": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", - "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", - "dependencies": { - "@noble/hashes": "1.3.2" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/hashes": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", - "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@types/sinon": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.2.tgz", - "integrity": "sha512-Zt6heIGsdqERkxctIpvN5Pv3edgBrhoeb3yHyxffd4InN0AX2SVNKSrhdDZKGQICVOxWP/q4DyhpfPNMSrpIiA==", - "dependencies": { - "@types/sinonjs__fake-timers": "*" - } - }, - "node_modules/@types/sinonjs__fake-timers": { - "version": "8.1.5", - "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz", - "integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==" - }, - "node_modules/abortable-iterator": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/abortable-iterator/-/abortable-iterator-5.0.1.tgz", - "integrity": "sha512-hlZ5Z8UwqrKsJcelVPEqDduZowJPBQJ9ZhBC2FXpja3lXy8X6MoI5uMzIgmrA8+3jcVnp8TF/tx+IBBqYJNUrg==", - "dependencies": { - "get-iterator": "^2.0.0", - "it-stream-types": "^2.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/any-signal": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/any-signal/-/any-signal-4.1.1.tgz", - "integrity": "sha512-iADenERppdC+A2YKbOXXB2WUeABLaM6qnpZ70kZbPZ1cZMMJ7eF+3CaYm+/PhBizgkzlvssC7QuHS30oOiQYWA==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/datastore-core": { - "version": "9.2.3", - "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-9.2.3.tgz", - "integrity": "sha512-jcvrVDt+jp7lUp2WhMXXgX/hoi3VcJebN+z/ZXbIRKOVfNOF4bl8cvr7sQ1y9qITikgC2coXFYd79Wzt/n13ZQ==", - "dependencies": { - "@libp2p/logger": "^3.0.0", - "err-code": "^3.0.1", - "interface-store": "^5.0.0", - "it-all": "^3.0.1", - "it-drain": "^3.0.1", - "it-filter": "^3.0.0", - "it-map": "^3.0.1", - "it-merge": "^3.0.1", - "it-pipe": "^3.0.0", - "it-pushable": "^3.0.0", - "it-sort": "^3.0.1", - "it-take": "^3.0.1", - "uint8arrays": "^4.0.2" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/delay": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/delay/-/delay-6.0.0.tgz", - "integrity": "sha512-2NJozoOHQ4NuZuVIr5CWd0iiLVIRSDepakaovIN+9eIDHEhdCAEvSy2cuf1DCrPPQLvHmbqTHODlhHg8UCy4zw==", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/dns-over-http-resolver": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/dns-over-http-resolver/-/dns-over-http-resolver-3.0.0.tgz", - "integrity": "sha512-5+BI+B7n8LKhNaEZBYErr+CBd9t5nYtjunByLhrLGtZ+i3TRgiU8yE87pCjEBu2KOwNsD9ljpSXEbZ4S8xih5g==", - "dependencies": { - "debug": "^4.3.4", - "receptacle": "^1.3.2" - } - }, - "node_modules/err-code": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" - }, - "node_modules/eventemitter3": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" - }, - "node_modules/get-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-2.0.1.tgz", - "integrity": "sha512-7HuY/hebu4gryTDT7O/XY/fvY9wRByEGdK6QOa4of8npTcv0+NS6frFKABcf6S9EBAsveTuKTsZQQBFMMNILIg==" - }, - "node_modules/interface-datastore": { - "version": "8.2.5", - "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-8.2.5.tgz", - "integrity": "sha512-kvLGJMz3RPoJF/g5DbEvfWWempIiSBLVMf63b0PBsziVcSkj0ofzHYI86v8vqpGedkQ81DtPCUKyvX9W7zWvrQ==", - "dependencies": { - "interface-store": "^5.0.0", - "nanoid": "^4.0.0", - "uint8arrays": "^4.0.2" - } - }, - "node_modules/interface-store": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/interface-store/-/interface-store-5.1.4.tgz", - "integrity": "sha512-SI2co5IAxAybBc9egRM2bXvHOa1RPh5SQQkO6di6t/aX92RbtzP4t8raB0l3GTzQmJADaBbzz8Tfa1QLgfMdGQ==" - }, - "node_modules/ip-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-5.0.0.tgz", - "integrity": "sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ipaddr.js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz", - "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==", - "engines": { - "node": ">= 10" - } - }, - "node_modules/is-electron": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.2.2.tgz", - "integrity": "sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg==" - }, - "node_modules/is-loopback-addr": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-2.0.2.tgz", - "integrity": "sha512-26POf2KRCno/KTNL5Q0b/9TYnL00xEsSaLfiFRmjM7m7Lw7ZMmFybzzuX4CcsLAluZGd+niLUiMRxEooVE3aqg==" - }, - "node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/it-all": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-all/-/it-all-3.0.4.tgz", - "integrity": "sha512-UMiy0i9DqCHBdWvMbzdYvVGa5/w4t1cc4nchpbnjdLhklglv8mQeEYnii0gvKESJuL1zV32Cqdb33R6/GPfxpQ==" - }, - "node_modules/it-byte-stream": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/it-byte-stream/-/it-byte-stream-1.0.5.tgz", - "integrity": "sha512-wGHbXPE0ZiU0poJTgCNOW06+mh9yyCwdF8bVv0zxchgql6CMQd/2NEXXtmwWE+N65st8bi/KWUWcMU2pJU2fEw==", - "dependencies": { - "it-stream-types": "^2.0.1", - "p-defer": "^4.0.0", - "race-signal": "^1.0.1", - "uint8arraylist": "^2.4.1" - } - }, - "node_modules/it-drain": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/it-drain/-/it-drain-3.0.5.tgz", - "integrity": "sha512-qYFe4SWdvs9oJGUY5bSjvmiLUMLzFEODNOQUdYdCIkuIgQF+AUB2INhM4yQ09buJ2rhHKDFxvTD/+yUq6qg0XA==" - }, - "node_modules/it-filter": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-filter/-/it-filter-3.0.4.tgz", - "integrity": "sha512-e0sz+st4sudK/zH6GZ/gRTRP8A/ADuJFCYDmRgMbZvR79y5+v4ZXav850bBZk5wL9zXaYZFxS1v/6Qi+Vjwh5g==", - "dependencies": { - "it-peekable": "^3.0.0" - } - }, - "node_modules/it-first": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-first/-/it-first-3.0.4.tgz", - "integrity": "sha512-FtQl84iTNxN5EItP/JgL28V2rzNMkCzTUlNoj41eVdfix2z1DBuLnBqZ0hzYhGGa1rMpbQf0M7CQSA2adlrLJg==" - }, - "node_modules/it-foreach": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/it-foreach/-/it-foreach-2.0.6.tgz", - "integrity": "sha512-OVosBHJsdXpAyeFlCbe3IGZia+65UykyAznakNsKXK+b99dbhuu/mOnXxTadDEo1GWhKx+WA8RNanKkMf07zQw==", - "dependencies": { - "it-peekable": "^3.0.0" - } - }, - "node_modules/it-length-prefixed": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-9.0.3.tgz", - "integrity": "sha512-YAu424ceYpXctxtjcLOqn7vJq082CaoP8J646ZusYISfQc3bpzQErgTUqMFj81V262KG2W9/YMBHsy6A/4yvmg==", - "dependencies": { - "err-code": "^3.0.1", - "it-reader": "^6.0.1", - "it-stream-types": "^2.0.1", - "uint8-varint": "^2.0.1", - "uint8arraylist": "^2.0.0", - "uint8arrays": "^4.0.2" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-length-prefixed-stream": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/it-length-prefixed-stream/-/it-length-prefixed-stream-1.1.4.tgz", - "integrity": "sha512-6YcQ5jsaYnuXBqF+oSGjSdSY9jF7HWl7yh+dxYytXxbE2GcdiOpn6pLM7m6AlIID9MCzQqMY5nOzaiatQ8A3/A==", - "dependencies": { - "it-byte-stream": "^1.0.0", - "it-length-prefixed": "^9.0.1", - "it-stream-types": "^2.0.1", - "uint8-varint": "^2.0.1", - "uint8arraylist": "^2.4.1" - } - }, - "node_modules/it-map": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/it-map/-/it-map-3.0.5.tgz", - "integrity": "sha512-hB0TDXo/h4KSJJDSRLgAPmDroiXP6Fx1ck4Bzl3US9hHfZweTKsuiP0y4gXuTMcJlS6vj0bb+f70rhkD47ZA3w==", - "dependencies": { - "it-peekable": "^3.0.0" - } - }, - "node_modules/it-merge": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/it-merge/-/it-merge-3.0.3.tgz", - "integrity": "sha512-FYVU15KC5pb/GQX1Ims+lee8d4pdqGVCpWr0lkNj8o4xuNo7jY71k6GuEiWdP+T7W1bJqewSxX5yoTy5yZpRVA==", - "dependencies": { - "it-pushable": "^3.2.0" - } - }, - "node_modules/it-pair": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/it-pair/-/it-pair-2.0.6.tgz", - "integrity": "sha512-5M0t5RAcYEQYNG5BV7d7cqbdwbCAp5yLdzvkxsZmkuZsLbTdZzah6MQySYfaAQjNDCq6PUnDt0hqBZ4NwMfW6g==", - "dependencies": { - "it-stream-types": "^2.0.1", - "p-defer": "^4.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-peekable": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/it-peekable/-/it-peekable-3.0.3.tgz", - "integrity": "sha512-Wx21JX/rMzTEl9flx3DGHuPV1KQFGOl8uoKfQtmZHgPQtGb89eQ6RyVd82h3HuP9Ghpt0WgBDlmmdWeHXqyx7w==" - }, - "node_modules/it-pipe": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/it-pipe/-/it-pipe-3.0.1.tgz", - "integrity": "sha512-sIoNrQl1qSRg2seYSBH/3QxWhJFn9PKYvOf/bHdtCBF0bnghey44VyASsWzn5dAx0DCDDABq1hZIuzKmtBZmKA==", - "dependencies": { - "it-merge": "^3.0.0", - "it-pushable": "^3.1.2", - "it-stream-types": "^2.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-pushable": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-3.2.3.tgz", - "integrity": "sha512-gzYnXYK8Y5t5b/BnJUr7glfQLO4U5vyb05gPx/TyTw+4Bv1zM9gFk4YsOrnulWefMewlphCjKkakFvj1y99Tcg==", - "dependencies": { - "p-defer": "^4.0.0" - } - }, - "node_modules/it-reader": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/it-reader/-/it-reader-6.0.4.tgz", - "integrity": "sha512-XCWifEcNFFjjBHtor4Sfaj8rcpt+FkY0L6WdhD578SCDhV4VUm7fCkF3dv5a+fTcfQqvN9BsxBTvWbYO6iCjTg==", - "dependencies": { - "it-stream-types": "^2.0.1", - "uint8arraylist": "^2.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-sort": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-sort/-/it-sort-3.0.4.tgz", - "integrity": "sha512-tvnC93JZZWjX4UxALy0asow0dzXabkoaRbrPJKClTKhNCqw4gzHr+H5axf1gohcthedRRkqd/ae+wl7WqoxFhw==", - "dependencies": { - "it-all": "^3.0.0" - } - }, - "node_modules/it-stream-types": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/it-stream-types/-/it-stream-types-2.0.1.tgz", - "integrity": "sha512-6DmOs5r7ERDbvS4q8yLKENcj6Yecr7QQTqWApbZdfAUTEC947d+PEha7PCqhm//9oxaLYL7TWRekwhoXl2s6fg==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-take": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-take/-/it-take-3.0.4.tgz", - "integrity": "sha512-RG8HDjAZlvkzz5Nav4xq6gK5zNT+Ff1UTIf+CrSJW8nIl6N1FpBH5e7clUshiCn+MmmMoSdIEpw4UaTolszxhA==" - }, - "node_modules/libp2p": { - "version": "0.46.21-0b4a2ee79", - "resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.46.21-0b4a2ee79.tgz", - "integrity": "sha512-WLThU38PZfc2nYzKCZdVgsuWALtkWavwSXQy4pNhSf8fAzbRTjRdY1EqR/O3G2tI6CybdHVj1dCxMnvvM/YXuA==", - "dependencies": { - "@libp2p/crypto": "2.0.8-0b4a2ee79", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/interface-internal": "0.1.9-0b4a2ee79", - "@libp2p/logger": "3.1.0-0b4a2ee79", - "@libp2p/multistream-select": "4.0.6-0b4a2ee79", - "@libp2p/peer-collections": "4.0.8-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "@libp2p/peer-id-factory": "3.0.8-0b4a2ee79", - "@libp2p/peer-store": "9.0.9-0b4a2ee79", - "@libp2p/utils": "4.0.7-0b4a2ee79", - "@multiformats/mafmt": "^12.1.6", - "@multiformats/multiaddr": "^12.1.10", - "@multiformats/multiaddr-matcher": "^1.1.0", - "any-signal": "^4.1.1", - "datastore-core": "^9.0.1", - "delay": "^6.0.0", - "interface-datastore": "^8.2.0", - "it-all": "^3.0.2", - "it-drain": "^3.0.2", - "it-filter": "^3.0.1", - "it-first": "^3.0.3", - "it-map": "^3.0.4", - "it-merge": "^3.0.0", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "merge-options": "^3.0.4", - "multiformats": "^12.1.3", - "p-defer": "^4.0.0", - "p-queue": "^7.4.1", - "private-ip": "^3.0.1", - "rate-limiter-flexible": "^3.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/libp2p/node_modules/@libp2p/crypto": { - "version": "2.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8-0b4a2ee79.tgz", - "integrity": "sha512-k6elAUnxMquhQYpCnlLmuU8NpfVU12XU0hFELsgC4TqKkC1PO7EuagngbjHilzyo1wpSAfaYGjAIjlQfjB50iw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.1.3", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/libp2p/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/libp2p/node_modules/@libp2p/logger": { - "version": "3.1.0-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-3.1.0-0b4a2ee79.tgz", - "integrity": "sha512-haeXJplYP29dYTkwLlGI/dc7nQuRTbRte7GeMcNwrmCeODM3uo3D0O7+qS6RulmRDbvWqs3muCxZyRFSU4oB+A==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "debug": "^4.3.4", - "interface-datastore": "^8.2.0", - "multiformats": "^12.1.3" - } - }, - "node_modules/libp2p/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/merge-options": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", - "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", - "dependencies": { - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mortice": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mortice/-/mortice-3.0.1.tgz", - "integrity": "sha512-eyDUsl1nCR9+JtNksKnaESLP9MgAXCA4w1LTtsmOSQNsThnv++f36rrBu5fC/fdGIwTJZmbiaR/QewptH93pYA==", - "dependencies": { - "nanoid": "^4.0.0", - "observable-webworkers": "^2.0.1", - "p-queue": "^7.2.0", - "p-timeout": "^6.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/multiformats": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.3.tgz", - "integrity": "sha512-eajQ/ZH7qXZQR2AgtfpmSMizQzmyYVmCql7pdhldPuYQi4atACekbJaQplk6dWyIi10jCaFnd6pqvcEFXjbaJw==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/nanoid": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.2.tgz", - "integrity": "sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.js" - }, - "engines": { - "node": "^14 || ^16 || >=18" - } - }, - "node_modules/netmask": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", - "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/node-forge": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", - "engines": { - "node": ">= 6.13.0" - } - }, - "node_modules/observable-webworkers": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/observable-webworkers/-/observable-webworkers-2.0.1.tgz", - "integrity": "sha512-JI1vB0u3pZjoQKOK1ROWzp0ygxSi7Yb0iR+7UNsw4/Zn4cQ0P3R7XL38zac/Dy2tEA7Lg88/wIJTjF8vYXZ0uw==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/p-defer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-4.0.0.tgz", - "integrity": "sha512-Vb3QRvQ0Y5XnF40ZUWW7JfLogicVh/EnA5gBIvKDJoYpeI82+1E3AlB9yOcKFS0AhHrWVnAQO39fbR0G99IVEQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-queue": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.4.1.tgz", - "integrity": "sha512-vRpMXmIkYF2/1hLBKisKeVYJZ8S2tZ0zEAmIJgdVKP2nq0nh4qCdf8bgw+ZgKrkh71AOCaqzwbJJk1WtdcF3VA==", - "dependencies": { - "eventemitter3": "^5.0.1", - "p-timeout": "^5.0.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-queue/node_modules/p-timeout": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", - "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-timeout": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", - "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/private-ip": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/private-ip/-/private-ip-3.0.1.tgz", - "integrity": "sha512-Ezc16ANuhSHmWAE6lbXUKburNzGpR0J5X0Zh5Um/PZ/s57Fp+HYqYe6BYPH2QbqKr/5WebfzJQ1jq6Kj5dbRmA==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.1", - "ip-regex": "^5.0.0", - "ipaddr.js": "^2.1.0", - "netmask": "^2.0.2" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/protons-runtime": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-5.2.0.tgz", - "integrity": "sha512-jL3VSbXllgm17zurKQ/z+Ath0w+4BknJ+l/NLocfjAB8hbeASOZTNtb7zK3nDsKq2pHK9YFumNQvpkZ6gFfWhA==", - "dependencies": { - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/race-signal": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/race-signal/-/race-signal-1.0.2.tgz", - "integrity": "sha512-o3xNv0iTcIDQCXFlF6fPAMEBRjFxssgGoRqLbg06m+AdzEXXLUmoNOoUHTVz2NoBI8hHwKFKoC6IqyNtWr2bww==" - }, - "node_modules/rate-limiter-flexible": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/rate-limiter-flexible/-/rate-limiter-flexible-3.0.4.tgz", - "integrity": "sha512-LFrdT9Pl/TRxG143frHBPyESXHvS2tstLfAUM6shBbJ3M6YssT2cIUWFwAWVAU9Vl4Z2gUN7ZE7tSdQh/0aqcA==" - }, - "node_modules/receptacle": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/receptacle/-/receptacle-1.3.2.tgz", - "integrity": "sha512-HrsFvqZZheusncQRiEE7GatOAETrARKV/lnfYicIm8lbvp/JQOdADOfhjBd2DajvoszEyxSM6RlAAIZgEoeu/A==", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/stream-to-it": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/stream-to-it/-/stream-to-it-0.2.4.tgz", - "integrity": "sha512-4vEbkSs83OahpmBybNJXlJd7d6/RxzkkSdT3I0mnGt79Xd2Kk+e1JqbvAvsQfCeKj3aKb0QIWkyK3/n0j506vQ==", - "dependencies": { - "get-iterator": "^1.0.2" - } - }, - "node_modules/stream-to-it/node_modules/get-iterator": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-1.0.2.tgz", - "integrity": "sha512-v+dm9bNVfOYsY1OrhaCrmyOcYoSeVvbt+hHZ0Au+T+p1y+0Uyj9aMaGIeUTT6xdpRbWzDeYKvfOslPhggQMcsg==" - }, - "node_modules/uint8-varint": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/uint8-varint/-/uint8-varint-2.0.2.tgz", - "integrity": "sha512-LZXmBT0jiHR7J4oKM1GUhtdLFW1yPauzI8NjJlotXn92TprO9u8VMvEVR4QMk8xhUVUd+2fqfU2/kGbVHYSSWw==", - "dependencies": { - "uint8arraylist": "^2.0.0", - "uint8arrays": "^4.0.2" - } - }, - "node_modules/uint8arraylist": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-2.4.3.tgz", - "integrity": "sha512-oEVZr4/GrH87K0kjNce6z8pSCzLEPqHNLNR5sj8cJOySrTP8Vb/pMIbZKLJGhQKxm1TiZ31atNrpn820Pyqpow==", - "dependencies": { - "uint8arrays": "^4.0.2" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/uint8arrays": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.6.tgz", - "integrity": "sha512-4ZesjQhqOU2Ip6GPReIwN60wRxIupavL8T0Iy36BBHr2qyMrNxsPJvr7vpS4eFt8F8kSguWUPad6ZM9izs/vyw==", - "dependencies": { - "multiformats": "^12.0.1" - } - }, - "node_modules/wherearewe": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/wherearewe/-/wherearewe-2.0.1.tgz", - "integrity": "sha512-XUguZbDxCA2wBn2LoFtcEhXL6AXo+hVjGonwhSTTTU9SzbWG8Xu3onNIpzf9j/mYUcJQ0f+m37SzG77G851uFw==", - "dependencies": { - "is-electron": "^2.2.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/package.json b/perf/impl/js-libp2p/v1.0-native-x25519/package.json deleted file mode 100644 index dc78f0d62..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "@libp2p/perf-js-libp2p-1-0", - "private": true, - "main": "index.js", - "type": "module", - "dependencies": { - "@chainsafe/libp2p-noise": "^13.0.3", - "@chainsafe/libp2p-yamux": "^5.0.3", - "@libp2p/perf": "next", - "@libp2p/tcp": "next", - "libp2p": "next" - } -} diff --git a/perf/impl/js-libp2p/v1.0-native-x25519/perf b/perf/impl/js-libp2p/v1.0-native-x25519/perf deleted file mode 100755 index 1a3e19c51..000000000 --- a/perf/impl/js-libp2p/v1.0-native-x25519/perf +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# In case this script is `kill`ed, `kill` its child process, namely the `node` -# process below. -cleanup() { - kill $node_pid -} -trap cleanup EXIT TERM - -# Find the path to the Node.js executable -node_path=$(which node) - -run_server=false -server_address="" -upload_bytes=0 -download_bytes=0 -transport="" - -# Parse named parameters manually -for ((i = 1; i <= $#; i++)); do - if [ "${!i}" == "--server-address" ]; then - server_address="${@:i+1:1}" - fi - if [ "${!i}" == "--upload-bytes" ]; then - upload_bytes="${@:i+1:1}" - fi - if [ "${!i}" == "--download-bytes" ]; then - download_bytes="${@:i+1:1}" - fi - if [ "${!i}" == "--transport" ]; then - transport="${@:i+1:1}" - fi - if [ "${!i}" == "--run-server" ]; then - run_server=true - fi -done - -# Run perf -node $(dirname "$0")/index.js --run-server=$run_server --server-address=$server_address --upload-bytes=$upload_bytes --download-bytes=$download_bytes --transport=$transport & - -node_pid=$! - -# Wait for `node_pid` to finish, or for it to be `kill`ed by the above -# `cleanup`. -wait $node_pid diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/Makefile b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/Makefile deleted file mode 100644 index a1e077cdc..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -DOCKER_IMAGE := node:20-alpine -DOCKER_RUN := docker run --rm -v "$(shell pwd)":/usr/src/myapp -w /usr/src/myapp $(DOCKER_IMAGE) - -all: perf - -perf: - $(DOCKER_RUN) npm ci - -clean: - rm -rf node_modules - -.PHONY: all clean perf diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/index.js deleted file mode 100644 index 8b4462ee6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/index.js +++ /dev/null @@ -1,109 +0,0 @@ -import { noise } from './noise/dist/src/index.js' -import { yamux } from './yamux/dist/src/index.js' -import { tcp } from './tcp/dist/src/index.js' -import { multiaddr } from '@multiformats/multiaddr' -import { createLibp2p } from './libp2p/dist/src/index.js' -import { perf } from '@libp2p/perf' -import { parseArgs } from 'node:util' - -const argv = parseArgs({ - options: { - 'run-server': { - type: 'string', - default: 'false' - }, - 'server-address': { - type: 'string', - default: '127.0.0.1:8000' - }, - transport: { - type: 'string', - default: 'tcp' - }, - 'upload-bytes': { - type: 'string', - default: '0' - }, - 'download-bytes': { - type: 'string', - default: '10000000000' - } - } -}) - -/** - * @param {boolean} runServer - * @param {string} serverIpAddress - * @param {string} transport - * @param {number} uploadBytes - * @param {number} downloadBytes - */ -export async function main (runServer, serverIpAddress, transport, uploadBytes, downloadBytes) { - const { host, port } = splitHostPort(serverIpAddress) - - const config = { - transports: [ - tcp() - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - noise() - ], - connectionManager: { - minConnections: 0 - }, - services: { - perf: perf() - } - } - - if (runServer) { - Object.assign(config, { - addresses: { - listen: [ - // #TODO: right now we only support tcp - `/ip4/${host}/tcp/${port}` - ] - } - }) - } - - const node = await createLibp2p(config) - - await node.start() - - if (!runServer) { - for await (const output of node.services.perf.measurePerformance(multiaddr(`/ip4/${host}/tcp/${port}`), uploadBytes, downloadBytes)) { - // eslint-disable-next-line no-console - console.log(JSON.stringify(output)) - } - - await node.stop() - } -} - -/** - * @param {string} address - * @returns { host: string, port?: string } - */ -function splitHostPort (address) { - try { - const parts = address.split(':') - const host = parts[0] - const port = parts[1] - return { - host, - port - } - } catch (error) { - throw Error('Invalid server address') - } -} - -main(argv.values['run-server'] === 'true', argv.values['server-address'], argv.values.transport, Number(argv.values['upload-bytes']), Number(argv.values['download-bytes'])).catch((err) => { - // eslint-disable-next-line no-console - console.error(err) - process.exit(1) -}) diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/index.min.js deleted file mode 100644 index 506967c5c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/index.min.js +++ /dev/null @@ -1,91 +0,0 @@ -(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2P = factory()}(typeof self !== 'undefined' ? self : this, function () { -"use strict";var Libp2P=(()=>{var eg=Object.create;var is=Object.defineProperty;var tg=Object.getOwnPropertyDescriptor;var rg=Object.getOwnPropertyNames;var ng=Object.getPrototypeOf,ig=Object.prototype.hasOwnProperty;var V=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ke=(t,e)=>{for(var r in e)is(t,r,{get:e[r],enumerable:!0})},Zl=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of rg(e))!ig.call(t,i)&&i!==r&&is(t,i,{get:()=>e[i],enumerable:!(n=tg(e,i))||n.enumerable});return t};var ve=(t,e,r)=>(r=t!=null?eg(ng(t)):{},Zl(e||!t||!t.__esModule?is(r,"default",{value:t,enumerable:!0}):r,t)),sg=t=>Zl(is({},"__esModule",{value:!0}),t);var de=V((Rv,jl)=>{jl.exports={options:{usePureJavaScript:!1}}});var tf=V((Cv,ef)=>{var da={};ef.exports=da;var Jl={};da.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=og(t,e);else{var i=0,s=e.length,o=e.charAt(0),a=[0];for(i=0;i0;)a.push(u%s),u=u/s|0}for(i=0;t[i]===0&&i=0;--i)n+=e[a[i]]}if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join(`\r -`)}return n};da.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=Jl[e];if(!r){r=Jl[e]=[];for(var n=0;n>=8;for(;u>0;)o.push(u&255),u>>=8}for(var l=0;t[l]===s&&l0;)s.push(a%n),a=a/n|0}var c="";for(r=0;t.at(r)===0&&r=0;--r)c+=e[s[r]];return c}});var Ne=V((Tv,of)=>{var rf=de(),nf=tf(),w=of.exports=rf.util=rf.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){w.nextTick=process.nextTick,typeof setImmediate=="function"?w.setImmediate=setImmediate:w.setImmediate=w.nextTick;return}if(typeof setImmediate=="function"){w.setImmediate=function(){return setImmediate.apply(void 0,arguments)},w.nextTick=function(a){return setImmediate(a)};return}if(w.setImmediate=function(a){setTimeout(a,0)},typeof window<"u"&&typeof window.postMessage=="function"){let a=function(c){if(c.source===window&&c.data===t){c.stopPropagation();var u=e.slice();e.length=0,u.forEach(function(l){l()})}};var o=a,t="forge.setImmediate",e=[];w.setImmediate=function(c){e.push(c),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",a,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,i=document.createElement("div"),e=[];new MutationObserver(function(){var c=e.slice();e.length=0,c.forEach(function(u){u()})}).observe(i,{attributes:!0});var s=w.setImmediate;w.setImmediate=function(c){Date.now()-r>15?(r=Date.now(),s(c)):(e.push(c),e.length===1&&i.setAttribute("a",n=!n))}}w.nextTick=w.setImmediate})();w.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;w.globalScope=function(){return w.isNodejs?globalThis:typeof self>"u"?window:self}();w.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};w.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};w.isArrayBufferView=function(t){return t&&w.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function hi(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}w.ByteBuffer=pa;function pa(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(w.isArrayBuffer(t)||w.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;rag&&(this.data.substr(0,1),this._constructedStringLength=0)};w.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};w.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};w.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};w.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};w.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};w.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(w.encodeUtf8(t))};w.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};w.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};w.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};w.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};w.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};w.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};w.ByteStringBuffer.prototype.putInt=function(t,e){hi(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};w.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};w.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};w.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};w.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};w.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};w.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};w.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};w.ByteStringBuffer.prototype.copy=function(){var t=w.createBuffer(this.data);return t.read=this.read,t};w.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};w.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};w.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};w.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};w.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};w.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};w.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};w.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};w.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};w.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};w.DataBuffer.prototype.putInt=function(t,e){hi(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};w.DataBuffer.prototype.putSignedInt=function(t,e){return hi(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};w.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};w.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};w.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};w.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};w.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};w.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};w.DataBuffer.prototype.copy=function(){return new w.DataBuffer(this)};w.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};w.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};w.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};w.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};w.xorBytes=function(t,e,r){for(var n="",i="",s="",o=0,a=0;r>0;--r,++o)i=t.charCodeAt(o)^e.charCodeAt(o),a>=10&&(n+=s,s="",a=0),s+=String.fromCharCode(i),++a;return n+=s,n};w.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var gr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",yr=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],sf="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";w.encode64=function(t,e){for(var r="",n="",i,s,o,a=0;a>2),r+=gr.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=gr.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":gr.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};w.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,i,s,o=0;o>4),i!==64&&(e+=String.fromCharCode((n&15)<<4|i>>2),s!==64&&(e+=String.fromCharCode((i&3)<<6|s)));return e};w.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};w.decodeUtf8=function(t){return decodeURIComponent(escape(t))};w.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:nf.encode,decode:nf.decode}};w.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};w.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s>2),r+=gr.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=gr.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":gr.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};w.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,s,o,a,c=0,u=r;c>4,o!==64&&(n[u++]=(s&15)<<4|o>>2,a!==64&&(n[u++]=(o&3)<<6|a));return e?u-r:n.subarray(0,u)};w.binary.base58.encode=function(t,e){return w.binary.baseN.encode(t,sf,e)};w.binary.base58.decode=function(t,e){return w.binary.baseN.decode(t,sf,e)};w.text={utf8:{},utf16:{}};w.text.utf8.encode=function(t,e,r){t=w.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s"u"&&(r=["web","flash"]);var i,s=!1,o=null;for(var a in r){i=r[a];try{if(i==="flash"||i==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),s=i==="flash"}(i==="web"||i==="both")&&(e[0]=localStorage,n=t.apply(this,e),s=!0)}catch(c){o=c}if(s)break}if(!s)throw o;return n};w.setItem=function(t,e,r,n,i){ss(ug,arguments,i)};w.getItem=function(t,e,r,n){return ss(lg,arguments,n)};w.removeItem=function(t,e,r,n){ss(fg,arguments,n)};w.clearItems=function(t,e,r){ss(hg,arguments,r)};w.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};w.format=function(t){for(var e=/%./g,r,n,i=0,s=[],o=0;r=e.exec(t);){n=t.substring(o,e.lastIndex-2),n.length>0&&s.push(n),o=e.lastIndex;var a=r[0][1];switch(a){case"s":case"o":i");break;case"%":s.push("%");break;default:s.push("<%"+a+"?>")}}return s.push(t.substring(o)),s.join("")};w.formatNumber=function(t,e,r,n){var i=t,s=isNaN(e=Math.abs(e))?2:e,o=r===void 0?",":r,a=n===void 0?".":n,c=i<0?"-":"",u=parseInt(i=Math.abs(+i||0).toFixed(s),10)+"",l=u.length>3?u.length%3:0;return c+(l?u.substr(0,l)+a:"")+u.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+a)+(s?o+Math.abs(i-u).toFixed(s).slice(2):"")};w.formatSize=function(t){return t>=1073741824?t=w.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=w.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=w.formatNumber(t/1024,0)+" KiB":t=w.formatNumber(t,0)+" bytes",t};w.bytesFromIP=function(t){return t.indexOf(".")!==-1?w.bytesFromIPv4(t):t.indexOf(":")!==-1?w.bytesFromIPv6(t):null};w.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=w.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1))}e.push(s)}if(r.length>0){var c=r[n];c.end-c.start>0&&(e.splice(c.start,c.end-c.start+1,""),c.start===0&&e.unshift(""),c.end===7&&e.push(""))}return e.join(":")};w.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in w&&!t.update)return e(null,w.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return w.cores=navigator.hardwareConcurrency,e(null,w.cores);if(typeof Worker>"u")return w.cores=1,e(null,w.cores);if(typeof Blob>"u")return w.cores=2,e(null,w.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(o){for(var a=Date.now(),c=a+4;Date.now()p.st&&l.stl.st&&p.st{var di=de();di.pki=di.pki||{};var ya=af.exports=di.pki.oids=di.oids=di.oids||{};function B(t,e){ya[t]=e,ya[e]=t}function ae(t,e){ya[t]=e}B("1.2.840.113549.1.1.1","rsaEncryption");B("1.2.840.113549.1.1.4","md5WithRSAEncryption");B("1.2.840.113549.1.1.5","sha1WithRSAEncryption");B("1.2.840.113549.1.1.7","RSAES-OAEP");B("1.2.840.113549.1.1.8","mgf1");B("1.2.840.113549.1.1.9","pSpecified");B("1.2.840.113549.1.1.10","RSASSA-PSS");B("1.2.840.113549.1.1.11","sha256WithRSAEncryption");B("1.2.840.113549.1.1.12","sha384WithRSAEncryption");B("1.2.840.113549.1.1.13","sha512WithRSAEncryption");B("1.3.101.112","EdDSA25519");B("1.2.840.10040.4.3","dsa-with-sha1");B("1.3.14.3.2.7","desCBC");B("1.3.14.3.2.26","sha1");B("1.3.14.3.2.29","sha1WithRSASignature");B("2.16.840.1.101.3.4.2.1","sha256");B("2.16.840.1.101.3.4.2.2","sha384");B("2.16.840.1.101.3.4.2.3","sha512");B("2.16.840.1.101.3.4.2.4","sha224");B("2.16.840.1.101.3.4.2.5","sha512-224");B("2.16.840.1.101.3.4.2.6","sha512-256");B("1.2.840.113549.2.2","md2");B("1.2.840.113549.2.5","md5");B("1.2.840.113549.1.7.1","data");B("1.2.840.113549.1.7.2","signedData");B("1.2.840.113549.1.7.3","envelopedData");B("1.2.840.113549.1.7.4","signedAndEnvelopedData");B("1.2.840.113549.1.7.5","digestedData");B("1.2.840.113549.1.7.6","encryptedData");B("1.2.840.113549.1.9.1","emailAddress");B("1.2.840.113549.1.9.2","unstructuredName");B("1.2.840.113549.1.9.3","contentType");B("1.2.840.113549.1.9.4","messageDigest");B("1.2.840.113549.1.9.5","signingTime");B("1.2.840.113549.1.9.6","counterSignature");B("1.2.840.113549.1.9.7","challengePassword");B("1.2.840.113549.1.9.8","unstructuredAddress");B("1.2.840.113549.1.9.14","extensionRequest");B("1.2.840.113549.1.9.20","friendlyName");B("1.2.840.113549.1.9.21","localKeyId");B("1.2.840.113549.1.9.22.1","x509Certificate");B("1.2.840.113549.1.12.10.1.1","keyBag");B("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");B("1.2.840.113549.1.12.10.1.3","certBag");B("1.2.840.113549.1.12.10.1.4","crlBag");B("1.2.840.113549.1.12.10.1.5","secretBag");B("1.2.840.113549.1.12.10.1.6","safeContentsBag");B("1.2.840.113549.1.5.13","pkcs5PBES2");B("1.2.840.113549.1.5.12","pkcs5PBKDF2");B("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");B("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");B("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");B("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");B("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");B("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");B("1.2.840.113549.2.7","hmacWithSHA1");B("1.2.840.113549.2.8","hmacWithSHA224");B("1.2.840.113549.2.9","hmacWithSHA256");B("1.2.840.113549.2.10","hmacWithSHA384");B("1.2.840.113549.2.11","hmacWithSHA512");B("1.2.840.113549.3.7","des-EDE3-CBC");B("2.16.840.1.101.3.4.1.2","aes128-CBC");B("2.16.840.1.101.3.4.1.22","aes192-CBC");B("2.16.840.1.101.3.4.1.42","aes256-CBC");B("2.5.4.3","commonName");B("2.5.4.4","surname");B("2.5.4.5","serialNumber");B("2.5.4.6","countryName");B("2.5.4.7","localityName");B("2.5.4.8","stateOrProvinceName");B("2.5.4.9","streetAddress");B("2.5.4.10","organizationName");B("2.5.4.11","organizationalUnitName");B("2.5.4.12","title");B("2.5.4.13","description");B("2.5.4.15","businessCategory");B("2.5.4.17","postalCode");B("2.5.4.42","givenName");B("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");B("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");B("2.16.840.1.113730.1.1","nsCertType");B("2.16.840.1.113730.1.13","nsComment");ae("2.5.29.1","authorityKeyIdentifier");ae("2.5.29.2","keyAttributes");ae("2.5.29.3","certificatePolicies");ae("2.5.29.4","keyUsageRestriction");ae("2.5.29.5","policyMapping");ae("2.5.29.6","subtreesConstraint");ae("2.5.29.7","subjectAltName");ae("2.5.29.8","issuerAltName");ae("2.5.29.9","subjectDirectoryAttributes");ae("2.5.29.10","basicConstraints");ae("2.5.29.11","nameConstraints");ae("2.5.29.12","policyConstraints");ae("2.5.29.13","basicConstraints");B("2.5.29.14","subjectKeyIdentifier");B("2.5.29.15","keyUsage");ae("2.5.29.16","privateKeyUsagePeriod");B("2.5.29.17","subjectAltName");B("2.5.29.18","issuerAltName");B("2.5.29.19","basicConstraints");ae("2.5.29.20","cRLNumber");ae("2.5.29.21","cRLReason");ae("2.5.29.22","expirationDate");ae("2.5.29.23","instructionCode");ae("2.5.29.24","invalidityDate");ae("2.5.29.25","cRLDistributionPoints");ae("2.5.29.26","issuingDistributionPoint");ae("2.5.29.27","deltaCRLIndicator");ae("2.5.29.28","issuingDistributionPoint");ae("2.5.29.29","certificateIssuer");ae("2.5.29.30","nameConstraints");B("2.5.29.31","cRLDistributionPoints");B("2.5.29.32","certificatePolicies");ae("2.5.29.33","policyMappings");ae("2.5.29.34","policyConstraints");B("2.5.29.35","authorityKeyIdentifier");ae("2.5.29.36","policyConstraints");B("2.5.29.37","extKeyUsage");ae("2.5.29.46","freshestCRL");ae("2.5.29.54","inhibitAnyPolicy");B("1.3.6.1.4.1.11129.2.4.2","timestampList");B("1.3.6.1.5.5.7.1.1","authorityInfoAccess");B("1.3.6.1.5.5.7.3.1","serverAuth");B("1.3.6.1.5.5.7.3.2","clientAuth");B("1.3.6.1.5.5.7.3.3","codeSigning");B("1.3.6.1.5.5.7.3.4","emailProtection");B("1.3.6.1.5.5.7.3.8","timeStamping")});var mi=V((Lv,uf)=>{var ge=de();Ne();os();var O=uf.exports=ge.asn1=ge.asn1||{};O.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};O.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};O.create=function(t,e,r,n,i){if(ge.util.isArray(n)){for(var s=[],o=0;oe){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}var dg=function(t,e){var r=t.getByte();if(e--,r!==128){var n,i=r&128;if(!i)n=r;else{var s=r&127;pi(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}};O.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof t=="string"&&(t=ge.util.createBuffer(t));var r=t.length(),n=as(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=r,i.remaining=t.length(),i}return n};function as(t,e,r,n){var i;pi(t,e,2);var s=t.getByte();e--;var o=s&192,a=s&31;i=t.length();var c=dg(t,e);if(e-=i-t.length(),c!==void 0&&c>e){if(n.strict){var u=new Error("Too few bytes to read ASN.1 value.");throw u.available=t.length(),u.remaining=e,u.requested=c,u}c=e}var l,f,h=(s&32)===32;if(h)if(l=[],c===void 0)for(;;){if(pi(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}i=t.length(),l.push(as(t,e,r+1,n)),e-=i-t.length()}else for(;c>0;)i=t.length(),l.push(as(t,c,r+1,n)),e-=i-t.length(),c-=i-t.length();if(l===void 0&&o===O.Class.UNIVERSAL&&a===O.Type.BITSTRING&&(f=t.bytes(c)),l===void 0&&n.decodeBitStrings&&o===O.Class.UNIVERSAL&&a===O.Type.BITSTRING&&c>1){var p=t.read,d=e,m=0;if(a===O.Type.BITSTRING&&(pi(t,e,1),m=t.getByte(),e--),m===0)try{i=t.length();var g={strict:!0,decodeBitStrings:!0},y=as(t,e,r+1,g),x=i-t.length();e-=x,a==O.Type.BITSTRING&&x++;var b=y.tagClass;x===c&&(b===O.Class.UNIVERSAL||b===O.Class.CONTEXT_SPECIFIC)&&(l=[y])}catch{}l===void 0&&(t.read=p,e=d)}if(l===void 0){if(c===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=e}if(a===O.Type.BMPSTRING)for(l="";c>0;c-=2)pi(t,e,2),l+=String.fromCharCode(t.getInt16()),e-=2;else l=t.getBytes(c),e-=c}var I=f===void 0?null:{bitStringContents:f};return O.create(o,a,h,l,I)}O.toDer=function(t){var e=ge.util.createBuffer(),r=t.tagClass|t.type,n=ge.util.createBuffer(),i=!1;if("bitStringContents"in t&&(i=!0,t.original&&(i=O.equals(t,t.original))),i)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var s=0;s1&&(t.value.charCodeAt(0)===0&&!(t.value.charCodeAt(1)&128)||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var o=n.length(),a="";do a+=String.fromCharCode(o&255),o=o>>>8;while(o>0);e.putByte(a.length|128);for(var s=a.length-1;s>=0;--s)e.putByte(a.charCodeAt(s))}return e.putBuffer(n),e};O.oidToDer=function(t){var e=t.split("."),r=ge.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,i,s,o,a=2;a>>7,n||(o|=128),i.push(o),n=!1;while(s>0);for(var c=i.length-1;c>=0;--c)r.putByte(i[c])}return r};O.derToOid=function(t){var e;typeof t=="string"&&(t=ge.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;)r=t.getByte(),n=n<<7,r&128?n+=r&127:(e+="."+(n+r),n=0);return e};O.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),s=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=0;if(t.length>11){var c=t.charAt(10),u=10;c!=="+"&&c!=="-"&&(a=parseInt(t.substr(10,2),10),u+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,0),u&&(c=t.charAt(u),c==="+"||c==="-")){var l=parseInt(t.substr(u+1,2),10),f=parseInt(t.substr(u+4,2),10),h=l*60+f;h*=6e4,c==="+"?e.setTime(+e-h):e.setTime(+e+h)}return e};O.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),o=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),c=0,u=0,l=!1;t.charAt(t.length-1)==="Z"&&(l=!0);var f=t.length-5,h=t.charAt(f);if(h==="+"||h==="-"){var p=parseInt(t.substr(f+1,2),10),d=parseInt(t.substr(f+4,2),10);u=p*60+d,u*=6e4,h==="+"&&(u*=-1),l=!0}return t.charAt(14)==="."&&(c=parseFloat(t.substr(14),10)*1e3),l?(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,c),e.setTime(+e+u)):(e.setFullYear(r,n,i),e.setHours(s,o,a,c)),e};O.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};O.derToInteger=function(t){typeof t=="string"&&(t=ge.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};O.validate=function(t,e,r,n){var i=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(i=!0,e.value&&ge.util.isArray(e.value))for(var s=0,o=0;i&&o0&&(n+=` -`);for(var i="",s=0;s1?n+="0x"+ge.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var u=t.value.charCodeAt(0);u==1?n+=" (1 unused bit shown)":u>1&&(n+=" ("+u+" unused bits shown)")}}else if(t.type===O.Type.OCTETSTRING)cf.test(t.value)||(n+="("+t.value+") "),n+="0x"+ge.util.bytesToHex(t.value);else if(t.type===O.Type.UTF8)try{n+=ge.util.decodeUtf8(t.value)}catch(l){if(l.message==="URI malformed")n+="0x"+ge.util.bytesToHex(t.value)+" (malformed UTF8)";else throw l}else t.type===O.Type.PRINTABLESTRING||t.type===O.Type.IA5String?n+=t.value:cf.test(t.value)?n+="0x"+ge.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var ba=V((Pv,lf)=>{var qe=de();Ne();lf.exports=qe.cipher=qe.cipher||{};qe.cipher.algorithms=qe.cipher.algorithms||{};qe.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=qe.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new qe.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};qe.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=qe.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new qe.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};qe.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),qe.cipher.algorithms[t]=e};qe.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in qe.cipher.algorithms?qe.cipher.algorithms[t]:null};var xa=qe.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};xa.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=qe.util.createBuffer(),this.output=t.output||qe.util.createBuffer(),this.mode.start(e)};xa.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};xa.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var Ea=V((Dv,ff)=>{var Ve=de();Ne();Ve.cipher=Ve.cipher||{};var J=ff.exports=Ve.cipher.modes=Ve.cipher.modes||{};J.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};J.ecb.prototype.start=function(t){};J.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};J.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};J.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=cs(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};J.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};J.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Ve.util.createBuffer(),this._partialBytes=0};J.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=cs(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};J.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};J.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};J.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Ve.util.createBuffer(),this._partialBytes=0};J.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=cs(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};J.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};J.ofb.prototype.decrypt=J.ofb.prototype.encrypt;J.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Ve.util.createBuffer(),this._partialBytes=0};J.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=cs(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};J.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}us(this._inBlock)};J.ctr.prototype.decrypt=J.ctr.prototype.encrypt;J.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Ve.util.createBuffer(),this._partialBytes=0,this._R=3774873600};J.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=Ve.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=Ve.util.createBuffer(t.additionalData):r=Ve.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=Ve.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(wa(n*8)))}this._inBlock=this._j0.slice(0),us(this._inBlock),this._partialBytes=0,r=Ve.util.createBuffer(r),this._aDataLength=wa(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};J.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),us(this._inBlock)};J.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),us(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};J.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=t[n]>>>(7-r%8)*4&15,s=this._m[r][i];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};J.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};J.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,s=new Array(i),o=0;o>>1,i=new Array(r);i[n]=t.slice(0);for(var s=n>>>1;s>0;)this.pow(i[2*s],i[s]=[]),s>>=1;for(s=2;s4){var r=t;t=Ve.util.createBuffer();for(var n=0;n{var me=de();ba();Ea();Ne();mf.exports=me.aes=me.aes||{};me.aes.startEncrypting=function(t,e,r,n){var i=ls({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i};me.aes.createEncryptionCipher=function(t,e){return ls({key:t,output:null,decrypt:!1,mode:e})};me.aes.startDecrypting=function(t,e,r,n){var i=ls({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i};me.aes.createDecryptionCipher=function(t,e){return ls({key:t,output:null,decrypt:!0,mode:e})};me.aes.Algorithm=function(t,e){Sa||df();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(n,i){return _a(r._w,n,i,!1)},decrypt:function(n,i){return _a(r._w,n,i,!0)}}}),r._init=!1};me.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=me.util.createBuffer(e);else if(me.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=me.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^a&255^99,ot[r]=a,va[a]=r,c=t[a],i=t[r],s=t[i],o=t[s],u=c<<24^a<<16^a<<8^(a^c),l=(i^s^o)<<24^(r^o)<<16^(r^s^o)<<8^(r^i^o);for(var f=0;f<4;++f)Vr[f][r]=u,Tt[f][a]=l,u=u<<24|u>>>8,l=l<<24|l>>>8;r===0?r=n=1:(r=i^t[t[t[i^o]]],n^=t[t[n]])}}function pf(t,e){for(var r=t.slice(0),n,i=1,s=r.length,o=s+6+1,a=_n*o,c=s;c>>16&255]<<24^ot[n>>>8&255]<<16^ot[n&255]<<8^ot[n>>>24]^hf[i]<<24,i++):s>6&&c%s===4&&(n=ot[n>>>24]<<24^ot[n>>>16&255]<<16^ot[n>>>8&255]<<8^ot[n&255]),r[c]=r[c-s]^n;if(e){var u,l=Tt[0],f=Tt[1],h=Tt[2],p=Tt[3],d=r.slice(0);a=r.length;for(var c=0,m=a-_n;c>>24]]^f[ot[u>>>16&255]]^h[ot[u>>>8&255]]^p[ot[u&255]];r=d}return r}function _a(t,e,r,n){var i=t.length/4-1,s,o,a,c,u;n?(s=Tt[0],o=Tt[1],a=Tt[2],c=Tt[3],u=va):(s=Vr[0],o=Vr[1],a=Vr[2],c=Vr[3],u=ot);var l,f,h,p,d,m,g;l=e[0]^t[0],f=e[n?3:1]^t[1],h=e[2]^t[2],p=e[n?1:3]^t[3];for(var y=3,x=1;x>>24]^o[f>>>16&255]^a[h>>>8&255]^c[p&255]^t[++y],m=s[f>>>24]^o[h>>>16&255]^a[p>>>8&255]^c[l&255]^t[++y],g=s[h>>>24]^o[p>>>16&255]^a[l>>>8&255]^c[f&255]^t[++y],p=s[p>>>24]^o[l>>>16&255]^a[f>>>8&255]^c[h&255]^t[++y],l=d,f=m,h=g;r[0]=u[l>>>24]<<24^u[f>>>16&255]<<16^u[h>>>8&255]<<8^u[p&255]^t[++y],r[n?3:1]=u[f>>>24]<<24^u[h>>>16&255]<<16^u[p>>>8&255]<<8^u[l&255]^t[++y],r[2]=u[h>>>24]<<24^u[p>>>16&255]<<16^u[l>>>8&255]<<8^u[f&255]^t[++y],r[n?1:3]=u[p>>>24]<<24^u[l>>>16&255]<<16^u[f>>>8&255]<<8^u[h&255]^t[++y]}function ls(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=me.cipher.createDecipher(r,t.key):n=me.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof me.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var xf=V((kv,yf)=>{var xe=de();ba();Ea();Ne();yf.exports=xe.des=xe.des||{};xe.des.startEncrypting=function(t,e,r,n){var i=fs({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};xe.des.createEncryptionCipher=function(t,e){return fs({key:t,output:null,decrypt:!1,mode:e})};xe.des.startDecrypting=function(t,e,r,n){var i=fs({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};xe.des.createDecryptionCipher=function(t,e){return fs({key:t,output:null,decrypt:!0,mode:e})};xe.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(n,i){return gf(r._keys,n,i,!1)},decrypt:function(n,i){return gf(r._keys,n,i,!0)}}}),r._init=!1};xe.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=xe.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=vg(e),this._init=!0}};Kt("DES-ECB",xe.cipher.modes.ecb);Kt("DES-CBC",xe.cipher.modes.cbc);Kt("DES-CFB",xe.cipher.modes.cfb);Kt("DES-OFB",xe.cipher.modes.ofb);Kt("DES-CTR",xe.cipher.modes.ctr);Kt("3DES-ECB",xe.cipher.modes.ecb);Kt("3DES-CBC",xe.cipher.modes.cbc);Kt("3DES-CFB",xe.cipher.modes.cfb);Kt("3DES-OFB",xe.cipher.modes.ofb);Kt("3DES-CTR",xe.cipher.modes.ctr);function Kt(t,e){var r=function(){return new xe.des.Algorithm(t,e)};xe.cipher.registerAlgorithm(t,r)}var pg=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],mg=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],gg=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],yg=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],xg=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],bg=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],wg=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],Eg=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function vg(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],a=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],l=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],d=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],m=t.length()>8?3:1,g=[],y=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],x=0,b,I=0;I>>4^_)&252645135,_^=b,v^=b<<4,b=(_>>>-16^v)&65535,v^=b,_^=b<<-16,b=(v>>>2^_)&858993459,_^=b,v^=b<<2,b=(_>>>-16^v)&65535,v^=b,_^=b<<-16,b=(v>>>1^_)&1431655765,_^=b,v^=b<<1,b=(_>>>8^v)&16711935,v^=b,_^=b<<8,b=(v>>>1^_)&1431655765,_^=b,v^=b<<1,b=v<<8|_>>>20&240,v=_<<24|_<<8&16711680|_>>>8&65280|_>>>24&240,_=b;for(var P=0;P>>26,_=_<<2|_>>>26):(v=v<<1|v>>>27,_=_<<1|_>>>27),v&=-15,_&=-15;var D=e[v>>>28]|r[v>>>24&15]|n[v>>>20&15]|i[v>>>16&15]|s[v>>>12&15]|o[v>>>8&15]|a[v>>>4&15],G=c[_>>>28]|u[_>>>24&15]|l[_>>>20&15]|f[_>>>16&15]|h[_>>>12&15]|p[_>>>8&15]|d[_>>>4&15];b=(G>>>16^D)&65535,g[x++]=D^b,g[x++]=G^b<<16}}return g}function gf(t,e,r,n){var i=t.length===32?3:9,s;i===3?s=n?[30,-2,-2]:[0,32,2]:s=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,a=e[0],c=e[1];o=(a>>>4^c)&252645135,c^=o,a^=o<<4,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,a=a<<1|a>>>31,c=c<<1|c>>>31;for(var u=0;u>>4|c<<28)^t[h+1];o=a,a=c,c=o^(mg[p>>>24&63]|yg[p>>>16&63]|bg[p>>>8&63]|Eg[p&63]|pg[d>>>24&63]|gg[d>>>16&63]|xg[d>>>8&63]|wg[d&63])}o=a,a=c,c=o}a=a>>>1|a<<31,c=c>>>1|c<<31,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(a>>>4^c)&252645135,c^=o,a^=o<<4,r[0]=a,r[1]=c}function fs(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=xe.cipher.createDecipher(r,t.key):n=xe.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof xe.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var $r=V((Ov,bf)=>{var hs=de();bf.exports=hs.md=hs.md||{};hs.md.algorithms=hs.md.algorithms||{}});var Ef=V((Mv,wf)=>{var er=de();$r();Ne();var _g=wf.exports=er.hmac=er.hmac||{};_g.create=function(){var t=null,e=null,r=null,n=null,i={};return i.start=function(s,o){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in er.md.algorithms)e=er.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else e=s;if(o===null)o=t;else{if(typeof o=="string")o=er.util.createBuffer(o);else if(er.util.isArray(o)){var a=o;o=er.util.createBuffer();for(var c=0;ce.blockLength&&(e.start(),e.update(o.bytes()),o=e.digest()),r=er.util.createBuffer(),n=er.util.createBuffer(),u=o.length();for(var c=0;c{});var _f=V((Kv,vf)=>{var at=de();Ef();$r();Ne();var Sg=at.pkcs5=at.pkcs5||{},tr;at.util.isNodejs&&!at.options.usePureJavaScript&&(tr=gi());vf.exports=at.pbkdf2=Sg.pbkdf2=function(t,e,r,n,i,s){if(typeof i=="function"&&(s=i,i=null),at.util.isNodejs&&!at.options.usePureJavaScript&&tr.pbkdf2&&(i===null||typeof i!="object")&&(tr.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?tr.pbkdf2Sync.length===4?tr.pbkdf2(t,e,r,n,function(b,I){if(b)return s(b);s(null,I.toString("binary"))}):tr.pbkdf2(t,e,r,n,i,function(b,I){if(b)return s(b);s(null,I.toString("binary"))}):tr.pbkdf2Sync.length===4?tr.pbkdf2Sync(t,e,r,n).toString("binary"):tr.pbkdf2Sync(t,e,r,n,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in at.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=at.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var a=new Error("Derived key is too long.");if(s)return s(a);throw a}var c=Math.ceil(n/o),u=n-(c-1)*o,l=at.hmac.create();l.start(i,t);var f="",h,p,d;if(!s){for(var m=1;m<=c;++m){l.start(null,null),l.update(e),l.update(at.util.int32ToBytes(m)),h=d=l.digest().getBytes();for(var g=2;g<=r;++g)l.start(null,null),l.update(d),p=l.digest().getBytes(),h=at.util.xorBytes(h,p,o),d=p;f+=mc)return s(null,f);l.start(null,null),l.update(e),l.update(at.util.int32ToBytes(m)),h=d=l.digest().getBytes(),g=2,x()}function x(){if(g<=r)return l.start(null,null),l.update(d),p=l.digest().getBytes(),h=at.util.xorBytes(h,p,o),d=p,++g,at.util.setImmediate(x);f+=m{var ps=de();Ne();var Sf=Af.exports=ps.pem=ps.pem||{};Sf.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r -`,n;if(t.procType&&(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=ds(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=ds(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=ds(n)),t.headers)for(var i=0;i65&&o!==-1){var a=e[o];a===","?(++o,e=e.substr(0,o)+`\r - `+e.substr(o)):e=e.substr(0,o)+`\r -`+a+e.substr(o+1),s=i-o-1,o=-1,++i}else(e[i]===" "||e[i]===" "||e[i]===",")&&(o=i);return e}function Ag(t){return t.replace(/^\s+/,"")}});var Pf=V((Vv,Lf)=>{var qt=de();$r();Ne();var Cf=Lf.exports=qt.sha256=qt.sha256||{};qt.md.sha256=qt.md.algorithms.sha256=Cf;Cf.create=function(){Tf||Ig();var t=null,e=qt.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),Rf(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=qt.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(Ia.substr(0,n.blockLength-o));for(var a,c,u=n.fullMessageLength[0]*8,l=0;l>>0,u+=c,i.putInt32(u>>>0),u=a>>>0;i.putInt32(u);var f={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};Rf(f,r,i);var h=qt.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h.putInt32(f.h5),h.putInt32(f.h6),h.putInt32(f.h7),h},n};var Ia=null,Tf=!1,Bf=null;function Ig(){Ia="\x80",Ia+=qt.util.fillString("\0",64),Bf=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Tf=!0}function Rf(t,e,r){for(var n,i,s,o,a,c,u,l,f,h,p,d,m,g,y,x=r.length();x>=64;){for(u=0;u<16;++u)e[u]=r.getInt32();for(;u<64;++u)n=e[u-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=e[u-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[u]=n+e[u-7]+i+e[u-16]|0;for(l=t.h0,f=t.h1,h=t.h2,p=t.h3,d=t.h4,m=t.h5,g=t.h6,y=t.h7,u=0;u<64;++u)o=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),a=g^d&(m^g),s=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),c=l&f|h&(l^f),n=y+o+a+Bf[u]+e[u],i=s+c,y=g,g=m,m=d,d=p+n>>>0,p=h,h=f,f=l,l=n+i>>>0;t.h0=t.h0+l|0,t.h1=t.h1+f|0,t.h2=t.h2+h|0,t.h3=t.h3+p|0,t.h4=t.h4+d|0,t.h5=t.h5+m|0,t.h6=t.h6+g|0,t.h7=t.h7+y|0,x-=64}}});var Nf=V(($v,Df)=>{var Vt=de();Ne();var ms=null;Vt.util.isNodejs&&!Vt.options.usePureJavaScript&&!process.versions["node-webkit"]&&(ms=gi());var Rg=Df.exports=Vt.prng=Vt.prng||{};Rg.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();e.pools=n,e.pool=0,e.generate=function(u,l){if(!l)return e.generateSync(u);var f=e.plugin.cipher,h=e.plugin.increment,p=e.plugin.formatKey,d=e.plugin.formatSeed,m=Vt.util.createBuffer();e.key=null,g();function g(y){if(y)return l(y);if(m.length()>=u)return l(null,m.getBytes(u));if(e.generated>1048575&&(e.key=null),e.key===null)return Vt.util.nextTick(function(){s(g)});var x=f(e.key,e.seed);e.generated+=x.length,m.putBytes(x),e.key=p(f(e.key,h(e.seed))),e.seed=d(f(e.key,e.seed)),Vt.util.setImmediate(g)}},e.generateSync=function(u){var l=e.plugin.cipher,f=e.plugin.increment,h=e.plugin.formatKey,p=e.plugin.formatSeed;e.key=null;for(var d=Vt.util.createBuffer();d.length()1048575&&(e.key=null),e.key===null&&o();var m=l(e.key,e.seed);e.generated+=m.length,d.putBytes(m),e.key=h(l(e.key,f(e.seed))),e.seed=p(l(e.key,e.seed))}return d.getBytes(u)};function s(u){if(e.pools[0].messageLength>=32)return a(),u();var l=32-e.pools[0].messageLength<<5;e.seedFile(l,function(f,h){if(f)return u(f);e.collect(h),a(),u()})}function o(){if(e.pools[0].messageLength>=32)return a();var u=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(u)),a()}function a(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var u=e.plugin.md.create();u.update(e.keyBytes);for(var l=1,f=0;f<32;++f)e.reseeds%l===0&&(u.update(e.pools[f].digest().getBytes()),e.pools[f].start()),l=l<<1;e.keyBytes=u.digest().getBytes(),u.start(),u.update(e.keyBytes);var h=u.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(h),e.generated=0}function c(u){var l=null,f=Vt.util.globalScope,h=f.crypto||f.msCrypto;h&&h.getRandomValues&&(l=function(v){return h.getRandomValues(v)});var p=Vt.util.createBuffer();if(l)for(;p.length()>16),x+=(y&32767)<<16,x+=y>>15,x=(x&2147483647)+(x>>31),I=x&4294967295;for(var g=0;g<3;++g)b=I>>>(g<<3),b^=Math.floor(Math.random()*256),p.putByte(b&255)}return p.getBytes(u)}return ms?(e.seedFile=function(u,l){ms.randomBytes(u,function(f,h){if(f)return l(f);l(null,h.toString())})},e.seedFileSync=function(u){return ms.randomBytes(u).toString()}):(e.seedFile=function(u,l){try{l(null,c(u))}catch(f){l(f)}},e.seedFileSync=c),e.collect=function(u){for(var l=u.length,f=0;f>h&255);e.collect(f)},e.registerWorker=function(u){if(u===self)e.seedFile=function(f,h){function p(d){var m=d.data;m.forge&&m.forge.prng&&(self.removeEventListener("message",p),h(m.forge.prng.err,m.forge.prng.bytes))}self.addEventListener("message",p),self.postMessage({forge:{prng:{needed:f}}})};else{var l=function(f){var h=f.data;h.forge&&h.forge.prng&&e.seedFile(h.forge.prng.needed,function(p,d){u.postMessage({forge:{prng:{err:p,bytes:d}}})})};u.addEventListener("message",l)}},e}});var yi=V((zv,Ra)=>{var $e=de();Aa();Pf();Nf();Ne();(function(){if($e.random&&$e.random.getBytes){Ra.exports=$e.random;return}(function(t){var e={},r=new Array(4),n=$e.util.createBuffer();e.formatKey=function(f){var h=$e.util.createBuffer(f);return f=new Array(4),f[0]=h.getInt32(),f[1]=h.getInt32(),f[2]=h.getInt32(),f[3]=h.getInt32(),$e.aes._expandKey(f,!1)},e.formatSeed=function(f){var h=$e.util.createBuffer(f);return f=new Array(4),f[0]=h.getInt32(),f[1]=h.getInt32(),f[2]=h.getInt32(),f[3]=h.getInt32(),f},e.cipher=function(f,h){return $e.aes._updateBlock(f,h,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(f){return++f[3],f},e.md=$e.md.sha256;function i(){var f=$e.prng.create(e);return f.getBytes=function(h,p){return f.generate(h,p)},f.getBytesSync=function(h){return f.generate(h)},f}var s=i(),o=null,a=$e.util.globalScope,c=a.crypto||a.msCrypto;if(c&&c.getRandomValues&&(o=function(f){return c.getRandomValues(f)}),$e.options.usePureJavaScript||!$e.util.isNodejs&&!o){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var u="";for(var l in navigator)try{typeof navigator[l]=="string"&&(u+=navigator[l])}catch{}s.collect(u),u=null}t&&(t().mousemove(function(f){s.collectInt(f.clientX,16),s.collectInt(f.clientY,16)}),t().keypress(function(f){s.collectInt(f.charCode,8)}))}if(!$e.random)$e.random=s;else for(var l in s)$e.random[l]=s[l];$e.random.createInstance=i,Ra.exports=$e.random})(typeof jQuery<"u"?jQuery:null)})()});var Uf=V((Hv,Mf)=>{var lt=de();Ne();var Ca=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],kf=[1,2,3,5],Cg=function(t,e){return t<>16-e},Tg=function(t,e){return(t&65535)>>e|t<<16-e&65535};Mf.exports=lt.rc2=lt.rc2||{};lt.rc2.expandKey=function(t,e){typeof t=="string"&&(t=lt.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),i=e,s=Math.ceil(i/8),o=255>>(i&7),a;for(a=n;a<128;a++)r.putByte(Ca[r.at(a-1)+r.at(a-n)&255]);for(r.setAt(128-s,Ca[r.at(128-s)&o]),a=127-s;a>=0;a--)r.setAt(a,Ca[r.at(a+1)^r.at(a+s)]);return r};var Of=function(t,e,r){var n=!1,i=null,s=null,o=null,a,c,u,l,f=[];for(t=lt.rc2.expandKey(t,e),u=0;u<64;u++)f.push(t.getInt16Le());r?(a=function(d){for(u=0;u<4;u++)d[u]+=f[l]+(d[(u+3)%4]&d[(u+2)%4])+(~d[(u+3)%4]&d[(u+1)%4]),d[u]=Cg(d[u],kf[u]),l++},c=function(d){for(u=0;u<4;u++)d[u]+=f[d[(u+3)%4]&63]}):(a=function(d){for(u=3;u>=0;u--)d[u]=Tg(d[u],kf[u]),d[u]-=f[l]+(d[(u+3)%4]&d[(u+2)%4])+(~d[(u+3)%4]&d[(u+1)%4]),l--},c=function(d){for(u=3;u>=0;u--)d[u]-=f[d[(u+3)%4]&63]});var h=function(d){var m=[];for(u=0;u<4;u++){var g=i.getInt16Le();o!==null&&(r?g^=o.getInt16Le():o.putInt16Le(g)),m.push(g&65535)}l=r?0:63;for(var y=0;y=8;)h([[5,a],[1,c],[6,a],[1,c],[5,a]])},finish:function(d){var m=!0;if(r)if(d)m=d(8,i,!r);else{var g=i.length()===8?8:8-i.length();i.fillWithByte(g,g)}if(m&&(n=!0,p.update()),!r&&(m=i.length()===0,m))if(d)m=d(8,s,!r);else{var y=s.length(),x=s.at(y-1);x>y?m=!1:s.truncate(x)}return m}},p};lt.rc2.startEncrypting=function(t,e,r){var n=lt.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};lt.rc2.createEncryptionCipher=function(t,e){return Of(t,e,!0)};lt.rc2.startDecrypting=function(t,e,r){var n=lt.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};lt.rc2.createDecryptionCipher=function(t,e){return Of(t,e,!1)}});var xs=V((Gv,Gf)=>{var Ta=de();Gf.exports=Ta.jsbn=Ta.jsbn||{};var rr,Bg=0xdeadbeefcafe,Ff=(Bg&16777215)==15715070;function C(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}Ta.jsbn.BigInteger=C;function ie(){return new C(null)}function Lg(t,e,r,n,i,s){for(;--s>=0;){var o=e*this.data[t++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=o&67108863}return i}function Pg(t,e,r,n,i,s){for(var o=e&32767,a=e>>15;--s>=0;){var c=this.data[t]&32767,u=this.data[t++]>>15,l=a*c+u*o;c=o*c+((l&32767)<<15)+r.data[n]+(i&1073741823),i=(c>>>30)+(l>>>15)+a*u+(i>>>30),r.data[n++]=c&1073741823}return i}function Kf(t,e,r,n,i,s){for(var o=e&16383,a=e>>14;--s>=0;){var c=this.data[t]&16383,u=this.data[t++]>>14,l=a*c+u*o;c=o*c+((l&16383)<<14)+r.data[n]+i,i=(c>>28)+(l>>14)+a*u,r.data[n++]=c&268435455}return i}typeof navigator>"u"?(C.prototype.am=Kf,rr=28):Ff&&navigator.appName=="Microsoft Internet Explorer"?(C.prototype.am=Pg,rr=30):Ff&&navigator.appName!="Netscape"?(C.prototype.am=Lg,rr=26):(C.prototype.am=Kf,rr=28);C.prototype.DB=rr;C.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function kg(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}function xr(t){var e=ie();return e.fromInt(t),e}function Og(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,i=!1,s=0;--n>=0;){var o=r==8?t[n]&255:Vf(t,n);if(o<0){t.charAt(n)=="-"&&(i=!0);continue}i=!1,s==0?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB)}r==8&&t[0]&128&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}function Ug(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(a>a)>0&&(i=!0,s=qf(n));o>=0;)a>(a+=this.DB-e)):(n=this.data[o]>>(a-=e)&r,a<=0&&(a+=this.DB,--o)),n>0&&(i=!0),i&&(s+=qf(n));return i?s:"0"}function Fg(){var t=ie();return C.ZERO.subTo(this,t),t}function Kg(){return this.s<0?this.negate():this}function qg(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}function ys(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function Vg(){return this.t<=0?0:this.DB*(this.t-1)+ys(this.data[this.t-1]^this.s&this.DM)}function $g(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}function zg(t,e){for(var r=t;r=0;--a)e.data[a+s+1]=this.data[a]>>n|o,o=(this.data[a]&i)<=0;--a)e.data[a]=0;e.data[s]=o,e.t=this.t+s+1,e.s=this.s,e.clamp()}function Gg(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,i=this.DB-n,s=(1<>n;for(var o=r+1;o>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}function Yg(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}function Xg(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var u=s.t,l=s.data[u-1];if(l!=0){var f=l*(1<1?s.data[u-2]>>this.F2:0),h=this.FV/f,p=(1<=0&&(r.data[r.t++]=1,r.subTo(y,r)),C.ONE.dlShiftTo(u,y),y.subTo(s,s);s.t=0;){var x=r.data[--m]==l?this.DM:Math.floor(r.data[m]*h+(r.data[m-1]+d)*p);if((r.data[m]+=s.am(0,x,r,g,0,u))0&&r.rShiftTo(c,r),o<0&&C.ZERO.subTo(r,r)}}}function Zg(t){var e=ie();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(C.ZERO)>0&&t.subTo(e,e),e}function zr(t){this.m=t}function jg(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function Jg(t){return t}function ey(t){t.divRemTo(this.m,null,t)}function ty(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function ry(t,e){t.squareTo(e),this.reduce(e)}zr.prototype.convert=jg;zr.prototype.revert=Jg;zr.prototype.reduce=ey;zr.prototype.mulTo=ty;zr.prototype.sqrTo=ry;function ny(){if(this.t<1)return 0;var t=this.data[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function Hr(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}function sy(t){var e=ie();return t.copyTo(e),this.reduce(e),e}function oy(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function ay(t,e){t.squareTo(e),this.reduce(e)}function cy(t,e,r){t.multiplyTo(e,r),this.reduce(r)}Hr.prototype.convert=iy;Hr.prototype.revert=sy;Hr.prototype.reduce=oy;Hr.prototype.mulTo=cy;Hr.prototype.sqrTo=ay;function uy(){return(this.t>0?this.data[0]&1:this.s)==0}function ly(t,e){if(t>4294967295||t<1)return C.ONE;var r=ie(),n=ie(),i=e.convert(this),s=ys(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,i,r);else{var o=r;r=n,n=o}return e.revert(r)}function fy(t,e){var r;return t<256||e.isEven()?r=new zr(e):r=new Hr(e),this.exp(t,r)}C.prototype.copyTo=Ng;C.prototype.fromInt=kg;C.prototype.fromString=Og;C.prototype.clamp=Mg;C.prototype.dlShiftTo=$g;C.prototype.drShiftTo=zg;C.prototype.lShiftTo=Hg;C.prototype.rShiftTo=Gg;C.prototype.subTo=Wg;C.prototype.multiplyTo=Yg;C.prototype.squareTo=Qg;C.prototype.divRemTo=Xg;C.prototype.invDigit=ny;C.prototype.isEven=uy;C.prototype.exp=ly;C.prototype.toString=Ug;C.prototype.negate=Fg;C.prototype.abs=Kg;C.prototype.compareTo=qg;C.prototype.bitLength=Vg;C.prototype.mod=Zg;C.prototype.modPowInt=fy;C.ZERO=xr(0);C.ONE=xr(1);function hy(){var t=ie();return this.copyTo(t),t}function dy(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}function my(){return this.t==0?this.s:this.data[0]<<16>>16}function gy(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function yy(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function xy(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=xr(r),i=ie(),s=ie(),o="";for(this.divRemTo(n,i,s);i.signum()>0;)o=(r+s.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,s);return s.intValue().toString(t)+o}function by(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,s=0,o=0,a=0;a=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(o,0)),i&&C.ZERO.subTo(this,this)}function wy(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(C.ONE.shiftLeft(t-1),La,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(C.ONE.shiftLeft(t-1),this);else{var n=new Array,i=t&7;n.length=(t>>3)+1,e.nextBytes(n),i>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function vy(t){return this.compareTo(t)==0}function _y(t){return this.compareTo(t)<0?this:t}function Sy(t){return this.compareTo(t)>0?this:t}function Ay(t,e,r){var n,i,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),t&255||(t>>=8,e+=8),t&15||(t>>=4,e+=4),t&3||(t>>=2,e+=2),t&1||++e,e}function ky(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}function zy(t){var e=ie();return this.addTo(t,e),e}function Hy(t){var e=ie();return this.subTo(t,e),e}function Gy(t){var e=ie();return this.multiplyTo(t,e),e}function Wy(t){var e=ie();return this.divRemTo(t,e,null),e}function Yy(t){var e=ie();return this.divRemTo(t,null,e),e}function Qy(t){var e=ie(),r=ie();return this.divRemTo(t,e,r),new Array(e,r)}function Xy(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Zy(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}function xi(){}function Hf(t){return t}function jy(t,e,r){t.multiplyTo(e,r)}function Jy(t,e){t.squareTo(e)}xi.prototype.convert=Hf;xi.prototype.revert=Hf;xi.prototype.mulTo=jy;xi.prototype.sqrTo=Jy;function e1(t){return this.exp(t,new xi)}function t1(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=ie();return t.copyTo(e),this.reduce(e),e}function i1(t){return t}function s1(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function o1(t,e){t.squareTo(e),this.reduce(e)}function a1(t,e,r){t.multiplyTo(e,r),this.reduce(r)}In.prototype.convert=n1;In.prototype.revert=i1;In.prototype.reduce=s1;In.prototype.mulTo=a1;In.prototype.sqrTo=o1;function c1(t,e){var r=t.bitLength(),n,i=xr(1),s;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new zr(e):e.isEven()?s=new In(e):s=new Hr(e);var o=new Array,a=3,c=n-1,u=(1<1){var l=ie();for(s.sqrTo(o[1],l);a<=u;)o[a]=ie(),s.mulTo(l,o[a-2],o[a]),a+=2}var f=t.t-1,h,p=!0,d=ie(),m;for(r=ys(t.data[f])-1;f>=0;){for(r>=c?h=t.data[f]>>r-c&u:(h=(t.data[f]&(1<0&&(h|=t.data[f-1]>>this.DB+r-c)),a=n;!(h&1);)h>>=1,--a;if((r-=a)<0&&(r+=this.DB,--f),p)o[h].copyTo(i),p=!1;else{for(;a>1;)s.sqrTo(i,d),s.sqrTo(d,i),a-=2;a>0?s.sqrTo(i,d):(m=i,i=d,d=m),s.mulTo(d,o[h],i)}for(;f>=0&&!(t.data[f]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function l1(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}function f1(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return C.ZERO;for(var r=t.clone(),n=this.clone(),i=xr(1),s=xr(0),o=xr(0),a=xr(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!i.isEven()||!s.isEven())&&(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!o.isEven()||!a.isEven())&&(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),s.subTo(a,s)):(n.subTo(r,n),e&&o.subTo(i,o),a.subTo(s,a))}if(n.compareTo(C.ONE)!=0)return C.ZERO;if(a.compareTo(t)>=0)return a.subtract(t);if(a.signum()<0)a.addTo(t,a);else return a;return a.signum()<0?a.add(t):a}var Bt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],h1=(1<<26)/Bt[Bt.length-1];function d1(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=Bt[Bt.length-1]){for(e=0;e=0);var a=s.modPow(n,this);if(a.compareTo(C.ONE)!=0&&a.compareTo(e)!=0){for(var c=1;c++{var $t=de();$r();Ne();var Yf=Xf.exports=$t.sha1=$t.sha1||{};$t.md.sha1=$t.md.algorithms.sha1=Yf;Yf.create=function(){Qf||g1();var t=null,e=$t.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),Wf(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=$t.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(Pa.substr(0,n.blockLength-o));for(var a,c,u=n.fullMessageLength[0]*8,l=0;l>>0,u+=c,i.putInt32(u>>>0),u=a>>>0;i.putInt32(u);var f={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};Wf(f,r,i);var h=$t.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h},n};var Pa=null,Qf=!1;function g1(){Pa="\x80",Pa+=$t.util.fillString("\0",64),Qf=!0}function Wf(t,e,r){for(var n,i,s,o,a,c,u,l,f=r.length();f>=64;){for(i=t.h0,s=t.h1,o=t.h2,a=t.h3,c=t.h4,l=0;l<16;++l)n=r.getInt32(),e[l]=n,u=a^s&(o^a),n=(i<<5|i>>>27)+u+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<20;++l)n=e[l-3]^e[l-8]^e[l-14]^e[l-16],n=n<<1|n>>>31,e[l]=n,u=a^s&(o^a),n=(i<<5|i>>>27)+u+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<32;++l)n=e[l-3]^e[l-8]^e[l-14]^e[l-16],n=n<<1|n>>>31,e[l]=n,u=s^o^a,n=(i<<5|i>>>27)+u+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<40;++l)n=e[l-6]^e[l-16]^e[l-28]^e[l-32],n=n<<2|n>>>30,e[l]=n,u=s^o^a,n=(i<<5|i>>>27)+u+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<60;++l)n=e[l-6]^e[l-16]^e[l-28]^e[l-32],n=n<<2|n>>>30,e[l]=n,u=s&o|a&(s^o),n=(i<<5|i>>>27)+u+c+2400959708+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<80;++l)n=e[l-6]^e[l-16]^e[l-28]^e[l-32],n=n<<2|n>>>30,e[l]=n,u=s^o^a,n=(i<<5|i>>>27)+u+c+3395469782+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+s|0,t.h2=t.h2+o|0,t.h3=t.h3+a|0,t.h4=t.h4+c|0,f-=64}}});var e0=V((Yv,Jf)=>{var zt=de();Ne();yi();Zf();var jf=Jf.exports=zt.pkcs1=zt.pkcs1||{};jf.encode_rsa_oaep=function(t,e,r){var n,i,s,o;typeof r=="string"?(n=r,i=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),s?s.start():s=zt.md.sha1.create(),o||(o=s);var a=Math.ceil(t.n.bitLength()/8),c=a-2*s.digestLength-2;if(e.length>c){var u=new Error("RSAES-OAEP input message length is too long.");throw u.length=e.length,u.maxLength=c,u}n||(n=""),s.update(n,"raw");for(var l=s.digest(),f="",h=c-e.length,p=0;p>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+o),n+=r.digest().getBytes()}return n.substring(0,e)}});var t0=V((Qv,Da)=>{var br=de();Ne();xs();yi();(function(){if(br.prime){Da.exports=br.prime;return}var t=Da.exports=br.prime=br.prime||{},e=br.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var i=function(f,h){return f|h};t.generateProbablePrime=function(f,h,p){typeof h=="function"&&(p=h,h={}),h=h||{};var d=h.algorithm||"PRIMEINC";typeof d=="string"&&(d={name:d}),d.options=d.options||{};var m=h.prng||br.random,g={nextBytes:function(y){for(var x=m.getBytesSync(y.length),b=0;bh&&(f=u(h,p)),f.isProbablePrime(m))return y(null,f);f.dAddOffset(r[d++%8],0)}while(g<0||+new Date-x"u")return o(f,h,p,d);var m=u(f,h),g=p.workers,y=p.workLoad||100,x=y*30/8,b=p.workerScript||"forge/prime.worker.js";if(g===-1)return br.util.estimateCores(function(v,_){v&&(_=2),g=_-1,I()});I();function I(){g=Math.max(1,g);for(var v=[],_=0;_f&&(m=u(f,h));var he=m.toString(16);W.target.postMessage({hex:he,workLoad:y}),m.dAddOffset(x,0)}}}}function u(f,h){var p=new e(f,h),d=f-1;return p.testBit(d)||p.bitwiseTo(e.ONE.shiftLeft(d),i,p),p.dAddOffset(31-p.mod(n).byteValue(),0),p}function l(f){return f<=100?27:f<=150?18:f<=200?15:f<=250?12:f<=300?9:f<=350?8:f<=400?7:f<=500?6:f<=600?5:f<=800?4:f<=1250?3:2}})()});var Es=V((Xv,c0)=>{var $=de();mi();xs();os();e0();t0();yi();Ne();typeof ne>"u"&&(ne=$.jsbn.BigInteger);var ne,Na=$.util.isNodejs?gi():null,E=$.asn1,At=$.util;$.pki=$.pki||{};c0.exports=$.pki.rsa=$.rsa=$.rsa||{};var Y=$.pki,y1=[6,4,2,4,2,4,6,2],x1={name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},b1={name:"RSAPrivateKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},w1={name:"RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},E1=$.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},v1={name:"DigestInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:E.Class.UNIVERSAL,type:E.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},_1=function(t){var e;if(t.algorithm in Y.oids)e=Y.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=E.oidToDer(e).getBytes(),i=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]),s=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]);s.value.push(E.create(E.Class.UNIVERSAL,E.Type.OID,!1,n)),s.value.push(E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,""));var o=E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(s),i.value.push(o),E.toDer(i).getBytes()},o0=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(ne.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(ne.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new ne($.util.bytesToHex($.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(ne.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var i=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(s)<0;)i=i.add(e.p);var o=i.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return o=o.multiply(n.modInverse(e.n)).mod(e.n),o};Y.rsa.encrypt=function(t,e,r){var n=r,i,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=a0(t,e,r)):(i=$.util.createBuffer(),i.putBytes(t));for(var o=new ne(i.toHex(),16),a=o0(o,e,n),c=a.toString(16),u=$.util.createBuffer(),l=s-Math.ceil(c.length/2);l>0;)u.putByte(0),--l;return u.putBytes($.util.hexToBytes(c)),u.getBytes()};Y.rsa.decrypt=function(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=i,s}var o=new ne($.util.createBuffer(t).toHex(),16);if(o.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var a=o0(o,e,r),c=a.toString(16),u=$.util.createBuffer(),l=i-Math.ceil(c.length/2);l>0;)u.putByte(0),--l;return u.putBytes($.util.hexToBytes(c)),n!==!1?ws(u.getBytes(),e,r):u.getBytes()};Y.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||$.random,i={nextBytes:function(a){for(var c=n.getBytesSync(a.length),u=0;u>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+s);return o};Y.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new ne(null);r.fromInt(30);for(var n=0,i=function(f,h){return f|h},s=+new Date,o,a=0;t.keys===null&&(e<=0||ac?t.pqState=0:t.num.isProbablePrime(A1(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(y1[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(ne.ONE).gcd(t.e).compareTo(ne.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(ne.ONE),t.q1=t.q.subtract(ne.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(ne.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var l=t.e.modInverse(t.phi);t.keys={privateKey:Y.rsa.setPrivateKey(t.n,t.e,l,t.p,t.q,l.mod(t.p1),l.mod(t.q1),t.q.modInverse(t.p)),publicKey:Y.rsa.setPublicKey(t.n,t.e)}}o=+new Date,a+=o-s,s=o}return t.keys!==null};Y.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!$.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(r0("generateKeyPair"))return Na.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(a,c,u){if(a)return n(a);n(null,{privateKey:Y.privateKeyFromPem(u),publicKey:Y.publicKeyFromPem(c)})});if(n0("generateKey")&&n0("exportKey"))return At.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:s0(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(a){return At.globalScope.crypto.subtle.exportKey("pkcs8",a.privateKey)}).then(void 0,function(a){n(a)}).then(function(a){if(a){var c=Y.privateKeyFromAsn1(E.fromDer($.util.createBuffer(a)));n(null,{privateKey:c,publicKey:Y.setRsaPublicKey(c.n,c.e)})}});if(i0("generateKey")&&i0("exportKey")){var i=At.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:s0(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(a){var c=a.target.result,u=At.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);u.oncomplete=function(l){var f=l.target.result,h=Y.privateKeyFromAsn1(E.fromDer($.util.createBuffer(f)));n(null,{privateKey:h,publicKey:Y.setRsaPublicKey(h.n,h.e)})},u.onerror=function(l){n(l)}},i.onerror=function(a){n(a)};return}}else if(r0("generateKeyPairSync")){var s=Na.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Y.privateKeyFromPem(s.privateKey),publicKey:Y.publicKeyFromPem(s.publicKey)}}}var o=Y.rsa.createKeyPairGenerationState(t,e,r);if(!n)return Y.rsa.stepKeyPairGenerationState(o,0),o.keys;S1(o,r,n)};Y.setRsaPublicKey=Y.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,i,s){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(a,c,u){return a0(a,c,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(a,c){return $.pkcs1.encode_rsa_oaep(c,a,s)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(a){return a}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(n,r,!0);return Y.rsa.encrypt(o,r,!0)},r.verify=function(n,i,s,o){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),s==="RSASSA-PKCS1-V1_5"?s={verify:function(c,u){u=ws(u,r,!0);var l=E.fromDer(u,{parseAllBytes:o._parseAllDigestBytes}),f={},h=[];if(!E.validate(l,v1,f,h)){var p=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw p.errors=h,p}var d=E.derToOid(f.algorithmIdentifier);if(!(d===$.oids.md2||d===$.oids.md5||d===$.oids.sha1||d===$.oids.sha224||d===$.oids.sha256||d===$.oids.sha384||d===$.oids.sha512||d===$.oids["sha512-224"]||d===$.oids["sha512-256"])){var p=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw p.oid=d,p}if((d===$.oids.md2||d===$.oids.md5)&&!("parameters"in f))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return c===f.digest}}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:function(c,u){return u=ws(u,r,!0),c===u}});var a=Y.rsa.decrypt(i,r,!0,!1);return s.verify(n,a,r.n.bitLength())},r};Y.setRsaPrivateKey=Y.rsa.setPrivateKey=function(t,e,r,n,i,s,o,a){var c={n:t,e,d:r,p:n,q:i,dP:s,dQ:o,qInv:a};return c.decrypt=function(u,l,f){typeof l=="string"?l=l.toUpperCase():l===void 0&&(l="RSAES-PKCS1-V1_5");var h=Y.rsa.decrypt(u,c,!1,!1);if(l==="RSAES-PKCS1-V1_5")l={decode:ws};else if(l==="RSA-OAEP"||l==="RSAES-OAEP")l={decode:function(p,d){return $.pkcs1.decode_rsa_oaep(d,p,f)}};else if(["RAW","NONE","NULL",null].indexOf(l)!==-1)l={decode:function(p){return p}};else throw new Error('Unsupported encryption scheme: "'+l+'".');return l.decode(h,c,!1)},c.sign=function(u,l){var f=!1;typeof l=="string"&&(l=l.toUpperCase()),l===void 0||l==="RSASSA-PKCS1-V1_5"?(l={encode:_1},f=1):(l==="NONE"||l==="NULL"||l===null)&&(l={encode:function(){return u}},f=1);var h=l.encode(u,c.n.bitLength());return Y.rsa.encrypt(h,c,f)},c};Y.wrapRsaPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Y.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,E.toDer(t).getBytes())])};Y.privateKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,x1,e,r)&&(t=E.fromDer($.util.createBuffer(e.privateKey))),e={},r=[],!E.validate(t,b1,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,s,o,a,c,u,l,f;return i=$.util.createBuffer(e.privateKeyModulus).toHex(),s=$.util.createBuffer(e.privateKeyPublicExponent).toHex(),o=$.util.createBuffer(e.privateKeyPrivateExponent).toHex(),a=$.util.createBuffer(e.privateKeyPrime1).toHex(),c=$.util.createBuffer(e.privateKeyPrime2).toHex(),u=$.util.createBuffer(e.privateKeyExponent1).toHex(),l=$.util.createBuffer(e.privateKeyExponent2).toHex(),f=$.util.createBuffer(e.privateKeyCoefficient).toHex(),Y.setRsaPrivateKey(new ne(i,16),new ne(s,16),new ne(o,16),new ne(a,16),new ne(c,16),new ne(u,16),new ne(l,16),new ne(f,16))};Y.privateKeyToAsn1=Y.privateKeyToRSAPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.e)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.d)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.p)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.q)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.dP)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.dQ)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.qInv))])};Y.publicKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,E1,e,r)){var n=E.derToOid(e.publicKeyOid);if(n!==Y.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}t=e.rsaPublicKey}if(r=[],!E.validate(t,w1,e,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var s=$.util.createBuffer(e.publicKeyModulus).toHex(),o=$.util.createBuffer(e.publicKeyExponent).toHex();return Y.setRsaPublicKey(new ne(s,16),new ne(o,16))};Y.publicKeyToAsn1=Y.publicKeyToSubjectPublicKeyInfo=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Y.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.BITSTRING,!1,[Y.publicKeyToRSAPublicKey(t)])])};Y.publicKeyToRSAPublicKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.e))])};function a0(t,e,r){var n=$.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=i-11,s}n.putByte(0),n.putByte(r);var o=i-3-t.length,a;if(r===0||r===1){a=r===0?0:255;for(var c=0;c0;){for(var u=0,l=$.random.getBytes(o),c=0;c"u")throw new Error("Encryption block is invalid.");var c=0;if(a===0){c=i-3-n;for(var u=0;u1;){if(s.getByte()!==255){--s.read;break}++c}else if(a===2)for(c=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++c}var l=s.getByte();if(l!==0||c!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function S1(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),i();function i(){s(t.pBits,function(a,c){if(a)return r(a);if(t.p=c,t.q!==null)return o(a,t.q);s(t.qBits,o)})}function s(a,c){$.prime.generateProbablePrime(a,n,c)}function o(a,c){if(a)return r(a);if(t.q=c,t.p.compareTo(t.q)<0){var u=t.p;t.p=t.q,t.q=u}if(t.p.subtract(ne.ONE).gcd(t.e).compareTo(ne.ONE)!==0){t.p=null,i();return}if(t.q.subtract(ne.ONE).gcd(t.e).compareTo(ne.ONE)!==0){t.q=null,s(t.qBits,o);return}if(t.p1=t.p.subtract(ne.ONE),t.q1=t.q.subtract(ne.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(ne.ONE)!==0){t.p=t.q=null,i();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,o);return}var l=t.e.modInverse(t.phi);t.keys={privateKey:Y.rsa.setPrivateKey(t.n,t.e,l,t.p,t.q,l.mod(t.p1),l.mod(t.q1),t.q.modInverse(t.p)),publicKey:Y.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function Ht(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=$.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function A1(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function r0(t){return $.util.isNodejs&&typeof Na[t]=="function"}function n0(t){return typeof At.globalScope<"u"&&typeof At.globalScope.crypto=="object"&&typeof At.globalScope.crypto.subtle=="object"&&typeof At.globalScope.crypto.subtle[t]=="function"}function i0(t){return typeof At.globalScope<"u"&&typeof At.globalScope.msCrypto=="object"&&typeof At.globalScope.msCrypto.subtle=="object"&&typeof At.globalScope.msCrypto.subtle[t]=="function"}function s0(t){for(var e=$.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{var M=de();Aa();mi();xf();$r();os();_f();If();yi();Uf();Es();Ne();typeof u0>"u"&&(u0=M.jsbn.BigInteger);var u0,A=M.asn1,X=M.pki=M.pki||{};d0.exports=X.pbe=M.pbe=M.pbe||{};var Gr=X.oids,I1={name:"EncryptedPrivateKeyInfo",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},R1={name:"PBES2Algorithms",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},C1={name:"pkcs-12PbeParams",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,capture:"iterations"}]};X.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=M.random.getBytesSync(r.saltSize),i=r.count,s=A.integerToDer(i),o,a,c;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var u,l,f;switch(r.algorithm){case"aes128":o=16,u=16,l=Gr["aes128-CBC"],f=M.aes.createEncryptionCipher;break;case"aes192":o=24,u=16,l=Gr["aes192-CBC"],f=M.aes.createEncryptionCipher;break;case"aes256":o=32,u=16,l=Gr["aes256-CBC"],f=M.aes.createEncryptionCipher;break;case"des":o=8,u=8,l=Gr.desCBC,f=M.des.createEncryptionCipher;break;default:var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=r.algorithm,h}var p="hmacWith"+r.prfAlgorithm.toUpperCase(),d=h0(p),m=M.pkcs5.pbkdf2(e,n,i,o,d),g=M.random.getBytesSync(u),y=f(m);y.start(g),y.update(A.toDer(t)),y.finish(),c=y.output.getBytes();var x=T1(n,s,o,p);a=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(Gr.pkcs5PBES2).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(Gr.pkcs5PBKDF2).getBytes()),x]),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(l).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,g)])])])}else if(r.algorithm==="3des"){o=24;var b=new M.util.ByteBuffer(n),m=X.pbe.generatePkcs12Key(e,b,1,i,o),g=X.pbe.generatePkcs12Key(e,b,2,i,o),y=M.des.createEncryptionCipher(m);y.start(g),y.update(A.toDer(t)),y.finish(),c=y.output.getBytes(),a=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(Gr["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,n),A.create(A.Class.UNIVERSAL,A.Type.INTEGER,!1,s.getBytes())])])}else{var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=r.algorithm,h}var I=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[a,A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,c)]);return I};X.decryptPrivateKeyInfo=function(t,e){var r=null,n={},i=[];if(!A.validate(t,I1,n,i)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=A.derToOid(n.encryptionOid),a=X.pbe.getCipher(o,n.encryptionParams,e),c=M.util.createBuffer(n.encryptedData);return a.update(c),a.finish()&&(r=A.fromDer(a.output)),r};X.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:A.toDer(t).getBytes()};return M.pem.encode(r,{maxline:e})};X.encryptedPrivateKeyFromPem=function(t){var e=M.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return A.fromDer(e.body)};X.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=X.wrapRsaPrivateKey(X.privateKeyToAsn1(t));return n=X.encryptPrivateKeyInfo(n,e,r),X.encryptedPrivateKeyToPem(n)}var i,s,o,a;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,s=M.random.getBytesSync(16),a=M.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,s=M.random.getBytesSync(16),a=M.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,s=M.random.getBytesSync(16),a=M.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,s=M.random.getBytesSync(8),a=M.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,s=M.random.getBytesSync(8),a=M.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var u=M.pbe.opensslDeriveBytes(e,s.substr(0,8),o),l=a(u);l.start(s),l.update(A.toDer(X.privateKeyToAsn1(t))),l.finish();var f={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:M.util.bytesToHex(s).toUpperCase()},body:l.output.getBytes()};return M.pem.encode(f)};X.decryptRsaPrivateKey=function(t,e){var r=null,n=M.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,o;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,o=M.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,o=M.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,o=M.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,o=M.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,o=M.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,o=function(f){return M.rc2.createDecryptionCipher(f,40)};break;case"RC2-64-CBC":s=8,o=function(f){return M.rc2.createDecryptionCipher(f,64)};break;case"RC2-128-CBC":s=16,o=function(f){return M.rc2.createDecryptionCipher(f,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var a=M.util.hexToBytes(n.dekInfo.parameters),c=M.pbe.opensslDeriveBytes(e,a.substr(0,8),s),u=o(c);if(u.start(a),u.update(M.util.createBuffer(n.body)),u.finish())r=u.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=X.decryptPrivateKeyInfo(A.fromDer(r),e):r=A.fromDer(r),r!==null&&(r=X.privateKeyFromAsn1(r)),r};X.pbe.generatePkcs12Key=function(t,e,r,n,i,s){var o,a;if(typeof s>"u"||s===null){if(!("sha1"in M.md))throw new Error('"sha1" hash algorithm unavailable.');s=M.md.sha1.create()}var c=s.digestLength,u=s.blockLength,l=new M.util.ByteBuffer,f=new M.util.ByteBuffer;if(t!=null){for(a=0;a=0;a--)ee=ee>>8,ee+=D.at(a)+z.at(a),z.setAt(a,ee&255);W.putBuffer(z)}b=W,l.putBuffer(_)}return l.truncate(l.length()-i),l};X.pbe.getCipher=function(t,e,r){switch(t){case X.oids.pkcs5PBES2:return X.pbe.getCipherForPBES2(t,e,r);case X.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case X.oids["pbewithSHAAnd40BitRC2-CBC"]:return X.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};X.pbe.getCipherForPBES2=function(t,e,r){var n={},i=[];if(!A.validate(e,R1,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}if(t=A.derToOid(n.kdfOid),t!==X.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=A.derToOid(n.encOid),t!==X.oids["aes128-CBC"]&&t!==X.oids["aes192-CBC"]&&t!==X.oids["aes256-CBC"]&&t!==X.oids["des-EDE3-CBC"]&&t!==X.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var o=n.kdfSalt,a=M.util.createBuffer(n.kdfIterationCount);a=a.getInt(a.length()<<3);var c,u;switch(X.oids[t]){case"aes128-CBC":c=16,u=M.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,u=M.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,u=M.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,u=M.des.createDecryptionCipher;break;case"desCBC":c=8,u=M.des.createDecryptionCipher;break}var l=f0(n.prfOid),f=M.pkcs5.pbkdf2(r,o,a,c,l),h=n.encIv,p=u(f);return p.start(h),p};X.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},i=[];if(!A.validate(e,C1,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=M.util.createBuffer(n.salt),a=M.util.createBuffer(n.iterations);a=a.getInt(a.length()<<3);var c,u,l;switch(t){case X.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,u=8,l=M.des.startDecrypting;break;case X.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,u=8,l=function(m,g){var y=M.rc2.createDecryptionCipher(m,40);return y.start(g,null),y};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var f=f0(n.prfOid),h=X.pbe.generatePkcs12Key(r,o,1,a,c,f);f.start();var p=X.pbe.generatePkcs12Key(r,o,2,a,u,f);return l(h,p)};X.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in M.md))throw new Error('"md5" hash algorithm unavailable.');n=M.md.md5.create()}e===null&&(e="");for(var i=[l0(n,t+e)],s=16,o=1;s{var ye=de();$r();Ne();var Ti=wh.exports=ye.sha512=ye.sha512||{};ye.md.sha512=ye.md.algorithms.sha512=Ti;var xh=ye.sha384=ye.sha512.sha384=ye.sha512.sha384||{};xh.create=function(){return Ti.create("SHA-384")};ye.md.sha384=ye.md.algorithms.sha384=xh;ye.sha512.sha256=ye.sha512.sha256||{create:function(){return Ti.create("SHA-512/256")}};ye.md["sha512/256"]=ye.md.algorithms["sha512/256"]=ye.sha512.sha256;ye.sha512.sha224=ye.sha512.sha224||{create:function(){return Ti.create("SHA-512/224")}};ye.md["sha512/224"]=ye.md.algorithms["sha512/224"]=ye.sha512.sha224;Ti.create=function(t){if(bh||j2(),typeof t>"u"&&(t="SHA-512"),!(t in rn))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=rn[t],r=null,n=ye.util.createBuffer(),i=new Array(80),s=0;s<80;++s)i[s]=new Array(2);var o=64;switch(t){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var a={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength128=[];for(var c=a.messageLengthSize/4,u=0;u>>0,l>>>0];for(var f=a.fullMessageLength.length-1;f>=0;--f)a.fullMessageLength[f]+=l[1],l[1]=l[0]+(a.fullMessageLength[f]/4294967296>>>0),a.fullMessageLength[f]=a.fullMessageLength[f]>>>0,l[0]=l[1]/4294967296>>>0;return n.putBytes(c),yh(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),a},a.digest=function(){var c=ye.util.createBuffer();c.putBytes(n.bytes());var u=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize,l=u&a.blockLength-1;c.putBytes(kc.substr(0,a.blockLength-l));for(var f,h,p=a.fullMessageLength[0]*8,d=0;d>>0,p+=h,c.putInt32(p>>>0),p=f>>>0;c.putInt32(p);for(var m=new Array(r.length),d=0;d=128;){for(T=0;T<16;++T)e[T][0]=r.getInt32()>>>0,e[T][1]=r.getInt32()>>>0;for(;T<80;++T)N=e[T-2],k=N[0],L=N[1],n=((k>>>19|L<<13)^(L>>>29|k<<3)^k>>>6)>>>0,i=((k<<13|L>>>19)^(L<<3|k>>>29)^(k<<26|L>>>6))>>>0,U=e[T-15],k=U[0],L=U[1],s=((k>>>1|L<<31)^(k>>>8|L<<24)^k>>>7)>>>0,o=((k<<31|L>>>1)^(k<<24|L>>>8)^(k<<25|L>>>7))>>>0,R=e[T-7],q=e[T-16],L=i+R[1]+o+q[1],e[T][0]=n+R[0]+s+q[0]+(L/4294967296>>>0)>>>0,e[T][1]=L>>>0;for(m=t[0][0],g=t[0][1],y=t[1][0],x=t[1][1],b=t[2][0],I=t[2][1],v=t[3][0],_=t[3][1],P=t[4][0],D=t[4][1],G=t[5][0],W=t[5][1],z=t[6][0],ee=t[6][1],he=t[7][0],He=t[7][1],T=0;T<80;++T)u=((P>>>14|D<<18)^(P>>>18|D<<14)^(D>>>9|P<<23))>>>0,l=((P<<18|D>>>14)^(P<<14|D>>>18)^(D<<23|P>>>9))>>>0,f=(z^P&(G^z))>>>0,h=(ee^D&(W^ee))>>>0,a=((m>>>28|g<<4)^(g>>>2|m<<30)^(g>>>7|m<<25))>>>0,c=((m<<4|g>>>28)^(g<<30|m>>>2)^(g<<25|m>>>7))>>>0,p=(m&y|b&(m^y))>>>0,d=(g&x|I&(g^x))>>>0,L=He+l+h+Oc[T][1]+e[T][1],n=he+u+f+Oc[T][0]+e[T][0]+(L/4294967296>>>0)>>>0,i=L>>>0,L=c+d,s=a+p+(L/4294967296>>>0)>>>0,o=L>>>0,he=z,He=ee,z=G,ee=W,G=P,W=D,L=_+i,P=v+n+(L/4294967296>>>0)>>>0,D=L>>>0,v=b,_=I,b=y,I=x,y=m,x=g,L=i+o,m=n+s+(L/4294967296>>>0)>>>0,g=L>>>0;L=t[0][1]+g,t[0][0]=t[0][0]+m+(L/4294967296>>>0)>>>0,t[0][1]=L>>>0,L=t[1][1]+x,t[1][0]=t[1][0]+y+(L/4294967296>>>0)>>>0,t[1][1]=L>>>0,L=t[2][1]+I,t[2][0]=t[2][0]+b+(L/4294967296>>>0)>>>0,t[2][1]=L>>>0,L=t[3][1]+_,t[3][0]=t[3][0]+v+(L/4294967296>>>0)>>>0,t[3][1]=L>>>0,L=t[4][1]+D,t[4][0]=t[4][0]+P+(L/4294967296>>>0)>>>0,t[4][1]=L>>>0,L=t[5][1]+W,t[5][0]=t[5][0]+G+(L/4294967296>>>0)>>>0,t[5][1]=L>>>0,L=t[6][1]+ee,t[6][0]=t[6][0]+z+(L/4294967296>>>0)>>>0,t[6][1]=L>>>0,L=t[7][1]+He,t[7][0]=t[7][0]+he+(L/4294967296>>>0)>>>0,t[7][1]=L>>>0,H-=128}}});var eu=V((g4,Yh)=>{var $n=1e3,zn=$n*60,Hn=zn*60,on=Hn*24,Ab=on*7,Ib=on*365.25;Yh.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Rb(t);if(r==="number"&&isFinite(t))return e.long?Tb(t):Cb(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Rb(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Ib;case"weeks":case"week":case"w":return r*Ab;case"days":case"day":case"d":return r*on;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Hn;case"minutes":case"minute":case"mins":case"min":case"m":return r*zn;case"seconds":case"second":case"secs":case"sec":case"s":return r*$n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Cb(t){var e=Math.abs(t);return e>=on?Math.round(t/on)+"d":e>=Hn?Math.round(t/Hn)+"h":e>=zn?Math.round(t/zn)+"m":e>=$n?Math.round(t/$n)+"s":t+"ms"}function Tb(t){var e=Math.abs(t);return e>=on?Hs(t,e,on,"day"):e>=Hn?Hs(t,e,Hn,"hour"):e>=zn?Hs(t,e,zn,"minute"):e>=$n?Hs(t,e,$n,"second"):t+" ms"}function Hs(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var Xh=V((y4,Qh)=>{function Bb(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=eu(),r.destroy=u,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h{if(_==="%%")return"%";I++;let D=r.formatters[P];if(typeof D=="function"){let G=g[I];_=D.call(y,G),g.splice(I,1),I--}return _}),r.formatArgs.call(y,g),(y.log||r.log).apply(y,g)}return m.namespace=l,m.useColors=r.useColors(),m.color=r.selectColor(l),m.extend=n,m.destroy=r.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(p!==r.namespaces&&(p=r.namespaces,d=r.enabled(l)),d),set:g=>{h=g}}),typeof r.init=="function"&&r.init(m),m}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),p=h.length;for(f=0;f"-"+f)].join(",");return r.enable(""),l}function o(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f{xt.formatArgs=Pb;xt.save=Db;xt.load=Nb;xt.useColors=Lb;xt.storage=kb();xt.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();xt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Lb(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Pb(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Gs.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}xt.log=console.debug||console.log||(()=>{});function Db(t){try{t?xt.storage.setItem("debug",t):xt.storage.removeItem("debug")}catch{}}function Nb(){let t;try{t=xt.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function kb(){try{return localStorage}catch{}}Gs.exports=Xh()(xt);var{formatters:Ob}=Gs.exports;Ob.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var vd=V((J8,_u)=>{"use strict";var yw=Object.prototype.hasOwnProperty,ct="~";function qi(){}Object.create&&(qi.prototype=Object.create(null),new qi().__proto__||(ct=!1));function xw(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function Ed(t,e,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var s=new xw(r,n||t,i),o=ct?ct+e:e;return t._events[o]?t._events[o].fn?t._events[o]=[t._events[o],s]:t._events[o].push(s):(t._events[o]=s,t._eventsCount++),t}function no(t,e){--t._eventsCount===0?t._events=new qi:delete t._events[e]}function st(){this._events=new qi,this._eventsCount=0}st.prototype.eventNames=function(){var e=[],r,n;if(this._eventsCount===0)return e;for(n in r=this._events)yw.call(r,n)&&e.push(ct?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};st.prototype.listeners=function(e){var r=ct?ct+e:e,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i{"use strict";function Vd(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function kw(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return Vd(t,r)}catch{r.message=t.message,r.stack=t.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(t)),Vd(new i,r)}}$d.exports=kw});var Qd=V(Yi=>{(function(){var t,e,r,n,i,s,o,a;a=function(c){var u,l,f,h;return u=(c&255<<24)>>>24,l=(c&255<<16)>>>16,f=(c&65280)>>>8,h=c&255,[u,l,f,h].join(".")},o=function(c){var u,l,f,h,p,d;for(u=[],f=h=0;h<=3&&c.length!==0;f=++h){if(f>0){if(c[0]!==".")throw new Error("Invalid IP");c=c.substring(1)}d=e(c),p=d[0],l=d[1],c=c.substring(l),u.push(p)}if(c.length!==0)throw new Error("Invalid IP");switch(u.length){case 1:if(u[0]>4294967295)throw new Error("Invalid IP");return u[0]>>>0;case 2:if(u[0]>255||u[1]>16777215)throw new Error("Invalid IP");return(u[0]<<24|u[1])>>>0;case 3:if(u[0]>255||u[1]>255||u[2]>65535)throw new Error("Invalid IP");return(u[0]<<24|u[1]<<16|u[2])>>>0;case 4:if(u[0]>255||u[1]>255||u[2]>255||u[3]>255)throw new Error("Invalid IP");return(u[0]<<24|u[1]<<16|u[2]<<8|u[3])>>>0;default:throw new Error("Invalid IP")}},r=function(c){return c.charCodeAt(0)},n=r("0"),s=r("a"),i=r("A"),e=function(c){var u,l,f,h,p;for(h=0,u=10,l="9",f=0,c.length>1&&c[f]==="0"&&(c[f+1]==="x"||c[f+1]==="X"?(f+=2,u=16):"0"<=c[f+1]&&c[f+1]<="9"&&(f++,u=8,l="7")),p=f;f>>0;else if(u===16)if("a"<=c[f]&&c[f]<="f")h=h*u+(10+r(c[f])-s)>>>0;else if("A"<=c[f]&&c[f]<="F")h=h*u+(10+r(c[f])-i)>>>0;else break;else break;if(h>4294967295)throw new Error("too large");f++}if(f===p)throw new Error("empty octet");return[h,f]},t=function(){function c(u,l){var f,h,p,d;if(typeof u!="string")throw new Error("Missing `net' parameter");if(l||(d=u.split("/",2),u=d[0],l=d[1]),l||(l=32),typeof l=="string"&&l.indexOf(".")>-1){try{this.maskLong=o(l)}catch(m){throw f=m,new Error("Invalid mask: "+l)}for(h=p=32;p>=0;h=--p)if(this.maskLong===4294967295<<32-h>>>0){this.bitmask=h;break}}else if(l||l===0)this.bitmask=parseInt(l,10),this.maskLong=0,this.bitmask>0&&(this.maskLong=4294967295<<32-this.bitmask>>>0);else throw new Error("Invalid mask: empty");try{this.netLong=(o(u)&this.maskLong)>>>0}catch(m){throw f=m,new Error("Invalid net address: "+u)}if(!(this.bitmask<=32))throw new Error("Invalid mask for ip4: "+l);this.size=Math.pow(2,32-this.bitmask),this.base=a(this.netLong),this.mask=a(this.maskLong),this.hostmask=a(~this.maskLong),this.first=this.bitmask<=30?a(this.netLong+1):this.base,this.last=this.bitmask<=30?a(this.netLong+this.size-2):a(this.netLong+this.size-1),this.broadcast=this.bitmask<=30?a(this.netLong+this.size-1):void 0}return c.prototype.contains=function(u){return typeof u=="string"&&(u.indexOf("/")>0||u.split(".").length!==4)&&(u=new c(u)),u instanceof c?this.contains(u.base)&&this.contains(u.broadcast||u.last):(o(u)&this.maskLong)>>>0===(this.netLong&this.maskLong)>>>0},c.prototype.next=function(u){return u==null&&(u=1),new c(a(this.netLong+this.size*u),this.mask)},c.prototype.forEach=function(u){var l,f,h;for(h=o(this.first),f=o(this.last),l=0;h<=f;)u(a(h),h,l),l++,h++},c.prototype.toString=function(){return this.base+"/"+this.bitmask},c}(),Yi.ip2long=o,Yi.long2ip=a,Yi.Netmask=t}).call(Yi)});var Jd=V((jd,Ro)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",o="(?:[0-9a-f]+::?)+",a={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${o})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${o})|(?:::)(?:${o})?)${e}\\.${e}\\.${e}\\.${e}(${s})?$`,"i")};function c(p,d){if(p.indexOf("::")!==p.lastIndexOf("::"))return null;let m=0,g=-1,y=(p.match(a.zoneIndex)||[])[0],x,b;for(y&&(y=y.substring(1),p=p.replace(/%.+$/,""));(g=p.indexOf(":",g+1))>=0;)m++;if(p.substr(0,2)==="::"&&m--,p.substr(-2,2)==="::"&&m--,m>d)return null;for(b=d-m,x=":";b--;)x+="0:";return p=p.replace("::",x),p[0]===":"&&(p=p.slice(1)),p[p.length-1]===":"&&(p=p.slice(0,-1)),d=function(){let I=p.split(":"),v=[];for(let _=0;_0;){if(x=m-g,x<0&&(x=0),p[y]>>x!==d[y]>>x)return!1;g-=m,y+=1}return!0}function l(p){if(i.test(p))return parseInt(p,16);if(p[0]==="0"&&!isNaN(parseInt(p[1],10))){if(n.test(p))return parseInt(p,8);throw new Error(`ipaddr: cannot parse ${p} as octal`)}return parseInt(p,10)}function f(p,d){for(;p.length=0;y-=1)if(x=this.octets[y],x in g){if(b=g[x],m&&b!==0)return null;b!==8&&(m=!0),d+=b}else return null;return 32-d},p.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){return this.octets.slice(0)},p.prototype.toIPv4MappedAddress=function(){return h.IPv6.parse(`::ffff:${this.toString()}`)},p.prototype.toNormalizedString=function(){return this.toString()},p.prototype.toString=function(){return this.octets.join(".")},p}(),h.IPv4.broadcastAddressFromCIDR=function(p){try{let d=this.parseCIDR(p),m=d[0].toByteArray(),g=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),y=[],x=0;for(;x<4;)y.push(parseInt(m[x],10)|parseInt(g[x],10)^255),x++;return new this(y)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.isIPv4=function(p){return this.parser(p)!==null},h.IPv4.isValid=function(p){try{return new this(this.parser(p)),!0}catch{return!1}},h.IPv4.isValidFourPartDecimal=function(p){return!!(h.IPv4.isValid(p)&&p.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},h.IPv4.networkAddressFromCIDR=function(p){let d,m,g,y,x;try{for(d=this.parseCIDR(p),g=d[0].toByteArray(),x=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),y=[],m=0;m<4;)y.push(parseInt(g[m],10)&parseInt(x[m],10)),m++;return new this(y)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.parse=function(p){let d=this.parser(p);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},h.IPv4.parseCIDR=function(p){let d;if(d=p.match(/^(.+)\/(\d+)$/)){let m=parseInt(d[2]);if(m>=0&&m<=32){let g=[this.parse(d[1]),m];return Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},h.IPv4.parser=function(p){let d,m,g;if(d=p.match(r.fourOctet))return function(){let y=d.slice(1,6),x=[];for(let b=0;b4294967295||g<0)throw new Error("ipaddr: address outside defined range");return function(){let y=[],x;for(x=0;x<=24;x+=8)y.push(g>>x&255);return y}().reverse()}else return(d=p.match(r.twoOctet))?function(){let y=d.slice(1,4),x=[];if(g=l(y[1]),g>16777215||g<0)throw new Error("ipaddr: address outside defined range");return x.push(l(y[0])),x.push(g>>16&255),x.push(g>>8&255),x.push(g&255),x}():(d=p.match(r.threeOctet))?function(){let y=d.slice(1,5),x=[];if(g=l(y[2]),g>65535||g<0)throw new Error("ipaddr: address outside defined range");return x.push(l(y[0])),x.push(l(y[1])),x.push(g>>8&255),x.push(g&255),x}():null},h.IPv4.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],m=0,g=Math.floor(p/8);for(;m=0;b-=1)if(y=this.parts[b],y in g){if(x=g[y],m&&x!==0)return null;x!==16&&(m=!0),d+=x}else return null;return 128-d},p.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){let d,m=[],g=this.parts;for(let y=0;y>8),m.push(d&255);return m},p.prototype.toFixedLengthString=function(){let d=function(){let g=[];for(let y=0;y>8,m&255,g>>8,g&255])},p.prototype.toNormalizedString=function(){let d=function(){let g=[];for(let y=0;yy&&(g=x.index,y=x[0].length);return y<0?m:`${m.substring(0,g)}::${m.substring(g+y)}`},p.prototype.toString=function(){return this.toRFC5952String()},p}(),h.IPv6.broadcastAddressFromCIDR=function(p){try{let d=this.parseCIDR(p),m=d[0].toByteArray(),g=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),y=[],x=0;for(;x<16;)y.push(parseInt(m[x],10)|parseInt(g[x],10)^255),x++;return new this(y)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},h.IPv6.isIPv6=function(p){return this.parser(p)!==null},h.IPv6.isValid=function(p){if(typeof p=="string"&&p.indexOf(":")===-1)return!1;try{let d=this.parser(p);return new this(d.parts,d.zoneId),!0}catch{return!1}},h.IPv6.networkAddressFromCIDR=function(p){let d,m,g,y,x;try{for(d=this.parseCIDR(p),g=d[0].toByteArray(),x=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),y=[],m=0;m<16;)y.push(parseInt(g[m],10)&parseInt(x[m],10)),m++;return new this(y)}catch(b){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${b})`)}},h.IPv6.parse=function(p){let d=this.parser(p);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},h.IPv6.parseCIDR=function(p){let d,m,g;if((m=p.match(/^(.+)\/(\d+)$/))&&(d=parseInt(m[2]),d>=0&&d<=128))return g=[this.parse(m[1]),d],Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},h.IPv6.parser=function(p){let d,m,g,y,x,b;if(g=p.match(a.deprecatedTransitional))return this.parser(`::ffff:${g[1]}`);if(a.native.test(p))return c(p,8);if((g=p.match(a.transitional))&&(b=g[6]||"",d=c(g[1].slice(0,-1)+b,6),d.parts)){for(x=[parseInt(g[2]),parseInt(g[3]),parseInt(g[4]),parseInt(g[5])],m=0;m128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m=0,g=Math.floor(p/8);for(;m{"use strict";mp.exports=pp;var rE=eu(),Fr=pp.prototype,nE=new Date%1e9;function iE(){return(Math.random()*1e9>>>0)+nE++}function pp(t){t=t||{},this.id=t.id||iE(),this.max=t.max||1/0,this.items=t.items||[],this._lookup={},this.size=this.items.length,this.lastModified=new Date(t.lastModified||new Date);for(var e,r,n=this.items.length;n--;)e=this.items[n],r=new Date(e.expires)-new Date,this._lookup[e.key]=e,r>0?this.expire(e.key,r):r<=0&&this.delete(e.key)}Fr.has=function(t){return t in this._lookup};Fr.get=function(t){if(!this.has(t))return null;var e=this._lookup[t];return e.refresh&&this.expire(t,e.refresh),this.items.splice(this.items.indexOf(e),1),this.items.push(e),e.value};Fr.meta=function(t){if(!this.has(t))return null;var e=this._lookup[t];return"meta"in e?e.meta:null};Fr.set=function(t,e,r){var n=this._lookup[t],i=this._lookup[t]={key:t,value:e};return this.lastModified=new Date,n?(clearTimeout(n.timeout),this.items.splice(this.items.indexOf(n),1,i)):(this.size>=this.max&&this.delete(this.items[0].key),this.items.push(i),this.size++),r&&("ttl"in r&&this.expire(t,r.ttl),"meta"in r&&(i.meta=r.meta),r.refresh&&(i.refresh=r.ttl)),this};Fr.delete=function(t){var e=this._lookup[t];return e?(this.lastModified=new Date,this.items.splice(this.items.indexOf(e),1),clearTimeout(e.timeout),delete this._lookup[t],this.size--,this):!1};Fr.expire=function(t,e){var r=e||0,n=this._lookup[t];if(!n)return this;if(typeof r=="string"&&(r=rE(e)),typeof r!="number")throw new TypeError("Expiration time must be a string or number.");return clearTimeout(n.timeout),n.timeout=setTimeout(this.delete.bind(this,n.key),r),n.expires=Number(new Date)+r,this};Fr.clear=function(){for(var t=this.items.length;t--;)this.delete(this.items[t].key);return this};Fr.toJSON=function(){for(var t=new Array(this.items.length),e,r=t.length;r--;)e=this.items[r],t[r]={key:e.key,meta:e.meta,value:e.value,expires:e.expires,refresh:e.refresh};return{id:this.id,max:isFinite(this.max)?this.max:void 0,lastModified:this.lastModified,items:t}}});var Ep=V((I3,wp)=>{"use strict";wp.exports=t=>{if(Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}});var Rp=V((Ap,Ip)=>{"use strict";var ko=Ep(),{hasOwnProperty:_p}=Object.prototype,{propertyIsEnumerable:aE}=Object,ni=(t,e,r)=>Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0}),cE=Ap,vp={concatArrays:!1,ignoreUndefined:!1},Oo=t=>{let e=[];for(let r in t)_p.call(t,r)&&e.push(r);if(Object.getOwnPropertySymbols){let r=Object.getOwnPropertySymbols(t);for(let n of r)aE.call(t,n)&&e.push(n)}return e};function ii(t){return Array.isArray(t)?uE(t):ko(t)?lE(t):t}function uE(t){let e=t.slice(0,0);return Oo(t).forEach(r=>{ni(e,r,ii(t[r]))}),e}function lE(t){let e=Object.getPrototypeOf(t)===null?Object.create(null):{};return Oo(t).forEach(r=>{ni(e,r,ii(t[r]))}),e}var Sp=(t,e,r,n)=>(r.forEach(i=>{typeof e[i]>"u"&&n.ignoreUndefined||(i in t&&t[i]!==Object.getPrototypeOf(t)?ni(t,i,ul(t[i],e[i],n)):ni(t,i,ii(e[i])))}),t),fE=(t,e,r)=>{let n=t.slice(0,0),i=0;return[t,e].forEach(s=>{let o=[];for(let a=0;a!o.includes(a)),r)}),n};function ul(t,e,r){return r.concatArrays&&Array.isArray(t)&&Array.isArray(e)?fE(t,e,r):!ko(e)||!ko(t)?ii(e):Sp(t,e,Oo(e),r)}Ip.exports=function(...t){let e=ul(ii(vp),this!==cE&&this||{},vp),r={_:{}};for(let n of t)if(n!==void 0){if(!ko(n))throw new TypeError("`"+n+"` is not an Option Object");r=ul(r,{_:n},e)}return r._}});var ji=V((U3,Lp)=>{Lp.exports=class{constructor(e={}){this.points=e.points,this.duration=e.duration,this.blockDuration=e.blockDuration,this.execEvenly=e.execEvenly,this.execEvenlyMinDelayMs=e.execEvenlyMinDelayMs,this.keyPrefix=e.keyPrefix}get points(){return this._points}set points(e){this._points=e>=0?e:4}get duration(){return this._duration}set duration(e){this._duration=typeof e>"u"?1:e}get msDuration(){return this.duration*1e3}get blockDuration(){return this._blockDuration}set blockDuration(e){this._blockDuration=typeof e>"u"?0:e}get msBlockDuration(){return this.blockDuration*1e3}get execEvenly(){return this._execEvenly}set execEvenly(e){this._execEvenly=typeof e>"u"?!1:!!e}get execEvenlyMinDelayMs(){return this._execEvenlyMinDelayMs}set execEvenlyMinDelayMs(e){this._execEvenlyMinDelayMs=typeof e>"u"?Math.ceil(this.msDuration/this.points):e}get keyPrefix(){return this._keyPrefix}set keyPrefix(e){if(typeof e>"u"&&(e="rlflx"),typeof e!="string")throw new Error("keyPrefix must be string");this._keyPrefix=e}_getKeySecDuration(e={}){return e&&e.customDuration>=0?e.customDuration:this.duration}getKey(e){return this.keyPrefix.length>0?`${this.keyPrefix}:${e}`:e}parseKey(e){return e.substring(this.keyPrefix.length)}consume(){throw new Error("You have to implement the method 'consume'!")}penalty(){throw new Error("You have to implement the method 'penalty'!")}reward(){throw new Error("You have to implement the method 'reward'!")}get(){throw new Error("You have to implement the method 'get'!")}set(){throw new Error("You have to implement the method 'set'!")}block(){throw new Error("You have to implement the method 'block'!")}delete(){throw new Error("You have to implement the method 'delete'!")}}});var Dp=V((K3,Pp)=>{Pp.exports=class{constructor(){this._keys={},this._addedKeysAmount=0}collectExpired(){let e=Date.now();Object.keys(this._keys).forEach(r=>{this._keys[r]<=e&&delete this._keys[r]}),this._addedKeysAmount=Object.keys(this._keys).length}add(e,r){this.addMs(e,r*1e3)}addMs(e,r){this._keys[e]=Date.now()+r,this._addedKeysAmount++,this._addedKeysAmount>999&&this.collectExpired()}msBeforeExpire(e){let r=this._keys[e];if(r&&r>=Date.now()){this.collectExpired();let n=Date.now();return r>=n?r-n:0}return 0}delete(e){e?delete this._keys[e]:Object.keys(this._keys).forEach(r=>{delete this._keys[r]})}}});var kp=V((q3,Np)=>{var dE=Dp();Np.exports=dE});var _t=V(($3,Op)=>{Op.exports=class{constructor(e,r,n,i){this.remainingPoints=typeof e>"u"?0:e,this.msBeforeNext=typeof r>"u"?0:r,this.consumedPoints=typeof n>"u"?0:n,this.isFirstInDuration=typeof i>"u"?!1:i}get msBeforeNext(){return this._msBeforeNext}set msBeforeNext(e){return this._msBeforeNext=e,this}get remainingPoints(){return this._remainingPoints}set remainingPoints(e){return this._remainingPoints=e,this}get consumedPoints(){return this._consumedPoints}set consumedPoints(e){return this._consumedPoints=e,this}get isFirstInDuration(){return this._isFirstInDuration}set isFirstInDuration(e){this._isFirstInDuration=!!e}_getDecoratedProperties(){return{remainingPoints:this.remainingPoints,msBeforeNext:this.msBeforeNext,consumedPoints:this.consumedPoints,isFirstInDuration:this.isFirstInDuration}}[Symbol.for("nodejs.util.inspect.custom")](){return this._getDecoratedProperties()}toString(){return JSON.stringify(this._getDecoratedProperties())}toJSON(){return this._getDecoratedProperties()}}});var si=V((H3,Up)=>{var ll=ji(),pE=kp(),Mp=_t();Up.exports=class extends ll{constructor(e={}){super(e),this.inMemoryBlockOnConsumed=e.inMemoryBlockOnConsumed,this.inMemoryBlockDuration=e.inMemoryBlockDuration,this.insuranceLimiter=e.insuranceLimiter,this._inMemoryBlockedKeys=new pE}get client(){return this._client}set client(e){if(typeof e>"u")throw new Error("storeClient is not set");this._client=e}_afterConsume(e,r,n,i,s,o={}){let a=this._getRateLimiterRes(n,i,s);if(this.inMemoryBlockOnConsumed>0&&!(this.inMemoryBlockDuration>0)&&a.consumedPoints>=this.inMemoryBlockOnConsumed)return this._inMemoryBlockedKeys.addMs(n,a.msBeforeNext),a.consumedPoints>this.points?r(a):e(a);if(a.consumedPoints>this.points){let c=Promise.resolve();this.blockDuration>0&&a.consumedPoints<=this.points+i&&(a.msBeforeNext=this.msBlockDuration,c=this._block(n,a.consumedPoints,this.msBlockDuration,o)),this.inMemoryBlockOnConsumed>0&&a.consumedPoints>=this.inMemoryBlockOnConsumed&&(this._inMemoryBlockedKeys.add(n,this.inMemoryBlockDuration),a.msBeforeNext=this.msInMemoryBlockDuration),c.then(()=>{r(a)}).catch(u=>{r(u)})}else if(this.execEvenly&&a.msBeforeNext>0&&!a.isFirstInDuration){let c=Math.ceil(a.msBeforeNext/(a.remainingPoints+2));c{n(c)}).catch(c=>{i(c)}):i(e)}getInMemoryBlockMsBeforeExpire(e){return this.inMemoryBlockOnConsumed>0?this._inMemoryBlockedKeys.msBeforeExpire(e):0}get inMemoryBlockOnConsumed(){return this._inMemoryBlockOnConsumed}set inMemoryBlockOnConsumed(e){if(this._inMemoryBlockOnConsumed=e?parseInt(e):0,this.inMemoryBlockOnConsumed>0&&this.points>this.inMemoryBlockOnConsumed)throw new Error('inMemoryBlockOnConsumed option must be greater or equal "points" option')}get inMemoryBlockDuration(){return this._inMemoryBlockDuration}set inMemoryBlockDuration(e){if(this._inMemoryBlockDuration=e?parseInt(e):0,this.inMemoryBlockDuration>0&&this.inMemoryBlockOnConsumed===0)throw new Error("inMemoryBlockOnConsumed option must be set up")}get msInMemoryBlockDuration(){return this._inMemoryBlockDuration*1e3}get insuranceLimiter(){return this._insuranceLimiter}set insuranceLimiter(e){if(typeof e<"u"&&!(e instanceof ll))throw new Error("insuranceLimiter must be instance of RateLimiterAbstract");this._insuranceLimiter=e,this._insuranceLimiter&&(this._insuranceLimiter.blockDuration=this.blockDuration,this._insuranceLimiter.execEvenly=this.execEvenly)}block(e,r,n={}){let i=r*1e3;return this._block(this.getKey(e),this.points+1,i,n)}set(e,r,n,i={}){let s=(n>=0?n:this.duration)*1e3;return this._block(this.getKey(e),r,s,i)}consume(e,r=1,n={}){return new Promise((i,s)=>{let o=this.getKey(e),a=this.getInMemoryBlockMsBeforeExpire(o);if(a>0)return s(new Mp(0,a));this._upsert(o,r,this._getKeySecDuration(n)*1e3,!1,n).then(c=>{this._afterConsume(i,s,o,r,c)}).catch(c=>{this._handleError(c,"consume",i,s,e,r,n)})})}penalty(e,r=1,n={}){let i=this.getKey(e);return new Promise((s,o)=>{this._upsert(i,r,this._getKeySecDuration(n)*1e3,!1,n).then(a=>{s(this._getRateLimiterRes(i,r,a))}).catch(a=>{this._handleError(a,"penalty",s,o,e,r,n)})})}reward(e,r=1,n={}){let i=this.getKey(e);return new Promise((s,o)=>{this._upsert(i,-r,this._getKeySecDuration(n)*1e3,!1,n).then(a=>{s(this._getRateLimiterRes(i,-r,a))}).catch(a=>{this._handleError(a,"reward",s,o,e,r,n)})})}get(e,r={}){let n=this.getKey(e);return new Promise((i,s)=>{this._get(n,r).then(o=>{i(o===null||typeof o>"u"?null:this._getRateLimiterRes(n,0,o))}).catch(o=>{this._handleError(o,"get",i,s,e,r)})})}delete(e,r={}){let n=this.getKey(e);return new Promise((i,s)=>{this._delete(n,r).then(o=>{this._inMemoryBlockedKeys.delete(n),i(o)}).catch(o=>{this._handleError(o,"delete",i,s,e,r)})})}deleteInMemoryBlockedAll(){this._inMemoryBlockedKeys.delete()}_getRateLimiterRes(e,r,n){throw new Error("You have to implement the method '_getRateLimiterRes'!")}_block(e,r,n,i={}){return new Promise((s,o)=>{this._upsert(e,r,n,!0,i).then(()=>{s(new Mp(0,n>0?n:-1,r))}).catch(a=>{this._handleError(a,"block",s,o,this.parseKey(e),n/1e3,i)})})}_get(e,r={}){throw new Error("You have to implement the method '_get'!")}_delete(e,r={}){throw new Error("You have to implement the method '_delete'!")}_upsert(e,r,n,i=!1,s={}){throw new Error("You have to implement the method '_upsert'!")}}});var Kp=V((G3,Fp)=>{var mE=si(),gE=_t(),fl="redis.call('set', KEYS[1], 0, 'EX', ARGV[2], 'NX') local consumed = redis.call('incrby', KEYS[1], ARGV[1]) local ttl = redis.call('pttl', KEYS[1]) if ttl == -1 then redis.call('expire', KEYS[1], ARGV[2]) ttl = 1000 * ARGV[2] end return {consumed, ttl} ",hl=class extends mE{constructor(e){super(e),this.client=e.storeClient,this._rejectIfRedisNotReady=!!e.rejectIfRedisNotReady,this.useRedisPackage=e.useRedisPackage||this.client.constructor.name==="Commander"||!1,this.useRedis3AndLowerPackage=e.useRedis3AndLowerPackage,typeof this.client.defineCommand=="function"&&this.client.defineCommand("rlflxIncr",{numberOfKeys:1,lua:fl})}_isRedisReady(){return this._rejectIfRedisNotReady?!(this.client.status&&this.client.status!=="ready"||typeof this.client.isReady=="function"&&!this.client.isReady()):!0}_getRateLimiterRes(e,r,n){let[i,s]=n;Array.isArray(i)&&([,i]=i,[,s]=s);let o=new gE;return o.consumedPoints=parseInt(i),o.isFirstInDuration=o.consumedPoints===r,o.remainingPoints=Math.max(this.points-o.consumedPoints,0),o.msBeforeNext=s,o}async _upsert(e,r,n,i=!1){if(!this._isRedisReady())throw new Error("Redis connection is not ready");let s=Math.floor(n/1e3),o=this.client.multi();return i?(s>0?!this.useRedisPackage&&!this.useRedis3AndLowerPackage?o.set(e,r,"EX",s):o.set(e,r,{EX:s}):o.set(e,r),!this.useRedisPackage&&!this.useRedis3AndLowerPackage?o.pttl(e).exec(!0):o.pTTL(e).exec(!0)):s>0?!this.useRedisPackage&&!this.useRedis3AndLowerPackage?this.client.rlflxIncr([e].concat([String(r),String(s)])):this.useRedis3AndLowerPackage?new Promise((a,c)=>{let u=function(l,f){return l?c(l):a(f)};typeof this.client.rlflxIncr=="function"?this.client.rlflxIncr(e,r,s,u):this.client.eval(fl,1,e,r,s,u)}):this.client.eval(fl,{keys:[e],arguments:[String(r),String(s)]}):!this.useRedisPackage&&!this.useRedis3AndLowerPackage?o.incrby(e,r).pttl(e).exec(!0):o.incrBy(e,r).pTTL(e).exec(!0)}async _get(e){if(!this._isRedisReady())throw new Error("Redis connection is not ready");return!this.useRedisPackage&&!this.useRedis3AndLowerPackage?this.client.multi().get(e).pttl(e).exec().then(r=>{let[[,n]]=r;return n===null?null:r}):this.client.multi().get(e).pTTL(e).exec(!0).then(r=>{let[n]=r;return n===null?null:r})}_delete(e){return this.client.del(e).then(r=>r>0)}};Fp.exports=hl});var $p=V((W3,Vp)=>{var yE=si(),xE=_t();function qp(t){try{let e=t.client?t.client:t,{version:r}=e.topology.s.options.metadata.driver,n=r.split(".").map(i=>parseInt(i));return{major:n[0],feature:n[1],patch:n[2]}}catch{return{major:0,feature:0,patch:0}}}var dl=class t extends yE{constructor(e){super(e),this.dbName=e.dbName,this.tableName=e.tableName,this.indexKeyPrefix=e.indexKeyPrefix,e.mongo?this.client=e.mongo:this.client=e.storeClient,typeof this.client.then=="function"?this.client.then(r=>{this.client=r,this._initCollection(),this._driverVersion=qp(this.client)}):(this._initCollection(),this._driverVersion=qp(this.client))}get dbName(){return this._dbName}set dbName(e){this._dbName=typeof e>"u"?t.getDbName():e}static getDbName(){return"node-rate-limiter-flexible"}get tableName(){return this._tableName}set tableName(e){this._tableName=typeof e>"u"?this.keyPrefix:e}get client(){return this._client}set client(e){if(typeof e>"u")throw new Error("mongo is not set");this._client=e}get indexKeyPrefix(){return this._indexKeyPrefix}set indexKeyPrefix(e){this._indexKeyPrefix=e||{}}_initCollection(){let r=(typeof this.client.db=="function"?this.client.db(this.dbName):this.client).collection(this.tableName);r.createIndex({expire:-1},{expireAfterSeconds:0}),r.createIndex(Object.assign({},this.indexKeyPrefix,{key:1}),{unique:!0}),this._collection=r}_getRateLimiterRes(e,r,n){let i=new xE,s;return typeof n.value>"u"?s=n:s=n.value,i.isFirstInDuration=s.points===r,i.consumedPoints=s.points,i.remainingPoints=Math.max(this.points-i.consumedPoints,0),i.msBeforeNext=s.expire!==null?Math.max(new Date(s.expire).getTime()-Date.now(),0):-1,i}_upsert(e,r,n,i=!1,s={}){if(!this._collection)return Promise.reject(Error("Mongo connection is not established"));let o=s.attrs||{},a,c;i?(a={key:e},a=Object.assign(a,o),c={$set:{key:e,points:r,expire:n>0?new Date(Date.now()+n):null}},c.$set=Object.assign(c.$set,o)):(a={$or:[{expire:{$gt:new Date}},{expire:{$eq:null}}],key:e},a=Object.assign(a,o),c={$setOnInsert:{key:e,expire:n>0?new Date(Date.now()+n):null},$inc:{points:r}},c.$setOnInsert=Object.assign(c.$setOnInsert,o));let u={upsert:!0};return this._driverVersion.major>=4||this._driverVersion.major===3&&this._driverVersion.feature>=7||this._driverVersion.feature>=6&&this._driverVersion.patch>=7?u.returnDocument="after":u.returnOriginal=!1,new Promise((l,f)=>{this._collection.findOneAndUpdate(a,c,u).then(h=>{l(h)}).catch(h=>{if(h&&h.code===11e3){let p=Object.assign({$or:[{expire:{$lte:new Date}},{expire:{$eq:null}}],key:e},o),d={$set:Object.assign({key:e,points:r,expire:n>0?new Date(Date.now()+n):null},o)};this._collection.findOneAndUpdate(p,d,u).then(m=>{l(m)}).catch(m=>{m&&m.code===11e3?this._upsert(e,r,n,i).then(g=>l(g)).catch(g=>f(g)):f(m)})}else f(h)})})}_get(e,r={}){if(!this._collection)return Promise.reject(Error("Mongo connection is not established"));let n=r.attrs||{},i=Object.assign({key:e,$or:[{expire:{$gt:new Date}},{expire:{$eq:null}}]},n);return this._collection.findOne(i)}_delete(e,r={}){if(!this._collection)return Promise.reject(Error("Mongo connection is not established"));let n=r.attrs||{},i=Object.assign({key:e},n);return this._collection.deleteOne(i).then(s=>s.deletedCount>0)}};Vp.exports=dl});var Hp=V((Y3,zp)=>{var bE=si(),wE=_t(),pl=class extends bE{constructor(e,r=null){super(e),this.client=e.storeClient,this.clientType=e.storeType,this.dbName=e.dbName,this.tableName=e.tableName,this.clearExpiredByTimeout=e.clearExpiredByTimeout,this.tableCreated=e.tableCreated,this.tableCreated?(this.clearExpiredByTimeout&&this._clearExpiredHourAgo(),typeof r=="function"&&r()):this._createDbAndTable().then(()=>{this.tableCreated=!0,this.clearExpiredByTimeout&&this._clearExpiredHourAgo(),typeof r=="function"&&r()}).catch(n=>{if(typeof r=="function")r(n);else throw n})}clearExpired(e){return new Promise(r=>{this._getConnection().then(n=>{n.query("DELETE FROM ??.?? WHERE expire < ?",[this.dbName,this.tableName,e],()=>{this._releaseConnection(n),r()})}).catch(()=>{r()})})}_clearExpiredHourAgo(){this._clearExpiredTimeoutId&&clearTimeout(this._clearExpiredTimeoutId),this._clearExpiredTimeoutId=setTimeout(()=>{this.clearExpired(Date.now()-36e5).then(()=>{this._clearExpiredHourAgo()})},3e5),this._clearExpiredTimeoutId.unref()}_getConnection(){switch(this.clientType){case"pool":return new Promise((e,r)=>{this.client.getConnection((n,i)=>{if(n)return r(n);e(i)})});case"sequelize":return this.client.connectionManager.getConnection();case"knex":return this.client.client.acquireConnection();default:return Promise.resolve(this.client)}}_releaseConnection(e){switch(this.clientType){case"pool":return e.release();case"sequelize":return this.client.connectionManager.releaseConnection(e);case"knex":return this.client.client.releaseConnection(e);default:return!0}}_createDbAndTable(){return new Promise((e,r)=>{this._getConnection().then(n=>{n.query(`CREATE DATABASE IF NOT EXISTS \`${this.dbName}\`;`,i=>{if(i)return this._releaseConnection(n),r(i);n.query(this._getCreateTableStmt(),s=>{if(s)return this._releaseConnection(n),r(s);this._releaseConnection(n),e()})})}).catch(n=>{r(n)})})}_getCreateTableStmt(){return`CREATE TABLE IF NOT EXISTS \`${this.dbName}\`.\`${this.tableName}\` (\`key\` VARCHAR(255) CHARACTER SET utf8 NOT NULL,\`points\` INT(9) NOT NULL default 0,\`expire\` BIGINT UNSIGNED,PRIMARY KEY (\`key\`)) ENGINE = INNODB;`}get clientType(){return this._clientType}set clientType(e){if(typeof e>"u")if(this.client.constructor.name==="Connection")e="connection";else if(this.client.constructor.name==="Pool")e="pool";else if(this.client.constructor.name==="Sequelize")e="sequelize";else throw new Error("storeType is not defined");this._clientType=e.toLowerCase()}get dbName(){return this._dbName}set dbName(e){this._dbName=typeof e>"u"?"rtlmtrflx":e}get tableName(){return this._tableName}set tableName(e){this._tableName=typeof e>"u"?this.keyPrefix:e}get tableCreated(){return this._tableCreated}set tableCreated(e){this._tableCreated=typeof e>"u"?!1:!!e}get clearExpiredByTimeout(){return this._clearExpiredByTimeout}set clearExpiredByTimeout(e){this._clearExpiredByTimeout=typeof e>"u"?!0:!!e}_getRateLimiterRes(e,r,n){let i=new wE,[s]=n;return i.isFirstInDuration=r===s.points,i.consumedPoints=i.isFirstInDuration?r:s.points,i.remainingPoints=Math.max(this.points-i.consumedPoints,0),i.msBeforeNext=s.expire?Math.max(s.expire-Date.now(),0):-1,i}_upsertTransaction(e,r,n,i,s){return new Promise((o,a)=>{e.query("BEGIN",c=>{if(c)return e.rollback(),a(c);let u=Date.now(),l=i>0?u+i:null,f,h;s?(f=`INSERT INTO ??.?? VALUES (?, ?, ?) - ON DUPLICATE KEY UPDATE - points = ?, - expire = ?;`,h=[this.dbName,this.tableName,r,n,l,n,l]):(f=`INSERT INTO ??.?? VALUES (?, ?, ?) - ON DUPLICATE KEY UPDATE - points = IF(expire <= ?, ?, points + (?)), - expire = IF(expire <= ?, ?, expire);`,h=[this.dbName,this.tableName,r,n,l,u,n,n,u,l]),e.query(f,h,p=>{if(p)return e.rollback(),a(p);e.query("SELECT points, expire FROM ??.?? WHERE `key` = ?;",[this.dbName,this.tableName,r],(d,m)=>{if(d)return e.rollback(),a(d);e.query("COMMIT",g=>{if(g)return e.rollback(),a(g);o(m)})})})})})}_upsert(e,r,n,i=!1){return this.tableCreated?new Promise((s,o)=>{this._getConnection().then(a=>{this._upsertTransaction(a,e,r,n,i).then(c=>{s(c),this._releaseConnection(a)}).catch(c=>{o(c),this._releaseConnection(a)})}).catch(a=>{o(a)})}):Promise.reject(Error("Table is not created yet"))}_get(e){return this.tableCreated?new Promise((r,n)=>{this._getConnection().then(i=>{i.query("SELECT points, expire FROM ??.?? WHERE `key` = ? AND (`expire` > ? OR `expire` IS NULL)",[this.dbName,this.tableName,e,Date.now()],(s,o)=>{s?n(s):o.length===0?r(null):r(o),this._releaseConnection(i)})}).catch(i=>{n(i)})}):Promise.reject(Error("Table is not created yet"))}_delete(e){return this.tableCreated?new Promise((r,n)=>{this._getConnection().then(i=>{i.query("DELETE FROM ??.?? WHERE `key` = ?",[this.dbName,this.tableName,e],(s,o)=>{s?n(s):r(o.affectedRows>0),this._releaseConnection(i)})}).catch(i=>{n(i)})}):Promise.reject(Error("Table is not created yet"))}};zp.exports=pl});var Wp=V((Q3,Gp)=>{var EE=si(),vE=_t(),ml=class extends EE{constructor(e,r=null){super(e),this.client=e.storeClient,this.clientType=e.storeType,this.tableName=e.tableName,this.schemaName=e.schemaName,this.clearExpiredByTimeout=e.clearExpiredByTimeout,this.tableCreated=e.tableCreated,this.tableCreated?(this.clearExpiredByTimeout&&this._clearExpiredHourAgo(),typeof r=="function"&&r()):this._createTable().then(()=>{this.tableCreated=!0,this.clearExpiredByTimeout&&this._clearExpiredHourAgo(),typeof r=="function"&&r()}).catch(n=>{if(typeof r=="function")r(n);else throw n})}_getTableIdentifier(){return this.schemaName?`"${this.schemaName}"."${this.tableName}"`:`"${this.tableName}"`}clearExpired(e){return new Promise(r=>{let n={name:"rlflx-clear-expired",text:`DELETE FROM ${this._getTableIdentifier()} WHERE expire < $1`,values:[e]};this._query(n).then(()=>{r()}).catch(()=>{r()})})}_clearExpiredHourAgo(){this._clearExpiredTimeoutId&&clearTimeout(this._clearExpiredTimeoutId),this._clearExpiredTimeoutId=setTimeout(()=>{this.clearExpired(Date.now()-36e5).then(()=>{this._clearExpiredHourAgo()})},3e5),this._clearExpiredTimeoutId.unref()}_getConnection(){switch(this.clientType){case"pool":return Promise.resolve(this.client);case"sequelize":return this.client.connectionManager.getConnection();case"knex":return this.client.client.acquireConnection();case"typeorm":return Promise.resolve(this.client.driver.master);default:return Promise.resolve(this.client)}}_releaseConnection(e){switch(this.clientType){case"pool":return!0;case"sequelize":return this.client.connectionManager.releaseConnection(e);case"knex":return this.client.client.releaseConnection(e);case"typeorm":return!0;default:return!0}}_createTable(){return new Promise((e,r)=>{this._query({text:this._getCreateTableStmt()}).then(()=>{e()}).catch(n=>{n.code==="23505"?e():r(n)})})}_getCreateTableStmt(){return`CREATE TABLE IF NOT EXISTS ${this._getTableIdentifier()} ( - key varchar(255) PRIMARY KEY, - points integer NOT NULL DEFAULT 0, - expire bigint - );`}get clientType(){return this._clientType}set clientType(e){let r=this.client.constructor.name;if(typeof e>"u")if(r==="Client")e="client";else if(r==="Pool"||r==="BoundPool")e="pool";else if(r==="Sequelize")e="sequelize";else throw new Error("storeType is not defined");this._clientType=e.toLowerCase()}get tableName(){return this._tableName}set tableName(e){this._tableName=typeof e>"u"?this.keyPrefix:e}get schemaName(){return this._schemaName}set schemaName(e){this._schemaName=e}get tableCreated(){return this._tableCreated}set tableCreated(e){this._tableCreated=typeof e>"u"?!1:!!e}get clearExpiredByTimeout(){return this._clearExpiredByTimeout}set clearExpiredByTimeout(e){this._clearExpiredByTimeout=typeof e>"u"?!0:!!e}_getRateLimiterRes(e,r,n){let i=new vE,s=n.rows[0];return i.isFirstInDuration=r===s.points,i.consumedPoints=i.isFirstInDuration?r:s.points,i.remainingPoints=Math.max(this.points-i.consumedPoints,0),i.msBeforeNext=s.expire?Math.max(s.expire-Date.now(),0):-1,i}_query(e){let n={name:`${this.tableName.toLowerCase()}:${e.name}`,text:e.text,values:e.values};return new Promise((i,s)=>{this._getConnection().then(o=>{o.query(n).then(a=>{i(a),this._releaseConnection(o)}).catch(a=>{s(a),this._releaseConnection(o)})}).catch(o=>{s(o)})})}_upsert(e,r,n,i=!1){if(!this.tableCreated)return Promise.reject(Error("Table is not created yet"));let s=n>0?Date.now()+n:null,o=i?" $3 ":` CASE - WHEN ${this._getTableIdentifier()}.expire <= $4 THEN $3 - ELSE ${this._getTableIdentifier()}.expire - END `;return this._query({name:i?"rlflx-upsert-force":"rlflx-upsert",text:` - INSERT INTO ${this._getTableIdentifier()} VALUES ($1, $2, $3) - ON CONFLICT(key) DO UPDATE SET - points = CASE - WHEN (${this._getTableIdentifier()}.expire <= $4 OR 1=${i?1:0}) THEN $2 - ELSE ${this._getTableIdentifier()}.points + ($2) - END, - expire = ${o} - RETURNING points, expire;`,values:[e,r,s,Date.now()]})}_get(e){return this.tableCreated?new Promise((r,n)=>{this._query({name:"rlflx-get",text:` - SELECT points, expire FROM ${this._getTableIdentifier()} WHERE key = $1 AND (expire > $2 OR expire IS NULL);`,values:[e,Date.now()]}).then(i=>{i.rowCount===0&&(i=null),r(i)}).catch(i=>{n(i)})}):Promise.reject(Error("Table is not created yet"))}_delete(e){return this.tableCreated?this._query({name:"rlflx-delete",text:`DELETE FROM ${this._getTableIdentifier()} WHERE key = $1`,values:[e]}).then(r=>r.rowCount>0):Promise.reject(Error("Table is not created yet"))}};Gp.exports=ml});var Yp=V(()=>{});var Xp=V((J3,Qp)=>{Qp.exports=class{constructor(e,r,n=null){this.value=e,this.expiresAt=r,this.timeoutId=n}get value(){return this._value}set value(e){this._value=parseInt(e)}get expiresAt(){return this._expiresAt}set expiresAt(e){!(e instanceof Date)&&Number.isInteger(e)&&(e=new Date(e)),this._expiresAt=e}get timeoutId(){return this._timeoutId}set timeoutId(e){this._timeoutId=e}}});var jp=V((tB,Zp)=>{var _E=Xp(),gl=_t();Zp.exports=class{constructor(){this._storage={}}incrby(e,r,n){if(this._storage[e]){let i=this._storage[e].expiresAt?this._storage[e].expiresAt.getTime()-new Date().getTime():-1;return i!==0?(this._storage[e].value=this._storage[e].value+r,new gl(0,i,this._storage[e].value,!1)):this.set(e,r,n)}return this.set(e,r,n)}set(e,r,n){let i=n*1e3;return this._storage[e]&&this._storage[e].timeoutId&&clearTimeout(this._storage[e].timeoutId),this._storage[e]=new _E(r,i>0?new Date(Date.now()+i):null),i>0&&(this._storage[e].timeoutId=setTimeout(()=>{delete this._storage[e]},i),this._storage[e].timeoutId.unref&&this._storage[e].timeoutId.unref()),new gl(0,i===0?-1:i,this._storage[e].value,!0)}get(e){if(this._storage[e]){let r=this._storage[e].expiresAt?this._storage[e].expiresAt.getTime()-new Date().getTime():-1;return new gl(0,r,this._storage[e].value,!1)}return null}delete(e){return this._storage[e]?(this._storage[e].timeoutId&&clearTimeout(this._storage[e].timeoutId),delete this._storage[e],!0):!1}}});var xl=V((rB,em)=>{var SE=ji(),AE=jp(),Jp=_t(),yl=class extends SE{constructor(e={}){super(e),this._memoryStorage=new AE}consume(e,r=1,n={}){return new Promise((i,s)=>{let o=this.getKey(e),a=this._getKeySecDuration(n),c=this._memoryStorage.incrby(o,r,a);if(c.remainingPoints=Math.max(this.points-c.consumedPoints,0),c.consumedPoints>this.points)this.blockDuration>0&&c.consumedPoints<=this.points+r&&(c=this._memoryStorage.set(o,c.consumedPoints,this.blockDuration)),s(c);else if(this.execEvenly&&c.msBeforeNext>0&&!c.isFirstInDuration){let u=Math.ceil(c.msBeforeNext/(c.remainingPoints+2));u{let o=this._getKeySecDuration(n),a=this._memoryStorage.incrby(i,r,o);a.remainingPoints=Math.max(this.points-a.consumedPoints,0),s(a)})}reward(e,r=1,n={}){let i=this.getKey(e);return new Promise(s=>{let o=this._getKeySecDuration(n),a=this._memoryStorage.incrby(i,-r,o);a.remainingPoints=Math.max(this.points-a.consumedPoints,0),s(a)})}block(e,r){let n=r*1e3,i=this.points+1;return this._memoryStorage.set(this.getKey(e),i,r),Promise.resolve(new Jp(0,n===0?-1:n,i))}set(e,r,n){let i=(n>=0?n:this.duration)*1e3;return this._memoryStorage.set(this.getKey(e),r,n),Promise.resolve(new Jp(0,i===0?-1:i,r))}get(e){let r=this._memoryStorage.get(this.getKey(e));return r!==null&&(r.remainingPoints=Math.max(this.points-r.consumedPoints,0)),Promise.resolve(r)}delete(e){return Promise.resolve(this._memoryStorage.delete(this.getKey(e)))}};em.exports=yl});var am=V((nB,om)=>{var tm=Yp(),IE=gi(),RE=ji(),nm=xl(),CE=_t(),Ct="rate_limiter_flexible",ci=null,rm=function(t,e,r,n){let i;n===null||n===!0||n===!1?i=n:i={remainingPoints:n.remainingPoints,msBeforeNext:n.msBeforeNext,consumedPoints:n.consumedPoints,isFirstInDuration:n.isFirstInDuration},t.send({channel:Ct,keyPrefix:e.keyPrefix,promiseId:e.promiseId,type:r,data:i})},im=function(t){setTimeout(()=>{this._initiated?process.send(t):typeof this._promises[t.promiseId]<"u"&&im.call(this,t)},30)},oi=function(t,e,r,n,i){let s={channel:Ct,keyPrefix:this.keyPrefix,func:t,promiseId:e,data:{key:r,arg:n,opts:i}};this._initiated?process.send(s):im.call(this,s)},sm=function(t,e){if(!e||e.channel!==Ct||typeof this._rateLimiters[e.keyPrefix]>"u")return!1;let r;switch(e.func){case"consume":r=this._rateLimiters[e.keyPrefix].consume(e.data.key,e.data.arg,e.data.opts);break;case"penalty":r=this._rateLimiters[e.keyPrefix].penalty(e.data.key,e.data.arg,e.data.opts);break;case"reward":r=this._rateLimiters[e.keyPrefix].reward(e.data.key,e.data.arg,e.data.opts);break;case"block":r=this._rateLimiters[e.keyPrefix].block(e.data.key,e.data.arg,e.data.opts);break;case"get":r=this._rateLimiters[e.keyPrefix].get(e.data.key,e.data.opts);break;case"delete":r=this._rateLimiters[e.keyPrefix].delete(e.data.key,e.data.opts);break;default:return!1}r&&r.then(n=>{rm(t,e,"resolve",n)}).catch(n=>{rm(t,e,"reject",n)})},TE=function(t){if(!t||t.channel!==Ct||t.keyPrefix!==this.keyPrefix)return!1;if(this._promises[t.promiseId]){clearTimeout(this._promises[t.promiseId].timeoutId);let e;switch(t.data===null||t.data===!0||t.data===!1?e=t.data:e=new CE(t.data.remainingPoints,t.data.msBeforeNext,t.data.consumedPoints,t.data.isFirstInDuration),t.type){case"resolve":this._promises[t.promiseId].resolve(e);break;case"reject":this._promises[t.promiseId].reject(e);break;default:throw new Error(`RateLimiterCluster: no such message type '${t.type}'`)}delete this._promises[t.promiseId]}},BE=function(){return{points:this.points,duration:this.duration,blockDuration:this.blockDuration,execEvenly:this.execEvenly,execEvenlyMinDelayMs:this.execEvenlyMinDelayMs,keyPrefix:this.keyPrefix}},ai=function(t,e){let r=process.hrtime(),n=r[0].toString()+r[1].toString();return typeof this._promises[n]<"u"&&(n+=IE.randomBytes(12).toString("base64")),this._promises[n]={resolve:t,reject:e,timeoutId:setTimeout(()=>{delete this._promises[n],e(new Error("RateLimiterCluster timeout: no answer from master in time"))},this.timeoutMs)},n},bl=class{constructor(){if(ci)return ci;this._rateLimiters={},tm.setMaxListeners(0),tm.on("message",(e,r)=>{r&&r.channel===Ct&&r.type==="init"?(typeof this._rateLimiters[r.opts.keyPrefix]>"u"&&(this._rateLimiters[r.opts.keyPrefix]=new nm(r.opts)),e.send({channel:Ct,type:"init",keyPrefix:r.opts.keyPrefix})):sm.call(this,e,r)}),ci=this}},wl=class{constructor(e){if(ci)return ci;this._rateLimiters={},e.launchBus((r,n)=>{n.on("process:msg",i=>{let s=i.raw;if(s&&s.channel===Ct&&s.type==="init")typeof this._rateLimiters[s.opts.keyPrefix]>"u"&&(this._rateLimiters[s.opts.keyPrefix]=new nm(s.opts)),e.sendDataToProcessId(i.process.pm_id,{data:{},topic:Ct,channel:Ct,type:"init",keyPrefix:s.opts.keyPrefix},(o,a)=>{o&&console.log(o,a)});else{let o={send:a=>{let c=a;c.topic=Ct,typeof c.data>"u"&&(c.data={}),e.sendDataToProcessId(i.process.pm_id,c,(u,l)=>{u&&console.log(u,l)})}};sm.call(this,o,s)}})}),ci=this}},El=class extends RE{get timeoutMs(){return this._timeoutMs}set timeoutMs(e){this._timeoutMs=typeof e>"u"?5e3:Math.abs(parseInt(e))}constructor(e={}){super(e),process.setMaxListeners(0),this.timeoutMs=e.timeoutMs,this._initiated=!1,process.on("message",r=>{r&&r.channel===Ct&&r.type==="init"&&r.keyPrefix===this.keyPrefix?this._initiated=!0:TE.call(this,r)}),process.send({channel:Ct,type:"init",opts:BE.call(this)}),this._promises={}}consume(e,r=1,n={}){return new Promise((i,s)=>{let o=ai.call(this,i,s);oi.call(this,"consume",o,e,r,n)})}penalty(e,r=1,n={}){return new Promise((i,s)=>{let o=ai.call(this,i,s);oi.call(this,"penalty",o,e,r,n)})}reward(e,r=1,n={}){return new Promise((i,s)=>{let o=ai.call(this,i,s);oi.call(this,"reward",o,e,r,n)})}block(e,r,n={}){return new Promise((i,s)=>{let o=ai.call(this,i,s);oi.call(this,"block",o,e,r,n)})}get(e,r={}){return new Promise((n,i)=>{let s=ai.call(this,n,i);oi.call(this,"get",s,e,r)})}delete(e,r={}){return new Promise((n,i)=>{let s=ai.call(this,n,i);oi.call(this,"delete",s,e,r)})}};om.exports={RateLimiterClusterMaster:bl,RateLimiterClusterMasterPM2:wl,RateLimiterCluster:El}});var um=V((iB,cm)=>{var LE=si(),PE=_t(),vl=class extends LE{constructor(e){super(e),this.client=e.storeClient}_getRateLimiterRes(e,r,n){let i=new PE;return i.consumedPoints=parseInt(n.consumedPoints),i.isFirstInDuration=n.consumedPoints===r,i.remainingPoints=Math.max(this.points-i.consumedPoints,0),i.msBeforeNext=n.msBeforeNext,i}_upsert(e,r,n,i=!1,s={}){return new Promise((o,a)=>{let c=Date.now(),u=Math.floor(n/1e3);i?this.client.set(e,r,u,l=>{l?a(l):this.client.set(`${e}_expire`,u>0?c+u*1e3:-1,u,()=>{let f={consumedPoints:r,msBeforeNext:u>0?u*1e3:-1};o(f)})}):this.client.incr(e,r,(l,f)=>{l||f===!1?this.client.add(e,r,u,(h,p)=>{if(h||!p)if(typeof s.attemptNumber>"u"||s.attemptNumber<3){let d=Object.assign({},s);d.attemptNumber=d.attemptNumber?d.attemptNumber+1:1,this._upsert(e,r,n,i,d).then(m=>o(m)).catch(m=>a(m))}else a(new Error("Can not add key"));else this.client.add(`${e}_expire`,u>0?c+u*1e3:-1,u,()=>{let d={consumedPoints:r,msBeforeNext:u>0?u*1e3:-1};o(d)})}):this.client.get(`${e}_expire`,(h,p)=>{if(h)a(h);else{let d=p===!1?0:p,m={consumedPoints:f,msBeforeNext:d>=0?Math.max(d-c,0):-1};o(m)}})})})}_get(e){return new Promise((r,n)=>{let i=Date.now();this.client.get(e,(s,o)=>{o?this.client.get(`${e}_expire`,(a,c)=>{if(a)n(a);else{let u=c===!1?0:c,l={consumedPoints:o,msBeforeNext:u>=0?Math.max(u-i,0):-1};r(l)}}):r(null)})})}_delete(e){return new Promise((r,n)=>{this.client.del(e,(i,s)=>{i?n(i):s===!1?r(s):this.client.del(`${e}_expire`,o=>{o?n(o):r(s)})})})}};cm.exports=vl});var hm=V((oB,fm)=>{var lm=_t();fm.exports=class{constructor(e={}){this.limiter=e.limiter,this.blackList=e.blackList,this.whiteList=e.whiteList,this.isBlackListed=e.isBlackListed,this.isWhiteListed=e.isWhiteListed,this.runActionAnyway=e.runActionAnyway}get limiter(){return this._limiter}set limiter(e){if(typeof e>"u")throw new Error("limiter is not set");this._limiter=e}get runActionAnyway(){return this._runActionAnyway}set runActionAnyway(e){this._runActionAnyway=typeof e>"u"?!1:e}get blackList(){return this._blackList}set blackList(e){this._blackList=Array.isArray(e)?e:[]}get isBlackListed(){return this._isBlackListed}set isBlackListed(e){if(typeof e>"u"&&(e=()=>!1),typeof e!="function")throw new Error("isBlackListed must be function");this._isBlackListed=e}get whiteList(){return this._whiteList}set whiteList(e){this._whiteList=Array.isArray(e)?e:[]}get isWhiteListed(){return this._isWhiteListed}set isWhiteListed(e){if(typeof e>"u"&&(e=()=>!1),typeof e!="function")throw new Error("isWhiteListed must be function");this._isWhiteListed=e}isBlackListedSomewhere(e){return this.blackList.indexOf(e)>=0||this.isBlackListed(e)}isWhiteListedSomewhere(e){return this.whiteList.indexOf(e)>=0||this.isWhiteListed(e)}getBlackRes(){return new lm(0,Number.MAX_SAFE_INTEGER,0,!1)}getWhiteRes(){return new lm(Number.MAX_SAFE_INTEGER,0,0,!1)}rejectBlack(){return Promise.reject(this.getBlackRes())}resolveBlack(){return Promise.resolve(this.getBlackRes())}resolveWhite(){return Promise.resolve(this.getWhiteRes())}consume(e,r=1){let n;return this.isWhiteListedSomewhere(e)?n=this.resolveWhite():this.isBlackListedSomewhere(e)&&(n=this.rejectBlack()),typeof n>"u"?this.limiter.consume(e,r):(this.runActionAnyway&&this.limiter.consume(e,r).catch(()=>{}),n)}block(e,r){let n;return this.isWhiteListedSomewhere(e)?n=this.resolveWhite():this.isBlackListedSomewhere(e)&&(n=this.resolveBlack()),typeof n>"u"?this.limiter.block(e,r):(this.runActionAnyway&&this.limiter.block(e,r).catch(()=>{}),n)}penalty(e,r){let n;return this.isWhiteListedSomewhere(e)?n=this.resolveWhite():this.isBlackListedSomewhere(e)&&(n=this.resolveBlack()),typeof n>"u"?this.limiter.penalty(e,r):(this.runActionAnyway&&this.limiter.penalty(e,r).catch(()=>{}),n)}reward(e,r){let n;return this.isWhiteListedSomewhere(e)?n=this.resolveWhite():this.isBlackListedSomewhere(e)&&(n=this.resolveBlack()),typeof n>"u"?this.limiter.reward(e,r):(this.runActionAnyway&&this.limiter.reward(e,r).catch(()=>{}),n)}get(e){let r;return this.isWhiteListedSomewhere(e)?r=this.resolveWhite():this.isBlackListedSomewhere(e)&&(r=this.resolveBlack()),typeof r>"u"||this.runActionAnyway?this.limiter.get(e):r}delete(e){return this.limiter.delete(e)}}});var pm=V((cB,dm)=>{var DE=ji();dm.exports=class{constructor(...e){if(e.length<1)throw new Error("RateLimiterUnion: at least one limiter have to be passed");e.forEach(r=>{if(!(r instanceof DE))throw new Error("RateLimiterUnion: all limiters have to be instance of RateLimiterAbstract")}),this._limiters=e}consume(e,r=1){return new Promise((n,i)=>{let s=[];this._limiters.forEach(o=>{s.push(o.consume(e,r).catch(a=>({rejected:!0,rej:a})))}),Promise.all(s).then(o=>{let a={},c=!1;o.forEach(u=>{u.rejected===!0&&(c=!0)});for(let u=0;u{mm.exports=class extends Error{constructor(e,r){super(),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="CustomError",this.message=e,r&&(this.extra=r)}}});var wm=V((hB,bm)=>{var ym=gm(),xm=4294967295,_l="limiter";bm.exports=class{constructor(e,r={maxQueueSize:xm}){this._queueLimiters={KEY_DEFAULT:new Uo(e,r)},this._limiterFlexible=e,this._maxQueueSize=r.maxQueueSize}getTokensRemaining(e=_l){return this._queueLimiters[e]?this._queueLimiters[e].getTokensRemaining():Promise.resolve(this._limiterFlexible.points)}removeTokens(e,r=_l){return this._queueLimiters[r]||(this._queueLimiters[r]=new Uo(this._limiterFlexible,{key:r,maxQueueSize:this._maxQueueSize})),this._queueLimiters[r].removeTokens(e)}};var Uo=class{constructor(e,r={maxQueueSize:xm,key:_l}){this._key=r.key,this._waitTimeout=null,this._queue=[],this._limiterFlexible=e,this._maxQueueSize=r.maxQueueSize}getTokensRemaining(){return this._limiterFlexible.get(this._key).then(e=>e!==null?e.remainingPoints:this._limiterFlexible.points)}removeTokens(e){let r=this;return new Promise((n,i)=>{if(e>r._limiterFlexible.points){i(new ym(`Requested tokens ${e} exceeds maximum ${r._limiterFlexible.points} tokens per interval`));return}r._queue.length>0?r._queueRequest.call(r,n,i,e):r._limiterFlexible.consume(r._key,e).then(s=>{n(s.remainingPoints)}).catch(s=>{s instanceof Error?i(s):(r._queueRequest.call(r,n,i,e),r._waitTimeout===null&&(r._waitTimeout=setTimeout(r._processFIFO.bind(r),s.msBeforeNext)))})})}_queueRequest(e,r,n){let i=this;i._queue.length{r.resolve(n.remainingPoints),e._processFIFO.call(e)}).catch(n=>{n instanceof Error?(r.reject(n),e._processFIFO.call(e)):(e._queue.unshift(r),e._waitTimeout===null&&(e._waitTimeout=setTimeout(e._processFIFO.bind(e),n.msBeforeNext)))})}}});var vm=V((pB,Em)=>{var Sl=_t();Em.exports=class{constructor(e,r){this._rateLimiter=e,this._burstLimiter=r}_combineRes(e,r){return e?new Sl(e.remainingPoints,Math.min(e.msBeforeNext,r?r.msBeforeNext:0),e.consumedPoints,e.isFirstInDuration):null}consume(e,r=1,n={}){return this._rateLimiter.consume(e,r,n).catch(i=>i instanceof Sl?this._burstLimiter.consume(e,r,n).then(s=>Promise.resolve(this._combineRes(i,s))).catch(s=>s instanceof Sl?Promise.reject(this._combineRes(i,s)):Promise.reject(s)):Promise.reject(i))}get(e){return Promise.all([this._rateLimiter.get(e),this._burstLimiter.get(e)]).then(([r,n])=>this._combineRes(r,n))}get points(){return this._rateLimiter.points}}});var Sm=V((mB,_m)=>{var NE=Kp(),kE=$p(),OE=Hp(),ME=Wp(),{RateLimiterClusterMaster:UE,RateLimiterClusterMasterPM2:FE,RateLimiterCluster:KE}=am(),qE=xl(),VE=um(),$E=hm(),zE=pm(),HE=wm(),GE=vm(),WE=_t();_m.exports={RateLimiterRedis:NE,RateLimiterMongo:kE,RateLimiterMySQL:OE,RateLimiterPostgres:ME,RateLimiterMemory:qE,RateLimiterMemcache:VE,RateLimiterClusterMaster:UE,RateLimiterClusterMasterPM2:FE,RateLimiterCluster:KE,RLWrapperBlackAndWhite:$E,RateLimiterUnion:zE,RateLimiterQueue:HE,BurstyRateLimiter:GE,RateLimiterRes:WE}});var Av={};Ke(Av,{createLibp2p:()=>Sv});var t4=ve(mi(),1),r4=ve(p0(),1);var Rn=class t extends Error{code;type;constructor(e="The operation was aborted"){super(e),this.code=t.code,this.type=t.type}static code="ABORT_ERR";static type="aborted"},S=class extends Error{code;props;constructor(e,r,n){super(e),this.code=r,this.name=n?.name??"CodeError",this.props=n??{}}};var vs="ERR_TIMEOUT",m0="ERR_INVALID_PARAMETERS";var Sb=ve(de(),1);function Wr(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}var Fa={};Ke(Fa,{base10:()=>k1});function B1(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,I=new Uint8Array(b);y!==x;){for(var v=d[y],_=0,P=b-1;(v!==0||_>>0,I[P]=v%a>>>0,v=v/a>>>0;if(v!==0)throw new Error("Non-zero carry");g=_,y++}for(var D=b-g;D!==b&&I[D]===0;)D++;for(var G=c.repeat(m);D>>0,b=new Uint8Array(x);d[m];){var I=r[d.charCodeAt(m)];if(I===255)return;for(var v=0,_=x-1;(I!==0||v>>0,b[_]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");y=v,m++}if(d[m]!==" "){for(var P=x-y;P!==x&&b[P]===0;)P++;for(var D=new Uint8Array(g+(x-P)),G=g;P!==x;)D[G++]=b[P++];return D}}}function p(d){var m=h(d);if(m)return m;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:h,decode:p}}var L1=B1,P1=L1,g0=P1;var t_=new Uint8Array(0);var y0=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var x0=t=>new TextEncoder().encode(t),b0=t=>new TextDecoder().decode(t);var ka=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Oa=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return E0(this,e)}},Ma=class{constructor(e){this.decoders=e}or(e){return E0(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},E0=(t,e)=>new Ma({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),Ua=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ka(e,r,n),this.decoder=new Oa(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Cn=({name:t,prefix:e,encode:r,decode:n})=>new Ua(t,e,r,n),wr=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=g0(r,e);return Cn({prefix:t,name:e,encode:n,decode:s=>nr(i(s))})},D1=(t,e,r,n)=>{let i={};for(let l=0;l=8&&(a-=8,o[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},N1=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<Cn({prefix:e,name:t,encode(i){return N1(i,n,r)},decode(i){return D1(i,n,r,t)}});var k1=wr({prefix:"9",name:"base10",alphabet:"0123456789"});var Ka={};Ke(Ka,{base16:()=>O1,base16upper:()=>M1});var O1=Re({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),M1=Re({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var qa={};Ke(qa,{base2:()=>U1});var U1=Re({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Va={};Ke(Va,{base256emoji:()=>$1});var v0=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),F1=v0.reduce((t,e,r)=>(t[r]=e,t),[]),K1=v0.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function q1(t){return t.reduce((e,r)=>(e+=F1[r],e),"")}function V1(t){let e=[];for(let r of t){let n=K1[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var $1=Cn({prefix:"\u{1F680}",name:"base256emoji",encode:q1,decode:V1});var $a={};Ke($a,{base32:()=>pt,base32hex:()=>W1,base32hexpad:()=>Q1,base32hexpadupper:()=>X1,base32hexupper:()=>Y1,base32pad:()=>H1,base32padupper:()=>G1,base32upper:()=>z1,base32z:()=>Z1});var pt=Re({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),z1=Re({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),H1=Re({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),G1=Re({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),W1=Re({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Y1=Re({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Q1=Re({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),X1=Re({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Z1=Re({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var za={};Ke(za,{base36:()=>j1,base36upper:()=>J1});var j1=wr({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),J1=wr({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Ha={};Ke(Ha,{base58btc:()=>_e,base58flickr:()=>ex});var _e=wr({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ex=wr({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Wa={};Ke(Wa,{base64:()=>Tn,base64pad:()=>tx,base64url:()=>Ga,base64urlpad:()=>rx});var Tn=Re({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),tx=Re({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ga=Re({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),rx=Re({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Ya={};Ke(Ya,{base8:()=>nx});var nx=Re({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Qa={};Ke(Qa,{identity:()=>ix});var ix=Cn({prefix:"\0",name:"identity",encode:t=>b0(t),decode:t=>x0(t)});var g_=new TextEncoder,y_=new TextDecoder;var Za={};Ke(Za,{identity:()=>Er});var ax=A0,_0=128,cx=127,ux=~cx,lx=Math.pow(2,31);function A0(t,e,r){e=e||[],r=r||0;for(var n=r;t>=lx;)e[r++]=t&255|_0,t/=128;for(;t&ux;)e[r++]=t&255|_0,t>>>=7;return e[r]=t|0,A0.bytes=r-n+1,e}var fx=Xa,hx=128,S0=127;function Xa(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw Xa.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&S0)<=hx);return Xa.bytes=s-n,r}var dx=Math.pow(2,7),px=Math.pow(2,14),mx=Math.pow(2,21),gx=Math.pow(2,28),yx=Math.pow(2,35),xx=Math.pow(2,42),bx=Math.pow(2,49),wx=Math.pow(2,56),Ex=Math.pow(2,63),vx=function(t){return t[bi.decode(t,e),bi.decode.bytes],Bn=(t,e,r=0)=>(bi.encode(t,e,r),e),Ln=t=>bi.encodingLength(t);var Gt=(t,e)=>{let r=e.byteLength,n=Ln(t),i=n+Ln(r),s=new Uint8Array(i+r);return Bn(t,s,0),Bn(r,s,n),s.set(e,i),new Pn(t,r,e,s)},Yr=t=>{let e=nr(t),[r,n]=wi(e),[i,s]=wi(e.subarray(n)),o=e.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new Pn(r,i,o,e)},I0=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&y0(t.bytes,r.bytes)}},Pn=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var R0=0,Ax="identity",C0=nr,Ix=t=>Gt(R0,C0(t)),Er={code:R0,name:Ax,encode:C0,digest:Ix};var ec={};Ke(ec,{sha256:()=>Ye,sha512:()=>Rx});var Ja=({name:t,code:e,encode:r})=>new ja(t,e,r),ja=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?Gt(this.code,r):r.then(n=>Gt(this.code,n))}else throw Error("Unknown type, must be binary type")}};var B0=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Ye=Ja({name:"sha2-256",code:18,encode:B0("SHA-256")}),Rx=Ja({name:"sha2-512",code:19,encode:B0("SHA-512")});var L0=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return Tx(r,tc(t),e||_e.encoder);default:return Bx(r,tc(t),e||pt.encoder)}};var P0=new WeakMap,tc=t=>{let e=P0.get(t);if(e==null){let r=new Map;return P0.set(t,r),r}return e},Lt=class t{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==Ei)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Lx)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=Gt(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&I0(e.multihash,n.multihash)}toString(e){return L0(this,e)}toJSON(){return{"/":L0(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new t(n,i,s,o||D0(n,i,s.bytes))}else if(r[Px]===!0){let{version:n,multihash:i,code:s}=r,o=Yr(i);return t.create(n,s,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==Ei)throw new Error(`Version 0 CID must use dag-pb (code: ${Ei}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=D0(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,Ei,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=nr(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new Pn(r.multihashCode,r.digestSize,s,i);return[r.version===0?t.createV0(o):t.createV1(r.codec,o),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[f,h]=wi(e.subarray(r));return r+=h,f},i=n(),s=Ei;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),c=n(),u=r+c,l=u-o;return{version:i,codec:s,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,r){let[n,i]=Cx(e,r),s=t.decode(i);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return tc(s).set(n,e),s}},Cx=(t,e)=>{switch(t[0]){case"Q":{let r=e||_e;return[_e.prefix,r.decode(`${_e.prefix}${t}`)]}case _e.prefix:{let r=e||_e;return[_e.prefix,r.decode(t)]}case pt.prefix:{let r=e||pt;return[pt.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},Tx=(t,e,r)=>{let{prefix:n}=r;if(n!==_e.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let s=r.encode(t).slice(1);return e.set(n,s),s}else return i},Bx=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let s=r.encode(t);return e.set(n,s),s}else return i},Ei=112,Lx=18,D0=(t,e,r)=>{let n=Ln(t),i=n+Ln(e),s=new Uint8Array(i+r.byteLength);return Bn(t,s,0),Bn(e,s,n),s.set(r,i),s},Px=Symbol.for("@ipld/js-cid/CID");var vr={...Qa,...qa,...Ya,...Fa,...Ka,...$a,...za,...Ha,...Wa,...Va},D_={...ec,...Za};function ir(t=0){return globalThis.Buffer?.alloc!=null?Wr(globalThis.Buffer.alloc(t)):new Uint8Array(t)}function tt(t=0){return globalThis.Buffer?.allocUnsafe!=null?Wr(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function k0(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var N0=k0("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),rc=k0("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);let e=tt(t.length);for(let r=0;rtn,Ed25519PublicKey:()=>Ci,generateKeyPair:()=>Y2,generateKeyPairFromSeed:()=>ph,unmarshalEd25519PrivateKey:()=>G2,unmarshalEd25519PublicKey:()=>W2});function Se(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function M0(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");O0(t.outputLen),O0(t.blockLen)}function Dn(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function U0(t,e){nc(t);let r=e.outputLen;if(t.lengtht instanceof Uint8Array;var Is=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Pt=(t,e)=>t<<32-e|t>>>e,Nx=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Nx)throw new Error("Non little-endian hardware is not supported");function ic(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function vi(t){if(typeof t=="string"&&(t=ic(t)),!F0(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function Rs(...t){let e=new Uint8Array(t.reduce((n,i)=>n+i.length,0)),r=0;return t.forEach(n=>{if(!F0(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}var Nn=class{clone(){return this._cloneInto()}},W_={}.toString;function Cs(t){let e=n=>t().update(vi(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function kn(t=32){if(As&&typeof As.getRandomValues=="function")return As.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function kx(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,u=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+u,a,n)}var On=class extends Nn{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Is(this.buffer)}update(e){Dn(this);let{view:r,buffer:n,blockLen:i}=this;e=vi(e);let s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let f=o;fl.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f>sc&Ts)}:{h:Number(t>>sc&Ts)|0,l:Number(t&Ts)|0}}function Ox(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),Ux=(t,e,r)=>t>>>r,Fx=(t,e,r)=>t<<32-r|e>>>r,Kx=(t,e,r)=>t>>>r|e<<32-r,qx=(t,e,r)=>t<<32-r|e>>>r,Vx=(t,e,r)=>t<<64-r|e>>>r-32,$x=(t,e,r)=>t>>>r-32|e<<64-r,zx=(t,e)=>e,Hx=(t,e)=>t,Gx=(t,e,r)=>t<>>32-r,Wx=(t,e,r)=>e<>>32-r,Yx=(t,e,r)=>e<>>64-r,Qx=(t,e,r)=>t<>>64-r;function Xx(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var Zx=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),jx=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,Jx=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),e2=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,t2=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),r2=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0;var n2={fromBig:K0,split:Ox,toBig:Mx,shrSH:Ux,shrSL:Fx,rotrSH:Kx,rotrSL:qx,rotrBH:Vx,rotrBL:$x,rotr32H:zx,rotr32L:Hx,rotlSH:Gx,rotlSL:Wx,rotlBH:Yx,rotlBL:Qx,add:Xx,add3L:Zx,add3H:jx,add4L:Jx,add4H:e2,add5H:r2,add5L:t2},Z=n2;var[i2,s2]=Z.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),_r=new Uint32Array(80),Sr=new Uint32Array(80),oc=class extends On{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:u,El:l,Fh:f,Fl:h,Gh:p,Gl:d,Hh:m,Hl:g}=this;return[e,r,n,i,s,o,a,c,u,l,f,h,p,d,m,g]}set(e,r,n,i,s,o,a,c,u,l,f,h,p,d,m,g){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=l|0,this.Fh=f|0,this.Fl=h|0,this.Gh=p|0,this.Gl=d|0,this.H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l:o}=Z.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=Z.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l}=Z.add(this.Dh|0,this.Dl|0,u|0,l|0),{h:f,l:h}=Z.add(this.Eh|0,this.El|0,f|0,h|0),{h:p,l:d}=Z.add(this.Fh|0,this.Fl|0,p|0,d|0),{h:m,l:g}=Z.add(this.Gh|0,this.Gl|0,m|0,g|0),{h:y,l:x}=Z.add(this.Hh|0,this.Hl|0,y|0,x|0),this.set(n,i,s,o,a,c,u,l,f,h,p,d,m,g,y,x)}roundClean(){_r.fill(0),Sr.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var ac=Cs(()=>new oc);var Ps={};Ke(Ps,{bitGet:()=>h2,bitLen:()=>f2,bitMask:()=>_i,bitSet:()=>d2,bytesToHex:()=>sr,bytesToNumberBE:()=>or,bytesToNumberLE:()=>Ar,concatBytes:()=>ar,createHmacDrbg:()=>lc,ensureBytes:()=>Ce,equalBytes:()=>u2,hexToBytes:()=>Xr,hexToNumber:()=>uc,numberToBytesBE:()=>Ir,numberToBytesLE:()=>Zr,numberToHexUnpadded:()=>$0,numberToVarBytesBE:()=>c2,utf8ToBytes:()=>l2,validateObject:()=>Wt});var V0=BigInt(0),Bs=BigInt(1),o2=BigInt(2),Ls=t=>t instanceof Uint8Array,a2=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function sr(t){if(!Ls(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0)),r=0;return t.forEach(n=>{if(!Ls(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function u2(t,e){if(t.length!==e.length)return!1;for(let r=0;rV0;t>>=Bs,e+=1);return e}function h2(t,e){return t>>BigInt(e)&Bs}var d2=(t,e,r)=>t|(r?Bs:V0)<(o2<new Uint8Array(t),q0=t=>Uint8Array.from(t);function lc(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=cc(t),i=cc(t),s=0,o=()=>{n.fill(1),i.fill(0),s=0},a=(...f)=>r(i,n,...f),c=(f=cc())=>{i=a(q0([0]),f),n=a(),f.length!==0&&(i=a(q0([1]),f),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0,h=[];for(;f{o(),c(f);let p;for(;!(p=h(u()));)c();return o(),p}}var p2={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Wt(t,e,r={}){let n=(i,s,o)=>{let a=p2[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);let c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(let[i,s]of Object.entries(e))n(i,s,!1);for(let[i,s]of Object.entries(r))n(i,s,!0);return t}var Me=BigInt(0),be=BigInt(1),jr=BigInt(2),m2=BigInt(3),fc=BigInt(4),z0=BigInt(5),H0=BigInt(8),g2=BigInt(9),y2=BigInt(16);function pe(t,e){let r=t%e;return r>=Me?r:e+r}function x2(t,e,r){if(r<=Me||e 0");if(r===be)return Me;let n=be;for(;e>Me;)e&be&&(n=n*t%r),t=t*t%r,e>>=be;return n}function we(t,e,r){let n=t;for(;e-- >Me;)n*=n,n%=r;return n}function Ds(t,e){if(t===Me||e<=Me)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=pe(t,e),n=e,i=Me,s=be,o=be,a=Me;for(;r!==Me;){let u=n/r,l=n%r,f=i-o*u,h=s-a*u;n=r,r=l,i=o,s=a,o=f,a=h}if(n!==be)throw new Error("invert: does not exist");return pe(i,e)}function b2(t){let e=(t-be)/jr,r,n,i;for(r=t-be,n=0;r%jr===Me;r/=jr,n++);for(i=jr;i(pe(t,e)&be)===be,E2=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function hc(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=E2.reduce((n,i)=>(n[i]="function",n),e);return Wt(t,r)}function v2(t,e,r){if(r 0");if(r===Me)return t.ONE;if(r===be)return e;let n=t.ONE,i=e;for(;r>Me;)r&be&&(n=t.mul(n,i)),i=t.sqr(i),r>>=be;return n}function _2(t,e){let r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function dc(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Ns(t,e,r=!1,n={}){if(t<=Me)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:s}=dc(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=w2(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:_i(i),ZERO:Me,ONE:be,create:c=>pe(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Me<=c&&cc===Me,isOdd:c=>(c&be)===be,neg:c=>pe(-c,t),eql:(c,u)=>c===u,sqr:c=>pe(c*c,t),add:(c,u)=>pe(c+u,t),sub:(c,u)=>pe(c-u,t),mul:(c,u)=>pe(c*u,t),pow:(c,u)=>v2(a,c,u),div:(c,u)=>pe(c*Ds(u,t),t),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>Ds(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>_2(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>r?Zr(c,s):Ir(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?Ar(c):or(c)}});return Object.freeze(a)}function W0(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}function Y0(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function pc(t){let e=Y0(t);return e+Math.ceil(e/2)}function Q0(t,e,r=!1){let n=t.length,i=Y0(e),s=pc(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let o=r?or(t):Ar(t),a=pe(o,e-be)+be;return r?Zr(a,i):Ir(a,i)}var A2=BigInt(0),mc=BigInt(1);function ks(t,e){let r=(i,s)=>{let o=s.negate();return i?o:s},n=i=>{let s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>A2;)s&mc&&(o=o.add(a)),a=a.double(),s>>=mc;return o},precomputeWindow(i,s){let{windows:o,windowSize:a}=n(s),c=[],u=i,l=u;for(let f=0;f>=p,g>c&&(g-=h,o+=mc);let y=m,x=m+Math.abs(g)-1,b=d%2!==0,I=g<0;g===0?l=l.add(r(b,s[y])):u=u.add(r(I,s[x]))}return{p:u,f:l}},wNAFCached(i,s,o,a){let c=i._WINDOW_SIZE||1,u=s.get(i);return u||(u=this.precomputeWindow(i,c),c!==1&&s.set(i,a(u))),this.wNAF(c,u,o)}}}function Si(t){return hc(t.Fp),Wt(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...dc(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var Dt=BigInt(0),mt=BigInt(1),Os=BigInt(2),I2=BigInt(8),R2={zip215:!0};function C2(t){let e=Si(t);return Wt(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Ms(t){let e=C2(t),{Fp:r,n,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,u=Os<{try{return{isValid:!0,value:r.sqrt(N*r.inv(R))}}catch{return{isValid:!1,value:Dt}}}),h=e.adjustScalarBytes||(N=>N),p=e.domain||((N,R,U)=>{if(R.length||U)throw new Error("Contexts/pre-hash are not supported");return N}),d=N=>typeof N=="bigint"&&Dtd(N)&&d(R)&&NN===Dt||m(N,u);function y(N,R){if(m(N,R))return N;throw new Error(`Expected valid scalar < ${R}, got ${typeof N} ${N}`)}function x(N){return N===Dt?N:y(N,n)}let b=new Map;function I(N){if(!(N instanceof v))throw new Error("ExtendedPoint expected")}class v{constructor(R,U,q,H){if(this.ex=R,this.ey=U,this.ez=q,this.et=H,!g(R))throw new Error("x required");if(!g(U))throw new Error("y required");if(!g(q))throw new Error("z required");if(!g(H))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(R){if(R instanceof v)throw new Error("extended point not allowed");let{x:U,y:q}=R||{};if(!g(U)||!g(q))throw new Error("invalid affine point");return new v(U,q,mt,l(U*q))}static normalizeZ(R){let U=r.invertBatch(R.map(q=>q.ez));return R.map((q,H)=>q.toAffine(U[H])).map(v.fromAffine)}_setWindowSize(R){this._WINDOW_SIZE=R,b.delete(this)}assertValidity(){let{a:R,d:U}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:q,ey:H,ez:j,et:te}=this,le=l(q*q),re=l(H*H),oe=l(j*j),De=l(oe*oe),Ie=l(le*R),Ge=l(oe*l(Ie+re)),We=l(De+l(U*l(le*re)));if(Ge!==We)throw new Error("bad point: equation left != right (1)");let Oe=l(q*H),et=l(j*te);if(Oe!==et)throw new Error("bad point: equation left != right (2)")}equals(R){I(R);let{ex:U,ey:q,ez:H}=this,{ex:j,ey:te,ez:le}=R,re=l(U*le),oe=l(j*H),De=l(q*le),Ie=l(te*H);return re===oe&&De===Ie}is0(){return this.equals(v.ZERO)}negate(){return new v(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){let{a:R}=e,{ex:U,ey:q,ez:H}=this,j=l(U*U),te=l(q*q),le=l(Os*l(H*H)),re=l(R*j),oe=U+q,De=l(l(oe*oe)-j-te),Ie=re+te,Ge=Ie-le,We=re-te,Oe=l(De*Ge),et=l(Ie*We),Jt=l(De*We),qr=l(Ge*Ie);return new v(Oe,et,qr,Jt)}add(R){I(R);let{a:U,d:q}=e,{ex:H,ey:j,ez:te,et:le}=this,{ex:re,ey:oe,ez:De,et:Ie}=R;if(U===BigInt(-1)){let zl=l((j-H)*(oe+re)),Hl=l((j+H)*(oe-re)),ha=l(Hl-zl);if(ha===Dt)return this.double();let Gl=l(te*Os*Ie),Wl=l(le*Os*De),Yl=Wl+Gl,Ql=Hl+zl,Xl=Wl-Gl,Xm=l(Yl*ha),Zm=l(Ql*Xl),jm=l(Yl*Xl),Jm=l(ha*Ql);return new v(Xm,Zm,Jm,jm)}let Ge=l(H*re),We=l(j*oe),Oe=l(le*q*Ie),et=l(te*De),Jt=l((H+j)*(re+oe)-Ge-We),qr=et-Oe,fi=et+Oe,$l=l(We-U*Ge),Gm=l(Jt*qr),Wm=l(fi*$l),Ym=l(Jt*$l),Qm=l(qr*fi);return new v(Gm,Wm,Qm,Ym)}subtract(R){return this.add(R.negate())}wNAF(R){return D.wNAFCached(this,b,R,v.normalizeZ)}multiply(R){let{p:U,f:q}=this.wNAF(y(R,n));return v.normalizeZ([U,q])[0]}multiplyUnsafe(R){let U=x(R);return U===Dt?P:this.equals(P)||U===mt?this:this.equals(_)?this.wNAF(U).p:D.unsafeLadder(this,U)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return D.unsafeLadder(this,n).is0()}toAffine(R){let{ex:U,ey:q,ez:H}=this,j=this.is0();R==null&&(R=j?I2:r.inv(H));let te=l(U*R),le=l(q*R),re=l(H*R);if(j)return{x:Dt,y:mt};if(re!==mt)throw new Error("invZ was invalid");return{x:te,y:le}}clearCofactor(){let{h:R}=e;return R===mt?this:this.multiplyUnsafe(R)}static fromHex(R,U=!1){let{d:q,a:H}=e,j=r.BYTES;R=Ce("pointHex",R,j);let te=R.slice(),le=R[j-1];te[j-1]=le&-129;let re=Ar(te);re===Dt||(U?y(re,u):y(re,r.ORDER));let oe=l(re*re),De=l(oe-mt),Ie=l(q*oe-H),{isValid:Ge,value:We}=f(De,Ie);if(!Ge)throw new Error("Point.fromHex: invalid y coordinate");let Oe=(We&mt)===mt,et=(le&128)!==0;if(!U&&We===Dt&&et)throw new Error("Point.fromHex: x=0 and x_0=1");return et!==Oe&&(We=l(-We)),v.fromAffine({x:We,y:re})}static fromPrivateKey(R){return z(R).point}toRawBytes(){let{x:R,y:U}=this.toAffine(),q=Zr(U,r.BYTES);return q[q.length-1]|=R&mt?128:0,q}toHex(){return sr(this.toRawBytes())}}v.BASE=new v(e.Gx,e.Gy,mt,l(e.Gx*e.Gy)),v.ZERO=new v(Dt,mt,mt,Dt);let{BASE:_,ZERO:P}=v,D=ks(v,a*8);function G(N){return pe(N,n)}function W(N){return G(Ar(N))}function z(N){let R=a;N=Ce("private key",N,R);let U=Ce("hashed private key",s(N),2*R),q=h(U.slice(0,R)),H=U.slice(R,2*R),j=W(q),te=_.multiply(j),le=te.toRawBytes();return{head:q,prefix:H,scalar:j,point:te,pointBytes:le}}function ee(N){return z(N).pointBytes}function he(N=new Uint8Array,...R){let U=ar(...R);return W(s(p(U,Ce("context",N),!!i)))}function He(N,R,U={}){N=Ce("message",N),i&&(N=i(N));let{prefix:q,scalar:H,pointBytes:j}=z(R),te=he(U.context,q,N),le=_.multiply(te).toRawBytes(),re=he(U.context,le,j,N),oe=G(te+re*H);x(oe);let De=ar(le,Zr(oe,r.BYTES));return Ce("result",De,a*2)}let T=R2;function k(N,R,U,q=T){let{context:H,zip215:j}=q,te=r.BYTES;N=Ce("signature",N,2*te),R=Ce("message",R),i&&(R=i(R));let le=Ar(N.slice(te,2*te)),re,oe,De;try{re=v.fromHex(U,j),oe=v.fromHex(N.slice(0,te),j),De=_.multiplyUnsafe(le)}catch{return!1}if(!j&&re.isSmallOrder())return!1;let Ie=he(H,oe.toRawBytes(),re.toRawBytes(),R);return oe.add(re.multiplyUnsafe(Ie)).subtract(De).clearCofactor().equals(v.ZERO)}return _._setWindowSize(8),{CURVE:e,getPublicKey:ee,sign:He,verify:k,ExtendedPoint:v,utils:{getExtendedPublicKey:z,randomPrivateKey:()=>o(r.BYTES),precompute(N=8,R=v.BASE){return R._setWindowSize(N),R.multiply(BigInt(3)),R}}}}var yc=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),X0=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),mS=BigInt(0),T2=BigInt(1),gc=BigInt(2),B2=BigInt(5),Z0=BigInt(10),L2=BigInt(20),P2=BigInt(40),j0=BigInt(80);function D2(t){let e=yc,n=t*t%e*t%e,i=we(n,gc,e)*n%e,s=we(i,T2,e)*t%e,o=we(s,B2,e)*s%e,a=we(o,Z0,e)*o%e,c=we(a,L2,e)*a%e,u=we(c,P2,e)*c%e,l=we(u,j0,e)*u%e,f=we(l,j0,e)*u%e,h=we(f,Z0,e)*o%e;return{pow_p_5_8:we(h,gc,e)*t%e,b2:n}}function N2(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function k2(t,e){let r=yc,n=pe(e*e*e,r),i=pe(n*n*e,r),s=D2(t*i).pow_p_5_8,o=pe(t*n*s,r),a=pe(e*o*o,r),c=o,u=pe(o*X0,r),l=a===t,f=a===pe(-t,r),h=a===pe(-t*X0,r);return l&&(o=c),(f||h)&&(o=u),G0(o,r)&&(o=pe(-o,r)),{isValid:l||f,value:o}}var cr=Ns(yc,void 0,!0),xc={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:cr,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:ac,randomBytes:kn,adjustScalarBytes:N2,uvRatio:k2},Mn=Ms(xc);function J0(t,e,r){if(e.length>255)throw new Error("Context is too big");return Rs(ic("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,e.length]),e,t)}var gS=Ms({...xc,domain:J0}),yS=Ms({...xc,domain:J0,prehash:ac});var O2=(cr.ORDER+BigInt(3))/BigInt(8),xS=cr.pow(gc,O2),bS=cr.sqrt(cr.neg(cr.ONE)),wS=(cr.ORDER-BigInt(5))/BigInt(8),ES=BigInt(486662);var vS=W0(cr,cr.neg(BigInt(486664)));var _S=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),SS=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),AS=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),IS=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var RS=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Un=32,ur=64,Us=32;async function eh(){let t=Mn.utils.randomPrivateKey(),e=Mn.getPublicKey(t);return{privateKey:ih(t,e),publicKey:e}}async function th(t){if(t.length!==Us)throw new TypeError('"seed" must be 32 bytes in length.');if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');let e=t,r=Mn.getPublicKey(e);return{privateKey:ih(e,r),publicKey:r}}async function rh(t,e){let r=t.subarray(0,Us);return Mn.sign(e,r)}async function nh(t,e,r){return Mn.verify(e,r,t)}function ih(t,e){let r=new Uint8Array(ur);for(let n=0;ni+s.length,0));let r=tt(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return Wr(r)}var ft={get(t=globalThis){let e=t.crypto;if(e==null||e.subtle==null)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p/blob/main/packages/crypto/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return e}};var bc={alg:"A128GCM",ext:!0,k:"scm9jmO_4BJAgdwWGVulLg",key_ops:["encrypt","decrypt"],kty:"oct"};function wc(t){let e=t?.algorithm??"AES-GCM",r=t?.keyLength??16,n=t?.nonceLength??12,i=t?.digest??"SHA-256",s=t?.saltLength??16,o=t?.iterations??32767,a=ft.get();r*=8;async function c(f,h){let p=a.getRandomValues(new Uint8Array(s)),d=a.getRandomValues(new Uint8Array(n)),m={name:e,iv:d};typeof h=="string"&&(h=Q(h));let g;if(h.length===0){g=await a.subtle.importKey("jwk",bc,{name:"AES-GCM"},!0,["encrypt"]);try{let x={name:"PBKDF2",salt:p,iterations:o,hash:{name:i}},b=await a.subtle.importKey("raw",h,{name:"PBKDF2"},!1,["deriveKey"]);g=await a.subtle.deriveKey(x,b,{name:e,length:r},!0,["encrypt"])}catch{g=await a.subtle.importKey("jwk",bc,{name:"AES-GCM"},!0,["encrypt"])}}else{let x={name:"PBKDF2",salt:p,iterations:o,hash:{name:i}},b=await a.subtle.importKey("raw",h,{name:"PBKDF2"},!1,["deriveKey"]);g=await a.subtle.deriveKey(x,b,{name:e,length:r},!0,["encrypt"])}let y=await a.subtle.encrypt(m,g,f);return Te([p,m.iv,new Uint8Array(y)])}async function u(f,h){let p=f.subarray(0,s),d=f.subarray(s,s+n),m=f.subarray(s+n),g={name:e,iv:d};typeof h=="string"&&(h=Q(h));let y;if(h.length===0)try{let b={name:"PBKDF2",salt:p,iterations:o,hash:{name:i}},I=await a.subtle.importKey("raw",h,{name:"PBKDF2"},!1,["deriveKey"]);y=await a.subtle.deriveKey(b,I,{name:e,length:r},!0,["decrypt"])}catch{y=await a.subtle.importKey("jwk",bc,{name:"AES-GCM"},!0,["decrypt"])}else{let b={name:"PBKDF2",salt:p,iterations:o,hash:{name:i}},I=await a.subtle.importKey("raw",h,{name:"PBKDF2"},!1,["deriveKey"]);y=await a.subtle.deriveKey(b,I,{name:e,length:r},!0,["decrypt"])}let x=await a.subtle.decrypt(g,y,m);return new Uint8Array(x)}return{encrypt:c,decrypt:u}}async function Fn(t,e){let n=await wc().encrypt(t,e);return Tn.encode(n)}var Ec=new Float32Array([-0]),Rr=new Uint8Array(Ec.buffer);function oh(t,e,r){Ec[0]=t,e[r]=Rr[0],e[r+1]=Rr[1],e[r+2]=Rr[2],e[r+3]=Rr[3]}function ah(t,e){return Rr[0]=t[e],Rr[1]=t[e+1],Rr[2]=t[e+2],Rr[3]=t[e+3],Ec[0]}var vc=new Float64Array([-0]),rt=new Uint8Array(vc.buffer);function ch(t,e,r){vc[0]=t,e[r]=rt[0],e[r+1]=rt[1],e[r+2]=rt[2],e[r+3]=rt[3],e[r+4]=rt[4],e[r+5]=rt[5],e[r+6]=rt[6],e[r+7]=rt[7]}function uh(t,e){return rt[0]=t[e],rt[1]=t[e+1],rt[2]=t[e+2],rt[3]=t[e+3],rt[4]=t[e+4],rt[5]=t[e+5],rt[6]=t[e+6],rt[7]=t[e+7],vc[0]}var U2=BigInt(Number.MAX_SAFE_INTEGER),F2=BigInt(Number.MIN_SAFE_INTEGER),ht=class t{lo;hi;constructor(e,r){this.lo=e|0,this.hi=r|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return Jr;if(eF2)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,i=e-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>lh&&(i=0n,++n>lh&&(n=0n))),new t(Number(i),Number(n))}static fromNumber(e){if(e===0)return Jr;let r=e<0;r&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new t(n,i)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):Jr}},Jr=new ht(0,0);Jr.toBigInt=function(){return 0n};Jr.zzEncode=Jr.zzDecode=function(){return this};Jr.length=function(){return 1};var lh=4294967296n;function fh(t){let e=0,r=0;for(let n=0;n191&&a<224?s[o++]=(a&31)<<6|t[e++]&63:a>239&&a<365?(a=((a&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,s[o++]=55296+(a>>10),s[o++]=56320+(a&1023)):s[o++]=(a&15)<<12|(t[e++]&63)<<6|t[e++]&63,o>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,s)),o=0);return i!=null?(o>0&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))}function _c(t,e,r){let n=r,i,s;for(let o=0;o>6|192,e[r++]=i&63|128):(i&64512)===55296&&((s=t.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(s&1023),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128);return r-n}function Nt(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Fs(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var Sc=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,Nt(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw Nt(this,4);return Fs(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw Nt(this,4);return Fs(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw Nt(this,4);let e=ah(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw Nt(this,4);let e=uh(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw Nt(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return hh(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw Nt(this,e);this.pos+=e}else do if(this.pos>=this.len)throw Nt(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new ht(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw Nt(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw Nt(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw Nt(this,8);let e=Fs(this.buf,this.pos+=4),r=Fs(this.buf,this.pos+=4);return new ht(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Ac(t){return new Sc(t instanceof Uint8Array?t:t.subarray())}function Qe(t,e){let r=Ac(t);return e.decode(r)}function Ic(t){let e=t??8192,r=e>>>1,n,i=e;return function(o){if(o<1||o>r)return tt(o);i+o>e&&(n=tt(e),i=0);let a=n.subarray(i,i+=o);return i&7&&(i=(i|7)+1),a}}var en=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function Rc(){}var Tc=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},K2=Ic();function q2(t){return globalThis.Buffer!=null?tt(t):K2(t)}var Ri=class{len;head;tail;states;constructor(){this.len=0,this.head=new en(Rc,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new en(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new Bc((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(Ai,10,ht.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=ht.fromBigInt(e);return this._push(Ai,r.length(),r)}uint64Number(e){let r=ht.fromNumber(e);return this._push(Ai,r.length(),r)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=ht.fromBigInt(e).zzEncode();return this._push(Ai,r.length(),r)}sint64Number(e){let r=ht.fromNumber(e).zzEncode();return this._push(Ai,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(Cc,1,e?1:0)}fixed32(e){return this._push(Ii,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=ht.fromBigInt(e);return this._push(Ii,4,r.lo)._push(Ii,4,r.hi)}fixed64Number(e){let r=ht.fromNumber(e);return this._push(Ii,4,r.lo)._push(Ii,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(oh,4,e)}double(e){return this._push(ch,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(Cc,1,0):this.uint32(r)._push($2,r,e)}string(e){let r=fh(e);return r!==0?this.uint32(r)._push(_c,r,e):this._push(Cc,1,0)}fork(){return this.states=new Tc(this),this.head=this.tail=new en(Rc,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new en(Rc,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=q2(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function Cc(t,e,r){e[r]=t&255}function V2(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var Bc=class extends en{next;constructor(e,r){super(V2,e,r),this.next=void 0}};function Ai(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function Ii(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function $2(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(Ri.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(z2,e,t),this},Ri.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(H2,e,t),this});function z2(t,e,r){e.set(t,r)}function H2(t,e,r){t.length<40?_c(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(Q(t),r)}function Lc(){return new Ri}function Xe(t,e){let r=Lc();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var Kn;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(Kn||(Kn={}));function Ks(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function Pc(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(s,o){let a=e(s);o.int32(a)},n=function(s){let o=s.int32();return e(o)};return Ks("enum",Kn.VARINT,r,n)}function Ze(t,e){return Ks("message",Kn.LENGTH_DELIMITED,t,e)}var Ee;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.Secp256k1="Secp256k1"})(Ee||(Ee={}));var Dc;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.Secp256k1=2]="Secp256k1"})(Dc||(Dc={}));(function(t){t.codec=()=>Pc(Dc)})(Ee||(Ee={}));var Yt;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),Ee.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=Ee.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(Yt||(Yt={}));var Qt;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),Ee.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=Ee.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(Qt||(Qt={}));var Ci=class{_key;constructor(e){this._key=qn(e,Un)}async verify(e,r){return nh(this._key,r,e)}marshal(){return this._key}get bytes(){return Yt.encode({Type:Ee.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}},tn=class{_key;_publicKey;constructor(e,r){this._key=qn(e,ur),this._publicKey=qn(r,Un)}async sign(e){return rh(this._key,e)}get public(){return new Ci(this._publicKey)}marshal(){return this._key}get bytes(){return Qt.encode({Type:Ee.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}async id(){let e=Er.digest(this.public.bytes);return _e.encode(e.bytes).substring(1)}async export(e,r="libp2p-key"){if(r==="libp2p-key")return Fn(this.bytes,e);throw new S(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function G2(t){if(t.length>ur){t=qn(t,ur+Un);let n=t.subarray(0,ur),i=t.subarray(ur,t.length);return new tn(n,i)}t=qn(t,ur);let e=t.subarray(0,ur),r=t.subarray(Un);return new tn(e,r)}function W2(t){return t=qn(t,Un),new Ci(t)}async function Y2(){let{privateKey:t,publicKey:e}=await eh();return new tn(t,e)}async function ph(t){let{privateKey:e,publicKey:r}=await th(t);return new tn(e,r)}function qn(t,e){if(t=Uint8Array.from(t??[]),t.length!==e)throw new S(`Key must be a Uint8Array of length ${e}, got ${t.length}`,"ERR_INVALID_KEY_TYPE");return t}function se(t,e="utf8"){let r=Ss[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var _A=ve(Ne(),1),SA=ve(xs(),1),mh=ve(de(),1);function kt(t,e){let r=Uint8Array.from(t.abs().toByteArray());if(r=r[0]===0?r.subarray(1):r,e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Te([new Uint8Array(e-r.length),r])}return se(r,"base64url")}function gt(t){let e=gh(t);return new mh.default.jsbn.BigInteger(se(e,"base16"),16)}function gh(t,e){let r=Q(t,"base64urlpad");if(e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Te([new Uint8Array(e-r.length),r])}return r}var Q2={"P-256":256,"P-384":384,"P-521":521},X2=Object.keys(Q2),kA=X2.join(" / ");var Fc={};Ke(Fc,{MAX_KEY_SIZE:()=>Pi,RsaPrivateKey:()=>Vn,RsaPublicKey:()=>Li,fromJwk:()=>ab,generateKeyPair:()=>cb,unmarshalRsaPrivateKey:()=>sb,unmarshalRsaPublicKey:()=>ob});var Bi=ve(de(),1);var bI=ve(Eh(),1);function Vs(t){if(isNaN(t)||t<=0)throw new S("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return kn(t)}var tI=ve(Es(),1),Mc=ve(de(),1);function vh(t,e){return e.map(r=>gt(t[r]))}function _h(t){return Mc.default.pki.setRsaPrivateKey(...vh(t,["n","e","d","p","q","dp","dq","qi"]))}function Sh(t){return Mc.default.pki.setRsaPublicKey(...vh(t,["n","e"]))}var nn={};Ke(nn,{jwkToPkcs1:()=>eb,jwkToPkix:()=>rb,pkcs1ToJwk:()=>J2,pkixToJwk:()=>tb});var iI=ve(mi(),1),sI=ve(Es(),1);var lr=ve(de(),1);function J2(t){let e=lr.default.asn1.fromDer(se(t,"ascii")),r=lr.default.pki.privateKeyFromAsn1(e);return{kty:"RSA",n:kt(r.n),e:kt(r.e),d:kt(r.d),p:kt(r.p),q:kt(r.q),dp:kt(r.dP),dq:kt(r.dQ),qi:kt(r.qInv),alg:"RS256"}}function eb(t){if(t.n==null||t.e==null||t.d==null||t.p==null||t.q==null||t.dp==null||t.dq==null||t.qi==null)throw new S("JWK was missing components","ERR_INVALID_PARAMETERS");let e=lr.default.pki.privateKeyToAsn1({n:gt(t.n),e:gt(t.e),d:gt(t.d),p:gt(t.p),q:gt(t.q),dP:gt(t.dp),dQ:gt(t.dq),qInv:gt(t.qi)});return Q(lr.default.asn1.toDer(e).getBytes(),"ascii")}function tb(t){let e=lr.default.asn1.fromDer(se(t,"ascii")),r=lr.default.pki.publicKeyFromAsn1(e);return{kty:"RSA",n:kt(r.n),e:kt(r.e)}}function rb(t){if(t.n==null||t.e==null)throw new S("JWK was missing components","ERR_INVALID_PARAMETERS");let e=lr.default.pki.publicKeyToAsn1({n:gt(t.n),e:gt(t.e)});return Q(lr.default.asn1.toDer(e).getBytes(),"ascii")}async function Ah(t){let e=await ft.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await Ch(e);return{privateKey:r[0],publicKey:r[1]}}async function Uc(t){let r=[await ft.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await nb(t)],n=await Ch({privateKey:r[0],publicKey:r[1]});return{privateKey:n[0],publicKey:n[1]}}async function Ih(t,e){let r=await ft.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),n=await ft.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(e));return new Uint8Array(n,0,n.byteLength)}async function Rh(t,e,r){let n=await ft.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return ft.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},n,e,r)}async function Ch(t){if(t.privateKey==null||t.publicKey==null)throw new S("Private and public key are required","ERR_INVALID_PARAMETERS");return Promise.all([ft.get().subtle.exportKey("jwk",t.privateKey),ft.get().subtle.exportKey("jwk",t.publicKey)])}async function nb(t){return ft.get().subtle.importKey("jwk",{kty:t.kty,n:t.n,e:t.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}function Th(t,e,r,n){let i=e?Sh(t):_h(t),s=se(Uint8Array.from(r),"ascii"),o=n(s,i);return Q(o,"ascii")}function Bh(t,e){return Th(t,!0,e,(r,n)=>n.encrypt(r))}function Lh(t,e){return Th(t,!1,e,(r,n)=>n.decrypt(r))}function $s(t){if(t.kty!=="RSA")throw new S("invalid key type","ERR_INVALID_KEY_TYPE");if(t.n==null)throw new S("invalid key modulus","ERR_INVALID_KEY_MODULUS");return Q(t.n,"base64url").length*8}var Pi=8192,Li=class{_key;constructor(e){this._key=e}async verify(e,r){return Rh(this._key,r,e)}marshal(){return nn.jwkToPkix(this._key)}get bytes(){return Yt.encode({Type:Ee.RSA,Data:this.marshal()}).subarray()}encrypt(e){return Bh(this._key,e)}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}},Vn=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r}genSecret(){return Vs(16)}async sign(e){return Ih(this._key,e)}get public(){if(this._publicKey==null)throw new S("public key not provided","ERR_PUBKEY_NOT_PROVIDED");return new Li(this._publicKey)}decrypt(e){return Lh(this._key,e)}marshal(){return nn.jwkToPkcs1(this._key)}get bytes(){return Qt.encode({Type:Ee.RSA,Data:this.marshal()}).subarray()}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}async id(){let e=await this.public.hash();return se(e,"base58btc")}async export(e,r="pkcs-8"){if(r==="pkcs-8"){let n=new Bi.default.util.ByteBuffer(this.marshal()),i=Bi.default.asn1.fromDer(n),s=Bi.default.pki.privateKeyFromAsn1(i),o={algorithm:"aes256",count:1e4,saltSize:128/8,prfAlgorithm:"sha512"};return Bi.default.pki.encryptRsaPrivateKey(s,e,o)}else{if(r==="libp2p-key")return Fn(this.bytes,e);throw new S(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}}};async function sb(t){let e=nn.pkcs1ToJwk(t);if($s(e)>Pi)throw new S("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let r=await Uc(e);return new Vn(r.privateKey,r.publicKey)}function ob(t){let e=nn.pkixToJwk(t);if($s(e)>Pi)throw new S("key size is too large","ERR_KEY_SIZE_TOO_LARGE");return new Li(e)}async function ab(t){if($s(t)>Pi)throw new S("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await Uc(t);return new Vn(e.privateKey,e.publicKey)}async function cb(t){if(t>Pi)throw new S("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await Ah(t);return new Vn(e.privateKey,e.publicKey)}var Hc={};Ke(Hc,{Secp256k1PrivateKey:()=>Ni,Secp256k1PublicKey:()=>Di,generateKeyPair:()=>_b,unmarshalSecp256k1PrivateKey:()=>Eb,unmarshalSecp256k1PublicKey:()=>vb});var ub=(t,e,r)=>t&e^~t&r,lb=(t,e,r)=>t&e^t&r^e&r,fb=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Cr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Tr=new Uint32Array(64),Kc=class extends On{constructor(){super(64,32,8,!1),this.A=Cr[0]|0,this.B=Cr[1]|0,this.C=Cr[2]|0,this.D=Cr[3]|0,this.E=Cr[4]|0,this.F=Cr[5]|0,this.G=Cr[6]|0,this.H=Cr[7]|0}get(){let{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let f=0;f<16;f++,r+=4)Tr[f]=e.getUint32(r,!1);for(let f=16;f<64;f++){let h=Tr[f-15],p=Tr[f-2],d=Pt(h,7)^Pt(h,18)^h>>>3,m=Pt(p,17)^Pt(p,19)^p>>>10;Tr[f]=m+Tr[f-7]+d+Tr[f-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:u,H:l}=this;for(let f=0;f<64;f++){let h=Pt(a,6)^Pt(a,11)^Pt(a,25),p=l+h+ub(a,c,u)+fb[f]+Tr[f]|0,m=(Pt(n,2)^Pt(n,13)^Pt(n,22))+lb(n,i,s)|0;l=u,u=c,c=a,a=o+p|0,o=s,s=i,i=n,n=p+m|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,i,s,o,a,c,u,l)}roundClean(){Tr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Ph=Cs(()=>new Kc);function hb(t){let e=Si(t);Wt(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:db,hexToBytes:pb}=Ps,sn={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){let{Err:e}=sn;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:db(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=sn,r=typeof t=="string"?pb(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:s}=sn._parseInt(r.subarray(2)),{d:o,l:a}=sn._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){let e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,r=u=>{let l=u.toString(16);return l.length&1?`0${l}`:l},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},fr=BigInt(0),It=BigInt(1),CI=BigInt(2),Dh=BigInt(3),TI=BigInt(4);function mb(t){let e=hb(t),{Fp:r}=e,n=e.toBytes||((d,m,g)=>{let y=m.toAffine();return ar(Uint8Array.from([4]),r.toBytes(y.x),r.toBytes(y.y))}),i=e.fromBytes||(d=>{let m=d.subarray(1),g=r.fromBytes(m.subarray(0,r.BYTES)),y=r.fromBytes(m.subarray(r.BYTES,2*r.BYTES));return{x:g,y}});function s(d){let{a:m,b:g}=e,y=r.sqr(d),x=r.mul(y,d);return r.add(r.add(x,r.mul(d,m)),g)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(d){return typeof d=="bigint"&&frr.eql(b,r.ZERO);return x(g)&&x(y)?f.ZERO:new f(g,y,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){let g=r.invertBatch(m.map(y=>y.pz));return m.map((y,x)=>y.toAffine(g[x])).map(f.fromAffine)}static fromHex(m){let g=f.fromAffine(i(Ce("pointHex",m)));return g.assertValidity(),g}static fromPrivateKey(m){return f.BASE.multiply(c(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:m,y:g}=this.toAffine();if(!r.isValid(m)||!r.isValid(g))throw new Error("bad point: x or y not FE");let y=r.sqr(g),x=s(m);if(!r.eql(y,x))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:m}=this.toAffine();if(r.isOdd)return!r.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){l(m);let{px:g,py:y,pz:x}=this,{px:b,py:I,pz:v}=m,_=r.eql(r.mul(g,v),r.mul(b,x)),P=r.eql(r.mul(y,v),r.mul(I,x));return _&&P}negate(){return new f(this.px,r.neg(this.py),this.pz)}double(){let{a:m,b:g}=e,y=r.mul(g,Dh),{px:x,py:b,pz:I}=this,v=r.ZERO,_=r.ZERO,P=r.ZERO,D=r.mul(x,x),G=r.mul(b,b),W=r.mul(I,I),z=r.mul(x,b);return z=r.add(z,z),P=r.mul(x,I),P=r.add(P,P),v=r.mul(m,P),_=r.mul(y,W),_=r.add(v,_),v=r.sub(G,_),_=r.add(G,_),_=r.mul(v,_),v=r.mul(z,v),P=r.mul(y,P),W=r.mul(m,W),z=r.sub(D,W),z=r.mul(m,z),z=r.add(z,P),P=r.add(D,D),D=r.add(P,D),D=r.add(D,W),D=r.mul(D,z),_=r.add(_,D),W=r.mul(b,I),W=r.add(W,W),D=r.mul(W,z),v=r.sub(v,D),P=r.mul(W,G),P=r.add(P,P),P=r.add(P,P),new f(v,_,P)}add(m){l(m);let{px:g,py:y,pz:x}=this,{px:b,py:I,pz:v}=m,_=r.ZERO,P=r.ZERO,D=r.ZERO,G=e.a,W=r.mul(e.b,Dh),z=r.mul(g,b),ee=r.mul(y,I),he=r.mul(x,v),He=r.add(g,y),T=r.add(b,I);He=r.mul(He,T),T=r.add(z,ee),He=r.sub(He,T),T=r.add(g,x);let k=r.add(b,v);return T=r.mul(T,k),k=r.add(z,he),T=r.sub(T,k),k=r.add(y,x),_=r.add(I,v),k=r.mul(k,_),_=r.add(ee,he),k=r.sub(k,_),D=r.mul(G,T),_=r.mul(W,he),D=r.add(_,D),_=r.sub(ee,D),D=r.add(ee,D),P=r.mul(_,D),ee=r.add(z,z),ee=r.add(ee,z),he=r.mul(G,he),T=r.mul(W,T),ee=r.add(ee,he),he=r.sub(z,he),he=r.mul(G,he),T=r.add(T,he),z=r.mul(ee,T),P=r.add(P,z),z=r.mul(k,T),_=r.mul(He,_),_=r.sub(_,z),z=r.mul(He,ee),D=r.mul(k,D),D=r.add(D,z),new f(_,P,D)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return p.wNAFCached(this,u,m,g=>{let y=r.invertBatch(g.map(x=>x.pz));return g.map((x,b)=>x.toAffine(y[b])).map(f.fromAffine)})}multiplyUnsafe(m){let g=f.ZERO;if(m===fr)return g;if(a(m),m===It)return this;let{endo:y}=e;if(!y)return p.unsafeLadder(this,m);let{k1neg:x,k1:b,k2neg:I,k2:v}=y.splitScalar(m),_=g,P=g,D=this;for(;b>fr||v>fr;)b&It&&(_=_.add(D)),v&It&&(P=P.add(D)),D=D.double(),b>>=It,v>>=It;return x&&(_=_.negate()),I&&(P=P.negate()),P=new f(r.mul(P.px,y.beta),P.py,P.pz),_.add(P)}multiply(m){a(m);let g=m,y,x,{endo:b}=e;if(b){let{k1neg:I,k1:v,k2neg:_,k2:P}=b.splitScalar(g),{p:D,f:G}=this.wNAF(v),{p:W,f:z}=this.wNAF(P);D=p.constTimeNegate(I,D),W=p.constTimeNegate(_,W),W=new f(r.mul(W.px,b.beta),W.py,W.pz),y=D.add(W),x=G.add(z)}else{let{p:I,f:v}=this.wNAF(g);y=I,x=v}return f.normalizeZ([y,x])[0]}multiplyAndAddUnsafe(m,g,y){let x=f.BASE,b=(v,_)=>_===fr||_===It||!v.equals(x)?v.multiplyUnsafe(_):v.multiply(_),I=b(this,g).add(b(m,y));return I.is0()?void 0:I}toAffine(m){let{px:g,py:y,pz:x}=this,b=this.is0();m==null&&(m=b?r.ONE:r.inv(x));let I=r.mul(g,m),v=r.mul(y,m),_=r.mul(x,m);if(b)return{x:r.ZERO,y:r.ZERO};if(!r.eql(_,r.ONE))throw new Error("invZ was invalid");return{x:I,y:v}}isTorsionFree(){let{h:m,isTorsionFree:g}=e;if(m===It)return!0;if(g)return g(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:m,clearCofactor:g}=e;return m===It?this:g?g(f,this):this.multiplyUnsafe(e.h)}toRawBytes(m=!0){return this.assertValidity(),n(f,this,m)}toHex(m=!0){return sr(this.toRawBytes(m))}}f.BASE=new f(e.Gx,e.Gy,r.ONE),f.ZERO=new f(r.ZERO,r.ONE,r.ZERO);let h=e.nBitLength,p=ks(f,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function gb(t){let e=Si(t);return Wt(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Nh(t){let e=gb(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(T){return frsr(Ir(T,e.nByteLength));function d(T){let k=n>>It;return T>k}function m(T){return d(T)?a(-T):T}let g=(T,k,L)=>or(T.slice(k,L));class y{constructor(k,L,N){this.r=k,this.s=L,this.recovery=N,this.assertValidity()}static fromCompact(k){let L=e.nByteLength;return k=Ce("compactSignature",k,L*2),new y(g(k,0,L),g(k,L,2*L))}static fromDER(k){let{r:L,s:N}=sn.toSig(Ce("DER",k));return new y(L,N)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(k){return new y(this.r,this.s,k)}recoverPublicKey(k){let{r:L,s:N,recovery:R}=this,U=P(Ce("msgHash",k));if(R==null||![0,1,2,3].includes(R))throw new Error("recovery id invalid");let q=R===2||R===3?L+e.n:L;if(q>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let H=R&1?"03":"02",j=u.fromHex(H+p(q)),te=c(q),le=a(-U*te),re=a(N*te),oe=u.BASE.multiplyAndAddUnsafe(j,le,re);if(!oe)throw new Error("point at infinify");return oe.assertValidity(),oe}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Xr(this.toDERHex())}toDERHex(){return sn.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Xr(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}let x={isValidPrivateKey(T){try{return l(T),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{let T=pc(e.n);return Q0(e.randomBytes(T),e.n)},precompute(T=8,k=u.BASE){return k._setWindowSize(T),k.multiply(BigInt(3)),k}};function b(T,k=!0){return u.fromPrivateKey(T).toRawBytes(k)}function I(T){let k=T instanceof Uint8Array,L=typeof T=="string",N=(k||L)&&T.length;return k?N===i||N===s:L?N===2*i||N===2*s:T instanceof u}function v(T,k,L=!0){if(I(T))throw new Error("first arg must be private key");if(!I(k))throw new Error("second arg must be public key");return u.fromHex(k).multiply(l(T)).toRawBytes(L)}let _=e.bits2int||function(T){let k=or(T),L=T.length*8-e.nBitLength;return L>0?k>>BigInt(L):k},P=e.bits2int_modN||function(T){return a(_(T))},D=_i(e.nBitLength);function G(T){if(typeof T!="bigint")throw new Error("bigint expected");if(!(fr<=T&&TIe in L))throw new Error("sign() legacy options not supported");let{hash:N,randomBytes:R}=e,{lowS:U,prehash:q,extraEntropy:H}=L;U==null&&(U=!0),T=Ce("msgHash",T),q&&(T=Ce("prehashed msgHash",N(T)));let j=P(T),te=l(k),le=[G(te),G(j)];if(H!=null){let Ie=H===!0?R(r.BYTES):H;le.push(Ce("extraEntropy",Ie))}let re=ar(...le),oe=j;function De(Ie){let Ge=_(Ie);if(!h(Ge))return;let We=c(Ge),Oe=u.BASE.multiply(Ge).toAffine(),et=a(Oe.x);if(et===fr)return;let Jt=a(We*a(oe+et*te));if(Jt===fr)return;let qr=(Oe.x===et?0:2)|Number(Oe.y&It),fi=Jt;return U&&d(Jt)&&(fi=m(Jt),qr^=1),new y(et,fi,qr)}return{seed:re,k2sig:De}}let z={lowS:e.lowS,prehash:!1},ee={lowS:e.lowS,prehash:!1};function he(T,k,L=z){let{seed:N,k2sig:R}=W(T,k,L),U=e;return lc(U.hash.outputLen,U.nByteLength,U.hmac)(N,R)}u.BASE._setWindowSize(8);function He(T,k,L,N=ee){let R=T;if(k=Ce("msgHash",k),L=Ce("publicKey",L),"strict"in N)throw new Error("options.strict was renamed to lowS");let{lowS:U,prehash:q}=N,H,j;try{if(typeof R=="string"||R instanceof Uint8Array)try{H=y.fromDER(R)}catch(Oe){if(!(Oe instanceof sn.Err))throw Oe;H=y.fromCompact(R)}else if(typeof R=="object"&&typeof R.r=="bigint"&&typeof R.s=="bigint"){let{r:Oe,s:et}=R;H=new y(Oe,et)}else throw new Error("PARSE");j=u.fromHex(L)}catch(Oe){if(Oe.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(U&&H.hasHighS())return!1;q&&(k=e.hash(k));let{r:te,s:le}=H,re=P(k),oe=c(le),De=a(re*oe),Ie=a(te*oe),Ge=u.BASE.multiplyAndAddUnsafe(j,De,Ie)?.toAffine();return Ge?a(Ge.x)===te:!1}return{CURVE:e,getPublicKey:b,getSharedSecret:v,sign:he,verify:He,ProjectivePoint:u,Signature:y,utils:x}}var zs=class extends Nn{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,M0(e);let n=vi(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew zs(t,e).update(r).digest();qc.create=(t,e)=>new zs(t,e);function yb(t){return{hash:t,hmac:(e,...r)=>qc(t,e,Rs(...r)),randomBytes:kn}}function kh(t,e){let r=n=>Nh({...t,...yb(n)});return Object.freeze({...r(e),create:r})}var Uh=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Oh=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),xb=BigInt(1),Vc=BigInt(2),Mh=(t,e)=>(t+e/Vc)/e;function bb(t){let e=Uh,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=t*t*t%e,l=u*u*t%e,f=we(l,r,e)*l%e,h=we(f,r,e)*l%e,p=we(h,Vc,e)*u%e,d=we(p,i,e)*p%e,m=we(d,s,e)*d%e,g=we(m,a,e)*m%e,y=we(g,c,e)*g%e,x=we(y,a,e)*m%e,b=we(x,r,e)*l%e,I=we(b,o,e)*d%e,v=we(I,n,e)*u%e,_=we(v,Vc,e);if(!$c.eql($c.sqr(_),t))throw new Error("Cannot find square root");return _}var $c=Ns(Uh,void 0,void 0,{sqrt:bb}),hr=kh({a:BigInt(0),b:BigInt(7),Fp:$c,n:Oh,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=Oh,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-xb*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=Mh(s*t,e),c=Mh(-n*t,e),u=pe(t-a*r-c*i,e),l=pe(-a*n-c*s,e),f=u>o,h=l>o;if(f&&(u=e-u),h&&(l=e-l),u>o||l>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:u,k2neg:h,k2:l}}}},Ph),qI=BigInt(0);var VI=hr.ProjectivePoint;function Fh(){return hr.utils.randomPrivateKey()}async function Kh(t,e){let{digest:r}=await Ye.digest(e);try{return hr.sign(r,t).toDERRawBytes()}catch(n){throw new S(String(n),"ERR_INVALID_INPUT")}}async function qh(t,e,r){try{let{digest:n}=await Ye.digest(r);return hr.verify(e,n,t)}catch(n){throw new S(String(n),"ERR_INVALID_INPUT")}}function Vh(t){return hr.ProjectivePoint.fromHex(t).toRawBytes(!0)}function $h(t){try{hr.getPublicKey(t,!0)}catch(e){throw new S(String(e),"ERR_INVALID_PRIVATE_KEY")}}function zc(t){try{hr.ProjectivePoint.fromHex(t)}catch(e){throw new S(String(e),"ERR_INVALID_PUBLIC_KEY")}}function zh(t){try{return hr.getPublicKey(t,!0)}catch(e){throw new S(String(e),"ERR_INVALID_PRIVATE_KEY")}}var Di=class{_key;constructor(e){zc(e),this._key=e}async verify(e,r){return qh(this._key,r,e)}marshal(){return Vh(this._key)}get bytes(){return Yt.encode({Type:Ee.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}},Ni=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r??zh(e),$h(this._key),zc(this._publicKey)}async sign(e){return Kh(this._key,e)}get public(){return new Di(this._publicKey)}marshal(){return this._key}get bytes(){return Qt.encode({Type:Ee.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}async id(){let e=await this.public.hash();return se(e,"base58btc")}async export(e,r="libp2p-key"){if(r==="libp2p-key")return Fn(this.bytes,e);throw new S(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function Eb(t){return new Ni(t)}function vb(t){return new Di(t)}async function _b(){let t=Fh();return new Ni(t)}var Br={rsa:Fc,ed25519:Nc,secp256k1:Hc};function Gc(t){let e=Object.keys(Br).join(" / ");return new S(`invalid or unsupported key type ${t}. Must be ${e}`,"ERR_UNSUPPORTED_KEY_TYPE")}function Wc(t){if(t=t.toLowerCase(),t==="rsa"||t==="ed25519"||t==="secp256k1")return Br[t];throw Gc(t)}async function Hh(t,e){return Wc(t).generateKeyPair(e??2048)}function ki(t){let e=Yt.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case Ee.RSA:return Br.rsa.unmarshalRsaPublicKey(r);case Ee.Ed25519:return Br.ed25519.unmarshalEd25519PublicKey(r);case Ee.Secp256k1:return Br.secp256k1.unmarshalSecp256k1PublicKey(r);default:throw Gc(e.Type??"unknown")}}function Gh(t,e){return e=(e??"rsa").toLowerCase(),Wc(e),t.bytes}async function Yc(t){let e=Qt.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case Ee.RSA:return Br.rsa.unmarshalRsaPrivateKey(r);case Ee.Ed25519:return Br.ed25519.unmarshalEd25519PrivateKey(r);case Ee.Secp256k1:return Br.secp256k1.unmarshalSecp256k1PrivateKey(r);default:throw Gc(e.Type??"RSA")}}function Wh(t,e){return e=(e??"rsa").toLowerCase(),Wc(e),t.bytes}var Qc=Symbol.for("@libp2p/content-routing");var Oi=class extends EventTarget{#e=new Map;listenerCount(e){let r=this.#e.get(e);return r==null?0:r.length}addEventListener(e,r,n){super.addEventListener(e,r,n);let i=this.#e.get(e);i==null&&(i=[],this.#e.set(e,i)),i.push({callback:r,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(e,r,n){super.removeEventListener(e.toString(),r??null,n);let i=this.#e.get(e);i!=null&&(i=i.filter(({callback:s})=>s!==r),this.#e.set(e,i))}dispatchEvent(e){let r=super.dispatchEvent(e),n=this.#e.get(e.type);return n==null||(n=n.filter(({once:i})=>!i),this.#e.set(e.type,n)),r}safeDispatchEvent(e,r){return this.dispatchEvent(new Zc(e,r))}},Xc=class extends Event{detail;constructor(e,r){super(e,r),this.detail=r?.detail}},Zc=globalThis.CustomEvent??Xc;var yt=(t,...e)=>{try{[...e]}catch{}};var jc=Symbol.for("@libp2p/peer-discovery");var Jc=Symbol.for("@libp2p/peer-routing");var bt=ve(tu(),1);bt.default.formatters.b=t=>t==null?"undefined":_e.baseEncode(t);bt.default.formatters.t=t=>t==null?"undefined":pt.baseEncode(t);bt.default.formatters.m=t=>t==null?"undefined":Tn.baseEncode(t);bt.default.formatters.p=t=>t==null?"undefined":t.toString();bt.default.formatters.c=t=>t==null?"undefined":t.toString();bt.default.formatters.k=t=>t==null?"undefined":t.toString();bt.default.formatters.a=t=>t==null?"undefined":t.toString();function Mb(t){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=t,e.destroy=()=>!0,e.extend=()=>e,e}function Ws(){return{forComponent(t){return Ub(t)}}}function Ub(t){let e=Mb(`${t}:trace`);return bt.default.enabled(`${t}:trace`)&&bt.default.names.map(r=>r.toString()).find(r=>r.includes(":trace"))!=null&&(e=(0,bt.default)(`${t}:trace`)),Object.assign((0,bt.default)(t),{error:(0,bt.default)(`${t}:error`),trace:e})}var ru=Symbol.for("@libp2p/peer-id");function Ys(t){return t!=null&&!!t[ru]}var Fb=Symbol.for("nodejs.util.inspect.custom"),Zh=Object.values(vr).map(t=>t.decoder).reduce((t,e)=>t.or(e),vr.identity.decoder),jh=114,nu=36,iu=37,Mi=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[ru]=!0;toString(){return this.string==null&&(this.string=_e.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return Lt.createV1(jh,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return Se(this.multihash.bytes,e);if(typeof e=="string")return ce(e).equals(this);if(e?.multihash?.bytes!=null)return Se(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[Fb](){return`PeerId(${this.toString()})`}},an=class extends Mi{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},cn=class extends Mi{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},un=class extends Mi{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function Jh(t){if(t.type==="RSA")return new an(t);if(t.type==="Ed25519")return new cn(t);if(t.type==="secp256k1")return new un(t);throw new S("Not a PeerId","ERR_INVALID_PARAMETERS")}function ce(t,e){if(e=e??Zh,t.charAt(0)==="1"||t.charAt(0)==="Q"){let r=Yr(_e.decode(`z${t}`));return t.startsWith("12D")?new cn({multihash:r}):t.startsWith("16U")?new un({multihash:r}):new an({multihash:r})}return Gn(Zh.decode(t))}function Gn(t){try{let e=Yr(t);if(e.code===Er.code){if(e.digest.length===nu)return new cn({multihash:e});if(e.digest.length===iu)return new un({multihash:e})}if(e.code===Ye.code)return new an({multihash:e})}catch{return Kb(Lt.decode(t))}throw new Error("Supplied PeerID CID is invalid")}function Kb(t){if(t==null||t.multihash==null||t.version==null||t.version===1&&t.code!==jh)throw new Error("Supplied PeerID CID is invalid");let e=t.multihash;if(e.code===Ye.code)return new an({multihash:t.multihash});if(e.code===Er.code){if(e.digest.length===nu)return new cn({multihash:t.multihash});if(e.digest.length===iu)return new un({multihash:t.multihash})}throw new Error("Supplied PeerID CID is invalid")}async function Qs(t,e){return t.length===nu?new cn({multihash:Gt(Er.code,t),privateKey:e}):t.length===iu?new un({multihash:Gt(Er.code,t),privateKey:e}):new an({multihash:await Ye.digest(t),publicKey:t,privateKey:e})}function dr(t,e){let r={[Symbol.iterator]:()=>r,next:()=>{let n=t.next(),i=n.value;return n.done===!0||i==null?{done:!0,value:void 0}:{done:!1,value:e(i)}}};return r}var wt=class{map;constructor(e){if(this.map=new Map,e!=null)for(let[r,n]of e.entries())this.map.set(r.toString(),n)}[Symbol.iterator](){return this.entries()}clear(){this.map.clear()}delete(e){this.map.delete(e.toString())}entries(){return dr(this.map.entries(),e=>[ce(e[0]),e[1]])}forEach(e){this.map.forEach((r,n)=>{e(r,ce(n),this)})}get(e){return this.map.get(e.toString())}has(e){return this.map.has(e.toString())}set(e,r){this.map.set(e.toString(),r)}keys(){return dr(this.map.keys(),e=>ce(e))}values(){return this.map.values()}get size(){return this.map.size}};var ln=class t{set;constructor(e){if(this.set=new Set,e!=null)for(let r of e)this.set.add(r.toString())}get size(){return this.set.size}[Symbol.iterator](){return this.values()}add(e){this.set.add(e.toString())}clear(){this.set.clear()}delete(e){this.set.delete(e.toString())}entries(){return dr(this.set.entries(),e=>{let r=ce(e[0]);return[r,r]})}forEach(e){this.set.forEach(r=>{let n=ce(r);e(n,n,this)})}has(e){return this.set.has(e.toString())}values(){return dr(this.set.values(),e=>ce(e))}intersection(e){let r=new t;for(let n of e)this.has(n)&&r.add(n);return r}difference(e){let r=new t;for(let n of this)e.has(n)||r.add(n);return r}union(e){let r=new t;for(let n of e)r.add(n);for(let n of this)r.add(n);return r}};var su=class t{list;constructor(e){if(this.list=[],e!=null)for(let r of e)this.list.push(r.toString())}[Symbol.iterator](){return dr(this.list.entries(),e=>ce(e[1]))}concat(e){let r=new t(this);for(let n of e)r.push(n);return r}entries(){return dr(this.list.entries(),e=>[e[0],ce(e[1])])}every(e){return this.list.every((r,n)=>e(ce(r),n,this))}filter(e){let r=new t;return this.list.forEach((n,i)=>{let s=ce(n);e(s,i,this)&&r.push(s)}),r}find(e){let r=this.list.find((n,i)=>e(ce(n),i,this));if(r!=null)return ce(r)}findIndex(e){return this.list.findIndex((r,n)=>e(ce(r),n,this))}forEach(e){this.list.forEach((r,n)=>{e(ce(r),n,this)})}includes(e){return this.list.includes(e.toString())}indexOf(e){return this.list.indexOf(e.toString())}pop(){let e=this.list.pop();if(e!=null)return ce(e)}push(...e){for(let r of e)this.list.push(r.toString())}shift(){let e=this.list.shift();if(e!=null)return ce(e)}unshift(...e){let r=this.list.length;for(let n=e.length-1;n>-1;n--)r=this.list.unshift(e[n].toString());return r}get length(){return this.list.length}};var ou;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.id!=null&&(n.uint32(10),n.bytes(r.id)),r.pubKey!=null&&(n.uint32(18),n.bytes(r.pubKey)),r.privKey!=null&&(n.uint32(26),n.bytes(r.privKey)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.id=r.bytes();break;case 2:i.pubKey=r.bytes();break;case 3:i.privKey=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(ou||(ou={}));var ed=async()=>{let t=await Hh("Ed25519"),e=await qb(t);if(e.type==="Ed25519")return e;throw new Error(`Generated unexpected PeerId type "${e.type}"`)};async function qb(t){return Qs(Gh(t.public),Wh(t))}var Vb=Math.pow(2,7),$b=Math.pow(2,14),zb=Math.pow(2,21),au=Math.pow(2,28),cu=Math.pow(2,35),uu=Math.pow(2,42),lu=Math.pow(2,49),ue=128,nt=127;function it(t){if(tNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Hb(t,e,r=0){switch(it(t)){case 8:e[r++]=t&255|ue,t/=128;case 7:e[r++]=t&255|ue,t/=128;case 6:e[r++]=t&255|ue,t/=128;case 5:e[r++]=t&255|ue,t/=128;case 4:e[r++]=t&255|ue,t>>>=7;case 3:e[r++]=t&255|ue,t>>>=7;case 2:e[r++]=t&255|ue,t>>>=7;case 1:{e[r++]=t&255,t>>>=7;break}default:throw new Error("unreachable")}return e}function Gb(t,e,r=0){switch(it(t)){case 8:e.set(r++,t&255|ue),t/=128;case 7:e.set(r++,t&255|ue),t/=128;case 6:e.set(r++,t&255|ue),t/=128;case 5:e.set(r++,t&255|ue),t/=128;case 4:e.set(r++,t&255|ue),t>>>=7;case 3:e.set(r++,t&255|ue),t>>>=7;case 2:e.set(r++,t&255|ue),t>>>=7;case 1:{e.set(r++,t&255),t>>>=7;break}default:throw new Error("unreachable")}return e}function Wb(t,e){let r=t[e],n=0;if(n+=r&nt,r0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let r=0;for(let n of e)if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.push(n);else if(Xs(n))r+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}prepend(...e){this.prependAll(e)}prependAll(e){let r=0;for(let n of e.reverse())if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.unshift(n);else if(Xs(n))r+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}get(e){let r=td(this.bufs,e);return r.buf[r.index]}set(e,r){let n=td(this.bufs,e);n.buf[n.index]=r}write(e,r=0){if(e instanceof Uint8Array)for(let n=0;n0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,r){let{bufs:n,length:i}=this._subList(e,r);return Te(n,i)}subarray(e,r){let{bufs:n,length:i}=this._subList(e,r);return n.length===1?n[0]:Te(n,i)}sublist(e,r){let{bufs:n,length:i}=this._subList(e,r),s=new t;return s.length=i,s.bufs=n,s}_subList(e,r){if(e=e??0,r=r??this.length,e<0&&(e=this.length+e),r<0&&(r=this.length+r),e<0||r>this.length)throw new RangeError("index is out of bounds");if(e===r)return{bufs:[],length:0};if(e===0&&r===this.length)return{bufs:[...this.bufs],length:this.length};let n=[],i=0;for(let s=0;s=c)continue;let u=e>=a&&ea&&r<=c;if(u&&l){if(e===a&&r===c){n.push(o);break}let f=e-a;n.push(o.subarray(f,f+(r-e)));break}if(u){if(e===0){n.push(o);continue}n.push(o.subarray(e-a));continue}if(l){if(r===c){n.push(o);break}n.push(o.subarray(0,r-a));break}n.push(o)}return{bufs:n,length:r-e}}indexOf(e,r=0){if(!Xs(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(r=Number(r??0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),e.length===0)return r>this.length?this.length:r;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let s=256,o=new Int32Array(s);for(let f=0;f=0;h--){let p=this.get(f+h);if(n[h]!==p){l=Math.max(1,h-a[p]);break}}if(l===0)return f}return-1}getInt8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt8(0)}setInt8(e,r){let n=tt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,r),this.write(n,e)}getInt16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,r)}setInt16(e,r,n){let i=ir(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,r,n),this.write(i,e)}getInt32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,r)}setInt32(e,r,n){let i=ir(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,r,n),this.write(i,e)}getBigInt64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,r)}setBigInt64(e,r,n){let i=ir(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,r,n),this.write(i,e)}getUint8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint8(0)}setUint8(e,r){let n=tt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,r),this.write(n,e)}getUint16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,r)}setUint16(e,r,n){let i=ir(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,r,n),this.write(i,e)}getUint32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,r)}setUint32(e,r,n){let i=ir(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,r,n),this.write(i,e)}getBigUint64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,r)}setBigUint64(e,r,n){let i=ir(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,r,n),this.write(i,e)}getFloat32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,r)}setFloat32(e,r,n){let i=ir(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,r,n),this.write(i,e)}getFloat64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,r)}setFloat64(e,r,n){let i=ir(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,r,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof t)||e.bufs.length!==this.bufs.length)return!1;for(let r=0;ri+s.byteLength,0)),n.length=r,n}};var nd={ERR_SIGNATURE_NOT_VALID:"ERR_SIGNATURE_NOT_VALID"};var Ui;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.publicKey!=null&&r.publicKey.byteLength>0&&(n.uint32(10),n.bytes(r.publicKey)),r.payloadType!=null&&r.payloadType.byteLength>0&&(n.uint32(18),n.bytes(r.payloadType)),r.payload!=null&&r.payload.byteLength>0&&(n.uint32(26),n.bytes(r.payload)),r.signature!=null&&r.signature.byteLength>0&&(n.uint32(42),n.bytes(r.signature)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={publicKey:new Uint8Array(0),payloadType:new Uint8Array(0),payload:new Uint8Array(0),signature:new Uint8Array(0)},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.publicKey=r.bytes();break;case 2:i.payloadType=r.bytes();break;case 3:i.payload=r.bytes();break;case 5:i.signature=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(Ui||(Ui={}));var Wn=class t{static createFromProtobuf=async e=>{let r=Ui.decode(e),n=await Qs(r.publicKey);return new t({peerId:n,payloadType:r.payloadType,payload:r.payload,signature:r.signature})};static seal=async(e,r)=>{if(r.privateKey==null)throw new Error("Missing private key");let n=e.domain,i=e.codec,s=e.marshal(),o=id(n,i,s),c=await(await Yc(r.privateKey)).sign(o.subarray());return new t({peerId:r,payloadType:i,payload:s,signature:c})};static openAndCertify=async(e,r)=>{let n=await t.createFromProtobuf(e);if(!await n.validate(r))throw new S("envelope signature is not valid for the given domain",nd.ERR_SIGNATURE_NOT_VALID);return n};peerId;payloadType;payload;signature;marshaled;constructor(e){let{peerId:r,payloadType:n,payload:i,signature:s}=e;this.peerId=r,this.payloadType=n,this.payload=i,this.signature=s}marshal(){if(this.peerId.publicKey==null)throw new Error("Missing public key");return this.marshaled==null&&(this.marshaled=Ui.encode({publicKey:this.peerId.publicKey,payloadType:this.payloadType,payload:this.payload.subarray(),signature:this.signature})),this.marshaled}equals(e){return Se(this.marshal(),e.marshal())}async validate(e){let r=id(e,this.payloadType,this.payload);if(this.peerId.publicKey==null)throw new Error("Missing public key");return ki(this.peerId.publicKey).verify(r.subarray(),this.signature)}},id=(t,e,r)=>{let n=Q(t),i=dt(n.byteLength),s=dt(e.length),o=dt(r.length);return new ze(i,n,s,e,o,r)};function sd(t,e){let r=(n,i)=>n.toString().localeCompare(i.toString());return t.length!==e.length?!1:(e.sort(r),t.sort(r).every((n,i)=>e[i].equals(n)))}var Zs=class{index=0;input="";new(e){return this.index=0,this.input=e,this}readAtomically(e){let r=this.index,n=e();return n===void 0&&(this.index=r),n}parseWith(e){let r=e();if(this.index===this.input.length)return r}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(e){return this.readAtomically(()=>{let r=this.readChar();if(r===e)return r})}readSeparator(e,r,n){return this.readAtomically(()=>{if(!(r>0&&this.readGivenChar(e)===void 0))return n()})}readNumber(e,r,n,i){return this.readAtomically(()=>{let s=0,o=0,a=this.peekChar();if(a===void 0)return;let c=a==="0",u=2**(8*i)-1;for(;;){let l=this.readAtomically(()=>{let f=this.readChar();if(f===void 0)return;let h=Number.parseInt(f,e);if(!Number.isNaN(h))return h});if(l===void 0)break;if(s*=e,s+=l,s>u||(o+=1,r!==void 0&&o>r))return}if(o!==0)return!n&&c&&o>1?void 0:s})}readIPv4Addr(){return this.readAtomically(()=>{let e=new Uint8Array(4);for(let r=0;rthis.readNumber(10,3,!1,1));if(n===void 0)return;e[r]=n}return e})}readIPv6Addr(){let e=r=>{for(let n=0;nthis.readIPv4Addr());if(o!==void 0)return r[i]=o[0],r[i+1]=o[1],r[i+2]=o[2],r[i+3]=o[3],[i+4,!0]}let s=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(s===void 0)return[i,!1];r[i]=s>>8,r[i+1]=s&255}return[r.length,!1]};return this.readAtomically(()=>{let r=new Uint8Array(16),[n,i]=e(r);if(n===16)return r;if(i||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let s=new Uint8Array(14),o=16-(n+2),[a]=e(s.subarray(0,o));return r.set(s.subarray(0,a),16-a),r})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var od=45,Qb=15,Yn=new Zs;function fu(t){if(!(t.length>Qb))return Yn.new(t).parseWith(()=>Yn.readIPv4Addr())}function hu(t){if(t.includes("%")&&(t=t.split("%")[0]),!(t.length>od))return Yn.new(t).parseWith(()=>Yn.readIPv6Addr())}function js(t){if(t.includes("%")&&(t=t.split("%")[0]),!(t.length>od))return Yn.new(t).parseWith(()=>Yn.readIPAddr())}var TR=parseInt("0xFFFF",16),BR=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function Js(t){return!!fu(t)}function eo(t){return!!hu(t)}function Qn(t){return!!js(t)}var ud=Js,ew=eo,du=function(t){let e=0;if(t=t.toString().trim(),ud(t)){let r=new Uint8Array(e+4);return t.split(/\./g).forEach(n=>{r[e++]=parseInt(n,10)&255}),r}if(ew(t)){let r=t.split(":",8),n;for(n=0;n0;n--)s.push("0");r.splice.apply(r,s)}let i=new Uint8Array(e+16);for(n=0;n>8&255,i[e++]=s&255}return i}throw new Error("invalid ip address")},ld=function(t,e=0,r){e=~~e,r=r??t.length-e;let n=new DataView(t.buffer);if(r===4){let i=[];for(let s=0;s{let e=nw(...t);pu[e.code]=e,Xn[e.name]=e});function nw(t,e,r,n,i){return{code:t,size:e,name:r,resolvable:!!n,path:!!i}}function fe(t){if(typeof t=="number"){if(pu[t]!=null)return pu[t];throw new Error(`no protocol with code: ${t}`)}else if(typeof t=="string"){if(Xn[t]!=null)return Xn[t];throw new Error(`no protocol with name: ${t}`)}throw new Error(`invalid protocol id type: ${typeof t}`)}var d8=fe("ip4"),p8=fe("ip6"),m8=fe("ipcidr");function gu(t,e){switch(fe(t).code){case 4:case 41:return sw(e);case 42:return dd(e);case 6:case 273:case 33:case 132:return md(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return dd(e);case 421:return uw(e);case 444:return pd(e);case 445:return pd(e);case 466:return cw(e);default:return se(e,"base16")}}function yu(t,e){switch(fe(t).code){case 4:return fd(e);case 41:return fd(e);case 42:return hd(e);case 6:case 273:case 33:case 132:return xu(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return hd(e);case 421:return ow(e);case 444:return lw(e);case 445:return fw(e);case 466:return aw(e);default:return Q(e,"base16")}}var mu=Object.values(vr).map(t=>t.decoder),iw=function(){let t=mu[0].or(mu[1]);return mu.slice(2).forEach(e=>t=t.or(e)),t}();function fd(t){if(!Qn(t))throw new Error("invalid ip address");return du(t)}function sw(t){let e=ld(t,0,t.length);if(e==null)throw new Error("ipBuff is required");if(!Qn(e))throw new Error("invalid ip address");return e}function xu(t){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,t),new Uint8Array(e)}function md(t){return new DataView(t.buffer).getUint16(t.byteOffset)}function hd(t){let e=Q(t),r=Uint8Array.from(dt(e.length));return Te([r,e],r.length+e.length)}function dd(t){let e=Ot(t);if(t=t.slice(it(e)),t.length!==e)throw new Error("inconsistent lengths");return se(t)}function ow(t){let e;t[0]==="Q"||t[0]==="1"?e=Yr(_e.decode(`z${t}`)).bytes:e=Lt.parse(t).multihash.bytes;let r=Uint8Array.from(dt(e.length));return Te([r,e],r.length+e.length)}function aw(t){let e=iw.decode(t),r=Uint8Array.from(dt(e.length));return Te([r,e],r.length+e.length)}function cw(t){let e=Ot(t),r=t.slice(it(e));if(r.length!==e)throw new Error("inconsistent lengths");return"u"+se(r,"base64url")}function uw(t){let e=Ot(t),r=t.slice(it(e));if(r.length!==e)throw new Error("inconsistent lengths");return se(r,"base58btc")}function lw(t){let e=t.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let r=pt.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=xu(n);return Te([r,i],r.length+i.length)}function fw(t){let e=t.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let r=pt.decode(`b${e[0]}`),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=xu(n);return Te([r,i],r.length+i.length)}function pd(t){let e=t.slice(0,t.length-2),r=t.slice(t.length-2),n=se(e,"base32"),i=md(r);return`${n}:${i}`}function gd(t){t=bu(t);let e=[],r=[],n=null,i=t.split("/").slice(1);if(i.length===1&&i[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let s=0;s=i.length)throw xd("invalid address: "+t);if(a.path===!0){n=bu(i.slice(s).join("/")),e.push([a.code,yu(a.code,n)]),r.push([a.code,n]);break}let c=yu(a.code,i[s]);e.push([a.code,c]),r.push([a.code,gu(a.code,c)])}return{string:yd(r),bytes:Eu(e),tuples:e,stringTuples:r,path:n}}function wu(t){let e=[],r=[],n=null,i=0;for(;it.length)throw xd("Invalid address Uint8Array: "+se(t,"base16"));e.push([s,u]);let l=gu(s,u);if(r.push([s,l]),a.path===!0){n=l;break}}return{bytes:Uint8Array.from(t),string:yd(r),tuples:e,stringTuples:r,path:n}}function yd(t){let e=[];return t.map(r=>{let n=fe(r[0]);return e.push(n.name),r.length>1&&r[1]!=null&&e.push(r[1]),null}),bu(e.join("/"))}function Eu(t){return Te(t.map(e=>{let r=fe(e[0]),n=Uint8Array.from(dt(r.code));return e.length>1&&e[1]!=null&&(n=Te([n,e[1]])),n}))}function hw(t,e){if(t.size>0)return t.size/8;if(t.size===0)return 0;{let r=Ot(e instanceof Uint8Array?e:Uint8Array.from(e));return r+it(r)}}function bu(t){return"/"+t.trim().split("/").filter(e=>e).join("/")}function xd(t){return new Error("Error parsing address: "+t)}var dw=Symbol.for("nodejs.util.inspect.custom"),vu=Symbol.for("@multiformats/js-multiaddr/multiaddr"),pw=[fe("dns").code,fe("dns4").code,fe("dns6").code,fe("dnsaddr").code],to=class t{bytes;#e;#t;#r;#n;[vu]=!0;constructor(e){e==null&&(e="");let r;if(e instanceof Uint8Array)r=wu(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);r=gd(e)}else if(Lr(e))r=wu(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=r.bytes,this.#e=r.string,this.#t=r.tuples,this.#r=r.stringTuples,this.#n=r.path}toString(){return this.#e}toJSON(){return this.toString()}toOptions(){let e,r,n,i,s="",o=fe("tcp"),a=fe("udp"),c=fe("ip4"),u=fe("ip6"),l=fe("dns6"),f=fe("ip6zone");for(let[p,d]of this.stringTuples())p===f.code&&(s=`%${d??""}`),pw.includes(p)&&(r=o.name,i=443,n=`${d??""}${s}`,e=p===l.code?6:4),(p===o.code||p===a.code)&&(r=fe(p).name,i=parseInt(d??"")),(p===c.code||p===u.code)&&(r=fe(p).name,n=`${d??""}${s}`,e=p===u.code?6:4);if(e==null||r==null||n==null||i==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:e,host:n,transport:r,port:i}}protos(){return this.#t.map(([e])=>Object.assign({},fe(e)))}protoCodes(){return this.#t.map(([e])=>e)}protoNames(){return this.#t.map(([e])=>fe(e).name)}tuples(){return this.#t}stringTuples(){return this.#r}encapsulate(e){return e=new t(e),new t(this.toString()+e.toString())}decapsulate(e){let r=e.toString(),n=this.toString(),i=n.lastIndexOf(r);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new t(n.slice(0,i))}decapsulateCode(e){let r=this.tuples();for(let n=r.length-1;n>=0;n--)if(r[n][0]===e)return new t(Eu(r.slice(0,n)));return this}getPeerId(){try{let e=[];this.stringTuples().forEach(([n,i])=>{n===Xn.p2p.code&&e.push([n,i]),n===Xn["p2p-circuit"].code&&(e=[])});let r=e.pop();if(r?.[1]!=null){let n=r[1];return n[0]==="Q"||n[0]==="1"?se(_e.decode(`z${n}`),"base58btc"):se(Lt.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#n}equals(e){return Se(this.bytes,e.bytes)}async resolve(e){let r=this.protos().find(s=>s.resolvable);if(r==null)return[this];let n=ro.get(r.name);if(n==null)throw new S(`no available resolver for ${r.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,e)).map(s=>new t(s))}nodeAddress(){let e=this.toOptions();if(e.transport!=="tcp"&&e.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${e.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:e.family,address:e.host,port:e.port}}isThinWaistAddress(e){let r=(e??this).protos();return!(r.length!==2||r[0].code!==4&&r[0].code!==41||r[1].code!==6&&r[1].code!==273)}[dw](){return`Multiaddr(${this.#e})`}};var ro=new Map;function Lr(t){return!!t?.[vu]}function Ue(t){return new to(t)}var bd="libp2p-peer-record",wd=Uint8Array.from([3,1]);var Fi;(function(t){let e;(function(n){let i;n.codec=()=>(i==null&&(i=Ze((s,o,a={})=>{a.lengthDelimited!==!1&&o.fork(),s.multiaddr!=null&&s.multiaddr.byteLength>0&&(o.uint32(10),o.bytes(s.multiaddr)),a.lengthDelimited!==!1&&o.ldelim()},(s,o)=>{let a={multiaddr:new Uint8Array(0)},c=o==null?s.len:s.pos+o;for(;s.pos>>3){case 1:a.multiaddr=s.bytes();break;default:s.skipType(u&7);break}}return a})),i),n.encode=s=>Xe(s,n.codec()),n.decode=s=>Qe(s,n.codec())})(e=t.AddressInfo||(t.AddressInfo={}));let r;t.codec=()=>(r==null&&(r=Ze((n,i,s={})=>{if(s.lengthDelimited!==!1&&i.fork(),n.peerId!=null&&n.peerId.byteLength>0&&(i.uint32(10),i.bytes(n.peerId)),n.seq!=null&&n.seq!==0n&&(i.uint32(16),i.uint64(n.seq)),n.addresses!=null)for(let o of n.addresses)i.uint32(26),t.AddressInfo.codec().encode(o,i);s.lengthDelimited!==!1&&i.ldelim()},(n,i)=>{let s={peerId:new Uint8Array(0),seq:0n,addresses:[]},o=i==null?n.len:n.pos+i;for(;n.pos>>3){case 1:s.peerId=n.bytes();break;case 2:s.seq=n.uint64();break;case 3:s.addresses.push(t.AddressInfo.codec().decode(n,n.uint32()));break;default:n.skipType(a&7);break}}return s})),r),t.encode=n=>Xe(n,t.codec()),t.decode=n=>Qe(n,t.codec())})(Fi||(Fi={}));var hn=class t{static createFromProtobuf=e=>{let r=Fi.decode(e),n=Gn(r.peerId),i=(r.addresses??[]).map(o=>Ue(o.multiaddr)),s=r.seq;return new t({peerId:n,multiaddrs:i,seqNumber:s})};static DOMAIN=bd;static CODEC=wd;peerId;multiaddrs;seqNumber;domain=t.DOMAIN;codec=t.CODEC;marshaled;constructor(e){let{peerId:r,multiaddrs:n,seqNumber:i}=e;this.peerId=r,this.multiaddrs=n??[],this.seqNumber=i??BigInt(Date.now())}marshal(){return this.marshaled==null&&(this.marshaled=Fi.encode({peerId:this.peerId.toBytes(),seq:BigInt(this.seqNumber),addresses:this.multiaddrs.map(e=>({multiaddr:e.bytes}))})),this.marshaled}equals(e){return!(!(e instanceof t)||!this.peerId.equals(e.peerId)||this.seqNumber!==e.seqNumber||!sd(this.multiaddrs,e.multiaddrs))}};function mw(t){return t[Symbol.asyncIterator]!=null}function gw(t){if(mw(t))return(async()=>{let r=[];for await(let n of t)r.push(n);return r})();let e=[];for(let r of t)e.push(r);return e}var Ki=gw;var Su=ve(vd(),1);var Vi=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Au=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},_d=t=>globalThis.DOMException===void 0?new Au(t):new DOMException(t),Sd=t=>{let e=t.reason===void 0?_d("This operation was aborted."):t.reason;return e instanceof Error?e:_d(e)};function Iu(t,e,r,n){let i,s=new Promise((o,a)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e===Number.POSITIVE_INFINITY){o(t);return}if(n={customTimers:{setTimeout,clearTimeout},...n},n.signal){let{signal:c}=n;c.aborted&&a(Sd(c)),c.addEventListener("abort",()=>{a(Sd(c))})}i=n.customTimers.setTimeout.call(void 0,()=>{if(typeof r=="function"){try{o(r())}catch(l){a(l)}return}let c=typeof r=="string"?r:`Promise timed out after ${e} milliseconds`,u=r instanceof Error?r:new Vi(c);typeof t.cancel=="function"&&t.cancel(),a(u)},e),(async()=>{try{o(await t)}catch(c){a(c)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()});return s.clear=()=>{clearTimeout(i),i=void 0},s}function Ru(t,e,r){let n=0,i=t.length;for(;i>0;){let s=Math.trunc(i/2),o=n+s;r(t[o],e)<=0?(n=++o,i-=s+1):i=s}return n}var dn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},pr,Cu=class{constructor(){pr.set(this,[])}enqueue(e,r){r={priority:0,...r};let n={priority:r.priority,run:e};if(this.size&&dn(this,pr,"f")[this.size-1].priority>=r.priority){dn(this,pr,"f").push(n);return}let i=Ru(dn(this,pr,"f"),n,(s,o)=>o.priority-s.priority);dn(this,pr,"f").splice(i,0,n)}dequeue(){let e=dn(this,pr,"f").shift();return e?.run}filter(e){return dn(this,pr,"f").filter(r=>r.priority===e.priority).map(r=>r.run)}get size(){return dn(this,pr,"f").length}};pr=new WeakMap;var Ad=Cu;var Ae=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},K=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Be,zi,Hi,Dr,uo,Gi,io,Mt,$i,Et,so,vt,Wi,Pr,oo,Id,Rd,Bd,Cd,Td,ao,Tu,Bu,lo,Ld,co,fo=class extends Error{},Lu=class extends Su.default{constructor(e){var r,n,i,s;if(super(),Be.add(this),zi.set(this,void 0),Hi.set(this,void 0),Dr.set(this,0),uo.set(this,void 0),Gi.set(this,void 0),io.set(this,0),Mt.set(this,void 0),$i.set(this,void 0),Et.set(this,void 0),so.set(this,void 0),vt.set(this,0),Wi.set(this,void 0),Pr.set(this,void 0),oo.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Ad,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(r=e.intervalCap)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(s=(i=e.interval)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""}\` (${typeof e.interval})`);Ae(this,zi,e.carryoverConcurrencyCount,"f"),Ae(this,Hi,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),Ae(this,uo,e.intervalCap,"f"),Ae(this,Gi,e.interval,"f"),Ae(this,Et,new e.queueClass,"f"),Ae(this,so,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,Ae(this,oo,e.throwOnTimeout===!0,"f"),Ae(this,Pr,e.autoStart===!1,"f")}get concurrency(){return K(this,Wi,"f")}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);Ae(this,Wi,e,"f"),K(this,Be,"m",lo).call(this)}async add(e,r={}){return r={timeout:this.timeout,throwOnTimeout:K(this,oo,"f"),...r},new Promise((n,i)=>{K(this,Et,"f").enqueue(async()=>{var s,o,a;Ae(this,vt,(o=K(this,vt,"f"),o++,o),"f"),Ae(this,Dr,(a=K(this,Dr,"f"),a++,a),"f");try{if(!((s=r.signal)===null||s===void 0)&&s.aborted)throw new fo("The task was aborted.");let c=e({signal:r.signal});r.timeout&&(c=Iu(Promise.resolve(c),r.timeout)),r.signal&&(c=Promise.race([c,K(this,Be,"m",Ld).call(this,r.signal)]));let u=await c;n(u),this.emit("completed",u)}catch(c){if(c instanceof Vi&&!r.throwOnTimeout){n();return}i(c),this.emit("error",c)}finally{K(this,Be,"m",Bd).call(this)}},r),this.emit("add"),K(this,Be,"m",ao).call(this)})}async addAll(e,r){return Promise.all(e.map(async n=>this.add(n,r)))}start(){return K(this,Pr,"f")?(Ae(this,Pr,!1,"f"),K(this,Be,"m",lo).call(this),this):this}pause(){Ae(this,Pr,!0,"f")}clear(){Ae(this,Et,new(K(this,so,"f")),"f")}async onEmpty(){K(this,Et,"f").size!==0&&await K(this,Be,"m",co).call(this,"empty")}async onSizeLessThan(e){K(this,Et,"f").sizeK(this,Et,"f").size{K(this,Be,"m",Cd).call(this)},r),"f"),!0}return!1},ao=function(){if(K(this,Et,"f").size===0)return K(this,Mt,"f")&&clearInterval(K(this,Mt,"f")),Ae(this,Mt,void 0,"f"),this.emit("empty"),K(this,vt,"f")===0&&this.emit("idle"),!1;if(!K(this,Pr,"f")){let e=!K(this,Be,"a",Td);if(K(this,Be,"a",Id)&&K(this,Be,"a",Rd)){let r=K(this,Et,"f").dequeue();return r?(this.emit("active"),r(),e&&K(this,Be,"m",Tu).call(this),!0):!1}}return!1},Tu=function(){K(this,Hi,"f")||K(this,Mt,"f")!==void 0||(Ae(this,Mt,setInterval(()=>{K(this,Be,"m",Bu).call(this)},K(this,Gi,"f")),"f"),Ae(this,io,Date.now()+K(this,Gi,"f"),"f"))},Bu=function(){K(this,Dr,"f")===0&&K(this,vt,"f")===0&&K(this,Mt,"f")&&(clearInterval(K(this,Mt,"f")),Ae(this,Mt,void 0,"f")),Ae(this,Dr,K(this,zi,"f")?K(this,vt,"f"):0,"f"),K(this,Be,"m",lo).call(this)},lo=function(){for(;K(this,Be,"m",ao).call(this););},Ld=async function(e){return new Promise((r,n)=>{e.addEventListener("abort",()=>{n(new fo("The task was aborted."))},{once:!0})})},co=async function(e,r){return new Promise(n=>{let i=()=>{r&&!r()||(this.off(e,i),n())};this.on(e,i)})};var Nr=Lu;var Pu=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Du=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Pd=t=>globalThis.DOMException===void 0?new Du(t):new DOMException(t),Dd=t=>{let e=t.reason===void 0?Pd("This operation was aborted."):t.reason;return e instanceof Error?e:Pd(e)};function Nu(t,e){let{milliseconds:r,fallback:n,message:i,customTimers:s={setTimeout,clearTimeout}}=e,o,c=new Promise((u,l)=>{if(typeof r!="number"||Math.sign(r)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``);if(e.signal){let{signal:h}=e;h.aborted&&l(Dd(h)),h.addEventListener("abort",()=>{l(Dd(h))})}if(r===Number.POSITIVE_INFINITY){t.then(u,l);return}let f=new Pu;o=s.setTimeout.call(void 0,()=>{if(n){try{u(n())}catch(h){l(h)}return}typeof t.cancel=="function"&&t.cancel(),i===!1?u():i instanceof Error?l(i):(f.message=i??`Promise timed out after ${r} milliseconds`,l(f))},r),(async()=>{try{u(await t)}catch(h){l(h)}})()}).finally(()=>{c.clear()});return c.clear=()=>{s.clearTimeout.call(void 0,o),o=void 0},c}var ho=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),"");var ku="lock:worker:request-read",Ou="lock:worker:release-read",Mu="lock:master:grant-read",Uu="lock:worker:request-write",Fu="lock:worker:release-write",Ku="lock:master:grant-write";var kr={},Zn=t=>{t.addEventListener("message",e=>{Zn.dispatchEvent("message",t,e)}),t.port!=null&&t.port.addEventListener("message",e=>{Zn.dispatchEvent("message",t,e)})};Zn.addEventListener=(t,e)=>{kr[t]==null&&(kr[t]=[]),kr[t].push(e)};Zn.removeEventListener=(t,e)=>{kr[t]!=null&&(kr[t]=kr[t].filter(r=>r===e))};Zn.dispatchEvent=function(t,e,r){kr[t]!=null&&kr[t].forEach(n=>n(e,r))};var qu=Zn;var Nd=(t,e,r,n,i)=>(s,o)=>{if(o.data.type!==r)return;let a={type:o.data.type,name:o.data.name,identifier:o.data.identifier};t.dispatchEvent(new MessageEvent(e,{data:{name:a.name,handler:async()=>(s.postMessage({type:i,name:a.name,identifier:a.identifier}),await new Promise(c=>{let u=l=>{if(l==null||l.data==null)return;let f={type:l.data.type,name:l.data.name,identifier:l.data.identifier};f.type===n&&f.identifier===a.identifier&&(s.removeEventListener("message",u),c())};s.addEventListener("message",u)}))}}))},kd=(t,e,r,n)=>async()=>{let i=ho();return globalThis.postMessage({type:e,identifier:i,name:t}),await new Promise(s=>{let o=a=>{if(a==null||a.data==null)return;let c={type:a.data.type,identifier:a.data.identifier};c.type===r&&c.identifier===i&&(globalThis.removeEventListener("message",o),s(()=>{globalThis.postMessage({type:n,identifier:i,name:t})}))};globalThis.addEventListener("message",o)})},bw={singleProcess:!1},Od=t=>{if(t=Object.assign({},bw,t),!!globalThis.document||t.singleProcess){let r=new EventTarget;return qu.addEventListener("message",Nd(r,"requestReadLock",ku,Ou,Mu)),qu.addEventListener("message",Nd(r,"requestWriteLock",Uu,Fu,Ku)),r}return{isWorker:!0,readLock:r=>kd(r,ku,Mu,Ou),writeLock:r=>kd(r,Uu,Ku,Fu)}};var pn={},Or;async function Vu(t,e){let r,n=new Promise(i=>{r=i});return t.add(async()=>await Nu((async()=>await new Promise(i=>{r(()=>{i()})}))(),{milliseconds:e.timeout})),await n}var ww=(t,e)=>{if(Or.isWorker===!0)return{readLock:Or.readLock(t,e),writeLock:Or.writeLock(t,e)};let r=new Nr({concurrency:1}),n;return{async readLock(){if(n!=null)return await Vu(n,e);n=new Nr({concurrency:e.concurrency,autoStart:!1});let i=n,s=Vu(n,e);return r.add(async()=>(i.start(),await i.onIdle().then(()=>{n===i&&(n=null)}))),await s},async writeLock(){return n=null,await Vu(r,e)}}},Ew={name:"lock",concurrency:1/0,timeout:846e5,singleProcess:!1};function $u(t){let e=Object.assign({},Ew,t);return Or==null&&(Or=Od(e),Or.isWorker!==!0&&(Or.addEventListener("requestReadLock",r=>{pn[r.data.name]!=null&&pn[r.data.name].readLock().then(async n=>await r.data.handler().finally(()=>n()))}),Or.addEventListener("requestWriteLock",async r=>{pn[r.data.name]!=null&&pn[r.data.name].writeLock().then(async n=>await r.data.handler().finally(()=>n()))}))),pn[e.name]==null&&(pn[e.name]=ww(e.name,e)),pn[e.name]}var je={ERR_INVALID_PARAMETERS:"ERR_INVALID_PARAMETERS"};var jn;(function(t){let e;(function(i){let s;i.codec=()=>(s==null&&(s=Ze((o,a,c={})=>{c.lengthDelimited!==!1&&a.fork(),o.key!=null&&o.key!==""&&(a.uint32(10),a.string(o.key)),o.value!=null&&o.value.byteLength>0&&(a.uint32(18),a.bytes(o.value)),c.lengthDelimited!==!1&&a.ldelim()},(o,a)=>{let c={key:"",value:new Uint8Array(0)},u=a==null?o.len:o.pos+a;for(;o.pos>>3){case 1:c.key=o.string();break;case 2:c.value=o.bytes();break;default:o.skipType(l&7);break}}return c})),s),i.encode=o=>Xe(o,i.codec()),i.decode=o=>Qe(o,i.codec())})(e=t.Peer$metadataEntry||(t.Peer$metadataEntry={}));let r;(function(i){let s;i.codec=()=>(s==null&&(s=Ze((o,a,c={})=>{c.lengthDelimited!==!1&&a.fork(),o.key!=null&&o.key!==""&&(a.uint32(10),a.string(o.key)),o.value!=null&&(a.uint32(18),mo.codec().encode(o.value,a)),c.lengthDelimited!==!1&&a.ldelim()},(o,a)=>{let c={key:""},u=a==null?o.len:o.pos+a;for(;o.pos>>3){case 1:c.key=o.string();break;case 2:c.value=mo.codec().decode(o,o.uint32());break;default:o.skipType(l&7);break}}return c})),s),i.encode=o=>Xe(o,i.codec()),i.decode=o=>Qe(o,i.codec())})(r=t.Peer$tagsEntry||(t.Peer$tagsEntry={}));let n;t.codec=()=>(n==null&&(n=Ze((i,s,o={})=>{if(o.lengthDelimited!==!1&&s.fork(),i.addresses!=null)for(let a of i.addresses)s.uint32(10),po.codec().encode(a,s);if(i.protocols!=null)for(let a of i.protocols)s.uint32(18),s.string(a);if(i.publicKey!=null&&(s.uint32(34),s.bytes(i.publicKey)),i.peerRecordEnvelope!=null&&(s.uint32(42),s.bytes(i.peerRecordEnvelope)),i.metadata!=null&&i.metadata.size!==0)for(let[a,c]of i.metadata.entries())s.uint32(50),t.Peer$metadataEntry.codec().encode({key:a,value:c},s);if(i.tags!=null&&i.tags.size!==0)for(let[a,c]of i.tags.entries())s.uint32(58),t.Peer$tagsEntry.codec().encode({key:a,value:c},s);o.lengthDelimited!==!1&&s.ldelim()},(i,s)=>{let o={addresses:[],protocols:[],metadata:new Map,tags:new Map},a=s==null?i.len:i.pos+s;for(;i.pos>>3){case 1:o.addresses.push(po.codec().decode(i,i.uint32()));break;case 2:o.protocols.push(i.string());break;case 4:o.publicKey=i.bytes();break;case 5:o.peerRecordEnvelope=i.bytes();break;case 6:{let u=t.Peer$metadataEntry.codec().decode(i,i.uint32());o.metadata.set(u.key,u.value);break}case 7:{let u=t.Peer$tagsEntry.codec().decode(i,i.uint32());o.tags.set(u.key,u.value);break}default:i.skipType(c&7);break}}return o})),n),t.encode=i=>Xe(i,t.codec()),t.decode=i=>Qe(i,t.codec())})(jn||(jn={}));var po;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.multiaddr!=null&&r.multiaddr.byteLength>0&&(n.uint32(10),n.bytes(r.multiaddr)),r.isCertified!=null&&(n.uint32(16),n.bool(r.isCertified)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={multiaddr:new Uint8Array(0)},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.multiaddr=r.bytes();break;case 2:i.isCertified=r.bool();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(po||(po={}));var mo;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.value!=null&&r.value!==0&&(n.uint32(8),n.uint32(r.value)),r.expiry!=null&&(n.uint32(16),n.uint64(r.expiry)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={value:0},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.value=r.uint32();break;case 2:i.expiry=r.uint64();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(mo||(mo={}));function Jn(t,e){let r=jn.decode(e);r.publicKey!=null&&t.publicKey==null&&(t=Jh({...t,publicKey:t.publicKey}));let n=new Map,i=BigInt(Date.now());for(let[s,o]of r.tags.entries())o.expiry!=null&&o.expiry({multiaddr:Ue(s),isCertified:o??!1})),metadata:r.metadata,peerRecordEnvelope:r.peerRecordEnvelope??void 0,tags:n}}var mr="/",Md=new TextEncoder().encode(mr),go=Md[0],mn=class t{_buf;constructor(e,r){if(typeof e=="string")this._buf=Q(e);else if(e instanceof Uint8Array)this._buf=e;else throw new Error("Invalid key, should be String of Uint8Array");if(r==null&&(r=!0),r&&this.clean(),this._buf.byteLength===0||this._buf[0]!==go)throw new Error("Invalid key")}toString(e="utf8"){return se(this._buf,e)}uint8Array(){return this._buf}get[Symbol.toStringTag](){return`Key(${this.toString()})`}static withNamespaces(e){return new t(e.join(mr))}static random(){return new t(ho().replace(/-/g,""))}static asKey(e){return e instanceof Uint8Array||typeof e=="string"?new t(e):typeof e.uint8Array=="function"?new t(e.uint8Array()):null}clean(){if((this._buf==null||this._buf.byteLength===0)&&(this._buf=Md),this._buf[0]!==go){let e=new Uint8Array(this._buf.byteLength+1);e.fill(go,0,1),e.set(this._buf,1),this._buf=e}for(;this._buf.byteLength>1&&this._buf[this._buf.byteLength-1]===go;)this._buf=this._buf.subarray(0,-1)}less(e){let r=this.list(),n=e.list();for(let i=0;io)return!1}return r.lengthr.namespaces()))])}};function vw(t){let e=t.split(":");return e.length<2?"":e.slice(0,-1).join(":")}function _w(t){let e=t.split(":");return e[e.length-1]}function Sw(t){return[].concat(...t)}var zu="/peers/";function ei(t){if(!Ys(t)||t.type==null)throw new S("Invalid PeerId",je.ERR_INVALID_PARAMETERS);let e=t.toCID().toString();return new mn(`${zu}${e}`)}async function Ud(t,e,r){let n=new Map;for(let i of r){if(i==null)continue;if(i.multiaddr instanceof Uint8Array&&(i.multiaddr=Ue(i.multiaddr)),!Lr(i.multiaddr))throw new S("Multiaddr was invalid",je.ERR_INVALID_PARAMETERS);if(!await e(t,i.multiaddr))continue;let s=i.isCertified??!1,o=i.multiaddr.toString(),a=n.get(o);a!=null?i.isCertified=a.isCertified||s:n.set(o,{multiaddr:i.multiaddr,isCertified:s})}return[...n.values()].sort((i,s)=>i.multiaddr.toString().localeCompare(s.multiaddr.toString())).map(({isCertified:i,multiaddr:s})=>({isCertified:i,multiaddr:s.bytes}))}async function xo(t,e,r,n){if(e==null)throw new S("Invalid PeerData",je.ERR_INVALID_PARAMETERS);if(e.publicKey!=null&&t.publicKey!=null&&!Se(e.publicKey,t.publicKey))throw new S("publicKey bytes do not match peer id publicKey bytes",je.ERR_INVALID_PARAMETERS);let i=n.existingPeer;if(i!=null&&!t.equals(i.id))throw new S("peer id did not match existing peer id",je.ERR_INVALID_PARAMETERS);let s=i?.addresses??[],o=new Set(i?.protocols??[]),a=i?.metadata??new Map,c=i?.tags??new Map,u=i?.peerRecordEnvelope;if(r==="patch"){if((e.multiaddrs!=null||e.addresses!=null)&&(s=[],e.multiaddrs!=null&&s.push(...e.multiaddrs.map(f=>({isCertified:!1,multiaddr:f}))),e.addresses!=null&&s.push(...e.addresses)),e.protocols!=null&&(o=new Set(e.protocols)),e.metadata!=null){let f=e.metadata instanceof Map?[...e.metadata.entries()]:Object.entries(e.metadata);a=yo(f,{validate:Fd})}if(e.tags!=null){let f=e.tags instanceof Map?[...e.tags.entries()]:Object.entries(e.tags);c=yo(f,{validate:Kd,map:qd})}e.peerRecordEnvelope!=null&&(u=e.peerRecordEnvelope)}if(r==="merge"){if(e.multiaddrs!=null&&s.push(...e.multiaddrs.map(f=>({isCertified:!1,multiaddr:f}))),e.addresses!=null&&s.push(...e.addresses),e.protocols!=null&&(o=new Set([...o,...e.protocols])),e.metadata!=null){let f=e.metadata instanceof Map?[...e.metadata.entries()]:Object.entries(e.metadata);for(let[h,p]of f)p==null?a.delete(h):a.set(h,p);a=yo([...a.entries()],{validate:Fd})}if(e.tags!=null){let f=e.tags instanceof Map?[...e.tags.entries()]:Object.entries(e.tags),h=new Map(c);for(let[p,d]of f)d==null?h.delete(p):h.set(p,d);c=yo([...h.entries()],{validate:Kd,map:qd})}e.peerRecordEnvelope!=null&&(u=e.peerRecordEnvelope)}let l={addresses:await Ud(t,n.addressFilter??(async()=>!0),s),protocols:[...o.values()].sort((f,h)=>f.localeCompare(h)),metadata:a,tags:c,publicKey:i?.id.publicKey??e.publicKey??t.publicKey,peerRecordEnvelope:u};return t.type!=="RSA"&&delete l.publicKey,l}function yo(t,e){let r=new Map;for(let[n,i]of t)i!=null&&e.validate(n,i);for(let[n,i]of t.sort(([s],[o])=>s.localeCompare(o)))i!=null&&r.set(n,e.map?.(n,i)??i);return r}function Fd(t,e){if(typeof t!="string")throw new S("Metadata key must be a string",je.ERR_INVALID_PARAMETERS);if(!(e instanceof Uint8Array))throw new S("Metadata value must be a Uint8Array",je.ERR_INVALID_PARAMETERS)}function Kd(t,e){if(typeof t!="string")throw new S("Tag name must be a string",je.ERR_INVALID_PARAMETERS);if(e.value!=null){if(parseInt(`${e.value}`,10)!==e.value)throw new S("Tag value must be an integer",je.ERR_INVALID_PARAMETERS);if(e.value<0||e.value>100)throw new S("Tag value must be between 0-100",je.ERR_INVALID_PARAMETERS)}if(e.ttl!=null){if(parseInt(`${e.ttl}`,10)!==e.ttl)throw new S("Tag ttl must be an integer",je.ERR_INVALID_PARAMETERS);if(e.ttl<0)throw new S("Tag ttl must be between greater than 0",je.ERR_INVALID_PARAMETERS)}}function qd(t,e){let r;return e.expiry!=null&&(r=e.expiry),e.ttl!=null&&(r=BigInt(Date.now()+Number(e.ttl))),{value:e.value??0,expiry:r}}function bo(t,e,r){let n=t.toString().split("/")[2],i=pt.decode(n),s=Gn(i),o=r.get(s);if(o!=null)return o;let a=Jn(s,e);return r.set(s,a),a}function Aw(t,e){return t==null?{}:{prefix:zu,filters:(t.filters??[]).map(r=>({key:n,value:i})=>r(bo(n,i,e))),orders:(t.orders??[]).map(r=>(n,i)=>r(bo(n.key,n.value,e),bo(i.key,i.value,e)))}}var wo=class{peerId;datastore;lock;addressFilter;constructor(e,r={}){this.peerId=e.peerId,this.datastore=e.datastore,this.addressFilter=r.addressFilter,this.lock=$u({name:"peer-store",singleProcess:!0})}async has(e){return this.datastore.has(ei(e))}async delete(e){if(this.peerId.equals(e))throw new S("Cannot delete self peer",je.ERR_INVALID_PARAMETERS);await this.datastore.delete(ei(e))}async load(e){let r=await this.datastore.get(ei(e));return Jn(e,r)}async save(e,r){let{existingBuf:n,existingPeer:i}=await this.#e(e),s=await xo(e,r,"patch",{addressFilter:this.addressFilter});return this.#t(e,s,n,i)}async patch(e,r){let{existingBuf:n,existingPeer:i}=await this.#e(e),s=await xo(e,r,"patch",{addressFilter:this.addressFilter,existingPeer:i});return this.#t(e,s,n,i)}async merge(e,r){let{existingBuf:n,existingPeer:i}=await this.#e(e),s=await xo(e,r,"merge",{addressFilter:this.addressFilter,existingPeer:i});return this.#t(e,s,n,i)}async*all(e){let r=new wt;for await(let{key:n,value:i}of this.datastore.query(Aw(e??{},r))){let s=bo(n,i,r);s.id.equals(this.peerId)||(yield s)}}async#e(e){try{let r=await this.datastore.get(ei(e)),n=Jn(e,r);return{existingBuf:r,existingPeer:n}}catch(r){if(r.code!=="ERR_NOT_FOUND")throw r}return{}}async#t(e,r,n,i){let s=jn.encode(r);return n!=null&&Se(s,n)?{peer:Jn(e,s),previous:i,updated:!1}:(await this.datastore.put(ei(e),s),{peer:Jn(e,s),previous:i,updated:!0})}};var Eo=class{store;events;peerId;log;constructor(e,r={}){this.log=e.logger.forComponent("libp2p:peer-store"),this.events=e.events,this.peerId=e.peerId,this.store=new wo(e,r)}async forEach(e,r){this.log.trace("forEach await read lock");let n=await this.store.lock.readLock();this.log.trace("forEach got read lock");try{for await(let i of this.store.all(r))e(i)}finally{this.log.trace("forEach release read lock"),n()}}async all(e){this.log.trace("all await read lock");let r=await this.store.lock.readLock();this.log.trace("all got read lock");try{return await Ki(this.store.all(e))}finally{this.log.trace("all release read lock"),r()}}async delete(e){this.log.trace("delete await write lock");let r=await this.store.lock.writeLock();this.log.trace("delete got write lock");try{await this.store.delete(e)}finally{this.log.trace("delete release write lock"),r()}}async has(e){this.log.trace("has await read lock");let r=await this.store.lock.readLock();this.log.trace("has got read lock");try{return await this.store.has(e)}finally{this.log.trace("has release read lock"),r()}}async get(e){this.log.trace("get await read lock");let r=await this.store.lock.readLock();this.log.trace("get got read lock");try{return await this.store.load(e)}finally{this.log.trace("get release read lock"),r()}}async save(e,r){this.log.trace("save await write lock");let n=await this.store.lock.writeLock();this.log.trace("save got write lock");try{let i=await this.store.save(e,r);return this.#e(e,i),i.peer}finally{this.log.trace("save release write lock"),n()}}async patch(e,r){this.log.trace("patch await write lock");let n=await this.store.lock.writeLock();this.log.trace("patch got write lock");try{let i=await this.store.patch(e,r);return this.#e(e,i),i.peer}finally{this.log.trace("patch release write lock"),n()}}async merge(e,r){this.log.trace("merge await write lock");let n=await this.store.lock.writeLock();this.log.trace("merge got write lock");try{let i=await this.store.merge(e,r);return this.#e(e,i),i.peer}finally{this.log.trace("merge release write lock"),n()}}async consumePeerRecord(e,r){let n=await Wn.openAndCertify(e,hn.DOMAIN);if(r?.equals(n.peerId)===!1)return this.log("envelope peer id was not the expected peer id - expected: %p received: %p",r,n.peerId),!1;let i=hn.createFromProtobuf(n.payload),s;try{s=await this.get(n.peerId)}catch(o){if(o.code!=="ERR_NOT_FOUND")throw o}if(s?.peerRecordEnvelope!=null){let o=await Wn.createFromProtobuf(s.peerRecordEnvelope),a=hn.createFromProtobuf(o.payload);if(a.seqNumber>=i.seqNumber)return this.log("sequence number was lower or equal to existing sequence number - stored: %d received: %d",a.seqNumber,i.seqNumber),!1}return await this.patch(i.peerId,{peerRecordEnvelope:e,addresses:i.multiaddrs.map(o=>({isCertified:!0,multiaddr:o}))}),!0}#e(e,r){r.updated&&(this.peerId.equals(e)?this.events.safeDispatchEvent("self:peer:update",{detail:r}):this.events.safeDispatchEvent("peer:update",{detail:r}))}};function Iw(t){return t[Symbol.asyncIterator]!=null}function Rw(t){if(Iw(t))return(async()=>{for await(let e of t);})();for(let e of t);}var Hu=Rw;function Cw(t){let[e,r]=t[Symbol.asyncIterator]!=null?[t[Symbol.asyncIterator](),Symbol.asyncIterator]:[t[Symbol.iterator](),Symbol.iterator],n=[];return{peek:()=>e.next(),push:i=>{n.push(i)},next:()=>n.length>0?{done:!1,value:n.shift()}:e.next(),[r](){return this}}}var vo=Cw;function Tw(t){return t[Symbol.asyncIterator]!=null}function Bw(t,e){if(Tw(t))return async function*(){for await(let a of t)await e(a)&&(yield a)}();let r=vo(t),{value:n,done:i}=r.next();if(i===!0)return function*(){}();let s=e(n);if(typeof s.then=="function")return async function*(){await s&&(yield n);for await(let a of r)await e(a)&&(yield a)}();let o=e;return function*(){s===!0&&(yield n);for(let a of r)o(a)&&(yield a)}()}var Ut=Bw;function Lw(t){return t[Symbol.asyncIterator]!=null}function Pw(t,e){return Lw(t)?async function*(){yield*(await Ki(t)).sort(e)}():function*(){yield*Ki(t).sort(e)}()}var Gu=Pw;function Dw(t){return t[Symbol.asyncIterator]!=null}function Nw(t,e){return Dw(t)?async function*(){let r=0;if(!(e<1)){for await(let n of t)if(yield n,r++,r===e)return}}():function*(){let r=0;if(!(e<1)){for(let n of t)if(yield n,r++,r===e)return}}()}var Wu=Nw;var _o=class{put(e,r,n){return Promise.reject(new Error(".put is not implemented"))}get(e,r){return Promise.reject(new Error(".get is not implemented"))}has(e,r){return Promise.reject(new Error(".has is not implemented"))}delete(e,r){return Promise.reject(new Error(".delete is not implemented"))}async*putMany(e,r={}){for await(let{key:n,value:i}of e)await this.put(n,i,r),yield n}async*getMany(e,r={}){for await(let n of e)yield{key:n,value:await this.get(n,r)}}async*deleteMany(e,r={}){for await(let n of e)await this.delete(n,r),yield n}batch(){let e=[],r=[];return{put(n,i){e.push({key:n,value:i})},delete(n){r.push(n)},commit:async n=>{await Hu(this.putMany(e,n)),e=[],await Hu(this.deleteMany(r,n)),r=[]}}}async*_all(e,r){throw new Error("._all is not implemented")}async*_allKeys(e,r){throw new Error("._allKeys is not implemented")}query(e,r){let n=this._all(e,r);if(e.prefix!=null){let i=e.prefix;n=Ut(n,s=>s.key.toString().startsWith(i))}if(Array.isArray(e.filters)&&(n=e.filters.reduce((i,s)=>Ut(i,s),n)),Array.isArray(e.orders)&&(n=e.orders.reduce((i,s)=>Gu(i,s),n)),e.offset!=null){let i=0,s=e.offset;n=Ut(n,()=>i++>=s)}return e.limit!=null&&(n=Wu(n,e.limit)),n}queryKeys(e,r){let n=this._allKeys(e,r);if(e.prefix!=null){let i=e.prefix;n=Ut(n,s=>s.toString().startsWith(i))}if(Array.isArray(e.filters)&&(n=e.filters.reduce((i,s)=>Ut(i,s),n)),Array.isArray(e.orders)&&(n=e.orders.reduce((i,s)=>Gu(i,s),n)),e.offset!=null){let i=e.offset,s=0;n=Ut(n,()=>s++>=i)}return e.limit!=null&&(n=Wu(n,e.limit)),n}};var zd=ve(Yu(),1);function Hd(t){return t=t??new Error("Not Found"),(0,zd.default)(t,"ERR_NOT_FOUND")}var So=class extends _o{data;constructor(){super(),this.data=new Map}put(e,r){return this.data.set(e.toString(),r),e}get(e){let r=this.data.get(e.toString());if(r==null)throw Hd();return r}has(e){return this.data.has(e.toString())}delete(e){this.data.delete(e.toString())}*_all(){for(let[e,r]of this.data.entries())yield{key:new mn(e),value:r}}*_allKeys(){for(let e of this.data.keys())yield new mn(e)}};function Gd(t,e){let r;return function(){let n=function(){r=void 0,t()};clearTimeout(r),r=setTimeout(n,e)}}var Mw=t=>t;function Qu(t,e){let r=t.getPeerId();return r!=null&&ce(r).equals(e)&&(t=t.decapsulate(Ue(`/p2p/${e.toString()}`))),t}var Ao=class{log;components;listen;announce;observed;announceFilter;constructor(e,r={}){let{listen:n=[],announce:i=[]}=r;this.components=e,this.log=e.logger.forComponent("libp2p:address-manager"),this.listen=n.map(s=>s.toString()),this.announce=new Set(i.map(s=>s.toString())),this.observed=new Map,this.announceFilter=r.announceFilter??Mw,this._updatePeerStoreAddresses=Gd(this._updatePeerStoreAddresses.bind(this),1e3),e.events.addEventListener("transport:listening",()=>{this._updatePeerStoreAddresses()}),e.events.addEventListener("transport:close",()=>{this._updatePeerStoreAddresses()})}_updatePeerStoreAddresses(){let e=this.getAnnounceAddrs().concat(this.components.transportManager.getAddrs()).concat([...this.observed.entries()].filter(([r,n])=>n.confident).map(([r])=>Ue(r))).map(r=>r.getPeerId()===this.components.peerId.toString()?r.decapsulate(`/p2p/${this.components.peerId.toString()}`):r);this.components.peerStore.patch(this.components.peerId,{multiaddrs:e}).catch(r=>{this.log.error("error updating addresses",r)})}getListenAddrs(){return Array.from(this.listen).map(e=>Ue(e))}getAnnounceAddrs(){return Array.from(this.announce).map(e=>Ue(e))}getObservedAddrs(){return Array.from(this.observed).map(([e])=>Ue(e))}addObservedAddr(e){e=Qu(e,this.components.peerId);let r=e.toString();this.observed.has(r)||this.observed.set(r,{confident:!1})}confirmObservedAddr(e){e=Qu(e,this.components.peerId);let r=e.toString(),i=(this.observed.get(r)??{confident:!1}).confident;this.observed.set(r,{confident:!0}),i||this._updatePeerStoreAddresses()}removeObservedAddr(e){e=Qu(e,this.components.peerId);let r=e.toString();this.observed.delete(r)}getAddresses(){let e=this.getAnnounceAddrs().map(n=>n.toString());e.length===0&&(e=this.components.transportManager.getAddrs().map(n=>n.toString())),e=e.concat(Array.from(this.observed).filter(([n,i])=>i.confident).map(([n])=>n));let r=new Set(e);return this.announceFilter(Array.from(r).map(n=>Ue(n))).map(n=>n.protos().pop()?.path===!0||n.getPeerId()===this.components.peerId.toString()?n:n.encapsulate(`/p2p/${this.components.peerId.toString()}`))}};function Wd(t){return t!=null&&typeof t.start=="function"&&typeof t.stop=="function"}var Xu=class{components={};_started=!1;constructor(e={}){this.components={};for(let[r,n]of Object.entries(e))this.components[r]=n;this.components.logger==null&&(this.components.logger=Ws())}isStarted(){return this._started}async _invokeStartableMethod(e){await Promise.all(Object.values(this.components).filter(r=>Wd(r)).map(async r=>{await r[e]?.()}))}async beforeStart(){await this._invokeStartableMethod("beforeStart")}async start(){await this._invokeStartableMethod("start"),this._started=!0}async afterStart(){await this._invokeStartableMethod("afterStart")}async beforeStop(){await this._invokeStartableMethod("beforeStop")}async stop(){await this._invokeStartableMethod("stop"),this._started=!1}async afterStop(){await this._invokeStartableMethod("afterStop")}},Uw=["metrics","connectionProtector"],Fw=["components","isStarted","beforeStart","start","afterStart","beforeStop","stop","afterStop","then","_invokeStartableMethod"];function Yd(t={}){let e=new Xu(t);return new Proxy(e,{get(n,i,s){if(typeof i=="string"&&!Fw.includes(i)){let o=e.components[i];if(o==null&&!Uw.includes(i))throw new S(`${i} not set`,"ERR_SERVICE_MISSING");return o}return Reflect.get(n,i,s)},set(n,i,s){return typeof i=="string"?e.components[i]=s:Reflect.set(n,i,s),!0}})}var tp=ve(Qd(),1);var Xd="[a-fA-F\\d:]",Mr=t=>t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=${Xd})|(?<=${Xd})(?=\\s|$))`:"",Ft="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",ke="[a-fA-F\\d]{1,4}",Io=` -(?: -(?:${ke}:){7}(?:${ke}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 -(?:${ke}:){6}(?:${Ft}|:${ke}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 -(?:${ke}:){5}(?::${Ft}|(?::${ke}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4 -(?:${ke}:){4}(?:(?::${ke}){0,1}:${Ft}|(?::${ke}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4 -(?:${ke}:){3}(?:(?::${ke}){0,2}:${Ft}|(?::${ke}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4 -(?:${ke}:){2}(?:(?::${ke}){0,3}:${Ft}|(?::${ke}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4 -(?:${ke}:){1}(?:(?::${ke}){0,4}:${Ft}|(?::${ke}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 -(?::(?:(?::${ke}){0,5}:${Ft}|(?::${ke}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 -)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1 -`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),Kw=new RegExp(`(?:^${Ft}$)|(?:^${Io}$)`),qw=new RegExp(`^${Ft}$`),Vw=new RegExp(`^${Io}$`),Zu=t=>t&&t.exact?Kw:new RegExp(`(?:${Mr(t)}${Ft}${Mr(t)})|(?:${Mr(t)}${Io}${Mr(t)})`,"g");Zu.v4=t=>t&&t.exact?qw:new RegExp(`${Mr(t)}${Ft}${Mr(t)}`,"g");Zu.v6=t=>t&&t.exact?Vw:new RegExp(`${Mr(t)}${Io}${Mr(t)}`,"g");var Zd=Zu;var rp=ve(Jd(),1),{isValid:$w,parse:zw}=rp.default,Hw=["0.0.0.0/8","10.0.0.0/8","100.64.0.0/10","127.0.0.0/8","169.254.0.0/16","172.16.0.0/12","192.0.0.0/24","192.0.0.0/29","192.0.0.8/32","192.0.0.9/32","192.0.0.10/32","192.0.0.170/32","192.0.0.171/32","192.0.2.0/24","192.31.196.0/24","192.52.193.0/24","192.88.99.0/24","192.168.0.0/16","192.175.48.0/24","198.18.0.0/15","198.51.100.0/24","203.0.113.0/24","240.0.0.0/4","255.255.255.255/32"],Gw=Hw.map(t=>new tp.Netmask(t));function Ww(t){for(let e of Gw)if(e.contains(t))return!0;return!1}function ep(t){return/^::$/.test(t)||/^::1$/.test(t)||/^::f{4}:([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(t)||/^::f{4}:0.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(t)||/^64:ff9b::([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(t)||/^100::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2001::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2001:2[0-9a-fA-F]:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2001:db8:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2002:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^f[c-d]([0-9a-fA-F]{2,2}):/i.test(t)||/^fe[8-9a-bA-B][0-9a-fA-F]:/i.test(t)||/^ff([0-9a-fA-F]{2,2}):/i.test(t)}var np=t=>{if($w(t)){let e=zw(t);if(e.kind()==="ipv4")return Ww(e.toNormalizedString());if(e.kind()==="ipv6")return ep(t)}else if(Qn(t)&&Zd.v6().test(t))return ep(t)};var Co=np;function ip(t={}){return{denyDialPeer:async()=>!1,denyDialMultiaddr:async e=>{let r=e.stringTuples();return r[0][0]===4||r[0][0]===41?!!Co(`${r[0][1]}`):!1},denyInboundConnection:async()=>!1,denyOutboundConnection:async()=>!1,denyInboundEncryptedConnection:async()=>!1,denyOutboundEncryptedConnection:async()=>!1,denyInboundUpgradedConnection:async()=>!1,denyOutboundUpgradedConnection:async()=>!1,filterMultiaddrForPeer:async()=>!0,...t}}var $T=Symbol.for("@libp2p/transport");var Ur;(function(t){t[t.FATAL_ALL=0]="FATAL_ALL",t[t.NO_FATAL=1]="NO_FATAL"})(Ur||(Ur={}));var Yw=t=>t.toString().split("/").slice(1),Qi=t=>({match:e=>e.length<1?!1:t(e[0])?e.slice(1):!1,pattern:"fn"}),Le=t=>({match:e=>Qi(r=>r===t).match(e),pattern:t}),Lo=()=>({match:t=>Qi(e=>typeof e=="string").match(t),pattern:"{string}"}),sp=()=>({match:t=>Qi(e=>!isNaN(parseInt(e))).match(t),pattern:"{number}"}),Rt=()=>({match:t=>{if(t.length<2||t[0]!=="p2p"&&t[0]!=="ipfs")return!1;if(t[1].startsWith("Q")||t[1].startsWith("1"))try{_e.decode(`z${t[1]}`)}catch{return!1}else return!1;return t.slice(2)},pattern:"/p2p/{peerid}"}),To=()=>({match:t=>{if(t.length<2||t[0]!=="certhash")return!1;try{Ga.decode(t[1])}catch{return!1}return t.slice(2)},pattern:"/certhash/{certhash}"}),Xt=t=>({match:e=>{let r=t.match(e);return r===!1?e:r},pattern:`optional(${t.pattern})`}),Zt=(...t)=>({match:e=>{let r;for(let n of t){let i=n.match(e);i!==!1&&(r==null||i.lengthe.pattern).join(", ")})`}),Pe=(...t)=>({match:e=>{for(let r of t){let n=r.match(e);if(n===!1)return!1;e=n}return e},pattern:`and(${t.map(e=>e.pattern).join(", ")})`});function Fe(...t){function e(i){let s=Yw(i);for(let o of t){let a=o.match(s);if(a===!1)return!1;s=a}return s}function r(i){return e(i)!==!1}function n(i){let s=e(i);return s===!1?!1:s.length===0}return{matches:r,exactMatch:n}}var Ju=Pe(Le("dns4"),Lo()),el=Pe(Le("dns6"),Lo()),tl=Pe(Le("dnsaddr"),Lo()),op=Pe(Le("dns"),Lo()),QT=Fe(Ju),XT=Fe(el),ZT=Fe(tl),jT=Fe(Zt(op,tl,Ju,el)),ap=Pe(Le("ip4"),Qi(Js)),cp=Pe(Le("ip6"),Qi(eo)),up=Zt(ap,cp),Xi=Zt(up,op,Ju,el,tl),JT=Fe(Xi),e3=Fe(ap),t3=Fe(cp),r3=Fe(up),Po=Pe(Xi,Le("tcp"),sp()),Zi=Pe(Xi,Le("udp"),sp()),Qw=Zt(Po,Zi),n3=Fe(Po),i3=Fe(Zi),rl=Pe(Zi,Le("quic")),Do=Pe(Zi,Le("quic-v1")),Xw=Zt(rl,Do),s3=Fe(rl),o3=Fe(Do),ju=Zt(Xi,Po,Zi,rl,Do),lp=Zt(Pe(ju,Le("ws"),Xt(Rt()))),a3=Fe(lp),fp=Zt(Pe(ju,Le("wss"),Xt(Rt())),Pe(ju,Le("tls"),Le("ws"),Xt(Rt()))),c3=Fe(fp),hp=Pe(Qw,Le("webrtc-direct"),To(),Xt(To()),Xt(Rt())),u3=Fe(hp),dp=Pe(Do,Le("webtransport"),To(),To(),Xt(Rt())),l3=Fe(dp),Bo=Zt(lp,fp,Pe(Po,Xt(Rt())),Pe(Xw,Xt(Rt())),Pe(Xi,Xt(Rt())),hp,dp,Rt()),f3=Fe(Bo),Zw=Pe(Bo,Le("p2p-circuit"),Rt()),nl=Fe(Zw),jw=Zt(Pe(Bo,Le("p2p-circuit"),Le("webrtc"),Rt()),Pe(Bo,Le("webrtc"),Xt(Rt())),Le("webrtc")),h3=Fe(jw);function il(t){try{let{address:e}=t.nodeAddress();return!!Co(e)}catch{return!0}}function Jw(t,e){let r=il(t.multiaddr),n=il(e.multiaddr);return r&&!n?1:!r&&n?-1:0}function eE(t,e){return t.isCertified&&!e.isCertified?-1:!t.isCertified&&e.isCertified?1:0}function tE(t,e){let r=nl.exactMatch(t.multiaddr),n=nl.exactMatch(e.multiaddr);return r&&!n?1:!r&&n?-1:0}function ti(t,e){let r=Jw(t,e);if(r!==0)return r;let n=tE(t,e);return n!==0?n:eE(t,e)}var ol=ve(tu(),1),al=ve(gp(),1);function No(t,e,r){return`${t}?name=${e}&type=${r}`}async function yp(t,e){return await(await fetch(t,{headers:new Headers({accept:"application/dns-json"}),signal:e})).json()}function gn(t,e){return`${e}_${t}`}var sl=Object.assign((0,ol.default)("dns-over-http-resolver"),{error:(0,ol.default)("dns-over-http-resolver:error")}),cl=class{_cache;_TXTcache;_servers;_request;_abortControllers;constructor(e={}){this._cache=new al.default({max:e?.maxCache??100}),this._TXTcache=new al.default({max:e?.maxCache??100}),this._servers=["https://cloudflare-dns.com/dns-query","https://dns.google/resolve"],this._request=e.request??yp,this._abortControllers=[]}cancel(){this._abortControllers.forEach(e=>{e.abort()})}getServers(){return this._servers}_getShuffledServers(){let e=[...this._servers];for(let r=e.length-1;r>0;r--){let n=Math.floor(Math.random()*r),i=e[r];e[r]=e[n],e[n]=i}return e}setServers(e){this._servers=e}async resolve(e,r="A"){switch(r){case"A":return this.resolve4(e);case"AAAA":return this.resolve6(e);case"TXT":return this.resolveTxt(e);default:throw new Error(`${r} is not supported`)}}async resolve4(e){let r="A",n=this._cache.get(gn(e,r));if(n!=null)return n;let i=!1;for(let s of this._getShuffledServers()){let o=new AbortController;this._abortControllers.push(o);try{let a=await this._request(No(s,e,r),o.signal),c=a.Answer.map(l=>l.data),u=Math.min(...a.Answer.map(l=>l.TTL));return this._cache.set(gn(e,r),c,{ttl:u}),c}catch{o.signal.aborted&&(i=!0),sl.error(`${s} could not resolve ${e} record ${r}`)}finally{this._abortControllers=this._abortControllers.filter(a=>a!==o)}}throw i?Object.assign(new Error("queryA ECANCELLED"),{code:"ECANCELLED"}):new Error(`Could not resolve ${e} record ${r}`)}async resolve6(e){let r="AAAA",n=this._cache.get(gn(e,r));if(n!=null)return n;let i=!1;for(let s of this._getShuffledServers()){let o=new AbortController;this._abortControllers.push(o);try{let a=await this._request(No(s,e,r),o.signal),c=a.Answer.map(l=>l.data),u=Math.min(...a.Answer.map(l=>l.TTL));return this._cache.set(gn(e,r),c,{ttl:u}),c}catch{o.signal.aborted&&(i=!0),sl.error(`${s} could not resolve ${e} record ${r}`)}finally{this._abortControllers=this._abortControllers.filter(a=>a!==o)}}throw i?Object.assign(new Error("queryAaaa ECANCELLED"),{code:"ECANCELLED"}):new Error(`Could not resolve ${e} record ${r}`)}async resolveTxt(e){let r="TXT",n=this._TXTcache.get(gn(e,r));if(n!=null)return n;let i=!1;for(let s of this._getShuffledServers()){let o=new AbortController;this._abortControllers.push(o);try{let a=await this._request(No(s,e,r),o.signal),c=a.Answer.map(l=>[l.data.replace(/['"]+/g,"")]),u=Math.min(...a.Answer.map(l=>l.TTL));return this._TXTcache.set(gn(e,r),c,{ttl:u}),c}catch{o.signal.aborted&&(i=!0),sl.error(`${s} could not resolve ${e} record ${r}`)}finally{this._abortControllers=this._abortControllers.filter(a=>a!==o)}}throw i?Object.assign(new Error("queryTxt ECANCELLED"),{code:"ECANCELLED"}):new Error(`Could not resolve ${e} record ${r}`)}clearCache(){this._cache.clear(),this._TXTcache.clear()}},xp=cl;var bp=xp;var{code:oE}=fe("dnsaddr");async function ri(t,e={}){let r=new bp;e.signal!=null&&e.signal.addEventListener("abort",()=>{r.cancel()});let n=t.getPeerId(),[,i]=t.stringTuples().find(([a])=>a===oE)??[];if(i==null)throw new Error("No hostname found in multiaddr");let o=(await r.resolveTxt(`_dnsaddr.${i}`)).flat().map(a=>a.split("=")[1]).filter(Boolean);return n!=null&&(o=o.filter(a=>a.includes(n))),o}var Cp=ve(Rp(),1),Mo=Cp.default;var jt;(function(t){t.NOT_STARTED_YET="The libp2p node is not started yet",t.DHT_DISABLED="DHT is not available",t.PUBSUB_DISABLED="PubSub is not available",t.CONN_ENCRYPTION_REQUIRED="At least one connection encryption module is required",t.ERR_TRANSPORTS_REQUIRED="At least one transport module is required",t.ERR_PROTECTOR_REQUIRED="Private network is enforced, but no protector was provided",t.NOT_FOUND="Not found"})(jt||(jt={}));var F;(function(t){t.DHT_DISABLED="ERR_DHT_DISABLED",t.ERR_PUBSUB_DISABLED="ERR_PUBSUB_DISABLED",t.PUBSUB_NOT_STARTED="ERR_PUBSUB_NOT_STARTED",t.DHT_NOT_STARTED="ERR_DHT_NOT_STARTED",t.CONN_ENCRYPTION_REQUIRED="ERR_CONN_ENCRYPTION_REQUIRED",t.ERR_TRANSPORTS_REQUIRED="ERR_TRANSPORTS_REQUIRED",t.ERR_PROTECTOR_REQUIRED="ERR_PROTECTOR_REQUIRED",t.ERR_PEER_DIAL_INTERCEPTED="ERR_PEER_DIAL_INTERCEPTED",t.ERR_CONNECTION_INTERCEPTED="ERR_CONNECTION_INTERCEPTED",t.ERR_INVALID_PROTOCOLS_FOR_STREAM="ERR_INVALID_PROTOCOLS_FOR_STREAM",t.ERR_CONNECTION_ENDED="ERR_CONNECTION_ENDED",t.ERR_CONNECTION_FAILED="ERR_CONNECTION_FAILED",t.ERR_NODE_NOT_STARTED="ERR_NODE_NOT_STARTED",t.ERR_ALREADY_ABORTED="ERR_ALREADY_ABORTED",t.ERR_TOO_MANY_ADDRESSES="ERR_TOO_MANY_ADDRESSES",t.ERR_NO_VALID_ADDRESSES="ERR_NO_VALID_ADDRESSES",t.ERR_RELAYED_DIAL="ERR_RELAYED_DIAL",t.ERR_DIALED_SELF="ERR_DIALED_SELF",t.ERR_DISCOVERED_SELF="ERR_DISCOVERED_SELF",t.ERR_DUPLICATE_TRANSPORT="ERR_DUPLICATE_TRANSPORT",t.ERR_ENCRYPTION_FAILED="ERR_ENCRYPTION_FAILED",t.ERR_HOP_REQUEST_FAILED="ERR_HOP_REQUEST_FAILED",t.ERR_INVALID_KEY="ERR_INVALID_KEY",t.ERR_INVALID_MESSAGE="ERR_INVALID_MESSAGE",t.ERR_INVALID_PARAMETERS="ERR_INVALID_PARAMETERS",t.ERR_INVALID_PEER="ERR_INVALID_PEER",t.ERR_MUXER_UNAVAILABLE="ERR_MUXER_UNAVAILABLE",t.ERR_NOT_FOUND="ERR_NOT_FOUND",t.ERR_TRANSPORT_UNAVAILABLE="ERR_TRANSPORT_UNAVAILABLE",t.ERR_TRANSPORT_DIAL_FAILED="ERR_TRANSPORT_DIAL_FAILED",t.ERR_UNSUPPORTED_PROTOCOL="ERR_UNSUPPORTED_PROTOCOL",t.ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED="ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED",t.ERR_INVALID_MULTIADDR="ERR_INVALID_MULTIADDR",t.ERR_SIGNATURE_NOT_VALID="ERR_SIGNATURE_NOT_VALID",t.ERR_FIND_SELF="ERR_FIND_SELF",t.ERR_NO_ROUTERS_AVAILABLE="ERR_NO_ROUTERS_AVAILABLE",t.ERR_CONNECTION_NOT_MULTIPLEXED="ERR_CONNECTION_NOT_MULTIPLEXED",t.ERR_NO_DIAL_TOKENS="ERR_NO_DIAL_TOKENS",t.ERR_INVALID_CMS="ERR_INVALID_CMS",t.ERR_MISSING_KEYS="ERR_MISSING_KEYS",t.ERR_NO_KEY="ERR_NO_KEY",t.ERR_INVALID_KEY_NAME="ERR_INVALID_KEY_NAME",t.ERR_INVALID_KEY_TYPE="ERR_INVALID_KEY_TYPE",t.ERR_KEY_ALREADY_EXISTS="ERR_KEY_ALREADY_EXISTS",t.ERR_INVALID_KEY_SIZE="ERR_INVALID_KEY_SIZE",t.ERR_KEY_NOT_FOUND="ERR_KEY_NOT_FOUND",t.ERR_OLD_KEY_NAME_INVALID="ERR_OLD_KEY_NAME_INVALID",t.ERR_NEW_KEY_NAME_INVALID="ERR_NEW_KEY_NAME_INVALID",t.ERR_PASSWORD_REQUIRED="ERR_PASSWORD_REQUIRED",t.ERR_PEM_REQUIRED="ERR_PEM_REQUIRED",t.ERR_CANNOT_READ_KEY="ERR_CANNOT_READ_KEY",t.ERR_MISSING_PRIVATE_KEY="ERR_MISSING_PRIVATE_KEY",t.ERR_MISSING_PUBLIC_KEY="ERR_MISSING_PUBLIC_KEY",t.ERR_INVALID_OLD_PASS_TYPE="ERR_INVALID_OLD_PASS_TYPE",t.ERR_INVALID_NEW_PASS_TYPE="ERR_INVALID_NEW_PASS_TYPE",t.ERR_INVALID_PASS_LENGTH="ERR_INVALID_PASS_LENGTH",t.ERR_NOT_IMPLEMENTED="ERR_NOT_IMPLEMENTED",t.ERR_WRONG_PING_ACK="ERR_WRONG_PING_ACK",t.ERR_INVALID_RECORD="ERR_INVALID_RECORD",t.ERR_ALREADY_SUCCEEDED="ERR_ALREADY_SUCCEEDED",t.ERR_NO_HANDLER_FOR_PROTOCOL="ERR_NO_HANDLER_FOR_PROTOCOL",t.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS="ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS",t.ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS="ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS",t.ERR_CONNECTION_DENIED="ERR_CONNECTION_DENIED",t.ERR_TRANSFER_LIMIT_EXCEEDED="ERR_TRANSFER_LIMIT_EXCEEDED"})(F||(F={}));var hE={addresses:{listen:[],announce:[],noAnnounce:[],announceFilter:t=>t},connectionManager:{resolvers:{dnsaddr:ri},addressSorter:ti},transportManager:{faultTolerance:Ur.FATAL_ALL}};function Tp(t){let e=Mo(hE,t);if(e.transports==null||e.transports.length<1)throw new S(jt.ERR_TRANSPORTS_REQUIRED,F.ERR_TRANSPORTS_REQUIRED);if(e.connectionProtector===null&&globalThis.process?.env?.LIBP2P_FORCE_PNET!=null)throw new S(jt.ERR_PROTECTOR_REQUIRED,F.ERR_PROTECTOR_REQUIRED);return e}var Bp="keep-alive";var Cm=ve(Sm(),1);function Fo(t){if(Ys(t))return{peerId:t,multiaddrs:[]};Array.isArray(t)||(t=[t]);let e;if(t.length>0){let r=t[0].getPeerId();e=r==null?void 0:ce(r),t.forEach(n=>{if(!Lr(n))throw new S("Invalid Multiaddr",F.ERR_INVALID_MULTIADDR);let i=n.getPeerId();if(i==null){if(e!=null)throw new S("Multiaddrs must all have the same peer id or have no peer id",F.ERR_INVALID_PARAMETERS)}else{let s=ce(i);if(e==null||!e.equals(s))throw new S("Multiaddrs must all have the same peer id or have no peer id",F.ERR_INVALID_PARAMETERS)}})}return{peerId:e,multiaddrs:t}}function YE(t,e,r){let n=0,i=t.length;for(;i>0;){let s=Math.trunc(i/2),o=n+s;r(t[o],e)<=0?(n=++o,i-=s+1):i=s}return n}var Al=class{#e=[];enqueue(e,r){let n=r?.peerId,i=r?.priority??0;if(n==null)throw new S("missing peer id",m0);let s={priority:i,peerId:n,run:e};if(this.size>0&&this.#e[this.size-1].priority>=i){this.#e.push(s);return}let o=YE(this.#e,s,(a,c)=>c.priority-a.priority);this.#e.splice(o,0,s)}dequeue(){return this.#e.shift()?.run}filter(e){if(e.peerId!=null){let r=e.peerId;return this.#e.filter(n=>r.equals(n.peerId)).map(n=>n.run)}return this.#e.filter(r=>r.priority===e.priority).map(r=>r.run)}get size(){return this.#e.length}},Ko=class extends Nr{constructor(e={}){super({...e,queueClass:Al})}hasJob(e){return this.sizeBy({peerId:e})>0}};var qo="last-dial-failure";var Vo=5,$o=100,zo=50,Am=1e3*60*7;var yn={minConnections:Vo,maxQueueLength:100,autoDialConcurrency:25,autoDialPriority:0,autoDialInterval:5e3,autoDialPeerRetryThreshold:Am,autoDialDiscoveredPeersDebounce:10},Ho=class{connectionManager;peerStore;queue;minConnections;autoDialPriority;autoDialIntervalMs;autoDialMaxQueueLength;autoDialPeerRetryThresholdMs;autoDialDiscoveredPeersDebounce;autoDialInterval;started;running;log;constructor(e,r){this.connectionManager=e.connectionManager,this.peerStore=e.peerStore,this.minConnections=r.minConnections??yn.minConnections,this.autoDialPriority=r.autoDialPriority??yn.autoDialPriority,this.autoDialIntervalMs=r.autoDialInterval??yn.autoDialInterval,this.autoDialMaxQueueLength=r.maxQueueLength??yn.maxQueueLength,this.autoDialPeerRetryThresholdMs=r.autoDialPeerRetryThreshold??yn.autoDialPeerRetryThreshold,this.autoDialDiscoveredPeersDebounce=r.autoDialDiscoveredPeersDebounce??yn.autoDialDiscoveredPeersDebounce,this.log=e.logger.forComponent("libp2p:connection-manager:auto-dial"),this.started=!1,this.running=!1,this.queue=new Ko({concurrency:r.autoDialConcurrency??yn.autoDialConcurrency}),this.queue.addListener("error",i=>{this.log.error("error during auto-dial",i)}),e.events.addEventListener("connection:close",()=>{this.autoDial().catch(i=>{this.log.error(i)})});let n;e.events.addEventListener("peer:discovery",()=>{clearTimeout(n),n=setTimeout(()=>{this.autoDial().catch(i=>{this.log.error(i)})},this.autoDialDiscoveredPeersDebounce)})}isStarted(){return this.started}start(){this.autoDialInterval=setTimeout(()=>{this.autoDial().catch(e=>{this.log.error("error while autodialing",e)})},this.autoDialIntervalMs),this.started=!0}afterStart(){this.autoDial().catch(e=>{this.log.error("error while autodialing",e)})}stop(){this.queue.clear(),clearTimeout(this.autoDialInterval),this.started=!1,this.running=!1}async autoDial(){if(!this.started)return;let e=this.connectionManager.getConnectionsMap(),r=e.size;if(r>=this.minConnections){this.minConnections>0&&this.log.trace("have enough connections %d/%d",r,this.minConnections);return}if(this.queue.size>this.autoDialMaxQueueLength){this.log("not enough connections %d/%d but auto dial queue is full",r,this.minConnections);return}if(this.running){this.log("not enough connections %d/%d - but skipping autodial as it is already running",r,this.minConnections);return}this.running=!0,this.log("not enough connections %d/%d - will dial peers to increase the number of connections",r,this.minConnections);let n=new ln(this.connectionManager.getDialQueue().map(u=>u.peerId).filter(Boolean)),i=await this.peerStore.all({filters:[u=>u.addresses.length===0?(this.log.trace("not autodialing %p because they have no addresses",u.id),!1):e.has(u.id)?(this.log.trace("not autodialing %p because they are already connected",u.id),!1):n.has(u.id)?(this.log.trace("not autodialing %p because they are already being dialed",u.id),!1):this.queue.hasJob(u.id)?(this.log.trace("not autodialing %p because they are already being autodialed",u.id),!1):!0]}),s=i.sort(()=>Math.random()>.5?1:-1),o=new wt;for(let u of s)o.has(u.id)||o.set(u.id,[...u.tags.values()].reduce((l,f)=>l+f.value,0));let c=s.sort((u,l)=>{let f=o.get(u.id)??0,h=o.get(l.id)??0;return f>h?-1:f{let l=u.metadata.get(qo);if(l==null)return!0;let f=parseInt(se(l));return isNaN(f)?!0:Date.now()-f>this.autoDialPeerRetryThresholdMs});this.log("selected %d/%d peers to dial",c.length,i.length);for(let u of c)this.queue.add(async()=>{let l=this.connectionManager.getConnectionsMap().size;if(l>=this.minConnections){this.log("got enough connections now %d/%d",l,this.minConnections),this.queue.clear();return}this.log("connecting to a peerStore stored peer %p",u.id),await this.connectionManager.openConnection(u.id,{priority:this.autoDialPriority})},{peerId:u.id}).catch(l=>{this.log.error("could not connect to peerStore stored peer",l)});this.running=!1,this.started&&(this.autoDialInterval=setTimeout(()=>{this.autoDial().catch(u=>{this.log.error("error while autodialing",u)})},this.autoDialIntervalMs))}};var Im={maxConnections:$o,allow:[]},Go=class{maxConnections;connectionManager;peerStore;allow;events;log;constructor(e,r={}){this.maxConnections=r.maxConnections??Im.maxConnections,this.allow=r.allow??Im.allow,this.connectionManager=e.connectionManager,this.peerStore=e.peerStore,this.events=e.events,this.log=e.logger.forComponent("libp2p:connection-manager:connection-pruner"),e.events.addEventListener("connection:open",()=>{this.maybePruneConnections().catch(n=>{this.log.error(n)})})}async maybePruneConnections(){let e=this.connectionManager.getConnections(),r=e.length,n=Math.max(r-this.maxConnections,0);if(this.log("checking max connections limit %d/%d",r,this.maxConnections),r<=this.maxConnections)return;this.log("max connections limit exceeded %d/%d, pruning %d connection(s)",r,this.maxConnections,n);let i=new wt;for(let a of e){let c=a.remotePeer;if(!i.has(c)){i.set(c,0);try{let u=await this.peerStore.get(c);i.set(c,[...u.tags.values()].reduce((l,f)=>l+f.value,0))}catch(u){u.code!=="ERR_NOT_FOUND"&&this.log.error("error loading peer tags",u)}}}let s=e.sort((a,c)=>{let u=i.get(a.remotePeer)??0,l=i.get(c.remotePeer)??0;if(u>l)return 1;if(uh?-1:0}),o=[];for(let a of s)if(this.log("too many connections open - closing a connection to %p",a.remotePeer),this.allow.some(u=>a.remoteAddr.toString().startsWith(u.toString()))||o.push(a),o.length===n)break;await Promise.all(o.map(async a=>{try{await a.close()}catch(c){this.log.error(c)}})),this.events.safeDispatchEvent("connection:prune",{detail:o})}};function Wo(t){let e=new globalThis.AbortController;function r(){e.abort();for(let s of t)s?.removeEventListener!=null&&s.removeEventListener("abort",r)}for(let s of t){if(s?.aborted===!0){r();break}s?.addEventListener!=null&&s.addEventListener("abort",r)}function n(){for(let s of t)s?.removeEventListener!=null&&s.removeEventListener("abort",r)}let i=e.signal;return i.clear=n,i}function ut(){let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}async function Tl(t,e){if(!t.protoNames().includes("dnsaddr"))return[t];let n=await ZE(t,e),o=(await Promise.all(n.map(async a=>Tl(a,e)))).flat().reduce((a,c)=>(a.find(u=>u.equals(c))==null&&a.push(c),a),[]);return e.log("resolved %s to",t,o.map(a=>a.toString())),o}async function ZE(t,e){try{return t=Ue(t.toString()),await t.resolve(e)}catch(r){return e.log.error(`multiaddr ${t.toString()} could not be resolved`,r),[]}}function Rm(...t){let e=[];for(let n of t)n!=null&&(yt(1/0,n),e.push(n));let r=Wo(e);return yt(1/0,r),r}var Yo={addressSorter:ti,maxParallelDials:zo,maxPeerAddrsToDial:25,dialTimeout:3e4,resolvers:{dnsaddr:ri}},Qo=class{pendingDials;queue;peerId;peerStore;connectionGater;transportManager;addressSorter;maxPeerAddrsToDial;dialTimeout;inProgressDialCount;pendingDialCount;shutDownController;connections;log;constructor(e,r={}){this.addressSorter=r.addressSorter??Yo.addressSorter,this.maxPeerAddrsToDial=r.maxPeerAddrsToDial??Yo.maxPeerAddrsToDial,this.dialTimeout=r.dialTimeout??Yo.dialTimeout,this.connections=r.connections??new wt,this.log=e.logger.forComponent("libp2p:connection-manager:dial-queue"),this.peerId=e.peerId,this.peerStore=e.peerStore,this.connectionGater=e.connectionGater,this.transportManager=e.transportManager,this.shutDownController=new AbortController,yt(1/0,this.shutDownController.signal),this.pendingDialCount=e.metrics?.registerMetric("libp2p_dial_queue_pending_dials"),this.inProgressDialCount=e.metrics?.registerMetric("libp2p_dial_queue_in_progress_dials"),this.pendingDials=[];for(let[n,i]of Object.entries(r.resolvers??{}))ro.set(n,i);this.queue=new Nr({concurrency:r.maxParallelDials??Yo.maxParallelDials}),this.queue.on("add",()=>{this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)}),this.queue.on("active",()=>{this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)}),this.queue.on("completed",()=>{this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)}),this.queue.on("error",n=>{this.log.error("error in dial queue",n),this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)}),this.queue.on("empty",()=>{this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)}),this.queue.on("idle",()=>{this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)})}stop(){this.shutDownController.abort()}async dial(e,r={}){let{peerId:n,multiaddrs:i}=Fo(e),s=i.map(h=>({multiaddr:h,isCertified:!1})),o=this.createDialAbortControllers(r.signal),a;try{a=await this.calculateMultiaddrs(n,s,{...r,signal:o})}catch(h){throw o.clear(),h}let c=Array.from(this.connections.values()).flat().find(h=>r.force===!0?!1:a.find(p=>p.multiaddr.equals(h.remoteAddr)));if(c!=null)return this.log("already connected to %a",c.remoteAddr),c;let u=this.pendingDials.find(h=>!!(h.peerId!=null&&n!=null&&h.peerId.equals(n)||a.map(({multiaddr:p})=>p.toString()).join()===h.multiaddrs.map(p=>p.toString()).join()));if(u!=null)return this.log("joining existing dial target for %p",n),o.clear(),u.promise;this.log("creating dial target for",a.map(({multiaddr:h})=>h.toString()));let l={id:jE(),status:"queued",peerId:n,multiaddrs:a.map(({multiaddr:h})=>h)};l.promise=this.performDial(l,{...r,signal:o}).finally(()=>{this.pendingDials=this.pendingDials.filter(h=>h.id!==l.id),o.clear()}).catch(async h=>{if(this.log.error("dial failed to %s",l.multiaddrs.map(p=>p.toString()).join(", "),h),n!=null)try{await this.peerStore.patch(n,{metadata:{[qo]:Q(Date.now().toString())}})}catch(p){this.log.error("could not update last dial failure key for %p",n,p)}throw o.aborted?new S(h.message,vs):h}),this.pendingDials.push(l);let f=await l.promise;return c=Array.from(this.connections.values()).flat().find(h=>r.force===!0?!1:h.id!==f.id&&h.remoteAddr.equals(f.remoteAddr)),c!=null?(this.log("already connected to %a",c.remoteAddr),await f.close(),c):(this.log("connection opened to %a",f.remoteAddr),f)}createDialAbortControllers(e){let r=Wo([AbortSignal.timeout(this.dialTimeout),this.shutDownController.signal,e]);try{yt?.(1/0,r)}catch{}return r}async calculateMultiaddrs(e,r=[],n={}){if(e!=null){if(this.peerId.equals(e))throw new S("Tried to dial self",F.ERR_DIALED_SELF);if(await this.connectionGater.denyDialPeer?.(e)===!0)throw new S("The dial request is blocked by gater.allowDialPeer",F.ERR_PEER_DIAL_INTERCEPTED);if(r.length===0){this.log("loading multiaddrs for %p",e);try{let l=await this.peerStore.get(e);r.push(...l.addresses),this.log("loaded multiaddrs for %p",e,r.map(({multiaddr:f})=>f.toString()))}catch(l){if(l.code!==F.ERR_NOT_FOUND)throw l}}}let i=(await Promise.all(r.map(async l=>{let f=await Tl(l.multiaddr,{...n,log:this.log});return f.length===1&&f[0].equals(l.multiaddr)?l:f.map(h=>({multiaddr:h,isCertified:!1}))}))).flat();if(e!=null){let l=`/p2p/${e.toString()}`;i=i.map(f=>f.multiaddr.protos().pop()?.path===!0?f:f.multiaddr.getPeerId()==null?{multiaddr:f.multiaddr.encapsulate(l),isCertified:f.isCertified}:f)}let s=i.filter(l=>{if(this.transportManager.transportForMultiaddr(l.multiaddr)==null)return!1;let f=l.multiaddr.getPeerId();return e!=null&&f!=null?e.equals(f):!0}),o=new Map;for(let l of s){let f=l.multiaddr.toString(),h=o.get(f);if(h!=null){h.isCertified=h.isCertified||l.isCertified||!1;continue}o.set(f,l)}let a=[...o.values()];if((a.length===0||a.length>this.maxPeerAddrsToDial)&&(this.log("addresses for %p before filtering",e??"unknown peer",i.map(({multiaddr:l})=>l.toString())),this.log("addresses for %p after filtering",e??"unknown peer",a.map(({multiaddr:l})=>l.toString()))),a.length===0)throw new S("The dial request has no valid addresses",F.ERR_NO_VALID_ADDRESSES);if(a.length>this.maxPeerAddrsToDial)throw new S("dial with more addresses than allowed",F.ERR_TOO_MANY_ADDRESSES);let c=[];for(let l of a)this.connectionGater.denyDialMultiaddr!=null&&await this.connectionGater.denyDialMultiaddr(l.multiaddr)||c.push(l);let u=c.sort(this.addressSorter);if(u.length===0)throw new S("The connection gater denied all addresses in the dial request",F.ERR_NO_VALID_ADDRESSES);return u}async performDial(e,r={}){let n=e.multiaddrs.map(()=>new AbortController);try{let i=new Nr({concurrency:1});i.on("error",o=>{this.log.error("error dialing %s %o",e.multiaddrs,o)});let s=await Promise.any(e.multiaddrs.map(async(o,a)=>{let c=n[a];if(c==null)throw new S("dialAction did not come with an AbortController",F.ERR_INVALID_PARAMETERS);let u=Rm(c.signal,r.signal);u.addEventListener("abort",()=>{this.log("dial to %a aborted",o)});let l=ut();return await i.add(async()=>{if(u.aborted){this.log("dial to %a was aborted before reaching the head of the peer dial queue",o),l.reject(new Rn);return}await this.queue.add(async()=>{try{if(u.aborted){this.log("dial to %a was aborted before reaching the head of the dial queue",o),l.reject(new Rn);return}e.status="active";let f=await this.transportManager.dial(o,{...r,signal:u});if(c.signal.aborted){this.log("multiple dials succeeded, closing superfluous connection"),f.close().catch(h=>{this.log.error("error closing superfluous connection",h)}),l.reject(new Rn);return}n[a]=void 0,n.forEach(h=>{h!==void 0&&h.abort()}),this.log("dial to %a succeeded",o),l.resolve(f)}catch(f){this.log.error("error during dial of %a",o,f),l.reject(f)}},{...r,signal:u}).catch(f=>{l.reject(f)})},{signal:u}).catch(f=>{l.reject(f)}).finally(()=>{u.clear()}),l.promise}));if(s==null)throw new S("successful dial led to empty object returned from peer dial queue",F.ERR_TRANSPORT_DIAL_FAILED);return e.status="success",s}catch(i){throw e.status="error",e.multiaddrs.length===1&&i.name==="AggregateError"?i.errors[0]:i}}};function jE(){return`${parseInt(String(Math.random()*1e9),10).toString()}${Date.now()}`}var tv=50,xn={minConnections:Vo,maxConnections:$o,inboundConnectionThreshold:5,maxIncomingPendingConnections:10,autoDialConcurrency:25,autoDialPriority:0,autoDialMaxQueueLength:100},Xo=class{started;connections;allow;deny;maxIncomingPendingConnections;incomingPendingConnections;maxConnections;dialQueue;autoDial;connectionPruner;inboundConnectionRateLimiter;peerStore;metrics;events;log;constructor(e,r={}){this.maxConnections=r.maxConnections??xn.maxConnections;let n=r.minConnections??xn.minConnections;if(this.maxConnectionsUe(i)),this.deny=(r.deny??[]).map(i=>Ue(i)),this.incomingPendingConnections=0,this.maxIncomingPendingConnections=r.maxIncomingPendingConnections??xn.maxIncomingPendingConnections,this.inboundConnectionRateLimiter=new Cm.RateLimiterMemory({points:r.inboundConnectionThreshold??xn.inboundConnectionThreshold,duration:1}),this.autoDial=new Ho({connectionManager:this,peerStore:e.peerStore,events:e.events,logger:e.logger},{minConnections:n,autoDialConcurrency:r.autoDialConcurrency??xn.autoDialConcurrency,autoDialPriority:r.autoDialPriority??xn.autoDialPriority,maxQueueLength:r.autoDialMaxQueueLength??xn.autoDialMaxQueueLength}),this.connectionPruner=new Go({connectionManager:this,peerStore:e.peerStore,events:e.events,logger:e.logger},{maxConnections:this.maxConnections,allow:this.allow}),this.dialQueue=new Qo({peerId:e.peerId,metrics:e.metrics,peerStore:e.peerStore,transportManager:e.transportManager,connectionGater:e.connectionGater,logger:e.logger},{addressSorter:r.addressSorter??ti,maxParallelDials:r.maxParallelDials??zo,maxPeerAddrsToDial:r.maxPeerAddrsToDial??25,dialTimeout:r.dialTimeout??3e4,resolvers:r.resolvers??{dnsaddr:ri},connections:this.connections})}isStarted(){return this.started}async start(){this.metrics?.registerMetricGroup("libp2p_connection_manager_connections",{calculate:()=>{let e={inbound:0,outbound:0};for(let r of this.connections.values())for(let n of r)n.direction==="inbound"?e.inbound++:e.outbound++;return e}}),this.metrics?.registerMetricGroup("libp2p_protocol_streams_total",{label:"protocol",calculate:()=>{let e={};for(let r of this.connections.values())for(let n of r)for(let i of n.streams){let s=`${i.direction} ${i.protocol??"unnegotiated"}`;e[s]=(e[s]??0)+1}return e}}),this.metrics?.registerMetricGroup("libp2p_connection_manager_protocol_streams_per_connection_90th_percentile",{label:"protocol",calculate:()=>{let e={};for(let n of this.connections.values())for(let i of n){let s={};for(let o of i.streams){let a=`${o.direction} ${o.protocol??"unnegotiated"}`;s[a]=(s[a]??0)+1}for(let[o,a]of Object.entries(s))e[o]=e[o]??[],e[o].push(a)}let r={};for(let[n,i]of Object.entries(e)){i=i.sort((o,a)=>o-a);let s=Math.floor(i.length*.9);r[n]=i[s]}return r}}),this.autoDial.start(),this.started=!0,this.log("started")}async afterStart(){Promise.resolve().then(async()=>{let e=await this.peerStore.all({filters:[r=>r.tags.has(Bp)]});await Promise.all(e.map(async r=>{await this.openConnection(r.id).catch(n=>{this.log.error(n)})}))}).catch(e=>{this.log.error(e)}),this.autoDial.afterStart()}async stop(){this.dialQueue.stop(),this.autoDial.stop();let e=[];for(let r of this.connections.values())for(let n of r)e.push((async()=>{try{await n.close()}catch(i){this.log.error(i)}})());this.log("closing %d connections",e.length),await Promise.all(e),this.connections.clear(),this.log("stopped")}onConnect(e){this._onConnect(e).catch(r=>{this.log.error(r)})}async _onConnect(e){let{detail:r}=e;if(!this.started){await r.close();return}let n=r.remotePeer,i=this.connections.get(n),s=!1;i!=null?i.push(r):(s=!0,this.connections.set(n,[r])),n.publicKey!=null&&n.type==="RSA"&&await this.peerStore.patch(n,{publicKey:n.publicKey}),s&&this.events.safeDispatchEvent("peer:connect",{detail:r.remotePeer})}onDisconnect(e){let{detail:r}=e;if(!this.started)return;let n=r.remotePeer,i=this.connections.get(n);i!=null&&i.length>1?(i=i.filter(s=>s.id!==r.id),this.connections.set(n,i)):i!=null&&(this.connections.delete(n),this.events.safeDispatchEvent("peer:disconnect",{detail:r.remotePeer}))}getConnections(e){if(e!=null)return this.connections.get(e)??[];let r=[];for(let n of this.connections.values())r=r.concat(n);return r}getConnectionsMap(){return this.connections}async openConnection(e,r={}){if(!this.isStarted())throw new S("Not started",F.ERR_NODE_NOT_STARTED);r.signal?.throwIfAborted();let{peerId:n}=Fo(e);if(n!=null&&r.force!==!0){this.log("dial %p",n);let a=this.getConnections(n).find(c=>!c.transient);if(a!=null)return this.log("had an existing non-transient connection to %p",n),a}let i=await this.dialQueue.dial(e,{...r,priority:r.priority??tv}),s=this.connections.get(i.remotePeer);s==null&&(s=[],this.connections.set(i.remotePeer,s));let o=!1;for(let a of s)a.id===i.id&&(o=!0);return o||s.push(i),i}async closeConnections(e,r={}){let n=this.connections.get(e)??[];await Promise.all(n.map(async i=>{try{await i.close(r)}catch(s){i.abort(s)}}))}async acceptIncomingConnection(e){if(this.deny.some(i=>e.remoteAddr.toString().startsWith(i.toString())))return this.log("connection from %a refused - connection remote address was in deny list",e.remoteAddr),!1;if(this.allow.some(i=>e.remoteAddr.toString().startsWith(i.toString())))return this.incomingPendingConnections++,!0;if(this.incomingPendingConnections===this.maxIncomingPendingConnections)return this.log("connection from %a refused - incomingPendingConnections exceeded by host",e.remoteAddr),!1;if(e.remoteAddr.isThinWaistAddress()){let i=e.remoteAddr.nodeAddress().address;try{await this.inboundConnectionRateLimiter.consume(i,1)}catch{return this.log("connection from %a refused - inboundConnectionThreshold exceeded by host %s",e.remoteAddr,i),!1}}return this.getConnections().length0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},ui=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new Zo(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let r=this.head;this.head=r.next=new Zo(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var Pl=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function jo(t={}){return rv(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},t)}function rv(t,e){e=e??{};let r=e.onEnd,n=new ui,i,s,o,a=ut(),c=async()=>{try{return n.isEmpty()?o?{done:!0}:await new Promise((g,y)=>{s=x=>{s=null,n.push(x);try{g(t(n))}catch(b){y(b)}return i}}):t(n)}finally{n.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=ut()})}},u=g=>s!=null?s(g):(n.push(g),i),l=g=>(n=new ui,s!=null?s({error:g}):(n.push({error:g}),i)),f=g=>{if(o)return i;if(e?.objectMode!==!0&&g?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return u({done:!1,value:g})},h=g=>o?i:(o=!0,g!=null?l(g):u({done:!0})),p=()=>(n=new ui,h(),{done:!0}),d=g=>(h(g),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:c,return:p,throw:d,push:f,end:h,get readableLength(){return n.size},onEmpty:async g=>{let y=g?.signal;if(y?.throwIfAborted(),n.isEmpty())return;let x,b;y!=null&&(x=new Promise((I,v)=>{b=()=>{v(new Pl)},y.addEventListener("abort",b)}));try{await Promise.race([a.promise,x])}finally{b!=null&&y!=null&&y?.removeEventListener("abort",b)}}},r==null)return i;let m=i;return i={[Symbol.asyncIterator](){return this},next(){return m.next()},throw(g){return m.throw(g),r!=null&&(r(g),r=void 0),{done:!0}},return(){return m.return(),r!=null&&(r(),r=void 0),{done:!0}},push:f,end(g){return m.end(g),r!=null&&(r(g),r=void 0),i},get readableLength(){return m.readableLength},onEmpty:g=>m.onEmpty(g)},i}function nv(t){return t[Symbol.asyncIterator]!=null}function iv(...t){let e=[];for(let r of t)nv(r)||e.push(r);return e.length===t.length?function*(){for(let r of e)yield*r}():async function*(){let r=jo({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(t.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var bn=iv;function Ji(t,...e){if(t==null)throw new Error("Empty pipeline");if(Dl(t)){let n=t;t=()=>n.source}else if(Bm(t)||Tm(t)){let n=t;t=()=>n}let r=[t,...e];if(r.length>1&&Dl(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n{let e;for(;t.length>0;)e=t.shift()(e);return e},Tm=t=>t?.[Symbol.asyncIterator]!=null,Bm=t=>t?.[Symbol.iterator]!=null,Dl=t=>t==null?!1:t.sink!=null&&t.source!=null,ov=t=>e=>{let r=t.sink(e);if(r?.then!=null){let n=jo({objectMode:!0});r.then(()=>{n.end()},o=>{n.end(o)});let i,s=t.source;if(Tm(s))i=async function*(){yield*s,n.end()};else if(Bm(s))i=function*(){yield*s,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return bn(n,i())}return t.source};function av(t){return t[Symbol.asyncIterator]!=null}function cv(t,e){if(av(t))return async function*(){for await(let a of t)yield e(a)}();let r=vo(t),{value:n,done:i}=r.next();if(i===!0)return function*(){}();let s=e(n);if(typeof s.then=="function")return async function*(){yield await s;for await(let a of r)yield e(a)}();let o=e;return function*(){yield s;for(let a of r)yield o(a)}()}var Lm=cv;async function*es(t,e){yield*Lm(t,async r=>(await e.merge(r.id,{multiaddrs:r.multiaddrs}),r))}function Jo(t){let e=new Set;return Ut(t,r=>e.has(r.id.toString())?!1:(e.add(r.id.toString()),!0))}async function*ea(t,e=1){let r=0;for await(let n of t)r++,yield n;if(rn.findProviders(e,r))),n=>es(n,this.components.peerStore),n=>Jo(n),n=>ea(n))}async provide(e,r={}){if(this.routers.length===0)throw new S("No content routers available",F.ERR_NO_ROUTERS_AVAILABLE);await Promise.all(this.routers.map(async n=>{await n.provide(e,r)}))}async put(e,r,n){if(!this.isStarted())throw new S(jt.NOT_STARTED_YET,F.DHT_NOT_STARTED);await Promise.all(this.routers.map(async i=>{await i.put(e,r,n)}))}async get(e,r){if(!this.isStarted())throw new S(jt.NOT_STARTED_YET,F.DHT_NOT_STARTED);return Promise.any(this.routers.map(async n=>n.get(e,r)))}};function uv(t){return t[Symbol.asyncIterator]!=null}function lv(t){if(uv(t))return(async()=>{for await(let e of t)return e})();for(let e of t)return e}var Pm=lv;var ra=class{log;peerId;peerStore;routers;constructor(e,r){this.log=e.logger.forComponent("libp2p:peer-routing"),this.peerId=e.peerId,this.peerStore=e.peerStore,this.routers=r.routers??[]}async findPeer(e,r){if(this.routers.length===0)throw new S("No peer routers available",F.ERR_NO_ROUTERS_AVAILABLE);if(e.toString()===this.peerId.toString())throw new S("Should not try to find self",F.ERR_FIND_SELF);let n=this,i=await Ji(bn(...this.routers.map(s=>async function*(){try{yield await s.findPeer(e,r)}catch(o){n.log.error(o)}}())),s=>Ut(s,Boolean),s=>es(s,this.peerStore),async s=>Pm(s));if(i!=null)return i;throw new S(jt.NOT_FOUND,F.ERR_NOT_FOUND)}async*getClosestPeers(e,r){if(this.routers.length===0)throw new S("No peer routers available",F.ERR_NO_ROUTERS_AVAILABLE);yield*Ji(bn(...this.routers.map(n=>n.getClosestPeers(e,r))),n=>es(n,this.peerStore),n=>Jo(n),n=>ea(n))}};var Nl=32,kl=64,na=class{log;topologies;handlers;components;constructor(e){this.log=e.logger.forComponent("libp2p:registrar"),this.topologies=new Map,this.handlers=new Map,this.components=e,this._onDisconnect=this._onDisconnect.bind(this),this._onPeerUpdate=this._onPeerUpdate.bind(this),this._onPeerIdentify=this._onPeerIdentify.bind(this),this.components.events.addEventListener("peer:disconnect",this._onDisconnect),this.components.events.addEventListener("peer:update",this._onPeerUpdate),this.components.events.addEventListener("peer:identify",this._onPeerIdentify)}getProtocols(){return Array.from(new Set([...this.handlers.keys()])).sort()}getHandler(e){let r=this.handlers.get(e);if(r==null)throw new S(`No handler registered for protocol ${e}`,F.ERR_NO_HANDLER_FOR_PROTOCOL);return r}getTopologies(e){let r=this.topologies.get(e);return r==null?[]:[...r.values()]}async handle(e,r,n){if(this.handlers.has(e))throw new S(`Handler already registered for protocol ${e}`,F.ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED);let i=Mo.bind({ignoreUndefined:!0})({maxInboundStreams:Nl,maxOutboundStreams:kl},n);this.handlers.set(e,{handler:r,options:i}),await this.components.peerStore.merge(this.components.peerId,{protocols:[e]})}async unhandle(e){(Array.isArray(e)?e:[e]).forEach(n=>{this.handlers.delete(n)}),await this.components.peerStore.patch(this.components.peerId,{protocols:this.getProtocols()})}async register(e,r){if(r==null)throw new S("invalid topology",F.ERR_INVALID_PARAMETERS);let n=`${(Math.random()*1e9).toString(36)}${Date.now()}`,i=this.topologies.get(e);return i==null&&(i=new Map,this.topologies.set(e,i)),i.set(n,r),n}unregister(e){for(let[r,n]of this.topologies.entries())n.has(e)&&(n.delete(e),n.size===0&&this.topologies.delete(r))}_onDisconnect(e){let r=e.detail;this.components.peerStore.get(r).then(n=>{for(let i of n.protocols){let s=this.topologies.get(i);if(s!=null)for(let o of s.values())o.onDisconnect?.(r)}}).catch(n=>{n.code!==F.ERR_NOT_FOUND&&this.log.error("could not inform topologies of disconnecting peer %p",r,n)})}_onPeerUpdate(e){let{peer:r,previous:n}=e.detail,i=(n?.protocols??[]).filter(s=>!r.protocols.includes(s));for(let s of i){let o=this.topologies.get(s);if(o!=null)for(let a of o.values())a.onDisconnect?.(r.id)}}_onPeerIdentify(e){let r=e.detail.protocols,n=e.detail.connection,i=e.detail.peerId;for(let s of r){let o=this.topologies.get(s);if(o!=null)for(let a of o.values())n.transient&&a.notifyOnTransient!==!0||a.onConnect?.(i,n)}}};var Ol=class extends Map{metric;constructor(e){super();let{name:r,metrics:n}=e;this.metric=n.registerMetric(r),this.updateComponentMetric()}set(e,r){return super.set(e,r),this.updateComponentMetric(),this}delete(e){let r=super.delete(e);return this.updateComponentMetric(),r}clear(){super.clear(),this.updateComponentMetric()}updateComponentMetric(){this.metric.update(this.size)}};function Dm(t){let{name:e,metrics:r}=t,n;return r!=null?n=new Ol({name:e,metrics:r}):n=new Map,n}var ia=class{log;components;transports;listeners;faultTolerance;started;constructor(e,r={}){this.log=e.logger.forComponent("libp2p:transports"),this.components=e,this.started=!1,this.transports=new Map,this.listeners=Dm({name:"libp2p_transport_manager_listeners",metrics:this.components.metrics}),this.faultTolerance=r.faultTolerance??Ur.FATAL_ALL}add(e){let r=e[Symbol.toStringTag];if(r==null)throw new S("Transport must have a valid tag",F.ERR_INVALID_KEY);if(this.transports.has(r))throw new S(`There is already a transport with the tag ${r}`,F.ERR_DUPLICATE_TRANSPORT);this.log("adding transport %s",r),this.transports.set(r,e),this.listeners.has(r)||this.listeners.set(r,[])}isStarted(){return this.started}start(){this.started=!0}async afterStart(){let e=this.components.addressManager.getListenAddrs();await this.listen(e)}async stop(){let e=[];for(let[r,n]of this.listeners)for(this.log("closing listeners for %s",r);n.length>0;){let i=n.pop();i!=null&&e.push(i.close())}await Promise.all(e),this.log("all listeners closed");for(let r of this.listeners.keys())this.listeners.set(r,[]);this.started=!1}async dial(e,r){let n=this.transportForMultiaddr(e);if(n==null)throw new S(`No transport available for address ${String(e)}`,F.ERR_TRANSPORT_UNAVAILABLE);try{return await n.dial(e,{...r,upgrader:this.components.upgrader})}catch(i){throw i.code==null&&(i.code=F.ERR_TRANSPORT_DIAL_FAILED),i}}getAddrs(){let e=[];for(let r of this.listeners.values())for(let n of r)e=[...e,...n.getAddrs()];return e}getTransports(){return Array.of(...this.transports.values())}getListeners(){return Array.of(...this.listeners.values()).flat()}transportForMultiaddr(e){for(let r of this.transports.values())if(r.filter([e]).length>0)return r}async listen(e){if(!this.isStarted())throw new S("Not started",F.ERR_NODE_NOT_STARTED);if(e==null||e.length===0){this.log("no addresses were provided for listening, this node is dial only");return}let r=[];for(let[n,i]of this.transports.entries()){let s=i.filter(e),o=[];for(let u of s){this.log("creating listener for %s on %a",n,u);let l=i.createListener({upgrader:this.components.upgrader}),f=this.listeners.get(n)??[];f==null&&(f=[],this.listeners.set(n,f)),f.push(l),l.addEventListener("listening",()=>{this.components.events.safeDispatchEvent("transport:listening",{detail:l})}),l.addEventListener("close",()=>{let h=f.findIndex(p=>p===l);f.splice(h,1),this.components.events.safeDispatchEvent("transport:close",{detail:l})}),o.push(l.listen(u))}if(o.length===0){r.push(n);continue}if((await Promise.allSettled(o)).find(u=>u.status==="fulfilled")==null&&this.faultTolerance!==Ur.NO_FATAL)throw new S(`Transport (${n}) could not listen on any available address`,F.ERR_NO_VALID_ADDRESSES)}if(r.length===this.transports.size){let n=`no valid addresses were provided for transports [${r.join(", ")}]`;if(this.faultTolerance===Ur.FATAL_ALL)throw new S(n,F.ERR_NO_VALID_ADDRESSES);this.log(`libp2p in dial mode only: ${n}`)}}async remove(e){let r=this.listeners.get(e)??[];this.log.trace("removing transport %s",e);let n=[];for(this.log.trace("closing listeners for %s",e);r.length>0;){let i=r.pop();i!=null&&n.push(i.close())}await Promise.all(n),this.transports.delete(e),this.listeners.delete(e)}async removeAll(){let e=[];for(let r of this.transports.keys())e.push(this.remove(r));await Promise.all(e)}};var Je="/multistream/1.0.0";var sa=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=r??"ABORT_ERR"}};async function Nm(t,e,r){if(e==null)return t;if(e.aborted)return Promise.reject(new sa(r?.errorMessage,r?.errorCode));let n,i=new sa(r?.errorMessage,r?.errorCode);try{return await Promise.race([t,new Promise((s,o)=>{n=()=>{o(i)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var Ml=class{needNext;haveNext;ended;nextResult;constructor(){this.ended=!1,this.needNext=ut(),this.needNext.resolve(),this.haveNext=ut()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("Have next but next was undefined");let e=this.nextResult;return this.nextResult=void 0,this.needNext.resolve(),this.needNext=ut(),e}async throw(e){return this.ended=!0,e!=null&&this.haveNext.reject(e),{done:!0,value:void 0}}async return(){let e={done:!0,value:void 0};return await this._push(void 0),e}async push(e,r){await this._push(e,r)}async end(e,r){e!=null?await this.throw(e):await this._push(void 0,r)}async _push(e,r){if(e!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");this.nextResult!=null&&await this.needNext.promise,e!=null?this.nextResult={done:!1,value:e}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=ut(),await Nm(this.needNext.promise,r?.signal,r)}};function km(){return new Ml}var oa=class extends Error{code;constructor(e,r){super(e),this.code=r}},Ul=class extends oa{type;constructor(e){super(e,"ABORT_ERR"),this.type="aborted"}};function Om(t,e){let r=km();t.sink(r).catch(async o=>{await r.end(o)}),t.sink=async o=>{for await(let a of o)await r.push(a);await r.end()};let n=t.source;t.source[Symbol.iterator]!=null?n=t.source[Symbol.iterator]():t.source[Symbol.asyncIterator]!=null&&(n=t.source[Symbol.asyncIterator]());let i=new ze;return{read:async(o,a)=>{a?.signal?.throwIfAborted();let c,u=new Promise((l,f)=>{c=()=>{f(new Ul("Read aborted"))},a?.signal?.addEventListener("abort",c)});try{if(o==null){let{done:f,value:h}=await Promise.race([n.next(),u]);return f===!0?new ze:h}for(;i.byteLength{a?.signal?.throwIfAborted(),o instanceof Uint8Array?await r.push(o,a):await r.push(o.subarray(),a)},unwrap:()=>{if(i.byteLength>0){let o=t.source;t.source=async function*(){e?.yieldBytes===!1?yield i:yield*i,yield*o}()}return t},unreadBytes:()=>i.byteLength}}function aa(t){return t[Symbol.asyncIterator]!=null}var ca=t=>{let e=it(t),r=tt(e);return dt(t,r),ca.bytes=e,r};ca.bytes=0;function wn(t,e){e=e??{};let r=e.lengthEncoder??ca;function*n(i){let s=r(i.byteLength);s instanceof Uint8Array?yield s:yield*s,i instanceof Uint8Array?yield i:yield*i}return aa(t)?async function*(){for await(let i of t)yield*n(i)}():function*(){for(let i of t)yield*n(i)}()}wn.single=(t,e)=>{e=e??{};let r=e.lengthEncoder??ca;return new ze(r(t.byteLength),t)};var li=ve(Yu(),1);var fv=8,hv=1024*1024*4,En;(function(t){t[t.LENGTH=0]="LENGTH",t[t.DATA=1]="DATA"})(En||(En={}));var Kl=t=>{let e=Ot(t);return Kl.bytes=it(e),e};Kl.bytes=0;function Fl(t,e){let r=new ze,n=En.LENGTH,i=-1,s=e?.lengthDecoder??Kl,o=e?.maxLengthLength??fv,a=e?.maxDataLength??hv;function*c(){for(;r.byteLength>0;){if(n===En.LENGTH)try{if(i=s(r),i<0)throw(0,li.default)(new Error("invalid message length"),"ERR_INVALID_MSG_LENGTH");if(i>a)throw(0,li.default)(new Error("message length too long"),"ERR_MSG_DATA_TOO_LONG");let u=s.bytes;r.consume(u),e?.onLength!=null&&e.onLength(i),n=En.DATA}catch(u){if(u instanceof RangeError){if(r.byteLength>o)throw(0,li.default)(new Error("message length length too long"),"ERR_MSG_LENGTH_TOO_LONG");break}throw u}if(n===En.DATA){if(r.byteLength0)throw(0,li.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}():function*(){for(let u of t)r.append(u),yield*c();if(r.byteLength>0)throw(0,li.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}()}Fl.fromReader=(t,e)=>{let r=1,n=async function*(){for(;;)try{let{done:s,value:o}=await t.next(r);if(s===!0)return;o!=null&&(yield o)}catch(s){if(s.code==="ERR_UNDER_READ")return{done:!0,value:null};throw s}finally{r=1}}();return Fl(n,{...e??{},onLength:s=>{r=s}})};var ua=class extends Error{code;constructor(e,r){super(e),this.code=r}},Mm=t=>Ot(t);Mm.bytes=0;function ts(t,e={}){let r=Om(t,e);return e.maxDataLength!=null&&e.maxLengthLength==null&&(e.maxLengthLength=it(e.maxDataLength)),{read:async i=>{let s=-1,o=new ze,a=e?.lengthDecoder??Mm;for(;;){o.append(await r.read(1,i));try{s=a(o)}catch(c){if(c instanceof RangeError)continue;throw c}if(e?.maxLengthLength!=null&&o.byteLength>e.maxLengthLength)throw new ua("message length length too long","ERR_MSG_LENGTH_TOO_LONG");if(s>-1)break}if(e?.maxDataLength!=null&&s>e.maxDataLength)throw new ua("message length too long","ERR_MSG_DATA_TOO_LONG");return r.read(s,i)},write:async(i,s)=>{await r.write(wn.single(i,e),s)},writeV:async(i,s)=>{let o=new ze(...i.map(a=>wn.single(a,e)));await r.write(o,s)},unwrap:()=>r.unwrap(),unreadBytes:()=>r.unreadBytes()}}var pv=Q(` -`);async function vn(t,e,r){await t.write(e,r)}async function Um(t,e,r){await t.writeV(e,r)}async function mv(t,e){let r=await t.read(e);if(r.byteLength===0||r.get(r.byteLength-1)!==pv[0])throw e?.log.error("Invalid mss message - missing newline",r),new S("missing newline","ERR_INVALID_MULTISTREAM_SELECT_MESSAGE");return r.sublist(0,-1)}async function Kr(t,e){let r=await mv(t,e);return se(r.subarray())}async function rs(t,e,r){if(e=Array.isArray(e)?[...e]:[e],e.length===1)return gv(t,e[0],r);let n=ts(t,{...r,maxDataLength:1024}),i=e.shift();if(i==null)throw new Error("At least one protocol must be specified");r?.log.trace('select: write ["%s", "%s"]',Je,i);let s=Q(`${Je} -`),o=Q(`${i} -`);await Um(n,[s,o],r),r?.log.trace("select: reading multistream-select header");let a=await Kr(n,r);if(r?.log.trace('select: read "%s"',a),a===Je&&(r?.log.trace("select: reading protocol response"),a=await Kr(n,r),r?.log.trace('select: read "%s"',a)),a===i)return{stream:n.unwrap(),protocol:i};for(let c of e){r?.log.trace('select: write "%s"',c),await vn(n,Q(`${c} -`),r),r?.log.trace("select: reading protocol response");let u=await Kr(n,r);if(r?.log.trace('select: read "%s" for "%s"',u,c),u===c)return{stream:n.unwrap(),protocol:c}}throw new S("protocol selection failed","ERR_UNSUPPORTED_PROTOCOL")}function gv(t,e,r){let n=t.sink.bind(t),i=t.source,s=!1,o=!1,a=ut(),c=!1,u=!1,l=ut(),f=!1,h=!1,p=ut(),d=ts({sink:n,source:i},{...r,maxDataLength:1024});t.sink=async x=>{let{sink:b}=d.unwrap();await b(async function*(){let I=!1;for await(let v of x){if(u&&await l.promise,c)yield v;else{u=!0,r?.log.trace('optimistic: write ["%s", "%s", data(%d)] in sink',Je,e,v.byteLength);let _=`${e} -`;yield new ze(Uint8Array.from([19]),Q(`${Je} -`),dt(_.length),Q(_),v).subarray(),r?.log.trace('optimistic: wrote ["%s", "%s", data(%d)] in sink',Je,e,v.byteLength),c=!0,u=!1,l.resolve()}I=!0}I||await m()}())};async function m(){if(o){r?.log.trace("optimistic: already negotiating %s stream",e),await a.promise;return}o=!0;try{c||(r?.log.trace("optimistic: doing send protocol for %s stream",e),await g()),f||(r?.log.trace("optimistic: doing read protocol for %s stream",e),await y())}finally{o=!1,s=!0,a.resolve()}}async function g(){if(u){await l.promise;return}u=!0;try{r?.log.trace('optimistic: write ["%s", "%s", data] in source',Je,e),await d.writeV([Q(`${Je} -`),Q(`${e} -`)]),r?.log.trace('optimistic: wrote ["%s", "%s", data] in source',Je,e)}finally{c=!0,u=!1,l.resolve()}}async function y(){if(h){await p.promise;return}h=!0;try{r?.log.trace("optimistic: reading multistream select header");let x=await Kr(d,r);if(r?.log.trace('optimistic: read multistream select header "%s"',x),x===Je&&(x=await Kr(d,r)),r?.log.trace('optimistic: read protocol "%s", expecting "%s"',x,e),x!==e)throw new S("protocol selection failed","ERR_UNSUPPORTED_PROTOCOL")}finally{f=!0,h=!1,p.resolve()}}if(t.source=async function*(){await m(),r?.log.trace('optimistic: reading data from "%s" stream',e),yield*d.unwrap().source}(),t.closeRead!=null){let x=t.closeRead.bind(t);t.closeRead=async b=>{s||await m().catch(I=>{r?.log.error("could not negotiate protocol before close read",I)}),await x(b)}}if(t.closeWrite!=null){let x=t.closeWrite.bind(t);t.closeWrite=async b=>{s||await m().catch(I=>{r?.log.error("could not negotiate protocol before close write",I)}),await x(b)}}if(t.close!=null){let x=t.close.bind(t);t.close=async b=>{s||(s=!0,o=!1,a.resolve()),await x(b)}}return{stream:t,protocol:e}}async function ns(t,e,r){e=Array.isArray(e)?e:[e],r.log.trace("handle: available protocols %s",e);let n=ts(t,{...r,maxDataLength:1024,maxLengthLength:2});for(;;){r?.log.trace("handle: reading incoming string");let i=await Kr(n,r);if(r.log.trace('handle: read "%s"',i),i===Je){r.log.trace('handle: respond with "%s" for "%s"',Je,i),await vn(n,Q(`${Je} -`),r),r.log.trace('handle: responded with "%s" for "%s"',Je,i);continue}if(e.includes(i))return r.log.trace('handle: respond with "%s" for "%s"',i,i),await vn(n,Q(`${i} -`),r),r.log.trace('handle: responded with "%s" for "%s"',i,i),{stream:n.unwrap(),protocol:i};if(i==="ls"){let s=new ze(...e.map(o=>wn.single(Q(`${o} -`))),Q(` -`));r.log.trace('handle: respond with "%s" for %s',e,i),await vn(n,s,r),r.log.trace('handle: responded with "%s" for %s',e,i);continue}r.log('handle: respond with "na" for "%s"',i),await vn(n,Q(`na -`),r),r.log('handle: responded with "na" for "%s"',i)}}var Km=Symbol.for("@libp2p/connection");var xv=500,ql=class{id;remoteAddr;remotePeer;direction;timeline;multiplexer;encryption;status;transient;log;tags;_newStream;_close;_abort;_getStreams;constructor(e){let{remoteAddr:r,remotePeer:n,newStream:i,close:s,abort:o,getStreams:a}=e;this.id=`${parseInt(String(Math.random()*1e9)).toString(36)}${Date.now()}`,this.remoteAddr=r,this.remotePeer=n,this.direction=e.direction,this.status="open",this.timeline=e.timeline,this.multiplexer=e.multiplexer,this.encryption=e.encryption,this.transient=e.transient??!1,this.log=e.logger.forComponent(`libp2p:connection:${this.direction}:${this.id}`),this.remoteAddr.getPeerId()==null&&(this.remoteAddr=this.remoteAddr.encapsulate(`/p2p/${this.remotePeer}`)),this._newStream=i,this._close=s,this._abort=o,this._getStreams=a,this.tags=[]}[Symbol.toStringTag]="Connection";[Km]=!0;get streams(){return this._getStreams()}async newStream(e,r){if(this.status==="closing")throw new S("the connection is being closed","ERR_CONNECTION_BEING_CLOSED");if(this.status==="closed")throw new S("the connection is closed","ERR_CONNECTION_CLOSED");if(Array.isArray(e)||(e=[e]),this.transient&&r?.runOnTransientConnection!==!0)throw new S("Cannot open protocol stream on transient connection","ERR_TRANSIENT_CONNECTION");let n=await this._newStream(e,r);return n.direction="outbound",n}async close(e={}){if(!(this.status==="closed"||this.status==="closing")){if(this.log("closing connection to %a",this.remoteAddr),this.status="closing",e.signal==null){let r=AbortSignal.timeout(xv);yt(1/0,r),e={...e,signal:r}}try{this.log.trace("closing all streams"),await Promise.all(this.streams.map(async r=>r.close(e))),this.log.trace("closing underlying transport"),await this._close(e),this.log.trace("updating timeline with close time"),this.status="closed",this.timeline.close=Date.now()}catch(r){this.log.error("error encountered during graceful close of connection to %a",this.remoteAddr,r),this.abort(r)}}}abort(e){this.log.error("aborting connection to %a due to error",this.remoteAddr,e),this.status="closing",this.streams.forEach(r=>{r.abort(e)}),this.log.error("all streams aborted",this.streams.length),this._abort(e),this.timeline.close=Date.now(),this.status="closed"}};function qm(t){return new ql(t)}var wv=3e4;function Ev(t,e){try{let{options:r}=e.getHandler(t);return r.maxInboundStreams}catch(r){if(r.code!==F.ERR_NO_HANDLER_FOR_PROTOCOL)throw r}return Nl}function vv(t,e,r={}){try{let{options:n}=e.getHandler(t);if(n.maxOutboundStreams!=null)return n.maxOutboundStreams}catch(n){if(n.code!==F.ERR_NO_HANDLER_FOR_PROTOCOL)throw n}return r.maxOutboundStreams??kl}function Vm(t,e,r){let n=0;return r.streams.forEach(i=>{i.direction===e&&i.protocol===t&&n++}),n}var fa=class{components;connectionEncryption;muxers;inboundUpgradeTimeout;events;log;constructor(e,r){this.components=e,this.connectionEncryption=new Map,this.log=e.logger.forComponent("libp2p:upgrader"),r.connectionEncryption.forEach(n=>{this.connectionEncryption.set(n.protocol,n)}),this.muxers=new Map,r.muxers.forEach(n=>{this.muxers.set(n.protocol,n)}),this.inboundUpgradeTimeout=r.inboundUpgradeTimeout??3e4,this.events=e.events}async shouldBlockConnection(e,r,n){let i=this.components.connectionGater[n];if(i!==void 0&&await i(e,r))throw new S(`The multiaddr connection is blocked by gater.${n}`,F.ERR_CONNECTION_INTERCEPTED)}async upgradeInbound(e,r){if(!await this.components.connectionManager.acceptIncomingConnection(e))throw new S("connection denied",F.ERR_CONNECTION_DENIED);let i,s,o,a,c,u=AbortSignal.timeout(this.inboundUpgradeTimeout),l=()=>{e.abort(new S("inbound upgrade timeout",vs))};u.addEventListener("abort",l,{once:!0}),yt(1/0,u);try{if(await this.components.connectionGater.denyInboundConnection?.(e)===!0)throw new S("The multiaddr connection is blocked by gater.acceptConnection",F.ERR_CONNECTION_INTERCEPTED);this.components.metrics?.trackMultiaddrConnection(e),this.log("starting the inbound connection upgrade");let f=e;if(r?.skipProtection!==!0){let h=this.components.connectionProtector;h!=null&&(this.log("protecting the inbound connection"),f=await h.protect(e))}try{if(i=f,r?.skipEncryption!==!0){({conn:i,remotePeer:s,protocol:c}=await this._encryptInbound(f));let h={...f,...i};await this.shouldBlockConnection(s,h,"denyInboundEncryptedConnection")}else{let h=e.remoteAddr.getPeerId();if(h==null)throw new S("inbound connection that skipped encryption must have a peer id",F.ERR_INVALID_MULTIADDR);let p=ce(h);c="native",s=p}if(o=i,r?.muxerFactory!=null)a=r.muxerFactory;else if(this.muxers.size>0){let h=await this._multiplexInbound({...f,...i},this.muxers);a=h.muxerFactory,o=h.stream}}catch(h){throw this.log.error("Failed to upgrade inbound connection",h),h}return await this.shouldBlockConnection(s,e,"denyInboundUpgradedConnection"),this.log("successfully upgraded inbound connection"),this._createConnection({cryptoProtocol:c,direction:"inbound",maConn:e,upgradedConn:o,muxerFactory:a,remotePeer:s,transient:r?.transient})}finally{u.removeEventListener("abort",l),this.components.connectionManager.afterUpgradeInbound()}}async upgradeOutbound(e,r){let n=e.remoteAddr.getPeerId(),i;n!=null&&(i=ce(n),await this.shouldBlockConnection(i,e,"denyOutboundConnection"));let s,o,a,c,u;this.components.metrics?.trackMultiaddrConnection(e),this.log("Starting the outbound connection upgrade");let l=e;if(r?.skipProtection!==!0){let f=this.components.connectionProtector;f!=null&&(l=await f.protect(e))}try{if(s=l,r?.skipEncryption!==!0){({conn:s,remotePeer:o,protocol:c}=await this._encryptOutbound(l,i));let f={...l,...s};await this.shouldBlockConnection(o,f,"denyOutboundEncryptedConnection")}else{if(i==null)throw new S("Encryption was skipped but no peer id was passed",F.ERR_INVALID_PEER);c="native",o=i}if(a=s,r?.muxerFactory!=null)u=r.muxerFactory;else if(this.muxers.size>0){let f=await this._multiplexOutbound({...l,...s},this.muxers);u=f.muxerFactory,a=f.stream}}catch(f){throw this.log.error("Failed to upgrade outbound connection",f),await e.close(f),f}return await this.shouldBlockConnection(o,e,"denyOutboundUpgradedConnection"),this.log("Successfully upgraded outbound connection"),this._createConnection({cryptoProtocol:c,direction:"outbound",maConn:e,upgradedConn:a,muxerFactory:u,remotePeer:o,transient:r?.transient})}_createConnection(e){let{cryptoProtocol:r,direction:n,maConn:i,upgradedConn:s,remotePeer:o,muxerFactory:a,transient:c}=e,u,l,f;a!=null&&(u=a.createStreamMuxer({direction:n,onIncomingStream:d=>{f!=null&&Promise.resolve().then(async()=>{let m=this.components.registrar.getProtocols(),{stream:g,protocol:y}=await ns(d,m,{log:d.log,yieldBytes:!1});if(f==null)return;f.log("incoming stream opened on %s",y);let x=Ev(y,this.components.registrar);if(Vm(y,"inbound",f)===x){let I=new S(`Too many inbound protocol streams for protocol "${y}" - limit ${x}`,F.ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS);throw d.abort(I),I}d.source=g.source,d.sink=g.sink,d.protocol=y,g.closeWrite!=null&&(d.closeWrite=g.closeWrite),g.closeRead!=null&&(d.closeRead=g.closeRead),g.close!=null&&(d.close=g.close),await this.components.peerStore.merge(o,{protocols:[y]}),this.components.metrics?.trackProtocolStream(d,f),this._onStream({connection:f,stream:d,protocol:y})}).catch(async m=>{this.log.error("error handling incoming stream id %s",d.id,m.message,m.code,m.stack),d.timeline.close==null&&await d.close()})}}),l=async(d,m={})=>{if(u==null)throw new S("Stream is not multiplexed",F.ERR_MUXER_UNAVAILABLE);f.log("starting new stream for protocols %s",d);let g=await u.newStream();f.log.trace("started new stream %s for protocols %s",g.id,d);try{if(m.signal==null){this.log("No abort signal was passed while trying to negotiate protocols %s falling back to default timeout",d);let v=AbortSignal.timeout(wv);yt(1/0,v),m={...m,signal:v}}g.log.trace("selecting protocol from protocols %s",d);let{stream:y,protocol:x}=await rs(g,d,{...m,log:g.log,yieldBytes:!0});g.log("selected protocol %s",x);let b=vv(x,this.components.registrar,m);if(Vm(x,"outbound",f)>=b){let v=new S(`Too many outbound protocol streams for protocol "${x}" - limit ${b}`,F.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS);throw g.abort(v),v}return await this.components.peerStore.merge(o,{protocols:[x]}),g.source=y.source,g.sink=y.sink,g.protocol=x,y.closeWrite!=null&&(g.closeWrite=y.closeWrite),y.closeRead!=null&&(g.closeRead=y.closeRead),y.close!=null&&(g.close=y.close),this.components.metrics?.trackProtocolStream(g,f),g}catch(y){throw f.log.error("could not create new stream for protocols %s",d,y),g.timeline.close==null&&g.abort(y),y.code!=null?y:new S(String(y),F.ERR_UNSUPPORTED_PROTOCOL)}},Promise.all([u.sink(s.source),s.sink(u.source)]).catch(d=>{this.log.error(d)}));let h=i.timeline;i.timeline=new Proxy(h,{set:(...d)=>(f!=null&&d[1]==="close"&&d[2]!=null&&h.close==null&&(async()=>{try{f.status==="open"&&await f.close()}catch(m){this.log.error(m)}finally{this.events.safeDispatchEvent("connection:close",{detail:f})}})().catch(m=>{this.log.error(m)}),Reflect.set(...d))}),i.timeline.upgraded=Date.now();let p=()=>{throw new S("connection is not multiplexed",F.ERR_CONNECTION_NOT_MULTIPLEXED)};return f=qm({remoteAddr:i.remoteAddr,remotePeer:o,status:"open",direction:n,timeline:i.timeline,multiplexer:u?.protocol,encryption:r,transient:c,logger:this.components.logger,newStream:l??p,getStreams:()=>u!=null?u.streams:[],close:async d=>{u!=null&&(this.log.trace("close muxer"),await u.close(d)),this.log.trace("close maconn"),await i.close(d),this.log.trace("closed maconn")},abort:d=>{i.abort(d),u?.abort(d)}}),this.events.safeDispatchEvent("connection:open",{detail:f}),f}_onStream(e){let{connection:r,stream:n,protocol:i}=e,{handler:s,options:o}=this.components.registrar.getHandler(i);if(r.transient&&o.runOnTransientConnection!==!0)throw new S("Cannot open protocol stream on transient connection","ERR_TRANSIENT_CONNECTION");s({connection:r,stream:n})}async _encryptInbound(e){let r=Array.from(this.connectionEncryption.keys());this.log("handling inbound crypto protocol selection",r);try{let{stream:n,protocol:i}=await ns(e,r,{log:e.log}),s=this.connectionEncryption.get(i);if(s==null)throw new Error(`no crypto module found for ${i}`);return this.log("encrypting inbound connection using",i),{...await s.secureInbound(this.components.peerId,n),protocol:i}}catch(n){throw new S(String(n),F.ERR_ENCRYPTION_FAILED)}}async _encryptOutbound(e,r){let n=Array.from(this.connectionEncryption.keys());this.log("selecting outbound crypto protocol",n);try{e.log.trace("selecting encrypter from %s",n);let{stream:i,protocol:s}=await rs(e,n,{log:e.log,yieldBytes:!0}),o=this.connectionEncryption.get(s);if(o==null)throw new Error(`no crypto module found for ${s}`);return e.log("encrypting outbound connection to %p using %p",r),{...await o.secureOutbound(this.components.peerId,i,r),protocol:s}}catch(i){throw new S(String(i),F.ERR_ENCRYPTION_FAILED)}}async _multiplexOutbound(e,r){let n=Array.from(r.keys());this.log("outbound selecting muxer %s",n);try{e.log.trace("selecting stream muxer from %s",n);let{stream:i,protocol:s}=await rs(e,n,{log:e.log,yieldBytes:!0});e.log("selected %s as muxer protocol",s);let o=r.get(s);return{stream:i,muxerFactory:o}}catch(i){throw e.log.error("error multiplexing outbound stream",i),new S(String(i),F.ERR_MUXER_UNAVAILABLE)}}async _multiplexInbound(e,r){let n=Array.from(r.keys());this.log("inbound handling muxers %s",n);try{let{stream:i,protocol:s}=await ns(e,n,{log:e.log}),o=r.get(s);return{stream:i,muxerFactory:o}}catch(i){throw this.log.error("error multiplexing inbound stream",i),new S(String(i),F.ERR_MUXER_UNAVAILABLE)}}};var $m="0.0.0",zm="libp2p";var Vl=class extends Oi{peerId;peerStore;contentRouting;peerRouting;metrics;services;logger;components;#e;log;constructor(e){super();let r=new Oi,n=r.dispatchEvent.bind(r);r.dispatchEvent=a=>{let c=n(a),u=this.dispatchEvent(new Zc(a.type,{detail:a.detail}));return c||u},yt(1/0,r),this.#e=!1,this.peerId=e.peerId,this.logger=e.logger??Ws(),this.log=this.logger.forComponent("libp2p"),this.services={};let i=this.components=Yd({peerId:e.peerId,nodeInfo:e.nodeInfo??{name:zm,version:$m},logger:this.logger,events:r,datastore:e.datastore??new So,connectionGater:ip(e.connectionGater)});this.peerStore=this.configureComponent("peerStore",new Eo(i,{addressFilter:this.components.connectionGater.filterMultiaddrForPeer,...e.peerStore})),e.metrics!=null&&(this.metrics=this.configureComponent("metrics",e.metrics(this.components))),i.events.addEventListener("peer:update",a=>{if(a.detail.previous==null){let c={id:a.detail.peer.id,multiaddrs:a.detail.peer.addresses.map(u=>u.multiaddr)};i.events.safeDispatchEvent("peer:discovery",{detail:c})}}),e.connectionProtector!=null&&this.configureComponent("connectionProtector",e.connectionProtector(i)),this.components.upgrader=new fa(this.components,{connectionEncryption:(e.connectionEncryption??[]).map((a,c)=>this.configureComponent(`connection-encryption-${c}`,a(this.components))),muxers:(e.streamMuxers??[]).map((a,c)=>this.configureComponent(`stream-muxers-${c}`,a(this.components))),inboundUpgradeTimeout:e.connectionManager.inboundUpgradeTimeout}),this.configureComponent("transportManager",new ia(this.components,e.transportManager)),this.configureComponent("connectionManager",new Xo(this.components,e.connectionManager)),this.configureComponent("registrar",new na(this.components)),this.configureComponent("addressManager",new Ao(this.components,e.addresses));let s=(e.peerRouters??[]).map((a,c)=>this.configureComponent(`peer-router-${c}`,a(this.components)));this.peerRouting=this.components.peerRouting=this.configureComponent("peerRouting",new ra(this.components,{routers:s}));let o=(e.contentRouters??[]).map((a,c)=>this.configureComponent(`content-router-${c}`,a(this.components)));if(this.contentRouting=this.components.contentRouting=this.configureComponent("contentRouting",new ta(this.components,{routers:o})),(e.peerDiscovery??[]).forEach((a,c)=>{this.configureComponent(`peer-discovery-${c}`,a(this.components)).addEventListener("peer",l=>{this.#t(l)})}),e.transports.forEach((a,c)=>{this.components.transportManager.add(this.configureComponent(`transport-${c}`,a(this.components)))}),e.services!=null)for(let a of Object.keys(e.services)){let c=e.services[a],u=c(this.components);if(u==null){this.log.error("service factory %s returned null or undefined instance",a);continue}this.services[a]=u,this.configureComponent(a,u),u[Qc]!=null&&(this.log("registering service %s for content routing",a),o.push(u[Qc])),u[Jc]!=null&&(this.log("registering service %s for peer routing",a),s.push(u[Jc])),u[jc]!=null&&(this.log("registering service %s for peer discovery",a),u[jc].addEventListener("peer",l=>{this.#t(l)}))}}configureComponent(e,r){return r==null&&this.log.error("component %s was null or undefined",e),this.components[e]=r,r}async start(){if(!this.#e){this.#e=!0,this.log("libp2p is starting");try{await this.components.beforeStart?.(),await this.components.start(),await this.components.afterStart?.(),this.safeDispatchEvent("start",{detail:this}),this.log("libp2p has started")}catch(e){throw this.log.error("An error occurred starting libp2p",e),await this.stop(),e}}}async stop(){this.#e&&(this.log("libp2p is stopping"),this.#e=!1,await this.components.beforeStop?.(),await this.components.stop(),await this.components.afterStop?.(),this.safeDispatchEvent("stop",{detail:this}),this.log("libp2p has stopped"))}isStarted(){return this.#e}getConnections(e){return this.components.connectionManager.getConnections(e)}getDialQueue(){return this.components.connectionManager.getDialQueue()}getPeers(){let e=new ln;for(let r of this.components.connectionManager.getConnections())e.add(r.remotePeer);return Array.from(e)}async dial(e,r={}){return this.components.connectionManager.openConnection(e,r)}async dialProtocol(e,r,n={}){if(r==null)throw new S("no protocols were provided to open a stream",F.ERR_INVALID_PROTOCOLS_FOR_STREAM);if(r=Array.isArray(r)?r:[r],r.length===0)throw new S("no protocols were provided to open a stream",F.ERR_INVALID_PROTOCOLS_FOR_STREAM);return(await this.dial(e,n)).newStream(r,n)}getMultiaddrs(){return this.components.addressManager.getAddresses()}getProtocols(){return this.components.registrar.getProtocols()}async hangUp(e,r={}){Lr(e)&&(e=ce(e.getPeerId()??"")),await this.components.connectionManager.closeConnections(e,r)}async getPublicKey(e,r={}){if(this.log("getPublicKey %p",e),e.publicKey!=null)return e.publicKey;let n=await this.peerStore.get(e);if(n.id.publicKey!=null)return n.id.publicKey;let i=Te([Q("/pk/"),e.multihash.digest]),s=await this.contentRouting.get(i,r);return ki(s),await this.peerStore.patch(e,{publicKey:s}),s}async handle(e,r,n){Array.isArray(e)||(e=[e]),await Promise.all(e.map(async i=>{await this.components.registrar.handle(i,r,n)}))}async unhandle(e){Array.isArray(e)||(e=[e]),await Promise.all(e.map(async r=>{await this.components.registrar.unhandle(r)}))}async register(e,r){return this.components.registrar.register(e,r)}unregister(e){this.components.registrar.unregister(e)}#t(e){let{detail:r}=e;if(r.id.toString()===this.peerId.toString()){this.log.error(new Error(F.ERR_DISCOVERED_SELF));return}this.components.peerStore.merge(r.id,{multiaddrs:r.multiaddrs}).catch(n=>{this.log.error(n)})}};async function Hm(t){return t.peerId??=await ed(),new Vl(Tp(t))}async function Sv(t){let e=await Hm(t);return t.start!==!1&&await e.start(),e}return sg(Av);})(); -/*! Bundled license information: - -@noble/hashes/esm/utils.js: - (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/modular.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/curve.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/edwards.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/ed25519.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/weierstrass.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/_shortw_utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/secp256k1.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) -*/ -return Libp2P})); diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/index.d.ts deleted file mode 100644 index 5820cf0a7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/index.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -import type { ComponentLogger, Libp2pEvents } from '@libp2p/interface'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { TransportManager } from '@libp2p/interface-internal/transport-manager'; -import type { Multiaddr } from '@multiformats/multiaddr'; -export interface AddressManagerInit { - /** - * Pass an function in this field to override the list of addresses - * that are announced to the network - */ - announceFilter?: AddressFilter; - /** - * list of multiaddrs string representation to listen - */ - listen?: string[]; - /** - * list of multiaddrs string representation to announce - */ - announce?: string[]; - /** - * list of multiaddrs string representation to never announce - */ - noAnnounce?: string[]; -} -export interface DefaultAddressManagerComponents { - peerId: PeerId; - transportManager: TransportManager; - peerStore: PeerStore; - events: TypedEventTarget; - logger: ComponentLogger; -} -/** - * A function that takes a list of multiaddrs and returns a list - * to announce - */ -export interface AddressFilter { - (addrs: Multiaddr[]): Multiaddr[]; -} -export declare class DefaultAddressManager { - private readonly log; - private readonly components; - private readonly listen; - private readonly announce; - private readonly observed; - private readonly announceFilter; - /** - * Responsible for managing the peer addresses. - * Peers can specify their listen and announce addresses. - * The listen addresses will be used by the libp2p transports to listen for new connections, - * while the announce addresses will be used for the peer addresses' to other peers in the network. - */ - constructor(components: DefaultAddressManagerComponents, init?: AddressManagerInit); - _updatePeerStoreAddresses(): void; - /** - * Get peer listen multiaddrs - */ - getListenAddrs(): Multiaddr[]; - /** - * Get peer announcing multiaddrs - */ - getAnnounceAddrs(): Multiaddr[]; - /** - * Get observed multiaddrs - */ - getObservedAddrs(): Multiaddr[]; - /** - * Add peer observed addresses - */ - addObservedAddr(addr: Multiaddr): void; - confirmObservedAddr(addr: Multiaddr): void; - removeObservedAddr(addr: Multiaddr): void; - getAddresses(): Multiaddr[]; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/index.d.ts.map deleted file mode 100644 index d1ca76ee1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/address-manager/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAU,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,cAAc,CAAC,EAAE,aAAa,CAAA;IAE9B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB;AAED,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,MAAM,CAAA;IACd,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAA;IACtC,MAAM,EAAE,eAAe,CAAA;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAAA;CAClC;AA2BD,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiC;IAE5D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAa;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsC;IAC/D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAe;IAE9C;;;;;OAKG;gBACU,UAAU,EAAE,+BAA+B,EAAE,IAAI,GAAE,kBAAuB;IAwBvF,yBAAyB,IAAK,IAAI;IAwBlC;;OAEG;IACH,cAAc,IAAK,SAAS,EAAE;IAI9B;;OAEG;IACH,gBAAgB,IAAK,SAAS,EAAE;IAIhC;;OAEG;IACH,gBAAgB,IAAK,SAAS,EAAE;IAIhC;;OAEG;IACH,eAAe,CAAE,IAAI,EAAE,SAAS,GAAG,IAAI;IAcvC,mBAAmB,CAAE,IAAI,EAAE,SAAS,GAAG,IAAI;IAoB3C,kBAAkB,CAAE,IAAI,EAAE,SAAS,GAAG,IAAI;IAO1C,YAAY,IAAK,SAAS,EAAE;CAkC7B"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/index.js deleted file mode 100644 index a8eae24b0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/index.js +++ /dev/null @@ -1,152 +0,0 @@ -import { peerIdFromString } from '@libp2p/peer-id'; -import { multiaddr } from '@multiformats/multiaddr'; -import { debounce } from './utils.js'; -const defaultAddressFilter = (addrs) => addrs; -/** - * If the passed multiaddr contains the passed peer id, remove it - */ -function stripPeerId(ma, peerId) { - const observedPeerIdStr = ma.getPeerId(); - // strip our peer id if it has been passed - if (observedPeerIdStr != null) { - const observedPeerId = peerIdFromString(observedPeerIdStr); - // use same encoding for comparison - if (observedPeerId.equals(peerId)) { - ma = ma.decapsulate(multiaddr(`/p2p/${peerId.toString()}`)); - } - } - return ma; -} -export class DefaultAddressManager { - log; - components; - // this is an array to allow for duplicates, e.g. multiples of `/ip4/0.0.0.0/tcp/0` - listen; - announce; - observed; - announceFilter; - /** - * Responsible for managing the peer addresses. - * Peers can specify their listen and announce addresses. - * The listen addresses will be used by the libp2p transports to listen for new connections, - * while the announce addresses will be used for the peer addresses' to other peers in the network. - */ - constructor(components, init = {}) { - const { listen = [], announce = [] } = init; - this.components = components; - this.log = components.logger.forComponent('libp2p:address-manager'); - this.listen = listen.map(ma => ma.toString()); - this.announce = new Set(announce.map(ma => ma.toString())); - this.observed = new Map(); - this.announceFilter = init.announceFilter ?? defaultAddressFilter; - // this method gets called repeatedly on startup when transports start listening so - // debounce it so we don't cause multiple self:peer:update events to be emitted - this._updatePeerStoreAddresses = debounce(this._updatePeerStoreAddresses.bind(this), 1000); - // update our stored addresses when new transports listen - components.events.addEventListener('transport:listening', () => { - this._updatePeerStoreAddresses(); - }); - // update our stored addresses when existing transports stop listening - components.events.addEventListener('transport:close', () => { - this._updatePeerStoreAddresses(); - }); - } - _updatePeerStoreAddresses() { - // if announce addresses have been configured, ensure they make it into our peer - // record for things like identify - const addrs = this.getAnnounceAddrs() - .concat(this.components.transportManager.getAddrs()) - .concat([...this.observed.entries()] - .filter(([_, metadata]) => metadata.confident) - .map(([str]) => multiaddr(str))).map(ma => { - // strip our peer id if it is present - if (ma.getPeerId() === this.components.peerId.toString()) { - return ma.decapsulate(`/p2p/${this.components.peerId.toString()}`); - } - return ma; - }); - this.components.peerStore.patch(this.components.peerId, { - multiaddrs: addrs - }) - .catch(err => { this.log.error('error updating addresses', err); }); - } - /** - * Get peer listen multiaddrs - */ - getListenAddrs() { - return Array.from(this.listen).map((a) => multiaddr(a)); - } - /** - * Get peer announcing multiaddrs - */ - getAnnounceAddrs() { - return Array.from(this.announce).map((a) => multiaddr(a)); - } - /** - * Get observed multiaddrs - */ - getObservedAddrs() { - return Array.from(this.observed).map(([a]) => multiaddr(a)); - } - /** - * Add peer observed addresses - */ - addObservedAddr(addr) { - addr = stripPeerId(addr, this.components.peerId); - const addrString = addr.toString(); - // do not trigger the change:addresses event if we already know about this address - if (this.observed.has(addrString)) { - return; - } - this.observed.set(addrString, { - confident: false - }); - } - confirmObservedAddr(addr) { - addr = stripPeerId(addr, this.components.peerId); - const addrString = addr.toString(); - const metadata = this.observed.get(addrString) ?? { - confident: false - }; - const startingConfidence = metadata.confident; - this.observed.set(addrString, { - confident: true - }); - // only trigger the 'self:peer:update' event if our confidence in an address has changed - if (!startingConfidence) { - this._updatePeerStoreAddresses(); - } - } - removeObservedAddr(addr) { - addr = stripPeerId(addr, this.components.peerId); - const addrString = addr.toString(); - this.observed.delete(addrString); - } - getAddresses() { - let addrs = this.getAnnounceAddrs().map(ma => ma.toString()); - if (addrs.length === 0) { - // no configured announce addrs, add configured listen addresses - addrs = this.components.transportManager.getAddrs().map(ma => ma.toString()); - } - // add observed addresses we are confident in - addrs = addrs.concat(Array.from(this.observed) - .filter(([ma, metadata]) => metadata.confident) - .map(([ma]) => ma)); - // dedupe multiaddrs - const addrSet = new Set(addrs); - // Create advertising list - return this.announceFilter(Array.from(addrSet) - .map(str => multiaddr(str))) - .map(ma => { - // do not append our peer id to a path multiaddr as it will become invalid - if (ma.protos().pop()?.path === true) { - return ma; - } - if (ma.getPeerId() === this.components.peerId.toString()) { - return ma; - } - return ma.encapsulate(`/p2p/${this.components.peerId.toString()}`); - }); - } -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/index.js.map deleted file mode 100644 index cde528318..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/address-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AA+CrC,MAAM,oBAAoB,GAAG,CAAC,KAAkB,EAAe,EAAE,CAAC,KAAK,CAAA;AAMvE;;GAEG;AACH,SAAS,WAAW,CAAE,EAAa,EAAE,MAAc;IACjD,MAAM,iBAAiB,GAAG,EAAE,CAAC,SAAS,EAAE,CAAA;IAExC,0CAA0C;IAC1C,IAAI,iBAAiB,IAAI,IAAI,EAAE;QAC7B,MAAM,cAAc,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;QAE1D,mCAAmC;QACnC,IAAI,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;YACjC,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAA;SAC5D;KACF;IAED,OAAO,EAAE,CAAA;AACX,CAAC;AAED,MAAM,OAAO,qBAAqB;IACf,GAAG,CAAQ;IACX,UAAU,CAAiC;IAC5D,mFAAmF;IAClE,MAAM,CAAU;IAChB,QAAQ,CAAa;IACrB,QAAQ,CAAsC;IAC9C,cAAc,CAAe;IAE9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AS,EAAE,KAAK,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE;gBACxD,OAAO,EAAE,CAAA;aACV;YAED,OAAO,EAAE,CAAC,WAAW,CAAC,QAAQ,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;QACpE,CAAC,CAAC,CAAA;IACN,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/utils.d.ts deleted file mode 100644 index 89fb3c330..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/utils.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function debounce(func: () => void, wait: number): () => void; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/utils.d.ts.map deleted file mode 100644 index d2b3e2d53..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/address-manager/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAE,IAAI,EAAE,MAAM,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,IAAI,CAYpE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/utils.js deleted file mode 100644 index a52ce5c66..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/utils.js +++ /dev/null @@ -1,12 +0,0 @@ -export function debounce(func, wait) { - let timeout; - return function () { - const later = function () { - timeout = undefined; - func(); - }; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - }; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/utils.js.map deleted file mode 100644 index 9bea1f23f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/address-manager/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/address-manager/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CAAE,IAAgB,EAAE,IAAY;IACtD,IAAI,OAAkD,CAAA;IAEtD,OAAO;QACL,MAAM,KAAK,GAAG;YACZ,OAAO,GAAG,SAAS,CAAA;YACnB,IAAI,EAAE,CAAA;QACR,CAAC,CAAA;QAED,YAAY,CAAC,OAAO,CAAC,CAAA;QACrB,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/components.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/components.d.ts deleted file mode 100644 index 725f12c52..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/components.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { type Startable } from '@libp2p/interface/startable'; -import type { Libp2pEvents, ComponentLogger, NodeInfo } from '@libp2p/interface'; -import type { ConnectionProtector } from '@libp2p/interface/connection'; -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -import type { ContentRouting } from '@libp2p/interface/content-routing'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerRouting } from '@libp2p/interface/peer-routing'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Upgrader } from '@libp2p/interface/transport'; -import type { AddressManager } from '@libp2p/interface-internal/address-manager'; -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'; -import type { Registrar } from '@libp2p/interface-internal/registrar'; -import type { TransportManager } from '@libp2p/interface-internal/transport-manager'; -import type { Datastore } from 'interface-datastore'; -export interface Components extends Record, Startable { - peerId: PeerId; - nodeInfo: NodeInfo; - logger: ComponentLogger; - events: TypedEventTarget; - addressManager: AddressManager; - peerStore: PeerStore; - upgrader: Upgrader; - registrar: Registrar; - connectionManager: ConnectionManager; - transportManager: TransportManager; - connectionGater: ConnectionGater; - contentRouting: ContentRouting; - peerRouting: PeerRouting; - datastore: Datastore; - connectionProtector?: ConnectionProtector; - metrics?: Metrics; -} -export interface ComponentsInit { - peerId?: PeerId; - nodeInfo?: NodeInfo; - logger?: ComponentLogger; - events?: TypedEventTarget; - addressManager?: AddressManager; - peerStore?: PeerStore; - upgrader?: Upgrader; - metrics?: Metrics; - registrar?: Registrar; - connectionManager?: ConnectionManager; - transportManager?: TransportManager; - connectionGater?: ConnectionGater; - contentRouting?: ContentRouting; - peerRouting?: PeerRouting; - datastore?: Datastore; - connectionProtector?: ConnectionProtector; -} -export declare function defaultComponents(init?: ComponentsInit): Components; -//# sourceMappingURL=components.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/components.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/components.d.ts.map deleted file mode 100644 index 9a716ba13..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/components.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/components.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAA;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,MAAM,WAAW,UAAW,SAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CA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AE,IAAI,GAAE,cAAmB,GAAG,UAAU,CA+BxE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/components.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/components.js deleted file mode 100644 index ca141f10f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/components.js +++ /dev/null @@ -1,89 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { isStartable } from '@libp2p/interface/startable'; -import { defaultLogger } from '@libp2p/logger'; -class DefaultComponents { - components = {}; - _started = false; - constructor(init = {}) { - this.components = {}; - for (const [key, value] of Object.entries(init)) { - this.components[key] = value; - } - if (this.components.logger == null) { - this.components.logger = defaultLogger(); - } - } - isStarted() { - return this._started; - } - async _invokeStartableMethod(methodName) { - await Promise.all(Object.values(this.components) - .filter(obj => isStartable(obj)) - .map(async (startable) => { - await startable[methodName]?.(); - })); - } - async beforeStart() { - await this._invokeStartableMethod('beforeStart'); - } - async start() { - await this._invokeStartableMethod('start'); - this._started = true; - } - async afterStart() { - await this._invokeStartableMethod('afterStart'); - } - async beforeStop() { - await this._invokeStartableMethod('beforeStop'); - } - async stop() { - await this._invokeStartableMethod('stop'); - this._started = false; - } - async afterStop() { - await this._invokeStartableMethod('afterStop'); - } -} -const OPTIONAL_SERVICES = [ - 'metrics', - 'connectionProtector' -]; -const NON_SERVICE_PROPERTIES = [ - 'components', - 'isStarted', - 'beforeStart', - 'start', - 'afterStart', - 'beforeStop', - 'stop', - 'afterStop', - 'then', - '_invokeStartableMethod' -]; -export function defaultComponents(init = {}) { - const components = new DefaultComponents(init); - const proxy = new Proxy(components, { - get(target, prop, receiver) { - if (typeof prop === 'string' && !NON_SERVICE_PROPERTIES.includes(prop)) { - const service = components.components[prop]; - if (service == null && !OPTIONAL_SERVICES.includes(prop)) { - throw new CodeError(`${prop} not set`, 'ERR_SERVICE_MISSING'); - } - return service; - } - return Reflect.get(target, prop, receiver); - }, - set(target, prop, value) { - if (typeof prop === 'string') { - components.components[prop] = value; - } - else { - Reflect.set(target, prop, value); - } - return true; - } - }); - // @ts-expect-error component keys are proxied - return proxy; -} -//# sourceMappingURL=components.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/components.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/components.js.map deleted file mode 100644 index bcda671ae..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/components.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,WAAW,EAAkB,MAAM,6BAA6B,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAuD9C,MAAM,iBAAiB;IACd,UAAU,GAAwB,EAAE,CAAA;IACnC,QAAQ,GAAG,KAAK,CAAA;IAExB,YAAa,OAAuB,EAAE;QACpC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAA;QAEpB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC/C,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;SAC7B;QAED,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,IAAI,EAAE;YAClC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,aAAa,EAAE,CAAA;SACzC;IACH,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAEO,KAAK,CAAC,sBAAsB,CAAE,UAAwF;QAC5H,MAAM,OAAO,CAA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CAAA;IAE9C,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE;QAClC,GAAG,CAAE,MAAM,EAAE,IAAI,EAAE,QAAQ;YACzB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBACtE,MAAM,OAAO,GAAG,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;gBAE3C,IAAI,OAAO,IAAI,IAAI,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;oBACxD,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,UAAU,EAAE,qBAAqB,CAAC,CAAA;iBAC9D;gBAED,OAAO,OAAO,CAAA;aACf;YAED,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;QAC5C,CAAC;QAED,GAAG,CAAE,MAAM,EAAE,IAAI,EAAE,KAAK;YACtB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;gBAC5B,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;aACpC;iBAAM;gBACL,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;aACjC;YAED,OAAO,IAAI,CAAA;QACb,CAAC;KACF,CAAC,CAAA;IAEF,8CAA8C;IAC9C,OAAO,KAAK,CAAA;AACd,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config.d.ts deleted file mode 100644 index ab4251ece..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Libp2pInit } from './index.js'; -import type { ServiceMap, RecursivePartial } from '@libp2p/interface'; -export declare function validateConfig>(opts: RecursivePartial>): Libp2pInit; -//# sourceMappingURL=config.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config.d.ts.map deleted file mode 100644 index 55a83bd41..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAqBrE,wBAAgB,cAAc,CAAE,CAAC,SAAS,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAG,IAAI,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAYrI"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config.js deleted file mode 100644 index e4c01621d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config.js +++ /dev/null @@ -1,34 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { FaultTolerance } from '@libp2p/interface/transport'; -import { defaultAddressSort } from '@libp2p/utils/address-sort'; -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers'; -import mergeOptions from 'merge-options'; -import { codes, messages } from './errors.js'; -const DefaultConfig = { - addresses: { - listen: [], - announce: [], - noAnnounce: [], - announceFilter: (multiaddrs) => multiaddrs - }, - connectionManager: { - resolvers: { - dnsaddr: dnsaddrResolver - }, - addressSorter: defaultAddressSort - }, - transportManager: { - faultTolerance: FaultTolerance.FATAL_ALL - } -}; -export function validateConfig(opts) { - const resultingOptions = mergeOptions(DefaultConfig, opts); - if (resultingOptions.transports == null || resultingOptions.transports.length < 1) { - throw new CodeError(messages.ERR_TRANSPORTS_REQUIRED, codes.ERR_TRANSPORTS_REQUIRED); - } - if (resultingOptions.connectionProtector === null && globalThis.process?.env?.LIBP2P_FORCE_PNET != null) { // eslint-disable-line no-undef - throw new CodeError(messages.ERR_PROTECTOR_REQUIRED, codes.ERR_PROTECTOR_REQUIRED); - } - return resultingOptions; -} -//# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config.js.map deleted file mode 100644 index e112d5382..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,YAAY,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAK7C,MAAM,aAAa,GAAwB;IACzC,SAAS,EAAE;QACT,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,cAAc,EAAE,CAAC,UAAuB,EAAE,EAAE,CAAC,UAAU;KACxD;IACD,iBAAiB,EAAE;QACjB,SAAS,EAAE;YACT,OAAO,EAAE,eAAe;SACzB;QACD,aAAa,EAAE,kBAAkB;KAClC;IACD,gBAAgB,EAAE;QAChB,cAAc,EAAE,cAAc,CAAC,SAAS;KACzC;CACF,CAAA;AAED,MAAM,UAAU,cAAc,CAAmD,IAAqC;IACpH,MAAM,gBAAgB,GAAkB,YAAY,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;IAEzE,IAAI,gBAAgB,CAAC,UAAU,IAAI,IAAI,IAAI,gBAAgB,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;QACjF,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,uBAAuB,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAA;KACrF;IAED,IAAI,gBAAgB,CAAC,mBAAmB,KAAK,IAAI,IAAI,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,iBAAiB,IAAI,IAAI,EAAE,EAAE,+BAA+B;QACxI,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAA;KACnF;IAED,OAAO,gBAAgB,CAAA;AACzB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.browser.d.ts deleted file mode 100644 index e9811302d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.browser.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -/** - * Returns a connection gater that disallows dialling private addresses by - * default. Browsers are severely limited in their resource usage so don't - * waste time trying to dial undiallable addresses. - */ -export declare function connectionGater(gater?: ConnectionGater): ConnectionGater; -//# sourceMappingURL=connection-gater.browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.browser.d.ts.map deleted file mode 100644 index 835c96980..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-gater.browser.d.ts","sourceRoot":"","sources":["../../../src/config/connection-gater.browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAGzE;;;;GAIG;AACH,wBAAgB,eAAe,CAAE,KAAK,GAAE,eAAoB,GAAG,eAAe,CAqB7E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.browser.js deleted file mode 100644 index 314f039c3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.browser.js +++ /dev/null @@ -1,27 +0,0 @@ -import isPrivate from 'private-ip'; -/** - * Returns a connection gater that disallows dialling private addresses by - * default. Browsers are severely limited in their resource usage so don't - * waste time trying to dial undiallable addresses. - */ -export function connectionGater(gater = {}) { - return { - denyDialPeer: async () => false, - denyDialMultiaddr: async (multiaddr) => { - const tuples = multiaddr.stringTuples(); - if (tuples[0][0] === 4 || tuples[0][0] === 41) { - return Boolean(isPrivate(`${tuples[0][1]}`)); - } - return false; - }, - denyInboundConnection: async () => false, - denyOutboundConnection: async () => false, - denyInboundEncryptedConnection: async () => false, - denyOutboundEncryptedConnection: async () => false, - denyInboundUpgradedConnection: async () => false, - denyOutboundUpgradedConnection: async () => false, - filterMultiaddrForPeer: async () => true, - ...gater - }; -} -//# sourceMappingURL=connection-gater.browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.browser.js.map deleted file mode 100644 index 6cc29ec56..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-gater.browser.js","sourceRoot":"","sources":["../../../src/config/connection-gater.browser.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAA;AAIlC;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAE,QAAyB,EAAE;IAC1D,OAAO;QACL,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAC/B,iBAAiB,EAAE,KAAK,EAAE,SAAoB,EAAE,EAAE;YAChD,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,EAAE,CAAA;YAEvC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC7C,OAAO,OAAO,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;aAC7C;YAED,OAAO,KAAK,CAAA;QACd,CAAC;QACD,qBAAqB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACxC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACzC,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,+BAA+B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAClD,6BAA6B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAChD,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI;QACxC,GAAG,KAAK;KACT,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.d.ts deleted file mode 100644 index e0c7d6071..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -/** - * Returns a default connection gater implementation that allows everything - */ -export declare function connectionGater(gater?: ConnectionGater): ConnectionGater; -//# sourceMappingURL=connection-gater.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.d.ts.map deleted file mode 100644 index 611e82ee3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-gater.d.ts","sourceRoot":"","sources":["../../../src/config/connection-gater.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAEzE;;GAEG;AACH,wBAAgB,eAAe,CAAE,KAAK,GAAE,eAAoB,GAAG,eAAe,CAa7E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.js deleted file mode 100644 index 8795542ce..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Returns a default connection gater implementation that allows everything - */ -export function connectionGater(gater = {}) { - return { - denyDialPeer: async () => false, - denyDialMultiaddr: async () => false, - denyInboundConnection: async () => false, - denyOutboundConnection: async () => false, - denyInboundEncryptedConnection: async () => false, - denyOutboundEncryptedConnection: async () => false, - denyInboundUpgradedConnection: async () => false, - denyOutboundUpgradedConnection: async () => false, - filterMultiaddrForPeer: async () => true, - ...gater - }; -} -//# sourceMappingURL=connection-gater.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.js.map deleted file mode 100644 index e94bddffb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/config/connection-gater.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-gater.js","sourceRoot":"","sources":["../../../src/config/connection-gater.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,eAAe,CAAE,QAAyB,EAAE;IAC1D,OAAO;QACL,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAC/B,iBAAiB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACpC,qBAAqB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACxC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACzC,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,+BAA+B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAClD,6BAA6B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAChD,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI;QACxC,GAAG,KAAK;KACT,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/auto-dial.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/auto-dial.d.ts deleted file mode 100644 index 65674c201..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/auto-dial.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { Libp2pEvents, ComponentLogger } from '@libp2p/interface'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Startable } from '@libp2p/interface/startable'; -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'; -interface AutoDialInit { - minConnections?: number; - maxQueueLength?: number; - autoDialConcurrency?: number; - autoDialPriority?: number; - autoDialInterval?: number; - autoDialPeerRetryThreshold?: number; - autoDialDiscoveredPeersDebounce?: number; -} -interface AutoDialComponents { - connectionManager: ConnectionManager; - peerStore: PeerStore; - events: TypedEventTarget; - logger: ComponentLogger; -} -export declare class AutoDial implements Startable { - private readonly connectionManager; - private readonly peerStore; - private readonly queue; - private readonly minConnections; - private readonly autoDialPriority; - private readonly autoDialIntervalMs; - private readonly autoDialMaxQueueLength; - private readonly autoDialPeerRetryThresholdMs; - private readonly autoDialDiscoveredPeersDebounce; - private autoDialInterval?; - private started; - private running; - private readonly log; - /** - * Proactively tries to connect to known peers stored in the PeerStore. - * It will keep the number of connections below the upper limit and sort - * the peers to connect based on whether we know their keys and protocols. - */ - constructor(components: AutoDialComponents, init: AutoDialInit); - isStarted(): boolean; - start(): void; - afterStart(): void; - stop(): void; - autoDial(): Promise; -} -export {}; -//# sourceMappingURL=auto-dial.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/auto-dial.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/auto-dial.d.ts.map deleted file mode 100644 index 1038109b7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/auto-dial.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auto-dial.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/auto-dial.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAU,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAA;AAEtF,UAAU,YAAY;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,0BAA0B,CAAC,EAAE,MAAM,CAAA;IACnC,+BAA+B,CAAC,EAAE,MAAM,CAAA;CACzC;AAED,UAAU,kBAAkB;IAC1B,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAA;IACtC,MAAM,EAAE,eAAe,CAAA;CACxB;AAYD,qBAAa,QAAS,YAAW,SAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IACrD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAQ;IACvC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAQ;IACzC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAQ;IAC3C,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAQ;IAC/C,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAQ;IACrD,OAAO,CAAC,QAAQ,CAAC,+BAA+B,CAAQ;IACxD,OAAO,CAAC,gBAAgB,CAAC,CAAgC;IACzD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAE5B;;;;OAIG;gBACU,UAAU,EAAE,kBAAkB,EAAE,IAAI,EAAE,YAAY;IA4C/D,SAAS,IAAK,OAAO;IAIrB,KAAK,IAAK,IAAI;IAUd,UAAU,IAAK,IAAI;IAOnB,IAAI,IAAK,IAAI;IAQP,QAAQ,IAAK,OAAO,CAAC,IAAI,CAAC;CA4JjC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/auto-dial.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/auto-dial.js deleted file mode 100644 index 801fc1e0c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/auto-dial.js +++ /dev/null @@ -1,224 +0,0 @@ -import { PeerMap, PeerSet } from '@libp2p/peer-collections'; -import { PeerJobQueue } from '@libp2p/utils/peer-job-queue'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { AUTO_DIAL_CONCURRENCY, AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE, AUTO_DIAL_INTERVAL, AUTO_DIAL_MAX_QUEUE_LENGTH, AUTO_DIAL_PEER_RETRY_THRESHOLD, AUTO_DIAL_PRIORITY, LAST_DIAL_FAILURE_KEY, MIN_CONNECTIONS } from './constants.js'; -const defaultOptions = { - minConnections: MIN_CONNECTIONS, - maxQueueLength: AUTO_DIAL_MAX_QUEUE_LENGTH, - autoDialConcurrency: AUTO_DIAL_CONCURRENCY, - autoDialPriority: AUTO_DIAL_PRIORITY, - autoDialInterval: AUTO_DIAL_INTERVAL, - autoDialPeerRetryThreshold: AUTO_DIAL_PEER_RETRY_THRESHOLD, - autoDialDiscoveredPeersDebounce: AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE -}; -export class AutoDial { - connectionManager; - peerStore; - queue; - minConnections; - autoDialPriority; - autoDialIntervalMs; - autoDialMaxQueueLength; - autoDialPeerRetryThresholdMs; - autoDialDiscoveredPeersDebounce; - autoDialInterval; - started; - running; - log; - /** - * Proactively tries to connect to known peers stored in the PeerStore. - * It will keep the number of connections below the upper limit and sort - * the peers to connect based on whether we know their keys and protocols. - */ - constructor(components, init) { - this.connectionManager = components.connectionManager; - this.peerStore = components.peerStore; - this.minConnections = init.minConnections ?? defaultOptions.minConnections; - this.autoDialPriority = init.autoDialPriority ?? defaultOptions.autoDialPriority; - this.autoDialIntervalMs = init.autoDialInterval ?? defaultOptions.autoDialInterval; - this.autoDialMaxQueueLength = init.maxQueueLength ?? defaultOptions.maxQueueLength; - this.autoDialPeerRetryThresholdMs = init.autoDialPeerRetryThreshold ?? defaultOptions.autoDialPeerRetryThreshold; - this.autoDialDiscoveredPeersDebounce = init.autoDialDiscoveredPeersDebounce ?? defaultOptions.autoDialDiscoveredPeersDebounce; - this.log = components.logger.forComponent('libp2p:connection-manager:auto-dial'); - this.started = false; - this.running = false; - this.queue = new PeerJobQueue({ - concurrency: init.autoDialConcurrency ?? defaultOptions.autoDialConcurrency - }); - this.queue.addListener('error', (err) => { - this.log.error('error during auto-dial', err); - }); - // check the min connection limit whenever a peer disconnects - components.events.addEventListener('connection:close', () => { - this.autoDial() - .catch(err => { - this.log.error(err); - }); - }); - // sometimes peers are discovered in quick succession so add a small - // debounce to ensure all eligible peers are autodialed - let debounce; - // when new peers are discovered, dial them if we don't have - // enough connections - components.events.addEventListener('peer:discovery', () => { - clearTimeout(debounce); - debounce = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error(err); - }); - }, this.autoDialDiscoveredPeersDebounce); - }); - } - isStarted() { - return this.started; - } - start() { - this.autoDialInterval = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err); - }); - }, this.autoDialIntervalMs); - this.started = true; - } - afterStart() { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err); - }); - } - stop() { - // clear the queue - this.queue.clear(); - clearTimeout(this.autoDialInterval); - this.started = false; - this.running = false; - } - async autoDial() { - if (!this.started) { - return; - } - const connections = this.connectionManager.getConnectionsMap(); - const numConnections = connections.size; - // Already has enough connections - if (numConnections >= this.minConnections) { - if (this.minConnections > 0) { - this.log.trace('have enough connections %d/%d', numConnections, this.minConnections); - } - return; - } - if (this.queue.size > this.autoDialMaxQueueLength) { - this.log('not enough connections %d/%d but auto dial queue is full', numConnections, this.minConnections); - return; - } - if (this.running) { - this.log('not enough connections %d/%d - but skipping autodial as it is already running', numConnections, this.minConnections); - return; - } - this.running = true; - this.log('not enough connections %d/%d - will dial peers to increase the number of connections', numConnections, this.minConnections); - const dialQueue = new PeerSet( - // @ts-expect-error boolean filter removes falsy peer IDs - this.connectionManager.getDialQueue() - .map(queue => queue.peerId) - .filter(Boolean)); - // Sort peers on whether we know protocols or public keys for them - const peers = await this.peerStore.all({ - filters: [ - // Remove some peers - (peer) => { - // Remove peers without addresses - if (peer.addresses.length === 0) { - this.log.trace('not autodialing %p because they have no addresses', peer.id); - return false; - } - // remove peers we are already connected to - if (connections.has(peer.id)) { - this.log.trace('not autodialing %p because they are already connected', peer.id); - return false; - } - // remove peers we are already dialling - if (dialQueue.has(peer.id)) { - this.log.trace('not autodialing %p because they are already being dialed', peer.id); - return false; - } - // remove peers already in the autodial queue - if (this.queue.hasJob(peer.id)) { - this.log.trace('not autodialing %p because they are already being autodialed', peer.id); - return false; - } - return true; - } - ] - }); - // shuffle the peers - this is so peers with the same tag values will be - // dialled in a different order each time - const shuffledPeers = peers.sort(() => Math.random() > 0.5 ? 1 : -1); - // Sort shuffled peers by tag value - const peerValues = new PeerMap(); - for (const peer of shuffledPeers) { - if (peerValues.has(peer.id)) { - continue; - } - // sum all tag values - peerValues.set(peer.id, [...peer.tags.values()].reduce((acc, curr) => { - return acc + curr.value; - }, 0)); - } - // sort by value, highest to lowest - const sortedPeers = shuffledPeers.sort((a, b) => { - const peerAValue = peerValues.get(a.id) ?? 0; - const peerBValue = peerValues.get(b.id) ?? 0; - if (peerAValue > peerBValue) { - return -1; - } - if (peerAValue < peerBValue) { - return 1; - } - return 0; - }); - const peersThatHaveNotFailed = sortedPeers.filter(peer => { - const lastDialFailure = peer.metadata.get(LAST_DIAL_FAILURE_KEY); - if (lastDialFailure == null) { - return true; - } - const lastDialFailureTimestamp = parseInt(uint8ArrayToString(lastDialFailure)); - if (isNaN(lastDialFailureTimestamp)) { - return true; - } - // only dial if the time since the last failure is above the retry threshold - return Date.now() - lastDialFailureTimestamp > this.autoDialPeerRetryThresholdMs; - }); - this.log('selected %d/%d peers to dial', peersThatHaveNotFailed.length, peers.length); - for (const peer of peersThatHaveNotFailed) { - this.queue.add(async () => { - const numConnections = this.connectionManager.getConnectionsMap().size; - // Check to see if we still need to auto dial - if (numConnections >= this.minConnections) { - this.log('got enough connections now %d/%d', numConnections, this.minConnections); - this.queue.clear(); - return; - } - this.log('connecting to a peerStore stored peer %p', peer.id); - await this.connectionManager.openConnection(peer.id, { - priority: this.autoDialPriority - }); - }, { - peerId: peer.id - }).catch(err => { - this.log.error('could not connect to peerStore stored peer', err); - }); - } - this.running = false; - if (this.started) { - this.autoDialInterval = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err); - }); - }, this.autoDialIntervalMs); - } - } -} -//# sourceMappingURL=auto-dial.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/auto-dial.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/auto-dial.js.map deleted file mode 100644 index ffc5b37a7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/auto-dial.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auto-dial.js","sourceRoot":"","sources":["../../../src/connection-manager/auto-dial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,qBAAqB,EAAE,mCAAmC,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAwBvO,MAAM,cAAc,GAAG;IACrB,cAAc,EAAE,eAAe;IAC/B,cAAc,EAAE,0BAA0B;IAC1C,mBAAmB,EAAE,qBAAqB;IAC1C,gBAAgB,EAAE,kBAAkB;IACpC,gBAAgB,EAAE,kBAAkB;IACpC,0BAA0B,EAAE,8BAA8B;IAC1D,+BAA+B,EAAE,mCAAmC;CACrE,CAAA;AAED,MAAM,OAAO,QAAQ;IACF,iBAAiB,CAAmB;IACpC,SAAS,CAAW;IACpB,KAAK,CAAc;IACnB,cAAc,CAAQ;IACtB,gBAAgB,CAAQ;IACxB,kBAAkB,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EAAE;gBACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,4CAA4C,EAAE,GAAG,CAAC,CAAA;YACnE,CAAC,CAAC,CAAA;SACH;QAED,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QAEpB,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,GAAG,EAAE;gBACtC,IAAI,CAAC,QAAQ,EAAE;qBACZ,KAAK,CAAC,GAAG,CAAC,EAAE;oBACX,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAA;gBAChD,CAAC,CAAC,CAAA;YACN,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAA;SAC5B;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/connection-pruner.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/connection-pruner.d.ts deleted file mode 100644 index bb19797af..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/connection-pruner.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { Libp2pEvents, ComponentLogger } from '@libp2p/interface'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'; -import type { Multiaddr } from '@multiformats/multiaddr'; -interface ConnectionPrunerInit { - maxConnections?: number; - allow?: Multiaddr[]; -} -interface ConnectionPrunerComponents { - connectionManager: ConnectionManager; - peerStore: PeerStore; - events: TypedEventTarget; - logger: ComponentLogger; -} -/** - * If we go over the max connections limit, choose some connections to close - */ -export declare class ConnectionPruner { - private readonly maxConnections; - private readonly connectionManager; - private readonly peerStore; - private readonly allow; - private readonly events; - private readonly log; - constructor(components: ConnectionPrunerComponents, init?: ConnectionPrunerInit); - /** - * If we have more connections than our maximum, select some excess connections - * to prune based on peer value - */ - maybePruneConnections(): Promise; -} -export {}; -//# sourceMappingURL=connection-pruner.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/connection-pruner.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/connection-pruner.d.ts.map deleted file mode 100644 index 16cb1424a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/connection-pruner.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-pruner.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/connection-pruner.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAU,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAA;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,UAAU,oBAAoB;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;CACpB;AAED,UAAU,0BAA0B;IAClC,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAA;IACtC,MAAM,EAAE,eAAe,CAAA;CACxB;AAOD;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAQ;IACvC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IACrD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgC;IACvD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;gBAEf,UAAU,EAAE,0BAA0B,EAAE,IAAI,GAAE,oBAAyB;IAiBpF;;;OAGG;IACG,qBAAqB,IAAK,OAAO,CAAC,IAAI,CAAC;CAmG9C"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/connection-pruner.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/connection-pruner.js deleted file mode 100644 index 9993d96b0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/connection-pruner.js +++ /dev/null @@ -1,116 +0,0 @@ -import { PeerMap } from '@libp2p/peer-collections'; -import { MAX_CONNECTIONS } from './constants.js'; -const defaultOptions = { - maxConnections: MAX_CONNECTIONS, - allow: [] -}; -/** - * If we go over the max connections limit, choose some connections to close - */ -export class ConnectionPruner { - maxConnections; - connectionManager; - peerStore; - allow; - events; - log; - constructor(components, init = {}) { - this.maxConnections = init.maxConnections ?? defaultOptions.maxConnections; - this.allow = init.allow ?? defaultOptions.allow; - this.connectionManager = components.connectionManager; - this.peerStore = components.peerStore; - this.events = components.events; - this.log = components.logger.forComponent('libp2p:connection-manager:connection-pruner'); - // check the max connection limit whenever a peer connects - components.events.addEventListener('connection:open', () => { - this.maybePruneConnections() - .catch(err => { - this.log.error(err); - }); - }); - } - /** - * If we have more connections than our maximum, select some excess connections - * to prune based on peer value - */ - async maybePruneConnections() { - const connections = this.connectionManager.getConnections(); - const numConnections = connections.length; - const toPrune = Math.max(numConnections - this.maxConnections, 0); - this.log('checking max connections limit %d/%d', numConnections, this.maxConnections); - if (numConnections <= this.maxConnections) { - return; - } - this.log('max connections limit exceeded %d/%d, pruning %d connection(s)', numConnections, this.maxConnections, toPrune); - const peerValues = new PeerMap(); - // work out peer values - for (const connection of connections) { - const remotePeer = connection.remotePeer; - if (peerValues.has(remotePeer)) { - continue; - } - peerValues.set(remotePeer, 0); - try { - const peer = await this.peerStore.get(remotePeer); - // sum all tag values - peerValues.set(remotePeer, [...peer.tags.values()].reduce((acc, curr) => { - return acc + curr.value; - }, 0)); - } - catch (err) { - if (err.code !== 'ERR_NOT_FOUND') { - this.log.error('error loading peer tags', err); - } - } - } - // sort by value, lowest to highest - const sortedConnections = connections.sort((a, b) => { - const peerAValue = peerValues.get(a.remotePeer) ?? 0; - const peerBValue = peerValues.get(b.remotePeer) ?? 0; - if (peerAValue > peerBValue) { - return 1; - } - if (peerAValue < peerBValue) { - return -1; - } - // if the peers have an equal tag value then we want to close short-lived connections first - const connectionALifespan = a.timeline.open; - const connectionBLifespan = b.timeline.open; - if (connectionALifespan < connectionBLifespan) { - return 1; - } - if (connectionALifespan > connectionBLifespan) { - return -1; - } - return 0; - }); - // close some connections - const toClose = []; - for (const connection of sortedConnections) { - this.log('too many connections open - closing a connection to %p', connection.remotePeer); - // check allow list - const connectionInAllowList = this.allow.some((ma) => { - return connection.remoteAddr.toString().startsWith(ma.toString()); - }); - // Connections in the allow list should be excluded from pruning - if (!connectionInAllowList) { - toClose.push(connection); - } - if (toClose.length === toPrune) { - break; - } - } - // close connections - await Promise.all(toClose.map(async (connection) => { - try { - await connection.close(); - } - catch (err) { - this.log.error(err); - } - })); - // despatch prune event - this.events.safeDispatchEvent('connection:prune', { detail: toClose }); - } -} -//# sourceMappingURL=connection-pruner.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/connection-pruner.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/connection-pruner.js.map deleted file mode 100644 index baaa2d894..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/connection-pruner.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-pruner.js","sourceRoot":"","sources":["../../../src/connection-manager/connection-pruner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAmBhD,MAAM,cAAc,GAAG;IACrB,cAAc,EAAE,eAAe;IAC/B,KAAK,EAAE,EAAE;CACV,CAAA;AAED;;GAEG;AACH,MAAM,OAAO,gBAAgB;IACV,cAAc,CAAQ;IACtB,iBAAiB,CAAmB;IACpC,SAAS,CAAW;IACpB,KAAK,CAAa;IAClB,MAAM,CAAgC;IACtC,GAAG,CAAQ;IAE5B,YAAa,UAAsC,EAAE,OAA6B,EAAE;QAClF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,cAAc,CAAA;QAC1E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,cAAc,CAAC,KAAK,CAAA;QAC/C,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAA;QACrD,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAA;QACrC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAA;QAC/B,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,6CAA6C,CAAC,CAAA;QAExF,0DAA0D;QAC1D,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,GAAG,EAAE;YACzD,IAAI,CAAC,qBAAqB,EAAE;iBACzB,KAAK,CAAC,GAAG,CAAC,EAAE;gBACX,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YACrB,CAAC,CAA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,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;YACnE,CAAC,CAAC,CAAA;YAEF,gEAAgE;YAChE,IAAI,CAAC,qBAAqB,EAAE;gBAC1B,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;aACzB;YAED,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;gBAC9B,MAAK;aACN;SACF;QAED,oBAAoB;QACpB,MAAM,OAAO,CAAC,GAAG,CACf,OAAO,CAAC,GAAG,CAAC,KAAK,EAAC,UAAU,EAAC,EAAE;YAC7B,IAAI;gBACF,MAAM,UAAU,CAAC,KAAK,EAAE,CAAA;aACzB;YAAC,OAAO,GAAG,EAAE;gBACZ,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;aACpB;QACH,CAAC,CAAC,CACH,CAAA;QAED,uBAAuB;QACvB,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;IACxE,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.browser.d.ts deleted file mode 100644 index 925afbf76..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.browser.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export * from './constants.defaults.js'; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export declare const MIN_CONNECTIONS = 5; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export declare const MAX_CONNECTIONS = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export declare const MAX_PARALLEL_DIALS = 50; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export declare const AUTO_DIAL_PEER_RETRY_THRESHOLD: number; -//# sourceMappingURL=constants.browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.browser.d.ts.map deleted file mode 100644 index 090ece33c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.browser.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/constants.browser.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC;;GAEG;AACH,eAAO,MAAM,eAAe,IAAI,CAAA;AAEhC;;GAEG;AACH,eAAO,MAAM,eAAe,MAAM,CAAA;AAElC;;GAEG;AACH,eAAO,MAAM,kBAAkB,KAAK,CAAA;AAEpC;;GAEG;AACH,eAAO,MAAM,8BAA8B,QAAgB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.browser.js deleted file mode 100644 index 1d1ac1e69..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.browser.js +++ /dev/null @@ -1,18 +0,0 @@ -export * from './constants.defaults.js'; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export const MIN_CONNECTIONS = 5; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export const MAX_CONNECTIONS = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export const MAX_PARALLEL_DIALS = 50; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export const AUTO_DIAL_PEER_RETRY_THRESHOLD = 1000 * 60 * 7; -//# sourceMappingURL=constants.browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.browser.js.map deleted file mode 100644 index e5dde1817..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.browser.js","sourceRoot":"","sources":["../../../src/connection-manager/constants.browser.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAA;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAA;AAEpC;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,GAAG,EAAE,GAAG,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.d.ts deleted file mode 100644 index 7abb2020e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export * from './constants.defaults.js'; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export declare const MIN_CONNECTIONS = 50; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export declare const MAX_CONNECTIONS = 300; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export declare const MAX_PARALLEL_DIALS = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export declare const AUTO_DIAL_PEER_RETRY_THRESHOLD: number; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.d.ts.map deleted file mode 100644 index 6e0f71505..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/constants.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC;;GAEG;AACH,eAAO,MAAM,eAAe,KAAK,CAAA;AAEjC;;GAEG;AACH,eAAO,MAAM,eAAe,MAAM,CAAA;AAElC;;GAEG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAA;AAErC;;GAEG;AACH,eAAO,MAAM,8BAA8B,QAAY,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.defaults.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.defaults.d.ts deleted file mode 100644 index 24e4c5c07..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.defaults.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#dialTimeout - */ -export declare const DIAL_TIMEOUT = 30000; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundUpgradeTimeout - */ -export declare const INBOUND_UPGRADE_TIMEOUT = 30000; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxPeerAddrsToDial - */ -export declare const MAX_PEER_ADDRS_TO_DIAL = 25; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialInterval - */ -export declare const AUTO_DIAL_INTERVAL = 5000; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialConcurrency - */ -export declare const AUTO_DIAL_CONCURRENCY = 25; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialPriority - */ -export declare const AUTO_DIAL_PRIORITY = 0; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialMaxQueueLength - */ -export declare const AUTO_DIAL_MAX_QUEUE_LENGTH = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialDiscoveredPeersDebounce - */ -export declare const AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE = 10; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundConnectionThreshold - */ -export declare const INBOUND_CONNECTION_THRESHOLD = 5; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxIncomingPendingConnections - */ -export declare const MAX_INCOMING_PENDING_CONNECTIONS = 10; -/** - * Store as part of the peer store metadata for a given peer, the value for this - * key is a timestamp of the last time a dial attempted failed with the relevant - * peer stored as a string. - * - * Used to insure we do not endlessly try to auto dial peers we have recently - * failed to dial. - */ -export declare const LAST_DIAL_FAILURE_KEY = "last-dial-failure"; -//# sourceMappingURL=constants.defaults.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.defaults.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.defaults.d.ts.map deleted file mode 100644 index 67ae45655..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.defaults.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.defaults.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/constants.defaults.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,YAAY,QAAO,CAAA;AAEhC;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAAO,CAAA;AAE3C;;GAEG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAA;AAExC;;GAEG;AACH,eAAO,MAAM,kBAAkB,OAAO,CAAA;AAEtC;;GAEG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAA;AAEvC;;GAEG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAA;AAEnC;;GAEG;AACH,eAAO,MAAM,0BAA0B,MAAM,CAAA;AAE7C;;GAEG;AACH,eAAO,MAAM,mCAAmC,KAAK,CAAA;AAErD;;GAEG;AACH,eAAO,MAAM,4BAA4B,IAAI,CAAA;AAE7C;;GAEG;AACH,eAAO,MAAM,gCAAgC,KAAK,CAAA;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,sBAAsB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.defaults.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.defaults.js deleted file mode 100644 index 8175635a8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.defaults.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#dialTimeout - */ -export const DIAL_TIMEOUT = 30e3; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundUpgradeTimeout - */ -export const INBOUND_UPGRADE_TIMEOUT = 30e3; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxPeerAddrsToDial - */ -export const MAX_PEER_ADDRS_TO_DIAL = 25; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialInterval - */ -export const AUTO_DIAL_INTERVAL = 5000; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialConcurrency - */ -export const AUTO_DIAL_CONCURRENCY = 25; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialPriority - */ -export const AUTO_DIAL_PRIORITY = 0; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialMaxQueueLength - */ -export const AUTO_DIAL_MAX_QUEUE_LENGTH = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialDiscoveredPeersDebounce - */ -export const AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE = 10; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundConnectionThreshold - */ -export const INBOUND_CONNECTION_THRESHOLD = 5; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxIncomingPendingConnections - */ -export const MAX_INCOMING_PENDING_CONNECTIONS = 10; -/** - * Store as part of the peer store metadata for a given peer, the value for this - * key is a timestamp of the last time a dial attempted failed with the relevant - * peer stored as a string. - * - * Used to insure we do not endlessly try to auto dial peers we have recently - * failed to dial. - */ -export const LAST_DIAL_FAILURE_KEY = 'last-dial-failure'; -//# sourceMappingURL=constants.defaults.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.defaults.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.defaults.js.map deleted file mode 100644 index 39ecc9b1a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.defaults.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.defaults.js","sourceRoot":"","sources":["../../../src/connection-manager/constants.defaults.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAA;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAA;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAA;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAA;AAEtC;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAA;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAA;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAA;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,EAAE,CAAA;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAA;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,CAAA;AAElD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.js deleted file mode 100644 index df9b5d654..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.js +++ /dev/null @@ -1,18 +0,0 @@ -export * from './constants.defaults.js'; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export const MIN_CONNECTIONS = 50; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export const MAX_CONNECTIONS = 300; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export const MAX_PARALLEL_DIALS = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export const AUTO_DIAL_PEER_RETRY_THRESHOLD = 1000 * 60; -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.js.map deleted file mode 100644 index 4f42256bd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/connection-manager/constants.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAA;AAEjC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAErC;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,GAAG,EAAE,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/dial-queue.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/dial-queue.d.ts deleted file mode 100644 index e297eca62..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/dial-queue.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { PeerMap } from '@libp2p/peer-collections'; -import { type Multiaddr, type Resolver } from '@multiformats/multiaddr'; -import PQueue from 'p-queue'; -import type { AddressSorter, AbortOptions, PendingDial, ComponentLogger } from '@libp2p/interface'; -import type { Connection } from '@libp2p/interface/connection'; -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { TransportManager } from '@libp2p/interface-internal/transport-manager'; -export interface PendingDialTarget { - resolve(value: any): void; - reject(err: Error): void; -} -export interface DialOptions extends AbortOptions { - priority?: number; - force?: boolean; -} -interface PendingDialInternal extends PendingDial { - promise: Promise; -} -interface DialerInit { - addressSorter?: AddressSorter; - maxParallelDials?: number; - maxPeerAddrsToDial?: number; - dialTimeout?: number; - resolvers?: Record; - connections?: PeerMap; -} -interface DialQueueComponents { - peerId: PeerId; - metrics?: Metrics; - peerStore: PeerStore; - transportManager: TransportManager; - connectionGater: ConnectionGater; - logger: ComponentLogger; -} -export declare class DialQueue { - pendingDials: PendingDialInternal[]; - queue: PQueue; - private readonly peerId; - private readonly peerStore; - private readonly connectionGater; - private readonly transportManager; - private readonly addressSorter; - private readonly maxPeerAddrsToDial; - private readonly dialTimeout; - private readonly inProgressDialCount?; - private readonly pendingDialCount?; - private readonly shutDownController; - private readonly connections; - private readonly log; - constructor(components: DialQueueComponents, init?: DialerInit); - /** - * Clears any pending dials - */ - stop(): void; - /** - * Connects to a given peer, multiaddr or list of multiaddrs. - * - * If a peer is passed, all known multiaddrs will be tried. If a multiaddr or - * multiaddrs are passed only those will be dialled. - * - * Where a list of multiaddrs is passed, if any contain a peer id then all - * multiaddrs in the list must contain the same peer id. - * - * The dial to the first address that is successfully able to upgrade a connection - * will be used, all other dials will be aborted when that happens. - */ - dial(peerIdOrMultiaddr: PeerId | Multiaddr | Multiaddr[], options?: DialOptions): Promise; - private createDialAbortControllers; - private calculateMultiaddrs; - private performDial; -} -export {}; -//# sourceMappingURL=dial-queue.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/dial-queue.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/dial-queue.d.ts.map deleted file mode 100644 index 2b96b8863..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/dial-queue.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dial-queue.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/dial-queue.ts"],"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2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/dial-queue.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/dial-queue.js deleted file mode 100644 index 51fac6935..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/dial-queue.js +++ /dev/null @@ -1,454 +0,0 @@ -import { AbortError, CodeError } from '@libp2p/interface/errors'; -import { setMaxListeners } from '@libp2p/interface/events'; -import { PeerMap } from '@libp2p/peer-collections'; -import { defaultAddressSort } from '@libp2p/utils/address-sort'; -import { resolvers } from '@multiformats/multiaddr'; -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers'; -import { anySignal } from 'any-signal'; -import pDefer from 'p-defer'; -import PQueue from 'p-queue'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { codes } from '../errors.js'; -import { getPeerAddress } from '../get-peer.js'; -import { DIAL_TIMEOUT, MAX_PARALLEL_DIALS, MAX_PEER_ADDRS_TO_DIAL, LAST_DIAL_FAILURE_KEY } from './constants.js'; -import { combineSignals, resolveMultiaddrs } from './utils.js'; -const ERR_TIMEOUT = 'ERR_TIMEOUT'; -const defaultOptions = { - addressSorter: defaultAddressSort, - maxParallelDials: MAX_PARALLEL_DIALS, - maxPeerAddrsToDial: MAX_PEER_ADDRS_TO_DIAL, - dialTimeout: DIAL_TIMEOUT, - resolvers: { - dnsaddr: dnsaddrResolver - } -}; -export class DialQueue { - pendingDials; - queue; - peerId; - peerStore; - connectionGater; - transportManager; - addressSorter; - maxPeerAddrsToDial; - dialTimeout; - inProgressDialCount; - pendingDialCount; - shutDownController; - connections; - log; - constructor(components, init = {}) { - this.addressSorter = init.addressSorter ?? defaultOptions.addressSorter; - this.maxPeerAddrsToDial = init.maxPeerAddrsToDial ?? defaultOptions.maxPeerAddrsToDial; - this.dialTimeout = init.dialTimeout ?? defaultOptions.dialTimeout; - this.connections = init.connections ?? new PeerMap(); - this.log = components.logger.forComponent('libp2p:connection-manager:dial-queue'); - this.peerId = components.peerId; - this.peerStore = components.peerStore; - this.connectionGater = components.connectionGater; - this.transportManager = components.transportManager; - this.shutDownController = new AbortController(); - setMaxListeners(Infinity, this.shutDownController.signal); - this.pendingDialCount = components.metrics?.registerMetric('libp2p_dial_queue_pending_dials'); - this.inProgressDialCount = components.metrics?.registerMetric('libp2p_dial_queue_in_progress_dials'); - this.pendingDials = []; - for (const [key, value] of Object.entries(init.resolvers ?? {})) { - resolvers.set(key, value); - } - // controls dial concurrency - this.queue = new PQueue({ - concurrency: init.maxParallelDials ?? defaultOptions.maxParallelDials - }); - // a job was added to the queue - this.queue.on('add', () => { - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - // a queued job started - this.queue.on('active', () => { - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - // a started job completed without error - this.queue.on('completed', () => { - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - // a started job errored - this.queue.on('error', (err) => { - this.log.error('error in dial queue', err); - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - // all queued jobs have been started - this.queue.on('empty', () => { - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - // add started jobs have run and the queue is empty - this.queue.on('idle', () => { - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - } - /** - * Clears any pending dials - */ - stop() { - this.shutDownController.abort(); - } - /** - * Connects to a given peer, multiaddr or list of multiaddrs. - * - * If a peer is passed, all known multiaddrs will be tried. If a multiaddr or - * multiaddrs are passed only those will be dialled. - * - * Where a list of multiaddrs is passed, if any contain a peer id then all - * multiaddrs in the list must contain the same peer id. - * - * The dial to the first address that is successfully able to upgrade a connection - * will be used, all other dials will be aborted when that happens. - */ - async dial(peerIdOrMultiaddr, options = {}) { - const { peerId, multiaddrs } = getPeerAddress(peerIdOrMultiaddr); - const addrs = multiaddrs.map(multiaddr => ({ - multiaddr, - isCertified: false - })); - // create abort conditions - need to do this before `calculateMultiaddrs` as we may be about to - // resolve a dns addr which can time out - const signal = this.createDialAbortControllers(options.signal); - let addrsToDial; - try { - // load addresses from address book, resolve and dnsaddrs, filter undiallables, add peer IDs, etc - addrsToDial = await this.calculateMultiaddrs(peerId, addrs, { - ...options, - signal - }); - } - catch (err) { - signal.clear(); - throw err; - } - // make sure we don't have an existing connection to any of the addresses we - // are about to dial - let existingConnection = Array.from(this.connections.values()).flat().find(conn => { - if (options.force === true) { - return false; - } - return addrsToDial.find(addr => { - return addr.multiaddr.equals(conn.remoteAddr); - }); - }); - if (existingConnection != null) { - this.log('already connected to %a', existingConnection.remoteAddr); - return existingConnection; - } - // ready to dial, all async work finished - make sure we don't have any - // pending dials in progress for this peer or set of multiaddrs - const existingDial = this.pendingDials.find(dial => { - // is the dial for the same peer id? - if (dial.peerId != null && peerId != null && dial.peerId.equals(peerId)) { - return true; - } - // is the dial for the same set of multiaddrs? - if (addrsToDial.map(({ multiaddr }) => multiaddr.toString()).join() === dial.multiaddrs.map(multiaddr => multiaddr.toString()).join()) { - return true; - } - return false; - }); - if (existingDial != null) { - this.log('joining existing dial target for %p', peerId); - signal.clear(); - return existingDial.promise; - } - this.log('creating dial target for', addrsToDial.map(({ multiaddr }) => multiaddr.toString())); - // @ts-expect-error .promise property is set below - const pendingDial = { - id: randomId(), - status: 'queued', - peerId, - multiaddrs: addrsToDial.map(({ multiaddr }) => multiaddr) - }; - pendingDial.promise = this.performDial(pendingDial, { - ...options, - signal - }) - .finally(() => { - // remove our pending dial entry - this.pendingDials = this.pendingDials.filter(p => p.id !== pendingDial.id); - // clean up abort signals/controllers - signal.clear(); - }) - .catch(async (err) => { - this.log.error('dial failed to %s', pendingDial.multiaddrs.map(ma => ma.toString()).join(', '), err); - if (peerId != null) { - // record the last failed dial - try { - await this.peerStore.patch(peerId, { - metadata: { - [LAST_DIAL_FAILURE_KEY]: uint8ArrayFromString(Date.now().toString()) - } - }); - } - catch (err) { - this.log.error('could not update last dial failure key for %p', peerId, err); - } - } - // Error is a timeout - if (signal.aborted) { - const error = new CodeError(err.message, ERR_TIMEOUT); - throw error; - } - throw err; - }); - // let other dials join this one - this.pendingDials.push(pendingDial); - const connection = await pendingDial.promise; - // we may have been dialing a multiaddr without a peer id attached but by - // this point we have upgraded the connection so the remote peer information - // should be available - check again that we don't already have a connection - // to the remote multiaddr - existingConnection = Array.from(this.connections.values()).flat().find(conn => { - if (options.force === true) { - return false; - } - return conn.id !== connection.id && conn.remoteAddr.equals(connection.remoteAddr); - }); - if (existingConnection != null) { - this.log('already connected to %a', existingConnection.remoteAddr); - await connection.close(); - return existingConnection; - } - this.log('connection opened to %a', connection.remoteAddr); - return connection; - } - createDialAbortControllers(userSignal) { - // let any signal abort the dial - const signal = anySignal([AbortSignal.timeout(this.dialTimeout), - this.shutDownController.signal, - userSignal - ]); - try { - // This emitter gets listened to a lot - setMaxListeners?.(Infinity, signal); - } - catch { } - return signal; - } - // eslint-disable-next-line complexity - async calculateMultiaddrs(peerId, addrs = [], options = {}) { - // if a peer id or multiaddr(s) with a peer id, make sure it isn't our peer id and that we are allowed to dial it - if (peerId != null) { - if (this.peerId.equals(peerId)) { - throw new CodeError('Tried to dial self', codes.ERR_DIALED_SELF); - } - if ((await this.connectionGater.denyDialPeer?.(peerId)) === true) { - throw new CodeError('The dial request is blocked by gater.allowDialPeer', codes.ERR_PEER_DIAL_INTERCEPTED); - } - // if just a peer id was passed, load available multiaddrs for this peer from the address book - if (addrs.length === 0) { - this.log('loading multiaddrs for %p', peerId); - try { - const peer = await this.peerStore.get(peerId); - addrs.push(...peer.addresses); - this.log('loaded multiaddrs for %p', peerId, addrs.map(({ multiaddr }) => multiaddr.toString())); - } - catch (err) { - if (err.code !== codes.ERR_NOT_FOUND) { - throw err; - } - } - } - } - // resolve addresses - this can result in a one-to-many translation when dnsaddrs are resolved - let resolvedAddresses = (await Promise.all(addrs.map(async (addr) => { - const result = await resolveMultiaddrs(addr.multiaddr, { - ...options, - log: this.log - }); - if (result.length === 1 && result[0].equals(addr.multiaddr)) { - return addr; - } - return result.map(multiaddr => ({ - multiaddr, - isCertified: false - })); - }))) - .flat(); - // ensure the peer id is appended to the multiaddr - if (peerId != null) { - const peerIdMultiaddr = `/p2p/${peerId.toString()}`; - resolvedAddresses = resolvedAddresses.map(addr => { - const lastProto = addr.multiaddr.protos().pop(); - // do not append peer id to path multiaddrs - if (lastProto?.path === true) { - return addr; - } - // append peer id to multiaddr if it is not already present - if (addr.multiaddr.getPeerId() == null) { - return { - multiaddr: addr.multiaddr.encapsulate(peerIdMultiaddr), - isCertified: addr.isCertified - }; - } - return addr; - }); - } - const filteredAddrs = resolvedAddresses.filter(addr => { - // filter out any multiaddrs that we do not have transports for - if (this.transportManager.transportForMultiaddr(addr.multiaddr) == null) { - return false; - } - // if the resolved multiaddr has a PeerID but it's the wrong one, ignore it - // - this can happen with addresses like bootstrap.libp2p.io that resolve - // to multiple different peers - const addrPeerId = addr.multiaddr.getPeerId(); - if (peerId != null && addrPeerId != null) { - return peerId.equals(addrPeerId); - } - return true; - }); - // deduplicate addresses - const dedupedAddrs = new Map(); - for (const addr of filteredAddrs) { - const maStr = addr.multiaddr.toString(); - const existing = dedupedAddrs.get(maStr); - if (existing != null) { - existing.isCertified = existing.isCertified || addr.isCertified || false; - continue; - } - dedupedAddrs.set(maStr, addr); - } - const dedupedMultiaddrs = [...dedupedAddrs.values()]; - if (dedupedMultiaddrs.length === 0 || dedupedMultiaddrs.length > this.maxPeerAddrsToDial) { - this.log('addresses for %p before filtering', peerId ?? 'unknown peer', resolvedAddresses.map(({ multiaddr }) => multiaddr.toString())); - this.log('addresses for %p after filtering', peerId ?? 'unknown peer', dedupedMultiaddrs.map(({ multiaddr }) => multiaddr.toString())); - } - // make sure we actually have some addresses to dial - if (dedupedMultiaddrs.length === 0) { - throw new CodeError('The dial request has no valid addresses', codes.ERR_NO_VALID_ADDRESSES); - } - // make sure we don't have too many addresses to dial - if (dedupedMultiaddrs.length > this.maxPeerAddrsToDial) { - throw new CodeError('dial with more addresses than allowed', codes.ERR_TOO_MANY_ADDRESSES); - } - const gatedAdrs = []; - for (const addr of dedupedMultiaddrs) { - if (this.connectionGater.denyDialMultiaddr != null && await this.connectionGater.denyDialMultiaddr(addr.multiaddr)) { - continue; - } - gatedAdrs.push(addr); - } - const sortedGatedAddrs = gatedAdrs.sort(this.addressSorter); - // make sure we actually have some addresses to dial - if (sortedGatedAddrs.length === 0) { - throw new CodeError('The connection gater denied all addresses in the dial request', codes.ERR_NO_VALID_ADDRESSES); - } - return sortedGatedAddrs; - } - async performDial(pendingDial, options = {}) { - const dialAbortControllers = pendingDial.multiaddrs.map(() => new AbortController()); - try { - // internal peer dial queue - only one dial per peer at a time - const peerDialQueue = new PQueue({ concurrency: 1 }); - peerDialQueue.on('error', (err) => { - this.log.error('error dialing %s %o', pendingDial.multiaddrs, err); - }); - const conn = await Promise.any(pendingDial.multiaddrs.map(async (addr, i) => { - const controller = dialAbortControllers[i]; - if (controller == null) { - throw new CodeError('dialAction did not come with an AbortController', codes.ERR_INVALID_PARAMETERS); - } - // let any signal abort the dial - const signal = combineSignals(controller.signal, options.signal); - signal.addEventListener('abort', () => { - this.log('dial to %a aborted', addr); - }); - const deferred = pDefer(); - await peerDialQueue.add(async () => { - if (signal.aborted) { - this.log('dial to %a was aborted before reaching the head of the peer dial queue', addr); - deferred.reject(new AbortError()); - return; - } - // add the individual dial to the dial queue so we don't breach maxConcurrentDials - await this.queue.add(async () => { - try { - if (signal.aborted) { - this.log('dial to %a was aborted before reaching the head of the dial queue', addr); - deferred.reject(new AbortError()); - return; - } - // update dial status - pendingDial.status = 'active'; - const conn = await this.transportManager.dial(addr, { - ...options, - signal - }); - if (controller.signal.aborted) { - // another dial succeeded faster than this one - this.log('multiple dials succeeded, closing superfluous connection'); - conn.close().catch(err => { - this.log.error('error closing superfluous connection', err); - }); - deferred.reject(new AbortError()); - return; - } - // remove the successful AbortController so it is not aborted - dialAbortControllers[i] = undefined; - // immediately abort any other dials - dialAbortControllers.forEach(c => { - if (c !== undefined) { - c.abort(); - } - }); - this.log('dial to %a succeeded', addr); - // resolve the connection promise - deferred.resolve(conn); - } - catch (err) { - // something only went wrong if our signal was not aborted - this.log.error('error during dial of %a', addr, err); - deferred.reject(err); - } - }, { - ...options, - signal - }).catch(err => { - deferred.reject(err); - }); - }, { - signal - }).catch(err => { - deferred.reject(err); - }).finally(() => { - signal.clear(); - }); - return deferred.promise; - })); - // dial succeeded or failed - if (conn == null) { - throw new CodeError('successful dial led to empty object returned from peer dial queue', codes.ERR_TRANSPORT_DIAL_FAILED); - } - pendingDial.status = 'success'; - return conn; - } - catch (err) { - pendingDial.status = 'error'; - // if we only dialled one address, unwrap the AggregateError to provide more - // useful feedback to the user - if (pendingDial.multiaddrs.length === 1 && err.name === 'AggregateError') { - throw err.errors[0]; - } - throw err; - } - } -} -/** - * Returns a random string - */ -function randomId() { - return `${(parseInt(String(Math.random() * 1e9), 10)).toString()}${Date.now()}`; -} -//# sourceMappingURL=dial-queue.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/dial-queue.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/dial-queue.js.map deleted file mode 100644 index c63182258..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/dial-queue.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dial-queue.js","sourceRoot":"","sources":["../../../src/connection-manager/dial-queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM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CAAC,yBAAyB,CAAC,CAAA;aAC1H;YAED,WAAW,CAAC,MAAM,GAAG,SAAS,CAAA;YAE9B,OAAO,IAAI,CAAA;SACZ;QAAC,OAAO,GAAQ,EAAE;YACjB,WAAW,CAAC,MAAM,GAAG,OAAO,CAAA;YAE5B,4EAA4E;YAC5E,8BAA8B;YAC9B,IAAI,WAAW,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,gBAAgB,EAAE;gBACxE,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;aACpB;YAED,MAAM,GAAG,CAAA;SACV;IACH,CAAC;CACF;AAED;;GAEG;AACH,SAAS,QAAQ;IACf,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAA;AACjF,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/index.d.ts deleted file mode 100644 index 7a34e63e8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/index.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { PeerMap } from '@libp2p/peer-collections'; -import { type Multiaddr, type Resolver } from '@multiformats/multiaddr'; -import { AutoDial } from './auto-dial.js'; -import { ConnectionPruner } from './connection-pruner.js'; -import { DialQueue } from './dial-queue.js'; -import type { PendingDial, AddressSorter, Libp2pEvents, AbortOptions, ComponentLogger } from '@libp2p/interface'; -import type { Connection, MultiaddrConnection } from '@libp2p/interface/connection'; -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Startable } from '@libp2p/interface/startable'; -import type { ConnectionManager, OpenConnectionOptions } from '@libp2p/interface-internal/connection-manager'; -import type { TransportManager } from '@libp2p/interface-internal/transport-manager'; -export interface ConnectionManagerInit { - /** - * The maximum number of connections libp2p is willing to have before it starts - * pruning connections to reduce resource usage. (default: 300, 100 in browsers) - */ - maxConnections?: number; - /** - * The minimum number of connections below which libp2p will start to dial peers - * from the peer book. Setting this to 0 effectively disables this behaviour. - * (default: 50, 5 in browsers) - */ - minConnections?: number; - /** - * How long to wait between attempting to keep our number of concurrent connections - * above minConnections (default: 5000) - */ - autoDialInterval?: number; - /** - * When dialling peers from the peer book to keep the number of open connections - * above `minConnections`, add dials for this many peers to the dial queue - * at once. (default: 25) - */ - autoDialConcurrency?: number; - /** - * To allow user dials to take priority over auto dials, use this value as the - * dial priority. (default: 0) - */ - autoDialPriority?: number; - /** - * Limit the maximum number of peers to dial when trying to keep the number of - * open connections above `minConnections`. (default: 100) - */ - autoDialMaxQueueLength?: number; - /** - * When we've failed to dial a peer, do not autodial them again within this - * number of ms. (default: 1 minute, 7 minutes in browsers) - */ - autoDialPeerRetryThreshold?: number; - /** - * Newly discovered peers may be auto-dialed to increase the number of open - * connections, but they can be discovered in quick succession so add a small - * delay before attempting to dial them in case more peers have been - * discovered. (default: 10ms) - */ - autoDialDiscoveredPeersDebounce?: number; - /** - * Sort the known addresses of a peer before trying to dial, By default public - * addresses will be dialled before private (e.g. loopback or LAN) addresses. - */ - addressSorter?: AddressSorter; - /** - * The maximum number of dials across all peers to execute in parallel. - * (default: 100, 50 in browsers) - */ - maxParallelDials?: number; - /** - * Maximum number of addresses allowed for a given peer - if a peer has more - * addresses than this then the dial will fail. (default: 25) - */ - maxPeerAddrsToDial?: number; - /** - * How long a dial attempt is allowed to take, including DNS resolution - * of the multiaddr, opening a socket and upgrading it to a Connection. - */ - dialTimeout?: number; - /** - * When a new inbound connection is opened, the upgrade process (e.g. protect, - * encrypt, multiplex etc) must complete within this number of ms. (default: 30s) - */ - inboundUpgradeTimeout?: number; - /** - * Multiaddr resolvers to use when dialling - */ - resolvers?: Record; - /** - * A list of multiaddrs that will always be allowed (except if they are in the - * deny list) to open connections to this node even if we've reached maxConnections - */ - allow?: string[]; - /** - * A list of multiaddrs that will never be allowed to open connections to - * this node under any circumstances - */ - deny?: string[]; - /** - * If more than this many connections are opened per second by a single - * host, reject subsequent connections. (default: 5) - */ - inboundConnectionThreshold?: number; - /** - * The maximum number of parallel incoming connections allowed that have yet to - * complete the connection upgrade - e.g. choosing connection encryption, muxer, etc. - * (default: 10) - */ - maxIncomingPendingConnections?: number; -} -export interface DefaultConnectionManagerComponents { - peerId: PeerId; - metrics?: Metrics; - peerStore: PeerStore; - transportManager: TransportManager; - connectionGater: ConnectionGater; - events: TypedEventTarget; - logger: ComponentLogger; -} -/** - * Responsible for managing known connections. - */ -export declare class DefaultConnectionManager implements ConnectionManager, Startable { - private started; - private readonly connections; - private readonly allow; - private readonly deny; - private readonly maxIncomingPendingConnections; - private incomingPendingConnections; - private readonly maxConnections; - readonly dialQueue: DialQueue; - readonly autoDial: AutoDial; - readonly connectionPruner: ConnectionPruner; - private readonly inboundConnectionRateLimiter; - private readonly peerStore; - private readonly metrics?; - private readonly events; - private readonly log; - constructor(components: DefaultConnectionManagerComponents, init?: ConnectionManagerInit); - isStarted(): boolean; - /** - * Starts the Connection Manager. If Metrics are not enabled on libp2p - * only event loop and connection limits will be monitored. - */ - start(): Promise; - afterStart(): Promise; - /** - * Stops the Connection Manager - */ - stop(): Promise; - onConnect(evt: CustomEvent): void; - /** - * Tracks the incoming connection and check the connection limit - */ - _onConnect(evt: CustomEvent): Promise; - /** - * Removes the connection from tracking - */ - onDisconnect(evt: CustomEvent): void; - getConnections(peerId?: PeerId): Connection[]; - getConnectionsMap(): PeerMap; - openConnection(peerIdOrMultiaddr: PeerId | Multiaddr | Multiaddr[], options?: OpenConnectionOptions): Promise; - closeConnections(peerId: PeerId, options?: AbortOptions): Promise; - acceptIncomingConnection(maConn: MultiaddrConnection): Promise; - afterUpgradeInbound(): void; - getDialQueue(): PendingDial[]; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/index.d.ts.map deleted file mode 100644 index 91d3a3a2b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAElD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAa,MAAM,yBAAyB,CAAA;AAKlF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAU,MAAM,mBAAmB,CAAA;AACxH,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACnF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,KAAK,EAAE,MA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G,IAAI,IAAK,OAAO,CAAC,IAAI,CAAC;IAyB5B,SAAS,CAAE,GAAG,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,IAAI;IAM9C;;OAEG;IACG,UAAU,CAAE,GAAG,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAgC9D;;OAEG;IACH,YAAY,CAAE,GAAG,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,IAAI;IAoBjD,cAAc,CAAE,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,EAAE;IAc9C,iBAAiB,IAAK,OAAO,CAAC,UAAU,EAAE,CAAC;IAIrC,cAAc,CAAE,iBAAiB,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,EAAE,EAAE,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC,UAAU,CAAC;IAkD9H,gBAAgB,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAc5E,wBAAwB,CAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAiD9E,mBAAmB,IAAK,IAAI;IAI5B,YAAY,IAAK,WAAW,EAAE;CAG/B"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/index.js deleted file mode 100644 index 2f0b460f0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/index.js +++ /dev/null @@ -1,396 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { KEEP_ALIVE } from '@libp2p/interface/peer-store/tags'; -import { PeerMap } from '@libp2p/peer-collections'; -import { defaultAddressSort } from '@libp2p/utils/address-sort'; -import { multiaddr } from '@multiformats/multiaddr'; -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers'; -import { RateLimiterMemory } from 'rate-limiter-flexible'; -import { codes } from '../errors.js'; -import { getPeerAddress } from '../get-peer.js'; -import { AutoDial } from './auto-dial.js'; -import { ConnectionPruner } from './connection-pruner.js'; -import { AUTO_DIAL_CONCURRENCY, AUTO_DIAL_MAX_QUEUE_LENGTH, AUTO_DIAL_PRIORITY, DIAL_TIMEOUT, INBOUND_CONNECTION_THRESHOLD, MAX_CONNECTIONS, MAX_INCOMING_PENDING_CONNECTIONS, MAX_PARALLEL_DIALS, MAX_PEER_ADDRS_TO_DIAL, MIN_CONNECTIONS } from './constants.js'; -import { DialQueue } from './dial-queue.js'; -const DEFAULT_DIAL_PRIORITY = 50; -const defaultOptions = { - minConnections: MIN_CONNECTIONS, - maxConnections: MAX_CONNECTIONS, - inboundConnectionThreshold: INBOUND_CONNECTION_THRESHOLD, - maxIncomingPendingConnections: MAX_INCOMING_PENDING_CONNECTIONS, - autoDialConcurrency: AUTO_DIAL_CONCURRENCY, - autoDialPriority: AUTO_DIAL_PRIORITY, - autoDialMaxQueueLength: AUTO_DIAL_MAX_QUEUE_LENGTH -}; -/** - * Responsible for managing known connections. - */ -export class DefaultConnectionManager { - started; - connections; - allow; - deny; - maxIncomingPendingConnections; - incomingPendingConnections; - maxConnections; - dialQueue; - autoDial; - connectionPruner; - inboundConnectionRateLimiter; - peerStore; - metrics; - events; - log; - constructor(components, init = {}) { - this.maxConnections = init.maxConnections ?? defaultOptions.maxConnections; - const minConnections = init.minConnections ?? defaultOptions.minConnections; - if (this.maxConnections < minConnections) { - throw new CodeError('Connection Manager maxConnections must be greater than minConnections', codes.ERR_INVALID_PARAMETERS); - } - /** - * Map of connections per peer - */ - this.connections = new PeerMap(); - this.started = false; - this.peerStore = components.peerStore; - this.metrics = components.metrics; - this.events = components.events; - this.log = components.logger.forComponent('libp2p:connection-manager'); - this.onConnect = this.onConnect.bind(this); - this.onDisconnect = this.onDisconnect.bind(this); - this.events.addEventListener('connection:open', this.onConnect); - this.events.addEventListener('connection:close', this.onDisconnect); - // allow/deny lists - this.allow = (init.allow ?? []).map(ma => multiaddr(ma)); - this.deny = (init.deny ?? []).map(ma => multiaddr(ma)); - this.incomingPendingConnections = 0; - this.maxIncomingPendingConnections = init.maxIncomingPendingConnections ?? defaultOptions.maxIncomingPendingConnections; - // controls individual peers trying to dial us too quickly - this.inboundConnectionRateLimiter = new RateLimiterMemory({ - points: init.inboundConnectionThreshold ?? defaultOptions.inboundConnectionThreshold, - duration: 1 - }); - // controls what happens when we don't have enough connections - this.autoDial = new AutoDial({ - connectionManager: this, - peerStore: components.peerStore, - events: components.events, - logger: components.logger - }, { - minConnections, - autoDialConcurrency: init.autoDialConcurrency ?? defaultOptions.autoDialConcurrency, - autoDialPriority: init.autoDialPriority ?? defaultOptions.autoDialPriority, - maxQueueLength: init.autoDialMaxQueueLength ?? defaultOptions.autoDialMaxQueueLength - }); - // controls what happens when we have too many connections - this.connectionPruner = new ConnectionPruner({ - connectionManager: this, - peerStore: components.peerStore, - events: components.events, - logger: components.logger - }, { - maxConnections: this.maxConnections, - allow: this.allow - }); - this.dialQueue = new DialQueue({ - peerId: components.peerId, - metrics: components.metrics, - peerStore: components.peerStore, - transportManager: components.transportManager, - connectionGater: components.connectionGater, - logger: components.logger - }, { - addressSorter: init.addressSorter ?? defaultAddressSort, - maxParallelDials: init.maxParallelDials ?? MAX_PARALLEL_DIALS, - maxPeerAddrsToDial: init.maxPeerAddrsToDial ?? MAX_PEER_ADDRS_TO_DIAL, - dialTimeout: init.dialTimeout ?? DIAL_TIMEOUT, - resolvers: init.resolvers ?? { - dnsaddr: dnsaddrResolver - }, - connections: this.connections - }); - } - isStarted() { - return this.started; - } - /** - * Starts the Connection Manager. If Metrics are not enabled on libp2p - * only event loop and connection limits will be monitored. - */ - async start() { - // track inbound/outbound connections - this.metrics?.registerMetricGroup('libp2p_connection_manager_connections', { - calculate: () => { - const metric = { - inbound: 0, - outbound: 0 - }; - for (const conns of this.connections.values()) { - for (const conn of conns) { - if (conn.direction === 'inbound') { - metric.inbound++; - } - else { - metric.outbound++; - } - } - } - return metric; - } - }); - // track total number of streams per protocol - this.metrics?.registerMetricGroup('libp2p_protocol_streams_total', { - label: 'protocol', - calculate: () => { - const metric = {}; - for (const conns of this.connections.values()) { - for (const conn of conns) { - for (const stream of conn.streams) { - const key = `${stream.direction} ${stream.protocol ?? 'unnegotiated'}`; - metric[key] = (metric[key] ?? 0) + 1; - } - } - } - return metric; - } - }); - // track 90th percentile of streams per protocol - this.metrics?.registerMetricGroup('libp2p_connection_manager_protocol_streams_per_connection_90th_percentile', { - label: 'protocol', - calculate: () => { - const allStreams = {}; - for (const conns of this.connections.values()) { - for (const conn of conns) { - const streams = {}; - for (const stream of conn.streams) { - const key = `${stream.direction} ${stream.protocol ?? 'unnegotiated'}`; - streams[key] = (streams[key] ?? 0) + 1; - } - for (const [protocol, count] of Object.entries(streams)) { - allStreams[protocol] = allStreams[protocol] ?? []; - allStreams[protocol].push(count); - } - } - } - const metric = {}; - for (let [protocol, counts] of Object.entries(allStreams)) { - counts = counts.sort((a, b) => a - b); - const index = Math.floor(counts.length * 0.9); - metric[protocol] = counts[index]; - } - return metric; - } - }); - this.autoDial.start(); - this.started = true; - this.log('started'); - } - async afterStart() { - // re-connect to any peers with the KEEP_ALIVE tag - void Promise.resolve() - .then(async () => { - const keepAlivePeers = await this.peerStore.all({ - filters: [(peer) => { - return peer.tags.has(KEEP_ALIVE); - }] - }); - await Promise.all(keepAlivePeers.map(async (peer) => { - await this.openConnection(peer.id) - .catch(err => { - this.log.error(err); - }); - })); - }) - .catch(err => { - this.log.error(err); - }); - this.autoDial.afterStart(); - } - /** - * Stops the Connection Manager - */ - async stop() { - this.dialQueue.stop(); - this.autoDial.stop(); - // Close all connections we're tracking - const tasks = []; - for (const connectionList of this.connections.values()) { - for (const connection of connectionList) { - tasks.push((async () => { - try { - await connection.close(); - } - catch (err) { - this.log.error(err); - } - })()); - } - } - this.log('closing %d connections', tasks.length); - await Promise.all(tasks); - this.connections.clear(); - this.log('stopped'); - } - onConnect(evt) { - void this._onConnect(evt).catch(err => { - this.log.error(err); - }); - } - /** - * Tracks the incoming connection and check the connection limit - */ - async _onConnect(evt) { - const { detail: connection } = evt; - if (!this.started) { - // This can happen when we are in the process of shutting down the node - await connection.close(); - return; - } - const peerId = connection.remotePeer; - const storedConns = this.connections.get(peerId); - let isNewPeer = false; - if (storedConns != null) { - storedConns.push(connection); - } - else { - isNewPeer = true; - this.connections.set(peerId, [connection]); - } - // only need to store RSA public keys, all other types are embedded in the peer id - if (peerId.publicKey != null && peerId.type === 'RSA') { - await this.peerStore.patch(peerId, { - publicKey: peerId.publicKey - }); - } - if (isNewPeer) { - this.events.safeDispatchEvent('peer:connect', { detail: connection.remotePeer }); - } - } - /** - * Removes the connection from tracking - */ - onDisconnect(evt) { - const { detail: connection } = evt; - if (!this.started) { - // This can happen when we are in the process of shutting down the node - return; - } - const peerId = connection.remotePeer; - let storedConn = this.connections.get(peerId); - if (storedConn != null && storedConn.length > 1) { - storedConn = storedConn.filter((conn) => conn.id !== connection.id); - this.connections.set(peerId, storedConn); - } - else if (storedConn != null) { - this.connections.delete(peerId); - this.events.safeDispatchEvent('peer:disconnect', { detail: connection.remotePeer }); - } - } - getConnections(peerId) { - if (peerId != null) { - return this.connections.get(peerId) ?? []; - } - let conns = []; - for (const c of this.connections.values()) { - conns = conns.concat(c); - } - return conns; - } - getConnectionsMap() { - return this.connections; - } - async openConnection(peerIdOrMultiaddr, options = {}) { - if (!this.isStarted()) { - throw new CodeError('Not started', codes.ERR_NODE_NOT_STARTED); - } - options.signal?.throwIfAborted(); - const { peerId } = getPeerAddress(peerIdOrMultiaddr); - if (peerId != null && options.force !== true) { - this.log('dial %p', peerId); - const existingConnection = this.getConnections(peerId) - .find(conn => !conn.transient); - if (existingConnection != null) { - this.log('had an existing non-transient connection to %p', peerId); - return existingConnection; - } - } - const connection = await this.dialQueue.dial(peerIdOrMultiaddr, { - ...options, - priority: options.priority ?? DEFAULT_DIAL_PRIORITY - }); - let peerConnections = this.connections.get(connection.remotePeer); - if (peerConnections == null) { - peerConnections = []; - this.connections.set(connection.remotePeer, peerConnections); - } - // we get notified of connections via the Upgrader emitting "connection" - // events, double check we aren't already tracking this connection before - // storing it - let trackedConnection = false; - for (const conn of peerConnections) { - if (conn.id === connection.id) { - trackedConnection = true; - } - } - if (!trackedConnection) { - peerConnections.push(connection); - } - return connection; - } - async closeConnections(peerId, options = {}) { - const connections = this.connections.get(peerId) ?? []; - await Promise.all(connections.map(async (connection) => { - try { - await connection.close(options); - } - catch (err) { - connection.abort(err); - } - })); - } - async acceptIncomingConnection(maConn) { - // check deny list - const denyConnection = this.deny.some(ma => { - return maConn.remoteAddr.toString().startsWith(ma.toString()); - }); - if (denyConnection) { - this.log('connection from %a refused - connection remote address was in deny list', maConn.remoteAddr); - return false; - } - // check allow list - const allowConnection = this.allow.some(ma => { - return maConn.remoteAddr.toString().startsWith(ma.toString()); - }); - if (allowConnection) { - this.incomingPendingConnections++; - return true; - } - // check pending connections - if (this.incomingPendingConnections === this.maxIncomingPendingConnections) { - this.log('connection from %a refused - incomingPendingConnections exceeded by host', maConn.remoteAddr); - return false; - } - if (maConn.remoteAddr.isThinWaistAddress()) { - const host = maConn.remoteAddr.nodeAddress().address; - try { - await this.inboundConnectionRateLimiter.consume(host, 1); - } - catch { - this.log('connection from %a refused - inboundConnectionThreshold exceeded by host %s', maConn.remoteAddr, host); - return false; - } - } - if (this.getConnections().length < this.maxConnections) { - this.incomingPendingConnections++; - return true; - } - this.log('connection from %a refused - maxConnections exceeded', maConn.remoteAddr); - return false; - } - afterUpgradeInbound() { - this.incomingPendingConnections--; - } - getDialQueue() { - return this.dialQueue.pendingDials; - } -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/index.js.map deleted file mode 100644 index ab7037446..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connection-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAiC,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,YAAY,EAAE,4BAA4B,EAAE,eAAe,EAAE,gCAAgC,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAClQ,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAY3C,MAAM,qBAAqB,GAAG,EAAE,CAAA;AAoHhC,MAAM,cAAc,GAAG;IACrB,cAAc,EAAE,eAAe;IAC/B,cAAc,EAAE,eAAe;IAC/B,0BAA0B,EAAE,4BAA4B;IACxD,6BAA6B,EAAE,gCAAgC;IAC/D,mBAAmB,EAAE,qBAAqB;IAC1C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AU,CAAC,CAAA;QACnF,OAAO,KAAK,CAAA;IACd,CAAC;IAED,mBAAmB;QACjB,IAAI,CAAC,0BAA0B,EAAE,CAAA;IACnC,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAA;IACpC,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/utils.d.ts deleted file mode 100644 index cab51c8e6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/utils.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { type AbortOptions, type Multiaddr } from '@multiformats/multiaddr'; -import { type ClearableSignal } from 'any-signal'; -import type { LoggerOptions } from '@libp2p/interface'; -/** - * Resolve multiaddr recursively - */ -export declare function resolveMultiaddrs(ma: Multiaddr, options: AbortOptions & LoggerOptions): Promise; -export declare function combineSignals(...signals: Array): ClearableSignal; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/utils.d.ts.map deleted file mode 100644 index 8b759343d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAa,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACtF,OAAO,EAAE,KAAK,eAAe,EAAa,MAAM,YAAY,CAAA;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEtD;;GAEG;AACH,wBAAsB,iBAAiB,CAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,GAAG,aAAa,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CA0BnH;AAgBD,wBAAgB,cAAc,CAAE,GAAG,OAAO,EAAE,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC,GAAG,eAAe,CAgB3F"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/utils.js deleted file mode 100644 index 308b550e9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/utils.js +++ /dev/null @@ -1,56 +0,0 @@ -import { setMaxListeners } from '@libp2p/interface/events'; -import { multiaddr } from '@multiformats/multiaddr'; -import { anySignal } from 'any-signal'; -/** - * Resolve multiaddr recursively - */ -export async function resolveMultiaddrs(ma, options) { - // TODO: recursive logic should live in multiaddr once dns4/dns6 support is in place - // Now only supporting resolve for dnsaddr - const resolvableProto = ma.protoNames().includes('dnsaddr'); - // Multiaddr is not resolvable? End recursion! - if (!resolvableProto) { - return [ma]; - } - const resolvedMultiaddrs = await resolveRecord(ma, options); - const recursiveMultiaddrs = await Promise.all(resolvedMultiaddrs.map(async (nm) => { - return resolveMultiaddrs(nm, options); - })); - const addrs = recursiveMultiaddrs.flat(); - const output = addrs.reduce((array, newM) => { - if (array.find(m => m.equals(newM)) == null) { - array.push(newM); - } - return array; - }, ([])); - options.log('resolved %s to', ma, output.map(ma => ma.toString())); - return output; -} -/** - * Resolve a given multiaddr. If this fails, an empty array will be returned - */ -async function resolveRecord(ma, options) { - try { - ma = multiaddr(ma.toString()); // Use current multiaddr module - const multiaddrs = await ma.resolve(options); - return multiaddrs; - } - catch (err) { - options.log.error(`multiaddr ${ma.toString()} could not be resolved`, err); - return []; - } -} -export function combineSignals(...signals) { - const sigs = []; - for (const sig of signals) { - if (sig != null) { - setMaxListeners(Infinity, sig); - sigs.push(sig); - } - } - // let any signal abort the dial - const signal = anySignal(sigs); - setMaxListeners(Infinity, signal); - return signal; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/utils.js.map deleted file mode 100644 index 9bc4b57e7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection-manager/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/connection-manager/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAqB,SAAS,EAAkB,MAAM,yBAAyB,CAAA;AACtF,OAAO,EAAwB,SAAS,EAAE,MAAM,YAAY,CAAA;AAG5D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAE,EAAa,EAAE,OAAqC;IAC3F,oFAAoF;IACpF,0CAA0C;IAC1C,MAAM,eAAe,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;IAE3D,8CAA8C;IAC9C,IAAI,CAAC,eAAe,EAAE;QACpB,OAAO,CAAC,EAAE,CAAC,CAAA;KACZ;IAED,MAAM,kBAAkB,GAAG,MAAM,aAAa,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;IAC3D,MAAM,mBAAmB,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE;Q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I,EAAE;YACf,eAAe,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;YAC9B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;SACf;KACF;IAED,gCAAgC;IAChC,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;IAE9B,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IAEjC,OAAO,MAAM,CAAA;AACf,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection/index.d.ts deleted file mode 100644 index a246a011a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection/index.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { symbol } from '@libp2p/interface/connection'; -import type { AbortOptions, Logger, ComponentLogger } from '@libp2p/interface'; -import type { Direction, Connection, Stream, ConnectionTimeline, ConnectionStatus, NewStreamOptions } from '@libp2p/interface/connection'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { Multiaddr } from '@multiformats/multiaddr'; -interface ConnectionInit { - remoteAddr: Multiaddr; - remotePeer: PeerId; - newStream(protocols: string[], options?: AbortOptions): Promise; - close(options?: AbortOptions): Promise; - abort(err: Error): void; - getStreams(): Stream[]; - status: ConnectionStatus; - direction: Direction; - timeline: ConnectionTimeline; - multiplexer?: string; - encryption?: string; - transient?: boolean; - logger: ComponentLogger; -} -/** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ -export declare class ConnectionImpl implements Connection { - /** - * Connection identifier. - */ - readonly id: string; - /** - * Observed multiaddr of the remote peer - */ - readonly remoteAddr: Multiaddr; - /** - * Remote peer id - */ - readonly remotePeer: PeerId; - direction: Direction; - timeline: ConnectionTimeline; - multiplexer?: string; - encryption?: string; - status: ConnectionStatus; - transient: boolean; - readonly log: Logger; - /** - * User provided tags - * - */ - tags: string[]; - /** - * Reference to the new stream function of the multiplexer - */ - private readonly _newStream; - /** - * Reference to the close function of the raw connection - */ - private readonly _close; - private readonly _abort; - /** - * Reference to the getStreams function of the muxer - */ - private readonly _getStreams; - /** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ - constructor(init: ConnectionInit); - readonly [Symbol.toStringTag] = "Connection"; - readonly [symbol] = true; - /** - * Get all the streams of the muxer - */ - get streams(): Stream[]; - /** - * Create a new stream from this connection - */ - newStream(protocols: string | string[], options?: NewStreamOptions): Promise; - /** - * Close the connection - */ - close(options?: AbortOptions): Promise; - abort(err: Error): void; -} -export declare function createConnection(init: ConnectionInit): Connection; -export {}; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection/index.d.ts.map deleted file mode 100644 index 65815a36d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAGrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACzI,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAIxD,U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IAE7C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAgB;IAE5C;;;OAGG;gBACU,IAAI,EAAE,cAAc;IAyBjC,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAe;IAE5C,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAO;IAExB;;OAEG;IACH,IAAI,OAAO,IAAK,MAAM,EAAE,CAEvB;IAED;;OAEG;IACG,SAAS,CAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;IAwB3F;;OAEG;IACG,KAAK,CAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IA0CvD,KAAK,CAAE,GAAG,EAAE,KAAK,GAAG,IAAI;CAczB;AAED,wBAAgB,gBAAgB,CAAE,IAAI,EAAE,cAAc,GAAG,UAAU,CAElE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection/index.js deleted file mode 100644 index b9439ae39..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection/index.js +++ /dev/null @@ -1,147 +0,0 @@ -import { symbol } from '@libp2p/interface/connection'; -import { CodeError } from '@libp2p/interface/errors'; -import { setMaxListeners } from '@libp2p/interface/events'; -const CLOSE_TIMEOUT = 500; -/** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ -export class ConnectionImpl { - /** - * Connection identifier. - */ - id; - /** - * Observed multiaddr of the remote peer - */ - remoteAddr; - /** - * Remote peer id - */ - remotePeer; - direction; - timeline; - multiplexer; - encryption; - status; - transient; - log; - /** - * User provided tags - * - */ - tags; - /** - * Reference to the new stream function of the multiplexer - */ - _newStream; - /** - * Reference to the close function of the raw connection - */ - _close; - _abort; - /** - * Reference to the getStreams function of the muxer - */ - _getStreams; - /** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ - constructor(init) { - const { remoteAddr, remotePeer, newStream, close, abort, getStreams } = init; - this.id = `${(parseInt(String(Math.random() * 1e9))).toString(36)}${Date.now()}`; - this.remoteAddr = remoteAddr; - this.remotePeer = remotePeer; - this.direction = init.direction; - this.status = 'open'; - this.timeline = init.timeline; - this.multiplexer = init.multiplexer; - this.encryption = init.encryption; - this.transient = init.transient ?? false; - this.log = init.logger.forComponent(`libp2p:connection:${this.direction}:${this.id}`); - if (this.remoteAddr.getPeerId() == null) { - this.remoteAddr = this.remoteAddr.encapsulate(`/p2p/${this.remotePeer}`); - } - this._newStream = newStream; - this._close = close; - this._abort = abort; - this._getStreams = getStreams; - this.tags = []; - } - [Symbol.toStringTag] = 'Connection'; - [symbol] = true; - /** - * Get all the streams of the muxer - */ - get streams() { - return this._getStreams(); - } - /** - * Create a new stream from this connection - */ - async newStream(protocols, options) { - if (this.status === 'closing') { - throw new CodeError('the connection is being closed', 'ERR_CONNECTION_BEING_CLOSED'); - } - if (this.status === 'closed') { - throw new CodeError('the connection is closed', 'ERR_CONNECTION_CLOSED'); - } - if (!Array.isArray(protocols)) { - protocols = [protocols]; - } - if (this.transient && options?.runOnTransientConnection !== true) { - throw new CodeError('Cannot open protocol stream on transient connection', 'ERR_TRANSIENT_CONNECTION'); - } - const stream = await this._newStream(protocols, options); - stream.direction = 'outbound'; - return stream; - } - /** - * Close the connection - */ - async close(options = {}) { - if (this.status === 'closed' || this.status === 'closing') { - return; - } - this.log('closing connection to %a', this.remoteAddr); - this.status = 'closing'; - if (options.signal == null) { - const signal = AbortSignal.timeout(CLOSE_TIMEOUT); - setMaxListeners(Infinity, signal); - options = { - ...options, - signal - }; - } - try { - this.log.trace('closing all streams'); - // close all streams gracefully - this can throw if we're not multiplexed - await Promise.all(this.streams.map(async (s) => s.close(options))); - this.log.trace('closing underlying transport'); - // close raw connection - await this._close(options); - this.log.trace('updating timeline with close time'); - this.status = 'closed'; - this.timeline.close = Date.now(); - } - catch (err) { - this.log.error('error encountered during graceful close of connection to %a', this.remoteAddr, err); - this.abort(err); - } - } - abort(err) { - this.log.error('aborting connection to %a due to error', this.remoteAddr, err); - this.status = 'closing'; - this.streams.forEach(s => { s.abort(err); }); - this.log.error('all streams aborted', this.streams.length); - // Abort raw connection - this._abort(err); - this.timeline.close = Date.now(); - this.status = 'closed'; - } -} -export function createConnection(init) { - return new ConnectionImpl(init); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection/index.js.map deleted file mode 100644 index 7479dd06e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/connection/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAM1D,MAAM,aAAa,GAAG,GAAG,CAAA;AAkBzB;;;GAGG;AACH,MAAM,OAAO,cAAc;IACzB;;OAEG;IACa,EAAE,CAAQ;IAE1B;;OAEG;IACa,UAAU,CAAW;IAErC;;OAEG;IACa,UAAU,CAAQ;IAE3B,SAAS,CAAW;IACpB,QAAQ,CAAoB;IAC5B,WAAW,CAAS;IACpB,UAAU,CAAS;IACnB,MAAM,CAAkB;IACxB,SAAS,CAAS;IACT,GAAG,CAAQ;IAE3B;;;OAGG;IACI,IAAI,CAAU;IAErB;;OAEG;IACc,UAAU,CAAs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AS,CAAA;QACvB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA,CAAC,CAAC,CAAC,CAAA;QAE3C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAE1D,uBAAuB;QACvB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAEhB,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAChC,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAA;IACxB,CAAC;CACF;AAED,MAAM,UAAU,gBAAgB,CAAE,IAAoB;IACpD,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/index.d.ts deleted file mode 100644 index 7a11cb38b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { AbortOptions } from '@libp2p/interface'; -import type { ContentRouting } from '@libp2p/interface/content-routing'; -import type { PeerInfo } from '@libp2p/interface/peer-info'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Startable } from '@libp2p/interface/startable'; -import type { CID } from 'multiformats/cid'; -export interface CompoundContentRoutingInit { - routers: ContentRouting[]; -} -export interface CompoundContentRoutingComponents { - peerStore: PeerStore; -} -export declare class CompoundContentRouting implements ContentRouting, Startable { - private readonly routers; - private started; - private readonly components; - constructor(components: CompoundContentRoutingComponents, init: CompoundContentRoutingInit); - isStarted(): boolean; - start(): Promise; - stop(): Promise; - /** - * Iterates over all content routers in parallel to find providers of the given key - */ - findProviders(key: CID, options?: AbortOptions): AsyncIterable; - /** - * Iterates over all content routers in parallel to notify it is - * a provider of the given key - */ - provide(key: CID, options?: AbortOptions): Promise; - /** - * Store the given key/value pair in the available content routings - */ - put(key: Uint8Array, value: Uint8Array, options?: AbortOptions): Promise; - /** - * Get the value to the given key. - * Times out after 1 minute by default. - */ - get(key: Uint8Array, options?: AbortOptions): Promise; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/index.d.ts.map deleted file mode 100644 index aa53ef816..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/content-routing/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAE3C,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,cAAc,EAAE,CAAA;CAC1B;AAED,MAAM,WAAW,gCAAgC;IAC/C,SAAS,EAAE,SAAS,CAAA;CACrB;AAED,qBAAa,sBAAuB,YAAW,cAAc,EAAE,SAAS;IACtE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkC;gBAEhD,UAAU,EAAE,gCAAgC,EAAE,IAAI,EAAE,0BAA0B;IAM3F,SAAS,IAAK,OAAO;IAIf,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;IAIvB,IAAI,IAAK,OAAO,CAAC,IAAI,CAAC;IAI5B;;OAEG;IACK,aAAa,CAAE,GAAG,EAAE,GAAG,EAAE,OAAO,GAAE,YAAiB,GAAG,aAAa,CAAC,QAAQ,CAAC;IAerF;;;OAGG;IACG,OAAO,CAAE,GAAG,EAAE,GAAG,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQnE;;OAEG;IACG,GAAG,CAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAUrF;;;OAGG;IACG,GAAG,CAAE,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC;CASzE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/index.js deleted file mode 100644 index 3eb6047c6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/index.js +++ /dev/null @@ -1,67 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import merge from 'it-merge'; -import { pipe } from 'it-pipe'; -import { codes, messages } from '../errors.js'; -import { storeAddresses, uniquePeers, requirePeers } from './utils.js'; -export class CompoundContentRouting { - routers; - started; - components; - constructor(components, init) { - this.routers = init.routers ?? []; - this.started = false; - this.components = components; - } - isStarted() { - return this.started; - } - async start() { - this.started = true; - } - async stop() { - this.started = false; - } - /** - * Iterates over all content routers in parallel to find providers of the given key - */ - async *findProviders(key, options = {}) { - if (this.routers.length === 0) { - throw new CodeError('No content routers available', codes.ERR_NO_ROUTERS_AVAILABLE); - } - yield* pipe(merge(...this.routers.map(router => router.findProviders(key, options))), (source) => storeAddresses(source, this.components.peerStore), (source) => uniquePeers(source), (source) => requirePeers(source)); - } - /** - * Iterates over all content routers in parallel to notify it is - * a provider of the given key - */ - async provide(key, options = {}) { - if (this.routers.length === 0) { - throw new CodeError('No content routers available', codes.ERR_NO_ROUTERS_AVAILABLE); - } - await Promise.all(this.routers.map(async (router) => { await router.provide(key, options); })); - } - /** - * Store the given key/value pair in the available content routings - */ - async put(key, value, options) { - if (!this.isStarted()) { - throw new CodeError(messages.NOT_STARTED_YET, codes.DHT_NOT_STARTED); - } - await Promise.all(this.routers.map(async (router) => { - await router.put(key, value, options); - })); - } - /** - * Get the value to the given key. - * Times out after 1 minute by default. - */ - async get(key, options) { - if (!this.isStarted()) { - throw new CodeError(messages.NOT_STARTED_YET, codes.DHT_NOT_STARTED); - } - return Promise.any(this.routers.map(async (router) => { - return router.get(key, options); - })); - } -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/index.js.map deleted file mode 100644 index 4511ae947..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content-routing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,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ACjC,CAAC,CAAC,CAAC,CAAA;IACL,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/utils.d.ts deleted file mode 100644 index 8cb474c72..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/utils.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { PeerInfo } from '@libp2p/interface/peer-info'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Source } from 'it-stream-types'; -/** - * Store the multiaddrs from every peer in the passed peer store - */ -export declare function storeAddresses(source: Source, peerStore: PeerStore): AsyncIterable; -/** - * Filter peers by unique peer id - */ -export declare function uniquePeers(source: Source): AsyncIterable; -/** - * Require at least `min` peers to be yielded from `source` - */ -export declare function requirePeers(source: Source, min?: number): AsyncIterable; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/utils.d.ts.map deleted file mode 100644 index 02132d58d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/content-routing/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C;;GAEG;AACH,wBAAwB,cAAc,CAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,GAAG,aAAa,CAAC,QAAQ,CAAC,CAS/G;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC,CAc9E;AAED;;GAEG;AACH,wBAAwB,YAAY,CAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,GAAE,MAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,CAYxG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/utils.js deleted file mode 100644 index 5cd467241..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/utils.js +++ /dev/null @@ -1,44 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import filter from 'it-filter'; -import map from 'it-map'; -/** - * Store the multiaddrs from every peer in the passed peer store - */ -export async function* storeAddresses(source, peerStore) { - yield* map(source, async (peer) => { - // ensure we have the addresses for a given peer - await peerStore.merge(peer.id, { - multiaddrs: peer.multiaddrs - }); - return peer; - }); -} -/** - * Filter peers by unique peer id - */ -export function uniquePeers(source) { - /** @type Set */ - const seen = new Set(); - return filter(source, (peer) => { - // dedupe by peer id - if (seen.has(peer.id.toString())) { - return false; - } - seen.add(peer.id.toString()); - return true; - }); -} -/** - * Require at least `min` peers to be yielded from `source` - */ -export async function* requirePeers(source, min = 1) { - let seen = 0; - for await (const peer of source) { - seen++; - yield peer; - } - if (seen < min) { - throw new CodeError(`more peers required, seen: ${seen} min: ${min}`, 'NOT_FOUND'); - } -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/utils.js.map deleted file mode 100644 index d89a727c2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/content-routing/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/content-routing/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,GAAG,MAAM,QAAQ,CAAA;AAKxB;;GAEG;AACH,MAAM,CAAC,KAAK,SAAU,CAAC,CAAC,cAAc,CAAE,MAAwB,EAAE,SAAoB;IACpF,KAAM,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACjC,gDAAgD;QAChD,MAAM,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE;YAC7B,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAE,MAAwB;IACnD,wBAAwB;IACxB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAE,CAAA;IAEtB,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QAC7B,oBAAoB;QACpB,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE;YAChC,OAAO,KAAK,CAAA;SACb;QAED,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;QAE5B,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,SAAU,CAAC,CAAC,YAAY,CAAE,MAAwB,EAAE,MAAc,CAAC;IAC7E,IAAI,IAAI,GAAG,CAAC,CAAA;IAEZ,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,MAAM,EAAE;QAC/B,IAAI,EAAE,CAAA;QAEN,MAAM,IAAI,CAAA;KACX;IAED,IAAI,IAAI,GAAG,GAAG,EAAE;QACd,MAAM,IAAI,SAAS,CAAC,8BAA8B,IAAI,UAAU,GAAG,EAAE,EAAE,WAAW,CAAC,CAAA;KACpF;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/errors.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/errors.d.ts deleted file mode 100644 index 49b621f5e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/errors.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -export declare enum messages { - NOT_STARTED_YET = "The libp2p node is not started yet", - DHT_DISABLED = "DHT is not available", - PUBSUB_DISABLED = "PubSub is not available", - CONN_ENCRYPTION_REQUIRED = "At least one connection encryption module is required", - ERR_TRANSPORTS_REQUIRED = "At least one transport module is required", - ERR_PROTECTOR_REQUIRED = "Private network is enforced, but no protector was provided", - NOT_FOUND = "Not found" -} -export declare enum codes { - DHT_DISABLED = "ERR_DHT_DISABLED", - ERR_PUBSUB_DISABLED = "ERR_PUBSUB_DISABLED", - PUBSUB_NOT_STARTED = "ERR_PUBSUB_NOT_STARTED", - DHT_NOT_STARTED = "ERR_DHT_NOT_STARTED", - CONN_ENCRYPTION_REQUIRED = "ERR_CONN_ENCRYPTION_REQUIRED", - ERR_TRANSPORTS_REQUIRED = "ERR_TRANSPORTS_REQUIRED", - ERR_PROTECTOR_REQUIRED = "ERR_PROTECTOR_REQUIRED", - ERR_PEER_DIAL_INTERCEPTED = "ERR_PEER_DIAL_INTERCEPTED", - ERR_CONNECTION_INTERCEPTED = "ERR_CONNECTION_INTERCEPTED", - ERR_INVALID_PROTOCOLS_FOR_STREAM = "ERR_INVALID_PROTOCOLS_FOR_STREAM", - ERR_CONNECTION_ENDED = "ERR_CONNECTION_ENDED", - ERR_CONNECTION_FAILED = "ERR_CONNECTION_FAILED", - ERR_NODE_NOT_STARTED = "ERR_NODE_NOT_STARTED", - ERR_ALREADY_ABORTED = "ERR_ALREADY_ABORTED", - ERR_TOO_MANY_ADDRESSES = "ERR_TOO_MANY_ADDRESSES", - ERR_NO_VALID_ADDRESSES = "ERR_NO_VALID_ADDRESSES", - ERR_RELAYED_DIAL = "ERR_RELAYED_DIAL", - ERR_DIALED_SELF = "ERR_DIALED_SELF", - ERR_DISCOVERED_SELF = "ERR_DISCOVERED_SELF", - ERR_DUPLICATE_TRANSPORT = "ERR_DUPLICATE_TRANSPORT", - ERR_ENCRYPTION_FAILED = "ERR_ENCRYPTION_FAILED", - ERR_HOP_REQUEST_FAILED = "ERR_HOP_REQUEST_FAILED", - ERR_INVALID_KEY = "ERR_INVALID_KEY", - ERR_INVALID_MESSAGE = "ERR_INVALID_MESSAGE", - ERR_INVALID_PARAMETERS = "ERR_INVALID_PARAMETERS", - ERR_INVALID_PEER = "ERR_INVALID_PEER", - ERR_MUXER_UNAVAILABLE = "ERR_MUXER_UNAVAILABLE", - ERR_NOT_FOUND = "ERR_NOT_FOUND", - ERR_TRANSPORT_UNAVAILABLE = "ERR_TRANSPORT_UNAVAILABLE", - ERR_TRANSPORT_DIAL_FAILED = "ERR_TRANSPORT_DIAL_FAILED", - ERR_UNSUPPORTED_PROTOCOL = "ERR_UNSUPPORTED_PROTOCOL", - ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED = "ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED", - ERR_INVALID_MULTIADDR = "ERR_INVALID_MULTIADDR", - ERR_SIGNATURE_NOT_VALID = "ERR_SIGNATURE_NOT_VALID", - ERR_FIND_SELF = "ERR_FIND_SELF", - ERR_NO_ROUTERS_AVAILABLE = "ERR_NO_ROUTERS_AVAILABLE", - ERR_CONNECTION_NOT_MULTIPLEXED = "ERR_CONNECTION_NOT_MULTIPLEXED", - ERR_NO_DIAL_TOKENS = "ERR_NO_DIAL_TOKENS", - ERR_INVALID_CMS = "ERR_INVALID_CMS", - ERR_MISSING_KEYS = "ERR_MISSING_KEYS", - ERR_NO_KEY = "ERR_NO_KEY", - ERR_INVALID_KEY_NAME = "ERR_INVALID_KEY_NAME", - ERR_INVALID_KEY_TYPE = "ERR_INVALID_KEY_TYPE", - ERR_KEY_ALREADY_EXISTS = "ERR_KEY_ALREADY_EXISTS", - ERR_INVALID_KEY_SIZE = "ERR_INVALID_KEY_SIZE", - ERR_KEY_NOT_FOUND = "ERR_KEY_NOT_FOUND", - ERR_OLD_KEY_NAME_INVALID = "ERR_OLD_KEY_NAME_INVALID", - ERR_NEW_KEY_NAME_INVALID = "ERR_NEW_KEY_NAME_INVALID", - ERR_PASSWORD_REQUIRED = "ERR_PASSWORD_REQUIRED", - ERR_PEM_REQUIRED = "ERR_PEM_REQUIRED", - ERR_CANNOT_READ_KEY = "ERR_CANNOT_READ_KEY", - ERR_MISSING_PRIVATE_KEY = "ERR_MISSING_PRIVATE_KEY", - ERR_MISSING_PUBLIC_KEY = "ERR_MISSING_PUBLIC_KEY", - ERR_INVALID_OLD_PASS_TYPE = "ERR_INVALID_OLD_PASS_TYPE", - ERR_INVALID_NEW_PASS_TYPE = "ERR_INVALID_NEW_PASS_TYPE", - ERR_INVALID_PASS_LENGTH = "ERR_INVALID_PASS_LENGTH", - ERR_NOT_IMPLEMENTED = "ERR_NOT_IMPLEMENTED", - ERR_WRONG_PING_ACK = "ERR_WRONG_PING_ACK", - ERR_INVALID_RECORD = "ERR_INVALID_RECORD", - ERR_ALREADY_SUCCEEDED = "ERR_ALREADY_SUCCEEDED", - ERR_NO_HANDLER_FOR_PROTOCOL = "ERR_NO_HANDLER_FOR_PROTOCOL", - ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS = "ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS", - ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS = "ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS", - ERR_CONNECTION_DENIED = "ERR_CONNECTION_DENIED", - ERR_TRANSFER_LIMIT_EXCEEDED = "ERR_TRANSFER_LIMIT_EXCEEDED" -} -//# sourceMappingURL=errors.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/errors.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/errors.d.ts.map deleted file mode 100644 index 542684ed3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/errors.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,eAAe,uCAAuC;IACtD,YAAY,yBAAyB;IACrC,eAAe,4BAA4B;IAC3C,wBAAwB,0DAA0D;IAClF,uBAAuB,8CAA8C;IACrE,sBAAsB,+DAA+D;IACrF,SAAS,cAAc;CACxB;AAED,oBAAY,KAAK;IACf,YAAY,qBAAqB;IACjC,mBAAmB,wBAAwB;IAC3C,kBAAkB,2BAA2B;IAC7C,eAAe,wBAAwB;IACvC,wBAAwB,iCAAiC;IACzD,uBAAuB,4BAA4B;IACnD,sBAAsB,2BAA2B;IACjD,yBAAyB,8BAA8B;IACvD,0BAA0B,+BAA+B;IACzD,gCAAgC,qCAAqC;IACrE,oBAAoB,yBAAyB;IAC7C,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;IAC7C,mBAAmB,wBAAwB;IAC3C,sBAAsB,2BAA2B;IACjD,sBAAsB,2BAA2B;IACjD,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;IACnC,mBAAmB,wBAAwB;IAC3C,uBAAuB,4BAA4B;IACnD,qBAAqB,0BAA0B;IAC/C,sBAAsB,2BAA2B;IACjD,eAAe,oBAAoB;IACnC,mBAAmB,wBAAwB;IAC3C,sBAAsB,2BAA2B;IACjD,gBAAgB,qBAAqB;IACrC,qBAAqB,0BAA0B;IAC/C,aAAa,kBAAkB;IAC/B,yBAAyB,8BAA8B;IACvD,yBAAyB,8BAA8B;IACvD,wBAAwB,6BAA6B;IACrD,uCAAuC,4CAA4C;IACnF,qBAAqB,0BAA0B;IAC/C,uBAAuB,4BAA4B;IACnD,aAAa,kBAAkB;IAC/B,wBAAwB,6BAA6B;IACrD,8BAA8B,mCAAmC;IACjE,kBAAkB,uBAAuB;IACzC,eAAe,oBAAoB;IACnC,gBAAgB,qBAAqB;IACrC,UAAU,eAAe;IACzB,oBAAoB,yBAAyB;IAC7C,oBAAoB,yBAAyB;IAC7C,sBAAsB,2BAA2B;IACjD,oBAAoB,yBAAyB;IAC7C,iBAAiB,sBAAsB;IACvC,wBAAwB,6BAA6B;IACrD,wBAAwB,6BAA6B;IACrD,qBAAqB,0BAA0B;IAC/C,gBAAgB,qBAAqB;IACrC,mBAAmB,wBAAwB;IAC3C,uBAAuB,4BAA4B;IACnD,sBAAsB,2BAA2B;IACjD,yBAAyB,8BAA8B;IACvD,yBAAyB,8BAA8B;IACvD,uBAAuB,4BAA4B;IACnD,mBAAmB,wBAAwB;IAC3C,kBAAkB,uBAAuB;IACzC,kBAAkB,uBAAuB;IACzC,qBAAqB,0BAA0B;IAC/C,2BAA2B,gCAAgC;IAC3D,sCAAsC,2CAA2C;IACjF,qCAAqC,0CAA0C;IAC/E,qBAAqB,0BAA0B;IAC/C,2BAA2B,gCAAgC;CAC5D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/errors.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/errors.js deleted file mode 100644 index b8b7f6f32..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/errors.js +++ /dev/null @@ -1,79 +0,0 @@ -export var messages; -(function (messages) { - messages["NOT_STARTED_YET"] = "The libp2p node is not started yet"; - messages["DHT_DISABLED"] = "DHT is not available"; - messages["PUBSUB_DISABLED"] = "PubSub is not available"; - messages["CONN_ENCRYPTION_REQUIRED"] = "At least one connection encryption module is required"; - messages["ERR_TRANSPORTS_REQUIRED"] = "At least one transport module is required"; - messages["ERR_PROTECTOR_REQUIRED"] = "Private network is enforced, but no protector was provided"; - messages["NOT_FOUND"] = "Not found"; -})(messages || (messages = {})); -export var codes; -(function (codes) { - codes["DHT_DISABLED"] = "ERR_DHT_DISABLED"; - codes["ERR_PUBSUB_DISABLED"] = "ERR_PUBSUB_DISABLED"; - codes["PUBSUB_NOT_STARTED"] = "ERR_PUBSUB_NOT_STARTED"; - codes["DHT_NOT_STARTED"] = "ERR_DHT_NOT_STARTED"; - codes["CONN_ENCRYPTION_REQUIRED"] = "ERR_CONN_ENCRYPTION_REQUIRED"; - codes["ERR_TRANSPORTS_REQUIRED"] = "ERR_TRANSPORTS_REQUIRED"; - codes["ERR_PROTECTOR_REQUIRED"] = "ERR_PROTECTOR_REQUIRED"; - codes["ERR_PEER_DIAL_INTERCEPTED"] = "ERR_PEER_DIAL_INTERCEPTED"; - codes["ERR_CONNECTION_INTERCEPTED"] = "ERR_CONNECTION_INTERCEPTED"; - codes["ERR_INVALID_PROTOCOLS_FOR_STREAM"] = "ERR_INVALID_PROTOCOLS_FOR_STREAM"; - codes["ERR_CONNECTION_ENDED"] = "ERR_CONNECTION_ENDED"; - codes["ERR_CONNECTION_FAILED"] = "ERR_CONNECTION_FAILED"; - codes["ERR_NODE_NOT_STARTED"] = "ERR_NODE_NOT_STARTED"; - codes["ERR_ALREADY_ABORTED"] = "ERR_ALREADY_ABORTED"; - codes["ERR_TOO_MANY_ADDRESSES"] = "ERR_TOO_MANY_ADDRESSES"; - codes["ERR_NO_VALID_ADDRESSES"] = "ERR_NO_VALID_ADDRESSES"; - codes["ERR_RELAYED_DIAL"] = "ERR_RELAYED_DIAL"; - codes["ERR_DIALED_SELF"] = "ERR_DIALED_SELF"; - codes["ERR_DISCOVERED_SELF"] = "ERR_DISCOVERED_SELF"; - codes["ERR_DUPLICATE_TRANSPORT"] = "ERR_DUPLICATE_TRANSPORT"; - codes["ERR_ENCRYPTION_FAILED"] = "ERR_ENCRYPTION_FAILED"; - codes["ERR_HOP_REQUEST_FAILED"] = "ERR_HOP_REQUEST_FAILED"; - codes["ERR_INVALID_KEY"] = "ERR_INVALID_KEY"; - codes["ERR_INVALID_MESSAGE"] = "ERR_INVALID_MESSAGE"; - codes["ERR_INVALID_PARAMETERS"] = "ERR_INVALID_PARAMETERS"; - codes["ERR_INVALID_PEER"] = "ERR_INVALID_PEER"; - codes["ERR_MUXER_UNAVAILABLE"] = "ERR_MUXER_UNAVAILABLE"; - codes["ERR_NOT_FOUND"] = "ERR_NOT_FOUND"; - codes["ERR_TRANSPORT_UNAVAILABLE"] = "ERR_TRANSPORT_UNAVAILABLE"; - codes["ERR_TRANSPORT_DIAL_FAILED"] = "ERR_TRANSPORT_DIAL_FAILED"; - codes["ERR_UNSUPPORTED_PROTOCOL"] = "ERR_UNSUPPORTED_PROTOCOL"; - codes["ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED"] = "ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED"; - codes["ERR_INVALID_MULTIADDR"] = "ERR_INVALID_MULTIADDR"; - codes["ERR_SIGNATURE_NOT_VALID"] = "ERR_SIGNATURE_NOT_VALID"; - codes["ERR_FIND_SELF"] = "ERR_FIND_SELF"; - codes["ERR_NO_ROUTERS_AVAILABLE"] = "ERR_NO_ROUTERS_AVAILABLE"; - codes["ERR_CONNECTION_NOT_MULTIPLEXED"] = "ERR_CONNECTION_NOT_MULTIPLEXED"; - codes["ERR_NO_DIAL_TOKENS"] = "ERR_NO_DIAL_TOKENS"; - codes["ERR_INVALID_CMS"] = "ERR_INVALID_CMS"; - codes["ERR_MISSING_KEYS"] = "ERR_MISSING_KEYS"; - codes["ERR_NO_KEY"] = "ERR_NO_KEY"; - codes["ERR_INVALID_KEY_NAME"] = "ERR_INVALID_KEY_NAME"; - codes["ERR_INVALID_KEY_TYPE"] = "ERR_INVALID_KEY_TYPE"; - codes["ERR_KEY_ALREADY_EXISTS"] = "ERR_KEY_ALREADY_EXISTS"; - codes["ERR_INVALID_KEY_SIZE"] = "ERR_INVALID_KEY_SIZE"; - codes["ERR_KEY_NOT_FOUND"] = "ERR_KEY_NOT_FOUND"; - codes["ERR_OLD_KEY_NAME_INVALID"] = "ERR_OLD_KEY_NAME_INVALID"; - codes["ERR_NEW_KEY_NAME_INVALID"] = "ERR_NEW_KEY_NAME_INVALID"; - codes["ERR_PASSWORD_REQUIRED"] = "ERR_PASSWORD_REQUIRED"; - codes["ERR_PEM_REQUIRED"] = "ERR_PEM_REQUIRED"; - codes["ERR_CANNOT_READ_KEY"] = "ERR_CANNOT_READ_KEY"; - codes["ERR_MISSING_PRIVATE_KEY"] = "ERR_MISSING_PRIVATE_KEY"; - codes["ERR_MISSING_PUBLIC_KEY"] = "ERR_MISSING_PUBLIC_KEY"; - codes["ERR_INVALID_OLD_PASS_TYPE"] = "ERR_INVALID_OLD_PASS_TYPE"; - codes["ERR_INVALID_NEW_PASS_TYPE"] = "ERR_INVALID_NEW_PASS_TYPE"; - codes["ERR_INVALID_PASS_LENGTH"] = "ERR_INVALID_PASS_LENGTH"; - codes["ERR_NOT_IMPLEMENTED"] = "ERR_NOT_IMPLEMENTED"; - codes["ERR_WRONG_PING_ACK"] = "ERR_WRONG_PING_ACK"; - codes["ERR_INVALID_RECORD"] = "ERR_INVALID_RECORD"; - codes["ERR_ALREADY_SUCCEEDED"] = "ERR_ALREADY_SUCCEEDED"; - codes["ERR_NO_HANDLER_FOR_PROTOCOL"] = "ERR_NO_HANDLER_FOR_PROTOCOL"; - codes["ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS"] = "ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS"; - codes["ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS"] = "ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS"; - codes["ERR_CONNECTION_DENIED"] = "ERR_CONNECTION_DENIED"; - codes["ERR_TRANSFER_LIMIT_EXCEEDED"] = "ERR_TRANSFER_LIMIT_EXCEEDED"; -})(codes || (codes = {})); -//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/errors.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/errors.js.map deleted file mode 100644 index 6d105551e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAQX;AARD,WAAY,QAAQ;IAClB,kEAAsD,CAAA;IACtD,iDAAqC,CAAA;IACrC,uDAA2C,CAAA;IAC3C,8FAAkF,CAAA;IAClF,iFAAqE,CAAA;IACrE,iGAAqF,CAAA;IACrF,mCAAuB,CAAA;AACzB,CAAC,EARW,QAAQ,KAAR,QAAQ,QAQnB;AAED,MAAM,CAAN,IAAY,KAkEX;AAlED,WAAY,KAAK;IACf,0CAAiC,CAAA;IACjC,oDAA2C,CAAA;IAC3C,sDAA6C,CAAA;IAC7C,gDAAuC,CAAA;IACvC,kEAAyD,CAAA;IACzD,4DAAmD,CAAA;IACnD,0DAAiD,CAAA;IACjD,gEAAuD,CAAA;IACvD,kEAAyD,CAAA;IACzD,8EAAqE,CAAA;IACr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0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/get-peer.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/get-peer.d.ts deleted file mode 100644 index 57a58c30b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/get-peer.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { Multiaddr } from '@multiformats/multiaddr'; -export interface PeerAddress { - peerId?: PeerId; - multiaddrs: Multiaddr[]; -} -/** - * Extracts a PeerId and/or multiaddr from the passed PeerId or Multiaddr or an array of Multiaddrs - */ -export declare function getPeerAddress(peer: PeerId | Multiaddr | Multiaddr[]): PeerAddress; -//# sourceMappingURL=get-peer.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/get-peer.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/get-peer.d.ts.map deleted file mode 100644 index 341aabd82..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/get-peer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-peer.d.ts","sourceRoot":"","sources":["../../src/get-peer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,SAAS,EAAE,CAAA;CACxB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,EAAE,GAAG,WAAW,CAyCnF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/get-peer.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/get-peer.js deleted file mode 100644 index 1852d9607..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/get-peer.js +++ /dev/null @@ -1,44 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { isPeerId } from '@libp2p/interface/peer-id'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { isMultiaddr } from '@multiformats/multiaddr'; -import { codes } from './errors.js'; -/** - * Extracts a PeerId and/or multiaddr from the passed PeerId or Multiaddr or an array of Multiaddrs - */ -export function getPeerAddress(peer) { - if (isPeerId(peer)) { - return { peerId: peer, multiaddrs: [] }; - } - if (!Array.isArray(peer)) { - peer = [peer]; - } - let peerId; - if (peer.length > 0) { - const peerIdStr = peer[0].getPeerId(); - peerId = peerIdStr == null ? undefined : peerIdFromString(peerIdStr); - // ensure PeerId is either not set or is consistent - peer.forEach(ma => { - if (!isMultiaddr(ma)) { - throw new CodeError('Invalid Multiaddr', codes.ERR_INVALID_MULTIADDR); - } - const maPeerIdStr = ma.getPeerId(); - if (maPeerIdStr == null) { - if (peerId != null) { - throw new CodeError('Multiaddrs must all have the same peer id or have no peer id', codes.ERR_INVALID_PARAMETERS); - } - } - else { - const maPeerId = peerIdFromString(maPeerIdStr); - if (peerId == null || !peerId.equals(maPeerId)) { - throw new CodeError('Multiaddrs must all have the same peer id or have no peer id', codes.ERR_INVALID_PARAMETERS); - } - } - }); - } - return { - peerId, - multiaddrs: peer - }; -} -//# sourceMappingURL=get-peer.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/get-peer.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/get-peer.js.map deleted file mode 100644 index d77085be5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/get-peer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-peer.js","sourceRoot":"","sources":["../../src/get-peer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AASnC;;GAEG;AACH,MAAM,UAAU,cAAc,CAAE,IAAsC;IACpE,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;QAClB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,CAAA;KACxC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACxB,IAAI,GAAG,CAAC,IAAI,CAAC,CAAA;KACd;IAED,IAAI,MAA0B,CAAA;IAE9B,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;QACnB,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAA;QACrC,MAAM,GAAG,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAA;QAEpE,mDAAmD;QACnD,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;YAChB,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;gBACpB,MAAM,IAAI,SAAS,CAAC,mBAAmB,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAA;aACtE;YAED,MAAM,WAAW,GAAG,EAAE,CAAC,SAAS,EAAE,CAAA;YAElC,IAAI,WAAW,IAAI,IAAI,EAAE;gBACvB,IAAI,MAAM,IAAI,IAAI,EAAE;oBAClB,MAAM,IAAI,SAAS,CAAC,8DAA8D,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAA;iBAClH;aACF;iBAAM;gBACL,MAAM,QAAQ,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAA;gBAE9C,IAAI,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;oBAC9C,MAAM,IAAI,SAAS,CAAC,8DAA8D,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAA;iBAClH;aACF;QACH,CAAC,CAAC,CAAA;KACH;IAED,OAAO;QACL,MAAM;QACN,UAAU,EAAE,IAAI;KACjB,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/index.d.ts deleted file mode 100644 index d542548df..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/index.d.ts +++ /dev/null @@ -1,151 +0,0 @@ -/** - * @packageDocumentation - * - * Use the `createLibp2p` function to create a libp2p node. - * - * @example - * - * ```typescript - * import { createLibp2p } from 'libp2p' - * - * const node = await createLibp2p({ - * // ...other options - * }) - * ``` - */ -import type { AddressManagerInit } from './address-manager/index.js'; -import type { Components } from './components.js'; -import type { ConnectionManagerInit } from './connection-manager/index.js'; -import type { TransportManagerInit } from './transport-manager.js'; -import type { Libp2p, ServiceMap, RecursivePartial, ComponentLogger, NodeInfo } from '@libp2p/interface'; -import type { ConnectionProtector } from '@libp2p/interface/connection'; -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter'; -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -import type { ContentRouting } from '@libp2p/interface/content-routing'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerDiscovery } from '@libp2p/interface/peer-discovery'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerRouting } from '@libp2p/interface/peer-routing'; -import type { StreamMuxerFactory } from '@libp2p/interface/stream-muxer'; -import type { Transport } from '@libp2p/interface/transport'; -import type { PersistentPeerStoreInit } from '@libp2p/peer-store'; -import type { Datastore } from 'interface-datastore'; -export type ServiceFactoryMap = Record> = { - [Property in keyof T]: (components: Components) => T[Property]; -}; -/** - * For Libp2p configurations and modules details read the [Configuration Document](./CONFIGURATION.md). - */ -export interface Libp2pInit; -}> { - /** - * peerId instance (it will be created if not provided) - */ - peerId: PeerId; - /** - * Metadata about the node - implementation name, version number, etc - */ - nodeInfo: NodeInfo; - /** - * Addresses for transport listening and to advertise to the network - */ - addresses: AddressManagerInit; - /** - * libp2p Connection Manager configuration - */ - connectionManager: ConnectionManagerInit; - /** - * A connection gater can deny new connections based on user criteria - */ - connectionGater: ConnectionGater; - /** - * libp2p transport manager configuration - */ - transportManager: TransportManagerInit; - /** - * An optional datastore to persist peer information, DHT records, etc. - * - * An in-memory datastore will be used if one is not provided. - */ - datastore: Datastore; - /** - * libp2p PeerStore configuration - */ - peerStore: PersistentPeerStoreInit; - /** - * An array that must include at least 1 compliant transport - */ - transports: Array<(components: Components) => Transport>; - streamMuxers?: Array<(components: Components) => StreamMuxerFactory>; - connectionEncryption?: Array<(components: Components) => ConnectionEncrypter>; - peerDiscovery?: Array<(components: Components) => PeerDiscovery>; - peerRouters?: Array<(components: Components) => PeerRouting>; - contentRouters?: Array<(components: Components) => ContentRouting>; - /** - * A Metrics implementation can be supplied to collect metrics on this node - */ - metrics?(components: Components): Metrics; - /** - * A ConnectionProtector can be used to create a secure overlay on top of the network using pre-shared keys - */ - connectionProtector?(components: Components): ConnectionProtector; - /** - * Arbitrary libp2p modules - */ - services: ServiceFactoryMap; - /** - * An optional logging implementation that can be used to write runtime logs. - * - * Set the `DEBUG` env var or the `debug` key on LocalStorage to see logs. - * - * @example - * - * Node.js: - * - * ```console - * $ DEBUG="*libp2p:*" node myscript.js - * ``` - * - * Browsers: - * - * ```javascript - * localStorage.setItem('debug', '*libp2p:*') - * ``` - */ - logger?: ComponentLogger; -} -export type { Libp2p }; -export type Libp2pOptions> = RecursivePartial> & { - start?: boolean; -}; -/** - * Returns a new instance of the Libp2p interface, generating a new PeerId - * if one is not passed as part of the options. - * - * The node will be started unless `start: false` is passed as an option. - * - * @example - * - * ```js - * import { createLibp2p } from 'libp2p' - * import { tcp } from '@libp2p/tcp' - * import { mplex } from '@libp2p/mplex' - * import { noise } from '@chainsafe/libp2p-noise' - * import { yamux } from '@chainsafe/libp2p-yamux' - * - * // specify options - * const options = { - * transports: [tcp()], - * streamMuxers: [yamux(), mplex()], - * connectionEncryption: [noise()] - * } - * - * // create libp2p - * const libp2p = await createLibp2p(options) - * ``` - */ -export declare function createLibp2p; -}>(options: Libp2pOptions): Promise>; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/index.d.ts.map deleted file mode 100644 index fabc757a4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAA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AAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAEjI;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,YAAY,CAAE,CAAC,SAAS,UAAU,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,EAAG,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAQzI"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/index.js deleted file mode 100644 index afbc58dae..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/index.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @packageDocumentation - * - * Use the `createLibp2p` function to create a libp2p node. - * - * @example - * - * ```typescript - * import { createLibp2p } from 'libp2p' - * - * const node = await createLibp2p({ - * // ...other options - * }) - * ``` - */ -import { createLibp2pNode } from './libp2p.js'; -/** - * Returns a new instance of the Libp2p interface, generating a new PeerId - * if one is not passed as part of the options. - * - * The node will be started unless `start: false` is passed as an option. - * - * @example - * - * ```js - * import { createLibp2p } from 'libp2p' - * import { tcp } from '@libp2p/tcp' - * import { mplex } from '@libp2p/mplex' - * import { noise } from '@chainsafe/libp2p-noise' - * import { yamux } from '@chainsafe/libp2p-yamux' - * - * // specify options - * const options = { - * transports: [tcp()], - * streamMuxers: [yamux(), mplex()], - * connectionEncryption: [noise()] - * } - * - * // create libp2p - * const libp2p = await createLibp2p(options) - * ``` - */ -export async function createLibp2p(options) { - const node = await createLibp2pNode(options); - if (options.start !== false) { - await node.start(); - } - return node; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/index.js.map deleted file mode 100644 index 8ee9c1281..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAwH9C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAA0D,OAAyB;IACnH,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAE5C,IAAI,OAAO,CAAC,KAAK,KAAK,KAAK,EAAE;QAC3B,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;KACnB;IAED,OAAO,IAAI,CAAA;AACb,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/libp2p.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/libp2p.d.ts deleted file mode 100644 index cb492deed..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/libp2p.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { type ContentRouting } from '@libp2p/interface/content-routing'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { type PeerRouting } from '@libp2p/interface/peer-routing'; -import { type Multiaddr } from '@multiformats/multiaddr'; -import type { Components } from './components.js'; -import type { Libp2p, Libp2pInit, Libp2pOptions } from './index.js'; -import type { Libp2pEvents, PendingDial, ServiceMap, AbortOptions, ComponentLogger } from '@libp2p/interface'; -import type { Connection, NewStreamOptions, Stream } from '@libp2p/interface/connection'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Topology } from '@libp2p/interface/topology'; -import type { StreamHandler, StreamHandlerOptions } from '@libp2p/interface-internal/registrar'; -export declare class Libp2pNode> extends TypedEventEmitter implements Libp2p { - #private; - peerId: PeerId; - peerStore: PeerStore; - contentRouting: ContentRouting; - peerRouting: PeerRouting; - metrics?: Metrics; - services: T; - logger: ComponentLogger; - components: Components; - private readonly log; - constructor(init: Libp2pInit); - private configureComponent; - /** - * Starts the libp2p node and all its subsystems - */ - start(): Promise; - /** - * Stop the libp2p node by closing its listeners and open connections - */ - stop(): Promise; - isStarted(): boolean; - getConnections(peerId?: PeerId): Connection[]; - getDialQueue(): PendingDial[]; - getPeers(): PeerId[]; - dial(peer: PeerId | Multiaddr | Multiaddr[], options?: AbortOptions): Promise; - dialProtocol(peer: PeerId | Multiaddr | Multiaddr[], protocols: string | string[], options?: NewStreamOptions): Promise; - getMultiaddrs(): Multiaddr[]; - getProtocols(): string[]; - hangUp(peer: PeerId | Multiaddr, options?: AbortOptions): Promise; - /** - * Get the public key for the given peer id - */ - getPublicKey(peer: PeerId, options?: AbortOptions): Promise; - handle(protocols: string | string[], handler: StreamHandler, options?: StreamHandlerOptions): Promise; - unhandle(protocols: string[] | string): Promise; - register(protocol: string, topology: Topology): Promise; - unregister(id: string): void; -} -/** - * Returns a new Libp2pNode instance - this exposes more of the internals than the - * libp2p interface and is useful for testing and debugging. - */ -export declare function createLibp2pNode>(options: Libp2pOptions): Promise>; -//# sourceMappingURL=libp2p.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/libp2p.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/libp2p.d.ts.map deleted file mode 100644 index c2c806b62..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/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AQ,CAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYtD,QAAQ,CAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAItE,UAAU,CAAE,EAAE,EAAE,MAAM,GAAG,IAAI;CAqB9B;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAE,CAAC,SAAS,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAG,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAI1I"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/libp2p.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/libp2p.js deleted file mode 100644 index 7f1e9bcf8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/libp2p.js +++ /dev/null @@ -1,310 +0,0 @@ -import { unmarshalPublicKey } from '@libp2p/crypto/keys'; -import { contentRouting } from '@libp2p/interface/content-routing'; -import { CodeError } from '@libp2p/interface/errors'; -import { TypedEventEmitter, CustomEvent, setMaxListeners } from '@libp2p/interface/events'; -import { peerDiscovery } from '@libp2p/interface/peer-discovery'; -import { peerRouting } from '@libp2p/interface/peer-routing'; -import { defaultLogger } from '@libp2p/logger'; -import { PeerSet } from '@libp2p/peer-collections'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { isMultiaddr } from '@multiformats/multiaddr'; -import { MemoryDatastore } from 'datastore-core/memory'; -import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { DefaultAddressManager } from './address-manager/index.js'; -import { defaultComponents } from './components.js'; -import { connectionGater } from './config/connection-gater.js'; -import { validateConfig } from './config.js'; -import { DefaultConnectionManager } from './connection-manager/index.js'; -import { CompoundContentRouting } from './content-routing/index.js'; -import { codes } from './errors.js'; -import { DefaultPeerRouting } from './peer-routing.js'; -import { DefaultRegistrar } from './registrar.js'; -import { DefaultTransportManager } from './transport-manager.js'; -import { DefaultUpgrader } from './upgrader.js'; -import * as pkg from './version.js'; -export class Libp2pNode extends TypedEventEmitter { - peerId; - peerStore; - contentRouting; - peerRouting; - metrics; - services; - logger; - components; - #started; - log; - constructor(init) { - super(); - // event bus - components can listen to this emitter to be notified of system events - // and also cause them to be emitted - const events = new TypedEventEmitter(); - const originalDispatch = events.dispatchEvent.bind(events); - events.dispatchEvent = (evt) => { - const internalResult = originalDispatch(evt); - const externalResult = this.dispatchEvent(new CustomEvent(evt.type, { detail: evt.detail })); - return internalResult || externalResult; - }; - // This emitter gets listened to a lot - setMaxListeners(Infinity, events); - this.#started = false; - this.peerId = init.peerId; - this.logger = init.logger ?? defaultLogger(); - this.log = this.logger.forComponent('libp2p'); - // @ts-expect-error {} may not be of type T - this.services = {}; - const components = this.components = defaultComponents({ - peerId: init.peerId, - nodeInfo: init.nodeInfo ?? { - name: pkg.name, - version: pkg.version - }, - logger: this.logger, - events, - datastore: init.datastore ?? new MemoryDatastore(), - connectionGater: connectionGater(init.connectionGater) - }); - this.peerStore = this.configureComponent('peerStore', new PersistentPeerStore(components, { - addressFilter: this.components.connectionGater.filterMultiaddrForPeer, - ...init.peerStore - })); - // Create Metrics - if (init.metrics != null) { - this.metrics = this.configureComponent('metrics', init.metrics(this.components)); - } - components.events.addEventListener('peer:update', evt => { - // if there was no peer previously in the peer store this is a new peer - if (evt.detail.previous == null) { - const peerInfo = { - id: evt.detail.peer.id, - multiaddrs: evt.detail.peer.addresses.map(a => a.multiaddr) - }; - components.events.safeDispatchEvent('peer:discovery', { detail: peerInfo }); - } - }); - // Set up connection protector if configured - if (init.connectionProtector != null) { - this.configureComponent('connectionProtector', init.connectionProtector(components)); - } - // Set up the Upgrader - this.components.upgrader = new DefaultUpgrader(this.components, { - connectionEncryption: (init.connectionEncryption ?? []).map((fn, index) => this.configureComponent(`connection-encryption-${index}`, fn(this.components))), - muxers: (init.streamMuxers ?? []).map((fn, index) => this.configureComponent(`stream-muxers-${index}`, fn(this.components))), - inboundUpgradeTimeout: init.connectionManager.inboundUpgradeTimeout - }); - // Setup the transport manager - this.configureComponent('transportManager', new DefaultTransportManager(this.components, init.transportManager)); - // Create the Connection Manager - this.configureComponent('connectionManager', new DefaultConnectionManager(this.components, init.connectionManager)); - // Create the Registrar - this.configureComponent('registrar', new DefaultRegistrar(this.components)); - // Addresses {listen, announce, noAnnounce} - this.configureComponent('addressManager', new DefaultAddressManager(this.components, init.addresses)); - // Peer routers - const peerRouters = (init.peerRouters ?? []).map((fn, index) => this.configureComponent(`peer-router-${index}`, fn(this.components))); - this.peerRouting = this.components.peerRouting = this.configureComponent('peerRouting', new DefaultPeerRouting(this.components, { - routers: peerRouters - })); - // Content routers - const contentRouters = (init.contentRouters ?? []).map((fn, index) => this.configureComponent(`content-router-${index}`, fn(this.components))); - this.contentRouting = this.components.contentRouting = this.configureComponent('contentRouting', new CompoundContentRouting(this.components, { - routers: contentRouters - })); - (init.peerDiscovery ?? []).forEach((fn, index) => { - const service = this.configureComponent(`peer-discovery-${index}`, fn(this.components)); - service.addEventListener('peer', (evt) => { - this.#onDiscoveryPeer(evt); - }); - }); - // Transport modules - init.transports.forEach((fn, index) => { - this.components.transportManager.add(this.configureComponent(`transport-${index}`, fn(this.components))); - }); - // User defined modules - if (init.services != null) { - for (const name of Object.keys(init.services)) { - const createService = init.services[name]; - const service = createService(this.components); - if (service == null) { - this.log.error('service factory %s returned null or undefined instance', name); - continue; - } - this.services[name] = service; - this.configureComponent(name, service); - if (service[contentRouting] != null) { - this.log('registering service %s for content routing', name); - contentRouters.push(service[contentRouting]); - } - if (service[peerRouting] != null) { - this.log('registering service %s for peer routing', name); - peerRouters.push(service[peerRouting]); - } - if (service[peerDiscovery] != null) { - this.log('registering service %s for peer discovery', name); - service[peerDiscovery].addEventListener('peer', (evt) => { - this.#onDiscoveryPeer(evt); - }); - } - } - } - } - configureComponent(name, component) { - if (component == null) { - this.log.error('component %s was null or undefined', name); - } - this.components[name] = component; - return component; - } - /** - * Starts the libp2p node and all its subsystems - */ - async start() { - if (this.#started) { - return; - } - this.#started = true; - this.log('libp2p is starting'); - try { - await this.components.beforeStart?.(); - await this.components.start(); - await this.components.afterStart?.(); - this.safeDispatchEvent('start', { detail: this }); - this.log('libp2p has started'); - } - catch (err) { - this.log.error('An error occurred starting libp2p', err); - await this.stop(); - throw err; - } - } - /** - * Stop the libp2p node by closing its listeners and open connections - */ - async stop() { - if (!this.#started) { - return; - } - this.log('libp2p is stopping'); - this.#started = false; - await this.components.beforeStop?.(); - await this.components.stop(); - await this.components.afterStop?.(); - this.safeDispatchEvent('stop', { detail: this }); - this.log('libp2p has stopped'); - } - isStarted() { - return this.#started; - } - getConnections(peerId) { - return this.components.connectionManager.getConnections(peerId); - } - getDialQueue() { - return this.components.connectionManager.getDialQueue(); - } - getPeers() { - const peerSet = new PeerSet(); - for (const conn of this.components.connectionManager.getConnections()) { - peerSet.add(conn.remotePeer); - } - return Array.from(peerSet); - } - async dial(peer, options = {}) { - return this.components.connectionManager.openConnection(peer, options); - } - async dialProtocol(peer, protocols, options = {}) { - if (protocols == null) { - throw new CodeError('no protocols were provided to open a stream', codes.ERR_INVALID_PROTOCOLS_FOR_STREAM); - } - protocols = Array.isArray(protocols) ? protocols : [protocols]; - if (protocols.length === 0) { - throw new CodeError('no protocols were provided to open a stream', codes.ERR_INVALID_PROTOCOLS_FOR_STREAM); - } - const connection = await this.dial(peer, options); - return connection.newStream(protocols, options); - } - getMultiaddrs() { - return this.components.addressManager.getAddresses(); - } - getProtocols() { - return this.components.registrar.getProtocols(); - } - async hangUp(peer, options = {}) { - if (isMultiaddr(peer)) { - peer = peerIdFromString(peer.getPeerId() ?? ''); - } - await this.components.connectionManager.closeConnections(peer, options); - } - /** - * Get the public key for the given peer id - */ - async getPublicKey(peer, options = {}) { - this.log('getPublicKey %p', peer); - if (peer.publicKey != null) { - return peer.publicKey; - } - const peerInfo = await this.peerStore.get(peer); - if (peerInfo.id.publicKey != null) { - return peerInfo.id.publicKey; - } - const peerKey = uint8ArrayConcat([ - uint8ArrayFromString('/pk/'), - peer.multihash.digest - ]); - // search any available content routing methods - const bytes = await this.contentRouting.get(peerKey, options); - // ensure the returned key is valid - unmarshalPublicKey(bytes); - await this.peerStore.patch(peer, { - publicKey: bytes - }); - return bytes; - } - async handle(protocols, handler, options) { - if (!Array.isArray(protocols)) { - protocols = [protocols]; - } - await Promise.all(protocols.map(async (protocol) => { - await this.components.registrar.handle(protocol, handler, options); - })); - } - async unhandle(protocols) { - if (!Array.isArray(protocols)) { - protocols = [protocols]; - } - await Promise.all(protocols.map(async (protocol) => { - await this.components.registrar.unhandle(protocol); - })); - } - async register(protocol, topology) { - return this.components.registrar.register(protocol, topology); - } - unregister(id) { - this.components.registrar.unregister(id); - } - /** - * Called whenever peer discovery services emit `peer` events and adds peers - * to the peer store. - */ - #onDiscoveryPeer(evt) { - const { detail: peer } = evt; - if (peer.id.toString() === this.peerId.toString()) { - this.log.error(new Error(codes.ERR_DISCOVERED_SELF)); - return; - } - void this.components.peerStore.merge(peer.id, { - multiaddrs: peer.multiaddrs - }) - .catch(err => { this.log.error(err); }); - } -} -/** - * Returns a new Libp2pNode instance - this exposes more of the internals than the - * libp2p interface and is useful for testing and debugging. - */ -export async function createLibp2pNode(options) { - options.peerId ??= await createEd25519PeerId(); - return new Libp2pNode(validateConfig(options)); -} -//# sourceMappingURL=libp2p.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/libp2p.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/libp2p.js.map deleted file mode 100644 index 2e6bdd3cc..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/libp2p.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"libp2p.js","sourceRoot":"","sources":["../../src/libp2p.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAuB,cAAc,EAAE,MAAM,mCAAmC,CAAA;AACvF,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,EAAoB,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAkB,MAAM,yBAAyB,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EAAE,cAAc,E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CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE;YACjD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAA;YACpD,OAAM;SACP;QAED,KAAK,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE;YAC5C,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;aACC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA,CAAC,CAAC,CAAC,CAAA;IAC1C,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAmD,OAAyB;IAChH,OAAO,CAAC,MAAM,KAAK,MAAM,mBAAmB,EAAE,CAAA;IAE9C,OAAO,IAAI,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;AAChD,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/peer-routing.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/peer-routing.d.ts deleted file mode 100644 index c24dc1bb8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/peer-routing.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { AbortOptions } from '@libp2p/interface'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerInfo } from '@libp2p/interface/peer-info'; -import type { PeerRouting } from '@libp2p/interface/peer-routing'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { ComponentLogger } from '@libp2p/logger'; -export interface PeerRoutingInit { - routers?: PeerRouting[]; -} -export interface DefaultPeerRoutingComponents { - peerId: PeerId; - peerStore: PeerStore; - logger: ComponentLogger; -} -export declare class DefaultPeerRouting implements PeerRouting { - private readonly log; - private readonly peerId; - private readonly peerStore; - private readonly routers; - constructor(components: DefaultPeerRoutingComponents, init: PeerRoutingInit); - /** - * Iterates over all peer routers in parallel to find the given peer - */ - findPeer(id: PeerId, options?: AbortOptions): Promise; - /** - * Attempt to find the closest peers on the network to the given key - */ - getClosestPeers(key: Uint8Array, options?: AbortOptions): AsyncIterable; -} -//# sourceMappingURL=peer-routing.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/peer-routing.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/peer-routing.d.ts.map deleted file mode 100644 index 4f11ac2b3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/peer-routing.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-routing.d.ts","sourceRoot":"","sources":["../../src/peer-routing.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAU,MAAM,mBAAmB,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,WAAW,EAAE,CAAA;CACxB;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,eAAe,CAAA;CACxB;AAED,qBAAa,kBAAmB,YAAW,WAAW;IACpD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;gBAE1B,UAAU,EAAE,4BAA4B,EAAE,IAAI,EAAE,eAAe;IAO5E;;OAEG;IACG,QAAQ,CAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC;IAiCtE;;OAEG;IACK,eAAe,CAAE,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC;CAc3F"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/peer-routing.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/peer-routing.js deleted file mode 100644 index 658dc5529..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/peer-routing.js +++ /dev/null @@ -1,53 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import filter from 'it-filter'; -import first from 'it-first'; -import merge from 'it-merge'; -import { pipe } from 'it-pipe'; -import { storeAddresses, uniquePeers, requirePeers } from './content-routing/utils.js'; -import { codes, messages } from './errors.js'; -export class DefaultPeerRouting { - log; - peerId; - peerStore; - routers; - constructor(components, init) { - this.log = components.logger.forComponent('libp2p:peer-routing'); - this.peerId = components.peerId; - this.peerStore = components.peerStore; - this.routers = init.routers ?? []; - } - /** - * Iterates over all peer routers in parallel to find the given peer - */ - async findPeer(id, options) { - if (this.routers.length === 0) { - throw new CodeError('No peer routers available', codes.ERR_NO_ROUTERS_AVAILABLE); - } - if (id.toString() === this.peerId.toString()) { - throw new CodeError('Should not try to find self', codes.ERR_FIND_SELF); - } - const self = this; - const output = await pipe(merge(...this.routers.map(router => (async function* () { - try { - yield await router.findPeer(id, options); - } - catch (err) { - self.log.error(err); - } - })())), (source) => filter(source, Boolean), (source) => storeAddresses(source, this.peerStore), async (source) => first(source)); - if (output != null) { - return output; - } - throw new CodeError(messages.NOT_FOUND, codes.ERR_NOT_FOUND); - } - /** - * Attempt to find the closest peers on the network to the given key - */ - async *getClosestPeers(key, options) { - if (this.routers.length === 0) { - throw new CodeError('No peer routers available', codes.ERR_NO_ROUTERS_AVAILABLE); - } - yield* pipe(merge(...this.routers.map(router => router.getClosestPeers(key, options))), (source) => storeAddresses(source, this.peerStore), (source) => uniquePeers(source), (source) => requirePeers(source)); - } -} -//# sourceMappingURL=peer-routing.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/peer-routing.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/peer-routing.js.map deleted file mode 100644 index 8e8e8ba14..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/peer-routing.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-routing.js","sourceRoot":"","sources":["../../src/peer-routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EACL,cAAc,EACd,WAAW,EACX,YAAY,EACb,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAkB7C,MAAM,OAAO,kBAAkB;IACZ,GAAG,CAAQ;IACX,MAAM,CAAQ;IACd,SAAS,CAAW;IACpB,O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,SAAS,CAAC,EAClD,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAChC,CAAA;QAED,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,OAAO,MAAM,CAAA;SACd;QAED,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;IAC9D,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,CAAE,eAAe,CAAE,GAAe,EAAE,OAAsB;QAC9D,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;YAC7B,MAAM,IAAI,SAAS,CAAC,2BAA2B,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAA;SACjF;QAED,KAAM,CAAC,CAAC,IAAI,CACV,KAAK,CACH,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CACpE,EACD,CAAC,MAAM,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EAClD,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,EAC/B,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CACjC,CAAA;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/registrar.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/registrar.d.ts deleted file mode 100644 index 82e0d7d91..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/registrar.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { IdentifyResult, Libp2pEvents, PeerUpdate } from '@libp2p/interface'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Topology } from '@libp2p/interface/topology'; -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'; -import type { StreamHandlerOptions, StreamHandlerRecord, Registrar, StreamHandler } from '@libp2p/interface-internal/registrar'; -import type { ComponentLogger } from '@libp2p/logger'; -export declare const DEFAULT_MAX_INBOUND_STREAMS = 32; -export declare const DEFAULT_MAX_OUTBOUND_STREAMS = 64; -export interface RegistrarComponents { - peerId: PeerId; - connectionManager: ConnectionManager; - peerStore: PeerStore; - events: TypedEventTarget; - logger: ComponentLogger; -} -/** - * Responsible for notifying registered protocols of events in the network. - */ -export declare class DefaultRegistrar implements Registrar { - private readonly log; - private readonly topologies; - private readonly handlers; - private readonly components; - constructor(components: RegistrarComponents); - getProtocols(): string[]; - getHandler(protocol: string): StreamHandlerRecord; - getTopologies(protocol: string): Topology[]; - /** - * Registers the `handler` for each protocol - */ - handle(protocol: string, handler: StreamHandler, opts?: StreamHandlerOptions): Promise; - /** - * Removes the handler for each protocol. The protocol - * will no longer be supported on streams. - */ - unhandle(protocols: string | string[]): Promise; - /** - * Register handlers for a set of multicodecs given - */ - register(protocol: string, topology: Topology): Promise; - /** - * Unregister topology - */ - unregister(id: string): void; - /** - * Remove a disconnected peer from the record - */ - _onDisconnect(evt: CustomEvent): void; - /** - * When a peer is updated, if they have removed supported protocols notify any - * topologies interested in the removed protocols. - */ - _onPeerUpdate(evt: CustomEvent): void; - /** - * After identify has completed and we have received the list of supported - * protocols, notify any topologies interested in those protocols. - */ - _onPeerIdentify(evt: CustomEvent): void; -} -//# sourceMappingURL=registrar.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/registrar.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/registrar.d.ts.map deleted file mode 100644 index 3b9a68032..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/registrar.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registrar.d.ts","sourceRoot":"","sources":["../../src/registrar.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAU,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAA;AACtF,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAA;AAC/H,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD,eAAO,MAAM,2BAA2B,KAAK,CAAA;AAC7C,eAAO,MAAM,4BAA4B,KAAK,CAAA;AAE9C,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAA;IACtC,MAAM,EAAE,eAAe,CAAA;CACxB;AAED;;GAEG;AACH,qBAAa,gBAAiB,YAAW,SAAS;IAChD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoC;IAC/D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;IAC3D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAqB;gBAEnC,UAAU,EAAE,mBAAmB;IAe5C,YAAY,IAAK,MAAM,EAAE;IAMzB,UAAU,CAAE,QAAQ,EAAE,MAAM,GAAG,mBAAmB;IAUlD,aAAa,CAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE;IAY5C;;OAEG;IACG,MAAM,CAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBnG;;;OAGG;IACG,QAAQ,CAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAa5D;;OAEG;IACG,QAAQ,CAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAoBtE;;OAEG;IACH,UAAU,CAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAY7B;;OAEG;IACH,aAAa,CAAE,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI;IA4B9C;;;OAGG;IACH,aAAa,CAAE,GAAG,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,IAAI;IAkBlD;;;OAGG;IACH,eAAe,CAAE,GAAG,EAAE,WAAW,CAAC,cAAc,CAAC,GAAG,IAAI;CAsBzD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/registrar.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/registrar.js deleted file mode 100644 index 3b63bfb9c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/registrar.js +++ /dev/null @@ -1,178 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import merge from 'merge-options'; -import { codes } from './errors.js'; -export const DEFAULT_MAX_INBOUND_STREAMS = 32; -export const DEFAULT_MAX_OUTBOUND_STREAMS = 64; -/** - * Responsible for notifying registered protocols of events in the network. - */ -export class DefaultRegistrar { - log; - topologies; - handlers; - components; - constructor(components) { - this.log = components.logger.forComponent('libp2p:registrar'); - this.topologies = new Map(); - this.handlers = new Map(); - this.components = components; - this._onDisconnect = this._onDisconnect.bind(this); - this._onPeerUpdate = this._onPeerUpdate.bind(this); - this._onPeerIdentify = this._onPeerIdentify.bind(this); - this.components.events.addEventListener('peer:disconnect', this._onDisconnect); - this.components.events.addEventListener('peer:update', this._onPeerUpdate); - this.components.events.addEventListener('peer:identify', this._onPeerIdentify); - } - getProtocols() { - return Array.from(new Set([ - ...this.handlers.keys() - ])).sort(); - } - getHandler(protocol) { - const handler = this.handlers.get(protocol); - if (handler == null) { - throw new CodeError(`No handler registered for protocol ${protocol}`, codes.ERR_NO_HANDLER_FOR_PROTOCOL); - } - return handler; - } - getTopologies(protocol) { - const topologies = this.topologies.get(protocol); - if (topologies == null) { - return []; - } - return [ - ...topologies.values() - ]; - } - /** - * Registers the `handler` for each protocol - */ - async handle(protocol, handler, opts) { - if (this.handlers.has(protocol)) { - throw new CodeError(`Handler already registered for protocol ${protocol}`, codes.ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED); - } - const options = merge.bind({ ignoreUndefined: true })({ - maxInboundStreams: DEFAULT_MAX_INBOUND_STREAMS, - maxOutboundStreams: DEFAULT_MAX_OUTBOUND_STREAMS - }, opts); - this.handlers.set(protocol, { - handler, - options - }); - // Add new protocol to self protocols in the peer store - await this.components.peerStore.merge(this.components.peerId, { - protocols: [protocol] - }); - } - /** - * Removes the handler for each protocol. The protocol - * will no longer be supported on streams. - */ - async unhandle(protocols) { - const protocolList = Array.isArray(protocols) ? protocols : [protocols]; - protocolList.forEach(protocol => { - this.handlers.delete(protocol); - }); - // Update self protocols in the peer store - await this.components.peerStore.patch(this.components.peerId, { - protocols: this.getProtocols() - }); - } - /** - * Register handlers for a set of multicodecs given - */ - async register(protocol, topology) { - if (topology == null) { - throw new CodeError('invalid topology', codes.ERR_INVALID_PARAMETERS); - } - // Create topology - const id = `${(Math.random() * 1e9).toString(36)}${Date.now()}`; - let topologies = this.topologies.get(protocol); - if (topologies == null) { - topologies = new Map(); - this.topologies.set(protocol, topologies); - } - topologies.set(id, topology); - return id; - } - /** - * Unregister topology - */ - unregister(id) { - for (const [protocol, topologies] of this.topologies.entries()) { - if (topologies.has(id)) { - topologies.delete(id); - if (topologies.size === 0) { - this.topologies.delete(protocol); - } - } - } - } - /** - * Remove a disconnected peer from the record - */ - _onDisconnect(evt) { - const remotePeer = evt.detail; - void this.components.peerStore.get(remotePeer) - .then(peer => { - for (const protocol of peer.protocols) { - const topologies = this.topologies.get(protocol); - if (topologies == null) { - // no topologies are interested in this protocol - continue; - } - for (const topology of topologies.values()) { - topology.onDisconnect?.(remotePeer); - } - } - }) - .catch(err => { - if (err.code === codes.ERR_NOT_FOUND) { - // peer has not completed identify so they are not in the peer store - return; - } - this.log.error('could not inform topologies of disconnecting peer %p', remotePeer, err); - }); - } - /** - * When a peer is updated, if they have removed supported protocols notify any - * topologies interested in the removed protocols. - */ - _onPeerUpdate(evt) { - const { peer, previous } = evt.detail; - const removed = (previous?.protocols ?? []).filter(protocol => !peer.protocols.includes(protocol)); - for (const protocol of removed) { - const topologies = this.topologies.get(protocol); - if (topologies == null) { - // no topologies are interested in this protocol - continue; - } - for (const topology of topologies.values()) { - topology.onDisconnect?.(peer.id); - } - } - } - /** - * After identify has completed and we have received the list of supported - * protocols, notify any topologies interested in those protocols. - */ - _onPeerIdentify(evt) { - const protocols = evt.detail.protocols; - const connection = evt.detail.connection; - const peerId = evt.detail.peerId; - for (const protocol of protocols) { - const topologies = this.topologies.get(protocol); - if (topologies == null) { - // no topologies are interested in this protocol - continue; - } - for (const topology of topologies.values()) { - if (connection.transient && topology.notifyOnTransient !== true) { - continue; - } - topology.onConnect?.(peerId, connection); - } - } - } -} -//# sourceMappingURL=registrar.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/registrar.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/registrar.js.map deleted file mode 100644 index 77af8c611..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/registrar.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registrar.js","sourceRoot":"","sources":["../../src/registrar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,MAAM,eAAe,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAUnC,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAA;AAC7C,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAA;AAU9C;;GAEG;AACH,MAAM,OAAO,gBAAgB;IACV,GAAG,CAAQ;IACX,UAAU,CAAoC;IAC9C,QAAQ,CAAkC;IAC1C,UAAU,CAAqB;IAEhD,YAAa,UAA+B;QAC1C,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAA;QAC7D,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAA;QAC3B,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAA;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAEtD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,IAAI,CAAC,aAA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,QAAQ,CAAC,CAAA;YAEhD,IAAI,UAAU,IAAI,IAAI,EAAE;gBACtB,gDAAgD;gBAChD,SAAQ;aACT;YAED,KAAK,MAAM,QAAQ,IAAI,UAAU,CAAC,MAAM,EAAE,EAAE;gBAC1C,IAAI,UAAU,CAAC,SAAS,IAAI,QAAQ,CAAC,iBAAiB,KAAK,IAAI,EAAE;oBAC/D,SAAQ;iBACT;gBAED,QAAQ,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;aACzC;SACF;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/transport-manager.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/transport-manager.d.ts deleted file mode 100644 index 3cd9dc77c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/transport-manager.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { FaultTolerance } from '@libp2p/interface/transport'; -import type { Libp2pEvents, AbortOptions, ComponentLogger } from '@libp2p/interface'; -import type { Connection } from '@libp2p/interface/connection'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { Startable } from '@libp2p/interface/startable'; -import type { Listener, Transport, Upgrader } from '@libp2p/interface/transport'; -import type { AddressManager } from '@libp2p/interface-internal/address-manager'; -import type { TransportManager } from '@libp2p/interface-internal/transport-manager'; -import type { Multiaddr } from '@multiformats/multiaddr'; -export interface TransportManagerInit { - faultTolerance?: FaultTolerance; -} -export interface DefaultTransportManagerComponents { - metrics?: Metrics; - addressManager: AddressManager; - upgrader: Upgrader; - events: TypedEventTarget; - logger: ComponentLogger; -} -export declare class DefaultTransportManager implements TransportManager, Startable { - private readonly log; - private readonly components; - private readonly transports; - private readonly listeners; - private readonly faultTolerance; - private started; - constructor(components: DefaultTransportManagerComponents, init?: TransportManagerInit); - /** - * Adds a `Transport` to the manager - */ - add(transport: Transport): void; - isStarted(): boolean; - start(): void; - afterStart(): Promise; - /** - * Stops all listeners - */ - stop(): Promise; - /** - * Dials the given Multiaddr over it's supported transport - */ - dial(ma: Multiaddr, options?: AbortOptions): Promise; - /** - * Returns all Multiaddr's the listeners are using - */ - getAddrs(): Multiaddr[]; - /** - * Returns all the transports instances - */ - getTransports(): Transport[]; - /** - * Returns all the listener instances - */ - getListeners(): Listener[]; - /** - * Finds a transport that matches the given Multiaddr - */ - transportForMultiaddr(ma: Multiaddr): Transport | undefined; - /** - * Starts listeners for each listen Multiaddr - */ - listen(addrs: Multiaddr[]): Promise; - /** - * Removes the given transport from the manager. - * If a transport has any running listeners, they will be closed. - */ - remove(key: string): Promise; - /** - * Removes all transports from the manager. - * If any listeners are running, they will be closed. - * - * @async - */ - removeAll(): Promise; -} -//# sourceMappingURL=transport-manager.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/transport-manager.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/transport-manager.d.ts.map deleted file mode 100644 index 889428202..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/transport-manager.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.d.ts","sourceRoot":"","sources":["../../src/transport-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAE5D,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAU,MAAM,mBAAmB,CAAA;AAC5F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM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,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC;IAqBvE;;OAEG;IACH,QAAQ,IAAK,SAAS,EAAE;IAUxB;;OAEG;IACH,aAAa,IAAK,SAAS,EAAE;IAI7B;;OAEG;IACH,YAAY,IAAK,QAAQ,EAAE;IAI3B;;OAEG;IACH,qBAAqB,CAAE,EAAE,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS;IAU5D;;OAEG;IACG,MAAM,CAAE,KAAK,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAiFhD;;;OAGG;IACG,MAAM,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBzC;;;;;OAKG;IACG,SAAS,IAAK,OAAO,CAAC,IAAI,CAAC;CAQlC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/transport-manager.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/transport-manager.js deleted file mode 100644 index df34f9baa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/transport-manager.js +++ /dev/null @@ -1,233 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { trackedMap } from '@libp2p/interface/metrics/tracked-map'; -import { FaultTolerance } from '@libp2p/interface/transport'; -import { codes } from './errors.js'; -export class DefaultTransportManager { - log; - components; - transports; - listeners; - faultTolerance; - started; - constructor(components, init = {}) { - this.log = components.logger.forComponent('libp2p:transports'); - this.components = components; - this.started = false; - this.transports = new Map(); - this.listeners = trackedMap({ - name: 'libp2p_transport_manager_listeners', - metrics: this.components.metrics - }); - this.faultTolerance = init.faultTolerance ?? FaultTolerance.FATAL_ALL; - } - /** - * Adds a `Transport` to the manager - */ - add(transport) { - const tag = transport[Symbol.toStringTag]; - if (tag == null) { - throw new CodeError('Transport must have a valid tag', codes.ERR_INVALID_KEY); - } - if (this.transports.has(tag)) { - throw new CodeError(`There is already a transport with the tag ${tag}`, codes.ERR_DUPLICATE_TRANSPORT); - } - this.log('adding transport %s', tag); - this.transports.set(tag, transport); - if (!this.listeners.has(tag)) { - this.listeners.set(tag, []); - } - } - isStarted() { - return this.started; - } - start() { - this.started = true; - } - async afterStart() { - // Listen on the provided transports for the provided addresses - const addrs = this.components.addressManager.getListenAddrs(); - await this.listen(addrs); - } - /** - * Stops all listeners - */ - async stop() { - const tasks = []; - for (const [key, listeners] of this.listeners) { - this.log('closing listeners for %s', key); - while (listeners.length > 0) { - const listener = listeners.pop(); - if (listener == null) { - continue; - } - tasks.push(listener.close()); - } - } - await Promise.all(tasks); - this.log('all listeners closed'); - for (const key of this.listeners.keys()) { - this.listeners.set(key, []); - } - this.started = false; - } - /** - * Dials the given Multiaddr over it's supported transport - */ - async dial(ma, options) { - const transport = this.transportForMultiaddr(ma); - if (transport == null) { - throw new CodeError(`No transport available for address ${String(ma)}`, codes.ERR_TRANSPORT_UNAVAILABLE); - } - try { - return await transport.dial(ma, { - ...options, - upgrader: this.components.upgrader - }); - } - catch (err) { - if (err.code == null) { - err.code = codes.ERR_TRANSPORT_DIAL_FAILED; - } - throw err; - } - } - /** - * Returns all Multiaddr's the listeners are using - */ - getAddrs() { - let addrs = []; - for (const listeners of this.listeners.values()) { - for (const listener of listeners) { - addrs = [...addrs, ...listener.getAddrs()]; - } - } - return addrs; - } - /** - * Returns all the transports instances - */ - getTransports() { - return Array.of(...this.transports.values()); - } - /** - * Returns all the listener instances - */ - getListeners() { - return Array.of(...this.listeners.values()).flat(); - } - /** - * Finds a transport that matches the given Multiaddr - */ - transportForMultiaddr(ma) { - for (const transport of this.transports.values()) { - const addrs = transport.filter([ma]); - if (addrs.length > 0) { - return transport; - } - } - } - /** - * Starts listeners for each listen Multiaddr - */ - async listen(addrs) { - if (!this.isStarted()) { - throw new CodeError('Not started', codes.ERR_NODE_NOT_STARTED); - } - if (addrs == null || addrs.length === 0) { - this.log('no addresses were provided for listening, this node is dial only'); - return; - } - const couldNotListen = []; - for (const [key, transport] of this.transports.entries()) { - const supportedAddrs = transport.filter(addrs); - const tasks = []; - // For each supported multiaddr, create a listener - for (const addr of supportedAddrs) { - this.log('creating listener for %s on %a', key, addr); - const listener = transport.createListener({ - upgrader: this.components.upgrader - }); - let listeners = this.listeners.get(key) ?? []; - if (listeners == null) { - listeners = []; - this.listeners.set(key, listeners); - } - listeners.push(listener); - // Track listen/close events - listener.addEventListener('listening', () => { - this.components.events.safeDispatchEvent('transport:listening', { - detail: listener - }); - }); - listener.addEventListener('close', () => { - const index = listeners.findIndex(l => l === listener); - // remove the listener - listeners.splice(index, 1); - this.components.events.safeDispatchEvent('transport:close', { - detail: listener - }); - }); - // We need to attempt to listen on everything - tasks.push(listener.listen(addr)); - } - // Keep track of transports we had no addresses for - if (tasks.length === 0) { - couldNotListen.push(key); - continue; - } - const results = await Promise.allSettled(tasks); - // If we are listening on at least 1 address, succeed. - // TODO: we should look at adding a retry (`p-retry`) here to better support - // listening on remote addresses as they may be offline. We could then potentially - // just wait for any (`p-any`) listener to succeed on each transport before returning - const isListening = results.find(r => r.status === 'fulfilled'); - if ((isListening == null) && this.faultTolerance !== FaultTolerance.NO_FATAL) { - throw new CodeError(`Transport (${key}) could not listen on any available address`, codes.ERR_NO_VALID_ADDRESSES); - } - } - // If no transports were able to listen, throw an error. This likely - // means we were given addresses we do not have transports for - if (couldNotListen.length === this.transports.size) { - const message = `no valid addresses were provided for transports [${couldNotListen.join(', ')}]`; - if (this.faultTolerance === FaultTolerance.FATAL_ALL) { - throw new CodeError(message, codes.ERR_NO_VALID_ADDRESSES); - } - this.log(`libp2p in dial mode only: ${message}`); - } - } - /** - * Removes the given transport from the manager. - * If a transport has any running listeners, they will be closed. - */ - async remove(key) { - const listeners = this.listeners.get(key) ?? []; - this.log.trace('removing transport %s', key); - // Close any running listeners - const tasks = []; - this.log.trace('closing listeners for %s', key); - while (listeners.length > 0) { - const listener = listeners.pop(); - if (listener == null) { - continue; - } - tasks.push(listener.close()); - } - await Promise.all(tasks); - this.transports.delete(key); - this.listeners.delete(key); - } - /** - * Removes all transports from the manager. - * If any listeners are running, they will be closed. - * - * @async - */ - async removeAll() { - const tasks = []; - for (const key of this.transports.keys()) { - tasks.push(this.remove(key)); - } - await Promise.all(tasks); - } -} -//# sourceMappingURL=transport-manager.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/transport-manager.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/transport-manager.js.map deleted file mode 100644 index eda3a9904..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/transport-manager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.js","sourceRoot":"","sources":["../../src/transport-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAuBnC,MAAM,OAAO,uBAAuB;IACjB,GAAG,CAAQ;IACX,UAAU,CAAmC;IAC7C,UAAU,CAAwB;IAClC,SAAS,CAAyB;IAClC,cAAc,CAAgB;IACvC,OAAO,CAAS;IAExB,YAAa,UAA6C,EAAE,OAA6B,EAAE;QACzF,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAA;QAC9D,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACpB,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAqB,CAAA;QAC9C,IAAI,CAAC,SAAS,GAAG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1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/upgrader.d.ts deleted file mode 100644 index 5e75c1f1b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/upgrader.d.ts +++ /dev/null @@ -1,103 +0,0 @@ -import type { Libp2pEvents, ComponentLogger } from '@libp2p/interface'; -import type { MultiaddrConnection, Connection, Stream, ConnectionProtector } from '@libp2p/interface/connection'; -import type { ConnectionEncrypter, SecuredConnection } from '@libp2p/interface/connection-encrypter'; -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { StreamMuxerFactory } from '@libp2p/interface/stream-muxer'; -import type { Upgrader, UpgraderOptions } from '@libp2p/interface/transport'; -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'; -import type { Registrar } from '@libp2p/interface-internal/registrar'; -interface CreateConnectionOptions { - cryptoProtocol: string; - direction: 'inbound' | 'outbound'; - maConn: MultiaddrConnection; - upgradedConn: MultiaddrConnection; - remotePeer: PeerId; - muxerFactory?: StreamMuxerFactory; - transient?: boolean; -} -interface OnStreamOptions { - connection: Connection; - stream: Stream; - protocol: string; -} -export interface CryptoResult extends SecuredConnection { - protocol: string; -} -export interface UpgraderInit { - connectionEncryption: ConnectionEncrypter[]; - muxers: StreamMuxerFactory[]; - /** - * An amount of ms by which an inbound connection upgrade - * must complete - */ - inboundUpgradeTimeout?: number; -} -export interface DefaultUpgraderComponents { - peerId: PeerId; - metrics?: Metrics; - connectionManager: ConnectionManager; - connectionGater: ConnectionGater; - connectionProtector?: ConnectionProtector; - registrar: Registrar; - peerStore: PeerStore; - events: TypedEventTarget; - logger: ComponentLogger; -} -type ConnectionDeniedType = keyof Pick; -export declare class DefaultUpgrader implements Upgrader { - private readonly components; - private readonly connectionEncryption; - private readonly muxers; - private readonly inboundUpgradeTimeout; - private readonly events; - private readonly log; - constructor(components: DefaultUpgraderComponents, init: UpgraderInit); - shouldBlockConnection(remotePeer: PeerId, maConn: MultiaddrConnection, connectionType: ConnectionDeniedType): Promise; - /** - * Upgrades an inbound connection - */ - upgradeInbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise; - /** - * Upgrades an outbound connection - */ - upgradeOutbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise; - /** - * A convenience method for generating a new `Connection` - */ - _createConnection(opts: CreateConnectionOptions): Connection; - /** - * Routes incoming streams to the correct handler - */ - _onStream(opts: OnStreamOptions): void; - /** - * Attempts to encrypt the incoming `connection` with the provided `cryptos` - */ - _encryptInbound(connection: MultiaddrConnection): Promise; - /** - * Attempts to encrypt the given `connection` with the provided connection encrypters. - * The first `ConnectionEncrypter` module to succeed will be used - */ - _encryptOutbound(connection: MultiaddrConnection, remotePeerId?: PeerId): Promise; - /** - * Selects one of the given muxers via multistream-select. That - * muxer will be used for all future streams on the connection. - */ - _multiplexOutbound(connection: MultiaddrConnection, muxers: Map): Promise<{ - stream: MultiaddrConnection; - muxerFactory?: StreamMuxerFactory; - }>; - /** - * Registers support for one of the given muxers via multistream-select. The - * selected muxer will be used for all future streams on the connection. - */ - _multiplexInbound(connection: MultiaddrConnection, muxers: Map): Promise<{ - stream: MultiaddrConnection; - muxerFactory?: StreamMuxerFactory; - }>; -} -export {}; -//# sourceMappingURL=upgrader.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/upgrader.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/upgrader.d.ts.map deleted file mode 100644 index f6e57a5ce..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/upgrader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"upgrader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AAE,MAAM,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC;IA8G/F;;OAEG;IACG,eAAe,CAAE,MAAM,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC;IA2FhG;;OAEG;IACH,iBAAiB,CAAE,IAAI,EAAE,uBAAuB,GAAG,UAAU;IAqQ7D;;OAEG;IACH,SAAS,CAAE,IAAI,EAAE,eAAe,GAAG,IAAI;IAWvC;;OAEG;IACG,eAAe,CAAE,UAAU,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC;IAyB9E;;;OAGG;IACG,gBAAgB,CAAE,UAAU,EAAE,mBAAmB,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAgCtG;;;OAGG;IACG,kBAAkB,CAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,mBAAmB,CAAC;QAAC,YAAY,CAAC,EAAE,kBAAkB,CAAA;KAAE,CAAC;IAwBhL;;;OAGG;IACG,iBAAiB,CAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,mBAAmB,CAAC;QAAC,YAAY,CAAC,EAAE,kBAAkB,CAAA;KAAE,CAAC;CAehL"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/upgrader.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/upgrader.js deleted file mode 100644 index abbd57a49..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/upgrader.js +++ /dev/null @@ -1,567 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { setMaxListeners } from '@libp2p/interface/events'; -import * as mss from '@libp2p/multistream-select'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { createConnection } from './connection/index.js'; -import { INBOUND_UPGRADE_TIMEOUT } from './connection-manager/constants.js'; -import { codes } from './errors.js'; -import { DEFAULT_MAX_INBOUND_STREAMS, DEFAULT_MAX_OUTBOUND_STREAMS } from './registrar.js'; -const ERR_TIMEOUT = 'ERR_TIMEOUT'; -const DEFAULT_PROTOCOL_SELECT_TIMEOUT = 30000; -function findIncomingStreamLimit(protocol, registrar) { - try { - const { options } = registrar.getHandler(protocol); - return options.maxInboundStreams; - } - catch (err) { - if (err.code !== codes.ERR_NO_HANDLER_FOR_PROTOCOL) { - throw err; - } - } - return DEFAULT_MAX_INBOUND_STREAMS; -} -function findOutgoingStreamLimit(protocol, registrar, options = {}) { - try { - const { options } = registrar.getHandler(protocol); - if (options.maxOutboundStreams != null) { - return options.maxOutboundStreams; - } - } - catch (err) { - if (err.code !== codes.ERR_NO_HANDLER_FOR_PROTOCOL) { - throw err; - } - } - return options.maxOutboundStreams ?? DEFAULT_MAX_OUTBOUND_STREAMS; -} -function countStreams(protocol, direction, connection) { - let streamCount = 0; - connection.streams.forEach(stream => { - if (stream.direction === direction && stream.protocol === protocol) { - streamCount++; - } - }); - return streamCount; -} -export class DefaultUpgrader { - components; - connectionEncryption; - muxers; - inboundUpgradeTimeout; - events; - log; - constructor(components, init) { - this.components = components; - this.connectionEncryption = new Map(); - this.log = components.logger.forComponent('libp2p:upgrader'); - init.connectionEncryption.forEach(encrypter => { - this.connectionEncryption.set(encrypter.protocol, encrypter); - }); - this.muxers = new Map(); - init.muxers.forEach(muxer => { - this.muxers.set(muxer.protocol, muxer); - }); - this.inboundUpgradeTimeout = init.inboundUpgradeTimeout ?? INBOUND_UPGRADE_TIMEOUT; - this.events = components.events; - } - async shouldBlockConnection(remotePeer, maConn, connectionType) { - const connectionGater = this.components.connectionGater[connectionType]; - if (connectionGater !== undefined) { - if (await connectionGater(remotePeer, maConn)) { - throw new CodeError(`The multiaddr connection is blocked by gater.${connectionType}`, codes.ERR_CONNECTION_INTERCEPTED); - } - } - } - /** - * Upgrades an inbound connection - */ - async upgradeInbound(maConn, opts) { - const accept = await this.components.connectionManager.acceptIncomingConnection(maConn); - if (!accept) { - throw new CodeError('connection denied', codes.ERR_CONNECTION_DENIED); - } - let encryptedConn; - let remotePeer; - let upgradedConn; - let muxerFactory; - let cryptoProtocol; - const signal = AbortSignal.timeout(this.inboundUpgradeTimeout); - const onAbort = () => { - maConn.abort(new CodeError('inbound upgrade timeout', ERR_TIMEOUT)); - }; - signal.addEventListener('abort', onAbort, { once: true }); - setMaxListeners(Infinity, signal); - try { - if ((await this.components.connectionGater.denyInboundConnection?.(maConn)) === true) { - throw new CodeError('The multiaddr connection is blocked by gater.acceptConnection', codes.ERR_CONNECTION_INTERCEPTED); - } - this.components.metrics?.trackMultiaddrConnection(maConn); - this.log('starting the inbound connection upgrade'); - // Protect - let protectedConn = maConn; - if (opts?.skipProtection !== true) { - const protector = this.components.connectionProtector; - if (protector != null) { - this.log('protecting the inbound connection'); - protectedConn = await protector.protect(maConn); - } - } - try { - // Encrypt the connection - encryptedConn = protectedConn; - if (opts?.skipEncryption !== true) { - ({ - conn: encryptedConn, - remotePeer, - protocol: cryptoProtocol - } = await this._encryptInbound(protectedConn)); - const maConn = { - ...protectedConn, - ...encryptedConn - }; - await this.shouldBlockConnection(remotePeer, maConn, 'denyInboundEncryptedConnection'); - } - else { - const idStr = maConn.remoteAddr.getPeerId(); - if (idStr == null) { - throw new CodeError('inbound connection that skipped encryption must have a peer id', codes.ERR_INVALID_MULTIADDR); - } - const remotePeerId = peerIdFromString(idStr); - cryptoProtocol = 'native'; - remotePeer = remotePeerId; - } - upgradedConn = encryptedConn; - if (opts?.muxerFactory != null) { - muxerFactory = opts.muxerFactory; - } - else if (this.muxers.size > 0) { - // Multiplex the connection - const multiplexed = await this._multiplexInbound({ - ...protectedConn, - ...encryptedConn - }, this.muxers); - muxerFactory = multiplexed.muxerFactory; - upgradedConn = multiplexed.stream; - } - } - catch (err) { - this.log.error('Failed to upgrade inbound connection', err); - throw err; - } - await this.shouldBlockConnection(remotePeer, maConn, 'denyInboundUpgradedConnection'); - this.log('successfully upgraded inbound connection'); - return this._createConnection({ - cryptoProtocol, - direction: 'inbound', - maConn, - upgradedConn, - muxerFactory, - remotePeer, - transient: opts?.transient - }); - } - finally { - signal.removeEventListener('abort', onAbort); - this.components.connectionManager.afterUpgradeInbound(); - } - } - /** - * Upgrades an outbound connection - */ - async upgradeOutbound(maConn, opts) { - const idStr = maConn.remoteAddr.getPeerId(); - let remotePeerId; - if (idStr != null) { - remotePeerId = peerIdFromString(idStr); - await this.shouldBlockConnection(remotePeerId, maConn, 'denyOutboundConnection'); - } - let encryptedConn; - let remotePeer; - let upgradedConn; - let cryptoProtocol; - let muxerFactory; - this.components.metrics?.trackMultiaddrConnection(maConn); - this.log('Starting the outbound connection upgrade'); - // If the transport natively supports encryption, skip connection - // protector and encryption - // Protect - let protectedConn = maConn; - if (opts?.skipProtection !== true) { - const protector = this.components.connectionProtector; - if (protector != null) { - protectedConn = await protector.protect(maConn); - } - } - try { - // Encrypt the connection - encryptedConn = protectedConn; - if (opts?.skipEncryption !== true) { - ({ - conn: encryptedConn, - remotePeer, - protocol: cryptoProtocol - } = await this._encryptOutbound(protectedConn, remotePeerId)); - const maConn = { - ...protectedConn, - ...encryptedConn - }; - await this.shouldBlockConnection(remotePeer, maConn, 'denyOutboundEncryptedConnection'); - } - else { - if (remotePeerId == null) { - throw new CodeError('Encryption was skipped but no peer id was passed', codes.ERR_INVALID_PEER); - } - cryptoProtocol = 'native'; - remotePeer = remotePeerId; - } - upgradedConn = encryptedConn; - if (opts?.muxerFactory != null) { - muxerFactory = opts.muxerFactory; - } - else if (this.muxers.size > 0) { - // Multiplex the connection - const multiplexed = await this._multiplexOutbound({ - ...protectedConn, - ...encryptedConn - }, this.muxers); - muxerFactory = multiplexed.muxerFactory; - upgradedConn = multiplexed.stream; - } - } - catch (err) { - this.log.error('Failed to upgrade outbound connection', err); - await maConn.close(err); - throw err; - } - await this.shouldBlockConnection(remotePeer, maConn, 'denyOutboundUpgradedConnection'); - this.log('Successfully upgraded outbound connection'); - return this._createConnection({ - cryptoProtocol, - direction: 'outbound', - maConn, - upgradedConn, - muxerFactory, - remotePeer, - transient: opts?.transient - }); - } - /** - * A convenience method for generating a new `Connection` - */ - _createConnection(opts) { - const { cryptoProtocol, direction, maConn, upgradedConn, remotePeer, muxerFactory, transient } = opts; - let muxer; - let newStream; - let connection; // eslint-disable-line prefer-const - if (muxerFactory != null) { - // Create the muxer - muxer = muxerFactory.createStreamMuxer({ - direction, - // Run anytime a remote stream is created - onIncomingStream: muxedStream => { - if (connection == null) { - return; - } - void Promise.resolve() - .then(async () => { - const protocols = this.components.registrar.getProtocols(); - const { stream, protocol } = await mss.handle(muxedStream, protocols, { - log: muxedStream.log, - yieldBytes: false - }); - if (connection == null) { - return; - } - connection.log('incoming stream opened on %s', protocol); - const incomingLimit = findIncomingStreamLimit(protocol, this.components.registrar); - const streamCount = countStreams(protocol, 'inbound', connection); - if (streamCount === incomingLimit) { - const err = new CodeError(`Too many inbound protocol streams for protocol "${protocol}" - limit ${incomingLimit}`, codes.ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS); - muxedStream.abort(err); - throw err; - } - // after the handshake the returned stream can have early data so override - // the souce/sink - muxedStream.source = stream.source; - muxedStream.sink = stream.sink; - muxedStream.protocol = protocol; - // allow closing the write end of a not-yet-negotiated stream - if (stream.closeWrite != null) { - muxedStream.closeWrite = stream.closeWrite; - } - // allow closing the read end of a not-yet-negotiated stream - if (stream.closeRead != null) { - muxedStream.closeRead = stream.closeRead; - } - // make sure we don't try to negotiate a stream we are closing - if (stream.close != null) { - muxedStream.close = stream.close; - } - // If a protocol stream has been successfully negotiated and is to be passed to the application, - // the peerstore should ensure that the peer is registered with that protocol - await this.components.peerStore.merge(remotePeer, { - protocols: [protocol] - }); - this.components.metrics?.trackProtocolStream(muxedStream, connection); - this._onStream({ connection, stream: muxedStream, protocol }); - }) - .catch(async (err) => { - this.log.error('error handling incoming stream id %s', muxedStream.id, err.message, err.code, err.stack); - if (muxedStream.timeline.close == null) { - await muxedStream.close(); - } - }); - } - }); - newStream = async (protocols, options = {}) => { - if (muxer == null) { - throw new CodeError('Stream is not multiplexed', codes.ERR_MUXER_UNAVAILABLE); - } - connection.log('starting new stream for protocols %s', protocols); - const muxedStream = await muxer.newStream(); - connection.log.trace('started new stream %s for protocols %s', muxedStream.id, protocols); - try { - if (options.signal == null) { - this.log('No abort signal was passed while trying to negotiate protocols %s falling back to default timeout', protocols); - const signal = AbortSignal.timeout(DEFAULT_PROTOCOL_SELECT_TIMEOUT); - setMaxListeners(Infinity, signal); - options = { - ...options, - signal - }; - } - muxedStream.log.trace('selecting protocol from protocols %s', protocols); - const { stream, protocol } = await mss.select(muxedStream, protocols, { - ...options, - log: muxedStream.log, - yieldBytes: true - }); - muxedStream.log('selected protocol %s', protocol); - const outgoingLimit = findOutgoingStreamLimit(protocol, this.components.registrar, options); - const streamCount = countStreams(protocol, 'outbound', connection); - if (streamCount >= outgoingLimit) { - const err = new CodeError(`Too many outbound protocol streams for protocol "${protocol}" - limit ${outgoingLimit}`, codes.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS); - muxedStream.abort(err); - throw err; - } - // If a protocol stream has been successfully negotiated and is to be passed to the application, - // the peerstore should ensure that the peer is registered with that protocol - await this.components.peerStore.merge(remotePeer, { - protocols: [protocol] - }); - // after the handshake the returned stream can have early data so override - // the souce/sink - muxedStream.source = stream.source; - muxedStream.sink = stream.sink; - muxedStream.protocol = protocol; - // allow closing the write end of a not-yet-negotiated stream - if (stream.closeWrite != null) { - muxedStream.closeWrite = stream.closeWrite; - } - // allow closing the read end of a not-yet-negotiated stream - if (stream.closeRead != null) { - muxedStream.closeRead = stream.closeRead; - } - // make sure we don't try to negotiate a stream we are closing - if (stream.close != null) { - muxedStream.close = stream.close; - } - this.components.metrics?.trackProtocolStream(muxedStream, connection); - return muxedStream; - } - catch (err) { - connection.log.error('could not create new stream for protocols %s', protocols, err); - if (muxedStream.timeline.close == null) { - muxedStream.abort(err); - } - if (err.code != null) { - throw err; - } - throw new CodeError(String(err), codes.ERR_UNSUPPORTED_PROTOCOL); - } - }; - // Pipe all data through the muxer - void Promise.all([ - muxer.sink(upgradedConn.source), - upgradedConn.sink(muxer.source) - ]).catch(err => { - this.log.error(err); - }); - } - const _timeline = maConn.timeline; - maConn.timeline = new Proxy(_timeline, { - set: (...args) => { - if (connection != null && args[1] === 'close' && args[2] != null && _timeline.close == null) { - // Wait for close to finish before notifying of the closure - (async () => { - try { - if (connection.status === 'open') { - await connection.close(); - } - } - catch (err) { - this.log.error(err); - } - finally { - this.events.safeDispatchEvent('connection:close', { - detail: connection - }); - } - })().catch(err => { - this.log.error(err); - }); - } - return Reflect.set(...args); - } - }); - maConn.timeline.upgraded = Date.now(); - const errConnectionNotMultiplexed = () => { - throw new CodeError('connection is not multiplexed', codes.ERR_CONNECTION_NOT_MULTIPLEXED); - }; - // Create the connection - connection = createConnection({ - remoteAddr: maConn.remoteAddr, - remotePeer, - status: 'open', - direction, - timeline: maConn.timeline, - multiplexer: muxer?.protocol, - encryption: cryptoProtocol, - transient, - logger: this.components.logger, - newStream: newStream ?? errConnectionNotMultiplexed, - getStreams: () => { if (muxer != null) { - return muxer.streams; - } - else { - return []; - } }, - close: async (options) => { - // Ensure remaining streams are closed gracefully - if (muxer != null) { - this.log.trace('close muxer'); - await muxer.close(options); - } - this.log.trace('close maconn'); - // close the underlying transport - await maConn.close(options); - this.log.trace('closed maconn'); - }, - abort: (err) => { - maConn.abort(err); - // Ensure remaining streams are aborted - if (muxer != null) { - muxer.abort(err); - } - } - }); - this.events.safeDispatchEvent('connection:open', { - detail: connection - }); - return connection; - } - /** - * Routes incoming streams to the correct handler - */ - _onStream(opts) { - const { connection, stream, protocol } = opts; - const { handler, options } = this.components.registrar.getHandler(protocol); - if (connection.transient && options.runOnTransientConnection !== true) { - throw new CodeError('Cannot open protocol stream on transient connection', 'ERR_TRANSIENT_CONNECTION'); - } - handler({ connection, stream }); - } - /** - * Attempts to encrypt the incoming `connection` with the provided `cryptos` - */ - async _encryptInbound(connection) { - const protocols = Array.from(this.connectionEncryption.keys()); - this.log('handling inbound crypto protocol selection', protocols); - try { - const { stream, protocol } = await mss.handle(connection, protocols, { - log: connection.log - }); - const encrypter = this.connectionEncryption.get(protocol); - if (encrypter == null) { - throw new Error(`no crypto module found for ${protocol}`); - } - this.log('encrypting inbound connection using', protocol); - return { - ...await encrypter.secureInbound(this.components.peerId, stream), - protocol - }; - } - catch (err) { - throw new CodeError(String(err), codes.ERR_ENCRYPTION_FAILED); - } - } - /** - * Attempts to encrypt the given `connection` with the provided connection encrypters. - * The first `ConnectionEncrypter` module to succeed will be used - */ - async _encryptOutbound(connection, remotePeerId) { - const protocols = Array.from(this.connectionEncryption.keys()); - this.log('selecting outbound crypto protocol', protocols); - try { - connection.log.trace('selecting encrypter from %s', protocols); - const { stream, protocol } = await mss.select(connection, protocols, { - log: connection.log, - yieldBytes: true - }); - const encrypter = this.connectionEncryption.get(protocol); - if (encrypter == null) { - throw new Error(`no crypto module found for ${protocol}`); - } - connection.log('encrypting outbound connection to %p using %p', remotePeerId); - return { - ...await encrypter.secureOutbound(this.components.peerId, stream, remotePeerId), - protocol - }; - } - catch (err) { - throw new CodeError(String(err), codes.ERR_ENCRYPTION_FAILED); - } - } - /** - * Selects one of the given muxers via multistream-select. That - * muxer will be used for all future streams on the connection. - */ - async _multiplexOutbound(connection, muxers) { - const protocols = Array.from(muxers.keys()); - this.log('outbound selecting muxer %s', protocols); - try { - connection.log.trace('selecting stream muxer from %s', protocols); - const { stream, protocol } = await mss.select(connection, protocols, { - log: connection.log, - yieldBytes: true - }); - connection.log('selected %s as muxer protocol', protocol); - const muxerFactory = muxers.get(protocol); - return { stream, muxerFactory }; - } - catch (err) { - connection.log.error('error multiplexing outbound stream', err); - throw new CodeError(String(err), codes.ERR_MUXER_UNAVAILABLE); - } - } - /** - * Registers support for one of the given muxers via multistream-select. The - * selected muxer will be used for all future streams on the connection. - */ - async _multiplexInbound(connection, muxers) { - const protocols = Array.from(muxers.keys()); - this.log('inbound handling muxers %s', protocols); - try { - const { stream, protocol } = await mss.handle(connection, protocols, { - log: connection.log - }); - const muxerFactory = muxers.get(protocol); - return { stream, muxerFactory }; - } - catch (err) { - this.log.error('error multiplexing inbound stream', err); - throw new CodeError(String(err), codes.ERR_MUXER_UNAVAILABLE); - } - } -} -//# sourceMappingURL=upgrader.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/upgrader.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/upgrader.js.map deleted file mode 100644 index 5228dfbd9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/upgrader.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"upgrader.js","sourceRoot":"","sources":["../../src/upgrader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,GAAG,MAAM,4BAA4B,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAA;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAc1F,MAAM,+B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AI,CAAC,GAAG,CAAC,4BAA4B,EAAE,SAAS,CAAC,CAAA;QACjD,IAAI;YACF,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,EAAE;gBACnE,GAAG,EAAE,UAAU,CAAC,GAAG;aACpB,CAAC,CAAA;YACF,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YAEzC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAA;SAChC;QAAC,OAAO,GAAQ,EAAE;YACjB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,mCAAmC,EAAE,GAAG,CAAC,CAAA;YACxD,MAAM,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAA;SAC9D;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/version.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/version.d.ts deleted file mode 100644 index d5e48250d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/version.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const version = "0.0.0"; -export declare const name = "libp2p"; -//# sourceMappingURL=version.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/version.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/version.d.ts.map deleted file mode 100644 index 42cde27b6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/version.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAA;AAC9B,eAAO,MAAM,IAAI,WAAW,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/version.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/version.js deleted file mode 100644 index b68fea07c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/version.js +++ /dev/null @@ -1,3 +0,0 @@ -export const version = '0.0.0'; -export const name = 'libp2p'; -//# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/version.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/version.js.map deleted file mode 100644 index 7a06ad10a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/src/version.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAA;AAC9B,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/address-manager.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/address-manager.spec.d.ts deleted file mode 100644 index 985b1d198..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/address-manager.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=address-manager.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/address-manager.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/address-manager.spec.d.ts.map deleted file mode 100644 index ac1f6fc23..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/address-manager.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address-manager.spec.d.ts","sourceRoot":"","sources":["../../../test/addresses/address-manager.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/address-manager.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/address-manager.spec.js deleted file mode 100644 index 4b06d2ddd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/address-manager.spec.js +++ /dev/null @@ -1,193 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { defaultLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import delay from 'delay'; -import Sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { DefaultAddressManager } from '../../src/address-manager/index.js'; -const listenAddresses = ['/ip4/127.0.0.1/tcp/15006/ws', '/ip4/127.0.0.1/tcp/15008/ws']; -const announceAddreses = ['/dns4/peer.io']; -describe('Address Manager', () => { - let peerId; - let peerStore; - let events; - beforeEach(async () => { - peerId = await createEd25519PeerId(); - peerStore = stubInterface({ - patch: Sinon.stub().resolves({}) - }); - events = new TypedEventEmitter(); - }); - it('should not need any addresses', () => { - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface() - }); - expect(am.getListenAddrs()).to.be.empty(); - expect(am.getAnnounceAddrs()).to.be.empty(); - }); - it('should return listen multiaddrs on get', () => { - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface(), - listen: listenAddresses - }); - expect(am.getListenAddrs()).to.have.lengthOf(listenAddresses.length); - expect(am.getAnnounceAddrs()).to.be.empty(); - const listenMultiaddrs = am.getListenAddrs(); - expect(listenMultiaddrs.length).to.equal(2); - expect(listenMultiaddrs[0].equals(multiaddr(listenAddresses[0]))).to.equal(true); - expect(listenMultiaddrs[1].equals(multiaddr(listenAddresses[1]))).to.equal(true); - }); - it('should return announce multiaddrs on get', () => { - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface(), - listen: listenAddresses, - announce: announceAddreses - }); - expect(am.getListenAddrs()).to.have.lengthOf(listenAddresses.length); - expect(am.getAnnounceAddrs()).to.have.lengthOf(announceAddreses.length); - const announceMultiaddrs = am.getAnnounceAddrs(); - expect(announceMultiaddrs.length).to.equal(1); - expect(announceMultiaddrs[0].equals(multiaddr(announceAddreses[0]))).to.equal(true); - }); - it('should add observed addresses', () => { - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface() - }); - expect(am.getObservedAddrs()).to.be.empty(); - am.addObservedAddr(multiaddr('/ip4/123.123.123.123/tcp/39201')); - expect(am.getObservedAddrs()).to.have.lengthOf(1); - }); - it('should allow duplicate listen addresses', () => { - const ma = multiaddr('/ip4/0.0.0.0/tcp/0'); - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface(), - listen: [ - ma.toString(), - ma.toString() - ] - }); - expect(am.getListenAddrs()).to.deep.equal([ - ma, - ma - ]); - }); - it('should dedupe added observed addresses', () => { - const ma = multiaddr('/ip4/123.123.123.123/tcp/39201'); - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface() - }); - expect(am.getObservedAddrs()).to.be.empty(); - am.addObservedAddr(ma); - am.addObservedAddr(ma); - am.addObservedAddr(ma); - expect(am.getObservedAddrs()).to.have.lengthOf(1); - expect(am.getObservedAddrs().map(ma => ma.toString())).to.include(ma.toString()); - }); - it('should only set addresses once', async () => { - const ma = '/ip4/123.123.123.123/tcp/39201'; - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface({ - getAddrs: Sinon.stub().returns([]) - }), - peerStore, - events, - logger: defaultLogger() - }); - am.confirmObservedAddr(multiaddr(ma)); - am.confirmObservedAddr(multiaddr(ma)); - am.confirmObservedAddr(multiaddr(ma)); - am.confirmObservedAddr(multiaddr(`${ma.toString()}/p2p/${peerId.toString()}`)); - // wait for address manager _updatePeerStoreAddresses debounce - await delay(1500); - expect(peerStore.patch).to.have.property('callCount', 1); - }); - it('should strip our peer address from added observed addresses', () => { - const ma = multiaddr('/ip4/123.123.123.123/tcp/39201'); - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }); - expect(am.getObservedAddrs()).to.be.empty(); - am.addObservedAddr(ma); - am.addObservedAddr(multiaddr(`${ma.toString()}/p2p/${peerId.toString()}`)); - expect(am.getObservedAddrs()).to.have.lengthOf(1); - expect(am.getObservedAddrs().map(ma => ma.toString())).to.include(ma.toString()); - }); - it('should strip our peer address from added observed addresses in difference formats', () => { - const ma = multiaddr('/ip4/123.123.123.123/tcp/39201'); - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }); - expect(am.getObservedAddrs()).to.be.empty(); - am.addObservedAddr(ma); - am.addObservedAddr(multiaddr(`${ma.toString()}/p2p/${peerId.toString()}`)); - expect(am.getObservedAddrs()).to.have.lengthOf(1); - expect(am.getObservedAddrs().map(ma => ma.toString())).to.include(ma.toString()); - }); - it('should not add our peer id to path multiaddrs', () => { - const ma = '/unix/foo/bar/baz'; - const transportManager = stubInterface(); - const am = new DefaultAddressManager({ - peerId, - transportManager, - peerStore, - events, - logger: defaultLogger() - }, { - listen: [ma], - announce: [] - }); - transportManager.getAddrs.returns([multiaddr(ma)]); - const addrs = am.getAddresses(); - expect(addrs).to.have.lengthOf(1); - expect(addrs[0].toString()).to.not.include(`/p2p/${peerId.toString()}`); - }); -}); -//# sourceMappingURL=address-manager.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/address-manager.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/address-manager.spec.js.map deleted file mode 100644 index af28232b9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/address-manager.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address-manager.spec.js","sourceRoot":"","sources":["../../../test/addresses/address-manager.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,iBAAiB,EAAyB,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAwB,aAAa,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAsB,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAM9F,MAAM,eAAe,GAAG,CAAC,6BAA6B,EAAE,6BA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AAA;IAEF,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,EAAE,GAAG,mBAAmB,CAAA;QAC9B,MAAM,gBAAgB,GAAG,aAAa,EAAoB,CAAA;QAC1D,MAAM,EAAE,GAAG,IAAI,qBAAqB,CAAC;YACnC,MAAM;YACN,gBAAgB;YAChB,SAAS;YACT,MAAM;YACN,MAAM,EAAE,aAAa,EAAE;SACxB,EAAE;YACD,MAAM,EAAE,CAAC,EAAE,CAAC;YACZ,QAAQ,EAAE,EAAE;SACb,CAAC,CAAA;QAEF,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;QAElD,MAAM,KAAK,GAAG,EAAE,CAAC,YAAY,EAAE,CAAA;QAC/B,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;QACjC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;IACzE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/addresses.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/addresses.node.d.ts deleted file mode 100644 index 8e88d60d9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/addresses.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=addresses.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/addresses.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/addresses.node.d.ts.map deleted file mode 100644 index de6ec2bd2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/addresses.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"addresses.node.d.ts","sourceRoot":"","sources":["../../../test/addresses/addresses.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/addresses.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/addresses.node.js deleted file mode 100644 index f263de103..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/addresses.node.js +++ /dev/null @@ -1,214 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { isLoopback } from '@libp2p/utils/multiaddr/is-loopback'; -import { webSockets } from '@libp2p/websockets'; -import { multiaddr, protocols } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { pEvent } from 'p-event'; -import sinon from 'sinon'; -import { createNode } from '../fixtures/creators/peer.js'; -import { AddressesOptions } from './utils.js'; -const listenAddresses = ['/ip4/127.0.0.1/tcp/0', '/ip4/127.0.0.1/tcp/8000/ws']; -const announceAddreses = ['/dns4/peer.io/tcp/433/p2p/12D3KooWNvSZnPi3RrhrTwEY4LuuBeB6K6facKUCJcyWG1aoDd2p']; -describe('libp2p.addressManager', () => { - let libp2p; - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('should keep listen addresses after start, even if changed', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses, - announce: announceAddreses - } - } - }); - let listenAddrs = libp2p.components.addressManager.getListenAddrs().map(ma => ma.toString()); - expect(listenAddrs).to.have.lengthOf(listenAddresses.length); - expect(listenAddrs).to.include(listenAddresses[0]); - expect(listenAddrs).to.include(listenAddresses[1]); - // Should not replace listen addresses after transport listen - // Only transportManager has visibility of the port used - await libp2p.start(); - listenAddrs = libp2p.components.addressManager.getListenAddrs().map(ma => ma.toString()); - expect(listenAddrs).to.have.lengthOf(listenAddresses.length); - expect(listenAddrs).to.include(listenAddresses[0]); - expect(listenAddrs).to.include(listenAddresses[1]); - }); - it('should announce transport listen addresses if announce addresses are not provided', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses - } - } - }); - await libp2p.start(); - const tmListen = libp2p.components.transportManager.getAddrs().map((ma) => ma.toString()); - // Announce 2 listen (transport) - const advertiseMultiaddrs = libp2p.components.addressManager.getAddresses().map((ma) => ma.decapsulateCode(protocols('p2p').code).toString()); - expect(advertiseMultiaddrs).to.have.lengthOf(2); - tmListen.forEach((m) => { - expect(advertiseMultiaddrs).to.include(m); - }); - expect(advertiseMultiaddrs).to.not.include(listenAddresses[0]); // Random Port switch - }); - it('should only announce the given announce addresses when provided', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses, - announce: announceAddreses - } - } - }); - await libp2p.start(); - const tmListen = libp2p.components.transportManager.getAddrs().map((ma) => ma.toString()); - // Announce 1 announce addr - const advertiseMultiaddrs = libp2p.components.addressManager.getAddresses().map((ma) => ma.decapsulateCode(protocols('p2p').code).toString()); - expect(advertiseMultiaddrs.length).to.equal(announceAddreses.length); - advertiseMultiaddrs.forEach((m) => { - expect(tmListen).to.not.include(m); - expect(announceAddreses).to.include(m); - }); - }); - it('can filter out loopback addresses by the announce filter', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses, - announceFilter: (multiaddrs) => multiaddrs.filter(m => !isLoopback(m)) - } - } - }); - await libp2p.start(); - expect(libp2p.components.addressManager.getAddresses()).to.have.lengthOf(0); - // Stub transportManager addresses to add a public address - const stubMa = multiaddr('/ip4/120.220.10.1/tcp/1000'); - sinon.stub(libp2p.components.transportManager, 'getAddrs').returns([ - ...listenAddresses.map((a) => multiaddr(a)), - stubMa - ]); - const multiaddrs = libp2p.components.addressManager.getAddresses(); - expect(multiaddrs.length).to.equal(1); - expect(multiaddrs[0].decapsulateCode(protocols('p2p').code).equals(stubMa)).to.eql(true); - }); - it('can filter out loopback addresses to announced by the announce filter', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses, - announce: announceAddreses, - announceFilter: (multiaddrs) => multiaddrs.filter(m => !isLoopback(m)) - } - } - }); - const listenAddrs = libp2p.components.addressManager.getListenAddrs().map((ma) => ma.toString()); - expect(listenAddrs).to.have.lengthOf(listenAddresses.length); - expect(listenAddrs).to.include(listenAddresses[0]); - expect(listenAddrs).to.include(listenAddresses[1]); - await libp2p.start(); - const loopbackAddrs = libp2p.components.addressManager.getAddresses().filter(ma => isLoopback(ma)); - expect(loopbackAddrs).to.be.empty(); - }); - it('should include observed addresses in returned multiaddrs', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses - } - } - }); - const ma = '/ip4/83.32.123.53/tcp/43928'; - await libp2p.start(); - expect(libp2p.components.addressManager.getAddresses()).to.have.lengthOf(listenAddresses.length); - libp2p.components.addressManager.confirmObservedAddr(multiaddr(ma)); - expect(libp2p.components.addressManager.getAddresses()).to.have.lengthOf(listenAddresses.length + 1); - expect(libp2p.components.addressManager.getAddresses().map(ma => ma.decapsulateCode(protocols('p2p').code).toString())).to.include(ma); - }); - it('should populate the AddressManager from the config', async () => { - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: listenAddresses, - announce: announceAddreses - }, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - } - }); - expect(libp2p.getMultiaddrs().map(ma => ma.decapsulateCode(protocols('p2p').code).toString())).to.have.members(announceAddreses); - expect(libp2p.getMultiaddrs().map(ma => ma.decapsulateCode(protocols('p2p').code).toString())).to.not.have.members(listenAddresses); - }); - it('should update our peer record with announce addresses on startup', async () => { - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: listenAddresses, - announce: announceAddreses - }, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - } - }); - const eventPromise = pEvent(libp2p, 'self:peer:update'); - await libp2p.start(); - const event = await eventPromise; - expect(event.detail.peer.addresses.map(({ multiaddr }) => multiaddr.toString())) - .to.include.members(announceAddreses, 'peer info did not include announce addresses'); - }); - it('should only include confirmed observed addresses in peer record', async () => { - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: listenAddresses, - announce: announceAddreses - }, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - } - }); - await libp2p.start(); - const eventPromise = pEvent(libp2p, 'self:peer:update'); - const unconfirmedAddress = multiaddr('/ip4/127.0.0.1/tcp/4010/ws'); - libp2p.components.addressManager.addObservedAddr(unconfirmedAddress); - const confirmedAddress = multiaddr('/ip4/127.0.0.1/tcp/4011/ws'); - libp2p.components.addressManager.confirmObservedAddr(confirmedAddress); - const event = await eventPromise; - expect(event.detail.peer.addresses.map(({ multiaddr }) => multiaddr.toString())) - .to.not.include(unconfirmedAddress.toString(), 'peer info included unconfirmed observed address'); - expect(event.detail.peer.addresses.map(({ multiaddr }) => multiaddr.toString())) - .to.include(confirmedAddress.toString(), 'peer info did not include confirmed observed address'); - }); -}); -//# sourceMappingURL=addresses.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/addresses.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/addresses.node.js.map deleted file mode 100644 index 7452a01a9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/addresses.node.js.map +++ /dev/null @@ -1 +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gBAAgB,CAAC,CAAA;QAEtE,MAAM,KAAK,GAAG,MAAM,YAAY,CAAA;QAEhC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;aAC7E,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,QAAQ,EAAE,EAAE,iDAAiD,CAAC,CAAA;QAEnG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;aAC7E,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,EAAE,sDAAsD,CAAC,CAAA;IACpG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/utils.d.ts deleted file mode 100644 index fe756c845..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/utils.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const AddressesOptions: import("../../src/index.js").Libp2pOptions>; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/utils.d.ts.map deleted file mode 100644 index 887bb9fda..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../test/addresses/utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,qEAK3B,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/utils.js deleted file mode 100644 index 5329e4337..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/utils.js +++ /dev/null @@ -1,10 +0,0 @@ -import { tcp } from '@libp2p/tcp'; -import { webSockets } from '@libp2p/websockets'; -import { createBaseOptions } from '../fixtures/base-options.js'; -export const AddressesOptions = createBaseOptions({ - transports: [ - tcp(), - webSockets() - ] -}); -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/utils.js.map deleted file mode 100644 index d4fc62356..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/addresses/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../test/addresses/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAE/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;IAChD,UAAU,EAAE;QACV,GAAG,EAAE;QACL,UAAU,EAAE;KACb;CACF,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts deleted file mode 100644 index ce6da4870..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=auto-dial.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts.map deleted file mode 100644 index fe1b08ef2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auto-dial.spec.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/auto-dial.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.js deleted file mode 100644 index 721a8f1c9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.js +++ /dev/null @@ -1,254 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { defaultLogger } from '@libp2p/logger'; -import { PeerMap } from '@libp2p/peer-collections'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core'; -import delay from 'delay'; -import pWaitFor from 'p-wait-for'; -import Sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { defaultComponents } from '../../src/components.js'; -import { AutoDial } from '../../src/connection-manager/auto-dial.js'; -import { LAST_DIAL_FAILURE_KEY } from '../../src/connection-manager/constants.js'; -import { matchPeerId } from '../fixtures/match-peer-id.js'; -describe('auto-dial', () => { - let autoDialer; - let events; - let peerStore; - let peerId; - beforeEach(async () => { - peerId = await createEd25519PeerId(); - events = new TypedEventEmitter(); - peerStore = new PersistentPeerStore({ - datastore: new MemoryDatastore(), - events, - peerId, - logger: defaultLogger() - }); - }); - afterEach(() => { - if (autoDialer != null) { - autoDialer.stop(); - } - }); - it('should not dial peers without multiaddrs', async () => { - // peers with protocols are dialled before peers without protocols - const peerWithAddress = { - id: await createEd25519PeerId(), - protocols: [ - '/foo/bar' - ], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - const peerWithoutAddress = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [], - metadata: new Map(), - tags: new Map() - }; - await peerStore.save(peerWithAddress.id, peerWithAddress); - await peerStore.save(peerWithoutAddress.id, peerWithoutAddress); - const connectionManager = stubInterface({ - getConnectionsMap: Sinon.stub().returns(new PeerMap()), - getDialQueue: Sinon.stub().returns([]) - }); - autoDialer = new AutoDial(defaultComponents({ - peerStore, - connectionManager, - events - }), { - minConnections: 10, - autoDialInterval: 10000 - }); - autoDialer.start(); - void autoDialer.autoDial(); - await pWaitFor(() => { - return connectionManager.openConnection.callCount === 1; - }); - await delay(1000); - expect(connectionManager.openConnection.callCount).to.equal(1); - expect(connectionManager.openConnection.calledWith(matchPeerId(peerWithAddress.id))).to.be.true(); - expect(connectionManager.openConnection.calledWith(matchPeerId(peerWithoutAddress.id))).to.be.false(); - }); - it('should not dial connected peers', async () => { - const connectedPeer = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - const unConnectedPeer = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4002'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - await peerStore.save(connectedPeer.id, connectedPeer); - await peerStore.save(unConnectedPeer.id, unConnectedPeer); - const connectionMap = new PeerMap(); - connectionMap.set(connectedPeer.id, [stubInterface()]); - const connectionManager = stubInterface({ - getConnectionsMap: Sinon.stub().returns(connectionMap), - getDialQueue: Sinon.stub().returns([]) - }); - autoDialer = new AutoDial(defaultComponents({ - peerStore, - connectionManager, - events - }), { - minConnections: 10 - }); - autoDialer.start(); - await autoDialer.autoDial(); - await pWaitFor(() => connectionManager.openConnection.callCount === 1); - await delay(1000); - expect(connectionManager.openConnection.callCount).to.equal(1); - expect(connectionManager.openConnection.calledWith(matchPeerId(unConnectedPeer.id))).to.be.true(); - expect(connectionManager.openConnection.calledWith(matchPeerId(connectedPeer.id))).to.be.false(); - }); - it('should not dial peers already in the dial queue', async () => { - // peers with protocols are dialled before peers without protocols - const peerInDialQueue = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - const peerNotInDialQueue = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4002'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - await peerStore.save(peerInDialQueue.id, peerInDialQueue); - await peerStore.save(peerNotInDialQueue.id, peerNotInDialQueue); - const connectionManager = stubInterface({ - getConnectionsMap: Sinon.stub().returns(new PeerMap()), - getDialQueue: Sinon.stub().returns([{ - id: 'foo', - peerId: peerInDialQueue.id, - multiaddrs: [], - status: 'queued' - }]) - }); - autoDialer = new AutoDial(defaultComponents({ - peerStore, - connectionManager, - events - }), { - minConnections: 10 - }); - autoDialer.start(); - await autoDialer.autoDial(); - await pWaitFor(() => connectionManager.openConnection.callCount === 1); - await delay(1000); - expect(connectionManager.openConnection.callCount).to.equal(1); - expect(connectionManager.openConnection.calledWith(matchPeerId(peerNotInDialQueue.id))).to.be.true(); - expect(connectionManager.openConnection.calledWith(matchPeerId(peerInDialQueue.id))).to.be.false(); - }); - it('should not start parallel autodials', async () => { - const peerStoreAllSpy = Sinon.spy(peerStore, 'all'); - const connectionManager = stubInterface({ - getConnectionsMap: Sinon.stub().returns(new PeerMap()), - getDialQueue: Sinon.stub().returns([]) - }); - autoDialer = new AutoDial(defaultComponents({ - peerStore, - connectionManager, - events - }), { - minConnections: 10, - autoDialInterval: 10000 - }); - autoDialer.start(); - // call autodial twice - await Promise.all([ - autoDialer.autoDial(), - autoDialer.autoDial() - ]); - // should only have queried peer store once - expect(peerStoreAllSpy.callCount).to.equal(1); - }); - it('should not re-dial peers we have recently failed to dial', async () => { - const peerWithAddress = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - const undialablePeer = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4002'), - isCertified: true - }], - // we failed to dial them recently - metadata: new Map([[LAST_DIAL_FAILURE_KEY, uint8ArrayFromString(`${Date.now() - 10}`)]]), - tags: new Map() - }; - await peerStore.save(peerWithAddress.id, peerWithAddress); - await peerStore.save(undialablePeer.id, undialablePeer); - const connectionManager = stubInterface({ - getConnectionsMap: Sinon.stub().returns(new PeerMap()), - getDialQueue: Sinon.stub().returns([]) - }); - autoDialer = new AutoDial(defaultComponents({ - peerStore, - connectionManager, - events - }), { - minConnections: 10, - autoDialPeerRetryThreshold: 2000 - }); - autoDialer.start(); - void autoDialer.autoDial(); - await pWaitFor(() => { - return connectionManager.openConnection.callCount === 1; - }); - expect(connectionManager.openConnection.callCount).to.equal(1); - expect(connectionManager.openConnection.calledWith(matchPeerId(peerWithAddress.id))).to.be.true(); - expect(connectionManager.openConnection.calledWith(matchPeerId(undialablePeer.id))).to.be.false(); - // pass the retry threshold - await delay(2000); - // autodial again - void autoDialer.autoDial(); - await pWaitFor(() => { - return connectionManager.openConnection.callCount === 3; - }); - // should have retried the unreachable peer - expect(connectionManager.openConnection.calledWith(matchPeerId(undialablePeer.id))).to.be.true(); - }); -}); -//# sourceMappingURL=auto-dial.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.js.map deleted file mode 100644 index 9f6f42597..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auto-dial.spec.js","sourceRoot":"","sources":["../../../test/connection-manager/auto-dial.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,iBAAiB,EAAyB,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MA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;IAClG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts deleted file mode 100644 index 9a6ef4706..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=dial-queue.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts.map deleted file mode 100644 index a7f5a2683..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dial-queue.spec.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/dial-queue.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.js deleted file mode 100644 index 34f8adb10..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.js +++ /dev/null @@ -1,218 +0,0 @@ -/* eslint-env mocha */ -import { mockConnection, mockDuplex, mockMultiaddrConnection } from '@libp2p/interface-compliance-tests/mocks'; -import { peerLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { multiaddr, resolvers } from '@multiformats/multiaddr'; -import { WebRTC } from '@multiformats/multiaddr-matcher'; -import { expect } from 'aegir/chai'; -import delay from 'delay'; -import pDefer from 'p-defer'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { DialQueue } from '../../src/connection-manager/dial-queue.js'; -describe('dial queue', () => { - let components; - let dialer; - beforeEach(async () => { - const peerId = await createEd25519PeerId(); - components = { - peerId, - peerStore: stubInterface(), - transportManager: stubInterface(), - connectionGater: stubInterface(), - logger: peerLogger(peerId) - }; - }); - afterEach(() => { - if (dialer != null) { - dialer.stop(); - } - sinon.reset(); - }); - it('should end when a single multiaddr dials succeeds', async () => { - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), await createEd25519PeerId())); - const deferredConn = pDefer(); - const actions = { - '/ip4/127.0.0.1/tcp/1231': async () => Promise.reject(new Error('dial failure')), - '/ip4/127.0.0.1/tcp/1232': async () => Promise.resolve(connection), - '/ip4/127.0.0.1/tcp/1233': async () => deferredConn.promise - }; - components.transportManager.transportForMultiaddr.returns(stubInterface()); - components.transportManager.dial.callsFake(async (ma) => { - const maStr = ma.toString(); - const action = actions[maStr]; - if (action != null) { - return action(); - } - throw new Error(`No action found for multiaddr ${maStr}`); - }); - dialer = new DialQueue(components, { - maxParallelDials: 2 - }); - // Make sure that dial attempt comes back before terminating last dial action - await expect(dialer.dial(Object.keys(actions).map(str => multiaddr(str)))) - .to.eventually.equal(connection); - // End third dial attempt - deferredConn.resolve(); - // prevent playwright-core error Error: Cannot find parent object page@... to create handle@... - await expect(deferredConn.promise).to.eventually.be.undefined(); - }); - it('should end when a single multiaddr dials succeeds even when a final dial fails', async () => { - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), await createEd25519PeerId())); - const deferredConn = pDefer(); - const actions = { - '/ip4/127.0.0.1/tcp/1231': async () => Promise.reject(new Error('dial failure')), - '/ip4/127.0.0.1/tcp/1232': async () => Promise.resolve(connection), - '/ip4/127.0.0.1/tcp/1233': async () => deferredConn.promise - }; - components.transportManager.transportForMultiaddr.returns(stubInterface()); - components.transportManager.dial.callsFake(async (ma) => { - const maStr = ma.toString(); - const action = actions[maStr]; - if (action != null) { - return action(); - } - throw new Error(`No action found for multiaddr ${maStr}`); - }); - dialer = new DialQueue(components, { - maxParallelDials: 2 - }); - // Make sure that dial attempt comes back before terminating last dial action - await expect(dialer.dial(Object.keys(actions).map(str => multiaddr(str)))) - .to.eventually.equal(connection); - // End third dial attempt - deferredConn.reject(new Error('Oh noes!')); - // prevent playwright-core error Error: Cannot find parent object page@... to create handle@... - await expect(deferredConn.promise).to.eventually.be.rejected(); - }); - it('should throw an AggregateError if all dials fail', async () => { - const actions = { - '/ip4/127.0.0.1/tcp/1231': async () => Promise.reject(new Error('dial failure')), - '/ip4/127.0.0.1/tcp/1232': async () => Promise.reject(new Error('dial failure')), - '/ip4/127.0.0.1/tcp/1233': async () => Promise.reject(new Error('dial failure')) - }; - dialer = new DialQueue(components, { - maxParallelDials: 2 - }); - components.transportManager.transportForMultiaddr.returns(stubInterface()); - components.transportManager.dial.callsFake(async (ma) => { - const maStr = ma.toString(); - const action = actions[maStr]; - if (action != null) { - return action(); - } - throw new Error(`No action found for multiaddr ${maStr}`); - }); - sinon.spy(actions, '/ip4/127.0.0.1/tcp/1231'); - sinon.spy(actions, '/ip4/127.0.0.1/tcp/1232'); - sinon.spy(actions, '/ip4/127.0.0.1/tcp/1233'); - try { - await dialer.dial(Object.keys(actions).map(str => multiaddr(str))); - expect.fail('Should have thrown'); - } - catch (err) { - expect(err).to.have.property('name', 'AggregateError'); - } - expect(actions['/ip4/127.0.0.1/tcp/1231']).to.have.property('callCount', 1); - expect(actions['/ip4/127.0.0.1/tcp/1232']).to.have.property('callCount', 1); - expect(actions['/ip4/127.0.0.1/tcp/1233']).to.have.property('callCount', 1); - }); - it('should handle a large number of addrs', async () => { - const reject = sinon.stub().callsFake(async () => Promise.reject(new Error('dial failure'))); - const actions = {}; - const addrs = [...new Array(25)].map((_, index) => `/ip4/127.0.0.1/tcp/12${index + 1}`); - addrs.forEach(addr => { - actions[addr] = reject; - }); - dialer = new DialQueue(components, { - maxParallelDials: 2 - }); - components.transportManager.transportForMultiaddr.returns(stubInterface()); - components.transportManager.dial.callsFake(async (ma) => { - const maStr = ma.toString(); - const action = actions[maStr]; - if (action != null) { - return action(); - } - throw new Error(`No action found for multiaddr ${maStr}`); - }); - try { - await dialer.dial(Object.keys(actions).map(str => multiaddr(str))); - expect.fail('Should have thrown'); - } - catch (err) { - expect(err).to.have.property('name', 'AggregateError'); - } - expect(reject).to.have.property('callCount', addrs.length); - }); - it('should ignore DNS addresses for other peers', async () => { - const remotePeer = await createEd25519PeerId(); - const otherRemotePeer = await createEd25519PeerId(); - const ma = multiaddr(`/dnsaddr/example.com/p2p/${remotePeer}`); - const maStr = `/ip4/123.123.123.123/tcp/2348/p2p/${remotePeer}`; - const resolvedAddresses = [ - `/ip4/234.234.234.234/tcp/4213/p2p/${otherRemotePeer}`, - maStr - ]; - let resolvedDNSAddrs = false; - let dialedBadAddress = false; - // simulate a DNSAddr that resolves to multiple different peers like - // bootstrap.libp2p.io - resolvers.set('dnsaddr', async (addr) => { - if (addr.equals(ma)) { - resolvedDNSAddrs = true; - return resolvedAddresses; - } - return []; - }); - dialer = new DialQueue(components, { - maxParallelDials: 50 - }); - components.transportManager.transportForMultiaddr.returns(stubInterface()); - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeer)); - components.transportManager.dial.callsFake(async (ma, opts = {}) => { - if (ma.toString() === maStr) { - await delay(100); - return connection; - } - dialedBadAddress = true; - throw new Error('Could not dial address'); - }); - await expect(dialer.dial(ma)).to.eventually.equal(connection); - expect(resolvedDNSAddrs).to.be.true('Did not resolve DNSAddrs'); - expect(dialedBadAddress).to.be.false('Dialed address with wrong peer id'); - resolvers.delete('dnsaddr'); - }); - it('should dial WebRTC address with peer id appended', async () => { - const remotePeer = await createEd25519PeerId(); - const relayPeer = await createEd25519PeerId(); - const ma = multiaddr(`/ip4/123.123.123.123/tcp/123/ws/p2p/${relayPeer}/p2p-circuit/webrtc`); - const maWithPeer = `${ma}/p2p/${remotePeer}`; - components.transportManager.transportForMultiaddr.callsFake(ma => { - if (WebRTC.exactMatch(ma)) { - return stubInterface(); - } - }); - components.peerStore.get.withArgs(remotePeer).resolves({ - id: remotePeer, - protocols: [], - metadata: new Map(), - tags: new Map(), - addresses: [{ - multiaddr: ma, - isCertified: true - }] - }); - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeer)); - components.transportManager.dial.callsFake(async (ma, opts = {}) => { - if (ma.toString() === maWithPeer) { - await delay(100); - return connection; - } - throw new Error('Could not dial address'); - }); - dialer = new DialQueue(components); - await expect(dialer.dial(remotePeer)).to.eventually.equal(connection); - }); -}); -//# sourceMappingURL=dial-queue.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.js.map deleted file mode 100644 index 2b79846f3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dial-queue.spec.js","sourceRoot":"","sources":["../../../test/connection-manager/dial-queue.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAA;AAC9G,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;A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U,CAAC,CAAC,CAAA;QAEpF,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,GAAG,EAAE,EAAE,EAAE;YACjE,IAAI,EAAE,CAAC,QAAQ,EAAE,KAAK,UAAU,EAAE;gBAChC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;gBAChB,OAAO,UAAU,CAAA;aAClB;YAED,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;QAC3C,CAAC,CAAC,CAAA;QAEF,MAAM,GAAG,IAAI,SAAS,CAAC,UAAU,CAAC,CAAA;QAClC,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;IACvE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.node.d.ts deleted file mode 100644 index bf3a5d6de..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=direct.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.node.d.ts.map deleted file mode 100644 index 2626222c7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"direct.node.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/direct.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.node.js deleted file mode 100644 index 52332f6f5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.node.js +++ /dev/null @@ -1,544 +0,0 @@ -/* eslint-env mocha */ -import fs from 'node:fs'; -import os from 'node:os'; -import path from 'node:path'; -import { yamux } from '@chainsafe/libp2p-yamux'; -import { isConnection } from '@libp2p/interface/connection'; -import { AbortError, ERR_TIMEOUT } from '@libp2p/interface/errors'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { start, stop } from '@libp2p/interface/startable'; -import { mockConnection, mockConnectionGater, mockDuplex, mockMultiaddrConnection, mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { mplex } from '@libp2p/mplex'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { plaintext } from '@libp2p/plaintext'; -import { tcp } from '@libp2p/tcp'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core/memory'; -import delay from 'delay'; -import { pipe } from 'it-pipe'; -import { pushable } from 'it-pushable'; -import pWaitFor from 'p-wait-for'; -import Sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { DefaultAddressManager } from '../../src/address-manager/index.js'; -import { defaultComponents } from '../../src/components.js'; -import { DialQueue } from '../../src/connection-manager/dial-queue.js'; -import { DefaultConnectionManager } from '../../src/connection-manager/index.js'; -import { codes as ErrorCodes } from '../../src/errors.js'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { DefaultTransportManager } from '../../src/transport-manager.js'; -import { ECHO_PROTOCOL, echo } from '../fixtures/echo-service.js'; -const listenAddr = multiaddr('/ip4/127.0.0.1/tcp/0'); -const unsupportedAddr = multiaddr('/ip4/127.0.0.1/tcp/9999/ws/p2p/QmckxVrJw1Yo8LqvmDJNUmdAsKtSbiKWmrXJFyKmUraBoN'); -describe('dialing (direct, TCP)', () => { - let remoteTM; - let localTM; - let remoteAddr; - let remoteComponents; - let localComponents; - let resolver; - beforeEach(async () => { - resolver = Sinon.stub(); - const [localPeerId, remotePeerId] = await Promise.all([ - createEd25519PeerId(), - createEd25519PeerId() - ]); - const remoteEvents = new TypedEventEmitter(); - remoteComponents = defaultComponents({ - peerId: remotePeerId, - events: remoteEvents, - datastore: new MemoryDatastore(), - upgrader: mockUpgrader({ events: remoteEvents }), - connectionGater: mockConnectionGater(), - transportManager: stubInterface({ - getAddrs: Sinon.stub().returns([]) - }) - }); - remoteComponents.peerStore = new PersistentPeerStore(remoteComponents); - remoteComponents.addressManager = new DefaultAddressManager(remoteComponents, { - listen: [ - listenAddr.toString() - ] - }); - remoteTM = remoteComponents.transportManager = new DefaultTransportManager(remoteComponents); - remoteTM.add(tcp()({ - logger: defaultLogger() - })); - const localEvents = new TypedEventEmitter(); - localComponents = defaultComponents({ - peerId: localPeerId, - events: localEvents, - datastore: new MemoryDatastore(), - upgrader: mockUpgrader({ events: localEvents }), - transportManager: stubInterface(), - connectionGater: mockConnectionGater() - }); - localComponents.peerStore = new PersistentPeerStore(localComponents); - localComponents.connectionManager = new DefaultConnectionManager(localComponents, { - maxConnections: 100, - minConnections: 50, - inboundUpgradeTimeout: 1000 - }); - localComponents.addressManager = new DefaultAddressManager(localComponents); - localTM = localComponents.transportManager = new DefaultTransportManager(localComponents); - localTM.add(tcp()({ - logger: defaultLogger() - })); - await start(localComponents); - await start(remoteComponents); - remoteAddr = remoteTM.getAddrs()[0].encapsulate(`/p2p/${remotePeerId.toString()}`); - }); - afterEach(async () => { - await stop(localComponents); - await stop(remoteComponents); - }); - afterEach(() => { - Sinon.restore(); - }); - it('should be able to connect to a remote node via its multiaddr', async () => { - const dialer = new DialQueue(localComponents); - const connection = await dialer.dial(remoteAddr); - expect(connection).to.exist(); - await connection.close(); - }); - it('should be able to connect to remote node with duplicated addresses', async () => { - const remotePeer = peerIdFromString(remoteAddr.getPeerId() ?? ''); - const dnsaddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remotePeer}`); - await localComponents.peerStore.merge(remotePeer, { - multiaddrs: [ - dnsaddr - ] - }); - const dialer = new DialQueue(localComponents, { - resolvers: { - dnsaddr: resolver - }, - maxParallelDials: 1 - }); - // Resolver stub - resolver.withArgs(dnsaddr).resolves([remoteAddr.toString()]); - const connection = await dialer.dial(remotePeer); - expect(connection).to.exist(); - await connection.close(); - }); - it('should fail to connect to an unsupported multiaddr', async () => { - const dialer = new DialQueue(localComponents); - await expect(dialer.dial(unsupportedAddr)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('should fail to connect if peer has no known addresses', async () => { - const dialer = new DialQueue(localComponents); - const peerId = await createEd25519PeerId(); - await expect(dialer.dial(peerId)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('should be able to connect to a given peer id', async () => { - await localComponents.peerStore.patch(remoteComponents.peerId, { - multiaddrs: remoteTM.getAddrs() - }); - const dialer = new DialQueue(localComponents); - const connection = await dialer.dial(remoteComponents.peerId); - expect(connection).to.exist(); - await connection.close(); - }); - it('should fail to connect to a given peer with unsupported addresses', async () => { - await localComponents.peerStore.patch(remoteComponents.peerId, { - multiaddrs: [unsupportedAddr] - }); - const dialer = new DialQueue(localComponents); - await expect(dialer.dial(remoteComponents.peerId)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('should only try to connect to addresses supported by the transports configured', async () => { - const remoteAddrs = remoteTM.getAddrs(); - const peerId = await createEd25519PeerId(); - await localComponents.peerStore.patch(peerId, { - multiaddrs: [...remoteAddrs, unsupportedAddr] - }); - const dialer = new DialQueue(localComponents); - Sinon.spy(localTM, 'dial'); - const connection = await dialer.dial(peerId); - expect(localTM.dial).to.have.property('callCount', remoteAddrs.length); - expect(connection).to.exist(); - await connection.close(); - }); - it('should abort dials on queue task timeout', async () => { - const dialer = new DialQueue(localComponents, { - dialTimeout: 50 - }); - Sinon.stub(localTM, 'dial').callsFake(async (addr, options = {}) => { - expect(options.signal).to.exist(); - expect(options.signal?.aborted).to.equal(false); - expect(addr.toString()).to.eql(remoteAddr.toString()); - await delay(60); - expect(options.signal?.aborted).to.equal(true); - throw new AbortError(); - }); - await expect(dialer.dial(remoteAddr)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.property('code', ERR_TIMEOUT); - }); - it('should only dial to the max concurrency', async () => { - const peerId1 = await createEd25519PeerId(); - const peerId2 = await createEd25519PeerId(); - const peerId3 = await createEd25519PeerId(); - const addr1 = multiaddr(`/ip4/127.0.0.1/tcp/1234/p2p/${peerId1}`); - const addr2 = multiaddr(`/ip4/127.0.12.4/tcp/3210/p2p/${peerId2}`); - const addr3 = multiaddr(`/ip4/123.3.11.1/tcp/2010/p2p/${peerId3}`); - const slowDial = async () => { - await delay(100); - return mockConnection(mockMultiaddrConnection(mockDuplex(), peerId1)); - }; - const actions = { - [addr1.toString()]: slowDial, - [addr2.toString()]: slowDial, - [addr3.toString()]: async () => mockConnection(mockMultiaddrConnection(mockDuplex(), peerId3)) - }; - const dialer = new DialQueue(localComponents, { - maxParallelDials: 2 - }); - const transportManagerDialStub = Sinon.stub(localTM, 'dial'); - transportManagerDialStub.callsFake(async (ma) => { - const maStr = ma.toString(); - const action = actions[maStr]; - if (action != null) { - return action(); - } - throw new Error(`No action found for multiaddr ${maStr}`); - }); - // dial 3 different peers - void Promise.all([ - dialer.dial(addr1), - dialer.dial(addr2), - dialer.dial(addr3) - ]); - // Let the call stack run - await delay(0); - // We should have 2 in progress, and 1 waiting - expect(transportManagerDialStub).to.have.property('callCount', 2); - // stop dials - dialer.stop(); - }); -}); -describe('libp2p.dialer (direct, TCP)', () => { - let peerId; - let remotePeerId; - let libp2p; - let remoteLibp2p; - let remoteAddr; - beforeEach(async () => { - [peerId, remotePeerId] = await Promise.all([ - createEd25519PeerId(), - createEd25519PeerId() - ]); - remoteLibp2p = await createLibp2pNode({ - peerId: remotePeerId, - addresses: { - listen: [listenAddr.toString()] - }, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - echo: echo() - } - }); - await remoteLibp2p.start(); - remoteAddr = remoteLibp2p.getMultiaddrs()[0]; - }); - afterEach(async () => { - Sinon.restore(); - if (libp2p != null) { - await libp2p.stop(); - } - if (remoteLibp2p != null) { - await remoteLibp2p.stop(); - } - }); - it('should use the dialer for connecting to a peer', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - await libp2p.peerStore.patch(remotePeerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - const connection = await libp2p.dial(remotePeerId); - expect(connection).to.exist(); - const stream = await connection.newStream(ECHO_PROTOCOL); - expect(stream).to.exist(); - expect(stream).to.have.property('protocol', ECHO_PROTOCOL); - await connection.close(); - }); - it('should close all streams when the connection closes', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - // register some stream handlers to simulate several protocols - await libp2p.handle('/stream-count/1', ({ stream }) => { - void pipe(stream, stream); - }); - await libp2p.handle('/stream-count/2', ({ stream }) => { - void pipe(stream, stream); - }); - await remoteLibp2p.handle('/stream-count/3', ({ stream }) => { - void pipe(stream, stream); - }); - await remoteLibp2p.handle('/stream-count/4', ({ stream }) => { - void pipe(stream, stream); - }); - const connection = await libp2p.dial(remoteLibp2p.getMultiaddrs()); - // Create local to remote streams - const stream = await connection.newStream([ECHO_PROTOCOL, '/other/1.0.0']); - await connection.newStream('/stream-count/3'); - await libp2p.dialProtocol(remoteLibp2p.peerId, '/stream-count/4'); - // Partially write to the echo stream - const source = pushable(); - void stream.sink(source); - source.push(uint8ArrayFromString('hello')); - // Create remote to local streams - await remoteLibp2p.dialProtocol(libp2p.peerId, ['/stream-count/1', '/other/1.0.0']); - await remoteLibp2p.dialProtocol(libp2p.peerId, ['/stream-count/2', '/other/1.0.0']); - // Verify stream count - const remoteConn = remoteLibp2p.getConnections(libp2p.peerId); - if (remoteConn == null) { - throw new Error('No remote connection found'); - } - expect(connection.streams).to.have.length(5); - expect(remoteConn).to.have.lengthOf(1); - expect(remoteConn).to.have.nested.property('[0].streams').with.lengthOf(5); - // Close the connection and verify all streams have been closed - await connection.close(); - await pWaitFor(() => connection.streams.length === 0); - await pWaitFor(() => remoteConn[0].streams.length === 0); - }); - it('should throw when using dialProtocol with no protocols', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - // @ts-expect-error invalid params - await expect(libp2p.dialProtocol(remoteAddr)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.property('code', ErrorCodes.ERR_INVALID_PROTOCOLS_FOR_STREAM); - await expect(libp2p.dialProtocol(remoteAddr, [])) - .to.eventually.be.rejectedWith(Error) - .and.to.have.property('code', ErrorCodes.ERR_INVALID_PROTOCOLS_FOR_STREAM); - }); - it('should be able to use hangup to close connections', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - const connection = await libp2p.dial(remoteAddr); - expect(connection).to.exist(); - expect(connection.timeline.close).to.not.exist(); - await libp2p.hangUp(connection.remotePeer); - expect(connection.timeline.close).to.exist(); - }); - it('should use the protectors when provided for connecting', async () => { - const protector = { - async protect(connection) { - return connection; - } - }; - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionProtector: () => protector - }); - const protectorProtectSpy = Sinon.spy(protector, 'protect'); - await libp2p.start(); - const connection = await libp2p.dial(remoteAddr); - expect(connection).to.exist(); - const stream = await connection.newStream(ECHO_PROTOCOL); - expect(stream).to.exist(); - expect(stream).to.have.property('protocol', ECHO_PROTOCOL); - await connection.close(); - expect(protectorProtectSpy.callCount).to.equal(1); - }); - it('should coalesce parallel dials to the same peer (id in multiaddr)', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - const dials = 10; - // PeerId should be in multiaddr - expect(remoteAddr.getPeerId()).to.equal(remoteLibp2p.peerId.toString()); - await libp2p.peerStore.patch(remotePeerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - const dialResults = await Promise.all([...new Array(dials)].map(async (_, index) => { - if (index % 2 === 0) - return libp2p.dial(remoteLibp2p.peerId); - return libp2p.dial(remoteAddr); - })); - // All should succeed and we should have ten results - expect(dialResults).to.have.length(10); - for (const connection of dialResults) { - expect(isConnection(connection)).to.equal(true); - } - // 1 connection, because we know the peer in the multiaddr - expect(libp2p.getConnections()).to.have.lengthOf(1); - expect(remoteLibp2p.getConnections()).to.have.lengthOf(1); - }); - it('should coalesce parallel dials to the same error on failure', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - const dials = 10; - const error = new Error('Boom'); - Sinon.stub(libp2p.components.transportManager, 'dial').callsFake(async () => Promise.reject(error)); - await libp2p.peerStore.patch(remotePeerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - const dialResults = await Promise.allSettled([...new Array(dials)].map(async (_, index) => { - if (index % 2 === 0) - return libp2p.dial(remoteLibp2p.peerId); - return libp2p.dial(remoteAddr); - })); - // All should succeed and we should have ten results - expect(dialResults).to.have.length(10); - for (const result of dialResults) { - // All errors should be the exact same as `error` - expect(result).to.have.property('status', 'rejected'); - expect(result).to.have.property('reason', error); - } - // 1 connection, because we know the peer in the multiaddr - expect(libp2p.getConnections()).to.have.lengthOf(0); - expect(remoteLibp2p.getConnections()).to.have.lengthOf(0); - }); - it('should dial a unix socket', async () => { - if (os.platform() === 'win32') { - return; - } - if (remoteLibp2p != null) { - await remoteLibp2p.stop(); - } - const unixAddr = path.join(os.tmpdir(), `test-${Math.random()}.sock`); - const unixMultiaddr = multiaddr('/unix' + unixAddr); - remoteLibp2p = await createLibp2pNode({ - peerId: remotePeerId, - addresses: { - listen: [ - unixMultiaddr.toString() - ] - }, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await remoteLibp2p.start(); - expect(fs.existsSync(unixAddr)).to.be.true(); - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - const connection = await libp2p.dial(unixMultiaddr); - expect(connection.remotePeer.toString()).to.equal(remotePeerId.toString()); - }); -}); -//# sourceMappingURL=direct.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.node.js.map deleted file mode 100644 index e0168e929..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"direct.node.js","sourceRoot":"","sources":["../../../test/connection-manager/direct.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAA6C,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACtG,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACjJ,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,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AE;aACR;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAC,CAAA;QAEF,MAAM,YAAY,CAAC,KAAK,EAAE,CAAA;QAE1B,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QAE5C,MAAM,GAAG,MAAM,gBAAgB,CAAC;YAC9B,MAAM;YACN,UAAU,EAAE;gBACV,GAAG,EAAE;aACN;YACD,YAAY,EAAE;gBACZ,KAAK,EAAE;gBACP,KAAK,EAAE;aACR;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;QAEpB,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QAEnD,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC5E,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.spec.d.ts deleted file mode 100644 index bd766c5f7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=direct.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.spec.d.ts.map deleted file mode 100644 index 45ebfd5e7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"direct.spec.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/direct.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.spec.js deleted file mode 100644 index dd509b936..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.spec.js +++ /dev/null @@ -1,420 +0,0 @@ -/* eslint-env mocha */ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { identify } from '@libp2p/identify'; -import { AbortError, ERR_TIMEOUT } from '@libp2p/interface/errors'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockConnectionGater, mockDuplex, mockMultiaddrConnection, mockUpgrader, mockConnection } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { mplex } from '@libp2p/mplex'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { plaintext } from '@libp2p/plaintext'; -import { defaultAddressSort } from '@libp2p/utils/address-sort'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core/memory'; -import delay from 'delay'; -import pDefer from 'p-defer'; -import { pEvent } from 'p-event'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { defaultComponents } from '../../src/components.js'; -import { LAST_DIAL_FAILURE_KEY } from '../../src/connection-manager/constants.js'; -import { DefaultConnectionManager } from '../../src/connection-manager/index.js'; -import { codes as ErrorCodes } from '../../src/errors.js'; -import { createLibp2p } from '../../src/index.js'; -import { DefaultTransportManager } from '../../src/transport-manager.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -const unsupportedAddr = multiaddr('/ip4/127.0.0.1/tcp/9999'); -const relayMultiaddr = multiaddr(process.env.RELAY_MULTIADDR); -describe('dialing (direct, WebSockets)', () => { - let localTM; - let localComponents; - let remoteAddr; - let remoteComponents; - let connectionManager; - beforeEach(async () => { - const localEvents = new TypedEventEmitter(); - localComponents = defaultComponents({ - peerId: await createEd25519PeerId(), - datastore: new MemoryDatastore(), - upgrader: mockUpgrader({ events: localEvents }), - connectionGater: mockConnectionGater(), - transportManager: stubInterface(), - events: localEvents - }); - localComponents.peerStore = new PersistentPeerStore(localComponents, { - addressFilter: localComponents.connectionGater.filterMultiaddrForPeer - }); - localComponents.connectionManager = new DefaultConnectionManager(localComponents, { - maxConnections: 100, - minConnections: 50, - inboundUpgradeTimeout: 1000 - }); - localTM = new DefaultTransportManager(localComponents); - localTM.add(webSockets({ filter: filters.all })({ - logger: defaultLogger() - })); - localComponents.transportManager = localTM; - // this peer is spun up in .aegir.cjs - remoteAddr = relayMultiaddr; - remoteComponents = defaultComponents({ - peerId: peerIdFromString(remoteAddr.getPeerId() ?? '') - }); - }); - afterEach(async () => { - sinon.restore(); - if (connectionManager != null) { - await connectionManager.stop(); - } - }); - it('should be able to connect to a remote node via its multiaddr', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - const remotePeerId = peerIdFromString(remoteAddr.getPeerId() ?? ''); - await localComponents.peerStore.patch(remotePeerId, { - multiaddrs: [remoteAddr] - }); - const connection = await connectionManager.openConnection(remoteAddr); - expect(connection).to.exist(); - await connection.close(); - }); - it('should fail to connect to an unsupported multiaddr', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - await expect(connectionManager.openConnection(unsupportedAddr.encapsulate(`/p2p/${remoteComponents.peerId.toString()}`))) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('should mark a peer as having recently failed to connect', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - await expect(connectionManager.openConnection(multiaddr(`/ip4/127.0.0.1/tcp/12984/ws/p2p/${remoteComponents.peerId.toString()}`))) - .to.eventually.be.rejected(); - const peer = await localComponents.peerStore.get(remoteComponents.peerId); - expect(peer.metadata.has(LAST_DIAL_FAILURE_KEY)).to.be.true(); - }); - it('should be able to connect to a given peer', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - const remotePeerId = peerIdFromString(remoteAddr.getPeerId() ?? ''); - await localComponents.peerStore.patch(remotePeerId, { - multiaddrs: [remoteAddr] - }); - const connection = await connectionManager.openConnection(remotePeerId); - expect(connection).to.exist(); - await connection.close(); - }); - it('should fail to connect to a given peer with unsupported addresses', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - const remotePeerId = peerIdFromString(remoteAddr.getPeerId() ?? ''); - await localComponents.peerStore.patch(remotePeerId, { - multiaddrs: [unsupportedAddr] - }); - await expect(connectionManager.openConnection(remotePeerId)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('should abort dials on queue task timeout', async () => { - connectionManager = new DefaultConnectionManager(localComponents, { - dialTimeout: 50 - }); - await connectionManager.start(); - const remotePeerId = peerIdFromString(remoteAddr.getPeerId() ?? ''); - await localComponents.peerStore.patch(remotePeerId, { - multiaddrs: [remoteAddr] - }); - sinon.stub(localTM, 'dial').callsFake(async (addr, options) => { - expect(options.signal).to.exist(); - expect(options.signal.aborted).to.equal(false); - expect(addr.toString()).to.eql(remoteAddr.toString()); - await delay(60); - expect(options.signal.aborted).to.equal(true); - throw new AbortError(); - }); - await expect(connectionManager.openConnection(remoteAddr)) - .to.eventually.be.rejected() - .and.to.have.property('code', ERR_TIMEOUT); - }); - it('should throw when a peer advertises more than the allowed number of addresses', async () => { - connectionManager = new DefaultConnectionManager(localComponents, { - maxPeerAddrsToDial: 10 - }); - await connectionManager.start(); - const remotePeerId = peerIdFromString(remoteAddr.getPeerId() ?? ''); - await localComponents.peerStore.patch(remotePeerId, { - multiaddrs: Array.from({ length: 11 }, (_, i) => multiaddr(`/ip4/127.0.0.1/tcp/1500${i}/ws/p2p/${remotePeerId.toString()}`)) - }); - await expect(connectionManager.openConnection(remotePeerId)) - .to.eventually.be.rejected() - .and.to.have.property('code', ErrorCodes.ERR_TOO_MANY_ADDRESSES); - }); - it('should sort addresses on dial', async () => { - const peerMultiaddrs = [ - multiaddr('/ip4/127.0.0.1/tcp/15001/ws'), - multiaddr('/ip4/20.0.0.1/tcp/15001/ws'), - multiaddr('/ip4/30.0.0.1/tcp/15001/ws') - ]; - const addressesSorttSpy = sinon.spy(defaultAddressSort); - const localTMDialStub = sinon.stub(localTM, 'dial').callsFake(async (ma) => mockConnection(mockMultiaddrConnection(mockDuplex(), remoteComponents.peerId))); - connectionManager = new DefaultConnectionManager(localComponents, { - addressSorter: addressesSorttSpy, - maxParallelDials: 3 - }); - await connectionManager.start(); - // Inject data into the AddressBook - await localComponents.peerStore.merge(remoteComponents.peerId, { - multiaddrs: peerMultiaddrs - }); - // Perform 3 multiaddr dials - await connectionManager.openConnection(remoteComponents.peerId); - const sortedAddresses = peerMultiaddrs - .map((m) => ({ multiaddr: m, isCertified: false })) - .sort(defaultAddressSort); - expect(localTMDialStub.getCall(0).args[0].equals(sortedAddresses[0].multiaddr)); - }); - it('shutting down should abort pending dials', async () => { - const addrs = [ - multiaddr('/ip4/0.0.0.0/tcp/8000/ws'), - multiaddr('/ip4/0.0.0.0/tcp/8001/ws'), - multiaddr('/ip4/0.0.0.0/tcp/8002/ws') - ]; - connectionManager = new DefaultConnectionManager(localComponents, { - maxParallelDials: 2 - }); - await connectionManager.start(); - // Inject data into the AddressBook - await localComponents.peerStore.merge(remoteComponents.peerId, { - multiaddrs: addrs - }); - sinon.stub(localTM, 'dial').callsFake(async (_, options) => { - const deferredDial = pDefer(); - const onAbort = () => { - options.signal.removeEventListener('abort', onAbort); - deferredDial.reject(new AbortError()); - }; - options.signal.addEventListener('abort', onAbort); - return deferredDial.promise; - }); - // Perform 3 multiaddr dials - const dialPromise = connectionManager.openConnection(remoteComponents.peerId); - // Let the call stack run - await delay(0); - try { - await connectionManager.stop(); - await dialPromise; - expect.fail('should have failed'); - } - catch { - expect(connectionManager.getDialQueue()).to.have.lengthOf(0); // 0 dial requests - } - }); - it('should dial only the multiaddr that is passed', async () => { - const addrs = [ - multiaddr(`/ip4/0.0.0.0/tcp/8000/ws/p2p/${remoteComponents.peerId.toString()}`), - multiaddr(`/ip4/0.0.0.0/tcp/8001/ws/p2p/${remoteComponents.peerId.toString()}`), - multiaddr(`/ip4/0.0.0.0/tcp/8002/ws/p2p/${remoteComponents.peerId.toString()}`) - ]; - // Inject data into the AddressBook - await localComponents.peerStore.merge(remoteComponents.peerId, { - multiaddrs: addrs - }); - // different address not in the address book, same peer id - const dialMultiaddr = multiaddr(`/ip4/0.0.0.0/tcp/8003/ws/p2p/${remoteComponents.peerId.toString()}`); - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - const transactionManagerDialStub = sinon.stub(localTM, 'dial'); - transactionManagerDialStub.callsFake(async (ma) => mockConnection(mockMultiaddrConnection(mockDuplex(), remoteComponents.peerId))); - // Perform dial - await connectionManager.openConnection(dialMultiaddr); - expect(transactionManagerDialStub).to.have.property('callCount', 1); - expect(transactionManagerDialStub.getCall(0).args[0].toString()).to.equal(dialMultiaddr.toString()); - }); - it('should throw if dialling an empty array is attempted', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - // Perform dial - await expect(connectionManager.openConnection([])).to.eventually.rejected - .with.property('code', 'ERR_NO_VALID_ADDRESSES'); - }); - it('should throw if dialling multiaddrs with mismatched peer ids', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - // Perform dial - await expect(connectionManager.openConnection([ - multiaddr(`/ip4/0.0.0.0/tcp/8000/ws/p2p/${(await createPeerId()).toString()}`), - multiaddr(`/ip4/0.0.0.0/tcp/8001/ws/p2p/${(await createPeerId()).toString()}`) - ])).to.eventually.rejected - .with.property('code', 'ERR_INVALID_PARAMETERS'); - }); - it('should throw if dialling multiaddrs with inconsistent peer ids', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - // Perform dial - await expect(connectionManager.openConnection([ - multiaddr(`/ip4/0.0.0.0/tcp/8000/ws/p2p/${(await createPeerId()).toString()}`), - multiaddr('/ip4/0.0.0.0/tcp/8001/ws') - ])).to.eventually.rejected - .with.property('code', 'ERR_INVALID_PARAMETERS'); - // Perform dial - await expect(connectionManager.openConnection([ - multiaddr('/ip4/0.0.0.0/tcp/8001/ws'), - multiaddr(`/ip4/0.0.0.0/tcp/8000/ws/p2p/${(await createPeerId()).toString()}`) - ])).to.eventually.rejected - .with.property('code', 'ERR_INVALID_PARAMETERS'); - }); -}); -describe('libp2p.dialer (direct, WebSockets)', () => { - let libp2p; - let peerId; - beforeEach(async () => { - peerId = await createPeerId(); - }); - afterEach(async () => { - sinon.restore(); - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('should run identify automatically after connecting', async () => { - libp2p = await createLibp2p({ - peerId, - transports: [ - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - identify: identify() - }, - connectionGater: mockConnectionGater() - }); - if (libp2p.services.identify == null) { - throw new Error('Identify service missing'); - } - const identifySpy = sinon.spy(libp2p.services.identify, 'identify'); - const peerStorePatchSpy = sinon.spy(libp2p.peerStore, 'patch'); - const connectionPromise = pEvent(libp2p, 'connection:open'); - await libp2p.start(); - const connection = await libp2p.dial(relayMultiaddr); - expect(connection).to.exist(); - // Wait for connection event to be emitted - await connectionPromise; - expect(identifySpy.callCount).to.equal(1); - await identifySpy.firstCall.returnValue; - expect(peerStorePatchSpy.callCount).to.equal(1); - await libp2p.stop(); - }); - it('should not run identify automatically after connecting', async () => { - libp2p = await createLibp2p({ - peerId, - transports: [ - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - plaintext() - ], - services: { - identify: identify({ - runOnConnectionOpen: false - }) - }, - connectionGater: mockConnectionGater() - }); - if (libp2p.services.identify == null) { - throw new Error('Identify service missing'); - } - const identifySpy = sinon.spy(libp2p.services.identify, 'identify'); - const connectionPromise = pEvent(libp2p, 'connection:open'); - await libp2p.start(); - const connection = await libp2p.dial(relayMultiaddr); - expect(connection).to.exist(); - // Wait for connection event to be emitted - await connectionPromise; - expect(identifySpy.callCount).to.equal(0); - await libp2p.stop(); - }); - it('should be able to use hangup to close connections', async () => { - libp2p = await createLibp2p({ - peerId, - transports: [ - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }); - await libp2p.start(); - const connection = await libp2p.dial(relayMultiaddr); - expect(connection).to.exist(); - expect(connection.timeline.close).to.not.exist(); - await libp2p.hangUp(connection.remotePeer); - expect(connection.timeline.close).to.exist(); - await libp2p.stop(); - }); - it('should be able to use hangup when no connection exists', async () => { - libp2p = await createLibp2p({ - peerId, - transports: [ - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }); - await libp2p.hangUp(relayMultiaddr); - }); - it('should fail to dial self', async () => { - libp2p = await createLibp2p({ - peerId, - transports: [ - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }); - await libp2p.start(); - await expect(libp2p.dial(multiaddr(`/ip4/127.0.0.1/tcp/1234/ws/p2p/${peerId.toString()}`))) - .to.eventually.be.rejected() - .and.to.have.property('code', ErrorCodes.ERR_DIALED_SELF); - }); -}); -//# sourceMappingURL=direct.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.spec.js.map deleted file mode 100644 index 527cd2c3d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/direct.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"direct.spec.js","sourceRoot":"","sources":["../../../test/connection-manager/direct.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAiB,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,uBAAuB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAA;AACjJ,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,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AAG;iBACpB,CAAC;aACH;YACD,YAAY,EAAE;gBACZ,KAAK,EAAE;gBACP,KAAK,EAAE;aACR;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;YACD,eAAe,EAAE,mBAAmB,EAAE;SACvC,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;QAEpB,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,kCAAkC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;aACxF,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE;aAC3B,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,eAAe,CAAC,CAAA;IAC7D,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.node.d.ts deleted file mode 100644 index 95867294f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.node.d.ts.map deleted file mode 100644 index 5b7c5c52c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/index.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.node.js deleted file mode 100644 index 7bdc7f4d0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.node.js +++ /dev/null @@ -1,540 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { start } from '@libp2p/interface/startable'; -import { mockConnection, mockDuplex, mockMultiaddrConnection } from '@libp2p/interface-compliance-tests/mocks'; -import { expect } from 'aegir/chai'; -import delay from 'delay'; -import all from 'it-all'; -import { pipe } from 'it-pipe'; -import pWaitFor from 'p-wait-for'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { defaultComponents } from '../../src/components.js'; -import { DefaultConnectionManager } from '../../src/connection-manager/index.js'; -import { codes } from '../../src/errors.js'; -import { createBaseOptions } from '../fixtures/base-options.browser.js'; -import { createNode, createPeerId } from '../fixtures/creators/peer.js'; -import { ECHO_PROTOCOL, echo } from '../fixtures/echo-service.js'; -describe('Connection Manager', () => { - let libp2p; - let peerIds; - before(async () => { - peerIds = await Promise.all([ - createPeerId(), - createPeerId() - ]); - }); - beforeEach(async () => { - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - } - }) - }); - }); - afterEach(async () => { - await libp2p.stop(); - }); - it('should filter connections on disconnect, removing the closed one', async () => { - const peerStore = stubInterface(); - const components = defaultComponents({ - peerId: peerIds[0], - peerStore, - transportManager: stubInterface(), - connectionGater: stubInterface(), - events: new TypedEventEmitter() - }); - const connectionManager = new DefaultConnectionManager(components, { - maxConnections: 1000, - minConnections: 50, - inboundUpgradeTimeout: 1000 - }); - await start(connectionManager); - const conn1 = mockConnection(mockMultiaddrConnection(mockDuplex(), peerIds[1])); - const conn2 = mockConnection(mockMultiaddrConnection(mockDuplex(), peerIds[1])); - expect(connectionManager.getConnections(peerIds[1])).to.have.lengthOf(0); - // Add connection to the connectionManager - components.events.safeDispatchEvent('connection:open', { detail: conn1 }); - components.events.safeDispatchEvent('connection:open', { detail: conn2 }); - expect(connectionManager.getConnections(peerIds[1])).to.have.lengthOf(2); - await conn2.close(); - components.events.safeDispatchEvent('connection:close', { detail: conn2 }); - expect(connectionManager.getConnections(peerIds[1])).to.have.lengthOf(1); - expect(conn1).to.have.nested.property('status', 'open'); - await connectionManager.stop(); - }); - it('should close connections on stop', async () => { - const peerStore = stubInterface(); - const components = defaultComponents({ - peerId: peerIds[0], - peerStore, - transportManager: stubInterface(), - connectionGater: stubInterface(), - events: new TypedEventEmitter() - }); - const connectionManager = new DefaultConnectionManager(components, { - maxConnections: 1000, - minConnections: 50, - inboundUpgradeTimeout: 1000 - }); - await start(connectionManager); - const conn1 = mockConnection(mockMultiaddrConnection(mockDuplex(), peerIds[1])); - const conn2 = mockConnection(mockMultiaddrConnection(mockDuplex(), peerIds[1])); - // Add connection to the connectionManager - components.events.safeDispatchEvent('connection:open', { detail: conn1 }); - components.events.safeDispatchEvent('connection:open', { detail: conn2 }); - expect(connectionManager.getConnections(peerIds[1])).to.have.lengthOf(2); - await connectionManager.stop(); - expect(connectionManager.getConnections(peerIds[1])).to.have.lengthOf(0); - }); -}); -describe('libp2p.connections', () => { - let peerIds; - let libp2p; - before(async () => { - peerIds = await Promise.all([ - createPeerId(), - createPeerId() - ]); - }); - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('libp2p.connections gets the connectionManager conns', async () => { - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/15003/ws'] - } - }) - }); - const remoteLibp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[1], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/15004/ws'] - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - const conn = await libp2p.dial(remoteLibp2p.peerId); - expect(conn).to.be.ok(); - expect(libp2p.getConnections()).to.have.lengthOf(1); - await libp2p.stop(); - await remoteLibp2p.stop(); - }); - describe('proactive connections', () => { - let libp2p; - let nodes = []; - beforeEach(async () => { - nodes = await Promise.all([ - createNode({ - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - } - } - }), - createNode({ - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - } - } - }) - ]); - }); - afterEach(async () => { - await Promise.all(nodes.map(async (node) => { await node.stop(); })); - if (libp2p != null) { - await libp2p.stop(); - } - sinon.reset(); - }); - it('should connect to all the peers stored in the PeerStore, if their number is below minConnections', async () => { - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionManager: { - minConnections: 3 - } - } - }); - // Populate PeerStore before starting - await libp2p.peerStore.patch(nodes[0].peerId, { - multiaddrs: nodes[0].getMultiaddrs() - }); - await libp2p.peerStore.patch(nodes[1].peerId, { - multiaddrs: nodes[1].getMultiaddrs() - }); - await libp2p.start(); - // Wait for peers to connect - await pWaitFor(() => libp2p.getConnections().length === 2); - await libp2p.stop(); - }); - it('should connect to all the peers stored in the PeerStore until reaching the minConnections', async () => { - const minConnections = 1; - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionManager: { - minConnections, - maxConnections: 1 - } - } - }); - // Populate PeerStore before starting - await libp2p.peerStore.patch(nodes[0].peerId, { - multiaddrs: nodes[0].getMultiaddrs() - }); - await libp2p.peerStore.patch(nodes[1].peerId, { - multiaddrs: nodes[1].getMultiaddrs() - }); - await libp2p.start(); - // Wait for peer to connect - await pWaitFor(() => libp2p.components.connectionManager.getConnections().length === minConnections); - // Wait more time to guarantee no other connection happened - await delay(200); - expect(libp2p.components.connectionManager.getConnections().length).to.eql(minConnections); - await libp2p.stop(); - }); - // flaky - it.skip('should connect to all the peers stored in the PeerStore until reaching the minConnections sorted', async () => { - const minConnections = 1; - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionManager: { - minConnections, - maxConnections: 1 - } - } - }); - // Populate PeerStore before starting - await libp2p.peerStore.patch(nodes[0].peerId, { - multiaddrs: nodes[0].getMultiaddrs() - }); - await libp2p.peerStore.patch(nodes[1].peerId, { - multiaddrs: nodes[1].getMultiaddrs(), - protocols: ['/protocol-min-conns'] - }); - await libp2p.start(); - // Wait for peer to connect - await pWaitFor(() => libp2p.components.connectionManager.getConnections().length === minConnections); - // Should have connected to the peer with protocols - expect(libp2p.components.connectionManager.getConnections(nodes[0].peerId)).to.be.empty(); - expect(libp2p.components.connectionManager.getConnections(nodes[1].peerId)).to.not.be.empty(); - await libp2p.stop(); - }); - it('should connect to peers in the PeerStore when a peer disconnected', async () => { - const minConnections = 1; - libp2p = await createNode({ - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionManager: { - minConnections - } - } - }); - // Populate PeerStore after starting (discovery) - await libp2p.peerStore.patch(nodes[0].peerId, { - multiaddrs: nodes[0].getMultiaddrs() - }); - // Wait for peer to connect - const conn = await libp2p.dial(nodes[0].peerId); - expect(libp2p.components.connectionManager.getConnections(nodes[0].peerId)).to.not.be.empty(); - await conn.close(); - // Closed - await pWaitFor(() => libp2p.components.connectionManager.getConnections().length === 0); - // Connected - await pWaitFor(() => libp2p.components.connectionManager.getConnections().length === 1); - expect(libp2p.components.connectionManager.getConnections(nodes[0].peerId)).to.not.be.empty(); - await libp2p.stop(); - }); - it('should be closed status once immediately stopping', async () => { - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/15003/ws'] - } - }) - }); - const remoteLibp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[1], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/15004/ws'] - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - await libp2p.dial(remoteLibp2p.peerId); - const conns = libp2p.components.connectionManager.getConnections(); - expect(conns.length).to.eql(1); - const conn = conns[0]; - await libp2p.stop(); - expect(conn.status).to.eql('closed'); - await remoteLibp2p.stop(); - }); - it('should open multiple connections when forced', async () => { - libp2p = await createNode({ - config: createBaseOptions({ - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - } - }) - }); - // connect once, should have one connection - await libp2p.components.connectionManager.openConnection(nodes[0].getMultiaddrs()); - expect(libp2p.components.connectionManager.getConnections()).to.have.lengthOf(1); - // connect twice, should still only have one connection - await libp2p.components.connectionManager.openConnection(nodes[0].getMultiaddrs(), { - force: false - }); - expect(libp2p.components.connectionManager.getConnections()).to.have.lengthOf(1); - // force connection, should have two connections now - await libp2p.components.connectionManager.openConnection(nodes[0].getMultiaddrs(), { - force: true - }); - expect(libp2p.components.connectionManager.getConnections()).to.have.lengthOf(2); - }); - }); - describe('connection gater', () => { - let libp2p; - let remoteLibp2p; - beforeEach(async () => { - remoteLibp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[1], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - services: { - echo: echo() - } - }) - }); - }); - afterEach(async () => { - if (remoteLibp2p != null) { - await remoteLibp2p.stop(); - } - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('intercept peer dial', async () => { - const denyDialPeer = sinon.stub().returns(true); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyDialPeer - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - await expect(libp2p.dial(remoteLibp2p.peerId)) - .to.eventually.be.rejected().with.property('code', codes.ERR_PEER_DIAL_INTERCEPTED); - }); - it('intercept addr dial', async () => { - const denyDialMultiaddr = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyDialMultiaddr - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - await libp2p.components.connectionManager.openConnection(remoteLibp2p.peerId); - for (const multiaddr of remoteLibp2p.getMultiaddrs()) { - expect(denyDialMultiaddr.calledWith(multiaddr)).to.be.true(); - } - }); - it('intercept multiaddr store', async () => { - const filterMultiaddrForPeer = sinon.stub().returns(true); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - filterMultiaddrForPeer - } - }) - }); - const fullMultiaddr = remoteLibp2p.getMultiaddrs()[0]; - await libp2p.peerStore.merge(remoteLibp2p.peerId, { - multiaddrs: [fullMultiaddr] - }); - expect(filterMultiaddrForPeer.callCount).to.equal(1); - const args = filterMultiaddrForPeer.getCall(0).args; - expect(args[0].toString()).to.equal(remoteLibp2p.peerId.toString()); - expect(args[1].toString()).to.equal(fullMultiaddr.toString()); - }); - it('intercept accept inbound connection', async () => { - const denyInboundConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyInboundConnection - } - }) - }); - await remoteLibp2p.peerStore.patch(libp2p.peerId, { - multiaddrs: libp2p.getMultiaddrs() - }); - await remoteLibp2p.dial(libp2p.peerId); - expect(denyInboundConnection.called).to.be.true(); - }); - it('intercept accept outbound connection', async () => { - const denyOutboundConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyOutboundConnection - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - await libp2p.dial(remoteLibp2p.peerId); - expect(denyOutboundConnection.called).to.be.true(); - }); - it('intercept inbound encrypted', async () => { - const denyInboundEncryptedConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyInboundEncryptedConnection - } - }) - }); - await remoteLibp2p.peerStore.patch(libp2p.peerId, { - multiaddrs: libp2p.getMultiaddrs() - }); - await remoteLibp2p.dial(libp2p.peerId); - expect(denyInboundEncryptedConnection.called).to.be.true(); - expect(denyInboundEncryptedConnection.getCall(0)).to.have.nested.property('args[0].multihash.digest').that.equalBytes(remoteLibp2p.peerId.multihash.digest); - }); - it('intercept outbound encrypted', async () => { - const denyOutboundEncryptedConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyOutboundEncryptedConnection - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - await libp2p.dial(remoteLibp2p.peerId); - expect(denyOutboundEncryptedConnection.called).to.be.true(); - expect(denyOutboundEncryptedConnection.getCall(0)).to.have.nested.property('args[0].multihash.digest').that.equalBytes(remoteLibp2p.peerId.multihash.digest); - }); - it('intercept inbound upgraded', async () => { - const denyInboundUpgradedConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyInboundUpgradedConnection - }, - services: { - echo: echo() - } - }) - }); - await remoteLibp2p.peerStore.patch(libp2p.peerId, { - multiaddrs: libp2p.getMultiaddrs() - }); - const connection = await remoteLibp2p.dial(libp2p.peerId); - const stream = await connection.newStream(ECHO_PROTOCOL); - const input = [Uint8Array.from([0])]; - const output = await pipe(input, stream, async (source) => all(source)); - expect(denyInboundUpgradedConnection.called).to.be.true(); - expect(denyInboundUpgradedConnection.getCall(0)).to.have.nested.property('args[0].multihash.digest').that.equalBytes(remoteLibp2p.peerId.multihash.digest); - expect(output.map(b => b.subarray())).to.deep.equal(input); - }); - it('intercept outbound upgraded', async () => { - const denyOutboundUpgradedConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyOutboundUpgradedConnection - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - const connection = await libp2p.dial(remoteLibp2p.peerId); - const stream = await connection.newStream(ECHO_PROTOCOL); - const input = [Uint8Array.from([0])]; - const output = await pipe(input, stream, async (source) => all(source)); - expect(denyOutboundUpgradedConnection.called).to.be.true(); - expect(denyOutboundUpgradedConnection.getCall(0)).to.have.nested.property('args[0].multihash.digest').that.equalBytes(remoteLibp2p.peerId.multihash.digest); - expect(output.map(b => b.subarray())).to.deep.equal(input); - }); - }); -}); -//# sourceMappingURL=index.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.node.js.map deleted file mode 100644 index 1d96b5d8e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file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C,MAAM,CAAC,CAAA;YACzD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;YACxD,MAAM,KAAK,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACpC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;YAEvE,MAAM,CAAC,8BAA8B,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;YAC1D,MAAM,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;YAC3J,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAC5D,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.spec.d.ts deleted file mode 100644 index b37c2d278..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.spec.d.ts.map deleted file mode 100644 index 2ed10ac80..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/index.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.spec.js deleted file mode 100644 index 3a90b5750..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.spec.js +++ /dev/null @@ -1,445 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { KEEP_ALIVE } from '@libp2p/interface/peer-store/tags'; -import { mockConnection, mockDuplex, mockMultiaddrConnection, mockMetrics } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { pEvent } from 'p-event'; -import pWaitFor from 'p-wait-for'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { DefaultConnectionManager } from '../../src/connection-manager/index.js'; -import { createBaseOptions } from '../fixtures/base-options.browser.js'; -import { createNode } from '../fixtures/creators/peer.js'; -const defaultOptions = { - maxConnections: 10, - minConnections: 1, - autoDialInterval: Infinity, - inboundUpgradeTimeout: 10000 -}; -function defaultComponents(peerId) { - return { - peerId, - peerStore: stubInterface(), - transportManager: stubInterface(), - connectionGater: stubInterface(), - events: new TypedEventEmitter(), - logger: defaultLogger() - }; -} -describe('Connection Manager', () => { - let libp2p; - let connectionManager; - afterEach(async () => { - sinon.restore(); - if (connectionManager != null) { - await connectionManager.stop(); - } - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('should be able to create without metrics', async () => { - libp2p = await createNode({ - config: createBaseOptions(), - started: false - }); - const spy = sinon.spy(libp2p.components.connectionManager, 'start'); - await libp2p.start(); - expect(spy).to.have.property('callCount', 1); - expect(libp2p.metrics).to.not.exist(); - }); - it('should be able to create with metrics', async () => { - libp2p = await createNode({ - config: createBaseOptions({ - metrics: mockMetrics() - }), - started: false - }); - const spy = sinon.spy(libp2p.components.connectionManager, 'start'); - await libp2p.start(); - expect(spy).to.have.property('callCount', 1); - expect(libp2p.metrics).to.exist(); - }); - it('should close connections with low tag values first', async () => { - const max = 5; - libp2p = await createNode({ - config: createBaseOptions({ - connectionManager: { - maxConnections: max, - minConnections: 2 - } - }), - started: false - }); - await libp2p.start(); - const connectionManager = libp2p.components.connectionManager; - const connectionManagerMaybePruneConnectionsSpy = sinon.spy(connectionManager.connectionPruner, 'maybePruneConnections'); - const spies = new Map(); - // wait for prune event - const eventPromise = pEvent(libp2p, 'connection:prune'); - // Add 1 connection too many - for (let i = 0; i < max + 1; i++) { - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), await createEd25519PeerId())); - const spy = sinon.spy(connection, 'close'); - const value = i * 10; - spies.set(value, spy); - await libp2p.peerStore.merge(connection.remotePeer, { - tags: { - 'test-tag': { - value - } - } - }); - libp2p.components.events.safeDispatchEvent('connection:open', { detail: connection }); - } - await eventPromise; - // get the lowest value - const lowest = Array.from(spies.keys()).sort((a, b) => { - if (a > b) { - return 1; - } - if (a < b) { - return -1; - } - return 0; - })[0]; - const lowestSpy = spies.get(lowest); - expect(connectionManagerMaybePruneConnectionsSpy.callCount).to.equal(6); - expect(lowestSpy).to.have.property('callCount', 1); - }); - it('should close shortest-lived connection if the tag values are equal', async () => { - const max = 5; - libp2p = await createNode({ - config: createBaseOptions({ - connectionManager: { - maxConnections: max, - minConnections: 2 - } - }), - started: false - }); - await libp2p.start(); - const connectionManager = libp2p.components.connectionManager; - const connectionManagerMaybePruneConnectionsSpy = sinon.spy(connectionManager.connectionPruner, 'maybePruneConnections'); - const spies = new Map(); - const eventPromise = pEvent(libp2p, 'connection:prune'); - const createConnection = async (value, open = Date.now(), peerTag = 'test-tag') => { - // #TODO: Mock the connection timeline to simulate an older connection - const connection = mockConnection(mockMultiaddrConnection({ ...mockDuplex(), timeline: { open } }, await createEd25519PeerId())); - const spy = sinon.spy(connection, 'close'); - // The lowest tag value will have the longest connection - spies.set(peerTag, spy); - await libp2p.peerStore.merge(connection.remotePeer, { - tags: { - [peerTag]: { - value - } - } - }); - libp2p.components.events.safeDispatchEvent('connection:open', { detail: connection }); - }; - // Create one short of enough connections to initiate pruning - for (let i = 1; i < max; i++) { - const value = i * 10; - await createConnection(value); - } - const value = 0 * 10; - // Add a connection with the lowest tag value BUT the longest lived connection - await createConnection(value, 18000, 'longest'); - // Add one more connection with the lowest tag value BUT the shortest-lived connection - await createConnection(value, Date.now(), 'shortest'); - // wait for prune event - await eventPromise; - // get the lowest tagged value, but this would be also the longest lived connection - const longestLivedWithLowestTagSpy = spies.get('longest'); - // Get lowest tagged connection but with a shorter-lived connection - const shortestLivedWithLowestTagSpy = spies.get('shortest'); - expect(connectionManagerMaybePruneConnectionsSpy.callCount).to.equal(6); - expect(longestLivedWithLowestTagSpy).to.have.property('callCount', 0); - expect(shortestLivedWithLowestTagSpy).to.have.property('callCount', 1); - }); - it('should not close connection that is on the allowlist when pruning', async () => { - const max = 2; - const remoteAddr = multiaddr('/ip4/83.13.55.32/tcp/59283'); - libp2p = await createNode({ - config: createBaseOptions({ - connectionManager: { - maxConnections: max, - minConnections: 0, - allow: [ - '/ip4/83.13.55.32' - ] - } - }), - started: false - }); - await libp2p.start(); - const connectionManager = libp2p.components.connectionManager; - const connectionManagerMaybePruneConnectionsSpy = sinon.spy(connectionManager.connectionPruner, 'maybePruneConnections'); - const spies = new Map(); - const eventPromise = pEvent(libp2p, 'connection:prune'); - // Max out connections - for (let i = 0; i < max; i++) { - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), await createEd25519PeerId())); - const spy = sinon.spy(connection, 'close'); - const value = (i + 1) * 10; - spies.set(value, spy); - await libp2p.peerStore.merge(connection.remotePeer, { - tags: { - 'test-tag': { - value - } - } - }); - libp2p.components.events.safeDispatchEvent('connection:open', { detail: connection }); - } - // an outbound connection is opened from an address in the allow list - const remotePeer = await createEd25519PeerId(); - const connection = mockConnection(mockMultiaddrConnection({ - remoteAddr, - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, remotePeer)); - const value = 0; - const spy = sinon.spy(connection, 'close'); - spies.set(value, spy); - // Tag that allowed peer with lowest value - await libp2p.peerStore.merge(connection.remotePeer, { - tags: { - 'test-tag': { - value - } - } - }); - libp2p.components.events.safeDispatchEvent('connection:open', { detail: connection }); - // wait for prune event - await eventPromise; - // get the lowest value - const lowest = Array.from(spies.keys()).sort((a, b) => { - if (a > b) { - return 1; - } - if (a < b) { - return -1; - } - return 0; - })[0]; - const lowestSpy = spies.get(lowest); - expect(connectionManagerMaybePruneConnectionsSpy.callCount).to.equal(3); - // expect lowest value spy NOT to be called since the peer is in the allow list - expect(lowestSpy).to.have.property('callCount', 0); - }); - it('should close connection when the maximum connections has been reached even without tags', async () => { - const max = 5; - libp2p = await createNode({ - config: createBaseOptions({ - connectionManager: { - maxConnections: max, - minConnections: 0 - } - }), - started: false - }); - await libp2p.start(); - const connectionManager = libp2p.components.connectionManager; - const connectionManagerMaybePruneConnectionsSpy = sinon.spy(connectionManager.connectionPruner, 'maybePruneConnections'); - const eventPromise = pEvent(libp2p, 'connection:prune'); - // Add 1 too many connections - const spy = sinon.spy(); - for (let i = 0; i < max + 1; i++) { - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), await createEd25519PeerId())); - sinon.stub(connection, 'close').callsFake(async () => spy()); // eslint-disable-line - libp2p.components.events.safeDispatchEvent('connection:open', { detail: connection }); - } - // wait for prune event - await eventPromise; - expect(connectionManagerMaybePruneConnectionsSpy.callCount).to.equal(6); - expect(spy).to.have.property('callCount', 1); - }); - it('should fail if the connection manager has mismatched connection limit options', async () => { - await expect(createNode({ - config: createBaseOptions({ - connectionManager: { - maxConnections: 5, - minConnections: 6 - } - }), - started: false - })).to.eventually.rejected('maxConnections must be greater'); - }); - it('should reconnect to important peers on startup', async () => { - const peerId = await createEd25519PeerId(); - libp2p = await createNode({ - config: createBaseOptions(), - started: false - }); - const connectionManager = libp2p.components.connectionManager; - const connectionManagerOpenConnectionSpy = sinon.spy(connectionManager, 'openConnection'); - await libp2p.start(); - expect(connectionManagerOpenConnectionSpy.called).to.be.false('Attempted to connect to peers'); - await libp2p.peerStore.merge(peerId, { - tags: { - [KEEP_ALIVE]: {} - } - }); - await libp2p.stop(); - await libp2p.start(); - await pWaitFor(() => connectionManagerOpenConnectionSpy.called, { - interval: 100 - }); - expect(connectionManagerOpenConnectionSpy.called).to.be.true('Did not attempt to connect to important peer'); - expect(connectionManagerOpenConnectionSpy.getCall(0).args[0].toString()).to.equal(peerId.toString(), 'Attempted to connect to the wrong peer'); - }); - it('should deny connections from denylist multiaddrs', async () => { - const remoteAddr = multiaddr('/ip4/83.13.55.32/tcp/59283'); - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - deny: [ - '/ip4/83.13.55.32' - ] - }); - await connectionManager.start(); - const remotePeer = await createEd25519PeerId(); - const maConn = mockMultiaddrConnection({ - remoteAddr, - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, remotePeer); - await expect(connectionManager.acceptIncomingConnection(maConn)) - .to.eventually.be.false(); - }); - it('should deny connections when maxConnections is exceeded', async () => { - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - maxConnections: 1 - }); - await connectionManager.start(); - sinon.stub(connectionManager.dialQueue, 'dial').resolves(stubInterface()); - // max out the connection limit - await connectionManager.openConnection(await createEd25519PeerId()); - expect(connectionManager.getConnections()).to.have.lengthOf(1); - // an inbound connection is opened - const remotePeer = await createEd25519PeerId(); - const maConn = mockMultiaddrConnection({ - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, remotePeer); - await expect(connectionManager.acceptIncomingConnection(maConn)) - .to.eventually.be.false(); - }); - it('should deny connections from peers that connect too frequently', async () => { - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - inboundConnectionThreshold: 1 - }); - await connectionManager.start(); - sinon.stub(connectionManager.dialQueue, 'dial').resolves(stubInterface()); - // an inbound connection is opened - const remotePeer = await createEd25519PeerId(); - const maConn = mockMultiaddrConnection({ - source: (async function* () { - yield* []; - })(), - sink: async () => { }, - // has to be thin waist, which it will be since we've not done the peer id handshake - // yet in the code being exercised by this test - remoteAddr: multiaddr('/ip4/34.4.63.125/tcp/4001') - }, remotePeer); - await expect(connectionManager.acceptIncomingConnection(maConn)) - .to.eventually.be.true(); - // connect again within a second - await expect(connectionManager.acceptIncomingConnection(maConn)) - .to.eventually.be.false(); - }); - it('should allow connections from allowlist multiaddrs', async () => { - const remoteAddr = multiaddr('/ip4/83.13.55.32/tcp/59283'); - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - maxConnections: 1, - allow: [ - '/ip4/83.13.55.32' - ] - }); - await connectionManager.start(); - sinon.stub(connectionManager.dialQueue, 'dial').resolves(stubInterface()); - // max out the connection limit - await connectionManager.openConnection(await createEd25519PeerId()); - expect(connectionManager.getConnections()).to.have.lengthOf(1); - // an inbound connection is opened from an address in the allow list - const remotePeer = await createEd25519PeerId(); - const maConn = mockMultiaddrConnection({ - remoteAddr, - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, remotePeer); - await expect(connectionManager.acceptIncomingConnection(maConn)) - .to.eventually.be.true(); - }); - it('should limit the number of inbound pending connections', async () => { - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - maxIncomingPendingConnections: 1 - }); - await connectionManager.start(); - sinon.stub(connectionManager.dialQueue, 'dial').resolves(stubInterface()); - // start the upgrade - const maConn1 = mockMultiaddrConnection({ - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, await createEd25519PeerId()); - await expect(connectionManager.acceptIncomingConnection(maConn1)) - .to.eventually.be.true(); - // start the upgrade - const maConn2 = mockMultiaddrConnection({ - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, await createEd25519PeerId()); - // should be false because we have not completed the upgrade of maConn1 - await expect(connectionManager.acceptIncomingConnection(maConn2)) - .to.eventually.be.false(); - // finish the maConn1 pending upgrade - connectionManager.afterUpgradeInbound(); - // should be true because we have now completed the upgrade of maConn1 - await expect(connectionManager.acceptIncomingConnection(maConn2)) - .to.eventually.be.true(); - }); - it('should allow dialing peers when an existing transient connection exists', async () => { - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - maxIncomingPendingConnections: 1 - }); - await connectionManager.start(); - const targetPeer = await createEd25519PeerId(); - const addr = multiaddr(`/ip4/123.123.123.123/tcp/123/p2p/${targetPeer}`); - const existingConnection = stubInterface({ - transient: true - }); - const newConnection = stubInterface(); - sinon.stub(connectionManager.dialQueue, 'dial') - .withArgs(addr) - .resolves(newConnection); - // we have an existing transient connection - const map = connectionManager.getConnectionsMap(); - map.set(targetPeer, [ - existingConnection - ]); - const conn = await connectionManager.openConnection(addr); - expect(conn).to.equal(newConnection); - }); -}); -//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.spec.js.map deleted file mode 100644 index 66230badf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/index.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../test/connection-manager/index.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AAC3H,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,wBAAwB,EAA2C,MAAM,uCAAuC,CAAA;AACzH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AASzD,MAAM,cAAc,GAAG;IACrB,cAAc,EAAE,EAAE;IAClB,cAAc,EAAE,CAAC;IACjB,gBAAgB,EAAE,QAAQ;IAC1B,qBAAqB,EAAE,KAAK;CAC7B,CAAA;AAED,SAAS,iBAAiB,CAAE,MAAc;IACxC,OAAO;QACL,MAAM;QACN,SAAS,EAAE,aAAa,EAAa;QACrC,gBAAgB,EAAE,aAAa,EAAoB;QACnD,eAAe,EAAE,aAAa,EAAmB;QACjD,MAAM,EAAE,IAAI,i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KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,MAAM,CAAC;aAC5C,QAAQ,CAAC,IAAI,CAAC;aACd,QAAQ,CAAC,aAAa,CAAC,CAAA;QAE1B,2CAA2C;QAC3C,MAAM,GAAG,GAAG,iBAAiB,CAAC,iBAAiB,EAAE,CAAA;QACjD,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE;YAClB,kBAAkB;SACnB,CAAC,CAAA;QAEF,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;QAEzD,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;IACtC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/resolver.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/resolver.spec.d.ts deleted file mode 100644 index f08a5bfbd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/resolver.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=resolver.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/resolver.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/resolver.spec.d.ts.map deleted file mode 100644 index 976ef1837..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/resolver.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolver.spec.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/resolver.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/resolver.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/resolver.spec.js deleted file mode 100644 index 3944ab008..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/resolver.spec.js +++ /dev/null @@ -1,221 +0,0 @@ -/* eslint-env mocha */ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { RELAY_V2_HOP_CODEC } from '@libp2p/circuit-relay-v2'; -import { circuitRelayServer, circuitRelayTransport } from '@libp2p/circuit-relay-v2'; -import { mockConnection, mockConnectionGater, mockDuplex, mockMultiaddrConnection } from '@libp2p/interface-compliance-tests/mocks'; -import { mplex } from '@libp2p/mplex'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import pDefer from 'p-defer'; -import sinon from 'sinon'; -import { codes as ErrorCodes } from '../../src/errors.js'; -import { createLibp2pNode } from '../../src/libp2p.js'; -const relayAddr = multiaddr(process.env.RELAY_MULTIADDR); -const getDnsaddrStub = (peerId) => [ - `/dnsaddr/ams-1.bootstrap.libp2p.io/p2p/${peerId.toString()}`, - `/dnsaddr/ams-2.bootstrap.libp2p.io/p2p/${peerId.toString()}`, - `/dnsaddr/lon-1.bootstrap.libp2p.io/p2p/${peerId.toString()}`, - `/dnsaddr/nrt-1.bootstrap.libp2p.io/p2p/${peerId.toString()}`, - `/dnsaddr/nyc-1.bootstrap.libp2p.io/p2p/${peerId.toString()}`, - `/dnsaddr/sfo-2.bootstrap.libp2p.io/p2p/${peerId.toString()}` -]; -const relayedAddr = (peerId) => `${relayAddr.toString()}/p2p-circuit/p2p/${peerId.toString()}`; -const getDnsRelayedAddrStub = (peerId) => [ - `${relayedAddr(peerId)}` -]; -describe('dialing (resolvable addresses)', () => { - let libp2p; - let remoteLibp2p; - let resolver; - beforeEach(async () => { - resolver = sinon.stub(); - [libp2p, remoteLibp2p] = await Promise.all([ - createLibp2pNode({ - addresses: { - listen: [`${relayAddr.toString()}/p2p-circuit`] - }, - transports: [ - circuitRelayTransport(), - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionManager: { - resolvers: { - dnsaddr: resolver - } - }, - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }), - createLibp2pNode({ - addresses: { - listen: [`${relayAddr.toString()}/p2p-circuit`] - }, - transports: [ - circuitRelayTransport(), - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionManager: { - resolvers: { - dnsaddr: resolver - } - }, - connectionEncryption: [ - plaintext() - ], - services: { - relay: circuitRelayServer() - }, - connectionGater: mockConnectionGater() - }) - ]); - await Promise.all([ - libp2p.start(), - remoteLibp2p.start() - ]); - }); - afterEach(async () => { - sinon.restore(); - await Promise.all([libp2p, remoteLibp2p].map(async (n) => { - if (n != null) { - await n.stop(); - } - })); - }); - it('resolves dnsaddr to ws local address', async () => { - const peerId = await createEd25519PeerId(); - // ensure remote libp2p creates reservation on relay - await remoteLibp2p.peerStore.merge(peerId, { - protocols: [RELAY_V2_HOP_CODEC] - }); - const remoteId = remoteLibp2p.peerId; - const dialAddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remoteId.toString()}`); - const relayedAddrFetched = multiaddr(relayedAddr(remoteId)); - // Transport spy - const transport = getTransport(libp2p, 'libp2p/circuit-relay-v2'); - const transportDialSpy = sinon.spy(transport, 'dial'); - // Resolver stub - resolver.onCall(0).returns(Promise.resolve(getDnsRelayedAddrStub(remoteId))); - // Dial with address resolve - const connection = await libp2p.dial(dialAddr); - expect(connection).to.exist(); - expect(connection.remoteAddr.equals(relayedAddrFetched)); - const dialArgs = transportDialSpy.firstCall.args; - expect(dialArgs[0].equals(relayedAddrFetched)).to.eql(true); - }); - it('resolves a dnsaddr recursively', async () => { - const remoteId = remoteLibp2p.peerId; - const dialAddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remoteId.toString()}`); - const relayedAddrFetched = multiaddr(relayedAddr(remoteId)); - const relayId = await createEd25519PeerId(); - // ensure remote libp2p creates reservation on relay - await remoteLibp2p.peerStore.merge(relayId, { - protocols: [RELAY_V2_HOP_CODEC] - }); - // Transport spy - const transport = getTransport(libp2p, 'libp2p/circuit-relay-v2'); - const transportDialSpy = sinon.spy(transport, 'dial'); - // Resolver stub - let firstCall = false; - resolver.callsFake(async () => { - if (!firstCall) { - firstCall = true; - // Return an array of dnsaddr - return Promise.resolve(getDnsaddrStub(remoteId)); - } - return Promise.resolve(getDnsRelayedAddrStub(remoteId)); - }); - // Dial with address resolve - const connection = await libp2p.dial(dialAddr); - expect(connection).to.exist(); - expect(connection.remoteAddr.equals(relayedAddrFetched)); - const dialArgs = transportDialSpy.firstCall.args; - expect(dialArgs[0].equals(relayedAddrFetched)).to.eql(true); - }); - // TODO: Temporary solution does not resolve dns4/dns6 - // Resolver just returns the received multiaddrs - it('stops recursive resolve if finds dns4/dns6 and dials it', async () => { - const remoteId = remoteLibp2p.peerId; - const dialAddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remoteId.toString()}`); - // Stub resolver - const dnsMa = multiaddr(`/dns4/ams-1.remote.libp2p.io/tcp/443/wss/p2p/${remoteId.toString()}`); - resolver.returns(Promise.resolve([ - `${dnsMa.toString()}` - ])); - const deferred = pDefer(); - // Stub transport - const transport = getTransport(libp2p, '@libp2p/websockets'); - const stubTransport = sinon.stub(transport, 'dial'); - stubTransport.callsFake(async (multiaddr) => { - expect(multiaddr.equals(dnsMa)).to.equal(true); - deferred.resolve(); - return mockConnection(mockMultiaddrConnection(mockDuplex(), peerIdFromString(multiaddr.getPeerId() ?? ''))); - }); - void libp2p.dial(dialAddr); - await deferred.promise; - }); - it('resolves a dnsaddr recursively not failing if one address fails to resolve', async () => { - const remoteId = remoteLibp2p.peerId; - const dialAddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remoteId.toString()}`); - const relayedAddrFetched = multiaddr(relayedAddr(remoteId)); - const relayId = await createEd25519PeerId(); - // ensure remote libp2p creates reservation on relay - await remoteLibp2p.peerStore.merge(relayId, { - protocols: [RELAY_V2_HOP_CODEC] - }); - // Transport spy - const transport = getTransport(libp2p, 'libp2p/circuit-relay-v2'); - const transportDialSpy = sinon.spy(transport, 'dial'); - // Resolver stub - resolver.onCall(0).callsFake(async () => Promise.resolve(getDnsaddrStub(remoteId))); - resolver.onCall(1).callsFake(async () => Promise.reject(new Error())); - resolver.callsFake(async () => Promise.resolve(getDnsRelayedAddrStub(remoteId))); - // Dial with address resolve - const connection = await libp2p.dial(dialAddr); - expect(connection).to.exist(); - expect(connection.remoteAddr.equals(relayedAddrFetched)); - const dialArgs = transportDialSpy.firstCall.args; - expect(dialArgs[0].equals(relayedAddrFetched)).to.eql(true); - }); - it('fails to dial if resolve fails and there are no addresses to dial', async () => { - const remoteId = remoteLibp2p.peerId; - const dialAddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remoteId.toString()}`); - // Stub resolver - resolver.returns(Promise.reject(new Error())); - // Stub transport - const transport = getTransport(libp2p, '@libp2p/websockets'); - const spy = sinon.spy(transport, 'dial'); - await expect(libp2p.dial(dialAddr)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - expect(spy.callCount).to.eql(0); - }); -}); -function getTransport(libp2p, tag) { - const transport = libp2p.components.transportManager.getTransports().find(t => { - return t[Symbol.toStringTag] === tag; - }); - if (transport != null) { - return transport; - } - throw new Error(`No transport found for ${tag}`); -} -//# sourceMappingURL=resolver.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/resolver.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/resolver.spec.js.map deleted file mode 100644 index 705bf09ee..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection-manager/resolver.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolver.spec.js","sourceRoot":"","sources":["../../../test/connection-manager/resolver.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAA4B,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAC9G,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAA;AACnI,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,gBAAgB,E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SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;QAC5E,OAAO,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,GAAG,CAAA;IACtC,CAAC,CAAC,CAAA;IAEF,IAAI,SAAS,IAAI,IAAI,EAAE;QACrB,OAAO,SAAS,CAAA;KACjB;IAED,MAAM,IAAI,KAAK,CAAC,0BAA0B,GAAG,EAAE,CAAC,CAAA;AAClD,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/compliance.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/compliance.spec.d.ts deleted file mode 100644 index dac08d9d2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/compliance.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=compliance.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/compliance.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/compliance.spec.d.ts.map deleted file mode 100644 index 182587254..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/compliance.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.d.ts","sourceRoot":"","sources":["../../../test/connection/compliance.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/compliance.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/compliance.spec.js deleted file mode 100644 index f8761d588..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/compliance.spec.js +++ /dev/null @@ -1,72 +0,0 @@ -import tests from '@libp2p/interface-compliance-tests/connection'; -import peers from '@libp2p/interface-compliance-tests/peers'; -import { logger, peerLogger } from '@libp2p/logger'; -import * as PeerIdFactory from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import { createConnection } from '../../src/connection/index.js'; -import { pair } from './fixtures/pair.js'; -describe('connection compliance', () => { - tests({ - /** - * Test setup. `properties` allows the compliance test to override - * certain values for testing. - */ - async setup(properties) { - const localPeer = await PeerIdFactory.createEd25519PeerId(); - const remoteAddr = multiaddr('/ip4/127.0.0.1/tcp/8081'); - const remotePeer = await PeerIdFactory.createFromJSON(peers[0]); - let openStreams = []; - let streamId = 0; - const connection = createConnection({ - remotePeer, - remoteAddr, - timeline: { - open: Date.now() - 10, - upgraded: Date.now() - }, - direction: 'outbound', - encryption: '/secio/1.0.0', - multiplexer: '/mplex/6.7.0', - status: 'open', - logger: peerLogger(localPeer), - newStream: async (protocols) => { - const id = `${streamId++}`; - const stream = { - ...pair(), - close: async () => { - void stream.sink(async function* () { }()); - openStreams = openStreams.filter(s => s.id !== id); - }, - closeRead: async () => { }, - closeWrite: async () => { - void stream.sink(async function* () { }()); - }, - id, - abort: () => { }, - direction: 'outbound', - protocol: protocols[0], - timeline: { - open: 0 - }, - metadata: {}, - status: 'open', - writeStatus: 'ready', - readStatus: 'ready', - log: logger('test') - }; - openStreams.push(stream); - return stream; - }, - close: async () => { }, - abort: () => { }, - getStreams: () => openStreams, - ...properties - }); - return connection; - }, - async teardown() { - // cleanup resources created by setup() - } - }); -}); -//# sourceMappingURL=compliance.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/compliance.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/compliance.spec.js.map deleted file mode 100644 index 159229d1f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/compliance.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.js","sourceRoot":"","sources":["../../../test/connection/compliance.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,+CAA+C,CAAA;AACjE,OAAO,KAAK,MAAM,0CAA0C,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,aAAa,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAGzC,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,KAAK,CAAC;QACJ;;;WAGG;QACH,KAAK,CAAC,KAAK,CAAE,UAAU;YACrB,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC,mBAAmB,EAAE,CAAA;YAC3D,MAAM,UAAU,GAAG,SAAS,CAAC,yBAAyB,CAAC,CAAA;YACvD,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;YAC/D,IAAI,WAAW,GAAa,EAAE,CAAA;YAC9B,IAAI,QAAQ,GAAG,CAAC,CAAA;YAEhB,MAAM,UAAU,GAAG,gBAAgB,CAAC;gBAClC,UAAU;gBACV,UAAU;gBACV,QAAQ,EAAE;oBACR,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE;oBACrB,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE;iBACrB;gBACD,SAAS,EAAE,UAAU;gBACrB,UAAU,EAAE,cAAc;gBAC1B,WAA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AAG,UAAU;aACd,CAAC,CAAA;YACF,OAAO,UAAU,CAAA;QACnB,CAAC;QACD,KAAK,CAAC,QAAQ;YACZ,uCAAuC;QACzC,CAAC;KACF,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/fixtures/pair.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/fixtures/pair.d.ts deleted file mode 100644 index 1d866b335..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/fixtures/pair.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import type { Source, Duplex } from 'it-stream-types'; -/** - * A pair of streams where one drains from the other - */ -export declare function pair(): Duplex, Source, Promise>; -//# sourceMappingURL=pair.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/fixtures/pair.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/fixtures/pair.d.ts.map deleted file mode 100644 index b5f8d6292..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/fixtures/pair.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pair.d.ts","sourceRoot":"","sources":["../../../../test/connection/fixtures/pair.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAErD;;GAEG;AACH,wBAAgB,IAAI,IAAK,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,cAAc,GAAG,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAmBlH"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/fixtures/pair.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/fixtures/pair.js deleted file mode 100644 index e5b3f71c5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/fixtures/pair.js +++ /dev/null @@ -1,24 +0,0 @@ -import map from 'it-map'; -import defer from 'p-defer'; -import { Uint8ArrayList } from 'uint8arraylist'; -/** - * A pair of streams where one drains from the other - */ -export function pair() { - const deferred = defer(); - let piped = false; - return { - sink: async (source) => { - if (piped) { - throw new Error('already piped'); - } - piped = true; - deferred.resolve(source); - }, - source: (async function* () { - const source = await deferred.promise; - yield* map(source, (buf) => buf instanceof Uint8Array ? new Uint8ArrayList(buf) : buf); - }()) - }; -} -//# sourceMappingURL=pair.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/fixtures/pair.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/fixtures/pair.js.map deleted file mode 100644 index 0f5932345..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/fixtures/pair.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pair.js","sourceRoot":"","sources":["../../../../test/connection/fixtures/pair.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,QAAQ,CAAA;AACxB,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAG/C;;GAEG;AACH,MAAM,UAAU,IAAI;IAClB,MAAM,QAAQ,GAAG,KAAK,EAAuC,CAAA;IAC7D,IAAI,KAAK,GAAG,KAAK,CAAA;IAEjB,OAAO;QACL,IAAI,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;YACnB,IAAI,KAAK,EAAE;gBACT,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;aACjC;YAED,KAAK,GAAG,IAAI,CAAA;YACZ,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAC1B,CAAC;QACD,MAAM,EAAE,CAAC,KAAK,SAAU,CAAC;YACvB,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAA;YAErC,KAAM,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,YAAY,UAAU,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;QACzF,CAAC,EAAE,CAAC;KACL,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/index.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/index.spec.d.ts deleted file mode 100644 index b37c2d278..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/index.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/index.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/index.spec.d.ts.map deleted file mode 100644 index 99cb1ba5b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/index.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../../test/connection/index.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/index.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/index.spec.js deleted file mode 100644 index 2024f76a3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/index.spec.js +++ /dev/null @@ -1,53 +0,0 @@ -import { defaultLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import Sinon from 'sinon'; -import { createConnection } from '../../src/connection/index.js'; -function defaultConnectionInit() { - return { - timeline: { - open: Date.now() - 10, - upgraded: Date.now() - }, - direction: 'outbound', - encryption: '/secio/1.0.0', - multiplexer: '/mplex/6.7.0', - status: 'open', - newStream: Sinon.stub(), - close: Sinon.stub(), - abort: Sinon.stub(), - getStreams: Sinon.stub(), - logger: defaultLogger() - }; -} -describe('connection', () => { - it('should not require local or remote addrs', async () => { - const remotePeer = await createEd25519PeerId(); - return createConnection({ - remotePeer, - remoteAddr: multiaddr('/ip4/127.0.0.1/tcp/4002'), - ...defaultConnectionInit() - }); - }); - it('should append remote peer id to address if not already present', async () => { - const remotePeer = await createEd25519PeerId(); - const conn = createConnection({ - remotePeer, - remoteAddr: multiaddr('/ip4/127.0.0.1/tcp/4002'), - ...defaultConnectionInit() - }); - expect(conn.remoteAddr.getPeerId()).to.equal(remotePeer.toString()); - }); - it('should not append remote peer id to address if present', async () => { - const remotePeer = await createEd25519PeerId(); - const otherPeer = await createEd25519PeerId(); - const conn = createConnection({ - remotePeer, - remoteAddr: multiaddr(`/ip4/127.0.0.1/tcp/4002/p2p/${otherPeer}`), - ...defaultConnectionInit() - }); - expect(conn.remoteAddr.getPeerId()).to.equal(otherPeer.toString()); - }); -}); -//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/index.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/index.spec.js.map deleted file mode 100644 index c3e9bc2cf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/connection/index.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../test/connection/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAEhE,SAAS,qBAAqB;IAC5B,OAAO;QACL,QAAQ,EAAE;YACR,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE;YACrB,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE;SACrB;QACD,SAAS,EAAE,UAAU;QACrB,UAAU,EAAE,cAAc;QAC1B,WAAW,EAAE,cAAc;QAC3B,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,KAAK,CAAC,IAAI,EAAE;QACvB,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE;QACnB,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE;QACnB,UAAU,EAAE,KAAK,CAAC,IAAI,EAAE;QACxB,MAAM,EAAE,aAAa,EAAE;KACxB,CAAA;AACH,CAAC;AAED,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,UAAU,GAAG,MAAM,mBAAmB,EAAE,CAAA;QAE9C,OAAO,gBAAgB,CAAC;YACtB,UAAU;YACV,UAAU,EAAE,SAAS,CAAC,yBAAyB,CAAC;YAChD,GAAG,qBAAqB,EAAE;SAC3B,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gEAAgE,EAAE,KAAK,IAAI,EAAE;QAC9E,MAAM,UAAU,GAAG,MAAM,mBAAmB,EAAE,CAAA;QAE9C,MAAM,IAAI,GAAG,gBAAgB,CAAC;YAC5B,UAAU;YACV,UAAU,EAAE,SAAS,CAAC,yBAAyB,CAAC;YAChD,GAAG,qBAAqB,EAAE;SAC3B,CAAC,CAAA;QAEF,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAA;IACrE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACtE,MAAM,UAAU,GAAG,MAAM,mBAAmB,EAAE,CAAA;QAC9C,MAAM,SAAS,GAAG,MAAM,mBAAmB,EAAE,CAAA;QAE7C,MAAM,IAAI,GAAG,gBAAgB,CAAC;YAC5B,UAAU;YACV,UAAU,EAAE,SAAS,CAAC,+BAA+B,SAAS,EAAE,CAAC;YACjE,GAAG,qBAAqB,EAAE;SAC3B,CAAC,CAAA;QAEF,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAA;IACpE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/content-routing.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/content-routing.node.d.ts deleted file mode 100644 index 36e6e389e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/content-routing.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=content-routing.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/content-routing.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/content-routing.node.d.ts.map deleted file mode 100644 index e37f9e48b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/content-routing.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"content-routing.node.d.ts","sourceRoot":"","sources":["../../../test/content-routing/content-routing.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/content-routing.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/content-routing.node.js deleted file mode 100644 index f0efca1f7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/content-routing.node.js +++ /dev/null @@ -1,378 +0,0 @@ -/* eslint-env mocha */ -import { EventTypes } from '@libp2p/kad-dht'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import all from 'it-all'; -import drain from 'it-drain'; -import { CID } from 'multiformats/cid'; -import pDefer from 'p-defer'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { createLibp2p } from '../../src/index.js'; -import { createBaseOptions } from '../fixtures/base-options.js'; -import { createNode, createPeerId, populateAddressBooks } from '../fixtures/creators/peer.js'; -import { createRoutingOptions } from './utils.js'; -describe('content-routing', () => { - describe('no routers', () => { - let node; - before(async () => { - node = await createNode({ - config: createBaseOptions() - }); - }); - after(async () => { await node.stop(); }); - it('.findProviders should return an error', async () => { - try { - // @ts-expect-error invalid params - for await (const _ of node.contentRouting.findProviders('a cid')) { } // eslint-disable-line - throw new Error('.findProviders should return an error'); - } - catch (err) { - expect(err).to.exist(); - expect(err.code).to.equal('ERR_NO_ROUTERS_AVAILABLE'); - } - }); - it('.provide should return an error', async () => { - // @ts-expect-error invalid params - await expect(node.contentRouting.provide('a cid')) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_NO_ROUTERS_AVAILABLE'); - }); - }); - describe('via dht router', () => { - const number = 5; - let nodes; - before(async () => { - nodes = await Promise.all([ - createLibp2p(createRoutingOptions()), - createLibp2p(createRoutingOptions()), - createLibp2p(createRoutingOptions()), - createLibp2p(createRoutingOptions()), - createLibp2p(createRoutingOptions()) - ]); - await populateAddressBooks(nodes); - // Ring dial - await Promise.all(nodes.map(async (peer, i) => peer.dial(nodes[(i + 1) % number].peerId))); - }); - afterEach(() => { - sinon.restore(); - }); - after(async () => Promise.all(nodes.map(async (n) => { await n.stop(); }))); - it('should use the nodes dht to provide', async () => { - const deferred = pDefer(); - if (nodes[0].services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(nodes[0].services.dht, 'provide').callsFake(async function* () { - deferred.resolve(); - }); - void nodes[0].contentRouting.provide(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB')); - return deferred.promise; - }); - it('should use the nodes dht to find providers', async () => { - const deferred = pDefer(); - if (nodes[0].services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(nodes[0].services.dht, 'findProviders').callsFake(async function* () { - yield { - from: nodes[0].peerId, - type: EventTypes.PROVIDER, - name: 'PROVIDER', - providers: [{ - id: nodes[0].peerId, - multiaddrs: [], - protocols: [] - }] - }; - deferred.resolve(); - }); - await drain(nodes[0].contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))); - return deferred.promise; - }); - }); - describe('via delegate router', () => { - let node; - let delegate; - beforeEach(async () => { - delegate = stubInterface(); - delegate.provide.returns(Promise.resolve()); - delegate.findProviders.returns(async function* () { }()); - node = await createNode({ - config: createBaseOptions({ - contentRouters: [ - () => delegate - ] - }) - }); - }); - afterEach(async () => { - if (node != null) { - await node.stop(); - } - sinon.restore(); - }); - it('should use the delegate router to provide', async () => { - const deferred = pDefer(); - delegate.provide.callsFake(async () => { - deferred.resolve(); - }); - void node.contentRouting.provide(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB')); - return deferred.promise; - }); - it('should use the delegate router to find providers', async () => { - const deferred = pDefer(); - delegate.findProviders.returns(async function* () { - yield { - id: node.peerId, - multiaddrs: [], - protocols: [] - }; - deferred.resolve(); - }()); - await drain(node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))); - return deferred.promise; - }); - it('should be able to register as a provider', async () => { - const cid = CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'); - await node.contentRouting.provide(cid); - expect(delegate.provide.calledWith(cid)).to.equal(true); - }); - it('should handle errors when registering as a provider', async () => { - const cid = CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'); - delegate.provide.withArgs(cid).throws(new Error('Could not provide')); - await expect(node.contentRouting.provide(cid)) - .to.eventually.be.rejected() - .with.property('message', 'Could not provide'); - }); - it('should be able to find providers', async () => { - const cid = CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'); - const provider = 'QmZNgCqZCvTsi3B4Vt7gsSqpkqDpE7M2Y9TDmEhbDb4ceF'; - delegate.findProviders.withArgs(cid).returns(async function* () { - yield { - id: peerIdFromString(provider), - multiaddrs: [ - multiaddr('/ip4/0.0.0.0/tcp/0') - ], - protocols: [] - }; - }()); - const providers = await all(node.contentRouting.findProviders(cid)); - expect(providers).to.have.length(1); - expect(providers[0].id.toString()).to.equal(provider); - }); - it('should handle errors when finding providers', async () => { - const cid = CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'); - delegate.findProviders.withArgs(cid).throws(new Error('Could not find providers')); - await expect(drain(node.contentRouting.findProviders(cid))) - .to.eventually.be.rejected() - .with.property('message', 'Could not find providers'); - }); - }); - describe('via dht and delegate routers', () => { - let node; - let delegate; - beforeEach(async () => { - delegate = stubInterface(); - delegate.provide.returns(Promise.resolve()); - delegate.findProviders.returns(async function* () { }()); - node = await createNode({ - config: createRoutingOptions({ - contentRouters: [ - () => delegate - ] - }) - }); - }); - afterEach(() => { - sinon.restore(); - }); - afterEach(async () => { await node.stop(); }); - it('should store the multiaddrs of a peer', async () => { - const providerPeerId = await createPeerId(); - const result = { - id: providerPeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/49320') - ] - }; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { }); - delegate.findProviders.callsFake(async function* () { - yield result; - }); - expect(await node.peerStore.has(providerPeerId)).to.not.be.ok(); - await drain(node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))); - await expect(node.peerStore.get(providerPeerId)).to.eventually.have.property('addresses').that.deep.include({ - isCertified: false, - multiaddr: result.multiaddrs[0] - }); - }); - it('should not wait for routing findProviders to finish before returning results', async () => { - const providerPeerId = await createPeerId(); - const result = { - id: providerPeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/49320') - ], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - const defer = pDefer(); - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { - await defer.promise; - }); - delegate.findProviders.callsFake(async function* () { - yield result; - await defer.promise; - }); - for await (const provider of node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))) { - expect(provider.id).to.deep.equal(providerPeerId); - defer.resolve(); - } - }); - it('should dedupe results', async () => { - const providerPeerId = await createPeerId(); - const result = { - id: providerPeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/49320') - ], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { - yield { - from: providerPeerId, - type: EventTypes.PROVIDER, - name: 'PROVIDER', - providers: [ - result - ] - }; - }); - delegate.findProviders.callsFake(async function* () { - yield result; - }); - const results = await all(node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))); - expect(results).to.be.an('array').with.lengthOf(1).that.deep.equals([result]); - }); - it('should combine multiaddrs when different addresses are returned by different content routers', async () => { - const providerPeerId = await createPeerId(); - const result1 = { - id: providerPeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/49320') - ], - protocols: [] - }; - const result2 = { - id: providerPeerId, - multiaddrs: [ - multiaddr('/ip4/213.213.213.213/tcp/2344') - ], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { - yield { - from: providerPeerId, - type: EventTypes.PROVIDER, - name: 'PROVIDER', - providers: [ - result1 - ] - }; - }); - delegate.findProviders.callsFake(async function* () { - yield result2; - }); - await drain(node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))); - await expect(node.peerStore.get(providerPeerId)).to.eventually.have.property('addresses').that.deep.include({ - isCertified: false, - multiaddr: result1.multiaddrs[0] - }).and.to.deep.include({ - isCertified: false, - multiaddr: result2.multiaddrs[0] - }); - }); - it('should use both the dht and delegate router to provide', async () => { - const dhtDeferred = pDefer(); - const delegatedDeferred = pDefer(); - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'provide').callsFake(async function* () { - dhtDeferred.resolve(); - }); - delegate.provide.callsFake(async function () { - delegatedDeferred.resolve(); - }); - await node.contentRouting.provide(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB')); - await Promise.all([ - dhtDeferred.promise, - delegatedDeferred.promise - ]); - }); - it('should use the dht if the delegate fails to find providers', async () => { - const providerPeerId = await createPeerId(); - const results = [{ - id: providerPeerId, - multiaddrs: [], - protocols: [] - }]; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { - yield { - from: providerPeerId, - type: EventTypes.PROVIDER, - name: 'PROVIDER', - providers: [ - results[0] - ] - }; - }); - delegate.findProviders.callsFake(async function* () { - }); - const providers = []; - for await (const prov of node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))) { - providers.push(prov); - } - expect(providers).to.have.length.above(0); - expect(providers).to.eql(results); - }); - it('should use the delegate if the dht fails to find providers', async () => { - const providerPeerId = await createPeerId(); - const results = [{ - id: providerPeerId, - multiaddrs: [], - protocols: [] - }]; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { }); - delegate.findProviders.callsFake(async function* () { - yield results[0]; - }); - const providers = []; - for await (const prov of node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))) { - providers.push(prov); - } - expect(providers).to.have.length.above(0); - expect(providers).to.eql(results); - }); - }); -}); -//# sourceMappingURL=content-routing.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/content-routing.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/content-routing.node.js.map deleted file mode 100644 index c4d01da22..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/content-routing.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"content-routing.node.js","sourceRoot":"","sources":["../../../test/content-routing/content-routing.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,UAAU,EAAe,MAAM,iBAAiB,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,GAAG,MAAM,QAAQ,CAAA;AACxB,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAwB,aAAa,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAe,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAIjD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;QAC1B,IAAI,IAAY,CAAA;QAEhB,MAAM,CAAC,KAAK,IAAI,EAAE;YAChB,IAAI,GAAG,MAAM,UAAU,CAAC;gBACtB,MAAM,EAAE,iBAAiB,EAAE;aAC5B,CAAC,CAAA;QACJ,C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Ac;oBAClB,UAAU,EAAE,EAAE;oBACd,SAAS,EAAE,EAAE;iBACd,CAAC,CAAA;YAEF,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,IAAI,EAAE;gBAC7B,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;aAC1C;YAED,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,SAAS,CAAC,KAAK,SAAU,CAAC,MAAK,CAAC,CAAC,CAAA;YAEhF,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,SAAU,CAAC;gBAC/C,MAAM,OAAO,CAAC,CAAC,CAAC,CAAA;YAClB,CAAC,CAAC,CAAA;YAEF,MAAM,SAAS,GAAG,EAAE,CAAA;YACpB,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC,EAAE;gBACvH,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;aACrB;YAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YACzC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QACnC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/operation.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/operation.node.d.ts deleted file mode 100644 index 1cf770100..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/operation.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=operation.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/operation.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/operation.node.d.ts.map deleted file mode 100644 index 698f65880..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/operation.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"operation.node.d.ts","sourceRoot":"","sources":["../../../../test/content-routing/dht/operation.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/operation.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/operation.node.js deleted file mode 100644 index 83b2e9daa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/operation.node.js +++ /dev/null @@ -1,119 +0,0 @@ -/* eslint-env mocha */ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { kadDHT } from '@libp2p/kad-dht'; -import { mplex } from '@libp2p/mplex'; -import { plaintext } from '@libp2p/plaintext'; -import { tcp } from '@libp2p/tcp'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import pWaitFor from 'p-wait-for'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { createLibp2p } from '../../../src/index.js'; -import { createPeerId } from '../../fixtures/creators/peer.js'; -import { subsystemMulticodecs } from './utils.js'; -const listenAddr = multiaddr('/ip4/127.0.0.1/tcp/8000'); -const remoteListenAddr = multiaddr('/ip4/127.0.0.1/tcp/8001'); -async function getRemoteAddr(remotePeerId, libp2p) { - const { addresses } = await libp2p.peerStore.get(remotePeerId); - if (addresses.length === 0) { - throw new Error('No addrs found'); - } - const addr = addresses[0]; - return addr.multiaddr.encapsulate(`/p2p/${remotePeerId.toString()}`); -} -describe('DHT subsystem operates correctly', () => { - let peerId; - let remotePeerId; - let libp2p; - let remoteLibp2p; - let remAddr; - beforeEach(async () => { - [peerId, remotePeerId] = await Promise.all([ - createPeerId(), - createPeerId() - ]); - }); - describe('dht started before connect', () => { - beforeEach(async () => { - libp2p = await createLibp2p({ - peerId, - addresses: { - listen: [listenAddr.toString()] - }, - transports: [ - tcp() - ], - connectionEncryption: [ - plaintext() - ], - streamMuxers: [ - yamux(), - mplex() - ], - services: { - dht: kadDHT({ - allowQueryWithZeroPeers: true - }) - } - }); - remoteLibp2p = await createLibp2p({ - peerId: remotePeerId, - addresses: { - listen: [remoteListenAddr.toString()] - }, - transports: [ - tcp() - ], - connectionEncryption: [ - plaintext() - ], - streamMuxers: [ - yamux(), - mplex() - ], - services: { - dht: kadDHT({ - allowQueryWithZeroPeers: true - }) - } - }); - await Promise.all([ - libp2p.start(), - remoteLibp2p.start() - ]); - await libp2p.peerStore.patch(remotePeerId, { - multiaddrs: [remoteListenAddr] - }); - remAddr = await getRemoteAddr(remotePeerId, libp2p); - }); - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - if (remoteLibp2p != null) { - await remoteLibp2p.stop(); - } - }); - it('should get notified of connected peers on dial', async () => { - const stream = await libp2p.dialProtocol(remAddr, subsystemMulticodecs); - expect(stream).to.exist(); - return Promise.all([ - pWaitFor(() => libp2p.services.dht.lan.routingTable.size === 1), - pWaitFor(() => remoteLibp2p.services.dht.lan.routingTable.size === 1) - ]); - }); - it('should put on a peer and get from the other', async () => { - const key = uint8ArrayFromString('hello'); - const value = uint8ArrayFromString('world'); - await libp2p.dialProtocol(remotePeerId, subsystemMulticodecs); - await Promise.all([ - pWaitFor(() => libp2p.services.dht.lan.routingTable.size === 1), - pWaitFor(() => remoteLibp2p.services.dht.lan.routingTable.size === 1) - ]); - await libp2p.contentRouting.put(key, value); - const fetchedValue = await remoteLibp2p.contentRouting.get(key); - expect(fetchedValue).to.equalBytes(value); - }); - }); -}); -//# sourceMappingURL=operation.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/operation.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/operation.node.js.map deleted file mode 100644 index 55800e26a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/operation.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"operation.node.js","sourceRoot":"","sources":["../../../../test/content-routing/dht/operation.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAMjD,MAAM,UAAU,GAAG,SAAS,CAAC,yBAAyB,CAAC,CAAA;AACvD,MAAM,gBAAgB,GAAG,S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nagle/libp2p/dist/test/content-routing/dht/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/utils.d.ts deleted file mode 100644 index 8334a000c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/utils.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const subsystemMulticodecs: string[]; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/utils.d.ts.map deleted file mode 100644 index de0b19e10..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../test/content-routing/dht/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,UAGhC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/utils.js deleted file mode 100644 index 9cc3c44f0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/utils.js +++ /dev/null @@ -1,5 +0,0 @@ -export const subsystemMulticodecs = [ - '/ipfs/lan/kad/1.0.0', - '/other/1.0.0' -]; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/utils.js.map deleted file mode 100644 index c3b8faf94..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/dht/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../test/content-routing/dht/utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,qBAAqB;IACrB,cAAc;CACf,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/utils.d.ts deleted file mode 100644 index 3d1c83fcd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/utils.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Libp2pOptions } from '../../src/index.js'; -import type { KadDHT } from '@libp2p/kad-dht'; -export declare function createRoutingOptions(...overrides: Libp2pOptions[]): Libp2pOptions<{ - dht: KadDHT; -}>; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/utils.d.ts.map deleted file mode 100644 index 1298f0f57..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../test/content-routing/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C,wBAAgB,oBAAoB,CAAE,GAAG,SAAS,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAMnG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/utils.js deleted file mode 100644 index 62abfb2ec..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/utils.js +++ /dev/null @@ -1,10 +0,0 @@ -import { kadDHT } from '@libp2p/kad-dht'; -import { createBaseOptions } from '../fixtures/base-options.js'; -export function createRoutingOptions(...overrides) { - return createBaseOptions({ - services: { - dht: kadDHT() - } - }, ...overrides); -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/utils.js.map deleted file mode 100644 index f79b7fd0b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/content-routing/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../test/content-routing/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAI/D,MAAM,UAAU,oBAAoB,CAAE,GAAG,SAA0B;IACjE,OAAO,iBAAiB,CAAC;QACvB,QAAQ,EAAE;YACR,GAAG,EAAE,MAAM,EAAE;SACd;KACF,EAAE,GAAG,SAAS,CAAC,CAAA;AAClB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/consume-peer-record.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/consume-peer-record.spec.d.ts deleted file mode 100644 index 1f60e50d4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/consume-peer-record.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=consume-peer-record.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/consume-peer-record.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/consume-peer-record.spec.d.ts.map deleted file mode 100644 index e87be48f2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/consume-peer-record.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"consume-peer-record.spec.d.ts","sourceRoot":"","sources":["../../../test/core/consume-peer-record.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/consume-peer-record.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/consume-peer-record.spec.js deleted file mode 100644 index 54f77f66a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/consume-peer-record.spec.js +++ /dev/null @@ -1,39 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { multiaddr } from '@multiformats/multiaddr'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -describe('Consume peer record', () => { - let libp2p; - beforeEach(async () => { - const peerId = await createPeerId(); - libp2p = await createLibp2pNode({ - peerId, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - }); - }); - afterEach(async () => { - await libp2p.stop(); - }); - it('should update addresses when observed addrs are confirmed', async () => { - let done; - libp2p.peerStore.patch = async () => { - done(); - return {}; - }; - const p = new Promise(resolve => { - done = resolve; - }); - await libp2p.start(); - libp2p.components.addressManager.confirmObservedAddr(multiaddr('/ip4/123.123.123.123/tcp/3983')); - await p; - await libp2p.stop(); - }); -}); -//# sourceMappingURL=consume-peer-record.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/consume-peer-record.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/consume-peer-record.spec.js.map deleted file mode 100644 index 33b1c77ef..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/consume-peer-record.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"consume-peer-record.spec.js","sourceRoot":"","sources":["../../../test/core/consume-peer-record.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,IAAI,MAAkB,CAAA;IAEtB,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAA;QACnC,MAAM,GAAG,MAAM,gBAAgB,CAAC;YAC9B,MAAM;YACN,UAAU,EAAE;gBACV,UAAU,EAAE;aACb;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,2DAA2D,EAAE,KAAK,IAAI,EAAE;QACzE,IAAI,IAAgB,CAAA;QAEpB,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE;YAClC,IAAI,EAAE,CAAA;YACN,OAAO,EAAS,CAAA;QAClB,CAAC,CAAA;QAED,MAAM,CAAC,GAAG,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE;YACpC,IAAI,GAAG,OAAO,CAAA;QAChB,CAAC,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;QAEpB,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,mBAAmB,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAC,CAAA;QAEhG,MAAM,CAAC,CAAA;QAEP,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/encryption.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/encryption.spec.d.ts deleted file mode 100644 index 63c83cb90..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/encryption.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=encryption.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/encryption.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/encryption.spec.d.ts.map deleted file mode 100644 index 85fb6d201..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/encryption.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encryption.spec.d.ts","sourceRoot":"","sources":["../../../test/core/encryption.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/encryption.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/encryption.spec.js deleted file mode 100644 index e76a69348..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/encryption.spec.js +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { createLibp2p } from '../../src/index.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -describe('Connection encryption configuration', () => { - let peerId; - before(async () => { - peerId = await createPeerId(); - }); - it('can be created', async () => { - const config = { - peerId, - start: false, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - }; - await createLibp2p(config); - }); -}); -//# sourceMappingURL=encryption.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/encryption.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/encryption.spec.js.map deleted file mode 100644 index 9a184e96f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/encryption.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encryption.spec.js","sourceRoot":"","sources":["../../../test/core/encryption.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAsB,MAAM,oBAAoB,CAAA;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAG3D,QAAQ,CAAC,qCAAqC,EAAE,GAAG,EAAE;IACnD,IAAI,MAAc,CAAA;IAElB,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,MAAM,GAAG,MAAM,YAAY,EAAE,CAAA;IAC/B,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE;QAC9B,MAAM,MAAM,GAAkB;YAC5B,MAAM;YACN,KAAK,EAAE,KAAK;YACZ,UAAU,EAAE;gBACV,UAAU,EAAE;aACb;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAA;QACD,MAAM,YAAY,CAAC,MAAM,CAAC,CAAA;IAC5B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/events.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/events.spec.d.ts deleted file mode 100644 index 35b5a7f51..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/events.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=events.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/events.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/events.spec.d.ts.map deleted file mode 100644 index 967176175..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/events.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"events.spec.d.ts","sourceRoot":"","sources":["../../../test/core/events.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/events.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/events.spec.js deleted file mode 100644 index 0ba89d0da..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/events.spec.js +++ /dev/null @@ -1,42 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { expect } from 'aegir/chai'; -import { pEvent } from 'p-event'; -import { createLibp2p } from '../../src/index.js'; -describe('events', () => { - let node; - afterEach(async () => { - if (node != null) { - await node.stop(); - } - }); - it('should emit a start event', async () => { - node = await createLibp2p({ - start: false, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - }); - const eventPromise = pEvent(node, 'start'); - await node.start(); - await expect(eventPromise).to.eventually.have.property('detail', node); - }); - it('should emit a stop event', async () => { - node = await createLibp2p({ - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - }); - const eventPromise = pEvent(node, 'stop'); - await node.stop(); - await expect(eventPromise).to.eventually.have.property('detail', node); - }); -}); -//# sourceMappingURL=events.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/events.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/events.spec.js.map deleted file mode 100644 index 0db4e55bb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/events.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"events.spec.js","sourceRoot":"","sources":["../../../test/core/events.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGjD,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,IAAI,IAAY,CAAA;IAEhB,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,IAAI,IAAI,IAAI,IAAI,EAAE;YAChB,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;SAClB;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,2BAA2B,EAAE,KAAK,IAAI,EAAE;QACzC,IAAI,GAAG,MAAM,YAAY,CAAC;YACxB,KAAK,EAAE,KAAK;YACZ,UAAU,EAAE;gBACV,UAAU,EAAE;aACb;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAC,CAAA;QAEF,MAAM,YAAY,GAAG,MAAM,CAA+B,IAAI,EAAE,OAAO,CAAC,CAAA;QAExE,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;QAClB,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;IACxE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;QACxC,IAAI,GAAG,MAAM,YAAY,CAAC;YACxB,UAAU,EAAE;gBACV,UAAU,EAAE;aACb;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAC,CAAA;QAEF,MAAM,YAAY,GAAG,MAAM,CAA8B,IAAI,EAAE,MAAM,CAAC,CAAA;QAEtE,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;QACjB,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;IACxE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/get-public-key.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/get-public-key.spec.d.ts deleted file mode 100644 index 6dbf4bcf0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/get-public-key.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=get-public-key.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/get-public-key.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/get-public-key.spec.d.ts.map deleted file mode 100644 index 92e484a0e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/get-public-key.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-public-key.spec.d.ts","sourceRoot":"","sources":["../../../test/core/get-public-key.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/get-public-key.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/get-public-key.spec.js deleted file mode 100644 index 1ab28b1f6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/get-public-key.spec.js +++ /dev/null @@ -1,62 +0,0 @@ -/* eslint-env mocha */ -import { kadDHT } from '@libp2p/kad-dht'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { expect } from 'aegir/chai'; -import sinon from 'sinon'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -describe('getPublicKey', () => { - let libp2p; - beforeEach(async () => { - const peerId = await createPeerId(); - libp2p = await createLibp2pNode({ - peerId, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ], - services: { - dht: kadDHT() - } - }); - await libp2p.start(); - }); - afterEach(async () => { - await libp2p.stop(); - }); - it('should extract embedded public key', async () => { - const otherPeer = await createPeerId(); - const key = await libp2p.getPublicKey(otherPeer); - expect(otherPeer.publicKey).to.equalBytes(key); - }); - it('should get key from the keystore', async () => { - const otherPeer = await createPeerId({ opts: { type: 'rsa' } }); - if (otherPeer.publicKey == null) { - throw new Error('Public key was missing'); - } - await libp2p.peerStore.patch(otherPeer, { - publicKey: otherPeer.publicKey - }); - const key = await libp2p.getPublicKey(otherPeer); - expect(otherPeer.publicKey).to.equalBytes(key); - }); - it('should query the DHT when the key is not in the keystore', async () => { - const otherPeer = await createPeerId({ opts: { type: 'rsa' } }); - if (otherPeer.publicKey == null) { - throw new Error('Public key was missing'); - } - if (libp2p.services.dht == null) { - throw new Error('DHT was not configured'); - } - libp2p.services.dht.get = sinon.stub().returns([{ - name: 'VALUE', - value: otherPeer.publicKey - }]); - const key = await libp2p.getPublicKey(otherPeer); - expect(otherPeer.publicKey).to.equalBytes(key); - }); -}); -//# sourceMappingURL=get-public-key.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/get-public-key.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/get-public-key.spec.js.map deleted file mode 100644 index b9936d463..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/get-public-key.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-public-key.spec.js","sourceRoot":"","sources":["../../../test/core/get-public-key.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAI3D,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAI,MAA+B,CAAA;IAEnC,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAA;QACnC,MAAM,GAAG,MAAM,gBAAgB,CAAC;YAC9B,MAAM;YACN,UAAU,EAAE;gBACV,UAAU,EAAE;aACb;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;YACD,QAAQ,EAAE;gBACR,GAAG,EAAE,MAAM,EAAE;aACd;SACF,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,oCAAoC,EAA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AQ,CAAC,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC;gBAC9C,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,SAAS,CAAC,SAAS;aAC3B,CAAC,CAAC,CAAA;QAEH,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;QAEhD,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;IAChD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/listening.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/listening.node.d.ts deleted file mode 100644 index 9c74e4ee8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/listening.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=listening.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/listening.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/listening.node.d.ts.map deleted file mode 100644 index 8d6164770..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/listening.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listening.node.d.ts","sourceRoot":"","sources":["../../../test/core/listening.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/listening.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/listening.node.js deleted file mode 100644 index 81e71fe21..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/listening.node.js +++ /dev/null @@ -1,45 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { tcp } from '@libp2p/tcp'; -import { expect } from 'aegir/chai'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -const listenAddr = '/ip4/0.0.0.0/tcp/0'; -describe('Listening', () => { - let peerId; - let libp2p; - before(async () => { - peerId = await createPeerId(); - }); - after(async () => { - await libp2p.stop(); - }); - it('should replace wildcard host and port with actual host and port on startup', async () => { - libp2p = await createLibp2pNode({ - peerId, - addresses: { - listen: [listenAddr] - }, - transports: [ - tcp() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - const addrs = libp2p.components.transportManager.getAddrs(); - // Should get something like: - // /ip4/127.0.0.1/tcp/50866 - // /ip4/192.168.1.2/tcp/50866 - expect(addrs.length).to.be.at.least(1); - for (const addr of addrs) { - const opts = addr.toOptions(); - expect(opts.family).to.equal(4); - expect(opts.transport).to.equal('tcp'); - expect(opts.host).to.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/); - expect(opts.port).to.be.gt(0); - } - }); -}); -//# sourceMappingURL=listening.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/listening.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/listening.node.js.map deleted file mode 100644 index 1cd4d3774..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/listening.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listening.node.js","sourceRoot":"","sources":["../../../test/core/listening.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAA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C7B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YAC/B,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YACtC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAA;YAC5D,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;SAC9B;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/peer-id.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/peer-id.spec.d.ts deleted file mode 100644 index 6a1b64052..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/peer-id.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=peer-id.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/peer-id.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/peer-id.spec.d.ts.map deleted file mode 100644 index 7d06eaac1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/peer-id.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-id.spec.d.ts","sourceRoot":"","sources":["../../../test/core/peer-id.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/peer-id.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/peer-id.spec.js deleted file mode 100644 index c9883cdb3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/peer-id.spec.js +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { expect } from 'aegir/chai'; -import { createLibp2p } from '../../src/index.js'; -describe('peer-id', () => { - let libp2p; - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('should create a PeerId if none is passed', async () => { - libp2p = await createLibp2p({ - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - }); - expect(libp2p.peerId).to.be.ok(); - }); -}); -//# sourceMappingURL=peer-id.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/peer-id.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/peer-id.spec.js.map deleted file mode 100644 index da4596502..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/core/peer-id.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-id.spec.js","sourceRoot":"","sources":["../../../test/core/peer-id.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,YAAY,EAAe,MAAM,oBAAoB,CAAA;AAE9D,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,IAAI,MAAc,CAAA;IAElB,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;SACpB;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,GAAG,MAAM,YAAY,CAAC;YAC1B,UAAU,EAAE;gBACV,UAAU,EAAE;aACb;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAC,CAAA;QAEF,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAA;IAClC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.browser.d.ts deleted file mode 100644 index 76a8cbd22..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.browser.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Libp2pOptions } from '../../src/index.js'; -import type { ServiceMap } from '@libp2p/interface'; -export declare function createBaseOptions>(overrides?: Libp2pOptions): Libp2pOptions; -//# sourceMappingURL=base-options.browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.browser.d.ts.map deleted file mode 100644 index de49e9388..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-options.browser.d.ts","sourceRoot":"","sources":["../../../test/fixtures/base-options.browser.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,wBAAgB,iBAAiB,CAAE,CAAC,SAAS,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAG,SAAS,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAmBlI"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.browser.js deleted file mode 100644 index cb4bf1def..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.browser.js +++ /dev/null @@ -1,27 +0,0 @@ -import { circuitRelayTransport } from '@libp2p/circuit-relay-v2'; -import { mockConnectionGater } from '@libp2p/interface-compliance-tests/mocks'; -import { mplex } from '@libp2p/mplex'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import mergeOptions from 'merge-options'; -export function createBaseOptions(overrides) { - const options = { - transports: [ - webSockets({ - filter: filters.all - }), - circuitRelayTransport() - ], - streamMuxers: [ - mplex(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }; - return mergeOptions(options, overrides); -} -//# sourceMappingURL=base-options.browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.browser.js.map deleted file mode 100644 index 9b0376976..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-options.browser.js","sourceRoot":"","sources":["../../../test/fixtures/base-options.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAA;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAA;AACrD,OAAO,YAAY,MAAM,eAAe,CAAA;AAIxC,MAAM,UAAU,iBAAiB,CAAmD,SAA4B;IAC9G,MAAM,OAAO,GAAkB;QAC7B,UAAU,EAAE;YACV,UAAU,CAAC;gBACT,MAAM,EAAE,OAAO,CAAC,GAAG;aACpB,CAAC;YACF,qBAAqB,EAAE;SACxB;QACD,YAAY,EAAE;YACZ,KAAK,EAAE;YACP,KAAK,EAAE;SACR;QACD,oBAAoB,EAAE;YACpB,SAAS,EAAE;SACZ;QACD,eAAe,EAAE,mBAAmB,EAAE;KACvC,CAAA;IAED,OAAO,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;AACzC,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.d.ts deleted file mode 100644 index d816a2472..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Libp2pOptions } from '../../src'; -import type { ServiceMap } from '@libp2p/interface'; -export declare function createBaseOptions>(...overrides: Array>): Libp2pOptions; -//# sourceMappingURL=base-options.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.d.ts.map deleted file mode 100644 index bd719bb0d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-options.d.ts","sourceRoot":"","sources":["../../../test/fixtures/base-options.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,wBAAgB,iBAAiB,CAAE,CAAC,SAAS,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAG,GAAG,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAsB3I"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.js deleted file mode 100644 index 4a20946b6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.js +++ /dev/null @@ -1,31 +0,0 @@ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { circuitRelayTransport } from '@libp2p/circuit-relay-v2'; -import { mplex } from '@libp2p/mplex'; -import { plaintext } from '@libp2p/plaintext'; -import { tcp } from '@libp2p/tcp'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import mergeOptions from 'merge-options'; -export function createBaseOptions(...overrides) { - const options = { - addresses: { - listen: [`${process.env.RELAY_MULTIADDR}/p2p-circuit`] - }, - transports: [ - tcp(), - webSockets({ - filter: filters.all - }), - circuitRelayTransport() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }; - return mergeOptions(options, ...overrides); -} -//# sourceMappingURL=base-options.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.js.map deleted file mode 100644 index fb4f2fbc9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/base-options.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-options.js","sourceRoot":"","sources":["../../../test/fixtures/base-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAA;AACrD,OAAO,YAAY,MAAM,eAAe,CAAA;AAIxC,MAAM,UAAU,iBAAiB,CAAmD,GAAG,SAAkC;IACvH,MAAM,OAAO,GAAkB;QAC7B,SAAS,EAAE;YACT,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,cAAc,CAAC;SACvD;QACD,UAAU,EAAE;YACV,GAAG,EAAE;YACL,UAAU,CAAC;gBACT,MAAM,EAAE,OAAO,CAAC,GAAG;aACpB,CAAC;YACF,qBAAqB,EAAE;SACxB;QACD,YAAY,EAAE;YACZ,KAAK,EAAE;YACP,KAAK,EAAE;SACR;QACD,oBAAoB,EAAE;YACpB,SAAS,EAAE;SACZ;KACF,CAAA;IAED,OAAO,YAAY,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,CAAA;AAC5C,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/creators/peer.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/creators/peer.d.ts deleted file mode 100644 index 8fd586a6a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/creators/peer.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { type Libp2pNode } from '../../../src/libp2p.js'; -import type { Libp2pOptions } from '../../../src/index.js'; -import type { Libp2p, ServiceMap } from '@libp2p/interface'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export interface CreatePeerOptions { - /** - * number of peers (default: 1) - */ - number?: number; - /** - * nodes should start (default: true) - */ - started?: boolean; - config?: Libp2pOptions; -} -/** - * Create libp2p nodes. - */ -export declare function createNode(options?: CreatePeerOptions): Promise>; -export declare function populateAddressBooks(peers: Libp2p[]): Promise; -export interface CreatePeerIdOptions { - /** - * Options to pass to the PeerId constructor - */ - opts?: { - type?: 'rsa' | 'ed25519'; - bits?: number; - }; -} -/** - * Create Peer-id - */ -export declare function createPeerId(options?: CreatePeerIdOptions): Promise; -/** - * Create Peer-ids - */ -export declare function createPeerIds(count: number, options?: Omit): Promise; -//# sourceMappingURL=peer.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/creators/peer.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/creators/peer.d.ts.map deleted file mode 100644 index 814b7946b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/creators/peer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer.d.ts","sourceRoot":"","sources":["../../../../test/fixtures/creators/peer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAIvD,MAAM,WAAW,iBAAiB,CAAE,CAAC,SAAS,UAAU;IACtD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB,MAAM,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;CAC1B;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAE,CAAC,SAAS,UAAU,EAAG,OAAO,GAAE,iBAAiB,CAAC,CAAC,CAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CA6BnH;AAED,wBAAsB,oBAAoB,CAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAU1E;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,CAAA;QACxB,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;CACF;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAE,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CAItF;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAE,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAIzH"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/creators/peer.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/creators/peer.js deleted file mode 100644 index 194ca26ee..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/creators/peer.js +++ /dev/null @@ -1,63 +0,0 @@ -import { createEd25519PeerId, createRSAPeerId } from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import pTimes from 'p-times'; -import { createLibp2pNode } from '../../../src/libp2p.js'; -import { createBaseOptions } from '../base-options.browser.js'; -const listenAddr = multiaddr('/ip4/127.0.0.1/tcp/0'); -/** - * Create libp2p nodes. - */ -export async function createNode(options = {}) { - const started = options.started ?? true; - const config = options.config ?? {}; - const peerId = await createPeerId(); - const addresses = started - ? { - listen: [listenAddr.toString()], - announce: [], - noAnnounce: [], - announceFilter: (addrs) => addrs - } - : { - listen: [], - announce: [], - noAnnounce: [], - announceFilter: (addrs) => addrs - }; - const peer = await createLibp2pNode(createBaseOptions({ - peerId, - addresses, - start: started, - ...config - })); - if (started) { - await peer.start(); - } - return peer; -} -export async function populateAddressBooks(peers) { - for (let i = 0; i < peers.length; i++) { - for (let j = 0; j < peers.length; j++) { - if (i !== j) { - await peers[i].peerStore.patch(peers[j].peerId, { - multiaddrs: peers[j].getMultiaddrs() - }); - } - } - } -} -/** - * Create Peer-id - */ -export async function createPeerId(options = {}) { - const opts = options.opts ?? {}; - return opts.type === 'rsa' ? createRSAPeerId({ bits: opts.bits ?? 512 }) : createEd25519PeerId(); -} -/** - * Create Peer-ids - */ -export async function createPeerIds(count, options = {}) { - const opts = options.opts ?? {}; - return pTimes(count, async (i) => createPeerId({ opts })); -} -//# sourceMappingURL=peer.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/creators/peer.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/creators/peer.js.map deleted file mode 100644 index 54db26ed6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/creators/peer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer.js","sourceRoot":"","sources":["../../../../test/fixtures/creators/peer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,gBAAgB,EAAmB,MAAM,wBAAwB,CAAA;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAM9D,MAAM,UAAU,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAA;AAgBpD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAyB,UAAgC,EAAE;IACzF,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,CAAA;IACvC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,EAAE,CAAA;IACnC,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAA;IACnC,MAAM,SAAS,GAAuB,OAAO;QAC3C,CAAC,CAAC;YACE,MAAM,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;YAC/B,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,EAAE;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mBAAmB,EAAE,CAAA;AAClG,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAE,KAAa,EAAE,UAAgD,EAAE;IACpG,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAAA;IAE/B,OAAO,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AAC3D,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/echo-service.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/echo-service.d.ts deleted file mode 100644 index 0e7733ab2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/echo-service.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Registrar } from '@libp2p/interface-internal/registrar'; -export declare const ECHO_PROTOCOL = "/echo/1.0.0"; -export interface EchoInit { - protocol?: string; -} -export interface EchoComponents { - registrar: Registrar; -} -export declare function echo(init?: EchoInit): (components: EchoComponents) => unknown; -//# sourceMappingURL=echo-service.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/echo-service.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/echo-service.d.ts.map deleted file mode 100644 index d7f6f3d04..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/echo-service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"echo-service.d.ts","sourceRoot":"","sources":["../../../test/fixtures/echo-service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAErE,eAAO,MAAM,aAAa,gBAAgB,CAAA;AAE1C,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,SAAS,CAAA;CACrB;AAyBD,wBAAgB,IAAI,CAAE,IAAI,GAAE,QAAa,GAAG,CAAC,UAAU,EAAE,cAAc,KAAK,OAAO,CAIlF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/echo-service.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/echo-service.js deleted file mode 100644 index 2610f79bd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/echo-service.js +++ /dev/null @@ -1,27 +0,0 @@ -import { pipe } from 'it-pipe'; -export const ECHO_PROTOCOL = '/echo/1.0.0'; -class EchoService { - protocol; - registrar; - constructor(components, init = {}) { - this.protocol = init.protocol ?? ECHO_PROTOCOL; - this.registrar = components.registrar; - } - async start() { - await this.registrar.handle(this.protocol, ({ stream }) => { - void pipe(stream, stream) - // sometimes connections are closed before multistream-select finishes - // which causes an error - .catch(); - }); - } - async stop() { - await this.registrar.unhandle(this.protocol); - } -} -export function echo(init = {}) { - return (components) => { - return new EchoService(components, init); - }; -} -//# sourceMappingURL=echo-service.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/echo-service.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/echo-service.js.map deleted file mode 100644 index 6aa1a5d72..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/echo-service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"echo-service.js","sourceRoot":"","sources":["../../../test/fixtures/echo-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAI9B,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAA;AAU1C,MAAM,WAAW;IACE,QAAQ,CAAQ;IAChB,SAAS,CAAW;IAErC,YAAa,UAA0B,EAAE,OAAiB,EAAE;QAC1D,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,aAAa,CAAA;QAC9C,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAA;IACvC,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;YACxD,KAAK,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;gBACvB,sEAAsE;gBACtE,wBAAwB;iBACvB,KAAK,EAAE,CAAA;QACZ,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC9C,CAAC;CACF;AAED,MAAM,UAAU,IAAI,CAAE,OAAiB,EAAE;IACvC,OAAO,CAAC,UAAU,EAAE,EAAE;QACpB,OAAO,IAAI,WAAW,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;IAC1C,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/match-peer-id.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/match-peer-id.d.ts deleted file mode 100644 index 344fbcd01..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/match-peer-id.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import Sinon from 'sinon'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export declare function matchPeerId(peerId: PeerId): Sinon.SinonMatcher; -//# sourceMappingURL=match-peer-id.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/match-peer-id.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/match-peer-id.d.ts.map deleted file mode 100644 index 17083c74d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/match-peer-id.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"match-peer-id.d.ts","sourceRoot":"","sources":["../../../test/fixtures/match-peer-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,wBAAgB,WAAW,CAAE,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAE/D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/match-peer-id.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/match-peer-id.js deleted file mode 100644 index 699cedd88..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/match-peer-id.js +++ /dev/null @@ -1,5 +0,0 @@ -import Sinon from 'sinon'; -export function matchPeerId(peerId) { - return Sinon.match(p => p.toString() === peerId.toString()); -} -//# sourceMappingURL=match-peer-id.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/match-peer-id.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/match-peer-id.js.map deleted file mode 100644 index 0032df46f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/fixtures/match-peer-id.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"match-peer-id.js","sourceRoot":"","sources":["../../../test/fixtures/match-peer-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,UAAU,WAAW,CAAE,MAAc;IACzC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAA;AAC7D,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/interop.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/interop.d.ts deleted file mode 100644 index f160cf14e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/interop.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=interop.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/interop.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/interop.d.ts.map deleted file mode 100644 index 14efbf496..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/interop.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interop.d.ts","sourceRoot":"","sources":["../../test/interop.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/interop.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/interop.js deleted file mode 100644 index 093dd456a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/interop.js +++ /dev/null @@ -1,197 +0,0 @@ -import fs from 'fs'; -import { gossipsub } from '@chainsafe/libp2p-gossipsub'; -import { noise } from '@chainsafe/libp2p-noise'; -import { yamux } from '@chainsafe/libp2p-yamux'; -import { circuitRelayServer, circuitRelayTransport } from '@libp2p/circuit-relay-v2'; -import { unmarshalPrivateKey } from '@libp2p/crypto/keys'; -import { createClient } from '@libp2p/daemon-client'; -import { createServer } from '@libp2p/daemon-server'; -import { floodsub } from '@libp2p/floodsub'; -import { identify } from '@libp2p/identify'; -import { contentRouting } from '@libp2p/interface/content-routing'; -import { peerDiscovery } from '@libp2p/interface/peer-discovery'; -import { peerRouting } from '@libp2p/interface/peer-routing'; -import { interopTests } from '@libp2p/interop'; -import { kadDHT } from '@libp2p/kad-dht'; -import { logger } from '@libp2p/logger'; -import { mplex } from '@libp2p/mplex'; -import { peerIdFromKeys } from '@libp2p/peer-id'; -import { tcp } from '@libp2p/tcp'; -import { multiaddr } from '@multiformats/multiaddr'; -import { execa } from 'execa'; -import { path as p2pd } from 'go-libp2p'; -import pDefer from 'p-defer'; -import { createLibp2p } from '../src/index.js'; -/** - * @packageDocumentation - * - * To enable debug logging, run the tests with the following env vars: - * - * ```console - * DEBUG=libp2p*,go-libp2p:* npm run test:interop - * ``` - */ -async function createGoPeer(options) { - const controlPort = Math.floor(Math.random() * (50000 - 10000 + 1)) + 10000; - const apiAddr = multiaddr(`/ip4/127.0.0.1/tcp/${controlPort}`); - const log = logger(`go-libp2p:${controlPort}`); - const opts = [ - `-listen=${apiAddr.toString()}` - ]; - if (options.noListen === true) { - opts.push('-noListenAddrs'); - } - else { - opts.push('-hostAddrs=/ip4/127.0.0.1/tcp/0'); - } - if (options.noise === true) { - opts.push('-noise=true'); - } - if (options.dht === true) { - opts.push('-dhtServer'); - } - if (options.relay === true) { - opts.push('-relay'); - } - if (options.pubsub === true) { - opts.push('-pubsub'); - } - if (options.pubsubRouter != null) { - opts.push(`-pubsubRouter=${options.pubsubRouter}`); - } - if (options.key != null) { - opts.push(`-id=${options.key}`); - } - if (options.muxer === 'mplex') { - opts.push('-muxer=mplex'); - } - else { - opts.push('-muxer=yamux'); - } - const deferred = pDefer(); - const proc = execa(p2pd(), opts, { - env: { - GOLOG_LOG_LEVEL: 'debug' - } - }); - proc.stdout?.on('data', (buf) => { - const str = buf.toString(); - log(str); - // daemon has started - if (str.includes('Control socket:')) { - deferred.resolve(); - } - }); - proc.stderr?.on('data', (buf) => { - log.error(buf.toString()); - }); - await deferred.promise; - return { - client: createClient(apiAddr), - stop: async () => { - proc.kill(); - } - }; -} -async function createJsPeer(options) { - let peerId; - if (options.key != null) { - const keyFile = fs.readFileSync(options.key); - const privateKey = await unmarshalPrivateKey(keyFile); - peerId = await peerIdFromKeys(privateKey.public.bytes, privateKey.bytes); - } - const opts = { - peerId, - addresses: { - listen: options.noListen === true ? [] : ['/ip4/127.0.0.1/tcp/0'] - }, - transports: [tcp(), circuitRelayTransport()], - streamMuxers: [], - connectionEncryption: [noise()], - connectionManager: { - minConnections: 0 - } - }; - const services = { - identify: identify() - }; - if (options.muxer === 'mplex') { - opts.streamMuxers?.push(mplex()); - } - else { - opts.streamMuxers?.push(yamux()); - } - if (options.pubsub === true) { - if (options.pubsubRouter === 'floodsub') { - services.pubsub = floodsub(); - } - else { - services.pubsub = gossipsub(); - } - } - if (options.relay === true) { - services.relay = circuitRelayServer(); - } - if (options.dht === true) { - services.dht = (components) => { - const dht = kadDHT({ - clientMode: false - })(components); - // go-libp2p-daemon only has the older single-table DHT instead of the dual - // lan/wan version found in recent go-ipfs versions. unfortunately it's been - // abandoned so here we simulate the older config with the js implementation - const lan = dht.lan; - const protocol = '/ipfs/kad/1.0.0'; - lan.protocol = protocol; - lan.network.protocol = protocol; - lan.topologyListener.protocol = protocol; - Object.defineProperties(lan, { - [contentRouting]: { - get() { - return dht[contentRouting]; - } - }, - [peerRouting]: { - get() { - return dht[peerRouting]; - } - }, - [peerDiscovery]: { - get() { - return dht[peerDiscovery]; - } - } - }); - return lan; - }; - } - const node = await createLibp2p({ - ...opts, - services - }); - const server = createServer(multiaddr('/ip4/0.0.0.0/tcp/0'), node); - await server.start(); - return { - client: createClient(server.getMultiaddr()), - stop: async () => { - await server.stop(); - await node.stop(); - } - }; -} -async function main() { - const factory = { - async spawn(options) { - if (options.type === 'go') { - return createGoPeer(options); - } - return createJsPeer(options); - } - }; - await interopTests(factory); -} -main().catch(err => { - console.error(err); // eslint-disable-line no-console - process.exit(1); -}); -//# sourceMappingURL=interop.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/interop.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/interop.js.map deleted file mode 100644 index bb68e4de3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/interop.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interop.js","sourceRoot":"","sources":["../../test/interop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,QA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,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.node.d.ts deleted file mode 100644 index 95867294f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.node.d.ts.map deleted file mode 100644 index d01c584d3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../../test/peer-discovery/index.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.node.js deleted file mode 100644 index 5ebb0631a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.node.js +++ /dev/null @@ -1,185 +0,0 @@ -/* eslint-env mocha */ -import { bootstrap } from '@libp2p/bootstrap'; -import { randomBytes } from '@libp2p/crypto'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { peerDiscovery } from '@libp2p/interface/peer-discovery'; -import { kadDHT } from '@libp2p/kad-dht'; -import { mdns } from '@libp2p/mdns'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import defer from 'p-defer'; -import sinon from 'sinon'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { createLibp2p } from '../../src/index.js'; -import { createBaseOptions } from '../fixtures/base-options.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -const listenAddr = multiaddr('/ip4/127.0.0.1/tcp/0'); -class TestPeerDiscovery extends TypedEventEmitter { - get [peerDiscovery]() { - return this; - } - [Symbol.toStringTag] = '@libp2p/test-peer-discovery'; -} -describe('peer discovery scenarios', () => { - let peerId; - let remotePeerId1; - let remotePeerId2; - let libp2p; - beforeEach(async () => { - [peerId, remotePeerId1, remotePeerId2] = await Promise.all([ - createPeerId(), - createPeerId(), - createPeerId() - ]); - }); - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('should ignore self on discovery', async () => { - const discovery = new TestPeerDiscovery(); - libp2p = await createLibp2p(createBaseOptions({ - peerId, - peerDiscovery: [ - () => discovery - ] - })); - await libp2p.start(); - const discoverySpy = sinon.spy(); - libp2p.addEventListener('peer:discovery', discoverySpy); - discovery.safeDispatchEvent('peer', { - detail: { - id: libp2p.peerId, - multiaddrs: [], - protocols: [] - } - }); - expect(discoverySpy.called).to.eql(false); - }); - it('bootstrap should discover all peers in the list', async () => { - const deferred = defer(); - const bootstrappers = [ - `${listenAddr.toString()}/p2p/${remotePeerId1.toString()}`, - `${listenAddr.toString()}/p2p/${remotePeerId2.toString()}` - ]; - libp2p = await createLibp2p(createBaseOptions({ - peerId, - addresses: { - listen: [ - listenAddr.toString() - ] - }, - peerDiscovery: [ - bootstrap({ - list: bootstrappers - }) - ] - })); - const expectedPeers = new Set([ - remotePeerId1.toString(), - remotePeerId2.toString() - ]); - libp2p.addEventListener('peer:discovery', (evt) => { - const { id } = evt.detail; - expectedPeers.delete(id.toString()); - if (expectedPeers.size === 0) { - libp2p.removeEventListener('peer:discovery'); - deferred.resolve(); - } - }); - await libp2p.start(); - return deferred.promise; - }); - it('MulticastDNS should discover all peers on the local network', async () => { - const deferred = defer(); - // use a random tag to prevent CI collision - const serviceTag = `libp2p-test-${uint8ArrayToString(randomBytes(4), 'base16')}.local`; - const getConfig = (peerId) => createBaseOptions({ - peerId, - addresses: { - listen: [ - listenAddr.toString() - ] - }, - peerDiscovery: [ - mdns({ - interval: 200, - serviceTag - }) - ] - }); - libp2p = await createLibp2p(getConfig(peerId)); - const remoteLibp2p1 = await createLibp2p(getConfig(remotePeerId1)); - const remoteLibp2p2 = await createLibp2p(getConfig(remotePeerId2)); - const expectedPeers = new Set([ - remotePeerId1.toString(), - remotePeerId2.toString() - ]); - libp2p.addEventListener('peer:discovery', (evt) => { - const { id } = evt.detail; - expectedPeers.delete(id.toString()); - if (expectedPeers.size === 0) { - libp2p.removeEventListener('peer:discovery'); - deferred.resolve(); - } - }); - await Promise.all([ - remoteLibp2p1.start(), - remoteLibp2p2.start(), - libp2p.start() - ]); - await deferred.promise; - await remoteLibp2p1.stop(); - await remoteLibp2p2.stop(); - }); - it('kad-dht should discover other peers', async () => { - const deferred = defer(); - const getConfig = (peerId) => createBaseOptions({ - peerId, - addresses: { - listen: [ - listenAddr.toString() - ] - }, - services: { - dht: kadDHT() - } - }); - const localConfig = getConfig(peerId); - libp2p = await createLibp2p(localConfig); - const remoteLibp2p1 = await createLibp2p(getConfig(remotePeerId1)); - const remoteLibp2p2 = await createLibp2p(getConfig(remotePeerId2)); - libp2p.addEventListener('peer:discovery', (evt) => { - const { id } = evt.detail; - if (id.equals(remotePeerId1)) { - libp2p.removeEventListener('peer:discovery'); - deferred.resolve(); - } - }); - await Promise.all([ - libp2p.start(), - remoteLibp2p1.start(), - remoteLibp2p2.start() - ]); - await libp2p.peerStore.patch(remotePeerId1, { - multiaddrs: remoteLibp2p1.getMultiaddrs() - }); - await remoteLibp2p2.peerStore.patch(remotePeerId1, { - multiaddrs: remoteLibp2p1.getMultiaddrs() - }); - // Topology: - // A -> B - // C -> B - await Promise.all([ - libp2p.dial(remotePeerId1), - remoteLibp2p2.dial(remotePeerId1) - ]); - await deferred.promise; - return Promise.all([ - remoteLibp2p1.stop(), - remoteLibp2p2.stop() - ]); - }); -}); -//# sourceMappingURL=index.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.node.js.map deleted file mode 100644 index 3a2b8982b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.node.js","sourceRoot":"","sources":["../../../test/peer-discovery/index.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,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CAAA;gBAC5C,QAAQ,CAAC,OAAO,EAAE,CAAA;aACnB;QACH,CAAC,CAAC,CAAA;QAEF,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,MAAM,CAAC,KAAK,EAAE;YACd,aAAa,CAAC,KAAK,EAAE;YACrB,aAAa,CAAC,KAAK,EAAE;SACtB,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,EAAE;YAC1C,UAAU,EAAE,aAAa,CAAC,aAAa,EAAE;SAC1C,CAAC,CAAA;QACF,MAAM,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,EAAE;YACjD,UAAU,EAAE,aAAa,CAAC,aAAa,EAAE;SAC1C,CAAC,CAAA;QAEF,YAAY;QACZ,SAAS;QACT,SAAS;QACT,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;YAC1B,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC;SAClC,CAAC,CAAA;QAEF,MAAM,QAAQ,CAAC,OAAO,CAAA;QACtB,OAAO,OAAO,CAAC,GAAG,CAAC;YACjB,aAAa,CAAC,IAAI,EAAE;YACpB,aAAa,CAAC,IAAI,EAAE;SACrB,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.spec.d.ts deleted file mode 100644 index b37c2d278..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.spec.d.ts.map deleted file mode 100644 index ddc4c2518..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../../test/peer-discovery/index.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.spec.js deleted file mode 100644 index 96db53097..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.spec.js +++ /dev/null @@ -1,38 +0,0 @@ -/* eslint-env mocha */ -import { expect } from 'aegir/chai'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { createBaseOptions } from '../fixtures/base-options.browser.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -describe('peer discovery', () => { - describe('basic functions', () => { - let peerId; - let libp2p; - before(async () => { - peerId = await createPeerId(); - }); - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - sinon.reset(); - }); - it('should start/stop startable discovery on libp2p start/stop', async () => { - const discovery = stubInterface(); - libp2p = await createLibp2pNode(createBaseOptions({ - peerId, - peerDiscovery: [ - () => discovery - ] - })); - await libp2p.start(); - expect(discovery.start.calledOnce).to.be.true(); - expect(discovery.stop.called).to.be.false(); - await libp2p.stop(); - expect(discovery.start.calledOnce).to.be.true(); - expect(discovery.stop.calledOnce).to.be.true(); - }); - }); -}); -//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.spec.js.map deleted file mode 100644 index 262766661..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-discovery/index.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../test/peer-discovery/index.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAK3D,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;QAC/B,IAAI,MAAc,CAAA;QAClB,IAAI,MAAkB,CAAA;QAEtB,MAAM,CAAC,KAAK,IAAI,EAAE;YAChB,MAAM,GAAG,MAAM,YAAY,EAAE,CAAA;QAC/B,CAAC,CAAC,CAAA;QAEF,SAAS,CAAC,KAAK,IAAI,EAAE;YACnB,IAAI,MAAM,IAAI,IAAI,EAAE;gBAClB,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;aACpB;YAED,KAAK,CAAC,KAAK,EAAE,CAAA;QACf,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,4DAA4D,EAAE,KAAK,IAAI,EAAE;YAC1E,MAAM,SAAS,GAAG,aAAa,EAA6B,CAAA;YAE5D,MAAM,GAAG,MAAM,gBAAgB,CAAC,iBAAiB,CAAC;gBAChD,MAAM;gBACN,aAAa,EAAE;oBACb,GAAG,EAAE,CAAC,SAAS;iBAChB;aACF,CAAC,CAAC,CAAA;YAEH,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;YACpB,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;YAC/C,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;YAE3C,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;YACnB,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;YAC/C,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QAChD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/peer-routing.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/peer-routing.node.d.ts deleted file mode 100644 index 9f5c2bfd9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/peer-routing.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=peer-routing.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/peer-routing.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/peer-routing.node.d.ts.map deleted file mode 100644 index 6b4f26365..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/peer-routing.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-routing.node.d.ts","sourceRoot":"","sources":["../../../test/peer-routing/peer-routing.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/peer-routing.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/peer-routing.node.js deleted file mode 100644 index 52cd620c5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/peer-routing.node.js +++ /dev/null @@ -1,449 +0,0 @@ -/* eslint-env mocha */ -import { EventTypes, MessageType } from '@libp2p/kad-dht'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import delay from 'delay'; -import all from 'it-all'; -import drain from 'it-drain'; -import pDefer from 'p-defer'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { createBaseOptions } from '../fixtures/base-options.js'; -import { createNode, createPeerId, populateAddressBooks } from '../fixtures/creators/peer.js'; -import { createRoutingOptions } from './utils.js'; -describe('peer-routing', () => { - let peerId; - beforeEach(async () => { - peerId = await createEd25519PeerId(); - }); - describe('no routers', () => { - let node; - before(async () => { - node = await createNode({ - config: createBaseOptions() - }); - }); - after(async () => { await node.stop(); }); - it('.findPeer should return an error', async () => { - await expect(node.peerRouting.findPeer(peerId)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_NO_ROUTERS_AVAILABLE'); - }); - it('.getClosestPeers should return an error', async () => { - try { - for await (const _ of node.peerRouting.getClosestPeers(peerId.toBytes())) { } // eslint-disable-line - throw new Error('.getClosestPeers should return an error'); - } - catch (err) { - expect(err).to.exist(); - expect(err.code).to.equal('ERR_NO_ROUTERS_AVAILABLE'); - } - }); - }); - describe('via dht router', () => { - let nodes; - before(async () => { - nodes = await Promise.all([ - createNode({ config: createRoutingOptions() }), - createNode({ config: createRoutingOptions() }), - createNode({ config: createRoutingOptions() }), - createNode({ config: createRoutingOptions() }), - createNode({ config: createRoutingOptions() }) - ]); - await populateAddressBooks(nodes); - // Ring dial - await Promise.all(nodes.map(async (peer, i) => peer.dial(nodes[(i + 1) % nodes.length].peerId))); - }); - after(() => { - sinon.restore(); - }); - after(async () => Promise.all(nodes.map(async (n) => { await n.stop(); }))); - it('should use the nodes dht', async () => { - if (nodes[0].services.dht == null) { - throw new Error('DHT not configured'); - } - const dhtFindPeerStub = sinon.stub(nodes[0].services.dht, 'findPeer').callsFake(async function* () { - yield { - from: nodes[2].peerId, - type: EventTypes.FINAL_PEER, - name: 'FINAL_PEER', - peer: { - id: nodes[1].peerId, - multiaddrs: [], - protocols: [] - } - }; - }); - expect(dhtFindPeerStub.called).to.be.false(); - await nodes[0].peerRouting.findPeer(nodes[1].peerId); - expect(dhtFindPeerStub.called).to.be.true(); - dhtFindPeerStub.restore(); - }); - it('should use the nodes dht to get the closest peers', async () => { - if (nodes[0].services.dht == null) { - throw new Error('DHT not configured'); - } - const dhtGetClosestPeersStub = sinon.stub(nodes[0].services.dht, 'getClosestPeers').callsFake(async function* () { - yield { - from: nodes[2].peerId, - type: EventTypes.FINAL_PEER, - name: 'FINAL_PEER', - messageName: 'FIND_NODE', - messageType: MessageType.FIND_NODE, - peer: { - id: nodes[1].peerId, - multiaddrs: [], - protocols: [] - } - }; - }); - expect(dhtGetClosestPeersStub.called).to.be.false(); - await drain(nodes[0].peerRouting.getClosestPeers(nodes[1].peerId.toBytes())); - expect(dhtGetClosestPeersStub.called).to.be.true(); - dhtGetClosestPeersStub.restore(); - }); - it('should error when peer tries to find itself', async () => { - await expect(nodes[0].peerRouting.findPeer(nodes[0].peerId)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_FIND_SELF'); - }); - it('should handle error thrown synchronously during find peer', async () => { - const unknownPeer = await createPeerId(); - // @ts-expect-error private field - nodes[0].peerRouting.routers = [{ - findPeer() { - throw new Error('Thrown sync'); - } - }]; - await expect(nodes[0].peerRouting.findPeer(unknownPeer)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_NOT_FOUND'); - }); - it('should handle error thrown asynchronously during find peer', async () => { - const unknownPeer = await createPeerId(); - // @ts-expect-error private field - nodes[0].peerRouting.routers = [{ - async findPeer() { - throw new Error('Thrown async'); - } - }]; - await expect(nodes[0].peerRouting.findPeer(unknownPeer)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_NOT_FOUND'); - }); - it('should handle error thrown asynchronously after delay during find peer', async () => { - const unknownPeer = await createPeerId(); - // @ts-expect-error private field - nodes[0].peerRouting.routers = [{ - async findPeer() { - await delay(100); - throw new Error('Thrown async after delay'); - } - }]; - await expect(nodes[0].peerRouting.findPeer(unknownPeer)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_NOT_FOUND'); - }); - it('should return value when one router errors synchronously and another returns a value', async () => { - const peer = await createPeerId(); - // @ts-expect-error private field - nodes[0].peerRouting.routers = [{ - findPeer() { - throw new Error('Thrown sync'); - } - }, { - async findPeer() { - return Promise.resolve({ - id: peer, - multiaddrs: [] - }); - } - }]; - await expect(nodes[0].peerRouting.findPeer(peer)) - .to.eventually.deep.equal({ - id: peer, - multiaddrs: [] - }); - }); - it('should return value when one router errors asynchronously and another returns a value', async () => { - const peer = await createPeerId(); - // @ts-expect-error private field - nodes[0].peerRouting.routers = [{ - async findPeer() { - throw new Error('Thrown sync'); - } - }, { - async findPeer() { - return Promise.resolve({ - id: peer, - multiaddrs: [] - }); - } - }]; - await expect(nodes[0].peerRouting.findPeer(peer)) - .to.eventually.deep.equal({ - id: peer, - multiaddrs: [] - }); - }); - }); - describe('via delegate router', () => { - let node; - let delegate; - beforeEach(async () => { - delegate = stubInterface(); - delegate.findPeer.rejects(new Error('Could not find peer')); - delegate.getClosestPeers.returns(async function* () { }()); - node = await createNode({ - config: createBaseOptions({ - peerRouters: [ - () => delegate - ] - }) - }); - }); - afterEach(() => { - sinon.restore(); - }); - afterEach(async () => { await node.stop(); }); - it('should only have one router', () => { - // @ts-expect-error private field - expect(node.peerRouting.routers).to.have.lengthOf(1); - }); - it('should use the delegate router to find peers', async () => { - const remotePeerId = await createPeerId(); - delegate.findPeer.callsFake(async function () { - return { - id: remotePeerId, - multiaddrs: [], - protocols: [] - }; - }); - expect(delegate.findPeer.called).to.be.false(); - await node.peerRouting.findPeer(remotePeerId); - expect(delegate.findPeer.called).to.be.true(); - }); - it('should use the delegate router to get the closest peers', async () => { - const remotePeerId = await createPeerId(); - delegate.getClosestPeers.callsFake(async function* () { - yield { - id: remotePeerId, - multiaddrs: [], - protocols: [] - }; - }); - expect(delegate.getClosestPeers.called).to.be.false(); - await drain(node.peerRouting.getClosestPeers(remotePeerId.toBytes())); - expect(delegate.getClosestPeers.called).to.be.true(); - }); - it('should error when peer tries to find itself', async () => { - await expect(node.peerRouting.findPeer(node.peerId)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_FIND_SELF'); - }); - it('should handle errors from the delegate when finding closest peers', async () => { - const remotePeerId = await createPeerId(); - delegate.getClosestPeers.callsFake(async function* () { - throw new Error('Could not find closer peers'); - }); - expect(delegate.getClosestPeers.called).to.be.false(); - await expect(drain(node.peerRouting.getClosestPeers(remotePeerId.toBytes()))) - .to.eventually.be.rejectedWith('Could not find closer peers'); - }); - }); - describe('via dht and delegate routers', () => { - let node; - let delegate; - beforeEach(async () => { - delegate = stubInterface(); - delegate.findPeer.throws(new Error('Could not find peer')); - delegate.getClosestPeers.returns(async function* () { }()); - node = await createNode({ - config: createRoutingOptions({ - peerRouters: [ - () => delegate - ] - }) - }); - }); - afterEach(() => { - sinon.restore(); - }); - afterEach(async () => { await node.stop(); }); - it('should use the delegate if the dht fails to find the peer', async () => { - const remotePeerId = await createPeerId(); - const results = { - id: remotePeerId, - multiaddrs: [], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - sinon.stub(node.services.dht, 'findPeer').callsFake(async function* () { }); - delegate.findPeer.reset(); - delegate.findPeer.callsFake(async () => { - return results; - }); - const peer = await node.peerRouting.findPeer(remotePeerId); - expect(peer).to.eql(results); - }); - it('should not wait for the dht to return if the delegate does first', async () => { - const remotePeerId = await createPeerId(); - const results = { - id: remotePeerId, - multiaddrs: [], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - const defer = pDefer(); - sinon.stub(node.services.dht, 'findPeer').callsFake(async function* () { - yield { - name: 'SEND_QUERY', - type: EventTypes.SEND_QUERY, - to: remotePeerId, - messageName: 'FIND_NODE', - messageType: MessageType.FIND_NODE - }; - await defer.promise; - }); - delegate.findPeer.reset(); - delegate.findPeer.callsFake(async () => { - return results; - }); - const peer = await node.peerRouting.findPeer(remotePeerId); - expect(peer).to.eql(results); - defer.resolve(); - }); - it('should not wait for the delegate to return if the dht does first', async () => { - const remotePeerId = await createPeerId(); - const result = { - id: remotePeerId, - multiaddrs: [], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - const defer = pDefer(); - sinon.stub(node.services.dht, 'findPeer').callsFake(async function* () { - yield { - from: remotePeerId, - name: 'FINAL_PEER', - type: EventTypes.FINAL_PEER, - peer: result - }; - }); - delegate.findPeer.reset(); - delegate.findPeer.callsFake(async () => { - return defer.promise; - }); - const peer = await node.peerRouting.findPeer(remotePeerId); - expect(peer).to.eql(result); - defer.resolve(result); - }); - it('should store the addresses of the found peer', async () => { - const remotePeerId = await createPeerId(); - const result = { - id: remotePeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/38982') - ], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - const spy = sinon.spy(node.peerStore, 'merge'); - sinon.stub(node.services.dht, 'findPeer').callsFake(async function* () { - yield { - from: remotePeerId, - name: 'FINAL_PEER', - type: EventTypes.FINAL_PEER, - peer: result - }; - }); - delegate.findPeer.reset(); - delegate.findPeer.callsFake(async () => { - const deferred = pDefer(); - return deferred.promise; - }); - await node.peerRouting.findPeer(remotePeerId); - expect(spy.calledWith(result.id, { - multiaddrs: result.multiaddrs - })).to.be.true(); - }); - it('should use the delegate if the dht fails to get the closest peer', async () => { - const remotePeerId = await createPeerId(); - const results = [{ - id: remotePeerId, - multiaddrs: [], - protocols: [] - }]; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - sinon.stub(node.services.dht, 'getClosestPeers').callsFake(async function* () { }); - delegate.getClosestPeers.callsFake(async function* () { - yield results[0]; - }); - const closest = await all(node.peerRouting.getClosestPeers(remotePeerId.toBytes())); - expect(closest).to.have.length.above(0); - expect(closest).to.eql(results); - }); - it('should store the addresses of the closest peer', async () => { - const remotePeerId = await createPeerId(); - const result = { - id: remotePeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/38982') - ], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - const spy = sinon.spy(node.peerStore, 'merge'); - sinon.stub(node.services.dht, 'getClosestPeers').callsFake(async function* () { }); - delegate.getClosestPeers.callsFake(async function* () { - yield result; - }); - await drain(node.peerRouting.getClosestPeers(remotePeerId.toBytes())); - expect(spy.calledWith(result.id, { - multiaddrs: result.multiaddrs - })).to.be.true(); - }); - it('should dedupe closest peers', async () => { - const remotePeerId = await createPeerId(); - const results = [{ - id: remotePeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/38982') - ], - protocols: [] - }]; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - sinon.stub(node.services.dht, 'getClosestPeers').callsFake(async function* () { - for (const peer of results) { - yield { - from: remotePeerId, - name: 'FINAL_PEER', - type: EventTypes.FINAL_PEER, - peer - }; - } - }); - delegate.getClosestPeers.callsFake(async function* () { - yield* results; - }); - const peers = await all(node.peerRouting.getClosestPeers(remotePeerId.toBytes())); - expect(peers).to.be.an('array').with.a.lengthOf(1).that.deep.equals(results); - }); - }); -}); -//# sourceMappingURL=peer-routing.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/peer-routing.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/peer-routing.node.js.map deleted file mode 100644 index fccc46d67..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/peer-routing.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-routing.node.js","sourceRoot":"","sources":["../../../test/peer-routing/peer-routing.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAe,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,GAAG,MAAM,QAAQ,CAAA;AACxB,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAwB,aAAa,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAOjD,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAI,MAAc,CAA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C,KAAK,SAAU,CAAC;gBACjD,KAAM,CAAC,CAAC,OAAO,CAAA;YACjB,CAAC,CAAC,CAAA;YAEF,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;YAEjF,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAC9E,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/utils.d.ts deleted file mode 100644 index 3d1c83fcd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/utils.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Libp2pOptions } from '../../src/index.js'; -import type { KadDHT } from '@libp2p/kad-dht'; -export declare function createRoutingOptions(...overrides: Libp2pOptions[]): Libp2pOptions<{ - dht: KadDHT; -}>; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/utils.d.ts.map deleted file mode 100644 index 405f5d650..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../test/peer-routing/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C,wBAAgB,oBAAoB,CAAE,GAAG,SAAS,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAMnG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/utils.js deleted file mode 100644 index 62abfb2ec..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/utils.js +++ /dev/null @@ -1,10 +0,0 @@ -import { kadDHT } from '@libp2p/kad-dht'; -import { createBaseOptions } from '../fixtures/base-options.js'; -export function createRoutingOptions(...overrides) { - return createBaseOptions({ - services: { - dht: kadDHT() - } - }, ...overrides); -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/utils.js.map deleted file mode 100644 index d527ca63f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/peer-routing/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../test/peer-routing/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAI/D,MAAM,UAAU,oBAAoB,CAAE,GAAG,SAA0B;IACjE,OAAO,iBAAiB,CAAC;QACvB,QAAQ,EAAE;YACR,GAAG,EAAE,MAAM,EAAE;SACd;KACF,EAAE,GAAG,SAAS,CAAC,CAAA;AAClB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/registrar/registrar.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/registrar/registrar.spec.d.ts deleted file mode 100644 index 49a866882..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/registrar/registrar.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=registrar.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/registrar/registrar.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/registrar/registrar.spec.d.ts.map deleted file mode 100644 index 222915a66..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/registrar/registrar.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registrar.spec.d.ts","sourceRoot":"","sources":["../../../test/registrar/registrar.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/registrar/registrar.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/registrar/registrar.spec.js deleted file mode 100644 index 10e85a47c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/registrar/registrar.spec.js +++ /dev/null @@ -1,360 +0,0 @@ -/* eslint-env mocha */ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockDuplex, mockMultiaddrConnection, mockUpgrader, mockConnection } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { mplex } from '@libp2p/mplex'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core/memory'; -import pDefer from 'p-defer'; -import { stubInterface } from 'sinon-ts'; -import { defaultComponents } from '../../src/components.js'; -import { DefaultConnectionManager } from '../../src/connection-manager/index.js'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { DefaultRegistrar } from '../../src/registrar.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -import { matchPeerId } from '../fixtures/match-peer-id.js'; -const protocol = '/test/1.0.0'; -describe('registrar', () => { - let components; - let registrar; - let peerId; - let libp2p; - before(async () => { - peerId = await createPeerId(); - }); - describe('errors', () => { - beforeEach(() => { - const events = new TypedEventEmitter(); - components = defaultComponents({ - peerId, - events, - datastore: new MemoryDatastore(), - upgrader: mockUpgrader({ events }), - transportManager: stubInterface(), - connectionGater: stubInterface() - }); - components.peerStore = new PersistentPeerStore(components); - components.connectionManager = new DefaultConnectionManager(components, { - minConnections: 50, - maxConnections: 1000, - inboundUpgradeTimeout: 1000 - }); - registrar = new DefaultRegistrar(components); - }); - it('should fail to register a protocol if no multicodec is provided', () => { - // @ts-expect-error invalid parameters - return expect(registrar.register()).to.eventually.be.rejected(); - }); - it('should fail to register a protocol if an invalid topology is provided', () => { - const fakeTopology = { - random: 1 - }; - // @ts-expect-error invalid parameters - return expect(registrar.register(fakeTopology)).to.eventually.be.rejected(); - }); - }); - describe('registration', () => { - let registrar; - let peerId; - let connectionManager; - let peerStore; - let events; - beforeEach(async () => { - peerId = await createEd25519PeerId(); - connectionManager = stubInterface(); - peerStore = stubInterface(); - events = new TypedEventEmitter(); - registrar = new DefaultRegistrar({ - peerId, - connectionManager, - peerStore, - events, - logger: defaultLogger() - }); - }); - it('should be able to register a protocol', async () => { - const topology = { - onConnect: () => { }, - onDisconnect: () => { } - }; - expect(registrar.getTopologies(protocol)).to.have.lengthOf(0); - const identifier = await registrar.register(protocol, topology); - expect(identifier).to.exist(); - expect(registrar.getTopologies(protocol)).to.have.lengthOf(1); - }); - it('should be able to unregister a protocol', async () => { - const topology = { - onConnect: () => { }, - onDisconnect: () => { } - }; - expect(registrar.getTopologies(protocol)).to.have.lengthOf(0); - const identifier = await registrar.register(protocol, topology); - expect(registrar.getTopologies(protocol)).to.have.lengthOf(1); - registrar.unregister(identifier); - expect(registrar.getTopologies(protocol)).to.have.lengthOf(0); - }); - it('should not error if unregistering unregistered topology handler', () => { - registrar.unregister('bad-identifier'); - }); - it('should call onConnect handler for connected peers after register', async () => { - const onConnectDefer = pDefer(); - const onDisconnectDefer = pDefer(); - // Setup connections before registrar - const remotePeerId = await createEd25519PeerId(); - const conn = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - // return connection from connection manager - connectionManager.getConnections.withArgs(remotePeerId).returns([conn]); - const topology = { - onConnect: (peerId, connection) => { - expect(peerId.equals(remotePeerId)).to.be.true(); - expect(connection.id).to.eql(conn.id); - onConnectDefer.resolve(); - }, - onDisconnect: (peerId) => { - expect(peerId.equals(remotePeerId)).to.be.true(); - onDisconnectDefer.resolve(); - } - }; - // Register protocol - await registrar.register(protocol, topology); - // Peer data is in the peer store - peerStore.get.withArgs(matchPeerId(remotePeerId)).resolves({ - id: remotePeerId, - addresses: [], - protocols: [protocol], - metadata: new Map(), - tags: new Map() - }); - // remote peer connects - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: conn - } - }); - await onConnectDefer.promise; - // remote peer disconnects - await conn.close(); - events.safeDispatchEvent('peer:disconnect', { - detail: remotePeerId - }); - await onDisconnectDefer.promise; - }); - it('should call onConnect handler after register, once a peer is connected and protocols are updated', async () => { - const onConnectDefer = pDefer(); - const onDisconnectDefer = pDefer(); - // Setup connections before registrar - const remotePeerId = await createEd25519PeerId(); - const conn = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - // return connection from connection manager - connectionManager.getConnections.withArgs(matchPeerId(remotePeerId)).returns([conn]); - const topology = { - onConnect: () => { - onConnectDefer.resolve(); - }, - onDisconnect: () => { - onDisconnectDefer.resolve(); - } - }; - // Register protocol - await registrar.register(protocol, topology); - // remote peer connects - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: conn - } - }); - // Can get details after identify - peerStore.get.withArgs(matchPeerId(conn.remotePeer)).resolves({ - id: conn.remotePeer, - addresses: [], - protocols: [protocol], - metadata: new Map(), - tags: new Map() - }); - // we have a connection to this peer - connectionManager.getConnections.withArgs(matchPeerId(conn.remotePeer)).returns([conn]); - // identify completes - events.safeDispatchEvent('peer:update', { - detail: { - peer: { - id: conn.remotePeer, - protocols: [protocol], - addresses: [], - metadata: new Map() - } - } - }); - await onConnectDefer.promise; - // Peer no longer supports the protocol our topology is registered for - events.safeDispatchEvent('peer:update', { - detail: { - peer: { - id: conn.remotePeer, - protocols: [], - addresses: [], - metadata: new Map() - }, - previous: { - id: conn.remotePeer, - protocols: [protocol], - addresses: [], - metadata: new Map() - } - } - }); - await onDisconnectDefer.promise; - }); - it('should not call topology handlers for transient connection', async () => { - const onConnectDefer = pDefer(); - const onDisconnectDefer = pDefer(); - // Setup connections before registrar - const remotePeerId = await createEd25519PeerId(); - const conn = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - // connection is transient - conn.transient = true; - // return connection from connection manager - connectionManager.getConnections.withArgs(matchPeerId(remotePeerId)).returns([conn]); - const topology = { - onConnect: () => { - onConnectDefer.reject(new Error('Topolgy onConnect called for transient connection')); - }, - onDisconnect: () => { - onDisconnectDefer.reject(new Error('Topolgy onDisconnect called for transient connection')); - } - }; - // Register topology for protocol - await registrar.register(protocol, topology); - // remote peer connects - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: conn - } - }); - await expect(Promise.any([ - onConnectDefer.promise, - onDisconnectDefer.promise, - new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, 1000); - }) - ])).to.eventually.not.be.rejected(); - }); - it('should call topology onConnect handler for transient connection when explicitly requested', async () => { - const onConnectDefer = pDefer(); - // Setup connections before registrar - const remotePeerId = await createEd25519PeerId(); - const conn = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - // connection is transient - conn.transient = true; - // return connection from connection manager - connectionManager.getConnections.withArgs(matchPeerId(remotePeerId)).returns([conn]); - const topology = { - notifyOnTransient: true, - onConnect: () => { - onConnectDefer.resolve(); - } - }; - // Register topology for protocol - await registrar.register(protocol, topology); - // remote peer connects - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: conn - } - }); - await expect(onConnectDefer.promise).to.eventually.be.undefined(); - }); - it('should call topology handlers for non-transient connection opened after transient connection', async () => { - const onConnectDefer = pDefer(); - let callCount = 0; - const topology = { - notifyOnTransient: true, - onConnect: () => { - callCount++; - if (callCount === 2) { - onConnectDefer.resolve(); - } - } - }; - // Register topology for protocol - await registrar.register(protocol, topology); - // Setup connections before registrar - const remotePeerId = await createEd25519PeerId(); - const transientConnection = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - transientConnection.transient = true; - const nonTransientConnection = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - nonTransientConnection.transient = false; - // return connection from connection manager - connectionManager.getConnections.withArgs(matchPeerId(remotePeerId)).returns([ - transientConnection, - nonTransientConnection - ]); - // remote peer connects over transient connection - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: transientConnection - } - }); - // remote peer opens non-transient connection - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: nonTransientConnection - } - }); - await expect(onConnectDefer.promise).to.eventually.be.undefined(); - }); - it('should be able to register and unregister a handler', async () => { - const deferred = pDefer(); - libp2p = await createLibp2pNode({ - peerId: await createEd25519PeerId(), - transports: [ - webSockets() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - deferred.resolve(components); - } - } - }); - const components = await deferred.promise; - const registrar = components.registrar; - expect(registrar.getProtocols()).to.not.have.any.keys(['/echo/1.0.0', '/echo/1.0.1']); - const echoHandler = () => { }; - await libp2p.handle(['/echo/1.0.0', '/echo/1.0.1'], echoHandler); - expect(registrar.getHandler('/echo/1.0.0')).to.have.property('handler', echoHandler); - expect(registrar.getHandler('/echo/1.0.1')).to.have.property('handler', echoHandler); - await libp2p.unhandle(['/echo/1.0.0']); - expect(registrar.getProtocols()).to.not.have.any.keys(['/echo/1.0.0']); - expect(registrar.getHandler('/echo/1.0.1')).to.have.property('handler', echoHandler); - await expect(libp2p.peerStore.get(libp2p.peerId)).to.eventually.have.deep.property('protocols', [ - '/echo/1.0.1' - ]); - }); - }); -}); -//# sourceMappingURL=registrar.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/registrar/registrar.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/registrar/registrar.spec.js.map deleted file mode 100644 index 221e63da6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/registrar/registrar.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registrar.spec.js","sourceRoot":"","sources":["../../../test/registrar/registrar.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,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;YACtE,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;YAEpF,MAAM,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE;gBAC9F,aAAa;aACd,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.node.d.ts deleted file mode 100644 index e263e69a5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=transport-manager.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.node.d.ts.map deleted file mode 100644 index a4afdb959..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.node.d.ts","sourceRoot":"","sources":["../../../test/transports/transport-manager.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.node.js deleted file mode 100644 index 46a77e5fd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.node.js +++ /dev/null @@ -1,110 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { start, stop } from '@libp2p/interface/startable'; -import { FaultTolerance } from '@libp2p/interface/transport'; -import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { tcp } from '@libp2p/tcp'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core/memory'; -import { pEvent } from 'p-event'; -import pWaitFor from 'p-wait-for'; -import sinon from 'sinon'; -import { DefaultAddressManager } from '../../src/address-manager/index.js'; -import { defaultComponents } from '../../src/components.js'; -import { DefaultTransportManager } from '../../src/transport-manager.js'; -const addrs = [ - multiaddr('/ip4/127.0.0.1/tcp/0'), - multiaddr('/ip4/127.0.0.1/tcp/0') -]; -describe('Transport Manager (TCP)', () => { - let tm; - let localPeer; - let components; - before(async () => { - localPeer = await createEd25519PeerId(); - }); - beforeEach(async () => { - const events = new TypedEventEmitter(); - components = defaultComponents({ - peerId: localPeer, - events, - datastore: new MemoryDatastore(), - upgrader: mockUpgrader({ events }) - }); - components.addressManager = new DefaultAddressManager(components, { listen: addrs.map(addr => addr.toString()) }); - components.peerStore = new PersistentPeerStore(components); - tm = new DefaultTransportManager(components, { - faultTolerance: FaultTolerance.NO_FATAL - }); - components.transportManager = tm; - await start(tm); - }); - afterEach(async () => { - await tm.removeAll(); - expect(tm.getTransports()).to.be.empty(); - await stop(tm); - }); - it('should be able to add and remove a transport', async () => { - expect(tm.getTransports()).to.have.lengthOf(0); - tm.add(tcp()({ - logger: defaultLogger() - })); - expect(tm.getTransports()).to.have.lengthOf(1); - await tm.remove('@libp2p/tcp'); - expect(tm.getTransports()).to.have.lengthOf(0); - }); - it('should be able to listen', async () => { - const transport = tcp()({ - logger: defaultLogger() - }); - expect(tm.getTransports()).to.be.empty(); - tm.add(transport); - expect(tm.getTransports()).to.have.lengthOf(1); - const spyListener = sinon.spy(transport, 'createListener'); - await tm.listen(addrs); - // Ephemeral ip addresses may result in multiple listeners - expect(tm.getAddrs().length).to.equal(addrs.length); - await tm.stop(); - expect(spyListener.called).to.be.true(); - }); - it('should be able to dial', async () => { - tm.add(tcp()({ - logger: defaultLogger() - })); - await tm.listen(addrs); - const addr = tm.getAddrs().shift(); - if (addr == null) { - throw new Error('Could not find addr'); - } - const connection = await tm.dial(addr); - expect(connection).to.exist(); - await connection.close(); - }); - it('should remove listeners when they stop listening', async () => { - const transport = tcp()({ - logger: defaultLogger() - }); - tm.add(transport); - expect(tm.getListeners()).to.have.lengthOf(0); - const spyListener = sinon.spy(transport, 'createListener'); - await tm.listen(addrs); - expect(spyListener.callCount).to.equal(addrs.length); - // wait for listeners to start listening - await pWaitFor(async () => { - return tm.getListeners().length === addrs.length; - }); - // wait for listeners to stop listening - const closePromise = Promise.all(spyListener.getCalls().map(async (call) => { - return pEvent(call.returnValue, 'close'); - })); - await Promise.all(tm.getListeners().map(async (l) => { await l.close(); })); - await closePromise; - expect(tm.getListeners()).to.have.lengthOf(0); - await tm.stop(); - }); -}); -//# sourceMappingURL=transport-manager.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.node.js.map deleted file mode 100644 index ca003966e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.node.js","sourceRoot":"","sources":["../../../test/transports/transport-manager.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAC1E,OAAO,EAAE,iBAAiB,EAAmB,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AAGxE,MAAM,KAAK,GAAG;IACZ,SAAS,CAAC,sBAAsB,CAAC;IACjC,SAAS,CAAC,sBAAsB,CAAC;CAClC,CAAA;AAED,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,IAAI,EAA2B,CAAA;IAC/B,IAAI,SAAiB,CAAA;IACrB,IAAI,UAAsB,CAAA;IAE1B,MAAM,CA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CAAA;QAClD,CAAC,CAAC,CAAA;QAEF,uCAAuC;QACvC,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAC9B,WAAW,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,KAAK,EAAC,IAAI,EAAC,EAAE;YACtC,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;QAC1C,CAAC,CAAC,CACH,CAAA;QAED,MAAM,OAAO,CAAC,GAAG,CACf,EAAE,CAAC,YAAY,EAAE,CAAC,GAAG,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE,GAAG,MAAM,CAAC,CAAC,KAAK,EAAE,CAAA,CAAC,CAAC,CAAC,CACtD,CAAA;QAED,MAAM,YAAY,CAAA;QAElB,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;QAE7C,MAAM,EAAE,CAAC,IAAI,EAAE,CAAA;IACjB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.spec.d.ts deleted file mode 100644 index 9f7b811b6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=transport-manager.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.spec.d.ts.map deleted file mode 100644 index edad9dac1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.spec.d.ts","sourceRoot":"","sources":["../../../test/transports/transport-manager.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.spec.js deleted file mode 100644 index 7cbfe284f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.spec.js +++ /dev/null @@ -1,158 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { start, stop } from '@libp2p/interface/startable'; -import { FaultTolerance } from '@libp2p/interface/transport'; -import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import sinon from 'sinon'; -import { DefaultAddressManager } from '../../src/address-manager/index.js'; -import { codes as ErrorCodes } from '../../src/errors.js'; -import { createLibp2p } from '../../src/index.js'; -import { DefaultTransportManager } from '../../src/transport-manager.js'; -const listenAddr = multiaddr('/ip4/127.0.0.1/tcp/0'); -describe('Transport Manager (WebSockets)', () => { - let tm; - let components; - beforeEach(async () => { - const events = new TypedEventEmitter(); - components = { - peerId: await createEd25519PeerId(), - events, - upgrader: mockUpgrader({ events }), - logger: defaultLogger() - }; - components.addressManager = new DefaultAddressManager(components, { listen: [listenAddr.toString()] }); - tm = new DefaultTransportManager(components, { - faultTolerance: FaultTolerance.NO_FATAL - }); - await start(tm); - }); - afterEach(async () => { - await tm.removeAll(); - await stop(tm); - expect(tm.getTransports()).to.be.empty(); - }); - it('should be able to add and remove a transport', async () => { - const transport = webSockets({ - filter: filters.all - }); - expect(tm.getTransports()).to.have.lengthOf(0); - tm.add(transport({ - logger: defaultLogger() - })); - expect(tm.getTransports()).to.have.lengthOf(1); - await tm.remove('@libp2p/websockets'); - expect(tm.getTransports()).to.have.lengthOf(0); - }); - it('should not be able to add a transport twice', async () => { - tm.add(webSockets()({ - logger: defaultLogger() - })); - expect(() => { - tm.add(webSockets()({ - logger: defaultLogger() - })); - }) - .to.throw() - .and.to.have.property('code', ErrorCodes.ERR_DUPLICATE_TRANSPORT); - }); - it('should be able to dial', async () => { - tm.add(webSockets({ filter: filters.all })({ - logger: defaultLogger() - })); - const addr = multiaddr(process.env.RELAY_MULTIADDR); - const connection = await tm.dial(addr); - expect(connection).to.exist(); - await connection.close(); - }); - it('should fail to dial an unsupported address', async () => { - tm.add(webSockets({ filter: filters.all })({ - logger: defaultLogger() - })); - const addr = multiaddr('/ip4/127.0.0.1/tcp/0'); - await expect(tm.dial(addr)) - .to.eventually.be.rejected() - .and.to.have.property('code', ErrorCodes.ERR_TRANSPORT_UNAVAILABLE); - }); - it('should fail to listen with no valid address', async () => { - tm = new DefaultTransportManager(components); - tm.add(webSockets({ filter: filters.all })({ - logger: defaultLogger() - })); - await expect(start(tm)) - .to.eventually.be.rejected() - .and.to.have.property('code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - await stop(tm); - }); -}); -describe('libp2p.transportManager (dial only)', () => { - let peerId; - let libp2p; - before(async () => { - peerId = await createEd25519PeerId(); - }); - afterEach(async () => { - sinon.restore(); - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('fails to start if multiaddr fails to listen', async () => { - libp2p = await createLibp2p({ - peerId, - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0'] - }, - transports: [webSockets()], - connectionEncryption: [plaintext()], - start: false - }); - await expect(libp2p.start()).to.eventually.be.rejected - .with.property('code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('does not fail to start if provided listen multiaddr are not compatible to configured transports (when supporting dial only mode)', async () => { - libp2p = await createLibp2p({ - peerId, - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0'] - }, - transportManager: { - faultTolerance: FaultTolerance.NO_FATAL - }, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ], - start: false - }); - await expect(libp2p.start()).to.eventually.be.undefined(); - }); - it('does not fail to start if provided listen multiaddr fail to listen on configured transports (when supporting dial only mode)', async () => { - libp2p = await createLibp2p({ - peerId, - addresses: { - listen: ['/ip4/127.0.0.1/tcp/12345/p2p/QmWDn2LY8nannvSWJzruUYoLZ4vV83vfCBwd8DipvdgQc3/p2p-circuit'] - }, - transportManager: { - faultTolerance: FaultTolerance.NO_FATAL - }, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ], - start: false - }); - await expect(libp2p.start()).to.eventually.be.undefined(); - }); -}); -//# sourceMappingURL=transport-manager.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.spec.js.map deleted file mode 100644 index fa5f523bb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/transports/transport-manager.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.spec.js","sourceRoot":"","sources":["../../../test/transports/transport-manager.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC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--git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/upgrading/upgrader.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/upgrading/upgrader.spec.d.ts deleted file mode 100644 index 9763583dc..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/upgrading/upgrader.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=upgrader.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/upgrading/upgrader.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/upgrading/upgrader.spec.d.ts.map deleted file mode 100644 index aa7115453..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/upgrading/upgrader.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"upgrader.spec.d.ts","sourceRoot":"","sources":["../../../test/upgrading/upgrader.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/upgrading/upgrader.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/upgrading/upgrader.spec.js deleted file mode 100644 index 156069e09..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/upgrading/upgrader.spec.js +++ /dev/null @@ -1,857 +0,0 @@ -/* eslint-env mocha */ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { circuitRelayTransport } from '@libp2p/circuit-relay-v2'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockConnectionGater, mockConnectionManager, mockMultiaddrConnPair, mockRegistrar, mockStream, mockMuxer } from '@libp2p/interface-compliance-tests/mocks'; -import { mplex } from '@libp2p/mplex'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core'; -import delay from 'delay'; -import all from 'it-all'; -import drain from 'it-drain'; -import { pipe } from 'it-pipe'; -import pDefer from 'p-defer'; -import { pEvent } from 'p-event'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { Uint8ArrayList } from 'uint8arraylist'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { defaultComponents } from '../../src/components.js'; -import { codes } from '../../src/errors.js'; -import { createLibp2p } from '../../src/index.js'; -import { DEFAULT_MAX_OUTBOUND_STREAMS } from '../../src/registrar.js'; -import { DefaultUpgrader } from '../../src/upgrader.js'; -const addrs = [ - multiaddr('/ip4/127.0.0.1/tcp/0'), - multiaddr('/ip4/127.0.0.1/tcp/0') -]; -describe('Upgrader', () => { - let localUpgrader; - let localMuxerFactory; - let localYamuxerFactory; - let localConnectionEncrypter; - let localConnectionProtector; - let remoteUpgrader; - let remoteMuxerFactory; - let remoteYamuxerFactory; - let remoteConnectionEncrypter; - let remoteConnectionProtector; - let localPeer; - let remotePeer; - let localComponents; - let remoteComponents; - beforeEach(async () => { - ([ - localPeer, - remotePeer - ] = await Promise.all([ - createEd25519PeerId(), - createEd25519PeerId() - ])); - localConnectionProtector = stubInterface(); - localConnectionProtector.protect.resolvesArg(0); - localComponents = defaultComponents({ - peerId: localPeer, - connectionGater: mockConnectionGater(), - registrar: mockRegistrar(), - datastore: new MemoryDatastore(), - connectionProtector: localConnectionProtector, - events: new TypedEventEmitter() - }); - localComponents.peerStore = new PersistentPeerStore(localComponents); - localComponents.connectionManager = mockConnectionManager(localComponents); - localMuxerFactory = mplex()(localComponents); - localYamuxerFactory = yamux()(); - localConnectionEncrypter = plaintext()(localComponents); - localUpgrader = new DefaultUpgrader(localComponents, { - connectionEncryption: [ - localConnectionEncrypter - ], - muxers: [ - localMuxerFactory, - localYamuxerFactory - ], - inboundUpgradeTimeout: 1000 - }); - remoteConnectionProtector = stubInterface(); - remoteConnectionProtector.protect.resolvesArg(0); - remoteComponents = defaultComponents({ - peerId: remotePeer, - connectionGater: mockConnectionGater(), - registrar: mockRegistrar(), - datastore: new MemoryDatastore(), - connectionProtector: remoteConnectionProtector, - events: new TypedEventEmitter() - }); - remoteComponents.peerStore = new PersistentPeerStore(remoteComponents); - remoteComponents.connectionManager = mockConnectionManager(remoteComponents); - remoteMuxerFactory = mplex()(remoteComponents); - remoteYamuxerFactory = yamux()(); - remoteConnectionEncrypter = plaintext()(remoteComponents); - remoteUpgrader = new DefaultUpgrader(remoteComponents, { - connectionEncryption: [ - remoteConnectionEncrypter - ], - muxers: [ - remoteMuxerFactory, - remoteYamuxerFactory - ], - inboundUpgradeTimeout: 1000 - }); - await localComponents.registrar.handle('/echo/1.0.0', ({ stream }) => { - void pipe(stream, stream); - }, { - maxInboundStreams: 10, - maxOutboundStreams: 10 - }); - await remoteComponents.registrar.handle('/echo/1.0.0', ({ stream }) => { - void pipe(stream, stream); - }, { - maxInboundStreams: 10, - maxOutboundStreams: 10 - }); - }); - afterEach(() => { - sinon.restore(); - }); - it('should upgrade with valid muxers and crypto', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - const stream = await connections[0].newStream('/echo/1.0.0'); - expect(stream).to.have.property('protocol', '/echo/1.0.0'); - const hello = uint8ArrayFromString('hello there!'); - const result = await pipe([hello], stream, function toBuffer(source) { - return (async function* () { - for await (const val of source) - yield val.slice(); - })(); - }, async (source) => all(source)); - expect(result).to.eql([hello]); - }); - it('should upgrade with only crypto', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - // No available muxers - localUpgrader = new DefaultUpgrader(localComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [], - inboundUpgradeTimeout: 1000 - }); - remoteUpgrader = new DefaultUpgrader(remoteComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [], - inboundUpgradeTimeout: 1000 - }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - await expect(connections[0].newStream('/echo/1.0.0')).to.be.rejected(); - // Verify the MultiaddrConnection close method is called - const inboundCloseSpy = sinon.spy(inbound, 'close'); - const outboundCloseSpy = sinon.spy(outbound, 'close'); - await Promise.all(connections.map(async (conn) => { await conn.close(); })); - expect(inboundCloseSpy.callCount).to.equal(1); - expect(outboundCloseSpy.callCount).to.equal(1); - }); - it('should use a private connection protector when provided', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const protector = { - async protect(connection) { - return connection; - } - }; - const protectorProtectSpy = sinon.spy(protector, 'protect'); - localComponents.connectionProtector = protector; - remoteComponents.connectionProtector = protector; - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - const stream = await connections[0].newStream('/echo/1.0.0'); - expect(stream).to.have.property('protocol', '/echo/1.0.0'); - const hello = uint8ArrayFromString('hello there!'); - const result = await pipe([hello], stream, function toBuffer(source) { - return (async function* () { - for await (const val of source) - yield val.slice(); - })(); - }, async (source) => all(source)); - expect(result).to.eql([hello]); - expect(protectorProtectSpy.callCount).to.eql(2); - }); - it('should fail if crypto fails', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - class BoomCrypto { - static protocol = '/insecure'; - protocol = '/insecure'; - async secureInbound() { throw new Error('Boom'); } - async secureOutbound() { throw new Error('Boom'); } - } - localUpgrader = new DefaultUpgrader(localComponents, { - connectionEncryption: [ - new BoomCrypto() - ], - muxers: [], - inboundUpgradeTimeout: 1000 - }); - remoteUpgrader = new DefaultUpgrader(remoteComponents, { - connectionEncryption: [ - new BoomCrypto() - ], - muxers: [], - inboundUpgradeTimeout: 1000 - }); - // Wait for the results of each side of the connection - const results = await Promise.allSettled([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - // Ensure both sides fail - expect(results).to.have.length(2); - results.forEach(result => { - expect(result).to.have.property('status', 'rejected'); - expect(result).to.have.nested.property('reason.code', codes.ERR_ENCRYPTION_FAILED); - }); - }); - it('should clear timeout if upgrade is successful', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - localUpgrader = new DefaultUpgrader(localComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [ - yamux()() - ], - inboundUpgradeTimeout: 1000 - }); - remoteUpgrader = new DefaultUpgrader(remoteComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [ - yamux()() - ], - inboundUpgradeTimeout: 1000 - }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - await delay(2000); - expect(connections).to.have.length(2); - connections.forEach(conn => { - conn.close().catch(() => { - throw new Error('Failed to close connection'); - }); - }); - }); - it('should fail if muxers do not match', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - class OtherMuxer { - protocol = '/muxer-local'; - streams = []; - newStream(name) { - throw new Error('Not implemented'); - } - source = (async function* () { - yield* []; - })(); - async sink() { } - async close() { } - abort() { } - } - class OtherMuxerFactory { - protocol = '/muxer-local'; - createStreamMuxer(init) { - return new OtherMuxer(); - } - } - class OtherOtherMuxerFactory { - protocol = '/muxer-local-other'; - createStreamMuxer(init) { - return new OtherMuxer(); - } - } - localUpgrader = new DefaultUpgrader(localComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [ - new OtherMuxerFactory(), - new OtherOtherMuxerFactory() - ], - inboundUpgradeTimeout: 1000 - }); - remoteUpgrader = new DefaultUpgrader(remoteComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [ - yamux()(), - mplex()(localComponents) - ], - inboundUpgradeTimeout: 1000 - }); - // Wait for the results of each side of the connection - const results = await Promise.allSettled([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - // Ensure both sides fail - expect(results).to.have.length(2); - results.forEach(result => { - expect(result).to.have.property('status', 'rejected'); - expect(result).to.have.nested.property('reason.code', codes.ERR_MUXER_UNAVAILABLE); - }); - }); - it('should map getStreams and close methods', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - // Create a few streams, at least 1 in each direction - // use multiple protocols to trigger regular multistream select - await connections[0].newStream(['/echo/1.0.0', '/echo/1.0.1']); - await connections[1].newStream(['/echo/1.0.0', '/echo/1.0.1']); - await connections[0].newStream(['/echo/1.0.0', '/echo/1.0.1']); - connections.forEach(conn => { - expect(conn.streams).to.have.length(3); - }); - // Verify the MultiaddrConnection close method is called - const inboundCloseSpy = sinon.spy(inbound, 'close'); - const outboundCloseSpy = sinon.spy(outbound, 'close'); - await Promise.all(connections.map(async (conn) => { await conn.close(); })); - expect(inboundCloseSpy.callCount).to.equal(1); - expect(outboundCloseSpy.callCount).to.equal(1); - }); - it('should call connection handlers', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const localConnectionEventReceived = pDefer(); - const localConnectionEndEventReceived = pDefer(); - const remoteConnectionEventReceived = pDefer(); - const remoteConnectionEndEventReceived = pDefer(); - localComponents.events.addEventListener('connection:open', () => { - localConnectionEventReceived.resolve(); - }); - localComponents.events.addEventListener('connection:close', () => { - localConnectionEndEventReceived.resolve(); - }); - remoteComponents.events.addEventListener('connection:open', () => { - remoteConnectionEventReceived.resolve(); - }); - remoteComponents.events.addEventListener('connection:close', () => { - remoteConnectionEndEventReceived.resolve(); - }); - // Verify onConnection is called with the connection - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - await Promise.all([ - localConnectionEventReceived.promise, - remoteConnectionEventReceived.promise - ]); - // Verify onConnectionEnd is called with the connection - await Promise.all(connections.map(async (conn) => { await conn.close(); })); - await Promise.all([ - localConnectionEndEventReceived.promise, - remoteConnectionEndEventReceived.promise - ]); - }); - it('should fail to create a stream for an unsupported protocol', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - const results = await Promise.allSettled([ - connections[0].newStream('/unsupported/1.0.0'), - connections[1].newStream('/unsupported/1.0.0') - ]); - expect(results).to.have.length(2); - results.forEach(result => { - expect(result).to.have.property('status', 'rejected'); - expect(result).to.have.nested.property('reason.code', codes.ERR_UNSUPPORTED_PROTOCOL); - }); - }); - it('should abort protocol selection for slow streams', async () => { - const createStreamMuxerSpy = sinon.spy(localMuxerFactory, 'createStreamMuxer'); - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - // 10 ms timeout - const signal = AbortSignal.timeout(10); - // should have created muxer for connection - expect(createStreamMuxerSpy).to.have.property('callCount', 1); - // create mock muxed stream that never sends data - const muxer = createStreamMuxerSpy.getCall(0).returnValue; - muxer.newStream = () => { - return mockStream({ - source: (async function* () { - // longer than the timeout - await delay(1000); - yield new Uint8ArrayList(); - }()), - sink: drain - }); - }; - await expect(connections[0].newStream(['/echo/1.0.0', '/echo/1.0.1'], { - signal - })) - .to.eventually.be.rejected.with.property('code', 'ABORT_ERR'); - }); - it('should close streams when protocol negotiation fails', async () => { - await remoteComponents.registrar.unhandle('/echo/1.0.0'); - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections[0].streams).to.have.lengthOf(0); - expect(connections[1].streams).to.have.lengthOf(0); - await expect(connections[0].newStream(['/echo/1.0.0', '/echo/1.0.1'])) - .to.eventually.be.rejected.with.property('code', 'ERR_UNSUPPORTED_PROTOCOL'); - // wait for remote to close - await delay(100); - expect(connections[0].streams).to.have.lengthOf(0); - expect(connections[1].streams).to.have.lengthOf(0); - }); - it('should allow skipping encryption, protection and muxing', async () => { - const localStreamMuxerFactorySpy = sinon.spy(localMuxerFactory, 'createStreamMuxer'); - const localMuxerFactoryOverride = mockMuxer(); - const localStreamMuxerFactoryOverrideSpy = sinon.spy(localMuxerFactoryOverride, 'createStreamMuxer'); - const localConnectionEncrypterSpy = sinon.spy(localConnectionEncrypter, 'secureOutbound'); - const remoteStreamMuxerFactorySpy = sinon.spy(remoteMuxerFactory, 'createStreamMuxer'); - const remoteMuxerFactoryOverride = mockMuxer(); - const remoteStreamMuxerFactoryOverrideSpy = sinon.spy(remoteMuxerFactoryOverride, 'createStreamMuxer'); - const remoteConnectionEncrypterSpy = sinon.spy(remoteConnectionEncrypter, 'secureInbound'); - const { inbound, outbound } = mockMultiaddrConnPair({ - addrs: [ - multiaddr('/ip4/127.0.0.1/tcp/0').encapsulate(`/p2p/${remotePeer.toString()}`), - multiaddr('/ip4/127.0.0.1/tcp/0') - ], - remotePeer - }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound, { - skipEncryption: true, - skipProtection: true, - muxerFactory: localMuxerFactoryOverride - }), - remoteUpgrader.upgradeInbound(inbound, { - skipEncryption: true, - skipProtection: true, - muxerFactory: remoteMuxerFactoryOverride - }) - ]); - expect(connections).to.have.length(2); - const stream = await connections[0].newStream(['/echo/1.0.0', '/echo/1.0.1']); - expect(stream).to.have.property('protocol', '/echo/1.0.0'); - const hello = uint8ArrayFromString('hello there!'); - const result = await pipe([hello], stream, function toBuffer(source) { - return (async function* () { - for await (const val of source) - yield val.slice(); - })(); - }, async (source) => all(source)); - expect(result).to.eql([hello]); - expect(localStreamMuxerFactorySpy.callCount).to.equal(0, 'did not use passed stream muxer factory'); - expect(localStreamMuxerFactoryOverrideSpy.callCount).to.equal(1, 'did not use passed stream muxer factory'); - expect(remoteStreamMuxerFactorySpy.callCount).to.equal(0, 'did not use passed stream muxer factory'); - expect(remoteStreamMuxerFactoryOverrideSpy.callCount).to.equal(1, 'did not use passed stream muxer factory'); - expect(localConnectionEncrypterSpy.callCount).to.equal(0, 'used local connection encrypter'); - expect(remoteConnectionEncrypterSpy.callCount).to.equal(0, 'used remote connection encrypter'); - expect(localConnectionProtector.protect.callCount).to.equal(0, 'used local connection protector'); - expect(remoteConnectionProtector.protect.callCount).to.equal(0, 'used remote connection protector'); - }); -}); -describe('libp2p.upgrader', () => { - let peers; - let libp2p; - let remoteLibp2p; - before(async () => { - peers = await Promise.all([ - createEd25519PeerId(), - createEd25519PeerId() - ]); - }); - afterEach(async () => { - sinon.restore(); - if (libp2p != null) { - await libp2p.stop(); - } - if (remoteLibp2p != null) { - await remoteLibp2p.stop(); - } - }); - it('should create an Upgrader', async () => { - const deferred = pDefer(); - const protector = { - async protect(connection) { - return connection; - } - }; - libp2p = await createLibp2p({ - peerId: peers[0], - transports: [ - webSockets() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionProtector: () => protector, - services: { - test: (components) => { - deferred.resolve(components); - } - } - }); - const components = await deferred.promise; - expect(components.upgrader).to.exist(); - expect(components.connectionProtector).to.exist(); - }); - it('should return muxed streams', async () => { - const localDeferred = pDefer(); - const remoteDeferred = pDefer(); - const remotePeer = peers[1]; - libp2p = await createLibp2p({ - peerId: peers[0], - transports: [ - webSockets() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - localDeferred.resolve(components); - } - } - }); - const echoHandler = () => { }; - await libp2p.handle(['/echo/1.0.0'], echoHandler); - remoteLibp2p = await createLibp2p({ - peerId: remotePeer, - transports: [ - webSockets() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - remoteDeferred.resolve(components); - } - } - }); - await remoteLibp2p.handle('/echo/1.0.0', echoHandler); - const localComponents = await localDeferred.promise; - const remoteComponents = await remoteDeferred.promise; - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const [localConnection] = await Promise.all([ - localComponents.upgrader.upgradeOutbound(outbound), - remoteComponents.upgrader.upgradeInbound(inbound) - ]); - const remoteLibp2pUpgraderOnStreamSpy = sinon.spy(remoteComponents.upgrader, '_onStream'); - const stream = await localConnection.newStream(['/echo/1.0.0', '/echo/1.0.1']); - expect(stream).to.include.keys(['id', 'sink', 'source']); - const [arg0] = remoteLibp2pUpgraderOnStreamSpy.getCall(0).args; - expect(arg0.stream).to.include.keys(['id', 'sink', 'source']); - }); - it('should emit connect and disconnect events', async () => { - const remotePeer = peers[1]; - libp2p = await createLibp2p({ - peerId: peers[0], - addresses: { - listen: [ - `${process.env.RELAY_MULTIADDR}/p2p-circuit` - ] - }, - transports: [ - webSockets({ - filter: filters.all - }), - circuitRelayTransport() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }); - await libp2p.start(); - remoteLibp2p = await createLibp2p({ - peerId: remotePeer, - transports: [ - webSockets({ - filter: filters.all - }), - circuitRelayTransport() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }); - await remoteLibp2p.start(); - // Upgrade and check the connect event - const connectionPromise = pEvent(libp2p, 'connection:open'); - const connection = await remoteLibp2p.dial(libp2p.getMultiaddrs()); - const connectEvent = await connectionPromise; - if (connectEvent.type !== 'connection:open') { - throw new Error(`Incorrect event type, expected: 'connection:open' actual: ${connectEvent.type}`); - } - expect(remotePeer.equals(connectEvent.detail.remotePeer)).to.equal(true); - const disconnectionPromise = pEvent(libp2p, 'peer:disconnect'); - // Close and check the disconnect event - await connection.close(); - const disconnectEvent = await disconnectionPromise; - if (disconnectEvent.type !== 'peer:disconnect') { - throw new Error(`Incorrect event type, expected: 'peer:disconnect' actual: ${disconnectEvent.type}`); - } - expect(remotePeer.equals(disconnectEvent.detail)).to.equal(true); - }); - it('should limit the number of incoming streams that can be opened using a protocol', async () => { - const localDeferred = pDefer(); - const remoteDeferred = pDefer(); - const protocol = '/a-test-protocol/1.0.0'; - const remotePeer = peers[1]; - libp2p = await createLibp2p({ - peerId: peers[0], - transports: [ - webSockets() - ], - streamMuxers: [ - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - localDeferred.resolve(components); - } - }, - connectionGater: mockConnectionGater() - }); - remoteLibp2p = await createLibp2p({ - peerId: remotePeer, - transports: [ - webSockets() - ], - streamMuxers: [ - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - remoteDeferred.resolve(components); - } - }, - connectionGater: mockConnectionGater() - }); - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const localComponents = await localDeferred.promise; - const remoteComponents = await remoteDeferred.promise; - const [localToRemote] = await Promise.all([ - localComponents.upgrader.upgradeOutbound(outbound), - remoteComponents.upgrader.upgradeInbound(inbound) - ]); - let streamCount = 0; - await libp2p.handle(protocol, (data) => { }, { - maxInboundStreams: 10, - maxOutboundStreams: 10 - }); - await remoteLibp2p.handle(protocol, (data) => { - streamCount++; - }, { - maxInboundStreams: 1, - maxOutboundStreams: 1 - }); - expect(streamCount).to.equal(0); - await localToRemote.newStream([protocol, '/other/1.0.0']); - expect(streamCount).to.equal(1); - const s = await localToRemote.newStream(protocol); - await expect(drain(s.source)).to.eventually.be.rejected() - .with.property('code', 'ERR_STREAM_RESET'); - }); - it('should limit the number of outgoing streams that can be opened using a protocol', async () => { - const localDeferred = pDefer(); - const remoteDeferred = pDefer(); - const protocol = '/a-test-protocol/1.0.0'; - const remotePeer = peers[1]; - libp2p = await createLibp2p({ - peerId: peers[0], - transports: [ - webSockets() - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - localDeferred.resolve(components); - } - }, - connectionGater: mockConnectionGater() - }); - remoteLibp2p = await createLibp2p({ - peerId: remotePeer, - transports: [ - webSockets() - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - remoteDeferred.resolve(components); - } - } - }); - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const localComponents = await localDeferred.promise; - const remoteComponents = await remoteDeferred.promise; - const [localToRemote] = await Promise.all([ - localComponents.upgrader.upgradeOutbound(outbound), - remoteComponents.upgrader.upgradeInbound(inbound) - ]); - let streamCount = 0; - await libp2p.handle(protocol, (data) => { }, { - maxInboundStreams: 1, - maxOutboundStreams: 1 - }); - await remoteLibp2p.handle(protocol, (data) => { - streamCount++; - }, { - maxInboundStreams: 10, - maxOutboundStreams: 10 - }); - expect(streamCount).to.equal(0); - await localToRemote.newStream([protocol, '/other/1.0.0']); - expect(streamCount).to.equal(1); - await expect(localToRemote.newStream(protocol)).to.eventually.be.rejected() - .with.property('code', codes.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS); - }); - it('should allow overriding the number of outgoing streams that can be opened using a protocol without a handler', async () => { - const localDeferred = pDefer(); - const remoteDeferred = pDefer(); - const protocol = '/a-test-protocol/1.0.0'; - const remotePeer = peers[1]; - libp2p = await createLibp2p({ - peerId: peers[0], - transports: [ - webSockets() - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - localDeferred.resolve(components); - } - }, - connectionGater: mockConnectionGater() - }); - remoteLibp2p = await createLibp2p({ - peerId: remotePeer, - transports: [ - webSockets() - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - remoteDeferred.resolve(components); - } - } - }); - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const localComponents = await localDeferred.promise; - const remoteComponents = await remoteDeferred.promise; - const [localToRemote] = await Promise.all([ - localComponents.upgrader.upgradeOutbound(outbound), - remoteComponents.upgrader.upgradeInbound(inbound) - ]); - let streamCount = 0; - const limit = DEFAULT_MAX_OUTBOUND_STREAMS + 1; - await remoteLibp2p.handle(protocol, (data) => { - streamCount++; - }, { - maxInboundStreams: limit + 1, - maxOutboundStreams: 10 - }); - expect(streamCount).to.equal(0); - for (let i = 0; i < limit; i++) { - await localToRemote.newStream([protocol, '/other/1.0.0'], { - maxOutboundStreams: limit - }); - } - expect(streamCount).to.equal(limit); - // should reject without overriding limit - await expect(localToRemote.newStream(protocol)).to.eventually.be.rejected() - .with.property('code', codes.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS); - // should reject even with overriding limit - await expect(localToRemote.newStream(protocol, { - maxOutboundStreams: limit - })).to.eventually.be.rejected() - .with.property('code', codes.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS); - }); -}); -//# sourceMappingURL=upgrader.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/upgrading/upgrader.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/upgrading/upgrader.spec.js.map deleted file mode 100644 index 216c17147..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/test/upgrading/upgrader.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"upgrader.spec.js","sourceRoot":"","sources":["../../../test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2CAA2C;QAC3C,MAAM,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,EAAE;YAC7C,kBAAkB,EAAE,KAAK;SAC1B,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE;aAC5B,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,sCAAsC,CAAC,CAAA;IACxE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/tsconfig.tsbuildinfo deleted file mode 100644 index 92126c681..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../interface/dist/src/errors.d.ts","../../interface/dist/src/startable.d.ts","../../../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../../../node_modules/multiformats/dist/types/src/block/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../../../node_modules/multiformats/dist/types/src/link/interface.d.ts","../../../node_modules/multiformats/dist/types/src/cid.d.ts","../../interface/dist/src/peer-id/index.d.ts","../../logger/dist/src/index.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../../../node_modules/it-stream-types/dist/src/index.d.ts","../../../node_modules/uint8arraylist/dist/src/index.d.ts","../../interface/dist/src/connection/index.d.ts","../../interface/dist/src/peer-info/index.d.ts","../../interface/dist/src/content-routing/index.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../interface/dist/src/events.d.ts","../../interface/dist/src/metrics/index.d.ts","../../interface/dist/src/peer-routing/index.d.ts","../../interface/dist/src/peer-store/index.d.ts","../../interface/dist/src/stream-handler/index.d.ts","../../interface/dist/src/topology/index.d.ts","../../interface/dist/src/stream-muxer/index.d.ts","../../interface/dist/src/transport/index.d.ts","../../interface/dist/src/index.d.ts","../../interface/dist/src/connection-gater/index.d.ts","../../interface-internal/dist/src/address-manager/index.d.ts","../../peer-collections/dist/src/map.d.ts","../../peer-collections/dist/src/set.d.ts","../../peer-collections/dist/src/list.d.ts","../../peer-collections/dist/src/index.d.ts","../../interface-internal/dist/src/connection-manager/index.d.ts","../../interface-internal/dist/src/registrar/index.d.ts","../../interface-internal/dist/src/transport-manager/index.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../../../node_modules/multiformats/dist/types/src/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../../../node_modules/multiformats/dist/types/src/varint.d.ts","../../../node_modules/multiformats/dist/types/src/bytes.d.ts","../../../node_modules/multiformats/dist/types/src/index.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/raw.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/json.d.ts","../../../node_modules/multiformats/dist/types/src/bases/base.d.ts","../../../node_modules/multiformats/dist/types/src/basics.d.ts","../../../node_modules/uint8arrays/dist/src/util/bases.d.ts","../../../node_modules/uint8arrays/dist/src/to-string.d.ts","../../../node_modules/interface-datastore/dist/src/key.d.ts","../../../node_modules/interface-store/dist/src/index.d.ts","../../../node_modules/interface-datastore/dist/src/index.d.ts","../src/components.ts","../../utils/dist/src/address-sort.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/resolvers/index.d.ts","../../../node_modules/merge-options/index.d.ts","../src/errors.ts","../../crypto/dist/src/keys/ed25519-class.d.ts","../../crypto/dist/src/keys/interface.d.ts","../../crypto/dist/src/keys/ecdh.d.ts","../../crypto/dist/src/keys/ephemeral-keys.d.ts","../../crypto/dist/src/keys/key-stretcher.d.ts","../../../node_modules/protons-runtime/dist/src/codec.d.ts","../../../node_modules/protons-runtime/dist/src/decode.d.ts","../../../node_modules/protons-runtime/dist/src/encode.d.ts","../../../node_modules/protons-runtime/dist/src/codecs/enum.d.ts","../../../node_modules/protons-runtime/dist/src/codecs/message.d.ts","../../../node_modules/protons-runtime/dist/src/utils/reader.d.ts","../../../node_modules/protons-runtime/dist/src/utils/writer.d.ts","../../../node_modules/protons-runtime/dist/src/index.d.ts","../../crypto/dist/src/keys/keys.d.ts","../../crypto/dist/src/keys/rsa-class.d.ts","../../crypto/dist/src/keys/secp256k1-class.d.ts","../../interface/dist/src/keys/index.d.ts","../../crypto/dist/src/keys/index.d.ts","../../interface/dist/src/peer-discovery/index.d.ts","../../peer-id/dist/src/index.d.ts","../../peer-id-factory/dist/src/index.d.ts","../../peer-store/dist/src/index.d.ts","../../../node_modules/datastore-core/dist/src/base.d.ts","../../../node_modules/datastore-core/dist/src/memory.d.ts","../../../node_modules/uint8arrays/dist/src/concat.d.ts","../../../node_modules/uint8arrays/dist/src/from-string.d.ts","../src/address-manager/utils.ts","../src/address-manager/index.ts","../src/config/connection-gater.ts","../../interface/dist/src/peer-store/tags.d.ts","../../../node_modules/rate-limiter-flexible/lib/index.d.ts","../src/get-peer.ts","../../../node_modules/eventemitter3/index.d.ts","../../../node_modules/p-queue/dist/queue.d.ts","../../../node_modules/p-queue/dist/options.d.ts","../../../node_modules/p-queue/dist/priority-queue.d.ts","../../../node_modules/p-queue/dist/index.d.ts","../../utils/dist/src/peer-job-queue.d.ts","../src/connection-manager/constants.defaults.ts","../src/connection-manager/constants.ts","../src/connection-manager/auto-dial.ts","../src/connection-manager/connection-pruner.ts","../../../node_modules/any-signal/dist/src/index.d.ts","../../../node_modules/p-defer/index.d.ts","../src/connection-manager/utils.ts","../src/connection-manager/dial-queue.ts","../src/connection-manager/index.ts","../../../node_modules/it-merge/dist/src/index.d.ts","../../../node_modules/it-pipe/dist/src/index.d.ts","../../../node_modules/it-filter/dist/src/index.d.ts","../../../node_modules/it-map/dist/src/index.d.ts","../src/content-routing/utils.ts","../src/content-routing/index.ts","../../../node_modules/it-first/dist/src/index.d.ts","../src/peer-routing.ts","../src/registrar.ts","../../interface/dist/src/metrics/tracked-map.d.ts","../src/transport-manager.ts","../../multistream-select/dist/src/constants.d.ts","../../../node_modules/it-byte-stream/dist/src/index.d.ts","../../../node_modules/it-length-prefixed/dist/src/encode.d.ts","../../../node_modules/it-reader/dist/src/index.d.ts","../../../node_modules/it-length-prefixed/dist/src/decode.d.ts","../../../node_modules/it-length-prefixed/dist/src/index.d.ts","../../../node_modules/it-length-prefixed-stream/dist/src/index.d.ts","../../multistream-select/dist/src/select.d.ts","../../multistream-select/dist/src/handle.d.ts","../../multistream-select/dist/src/index.d.ts","../src/connection/index.ts","../../interface/dist/src/connection-encrypter/index.d.ts","../src/upgrader.ts","../src/version.ts","../src/libp2p.ts","../src/index.ts","../src/config.ts","../../../node_modules/private-ip/lib/index.d.ts","../src/config/connection-gater.browser.ts","../src/connection-manager/constants.browser.ts","../../../node_modules/protobufjs/index.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.d.ts","../../../node_modules/it-pushable/dist/src/index.d.ts","../../interface/dist/src/pubsub/index.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message-cache.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-stats.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/compute-score.d.ts","../../../node_modules/denque/index.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/message-deliveries.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/metrics.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/set.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/index.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/tracer.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/config.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/stream.d.ts","../../../node_modules/protobufjs/minimal.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/decoderpc.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/@types/basic.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/proto/payload.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/@types/libp2p.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/nonce.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/@types/handshake.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/crypto.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/noise.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/crypto/js.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/index.d.ts","../../../node_modules/@chainsafe/libp2p-yamux/dist/src/config.d.ts","../../../node_modules/@chainsafe/libp2p-yamux/dist/src/frame.d.ts","../../utils/dist/src/abstract-stream.d.ts","../../../node_modules/@chainsafe/libp2p-yamux/dist/src/stream.d.ts","../../../node_modules/@chainsafe/libp2p-yamux/dist/src/muxer.d.ts","../../../node_modules/@chainsafe/libp2p-yamux/dist/src/index.d.ts","../../transport-circuit-relay-v2/dist/src/pb/index.d.ts","../../../node_modules/it-protobuf-stream/dist/src/index.d.ts","../../transport-circuit-relay-v2/dist/src/server/advert-service.d.ts","../../transport-circuit-relay-v2/dist/src/server/reservation-store.d.ts","../../transport-circuit-relay-v2/dist/src/server/index.d.ts","../../transport-circuit-relay-v2/dist/src/transport/discovery.d.ts","../../transport-circuit-relay-v2/dist/src/transport/reservation-store.d.ts","../../transport-circuit-relay-v2/dist/src/transport/index.d.ts","../../transport-circuit-relay-v2/dist/src/constants.d.ts","../../transport-circuit-relay-v2/dist/src/index.d.ts","../../../node_modules/@libp2p/daemon-protocol/dist/src/index.d.ts","../../../node_modules/@libp2p/daemon-protocol/dist/src/stream-handler.d.ts","../../../node_modules/@libp2p/daemon-client/dist/src/index.d.ts","../../kad-dht/dist/src/providers.d.ts","../../../node_modules/progress-events/dist/src/index.d.ts","../../kad-dht/dist/src/record/record.d.ts","../../kad-dht/dist/src/record/index.d.ts","../../kad-dht/dist/src/index.d.ts","../../../node_modules/@libp2p/daemon-server/dist/src/index.d.ts","../../pubsub/dist/src/index.d.ts","../../pubsub-floodsub/dist/src/cache.d.ts","../../pubsub-floodsub/dist/src/config.d.ts","../../pubsub-floodsub/dist/src/index.d.ts","../../protocol-identify/dist/src/index.d.ts","../../../node_modules/@libp2p/interop/dist/src/connect.d.ts","../../../node_modules/@libp2p/interop/dist/src/dht/index.d.ts","../../../node_modules/@libp2p/interop/dist/src/pubsub/index.d.ts","../../../node_modules/@libp2p/interop/dist/src/relay/index.d.ts","../../../node_modules/@libp2p/interop/dist/src/streams/index.d.ts","../../../node_modules/@libp2p/interop/dist/src/index.d.ts","../../stream-multiplexer-mplex/dist/src/message-types.d.ts","../../stream-multiplexer-mplex/dist/src/stream.d.ts","../../stream-multiplexer-mplex/dist/src/mplex.d.ts","../../stream-multiplexer-mplex/dist/src/index.d.ts","../../transport-tcp/dist/src/listener.d.ts","../../transport-tcp/dist/src/index.d.ts","../../../node_modules/execa/index.d.ts","../../../node_modules/go-libp2p/dist/src/index.d.ts","../test/interop.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/@types/chai-as-promised/index.d.ts","../../../node_modules/chai-parentheses/index.d.ts","../../../node_modules/@types/chai-subset/index.d.ts","../../../node_modules/chai-bites/index.d.ts","../../../node_modules/@types/chai-string/index.d.ts","../../../node_modules/aegir/dist/utils/chai.d.ts","../../../node_modules/delay/index.d.ts","../../../node_modules/@types/sinonjs__fake-timers/index.d.ts","../../../node_modules/@types/sinon/index.d.ts","../../../node_modules/sinon-ts/dist/src/index.d.ts","../test/addresses/address-manager.spec.ts","../../connection-encrypter-plaintext/dist/src/index.d.ts","../../utils/dist/src/multiaddr/is-loopback.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/it-ws/dist/src/sink.d.ts","../../../node_modules/it-ws/dist/src/web-socket.d.ts","../../../node_modules/it-ws/dist/src/duplex.d.ts","../../../node_modules/it-ws/dist/src/client.d.ts","../../transport-websockets/dist/src/index.d.ts","../../../node_modules/p-timeout/index.d.ts","../../../node_modules/p-event/index.d.ts","../../../node_modules/p-times/node_modules/p-map/index.d.ts","../../../node_modules/p-times/index.d.ts","../../interface-compliance-tests/dist/src/mocks/connection-gater.d.ts","../../interface-compliance-tests/dist/src/mocks/connection-manager.d.ts","../../interface-compliance-tests/dist/src/mocks/connection.d.ts","../../interface-compliance-tests/dist/src/mocks/multiaddr-connection.d.ts","../../interface-compliance-tests/dist/src/mocks/muxer.d.ts","../../interface-compliance-tests/dist/src/mocks/registrar.d.ts","../../interface-compliance-tests/dist/src/mocks/upgrader.d.ts","../../interface-compliance-tests/dist/src/mocks/duplex.d.ts","../../interface-compliance-tests/dist/src/mocks/metrics.d.ts","../../interface-compliance-tests/dist/src/mocks/index.d.ts","../../transport-websockets/dist/src/filters.d.ts","../test/fixtures/base-options.browser.ts","../test/fixtures/creators/peer.ts","../test/fixtures/base-options.ts","../test/addresses/utils.ts","../test/addresses/addresses.node.ts","../../interface-compliance-tests/dist/src/index.d.ts","../../interface-compliance-tests/dist/src/connection/index.d.ts","../../interface-compliance-tests/dist/src/peers.d.ts","../test/connection/fixtures/pair.ts","../test/connection/compliance.spec.ts","../test/connection/index.spec.ts","../../../node_modules/datastore-core/dist/src/errors.d.ts","../../../node_modules/datastore-core/dist/src/shard.d.ts","../../../node_modules/datastore-core/dist/src/keytransform.d.ts","../../../node_modules/datastore-core/dist/src/sharding.d.ts","../../../node_modules/datastore-core/dist/src/mount.d.ts","../../../node_modules/datastore-core/dist/src/tiered.d.ts","../../../node_modules/datastore-core/dist/src/namespace.d.ts","../../../node_modules/datastore-core/dist/src/index.d.ts","../../../node_modules/p-wait-for/index.d.ts","../test/fixtures/match-peer-id.ts","../test/connection-manager/auto-dial.spec.ts","../../../node_modules/@multiformats/multiaddr-matcher/dist/src/index.d.ts","../test/connection-manager/dial-queue.spec.ts","../test/fixtures/echo-service.ts","../test/connection-manager/direct.node.ts","../test/connection-manager/direct.spec.ts","../../../node_modules/it-all/dist/src/index.d.ts","../test/connection-manager/index.node.ts","../test/connection-manager/index.spec.ts","../test/connection-manager/resolver.spec.ts","../../../node_modules/it-drain/dist/src/index.d.ts","../test/content-routing/utils.ts","../test/content-routing/content-routing.node.ts","../test/content-routing/dht/utils.ts","../test/content-routing/dht/operation.node.ts","../test/core/consume-peer-record.spec.ts","../test/core/encryption.spec.ts","../test/core/events.spec.ts","../test/core/get-public-key.spec.ts","../test/core/listening.node.ts","../test/core/peer-id.spec.ts","../../peer-discovery-bootstrap/dist/src/index.d.ts","../../crypto/dist/src/aes/index.d.ts","../../crypto/dist/src/hmac/index.d.ts","../../crypto/dist/src/pbkdf2.d.ts","../../crypto/dist/src/random-bytes.d.ts","../../crypto/dist/src/index.d.ts","../../../node_modules/@types/dns-packet/index.d.ts","../../../node_modules/@types/multicast-dns/index.d.ts","../../peer-discovery-mdns/dist/src/mdns.d.ts","../../peer-discovery-mdns/dist/src/index.d.ts","../test/peer-discovery/index.node.ts","../test/peer-discovery/index.spec.ts","../test/peer-routing/utils.ts","../test/peer-routing/peer-routing.node.ts","../test/registrar/registrar.spec.ts","../test/transports/transport-manager.node.ts","../test/transports/transport-manager.spec.ts","../test/upgrading/upgrader.spec.ts","../../../node_modules/keyv/src/index.d.ts","../../../node_modules/@types/http-cache-semantics/index.d.ts","../../../node_modules/@types/responselike/index.d.ts","../../../node_modules/@types/cacheable-request/index.d.ts","../../../node_modules/@types/ms/index.d.ts","../../../node_modules/@types/debug/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/keyv/index.d.ts","../../../node_modules/@types/linkify-it/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/lodash.random/index.d.ts","../../../node_modules/@types/lodash.range/index.d.ts","../../../node_modules/@types/mdurl/encode.d.ts","../../../node_modules/@types/mdurl/decode.d.ts","../../../node_modules/@types/mdurl/parse.d.ts","../../../node_modules/@types/mdurl/format.d.ts","../../../node_modules/@types/mdurl/index.d.ts","../../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../../node_modules/@types/markdown-it/lib/token.d.ts","../../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../../node_modules/@types/markdown-it/lib/index.d.ts","../../../node_modules/@types/markdown-it/index.d.ts","../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/mdast/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/minimist/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/retry/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/sinon-chai/index.d.ts","../../../node_modules/@types/strip-bom/index.d.ts","../../../node_modules/@types/strip-json-comments/index.d.ts","../../../node_modules/@types/which/index.d.ts","../../../node_modules/@types/xsalsa20/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts","../../../node_modules/@types/yauzl/index.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/proto/payload.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","cb4b40f34fe4b1d87c530a0f3c2c1e043e338829fab8cf5cbd92a91c8c1374b8","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc","176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","4369b27ca2716a04200930b5f24fa87a6ed62d8c70f80a83270956b6b23c32ae","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"8d6138a264ddc6f94f16e99d4e117a2d6eb31b217891cf091b6437a2f114d561","affectsGlobalScope":true},"a882b74c4ba115c6e86371f3592a3accb2c50874b6fcd92a4f83d17a4d6993af","4a8722c7d7a4dac1616db1f41ad0113998ccbbbcd37af43def3fbe6b41208c83","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"0b3868d3f87c95ea73bdfab380e536843ec3573aa76233b97aac40518494ea24","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","30c2ec6abf6aaa60eb4f32fb1235531506b7961c6d1bdc7430711aec8fd85295","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"d48009cbe8a30a504031cc82e1286f78fed33b7a42abf7602c23b5547b382563","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"24ba151e213906027e2b1f5223d33575a3612b0234a0e2b56119520bbe0e594b","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","28c1fc8505da2181ee74c9fe902fac964159cfae266c4413905d50eaecea8a19","84b8cc86ad19115f2637401cdd220460a25542df478c966a5ffc5eeaf3825299",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","1bf687d978bdd6d5aff10b9eb0ff0695179f8594d4446946fd0182d6d25fa433","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1","7f2cc72a16a663ab9f8d99bd5658e583251ce0c003bf80a948973e15a7ef9596","af89ab13b40dd28cd91818fc6329914d2b9663591831f032ff0f0cb4a028d4a5","83a1426ac1a9cf144141dfe10d71a68629623a7c28245c9ca0e0352bead501fd","2726c0a6a4a87fad11e6846e6b0b40b8924fbe66340adc512093c4273bc53e4e","c888daaa99fdf6c5712d98605fdcf21cbbaab756a629661a44cac44ede464d37","e044f60686dc70015a3b7e7c64ad0ac5ec5ec101a0aede0782ec077e136b6a65","a232f867897bbecfebf68df575a417af1afd9b5dd3d83fb4d59e0a133a0de93d","228dbc8825b7a45af7d416dee95c0a2162d7cf73ffddfd52357b7e548882bdaa","4e152867a5b1bea2dc6a2921c0196f877630fc144369f8c7b9a69905caa62741","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","88de5467cd5e4c2c1384629806d56ac1215657bddf39ef9f60a0e05beee2b131","ff5820394809bfc32a7e4586ff11b3c07327a0f4c756709aef92f1cd73d6da48","bfe2af20f3ff0579331661ef4c5d2597e0c31a7a0d760e41eaff0502bf064c4d","f52a0e53f79d7fd1c1c55a3cbda59499d4cce75f3188969024cdc286b29ad3ea","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","a878d4c7237a7af50e96534295fcf723134d70cbb1e9bfd8365266b912aee6ec","8970ab047d89c71edf9973609dd62f61bb366abeabbff36a1200103b6c1c605b","36d756189d9295e3a964e5cd45cb8ac965d5d2ada53ed848e08608426c146d69","8bdb5c16e8b9ba625ec08d8189879a6fb47b2c3c458a5d43ebd53a8763b5712e",{"version":"d920cd596508281d66f5b040b2e5c2728b02dc59cd481905dfa019dcf7151473","signature":"0d954151e68f83130428c7c4e47b4578edb239e5d1f4e0e3fce6fa3987fd0c46"},"38efa025cf48a42e6f449592f2bccb35729b182b1f6435701f75c6fe555b9cde","fadc84f69bab30e956d9926db282149dacad42d5f300a4cf6ed81b7d43c51d0b","d9619bdf47b220d356c646b3693eb6fd5cd0cfd1016da5b2f1d37ad0763da88d",{"version":"73d6a504cf3a99898e727db717d4d65d804f07c27324feb7e6991f4d9c8f7557","signature":"faac43934437f1d0900b60a80bca64fe9b7357b02fdabfe16b5e735155de3d42"},"b9998d79c6cb4e43e9d812fec5ccafbedee623c589904e3e3f0439ef861e25dd","7a6f74294b8fb90f5e3832be21e25898dd81b2a1adc36dda6929813ba4135311","d25e693302c8e284b417884b40dbadffe693b0daff8999a000995114dbf74c49","a1d4ac1b15cd62c7346d976e3a01e6cbcd4f166ea6b7866907d25c5acc832d77","5d40e6a7071d0d1e6e558e17214ff786ecb3ea73e31b25a88c2cbe2435fa1252","fd617cc8eec6f43227ab572160bac9d23c723073e83a9b100bd15c758eff34c2","ec3786b43d68955ecdb12ce679d3bc61b6b25c4d0ac5bcdaf50fa4a746189b98","3155e98b0df0c1523715e8a1c75c8a67c401aeb58d6eccf8bd89d5d775b8c1cf","fa82b7b22d9df87323e31e9e2ad75911028f3e544647fd212424b3c4452fee3f","90aa0b916eef195a17c3dbd621746f82ac7969ecc3dbf27c81ee4c68c5af7f25","9ceec2a882368c0160a8a3879aa0efce0fb985751fc23ff6191006030969cfa4","cad5d6451789234434c28dd2d6a8267b0d64c479b1ad267321faa31ba90d570b","e0e8254f7a1a21b5768beb4dbc9d4574ce67aefa59d88251d16b17c658f2a69e","c45242078469b9680653d6a0667b23b1b767ec908825a14bfa8bb1dde2e30dae","5dcd218cfe8eb7fd6a1e5668c1a98734ddefe888d17129f8844552dddda2a74d","0564c90e8c2577950a446d6197a3ab7ec433ad5ac98435378e8855427f4cbf24","e1712267198fc3dd7903d0b945d5049fd56d68cadaf986c0adc40235fee43488","df21f5c49d638cbd6bd322eeb5b16d8352ba14ccb88cc9b23a7d8d5c2eaaf659","40924f439552f559ffa4e41d300a411646ac9f3b53e578a012f7c439d36c6a30","f6d13788d90394a540d136fb8ba9a0a647d8baa2e51d2ae155d039b031f4717f","81c6dd936bf342efbb1b1a5440a4300db5d39d70a6ad49ebc91ca7033ae9ce79","924dd07d0dce2040a5106708a766802871d83562671e5aa3a443a87007428af1","8b1b666fe96fd9e713f1279a3e446f16ee824f46ca0c2c075e4e89f0b1258e6c","6aecbb60c2216da24acb86490f7c6270a820fd85424c8a509e3d284aa47f7a56","6af9cf238459fe6d7e2d61cd50a157a6f540905c9793718e0e6e5993ab0cd650","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f",{"version":"a9c5ce8f8c58d9765a03253195220cf4f92dafcec282422eb8a040529347810f","signature":"eb7e1526f24a930a1704fb10dbb8ea6b67155201538511c0597a78fe52cd5ad0"},{"version":"9d2c89e67738dde758932be6024680e8a75fcb29a5bcae0e849c880b9b5a2874","signature":"e21613b58d0d5d11dc5145c33a4e946e2f1c45a8a205af81605756688dd6ceaf"},{"version":"b549b4d3c0dbcbd5ba7e390f73551e47da1a2f4540f02748b67d097c839e8d5b","signature":"b627014446a386a8d065a2d0b4101c30694d51727e23da49233d8907e5b713c7"},"55e5a976b594dc02f054860fb59a5299872a5b3c8c90e96733a5c9c9d4ed1fb8","fd0dcd93884e6815d949e96fa15c89fdcbdab54503da402ae3a4caf31579c936",{"version":"e6bb2b7fadde29c393d340275d4ac7aeacf1eb876595f57aa24e5513a382b3ef","signature":"63ca909407550cae71c33965de45eecd193b8f8f039351c035fa5f1048c56844"},"27679e96d1bd38c5938178aaf4abe8627493090b63d6bae2ce8436e6a87ebe4d","a77fbecee25688f568e18b43f8f54195d6c278a2a9a687ada5ab3d2f726524eb","e29f2b3a93ca3392fe29fa8e7b93985e854b44fe28e2b5c113f08296095bd6b7","d27956c8b392088a06d882e1edb58aab4d5cf5ab1229b73f99329ab21f352147","d643518d0b08b3d8d6e7f1fa884bca57ef95caaa1c312abbd9e1d4ed0d51c370","2808ffd2725582e383a1d994188f0ad0eb2c456dc9845e8b6aa327383adb061e",{"version":"41ae2c0b7d01b64ec7b62ad4ccda00ad31a0aa7ae7f7284c2fd42e0936a88c5e","signature":"80988a4177913a1a01949bbf9e937652db5c88e54ccd3c3cceb76b333e456dd8"},{"version":"626ea938ac500bfaa0949f341ef326537d5892fc0c5657f3daf19a26fdbba9ec","signature":"5bfc6fd511694c1b7a798f9d8ba74c36f0319fe250a8d0620f938754316cc63f"},{"version":"bcf650f73a69cfe54c668c11901d7ce5baf9fdaaaa6420ec17253e67a1632c8f","signature":"be50726c9d62972a6797fc828490aaf8bf47a0b316f513c62043d6d26763ca25"},{"version":"614db724cedd81dc8a8b7ec3a375169d3055db2220c77bfbeeb5312eb4adf07b","signature":"3d9fe271b931d600a0f40f892b38fef1ce19193598aa7c41a649f9d70681ba3b"},"ca027df9fd496a200d99ca0db4b0077463ce4926a6c8e05cfae522c5971ccbc0","acd5d501223e3a7cdd229b501fce5fb071937b72bd05fa33e543eb21c8ee0aba",{"version":"0f2023112b4aa2e14dcff2572aefcaa69cdcf4143d1316a7c2f72dd3af8168e4","signature":"4de820fd1ee608149e674b6a7cc0d1fc0e492602238318696bc1887545874828"},{"version":"c5fda50b180cf1afdd1a3a68a8fa4a2723fcd4360a4e528db486d0ee4a598c16","signature":"2cac9001d5225ca959d0c3f5f80d35d5f013e8ebed154c498eca6c4972f4bab4"},{"version":"65827869dba0b53120021452552098e9ae4f4f4893d02e3809aea287379d0385","signature":"b958ae1dbad15a21485564e451f5e2228d90b71ec5a34bbdac9d9a5e724977e8"},"ebc51770c27d90812d97af081e035c941e7ce706a909c838e759b6d605967f83","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6","b9c8e45d6c518e88e902d77684fd368aff2965cf1b68553f65595a02fcdb9271","4c7450b3aa5f4eca98e0cc2c9345ced21ff3eac3e1d7e9cdb60c1506af3c28ac",{"version":"e0db3f04a02c9ef7e7dcc6b2d3df5b1429772cf2a621c10a7c55f1d900b5f08b","signature":"c8be47f329ddbed80083263f609d8c371aef74f245533fe8f735cfdc7ff81f46"},{"version":"5e72b8a1f80b69026210580877854692458685702dc6e594be768610a2ec3c40","signature":"0818e6c6df479d2fa37a814b3dfb485bc62cdaa0d2bc0975a8f8c92cb94d0019"},"f0d7ddd36a5f0302dbad31ae1756103614b1d2cb5d66787f6c7707421844600f",{"version":"0eab3309046467aa3bc74d3a63144a23c5d752fbc51a866cd5151bb3a0135b95","signature":"cc709944ab0871c160c167f85783e1d4c6965118253189a7d4050929f3ee9731"},{"version":"3e89bcb6787647878dee340dd79c3cc80cf12acfe49292f8b0a675c76d25fd80","signature":"663d1476d5406bb576933204087e4f6ca44c046ae2dbfa9557d1984c9f4625de"},"4dd9ae44b5db6481b9e4b97d73a11c70bc73b9872fcbe7afd294ac144524327a",{"version":"0faaec63b3842dcfff015dd500d6c4e5a2638f68ab6f118d743171a8492b8ff0","signature":"d6015cb929c7cb6ccde98f27cc9132dcf19c17ecc9603dcf9d7f3db1f3f2a407"},"18ea46e4d0790901645c0c35dba475cd9cc807bff21069d0712dc6cdd8e5a948","f7cd98b9514f659b7c56823a01bfbc090d160315d6cbec8b0bc93cb6e51256ee","f30cfcfff28ee8f87563225b47239bb07b9b11edd09dda0ea6499b18cca1a30e","0edb8a97ead1fefd337458449050857e80740e31a3f76cffa656262f4e651a50","db8e4b47dd8c22634e3a326e5a5f60aa71a8ad4a0458fc0aadb6951f1c7cdc54","5b7a6d3f5c1b1d94d6cbc6c1e113588e20ae61d583d0d0cb5ec3fd92926d3749","61e6c9b8686325521a57c5b666fe2eff5a2ded387d784ef798074be55c065115","49e4e28978a87105cd9f0751ef1de0f0027f05b54bb7fa7e6623384e249e2b69","08fa330c7b2cff91534f26d3b425c1c91e4dc09456eac94a4b90d7327d78ff45","6b36e4d73dc098ce39e690245b11bcddf64d3bf899ee3492c3a3b90fe7c4ef4a",{"version":"48d1f43215005531a8504b28ead6eeb1028e207f0ba5d0a48bf662c3cd83aee7","signature":"a57c2842a2521df37424e2408aa2a56959fb21289cdad0e1f46db96b90f26bab"},"f5337c3ea7b8702ffe2718f56a24325a67d517c0d552ef71b8d578d9f33a99d3",{"version":"b0150ab8495cfd4663d8dd8e9e0d7ca41ae2ef11949660ba5f8a8a7f4ed48977","signature":"dba2c5b1d82935514a77d71247e55bee230e03a5ae4e0e81bd3100910a74fd72"},{"version":"49edd25481acf33a4ddc1e247ec183e8baedcc3046ec73d0bd667d548002e8a3","signature":"fa091e487523449b62860cde2e6b83dddccf8443c3340f5834ff8ee937b97862"},{"version":"6fba7311ed757f04bef53b3681d9bbba4b681ea26a9b5fc0f05441df9247faca","signature":"452a1c5114901a45142bd00787acdbfcec0df71d6e8f08d44359990ac5018512"},{"version":"a7041eccf3ab5836cef6a250d19891dafa0baa144d356e4e995951ae07638abe","signature":"8f184e0e9ab262f3876e9df1c4f558d073e2423c5f52f9e5fcdb26401f1f1da6"},{"version":"ce2a4ca07d0b15fce4d2524e40d0c43a8631034996e92944e041fa090f9d0a18","signature":"1a0f1f766840f4d8da9242bd623dae922220a68103649d69ebb2de45b48e815d"},"db5a96761bf022851439f3e689ea8b7aca6055037647ba21501ed22d7c1b3bb3",{"version":"49ce78b09ad6872188259c0581435bc04faf9e09ed51ebd8e14ea73c7b6cf2ce","signature":"9e01780d391da4a7ff69191f227e324d7c6eff00f2c43cce9b6241761847741c"},{"version":"698b99e5612a81874c7c8816ebfd905bb2f4241a08dddb6dc6172a66a33a58a3","signature":"8c28bf28c8f832aa42278508fcb89eb937ebc13e3d39039a42d5cc72516974e8"},"688c9dfd2b7114f5f01022abb5b179659f990d5af5924f185c2644ca99fe7b77","925a8770415572378b7b62dcd714e744b7ffed86de59bdbe1d25c68d9d1f7f51","fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","03e385ae2125c9aa9dead008b42a0ab20d0812c26c19ee210d84c2666113f867","444fd02034dcb14575c1d65b39678654508784d34c4d66d6631b54bb6aa24d21","d4936633d5453e441ad5ab182efad46a0e1285fe5f9f5c2948cad3e71b7c2c23","7378c8a8eb3feec7b36b268d55794b625a77f1a3a4d075932425fd263aadd8c2","a1b60bd2328318dcbec30bdf529dad31a13315ff2df60c8bd71630c58a575b06","5d11703e2c5d4dbe00bbe79f3bc864d178cf8d6ebccc2d1448ea29e93654f029","92aabe63a01fe06680e7e49775d5a66524f4816d49490af8e82330e5aeff91fd","ed849d616865076f44a41c87f27698f7cdf230290c44bafc71d7c2bc6919b202","5c2862817a9073efcdc8608cb171525067c4a7afd82f2cd800bf208104085234","626a82c4bd44767fb7ab3709a2a7857d43b02b575e7d1678d3d24f889515983c","8f364fec0ef20506aa9cf00b5cd8b620c1c0389687b11a3a32b0b5d4716ad894","dcef5e69bfd584dd4640a8363792acac1f2328767a57f401ee6daa0f281c632a","763bb8df872cbb8783e29e19bd7a1dea0f88f7fd7398343af38be8509a65df82","c286b410193495d067668bcdbd13ea3f3a39001edff02edee248babf2652e563","ba1405da509cc84896a588978efc45400d4f9844ee738d750b59868b1ad1618a","129e03ea345ad2ec480758767408a6119112e1c1d6a454f83524c8590549a949","932cade1c5802123b5831f332ad8a6297f0f7d14d0ee04f5a774408f393e2200","1165dc3daad62e737ee6c7016470a4a9a4c751be9f47da494a718a0b428bfe49","1969a7f95125132dd513d57d726f4a645270bbe2c4036ae23231f6fe916b0bd3","35095a100857bdbca3c31ddd6e1eb18259140dee0092d97e631889daf084eaec","6744c64cda78d6af7280d69c20ead828fa4296efe0b582548cb10ab66914993d","612bf9cb0b0a7ce6eab9fa9c09da1b1e4e5ec8f6b94f282035bfc89f68d4f3c6","1cc2659564153cef042b6a377a36a04d861398d678e7032ec42698d8c80ec77f","1f66808998faa0d77e425d4c5ae8f481c3234d4b8c1deff001e1af71b4b041f3","2f37bd92ed3c6cbac299dbfd79abe367c5e5d72e098abdb8d3e3900badd53e88","4110b29391d0835f9b88a4c69cb7e1cdddbac43ca9ee86393ebc15567c271b4d","8db42cde9161c917ae86f075cb21c16d1fab5965db0c4f4b372b4e7a0276f82e","f2dc190b33c1e842552ab4117c29cc960edd8ce2327a22254ec47cbcbdbb91f7","c8031a5db82b240f801a5684ab693e95e1e06dc76958894fe42d35acbd446f28","1633b84fd3346ad6500a88e7a119ac778bb6f6b2746a3b7b8164c5ef2721822f","75e0c62536016dac8cc0d825742ff7cc4c0455ebc86923e47edcc19edac0997c","de6afce5d1e6f2f81a5030fee9c7400a56b3c4077c5f9699cd71294c91e525cf","067ab20bf63d65f9b724398636d5083a71fb7d8cfe80a504ce2d2fe31400eab7","df54eaa5ea53c6bb3a9548bc5d2f6fb22583ea3e8b936a4e8ec5acfd90422ff3","faff9c6bf0fdb4020a7562249152411c8836693214e96fb1ec8af5935ccf6f1f","a982ea9a0d0c2fd5bb64eb8b251a80528fd73dc75a0ff2945483c778d1538a45","c23e3a1201af6ac7008a961c755134b204e3a9cf88b0483dbcf84e6a8439abf6","58cb8a81e19e00682e13e339d3f5ca0e24062d4144459b83f5fab67fddb4ab2b","bbd1f1105b91037d6ea5e27a488842f519a639bf9544140a80887069d98aef79","91061d4b30ccb1bdecb7f77e1b2fe4851834216214e836a4bdc3e4ff509ace65","90c062de3a56230a2788738b08a1180ade53bff424fbcc4cccef9010f8ff8bf5","02501688d58478fe06e958ddb5e194c1176e59bc7978b98d565a25ada290e294","e1b02ca4c82a90dabfdf773d4e80e56741e57923f2b73b2626a0555d61c9b7b4","71d388419783d94fb23aa078aec7258e470733d2d0ef80e792c226f820d245d2","be8d072f400254824429edab10acbe595299b702c97b99cc47f8e8018b7102ff","1a319786bea64c944ba8dd33331090034468efbab9c2fb96552850033d62d8d8","33174450482b921bbf093e3d52f501f7f93b5fd612311aa86e7339f2800162aa","a549d8215160fc249abf80f37aeebc573b26b491fe99c90a4ab70e50ea44948e","6e6733927ade923e34b243d6fbec1465cfc8ed6edf62c6e09ed00c529f0d93de","83b3a9e85f7967509436fcdfa9be9bd543fb54003a9233c5c0af087e4a2c11c8","dc92d6eccf12395aa1d47afb765d5e4a1cd2639a385db0e3e88e9937ad2b63a3","efcac7cadc707d5a2160f7ecb5c50e1c44491bdc400425edc3fbe8bdeb9b644d","1242141c87ba3396bead6f379f6d6778bd38d02017f243aa448d1454a5fdc90e","359a90789781b494878462da0ce3542c3e2ba9a7ecf15c2fbff8af21eeed3117","db4d7c9c5038c75e1df338d780a6c06c79589b5105f138dd29b62310aab749fe","b056f955c85dd0eb196ff290138eb4a83787c3f413505b9ae2676a602be7d40d","d2012ac9bb5854c62e3a26000bda07f7ed765a3dd8ee7b705c7d83e085706271","0af481fc1bf41aafebc2f02c5df80b1a41bdb1cea1b202c44c1bb0e681f9d63e","17a4105ddae0308e19ee8532bdeb76278efa9dc644366060ca644541d3fd831c","913ffa031f7455c53e99c75ae130a046612d2ee0e716ed92707e996cbd3952ea","44e897d02326bf4d8169ea9638fe0a4c53b8f85cc48ae2fcbbb67b2f72c1d805","288fb1b9df77067c3c2675bde87d23d4a3f01bb6f929f854f11bdb68662968ff","b43b5156bc2831b46f6226777e292ff1646b3651ce190708b6228a078d42da4a","c3e77c4aa1097a38dcf4a20a093ce65033a16f3a48dab0ae3c5f6661bc39b11c","22c980472aeac42a88c7954c9645c5cf0c511142afd048699daf516b25f9ea2d","aabcb267f8a73a9923157af617c47e2d707481760e60967dfa836613e2b7433b","502048f764485a8d13079c153f3ab8659c8d40c900e3d13fe5a4f901216ef7ea","3fdffecf635bb6a2a57a4b5eb321f302355168a775b9d2b56aa0a61748c4db87","0d6e9983d87ca882bd160af191909bce5c1d9b22f4bcb247d914b572cbddc076","590815e7bd28778a71732b03b4852917e18bf42670cc1931e4f95ebe99157838","32cbe201bfe8ed7f4c323fb8a3fcfdfb451f22e84d3c49da33ceda2fbf9230be","50d536e2e8bdbb4234b6ade05992aa4227fbf0401aba24922734c3ddb4a3ff11",{"version":"0ea1988bfa2de2538b465f03ccec8d23a4ad137733c0ac943686044c59301b9b","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d","27573b15894c6311146838fa3b45786bacc013a4bca6c84adc1b11a4e7c8a4c0","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2","8d16e3ff29dd0650435766702b01c2f7e9d1f289a48fcbf8e93687d6ecf33f26",{"version":"4cc7b06037a8b4d268685c9c5f3a7512e5abbbe85754de00eea65e4af69f4d18","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"325d8f966024c6ee9696a9b1ef84fae789029aa40c2f492f513f042506067dd4","4f590c560ee71a07def1a8e0d663d9d7ddb0d806deab94d8ceaac1f6408ac314","f7163a5d37d21f636f6a5cd1c064ce95fada21917859a64b6cc49a8b6fd5c1a8","3f666b04eebdae90161ddb1688911a72644fb9836c076707758391ecdd0efaaa","1dcd0086953c3ed3210ddbb09c9933c3a59629a47feacfdf8245cf3efc69c7af","c18f4ad1703534835a14df4eb6de7e7dfa70f82fe947cb7864399c68169ad3e7","0c4ba3558cec749d376e43f9795ecfab6ad3893e0f8a40a761b0d32bf95524f8","1d34cb56aad5cbca58399312584b2d573e1d4d79917cf9548397b7f5dc8a4a48","91764b36fe5e1c5d688f5f90eeea47703a059ab9a81bf80f7bbc9b04507b7bd3","115327b8e1f68c03004d841b83e332ed16b8f48af59ac00f38313887d7ec2920","177efa90a97917618cef3f68b04ee95c393fceea045dfc0aef2820d5aaa9e8f0","f3c65459172595a5a332a5f74e99d3ddb6200201550a2d1ed1b03dcfa9c0d76f","f6e125b70d7118004733e6856a90163bbeb01a4633316fc2a2aaccbfca6ded6f","46507ca157c8093e9b90b1c62be468ccb4aa693eaacae464b3935f6f24ccc9ff","af9a54fd33c9b0b2c05e433a71994ae07b75a3c4adbe82bdf6de863ce0f0e340","818068f6c587f5540e5cdc7b0f2ea6c04a0b9fe11745ca60f031bf349c17ba5c","d5840c8f2acfef007839d4e252ad45bf87219021c81de7de5cc98646f5d99d0d","f2601f76cd8ebb45e274730c33b44897fdea4bc742cb83fd98586754f08a3398","054dda98b75dec317926dddfb103939b99cccfc8ade63d7e6a2ef2f3343d37f9","a3f9f52ce73700565c8d9ba2aa75823ab8fc8e7258a27ecb828cd4257b8f918d","ad3490364b6442ca8694fc6cd364b63a5d807651a514837cc22ef29df624bb9d","4b5603a1ccca455500cfb39517d41ec011f31ba84bb6de44473344a237d89168","2e5e5c1e456256a0ae3b2aad2b771fc751081ce0a28ec5dc2c64e65b0412dea0",{"version":"29cbd44b63e1373c5333f6a15b146de939492adee7bd0f365daf3a06cd65e21b","signature":"24e087d3b31a47d62c6c3993d39192013c5053f8fbca6071bafc7cec8a8d001b"},{"version":"664564e7585304eef4017daec5cfae3363cab137a5886f60778907349bde8b5b","signature":"3f17c7fa020acaea60b13c7a4aa818b43af21e670a63d2dadc23c91b9e18d0b7"},{"version":"bb3fbadbd80095e2a4e6b4ab3660abad522e3dd29c7ed789b5587a896da0bb54","signature":"e0f6fbf8d68b52c380346198897e0a93f1ae28f86330a88becc270b8c0091036"},{"version":"8cb350cb47ec9806c322ff42235c998bfd2431f8aaea942bc8fa788c4884602a","signature":"878912f2da7af40fcdf0e9c72301491113ad60d80b56f75f9dbcdaf9560efc75"},{"version":"ffcea8929e2e7bcfc9681b53d930d4d76bffa486f3867bc419aa14330c77b922","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","4a337d4b854af8d61f943bb689ccdf523a615d109638148e7c04f8d451124bde","bac9f741786fd70df187dc6a82222ac8516fb7b7034a1266d422febb635c1cbb",{"version":"f18c42254c093ff60ee9d0fd4e7ee14cd6d1a15bacc4cd987eefc2e2557a8dc6","signature":"518a3cef0d51ba223da57c7e8be03696fc4aa41a9f55e1630d548dac970eb6ac"},{"version":"71f5318cea6e3b64a4e1dab2564e819172c476d8769ccb2538aa57932cc65218","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"72033392f964381ad90647d2d9f06cab5bfec7e620f50a7d55de2823544efe19","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"d626f2c25d5d6daddb082576771a8e7b591233a7893a1739513c44f35a3f7489","7c59943d77166c1aecd731af8683a7b5a0984e1bc0427fa35be504d77c41fdcd","d357e56d630bcd0f63cfc678e306702555b4f791c2d8e07f037de39171be4cd3","238f87de951ed064c7ec3e30a987f386d4821bacfc8c7548cdccf848b8b6035c","a93ae01c9ed49ba423599144ffa3cd520db83e53b32471865905a65113bb3e59","6088973936033e869d3616b63d25c15363862b491f46af77d40a5215ee8cc1a8","04a80a0c9937d8d13620c1dcbcad60f3dd44385a76ac4e3b6cc389a955628256","02a8cc0d6cd7bf40d796bc94f975889aa82d0aae28a9b1ae470f4ba036f6ad8d","adb5ad16c19ff8dbfa9daa3a7dc8e1b039c381a2b94383144a53368681ad8ca0",{"version":"f73b9058c762abbcbb49d84b763f34f1dd47b71778e4f8963f01ed3bcc799749","signature":"b7b69c2e092bcba2a7ed8e26febeb8a8c15820c842451da89295ad8fea198e4b"},{"version":"0811daf51c6804a50262affde5c65480f51079b2d2aa1c1a1a948a7946a78ed7","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"b095fc8b641823c0a9dff9b0c7efa153db137c7c1512bb600995cf281b8f607f",{"version":"65ebfc151c78d1f6280915961897bd653175f71d1f0d48d070b0e12a6ee9b5d2","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"ab3cd789079dc58a03c1fa4b03baec764a24355aee00ab9ac4f29a1425d43b6d","signature":"f32f42a0ff6a2c2888746fc195585b4b70d62d09b2013bbb4f984c7ea7a48a66"},{"version":"ae856979375d9e5639b638af0d29ae832c8962ee023cb2b4fc8245e4aab0addd","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"eaa3b7616b2b314395494c049103baac9abed5130c37d8b171b64e841a2d940d","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"5ccc3c7f73ef48c223635cd4506f21133560de7abc4c09c623327bb1b54386dc",{"version":"830cf570c14fc77bfb7077aeaf8d22d124aab3fa6b23f337cedb0e4f65f19cba","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"14fafdc45e77ab7ce0ae87f1e8ceff495e7f80cbf89a8ce939a55eeb673deac6","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"d364010282a38935c34224a3c710246ece045a4f856dd48d46d7706d5ab6f246","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"687ec53a7422d8cf80477fffa82a2db211f724039267931642befcd4907aec26",{"version":"0569aabb972296b4eda3354f04ee852be3a3e5e9146150e410d966d8193e9a8d","signature":"a70f34c07bd6616df1a739e849c159f8cb144e6848808da94983cfdd80717264"},{"version":"8857f2b989814577c48410c51b19210a75e1142d6f673559b8e8cb7cee9155e5","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"74380673bfbcfab03e2ac8fbf7ab3040854088f0135ec6f1a80dab310bf087c7","signature":"1685b7bf75a707a658191846463c7b441d7617876816187236c2f7456f84b67c"},{"version":"6b0182ebdbd5187e44f4d50ed41ea8df8506b17e074e6fba97958542c06b1eae","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"571d2b33d636318cea915cc18aef35d858b9923fa5eec3a2dbdca5ac3b86c543","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"19cff718745012226a4232482c19c3566aeb846d58b0d72fd9e13cfe9925085b","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"3a0c74a63edf77177b54a9bd654315f37ab866823cce9cb11309b526a72b2c8c","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"e1be5fd899f565dfac8d7f831451d3d364ee2438e500ab36b7290ac3f77dfdf1","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"4b4a9cacb07588f869af5e910a9f262ac8c7c61f95a60d7a9766caf52bcf9877","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"42759c04bda25b20ab982e99963f6921934895f60e78d94a22d8d137a78dde59","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"6bcccfb00fbd5e180d8a9f28a4594e50fcf847628e8fc1d8f984d4c9bd24ed1d","df1bbd333631040027035b56cb31093015e59ce977a590500ed09feab109939b","a4f27ea63e3ff26a94b6681967a5276a2df9ddb80ae990df1ad03c0fffb34eca","18418f70457cee30da01c21bc26869ceb1ae65564784136f7fe2f7f2ff8f740f","3d2ec84143e6462a786b5d9ecf06f4f6f67a59a1f16c5a3a5e41721ba8478b7f","892f412f701d356f85cd3cb7d48b87ffecc0d4f85a2005c1d53e5e08414df8b1","5bfd23a4c8765d347e296639b75f50f4dfca445d2eb41ea0892e68b8976a0cdf","62a8effc4dd17bbc2c05927b4ca5f67e73fdb458e203b128c041d0d70ffa6b55","6b235e2b5f651d8fc5e06e6a5e41164164ad1bcce02edbbec07ef9419a6164a9","237b9868dd1ad6ff90abdfe22a14d323162704c6d8987e2b7905684fa3f7bdf3",{"version":"2da3f60192fd2a1bc69d43216b1ba3cd8053df69ddc0466e60eba51469d8159a","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"a1e32322f27ed7e7a9854a1b0025829a9a8694962c8ff08b66bb84bde18d76b3","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"0569aabb972296b4eda3354f04ee852be3a3e5e9146150e410d966d8193e9a8d","signature":"a70f34c07bd6616df1a739e849c159f8cb144e6848808da94983cfdd80717264"},{"version":"b359bda98a583c52c22ec8d3f2f3a7be26fc3df601f9c655286a7203a6a6cd87","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"24265aed586bbedf558d98048c3988260266e11c45cb579a73e2c5dae4813207","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"89b712b3515bffd0c615b344d0934582f6958dbfba5e5d12fef599819953d996","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"8e87715118f25403983a9b577dbe5b0fe8b754de0ec013860c25c2cb62c93cb8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"7a8c93220e8ebf8fd54353d566e140b3679f527627c8a1317fce12ee660d3fb8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","b8442e9db28157344d1bc5d8a5a256f1692de213f0c0ddeb84359834015a008c","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","da2b6356b84a40111aaecb18304ea4e4fcb43d70efb1c13ca7d7a906445ee0d3","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","6f294731b495c65ecf46a5694f0082954b961cf05463bea823f8014098eaffa0","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","68a0d0c508e1b6d8d23a519a8a0a3303dc5baa4849ca049f21e5bad41945e3fc","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","b03afe4bec768ae333582915146f48b161e567a81b5ebc31c4d78af089770ac9","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","4f6a12044ee6f458db11964153830abbc499e73d065c51c329ec97407f4b13dd","13e834b958fe7e9010d2161497f98916974a0618be7a773281a253a948da8b0d","dae5c8e0ca15779492744cb4071c5b3c94c2121940fbaefb43ca9a045557a0c9","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a",{"version":"525b52b38b44420fb1758c0917e7b67cf379f7f9477d2ba7343f3d5f50a44258","affectsGlobalScope":true},"4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","dc5fa6012f710446a9ed04156d986bd81d9119c93ecb63d85c6a9d493264b5dc","5aac5efd20619b522faeeb0badf250834850c605ad8c5fb91c6502a54057f413","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[199,203,[230,232],235,[242,245],[248,250],255,256,258,259,261,272,[274,278],280,281,357,369,[393,397],[401,403],413,414,[416,419],[421,423],[425,434],[445,452]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[157],[68,69,157,165,168,180,181,283,285,286,287,294,297,298,299,300,302],[157,283,286],[157,283,301],[157,282],[157,283,285,286,289],[157,288,290],[157,288,289,296],[157,292],[157,286,288,290,291,293,294,295],[157,286],[74,75,157],[157,286,294],[68,72,157,220,283,285],[157,304,306,307],[157,273,304,305],[157,304,306,308],[157,309],[157,273,305,309,310,311],[68,73,74,75,157,166,273,304,305,306,309],[157,304],[74,157,216],[69,157],[157,171,314,317],[73,74,157,171,173,284,313,314,316],[74,157,173,313,314,315],[67,68,72,73,74,76,157,329,330],[73,74,157],[72,75,157,173,303,329,336],[157,348],[157,331,343,344,345,346,347],[72,157],[70,71,157],[127,130,156,157,164,453,454,455],[157,358],[157,457],[157,164],[127,157,164],[157,476],[157,464,466,467,468,469,470,471,472,473,474,475,476],[157,464,465,467,468,469,470,471,472,473,474,475,476],[157,465,466,467,468,469,470,471,472,473,474,475,476],[157,464,465,466,468,469,470,471,472,473,474,475,476],[157,464,465,466,467,469,470,471,472,473,474,475,476],[157,464,465,466,467,468,470,471,472,473,474,475,476],[157,464,465,466,467,468,469,471,472,473,474,475,476],[157,464,465,466,467,468,469,470,472,473,474,475,476],[157,464,465,466,467,468,469,470,471,473,474,475,476],[157,464,465,466,467,468,469,470,471,472,474,475,476],[157,464,465,466,467,468,469,470,471,472,473,475,476],[157,464,465,466,467,468,469,470,471,472,473,474,476],[157,464,465,466,467,468,469,470,471,472,473,474,475],[157,498],[157,483],[157,487,488,489],[157,486],[157,488],[157,463,484,485,490,493,495,496,497],[157,485,491,492,498],[157,491,494],[157,485,486,491,498],[157,485,498],[157,500],[157,479,480,481,482],[121,127,157,164,441],[78,157],[114,157],[115,120,148,157],[116,127,128,135,145,156,157],[116,117,127,135,157],[118,157],[119,120,128,136,157],[120,145,153,157],[121,123,127,135,157],[122,157],[123,124,157],[127,157],[125,127,157],[114,127,157],[127,128,129,145,156,157],[127,128,129,142,145,148,157],[112,157,161],[123,127,130,135,145,156,157],[127,128,130,131,135,145,153,156,157],[130,132,145,153,156,157],[78,79,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163],[127,133,157],[134,156,157,161],[123,127,135,145,157],[136,157],[137,157],[114,138,157],[139,155,157,161],[140,157],[141,157],[127,142,143,157],[142,144,157,159],[115,127,145,146,147,148,157],[115,145,147,157],[145,146,157],[148,157],[149,157],[114,145,157],[127,151,152,157],[151,152,157],[120,135,145,153,157],[154,157],[135,155,157],[115,130,141,156,157],[120,157],[145,157,158],[134,157,159],[157,160],[115,120,127,129,138,145,156,157,159,161],[145,157,162],[130,145,157,164],[157,508,547],[157,508,532,547],[157,547],[157,508],[157,508,533,547],[157,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546],[157,533,547],[157,358,367],[157,366],[127,130,132,145,153,156,157,162,164],[157,553],[127,145,157,164],[157,358,359,360,361,362,363],[157,358,359],[157,197,198],[157,198,226,227,404,405,406,407,408,409,410],[157,197,198,226,411],[157,196,197,198,226],[157,197,198,226],[157,198,406],[157,198,411],[115,116,145,157],[157,196,197],[157,195],[73,74,157,263,267],[73,74,157,265,267],[73,74,157,267],[74,157,264,266],[73,157],[73,74,157,268],[157,372,373,375],[73,157,372,373,374],[73,157,372],[157,372],[63,157],[157,189,190,191,192],[66,67,157],[66,157],[64,157],[157,183],[65,157],[65,157,185],[67,157,184,185,186,187,188],[63,64,65,66,157,183],[63,64,65,157],[157,378],[157,236,237,238,239],[157,237],[157,237,238],[157,380],[157,216],[157,209],[157,209,216],[74,157,209],[157,209,210,211,212,213,214,215],[157,367],[157,194],[157,189,193],[89,93,156,157],[89,145,156,157],[84,157],[86,89,153,156,157],[135,153,157],[84,157,164],[86,89,135,156,157],[81,82,85,88,115,127,145,156,157],[81,87,157],[85,89,115,148,156,157,164],[115,157,164],[105,115,157,164],[83,84,157,164],[89,157],[83,84,85,86,87,88,89,90,91,93,94,95,96,97,98,99,100,101,102,103,104,106,107,108,109,110,111,157],[89,96,97,157],[87,89,97,98,157],[88,157],[81,84,89,157],[89,93,97,98,157],[93,157],[87,89,92,156,157],[81,86,87,89,93,96,157],[115,145,157],[84,89,105,115,157,161,164],[157,173,273],[157,221,436,437,438,439],[157,205],[157,189],[157,206],[157,204,207,208,217,218,219,220],[75,157,398],[157,174],[68,72,157,165,173,180,181,285],[68,73,74,75,157,171,173,181],[157,382,383,384,385,386,387,388,389,390],[157,166],[68,72,73,74,75,157],[75,157,171,284,315],[68,75,157,170,181],[157,165,172,173,181],[68,72,75,157,173,179],[75,157,170],[72,75,157,172],[68,73,74,75,157],[68,72,75,157],[68,72,73,74,157,173],[67,76,157,173],[62,68,72,75,76,77,157,165,166,167,168,169,170,172],[75,157],[76,157,165],[65,67,157],[68,72,157],[68,76,157,173],[68,74,75,157,165,284],[73,74,75,157,173],[68,75,157],[72,75,157,165,171,173],[67,68,76,157,165,166,168,173,175,180,181,198,332,333,335],[62,68,157,173,189,198],[74,157,334],[68,72,157,165,168,173,182,223,230],[61,62,68,69,75,77,157,165,166,167,168,172,173,174,175,180,181,182,198],[61,72,157,172,173,200,201,202,203,277],[72,157,174,279],[62,157,165,168,173,179,180,195,241,243],[72,157,165,168,173,179,180,243],[157,242],[61,68,72,75,157,165,166,168,173,174,179,182,200,201,203,229,235,240,243,246,247,248],[61,62,68,72,75,157,165,166,168,173,174,179,180,182,200,201,203,233,234,235,243,244,245,249],[72,157,165,173,246],[61,68,72,75,157,165,173],[61,62,67,76,77,157,168,173,203,251,252,255],[61,73,76,157,168,253,254],[61,68,72,157,203,223],[68,75,77,157,166,167,171,172,173,174,198,199,222,225,231,250,261,273,276],[61,68,69,72,75,76,77,157,165,166,167,168,170,173,179,181,199,203,221,222,223,224,225,227,228,229,231,232,250,256,258,259,261,274,275,277,278],[61,68,69,76,157,167,168,173,203,251,252,253,255,257],[61,68,69,157,165,168,170,173,180,181,202,203],[61,62,72,75,157,165,166,172,173,175,182,203,260],[61,68,75,157,165,166,168,171,172,173,174,180,181,203,223,243,259,271,272,273],[68,69,72,157,165,168,173,182,224,231,364,365,367,368],[72,157,173,276,364,367,370,371,377,379,394,396],[157,354,377,395],[68,69,72,75,157,165,168,173,179,180,199,224,225,229,243,244,364,365,367,368,411,412,413],[68,69,72,75,157,168,172,173,174,182,224,247,249,364,365,367,368,391,415],[61,62,68,69,72,75,128,136,137,157,165,182,199,203,223,224,225,227,229,231,249,250,252,261,276,284,318,352,354,364,365,367,368,370,391,412,417],[61,68,69,72,75,157,165,173,182,199,200,203,223,224,225,227,243,247,250,261,277,318,342,352,364,365,367,368,370,377,379,391,392,394],[62,68,157,165,168,174,182,199,203,250,252,276,277,364,365,367,368,391,393,394,412,417,420],[68,69,72,75,157,165,168,173,174,182,224,233,250,276,364,367,368,379,391,393,394,412],[68,72,157,172,203,223,224,247,276,318,328,352,364,367,370,377,391,392],[69,72,75,157,224,272,399,400,401],[73,74,157,247,254],[69,72,157,224,272,364,367],[67,72,76,77,157,223,247,277,336,364,367,368,394,395,420,424,425],[68,72,157,173,229,277,318,336,352,354,364,370,394,412,427],[157,277,336,395],[72,157,276,370,377,394],[68,157,277,370,377,394],[157,173,277,364,370,377,379],[157,173,276,336,364,367,370,377,394],[68,157,276,354,364,370,394],[157,277,364,370,377],[157,173,202,277,328,352,370,377,391,392],[157,173,202,277,318,328,352,354,370,377,392],[68,72,157,173,224,231,276,277,381,393],[62,157,181,252],[68,157,367],[68,69,72,77,128,157,167,173,221,222,223,247,277,303,312,318,328,331,336,337,341,342,348,352,354,355,356],[68,72,157,165,173,195,222,247,277,336,364,367,394,395,435,440,444],[62,68,157,222,276,364,367,368,393,394],[68,72,76,157,167,173,224,247,276,336,364,365,367,368,394,395,420,424,447],[68,69,157,165,168,170,173,174,180,181,182,199,224,225,227,247,250,259,276,318,352,364,368,370,377,391,394,413],[62,68,69,72,157,165,172,199,224,225,227,231,261,354,364,367,379,391,412],[62,68,69,72,157,165,172,173,199,203,224,231,261,277,364,367,370,377,391,392],[68,72,74,75,157,165,171,172,173,199,203,224,225,229,247,252,259,273,274,277,318,328,352,364,365,367,368,370,377,379,391,392,411,420,424],[68,157],[73,157,271],[157,173,262,268,269,270],[73,157,173,271],[157,176,177,178],[157,168,173,222],[157,222,443],[62,157,165,173,175,222,442],[68,157,220],[63,65,67,68,157],[68,72,157,165,168,173,198],[68,75,157,165,168,173,175,180,181],[68,74,157,285,338,339,340],[68,74,75,157,165,173,179,181,240,285],[157,171,351],[74,157],[73,74,75,157,171,173,349,350,352],[74,157,173,315,349],[72,157,165,179,319,323,326,327],[62,77,157,165,173],[68,75,157,168,173,174,175,180,181,319,320,321,322,328],[62,68,72,157,173,179,319,328],[62,68,77,157,165,168,173,180,181,182],[68,77,157,165,168,172,173,174,175,180,181,324,325],[62,68,157,165,168,173,180,182,319],[72,157,166,172,173,353],[72,75,157,165,166,172,173,354],[130,157,164,172,173,372,376],[69,73,74,75,157,173],[157,168],[68,157,240],[157,273,304,556],[157,273,309,310,311,556],[68,72,165,168,173,182],[62,68,75,77,165,166,167,168,172,173,174,175,180,181,182,198],[173,277],[174],[62,165,168,173,180],[72,165,168,173,180],[242],[68,72,75,166,168,173,174,179,182,240],[62,68,72,75,165,166,168,173,174,179,180,182,244,245,249],[72,173,246],[68,72,75,173],[62,67,76,77,168,173],[73,76,168],[68,72],[68,75,77,166,167,171,172,173,174,198,199,222,225,231,250,261,273],[68,72,75,77,165,166,167,168,170,173,181,199,277],[68,69,76,167,168,173],[68,69,165,168,170,173,180,181],[62,72,75,165,166,172,173,175,182],[68,75,165,166,168,171,172,173,174,180,181,273],[277],[73,74],[277,336],[68,173,276,277],[181],[68,367]],"referencedMap":[[299,1],[303,2],[287,3],[302,4],[283,5],[294,6],[291,7],[297,8],[293,9],[288,1],[289,1],[296,10],[290,11],[300,12],[298,13],[286,14],[295,1],[304,1],[308,15],[306,16],[309,17],[311,18],[312,19],[310,20],[307,21],[305,22],[313,23],[314,1],[318,24],[317,25],[316,26],[331,27],[329,22],[330,28],[337,29],[343,30],[344,30],[348,31],[345,30],[346,30],[347,30],[415,32],[71,32],[72,33],[70,32],[201,32],[456,34],[359,35],[363,35],[361,35],[358,1],[458,36],[441,37],[454,1],[459,1],[460,1],[461,1],[462,38],[463,1],[477,39],[478,39],[465,40],[466,41],[464,42],[467,43],[468,44],[469,45],[470,46],[471,47],[472,48],[473,49],[474,50],[475,51],[476,52],[499,53],[484,54],[490,55],[488,1],[487,56],[489,57],[498,58],[493,59],[495,60],[496,61],[497,62],[491,1],[492,62],[494,62],[486,62],[485,1],[501,63],[480,1],[479,1],[482,54],[483,64],[481,54],[502,1],[503,1],[504,1],[457,1],[442,65],[78,66],[79,66],[114,67],[115,68],[116,69],[117,70],[118,71],[119,72],[120,73],[121,74],[122,75],[123,76],[124,76],[126,77],[125,78],[127,79],[128,80],[129,81],[113,82],[163,1],[130,83],[131,84],[132,85],[164,86],[133,87],[134,88],[135,89],[136,90],[137,91],[138,92],[139,93],[140,94],[141,95],[142,96],[143,96],[144,97],[145,98],[147,99],[146,100],[148,101],[149,102],[150,103],[151,104],[152,105],[153,106],[154,107],[155,108],[156,109],[157,110],[158,111],[159,112],[160,113],[161,114],[162,115],[505,1],[506,1],[455,116],[507,1],[532,117],[533,118],[508,119],[511,119],[530,117],[531,117],[521,117],[520,120],[518,117],[513,117],[526,117],[524,117],[528,117],[512,117],[525,117],[529,117],[514,117],[515,117],[527,117],[509,117],[516,117],[517,117],[519,117],[523,117],[534,121],[522,117],[510,117],[547,122],[546,1],[541,121],[543,123],[542,121],[535,121],[536,121],[538,121],[540,121],[544,123],[545,123],[537,123],[539,123],[548,124],[367,125],[366,1],[549,1],[550,1],[500,1],[551,1],[372,126],[552,37],[553,1],[554,127],[555,128],[364,129],[246,1],[80,1],[362,35],[360,130],[226,131],[404,1],[411,132],[406,133],[227,134],[408,135],[410,136],[405,137],[407,133],[409,135],[365,1],[292,1],[236,1],[355,138],[356,1],[198,139],[196,140],[197,1],[420,1],[263,28],[424,1],[253,1],[257,1],[268,141],[266,142],[264,143],[267,144],[254,1],[251,1],[252,145],[320,146],[284,1],[265,28],[73,1],[376,147],[375,148],[373,149],[374,150],[453,77],[202,1],[192,151],[63,1],[193,152],[64,153],[188,1],[67,154],[183,155],[191,156],[190,156],[185,157],[186,158],[65,1],[189,159],[184,160],[66,161],[187,1],[247,1],[379,162],[240,163],[238,164],[239,165],[237,1],[378,1],[381,166],[380,1],[412,162],[279,1],[333,1],[282,1],[301,5],[209,167],[212,168],[213,169],[210,170],[211,168],[216,171],[214,22],[215,167],[234,1],[368,172],[59,1],[60,1],[10,1],[11,1],[14,1],[13,1],[2,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[3,1],[4,1],[23,1],[27,1],[24,1],[25,1],[26,1],[28,1],[29,1],[30,1],[5,1],[31,1],[32,1],[33,1],[34,1],[6,1],[38,1],[35,1],[36,1],[37,1],[39,1],[7,1],[40,1],[45,1],[46,1],[41,1],[42,1],[43,1],[44,1],[8,1],[50,1],[47,1],[48,1],[49,1],[51,1],[9,1],[52,1],[53,1],[54,1],[57,1],[55,1],[56,1],[1,1],[58,1],[12,1],[74,1],[228,1],[229,173],[195,173],[194,174],[96,175],[103,176],[95,175],[110,177],[87,178],[86,179],[109,37],[104,180],[107,181],[89,182],[88,183],[84,184],[83,185],[106,186],[85,187],[90,188],[91,1],[94,188],[81,1],[112,189],[111,188],[98,190],[99,191],[101,192],[97,193],[100,194],[105,37],[92,195],[93,196],[102,197],[82,198],[108,199],[370,200],[436,1],[437,1],[440,201],[206,202],[204,203],[207,204],[221,205],[205,1],[208,202],[217,22],[218,203],[219,203],[438,1],[439,1],[399,206],[398,1],[382,207],[383,208],[384,209],[389,28],[391,210],[390,211],[385,212],[386,213],[387,214],[388,215],[400,1],[175,32],[180,216],[181,217],[182,218],[273,219],[174,220],[75,221],[77,222],[61,1],[165,38],[173,223],[220,1],[166,224],[260,211],[222,225],[68,226],[76,227],[167,228],[168,227],[233,1],[285,229],[62,1],[169,224],[171,230],[170,231],[172,232],[336,233],[332,234],[335,235],[334,22],[231,236],[230,1],[199,237],[278,238],[280,239],[232,207],[244,240],[245,241],[281,242],[242,1],[243,242],[249,243],[250,244],[248,245],[272,246],[256,247],[255,248],[203,1],[235,249],[277,250],[276,251],[258,252],[259,253],[261,254],[274,255],[275,1],[369,256],[397,257],[396,258],[414,259],[416,260],[418,261],[419,262],[421,263],[422,264],[423,265],[402,266],[401,267],[403,268],[426,269],[428,270],[427,1],[425,271],[429,272],[430,273],[431,274],[432,275],[433,276],[434,277],[393,278],[395,279],[394,280],[417,281],[413,282],[357,283],[445,284],[446,285],[448,286],[447,271],[449,287],[450,288],[451,289],[452,290],[69,291],[262,1],[270,292],[271,293],[269,294],[179,295],[178,291],[176,291],[177,291],[435,296],[444,297],[443,298],[224,299],[223,300],[225,301],[342,302],[339,1],[340,1],[341,303],[338,304],[352,305],[349,306],[351,307],[350,308],[327,1],[328,309],[319,22],[321,310],[323,311],[322,312],[324,313],[326,314],[325,315],[354,316],[353,317],[392,32],[377,318],[315,319],[200,320],[371,32],[241,321]],"exportedModulesMap":[[299,1],[303,2],[287,3],[302,4],[283,5],[294,6],[291,7],[297,8],[293,9],[288,1],[289,1],[296,10],[290,11],[300,12],[298,13],[286,14],[295,1],[304,1],[308,15],[306,322],[309,17],[311,18],[312,323],[310,20],[307,21],[305,22],[313,23],[314,1],[318,24],[317,25],[316,26],[331,27],[329,22],[330,28],[337,29],[343,30],[344,30],[348,31],[345,30],[346,30],[347,30],[415,32],[71,32],[72,33],[70,32],[201,32],[456,34],[359,35],[363,35],[361,35],[358,1],[458,36],[441,37],[454,1],[459,1],[460,1],[461,1],[462,38],[463,1],[477,39],[478,39],[465,40],[466,41],[464,42],[467,43],[468,44],[469,45],[470,46],[471,47],[472,48],[473,49],[474,50],[475,51],[476,52],[499,53],[484,54],[490,55],[488,1],[487,56],[489,57],[498,58],[493,59],[495,60],[496,61],[497,62],[491,1],[492,62],[494,62],[486,62],[485,1],[501,63],[480,1],[479,1],[482,54],[483,64],[481,54],[502,1],[503,1],[504,1],[457,1],[442,65],[78,66],[79,66],[114,67],[115,68],[116,69],[117,70],[118,71],[119,72],[120,73],[121,74],[122,75],[123,76],[124,76],[126,77],[125,78],[127,79],[128,80],[129,81],[113,82],[163,1],[130,83],[131,84],[132,85],[164,86],[133,87],[134,88],[135,89],[136,90],[137,91],[138,92],[139,93],[140,94],[141,95],[142,96],[143,96],[144,97],[145,98],[147,99],[146,100],[148,101],[149,102],[150,103],[151,104],[152,105],[153,106],[154,107],[155,108],[156,109],[157,110],[158,111],[159,112],[160,113],[161,114],[162,115],[505,1],[506,1],[455,116],[507,1],[532,117],[533,118],[508,119],[511,119],[530,117],[531,117],[521,117],[520,120],[518,117],[513,117],[526,117],[524,117],[528,117],[512,117],[525,117],[529,117],[514,117],[515,117],[527,117],[509,117],[516,117],[517,117],[519,117],[523,117],[534,121],[522,117],[510,117],[547,122],[546,1],[541,121],[543,123],[542,121],[535,121],[536,121],[538,121],[540,121],[544,123],[545,123],[537,123],[539,123],[548,124],[367,125],[366,1],[549,1],[550,1],[500,1],[551,1],[372,126],[552,37],[553,1],[554,127],[555,128],[364,129],[246,1],[80,1],[362,35],[360,130],[226,131],[404,1],[411,132],[406,133],[227,134],[408,135],[410,136],[405,137],[407,133],[409,135],[365,1],[292,1],[236,1],[355,138],[356,1],[198,139],[196,140],[197,1],[420,1],[263,28],[424,1],[253,1],[257,1],[268,141],[266,142],[264,143],[267,144],[254,1],[251,1],[252,145],[320,146],[284,1],[265,28],[73,1],[376,147],[375,148],[373,149],[374,150],[453,77],[202,1],[192,151],[63,1],[193,152],[64,153],[188,1],[67,154],[183,155],[191,156],[190,156],[185,157],[186,158],[65,1],[189,159],[184,160],[66,161],[187,1],[247,1],[379,162],[240,163],[238,164],[239,165],[237,1],[378,1],[381,166],[380,1],[412,162],[279,1],[333,1],[282,1],[301,5],[209,167],[212,168],[213,169],[210,170],[211,168],[216,171],[214,22],[215,167],[234,1],[368,172],[59,1],[60,1],[10,1],[11,1],[14,1],[13,1],[2,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[3,1],[4,1],[23,1],[27,1],[24,1],[25,1],[26,1],[28,1],[29,1],[30,1],[5,1],[31,1],[32,1],[33,1],[34,1],[6,1],[38,1],[35,1],[36,1],[37,1],[39,1],[7,1],[40,1],[45,1],[46,1],[41,1],[42,1],[43,1],[44,1],[8,1],[50,1],[47,1],[48,1],[49,1],[51,1],[9,1],[52,1],[53,1],[54,1],[57,1],[55,1],[56,1],[1,1],[58,1],[12,1],[74,1],[228,1],[229,173],[195,173],[194,174],[96,175],[103,176],[95,175],[110,177],[87,178],[86,179],[109,37],[104,180],[107,181],[89,182],[88,183],[84,184],[83,185],[106,186],[85,187],[90,188],[91,1],[94,188],[81,1],[112,189],[111,188],[98,190],[99,191],[101,192],[97,193],[100,194],[105,37],[92,195],[93,196],[102,197],[82,198],[108,199],[370,200],[436,1],[437,1],[440,201],[206,202],[204,203],[207,204],[221,205],[205,1],[208,202],[217,22],[218,203],[219,203],[438,1],[439,1],[399,206],[398,1],[382,207],[383,208],[384,209],[389,28],[391,210],[390,211],[385,212],[386,213],[387,214],[388,215],[400,1],[175,32],[180,216],[181,217],[182,218],[273,219],[174,220],[75,221],[77,222],[61,1],[165,38],[173,223],[220,1],[166,224],[260,211],[222,225],[68,226],[76,227],[167,228],[168,227],[233,1],[285,229],[62,1],[169,224],[171,230],[170,231],[172,232],[336,233],[332,234],[335,235],[334,22],[231,324],[199,325],[278,326],[280,327],[232,327],[244,328],[245,329],[281,330],[243,330],[249,331],[250,332],[248,333],[272,334],[256,335],[255,336],[235,337],[277,338],[276,339],[258,340],[259,341],[261,342],[274,343],[396,344],[401,345],[425,346],[393,326],[395,326],[394,347],[417,348],[413,349],[447,346],[69,291],[262,1],[270,292],[271,293],[269,294],[179,295],[178,291],[176,291],[177,291],[435,296],[444,297],[443,298],[224,299],[223,300],[225,301],[342,302],[339,1],[340,1],[341,303],[338,304],[352,305],[349,306],[351,307],[350,308],[327,1],[328,309],[319,22],[321,310],[323,311],[322,312],[324,313],[326,314],[325,315],[354,316],[353,317],[392,32],[377,318],[315,319],[200,320],[371,32],[241,321]],"semanticDiagnosticsPerFile":[299,303,287,302,283,294,291,297,293,288,289,296,290,300,298,286,295,304,308,306,309,311,312,310,307,305,313,314,318,317,316,331,329,330,337,343,344,348,345,346,347,415,71,72,70,201,456,359,363,361,358,458,441,454,459,460,461,462,463,477,478,465,466,464,467,468,469,470,471,472,473,474,475,476,499,484,490,488,487,489,498,493,495,496,497,491,492,494,486,485,501,480,479,482,483,481,502,503,504,457,442,78,79,114,115,116,117,118,119,120,121,122,123,124,126,125,127,128,129,113,163,130,131,132,164,133,134,135,136,137,138,139,140,141,142,143,144,145,147,146,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,505,506,455,507,532,533,508,511,530,531,521,520,518,513,526,524,528,512,525,529,514,515,527,509,516,517,519,523,534,522,510,547,546,541,543,542,535,536,538,540,544,545,537,539,548,367,366,549,550,500,551,372,552,553,554,555,364,246,80,362,360,226,404,411,406,227,408,410,405,407,409,365,292,236,355,356,198,196,197,420,263,424,253,257,268,266,264,267,254,251,252,320,284,265,73,376,375,373,374,453,202,192,63,193,64,188,67,183,191,190,185,186,65,189,184,66,187,247,379,240,238,239,237,378,381,380,412,279,333,282,301,209,212,213,210,211,216,214,215,234,368,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,74,228,229,195,194,96,103,95,110,87,86,109,104,107,89,88,84,83,106,85,90,91,94,81,112,111,98,99,101,97,100,105,92,93,102,82,108,370,436,437,440,206,204,207,221,205,208,217,218,219,438,439,399,398,382,383,384,389,391,390,385,386,387,388,400,175,180,181,182,273,174,75,77,61,165,173,220,166,260,222,68,76,167,168,233,285,62,169,171,170,172,336,332,335,334,231,230,199,278,280,232,244,245,281,242,243,249,250,248,272,256,255,203,235,277,276,258,259,261,274,275,369,397,396,414,416,418,419,421,422,423,402,401,403,426,428,427,425,429,430,431,432,433,434,393,395,394,417,413,357,445,446,448,447,449,450,451,452,69,262,270,271,269,179,178,176,177,435,444,443,224,223,225,342,339,340,341,338,352,349,351,350,327,328,319,321,323,322,324,326,325,354,353,392,377,315,200,371,241],"latestChangedDtsFile":"./src/upgrader.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/package.json deleted file mode 100644 index 3e8023769..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/package.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "name": "libp2p", - "version": "0.46.21", - "description": "JavaScript implementation of libp2p, a modular peer to peer network stack", - "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/libp2p#readme", - "repository": { - "type": "git", - "url": "git+https://github.com/libp2p/js-libp2p.git" - }, - "bugs": { - "url": "https://github.com/libp2p/js-libp2p/issues" - }, - "keywords": [ - "IPFS", - "libp2p", - "network", - "p2p", - "peer", - "peer-to-peer" - ], - "type": "module", - "types": "./dist/src/index.d.ts", - "files": [ - "src", - "dist", - "!dist/test", - "!**/*.tsbuildinfo" - ], - "exports": { - ".": { - "types": "./dist/src/index.d.ts", - "import": "./dist/src/index.js" - } - }, - "eslintConfig": { - "extends": "ipfs", - "parserOptions": { - "project": true, - "sourceType": "module" - }, - "ignorePatterns": [ - "!.aegir.js", - "test/ts-use", - "*.d.ts" - ] - }, - "scripts": { - "clean": "aegir clean", - "lint": "aegir lint", - "dep-check": "aegir dep-check", - "prepublishOnly": "node scripts/update-version.js && npm run build", - "build": "aegir build", - "test": "aegir test", - "test:node": "aegir test -t node -f \"./dist/test/**/*.{node,spec}.js\" --cov", - "test:chrome": "aegir test -t browser -f \"./dist/test/**/*.spec.js\" --cov", - "test:chrome-webworker": "aegir test -t webworker -f \"./dist/test/**/*.spec.js\"", - "test:firefox": "aegir test -t browser -f \"./dist/test/**/*.spec.js\" -- --browser firefox", - "test:firefox-webworker": "aegir test -t webworker -f \"./dist/test/**/*.spec.js\" -- --browser firefox", - "test:webkit": "aegir test -t browser -f \"./dist/test/**/*.spec.js\" -- --browser webkit", - "test:interop": "aegir test -t node -f dist/test/interop.js" - }, - "dependencies": { - "@libp2p/crypto": "^2.0.8", - "@libp2p/interface": "^0.1.6", - "@libp2p/interface-internal": "^0.1.9", - "@libp2p/logger": "^3.1.0", - "@libp2p/multistream-select": "^4.0.6", - "@libp2p/peer-collections": "^4.0.8", - "@libp2p/peer-id": "^3.0.6", - "@libp2p/peer-id-factory": "^3.0.8", - "@libp2p/peer-store": "^9.0.9", - "@libp2p/utils": "^4.0.7", - "@multiformats/mafmt": "^12.1.6", - "@multiformats/multiaddr": "^12.1.10", - "@multiformats/multiaddr-matcher": "^1.1.0", - "any-signal": "^4.1.1", - "datastore-core": "^9.0.1", - "delay": "^6.0.0", - "interface-datastore": "^8.2.0", - "it-all": "^3.0.2", - "it-drain": "^3.0.2", - "it-filter": "^3.0.1", - "it-first": "^3.0.3", - "it-map": "^3.0.4", - "it-merge": "^3.0.0", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "merge-options": "^3.0.4", - "multiformats": "^12.1.3", - "p-defer": "^4.0.0", - "p-queue": "^7.4.1", - "private-ip": "^3.0.1", - "rate-limiter-flexible": "^3.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - }, - "devDependencies": { - "@chainsafe/libp2p-gossipsub": "^10.0.0", - "@chainsafe/libp2p-noise": "^13.0.2", - "@chainsafe/libp2p-yamux": "^5.0.0", - "@libp2p/bootstrap": "^9.0.12", - "@libp2p/circuit-relay-v2": "^0.0.0", - "@libp2p/daemon-client": "^7.0.0", - "@libp2p/daemon-server": "^6.0.0", - "@libp2p/floodsub": "^8.0.13", - "@libp2p/identify": "^0.0.0", - "@libp2p/interface-compliance-tests": "^4.1.5", - "@libp2p/interop": "^9.0.0", - "@libp2p/kad-dht": "^10.0.15", - "@libp2p/mdns": "^9.0.14", - "@libp2p/mplex": "^9.0.12", - "@libp2p/plaintext": "^0.0.0", - "@libp2p/tcp": "^8.0.13", - "@libp2p/websockets": "^7.0.13", - "aegir": "^41.0.2", - "execa": "^8.0.1", - "go-libp2p": "^1.1.1", - "it-pushable": "^3.2.1", - "p-event": "^6.0.0", - "p-times": "^4.0.0", - "p-wait-for": "^5.0.2", - "sinon": "^17.0.0", - "sinon-ts": "^2.0.0" - }, - "browser": { - "./dist/src/connection-manager/constants.js": "./dist/src/connection-manager/constants.browser.js", - "./dist/src/config/connection-gater.js": "./dist/src/config/connection-gater.browser.js" - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/address-manager/README.md b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/address-manager/README.md deleted file mode 100644 index ae181eba9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/address-manager/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Address Manager - -The Address manager is responsible for keeping an updated register of the peer's addresses. It includes 2 different types of Addresses: `Listen Addresses` and `Announce Addresses`. - -These Addresses should be specified in your libp2p [configuration](../../../../doc/CONFIGURATION.md) when you create your node. - -## Listen Addresses - -A libp2p node should have a set of listen addresses, which will be used by libp2p underlying transports to listen for dials from other nodes in the network. - -Before a libp2p node starts, its configured listen addresses will be passed to the AddressManager, so that during startup the libp2p transports can use them to listen for connections. Accordingly, listen addresses should be specified through the libp2p configuration, in order to have the `AddressManager` created with them. - -It is important pointing out that libp2p accepts ephemeral listening addresses. In this context, the provided listen addresses might not be exactly the same as the ones used by the transports. For example TCP may replace `/ip4/0.0.0.0/tcp/0` with something like `/ip4/127.0.0.1/tcp/8989`. As a consequence, libp2p should take into account this when determining its advertised addresses. - -## Announce Addresses - -In some scenarios, a libp2p node will need to announce addresses that it is not listening on. In other words, Announce Addresses are an amendment to the Listen Addresses that aim to enable other nodes to achieve connectivity to this node. - -Scenarios for Announce Addresses include: -- when you setup a libp2p node in your private network at home, but you need to announce your public IP Address to the outside world; -- when you want to announce a DNS address, which maps to your public IP Address. - -## Implementation - -When a libp2p node is created, the Address Manager will be populated from the provided addresses through the libp2p configuration. Once the node is started, the Transport Manager component will gather the listen addresses from the Address Manager, so that the libp2p transports can attempt to bind to them. - -Libp2p will use the the Address Manager as the source of truth when advertising the peers addresses. After all transports are ready, other libp2p components/subsystems will kickoff, namely the Identify Service and the DHT. Both of them will announce the node addresses to the other peers in the network. The announce addresses will have an important role here and will be gathered by libp2p to compute its current addresses to advertise everytime it is needed. - -## Future Considerations - -### Dynamic address modifications - -In a future iteration, we can enable these addresses to be modified in runtime. For this, the Address Manager should be responsible for notifying interested subsystems of these changes, through an Event Emitter. - -#### Modify Listen Addresses - -While adding new addresses to listen on runtime should be trivial, removing a listen address might have bad implications for the node, since all the connections using that listen address will be closed. However, libp2p should provide a mechanism for both adding and removing listen addresses in the future. - -Every time a new listen address is added, the Address Manager should emit an event with the new multiaddrs to listen. The Transport Manager should listen to this events and act accordingly. - -#### Modify Announce Addresses - -When the announce addresses are modified, the Address Manager should emit an event so that other subsystems can act accordingly. For example, libp2p identify service should use the libp2p push protocol to inform other peers about these changes. diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/address-manager/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/address-manager/index.ts deleted file mode 100644 index 1ff557a6a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/address-manager/index.ts +++ /dev/null @@ -1,237 +0,0 @@ -import { peerIdFromString } from '@libp2p/peer-id' -import { multiaddr } from '@multiformats/multiaddr' -import { debounce } from './utils.js' -import type { ComponentLogger, Libp2pEvents, Logger } from '@libp2p/interface' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { TransportManager } from '@libp2p/interface-internal/transport-manager' -import type { Multiaddr } from '@multiformats/multiaddr' - -export interface AddressManagerInit { - /** - * Pass an function in this field to override the list of addresses - * that are announced to the network - */ - announceFilter?: AddressFilter - - /** - * list of multiaddrs string representation to listen - */ - listen?: string[] - - /** - * list of multiaddrs string representation to announce - */ - announce?: string[] - - /** - * list of multiaddrs string representation to never announce - */ - noAnnounce?: string[] -} - -export interface DefaultAddressManagerComponents { - peerId: PeerId - transportManager: TransportManager - peerStore: PeerStore - events: TypedEventTarget - logger: ComponentLogger -} - -/** - * A function that takes a list of multiaddrs and returns a list - * to announce - */ -export interface AddressFilter { - (addrs: Multiaddr[]): Multiaddr[] -} - -const defaultAddressFilter = (addrs: Multiaddr[]): Multiaddr[] => addrs - -interface ObservedAddressMetadata { - confident: boolean -} - -/** - * If the passed multiaddr contains the passed peer id, remove it - */ -function stripPeerId (ma: Multiaddr, peerId: PeerId): Multiaddr { - const observedPeerIdStr = ma.getPeerId() - - // strip our peer id if it has been passed - if (observedPeerIdStr != null) { - const observedPeerId = peerIdFromString(observedPeerIdStr) - - // use same encoding for comparison - if (observedPeerId.equals(peerId)) { - ma = ma.decapsulate(multiaddr(`/p2p/${peerId.toString()}`)) - } - } - - return ma -} - -export class DefaultAddressManager { - private readonly log: Logger - private readonly components: DefaultAddressManagerComponents - // this is an array to allow for duplicates, e.g. multiples of `/ip4/0.0.0.0/tcp/0` - private readonly listen: string[] - private readonly announce: Set - private readonly observed: Map - private readonly announceFilter: AddressFilter - - /** - * Responsible for managing the peer addresses. - * Peers can specify their listen and announce addresses. - * The listen addresses will be used by the libp2p transports to listen for new connections, - * while the announce addresses will be used for the peer addresses' to other peers in the network. - */ - constructor (components: DefaultAddressManagerComponents, init: AddressManagerInit = {}) { - const { listen = [], announce = [] } = init - - this.components = components - this.log = components.logger.forComponent('libp2p:address-manager') - this.listen = listen.map(ma => ma.toString()) - this.announce = new Set(announce.map(ma => ma.toString())) - this.observed = new Map() - this.announceFilter = init.announceFilter ?? defaultAddressFilter - - // this method gets called repeatedly on startup when transports start listening so - // debounce it so we don't cause multiple self:peer:update events to be emitted - this._updatePeerStoreAddresses = debounce(this._updatePeerStoreAddresses.bind(this), 1000) - - // update our stored addresses when new transports listen - components.events.addEventListener('transport:listening', () => { - this._updatePeerStoreAddresses() - }) - // update our stored addresses when existing transports stop listening - components.events.addEventListener('transport:close', () => { - this._updatePeerStoreAddresses() - }) - } - - _updatePeerStoreAddresses (): void { - // if announce addresses have been configured, ensure they make it into our peer - // record for things like identify - const addrs = this.getAnnounceAddrs() - .concat(this.components.transportManager.getAddrs()) - .concat( - [...this.observed.entries()] - .filter(([_, metadata]) => metadata.confident) - .map(([str]) => multiaddr(str)) - ).map(ma => { - // strip our peer id if it is present - if (ma.getPeerId() === this.components.peerId.toString()) { - return ma.decapsulate(`/p2p/${this.components.peerId.toString()}`) - } - - return ma - }) - - this.components.peerStore.patch(this.components.peerId, { - multiaddrs: addrs - }) - .catch(err => { this.log.error('error updating addresses', err) }) - } - - /** - * Get peer listen multiaddrs - */ - getListenAddrs (): Multiaddr[] { - return Array.from(this.listen).map((a) => multiaddr(a)) - } - - /** - * Get peer announcing multiaddrs - */ - getAnnounceAddrs (): Multiaddr[] { - return Array.from(this.announce).map((a) => multiaddr(a)) - } - - /** - * Get observed multiaddrs - */ - getObservedAddrs (): Multiaddr[] { - return Array.from(this.observed).map(([a]) => multiaddr(a)) - } - - /** - * Add peer observed addresses - */ - addObservedAddr (addr: Multiaddr): void { - addr = stripPeerId(addr, this.components.peerId) - const addrString = addr.toString() - - // do not trigger the change:addresses event if we already know about this address - if (this.observed.has(addrString)) { - return - } - - this.observed.set(addrString, { - confident: false - }) - } - - confirmObservedAddr (addr: Multiaddr): void { - addr = stripPeerId(addr, this.components.peerId) - const addrString = addr.toString() - - const metadata = this.observed.get(addrString) ?? { - confident: false - } - - const startingConfidence = metadata.confident - - this.observed.set(addrString, { - confident: true - }) - - // only trigger the 'self:peer:update' event if our confidence in an address has changed - if (!startingConfidence) { - this._updatePeerStoreAddresses() - } - } - - removeObservedAddr (addr: Multiaddr): void { - addr = stripPeerId(addr, this.components.peerId) - const addrString = addr.toString() - - this.observed.delete(addrString) - } - - getAddresses (): Multiaddr[] { - let addrs = this.getAnnounceAddrs().map(ma => ma.toString()) - - if (addrs.length === 0) { - // no configured announce addrs, add configured listen addresses - addrs = this.components.transportManager.getAddrs().map(ma => ma.toString()) - } - - // add observed addresses we are confident in - addrs = addrs.concat( - Array.from(this.observed) - .filter(([ma, metadata]) => metadata.confident) - .map(([ma]) => ma) - ) - - // dedupe multiaddrs - const addrSet = new Set(addrs) - - // Create advertising list - return this.announceFilter(Array.from(addrSet) - .map(str => multiaddr(str))) - .map(ma => { - // do not append our peer id to a path multiaddr as it will become invalid - if (ma.protos().pop()?.path === true) { - return ma - } - - if (ma.getPeerId() === this.components.peerId.toString()) { - return ma - } - - return ma.encapsulate(`/p2p/${this.components.peerId.toString()}`) - }) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/address-manager/utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/address-manager/utils.ts deleted file mode 100644 index 7062446a8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/address-manager/utils.ts +++ /dev/null @@ -1,13 +0,0 @@ -export function debounce (func: () => void, wait: number): () => void { - let timeout: ReturnType | undefined - - return function () { - const later = function (): void { - timeout = undefined - func() - } - - clearTimeout(timeout) - timeout = setTimeout(later, wait) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/components.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/components.ts deleted file mode 100644 index f03169820..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/components.ts +++ /dev/null @@ -1,164 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { isStartable, type Startable } from '@libp2p/interface/startable' -import { defaultLogger } from '@libp2p/logger' -import type { Libp2pEvents, ComponentLogger, NodeInfo } from '@libp2p/interface' -import type { ConnectionProtector } from '@libp2p/interface/connection' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { ContentRouting } from '@libp2p/interface/content-routing' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerRouting } from '@libp2p/interface/peer-routing' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Upgrader } from '@libp2p/interface/transport' -import type { AddressManager } from '@libp2p/interface-internal/address-manager' -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager' -import type { Registrar } from '@libp2p/interface-internal/registrar' -import type { TransportManager } from '@libp2p/interface-internal/transport-manager' -import type { Datastore } from 'interface-datastore' - -export interface Components extends Record, Startable { - peerId: PeerId - nodeInfo: NodeInfo - logger: ComponentLogger - events: TypedEventTarget - addressManager: AddressManager - peerStore: PeerStore - upgrader: Upgrader - registrar: Registrar - connectionManager: ConnectionManager - transportManager: TransportManager - connectionGater: ConnectionGater - contentRouting: ContentRouting - peerRouting: PeerRouting - datastore: Datastore - connectionProtector?: ConnectionProtector - metrics?: Metrics -} - -export interface ComponentsInit { - peerId?: PeerId - nodeInfo?: NodeInfo - logger?: ComponentLogger - events?: TypedEventTarget - addressManager?: AddressManager - peerStore?: PeerStore - upgrader?: Upgrader - metrics?: Metrics - registrar?: Registrar - connectionManager?: ConnectionManager - transportManager?: TransportManager - connectionGater?: ConnectionGater - contentRouting?: ContentRouting - peerRouting?: PeerRouting - datastore?: Datastore - connectionProtector?: ConnectionProtector -} - -class DefaultComponents implements Startable { - public components: Record = {} - private _started = false - - constructor (init: ComponentsInit = {}) { - this.components = {} - - for (const [key, value] of Object.entries(init)) { - this.components[key] = value - } - - if (this.components.logger == null) { - this.components.logger = defaultLogger() - } - } - - isStarted (): boolean { - return this._started - } - - private async _invokeStartableMethod (methodName: 'beforeStart' | 'start' | 'afterStart' | 'beforeStop' | 'stop' | 'afterStop'): Promise { - await Promise.all( - Object.values(this.components) - .filter(obj => isStartable(obj)) - .map(async (startable: Startable) => { - await startable[methodName]?.() - }) - ) - } - - async beforeStart (): Promise { - await this._invokeStartableMethod('beforeStart') - } - - async start (): Promise { - await this._invokeStartableMethod('start') - this._started = true - } - - async afterStart (): Promise { - await this._invokeStartableMethod('afterStart') - } - - async beforeStop (): Promise { - await this._invokeStartableMethod('beforeStop') - } - - async stop (): Promise { - await this._invokeStartableMethod('stop') - this._started = false - } - - async afterStop (): Promise { - await this._invokeStartableMethod('afterStop') - } -} - -const OPTIONAL_SERVICES = [ - 'metrics', - 'connectionProtector' -] - -const NON_SERVICE_PROPERTIES = [ - 'components', - 'isStarted', - 'beforeStart', - 'start', - 'afterStart', - 'beforeStop', - 'stop', - 'afterStop', - 'then', - '_invokeStartableMethod' -] - -export function defaultComponents (init: ComponentsInit = {}): Components { - const components = new DefaultComponents(init) - - const proxy = new Proxy(components, { - get (target, prop, receiver) { - if (typeof prop === 'string' && !NON_SERVICE_PROPERTIES.includes(prop)) { - const service = components.components[prop] - - if (service == null && !OPTIONAL_SERVICES.includes(prop)) { - throw new CodeError(`${prop} not set`, 'ERR_SERVICE_MISSING') - } - - return service - } - - return Reflect.get(target, prop, receiver) - }, - - set (target, prop, value) { - if (typeof prop === 'string') { - components.components[prop] = value - } else { - Reflect.set(target, prop, value) - } - - return true - } - }) - - // @ts-expect-error component keys are proxied - return proxy -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/config.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/config.ts deleted file mode 100644 index a9b83fb53..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/config.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { FaultTolerance } from '@libp2p/interface/transport' -import { defaultAddressSort } from '@libp2p/utils/address-sort' -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers' -import mergeOptions from 'merge-options' -import { codes, messages } from './errors.js' -import type { Libp2pInit } from './index.js' -import type { ServiceMap, RecursivePartial } from '@libp2p/interface' -import type { Multiaddr } from '@multiformats/multiaddr' - -const DefaultConfig: Partial = { - addresses: { - listen: [], - announce: [], - noAnnounce: [], - announceFilter: (multiaddrs: Multiaddr[]) => multiaddrs - }, - connectionManager: { - resolvers: { - dnsaddr: dnsaddrResolver - }, - addressSorter: defaultAddressSort - }, - transportManager: { - faultTolerance: FaultTolerance.FATAL_ALL - } -} - -export function validateConfig > (opts: RecursivePartial>): Libp2pInit { - const resultingOptions: Libp2pInit = mergeOptions(DefaultConfig, opts) - - if (resultingOptions.transports == null || resultingOptions.transports.length < 1) { - throw new CodeError(messages.ERR_TRANSPORTS_REQUIRED, codes.ERR_TRANSPORTS_REQUIRED) - } - - if (resultingOptions.connectionProtector === null && globalThis.process?.env?.LIBP2P_FORCE_PNET != null) { // eslint-disable-line no-undef - throw new CodeError(messages.ERR_PROTECTOR_REQUIRED, codes.ERR_PROTECTOR_REQUIRED) - } - - return resultingOptions -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/config/connection-gater.browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/config/connection-gater.browser.ts deleted file mode 100644 index c03a15369..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/config/connection-gater.browser.ts +++ /dev/null @@ -1,31 +0,0 @@ -import isPrivate from 'private-ip' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { Multiaddr } from '@multiformats/multiaddr' - -/** - * Returns a connection gater that disallows dialling private addresses by - * default. Browsers are severely limited in their resource usage so don't - * waste time trying to dial undiallable addresses. - */ -export function connectionGater (gater: ConnectionGater = {}): ConnectionGater { - return { - denyDialPeer: async () => false, - denyDialMultiaddr: async (multiaddr: Multiaddr) => { - const tuples = multiaddr.stringTuples() - - if (tuples[0][0] === 4 || tuples[0][0] === 41) { - return Boolean(isPrivate(`${tuples[0][1]}`)) - } - - return false - }, - denyInboundConnection: async () => false, - denyOutboundConnection: async () => false, - denyInboundEncryptedConnection: async () => false, - denyOutboundEncryptedConnection: async () => false, - denyInboundUpgradedConnection: async () => false, - denyOutboundUpgradedConnection: async () => false, - filterMultiaddrForPeer: async () => true, - ...gater - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/config/connection-gater.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/config/connection-gater.ts deleted file mode 100644 index 40f1827ae..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/config/connection-gater.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ConnectionGater } from '@libp2p/interface/connection-gater' - -/** - * Returns a default connection gater implementation that allows everything - */ -export function connectionGater (gater: ConnectionGater = {}): ConnectionGater { - return { - denyDialPeer: async () => false, - denyDialMultiaddr: async () => false, - denyInboundConnection: async () => false, - denyOutboundConnection: async () => false, - denyInboundEncryptedConnection: async () => false, - denyOutboundEncryptedConnection: async () => false, - denyInboundUpgradedConnection: async () => false, - denyOutboundUpgradedConnection: async () => false, - filterMultiaddrForPeer: async () => true, - ...gater - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/auto-dial.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/auto-dial.ts deleted file mode 100644 index 9cd95d6df..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/auto-dial.ts +++ /dev/null @@ -1,287 +0,0 @@ -import { PeerMap, PeerSet } from '@libp2p/peer-collections' -import { PeerJobQueue } from '@libp2p/utils/peer-job-queue' -import { toString as uint8ArrayToString } from 'uint8arrays/to-string' -import { AUTO_DIAL_CONCURRENCY, AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE, AUTO_DIAL_INTERVAL, AUTO_DIAL_MAX_QUEUE_LENGTH, AUTO_DIAL_PEER_RETRY_THRESHOLD, AUTO_DIAL_PRIORITY, LAST_DIAL_FAILURE_KEY, MIN_CONNECTIONS } from './constants.js' -import type { Libp2pEvents, Logger, ComponentLogger } from '@libp2p/interface' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Startable } from '@libp2p/interface/startable' -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager' - -interface AutoDialInit { - minConnections?: number - maxQueueLength?: number - autoDialConcurrency?: number - autoDialPriority?: number - autoDialInterval?: number - autoDialPeerRetryThreshold?: number - autoDialDiscoveredPeersDebounce?: number -} - -interface AutoDialComponents { - connectionManager: ConnectionManager - peerStore: PeerStore - events: TypedEventTarget - logger: ComponentLogger -} - -const defaultOptions = { - minConnections: MIN_CONNECTIONS, - maxQueueLength: AUTO_DIAL_MAX_QUEUE_LENGTH, - autoDialConcurrency: AUTO_DIAL_CONCURRENCY, - autoDialPriority: AUTO_DIAL_PRIORITY, - autoDialInterval: AUTO_DIAL_INTERVAL, - autoDialPeerRetryThreshold: AUTO_DIAL_PEER_RETRY_THRESHOLD, - autoDialDiscoveredPeersDebounce: AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE -} - -export class AutoDial implements Startable { - private readonly connectionManager: ConnectionManager - private readonly peerStore: PeerStore - private readonly queue: PeerJobQueue - private readonly minConnections: number - private readonly autoDialPriority: number - private readonly autoDialIntervalMs: number - private readonly autoDialMaxQueueLength: number - private readonly autoDialPeerRetryThresholdMs: number - private readonly autoDialDiscoveredPeersDebounce: number - private autoDialInterval?: ReturnType - private started: boolean - private running: boolean - private readonly log: Logger - - /** - * Proactively tries to connect to known peers stored in the PeerStore. - * It will keep the number of connections below the upper limit and sort - * the peers to connect based on whether we know their keys and protocols. - */ - constructor (components: AutoDialComponents, init: AutoDialInit) { - this.connectionManager = components.connectionManager - this.peerStore = components.peerStore - this.minConnections = init.minConnections ?? defaultOptions.minConnections - this.autoDialPriority = init.autoDialPriority ?? defaultOptions.autoDialPriority - this.autoDialIntervalMs = init.autoDialInterval ?? defaultOptions.autoDialInterval - this.autoDialMaxQueueLength = init.maxQueueLength ?? defaultOptions.maxQueueLength - this.autoDialPeerRetryThresholdMs = init.autoDialPeerRetryThreshold ?? defaultOptions.autoDialPeerRetryThreshold - this.autoDialDiscoveredPeersDebounce = init.autoDialDiscoveredPeersDebounce ?? defaultOptions.autoDialDiscoveredPeersDebounce - this.log = components.logger.forComponent('libp2p:connection-manager:auto-dial') - this.started = false - this.running = false - this.queue = new PeerJobQueue({ - concurrency: init.autoDialConcurrency ?? defaultOptions.autoDialConcurrency - }) - this.queue.addListener('error', (err) => { - this.log.error('error during auto-dial', err) - }) - - // check the min connection limit whenever a peer disconnects - components.events.addEventListener('connection:close', () => { - this.autoDial() - .catch(err => { - this.log.error(err) - }) - }) - - // sometimes peers are discovered in quick succession so add a small - // debounce to ensure all eligible peers are autodialed - let debounce: ReturnType - - // when new peers are discovered, dial them if we don't have - // enough connections - components.events.addEventListener('peer:discovery', () => { - clearTimeout(debounce) - debounce = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error(err) - }) - }, this.autoDialDiscoveredPeersDebounce) - }) - } - - isStarted (): boolean { - return this.started - } - - start (): void { - this.autoDialInterval = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err) - }) - }, this.autoDialIntervalMs) - this.started = true - } - - afterStart (): void { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err) - }) - } - - stop (): void { - // clear the queue - this.queue.clear() - clearTimeout(this.autoDialInterval) - this.started = false - this.running = false - } - - async autoDial (): Promise { - if (!this.started) { - return - } - - const connections = this.connectionManager.getConnectionsMap() - const numConnections = connections.size - - // Already has enough connections - if (numConnections >= this.minConnections) { - if (this.minConnections > 0) { - this.log.trace('have enough connections %d/%d', numConnections, this.minConnections) - } - return - } - - if (this.queue.size > this.autoDialMaxQueueLength) { - this.log('not enough connections %d/%d but auto dial queue is full', numConnections, this.minConnections) - return - } - - if (this.running) { - this.log('not enough connections %d/%d - but skipping autodial as it is already running', numConnections, this.minConnections) - return - } - - this.running = true - - this.log('not enough connections %d/%d - will dial peers to increase the number of connections', numConnections, this.minConnections) - - const dialQueue = new PeerSet( - // @ts-expect-error boolean filter removes falsy peer IDs - this.connectionManager.getDialQueue() - .map(queue => queue.peerId) - .filter(Boolean) - ) - - // Sort peers on whether we know protocols or public keys for them - const peers = await this.peerStore.all({ - filters: [ - // Remove some peers - (peer) => { - // Remove peers without addresses - if (peer.addresses.length === 0) { - this.log.trace('not autodialing %p because they have no addresses', peer.id) - return false - } - - // remove peers we are already connected to - if (connections.has(peer.id)) { - this.log.trace('not autodialing %p because they are already connected', peer.id) - return false - } - - // remove peers we are already dialling - if (dialQueue.has(peer.id)) { - this.log.trace('not autodialing %p because they are already being dialed', peer.id) - return false - } - - // remove peers already in the autodial queue - if (this.queue.hasJob(peer.id)) { - this.log.trace('not autodialing %p because they are already being autodialed', peer.id) - return false - } - - return true - } - ] - }) - - // shuffle the peers - this is so peers with the same tag values will be - // dialled in a different order each time - const shuffledPeers = peers.sort(() => Math.random() > 0.5 ? 1 : -1) - - // Sort shuffled peers by tag value - const peerValues = new PeerMap() - for (const peer of shuffledPeers) { - if (peerValues.has(peer.id)) { - continue - } - - // sum all tag values - peerValues.set(peer.id, [...peer.tags.values()].reduce((acc, curr) => { - return acc + curr.value - }, 0)) - } - - // sort by value, highest to lowest - const sortedPeers = shuffledPeers.sort((a, b) => { - const peerAValue = peerValues.get(a.id) ?? 0 - const peerBValue = peerValues.get(b.id) ?? 0 - - if (peerAValue > peerBValue) { - return -1 - } - - if (peerAValue < peerBValue) { - return 1 - } - - return 0 - }) - - const peersThatHaveNotFailed = sortedPeers.filter(peer => { - const lastDialFailure = peer.metadata.get(LAST_DIAL_FAILURE_KEY) - - if (lastDialFailure == null) { - return true - } - - const lastDialFailureTimestamp = parseInt(uint8ArrayToString(lastDialFailure)) - - if (isNaN(lastDialFailureTimestamp)) { - return true - } - - // only dial if the time since the last failure is above the retry threshold - return Date.now() - lastDialFailureTimestamp > this.autoDialPeerRetryThresholdMs - }) - - this.log('selected %d/%d peers to dial', peersThatHaveNotFailed.length, peers.length) - - for (const peer of peersThatHaveNotFailed) { - this.queue.add(async () => { - const numConnections = this.connectionManager.getConnectionsMap().size - - // Check to see if we still need to auto dial - if (numConnections >= this.minConnections) { - this.log('got enough connections now %d/%d', numConnections, this.minConnections) - this.queue.clear() - return - } - - this.log('connecting to a peerStore stored peer %p', peer.id) - await this.connectionManager.openConnection(peer.id, { - priority: this.autoDialPriority - }) - }, { - peerId: peer.id - }).catch(err => { - this.log.error('could not connect to peerStore stored peer', err) - }) - } - - this.running = false - - if (this.started) { - this.autoDialInterval = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err) - }) - }, this.autoDialIntervalMs) - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/connection-pruner.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/connection-pruner.ts deleted file mode 100644 index 71a2f2308..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/connection-pruner.ts +++ /dev/null @@ -1,157 +0,0 @@ -import { PeerMap } from '@libp2p/peer-collections' -import { MAX_CONNECTIONS } from './constants.js' -import type { Libp2pEvents, Logger, ComponentLogger } from '@libp2p/interface' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager' -import type { Multiaddr } from '@multiformats/multiaddr' - -interface ConnectionPrunerInit { - maxConnections?: number - allow?: Multiaddr[] -} - -interface ConnectionPrunerComponents { - connectionManager: ConnectionManager - peerStore: PeerStore - events: TypedEventTarget - logger: ComponentLogger -} - -const defaultOptions = { - maxConnections: MAX_CONNECTIONS, - allow: [] -} - -/** - * If we go over the max connections limit, choose some connections to close - */ -export class ConnectionPruner { - private readonly maxConnections: number - private readonly connectionManager: ConnectionManager - private readonly peerStore: PeerStore - private readonly allow: Multiaddr[] - private readonly events: TypedEventTarget - private readonly log: Logger - - constructor (components: ConnectionPrunerComponents, init: ConnectionPrunerInit = {}) { - this.maxConnections = init.maxConnections ?? defaultOptions.maxConnections - this.allow = init.allow ?? defaultOptions.allow - this.connectionManager = components.connectionManager - this.peerStore = components.peerStore - this.events = components.events - this.log = components.logger.forComponent('libp2p:connection-manager:connection-pruner') - - // check the max connection limit whenever a peer connects - components.events.addEventListener('connection:open', () => { - this.maybePruneConnections() - .catch(err => { - this.log.error(err) - }) - }) - } - - /** - * If we have more connections than our maximum, select some excess connections - * to prune based on peer value - */ - async maybePruneConnections (): Promise { - const connections = this.connectionManager.getConnections() - const numConnections = connections.length - const toPrune = Math.max(numConnections - this.maxConnections, 0) - - this.log('checking max connections limit %d/%d', numConnections, this.maxConnections) - if (numConnections <= this.maxConnections) { - return - } - - this.log('max connections limit exceeded %d/%d, pruning %d connection(s)', numConnections, this.maxConnections, toPrune) - const peerValues = new PeerMap() - - // work out peer values - for (const connection of connections) { - const remotePeer = connection.remotePeer - - if (peerValues.has(remotePeer)) { - continue - } - - peerValues.set(remotePeer, 0) - - try { - const peer = await this.peerStore.get(remotePeer) - - // sum all tag values - peerValues.set(remotePeer, [...peer.tags.values()].reduce((acc, curr) => { - return acc + curr.value - }, 0)) - } catch (err: any) { - if (err.code !== 'ERR_NOT_FOUND') { - this.log.error('error loading peer tags', err) - } - } - } - - // sort by value, lowest to highest - const sortedConnections = connections.sort((a, b) => { - const peerAValue = peerValues.get(a.remotePeer) ?? 0 - const peerBValue = peerValues.get(b.remotePeer) ?? 0 - - if (peerAValue > peerBValue) { - return 1 - } - - if (peerAValue < peerBValue) { - return -1 - } - - // if the peers have an equal tag value then we want to close short-lived connections first - const connectionALifespan = a.timeline.open - const connectionBLifespan = b.timeline.open - - if (connectionALifespan < connectionBLifespan) { - return 1 - } - - if (connectionALifespan > connectionBLifespan) { - return -1 - } - - return 0 - }) - - // close some connections - const toClose = [] - - for (const connection of sortedConnections) { - this.log('too many connections open - closing a connection to %p', connection.remotePeer) - // check allow list - const connectionInAllowList = this.allow.some((ma) => { - return connection.remoteAddr.toString().startsWith(ma.toString()) - }) - - // Connections in the allow list should be excluded from pruning - if (!connectionInAllowList) { - toClose.push(connection) - } - - if (toClose.length === toPrune) { - break - } - } - - // close connections - await Promise.all( - toClose.map(async connection => { - try { - await connection.close() - } catch (err) { - this.log.error(err) - } - }) - ) - - // despatch prune event - this.events.safeDispatchEvent('connection:prune', { detail: toClose }) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/constants.browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/constants.browser.ts deleted file mode 100644 index 2c369c124..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/constants.browser.ts +++ /dev/null @@ -1,21 +0,0 @@ -export * from './constants.defaults.js' - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export const MIN_CONNECTIONS = 5 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export const MAX_CONNECTIONS = 100 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export const MAX_PARALLEL_DIALS = 50 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export const AUTO_DIAL_PEER_RETRY_THRESHOLD = 1000 * 60 * 7 diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/constants.defaults.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/constants.defaults.ts deleted file mode 100644 index 2eb5044e7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/constants.defaults.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#dialTimeout - */ -export const DIAL_TIMEOUT = 30e3 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundUpgradeTimeout - */ -export const INBOUND_UPGRADE_TIMEOUT = 30e3 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxPeerAddrsToDial - */ -export const MAX_PEER_ADDRS_TO_DIAL = 25 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialInterval - */ -export const AUTO_DIAL_INTERVAL = 5000 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialConcurrency - */ -export const AUTO_DIAL_CONCURRENCY = 25 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialPriority - */ -export const AUTO_DIAL_PRIORITY = 0 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialMaxQueueLength - */ -export const AUTO_DIAL_MAX_QUEUE_LENGTH = 100 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialDiscoveredPeersDebounce - */ -export const AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE = 10 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundConnectionThreshold - */ -export const INBOUND_CONNECTION_THRESHOLD = 5 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxIncomingPendingConnections - */ -export const MAX_INCOMING_PENDING_CONNECTIONS = 10 - -/** - * Store as part of the peer store metadata for a given peer, the value for this - * key is a timestamp of the last time a dial attempted failed with the relevant - * peer stored as a string. - * - * Used to insure we do not endlessly try to auto dial peers we have recently - * failed to dial. - */ -export const LAST_DIAL_FAILURE_KEY = 'last-dial-failure' diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/constants.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/constants.ts deleted file mode 100644 index a6a6c486f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/constants.ts +++ /dev/null @@ -1,21 +0,0 @@ -export * from './constants.defaults.js' - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export const MIN_CONNECTIONS = 50 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export const MAX_CONNECTIONS = 300 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export const MAX_PARALLEL_DIALS = 100 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export const AUTO_DIAL_PEER_RETRY_THRESHOLD = 1000 * 60 diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/dial-queue.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/dial-queue.ts deleted file mode 100644 index 9550c95df..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/dial-queue.ts +++ /dev/null @@ -1,580 +0,0 @@ -import { AbortError, CodeError, ERR_TIMEOUT } from '@libp2p/interface/errors' -import { setMaxListeners } from '@libp2p/interface/events' -import { PeerMap } from '@libp2p/peer-collections' -import { defaultAddressSort } from '@libp2p/utils/address-sort' -import { type Multiaddr, type Resolver, resolvers } from '@multiformats/multiaddr' -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers' -import { type ClearableSignal, anySignal } from 'any-signal' -import pDefer from 'p-defer' -import PQueue from 'p-queue' -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' -import { codes } from '../errors.js' -import { getPeerAddress } from '../get-peer.js' -import { - DIAL_TIMEOUT, - MAX_PARALLEL_DIALS, - MAX_PEER_ADDRS_TO_DIAL, - LAST_DIAL_FAILURE_KEY -} from './constants.js' -import { combineSignals, resolveMultiaddrs } from './utils.js' -import type { AddressSorter, AbortOptions, PendingDial, ComponentLogger, Logger } from '@libp2p/interface' -import type { Connection } from '@libp2p/interface/connection' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { Metric, Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { Address, PeerStore } from '@libp2p/interface/peer-store' -import type { TransportManager } from '@libp2p/interface-internal/transport-manager' - -export interface PendingDialTarget { - resolve(value: any): void - reject(err: Error): void -} - -export interface DialOptions extends AbortOptions { - priority?: number - force?: boolean -} - -interface PendingDialInternal extends PendingDial { - promise: Promise -} - -interface DialerInit { - addressSorter?: AddressSorter - maxParallelDials?: number - maxPeerAddrsToDial?: number - dialTimeout?: number - resolvers?: Record - connections?: PeerMap -} - -const defaultOptions = { - addressSorter: defaultAddressSort, - maxParallelDials: MAX_PARALLEL_DIALS, - maxPeerAddrsToDial: MAX_PEER_ADDRS_TO_DIAL, - dialTimeout: DIAL_TIMEOUT, - resolvers: { - dnsaddr: dnsaddrResolver - } -} - -interface DialQueueComponents { - peerId: PeerId - metrics?: Metrics - peerStore: PeerStore - transportManager: TransportManager - connectionGater: ConnectionGater - logger: ComponentLogger -} - -export class DialQueue { - public pendingDials: PendingDialInternal[] - public queue: PQueue - private readonly peerId: PeerId - private readonly peerStore: PeerStore - private readonly connectionGater: ConnectionGater - private readonly transportManager: TransportManager - private readonly addressSorter: AddressSorter - private readonly maxPeerAddrsToDial: number - private readonly dialTimeout: number - private readonly inProgressDialCount?: Metric - private readonly pendingDialCount?: Metric - private readonly shutDownController: AbortController - private readonly connections: PeerMap - private readonly log: Logger - - constructor (components: DialQueueComponents, init: DialerInit = {}) { - this.addressSorter = init.addressSorter ?? defaultOptions.addressSorter - this.maxPeerAddrsToDial = init.maxPeerAddrsToDial ?? defaultOptions.maxPeerAddrsToDial - this.dialTimeout = init.dialTimeout ?? defaultOptions.dialTimeout - this.connections = init.connections ?? new PeerMap() - this.log = components.logger.forComponent('libp2p:connection-manager:dial-queue') - - this.peerId = components.peerId - this.peerStore = components.peerStore - this.connectionGater = components.connectionGater - this.transportManager = components.transportManager - this.shutDownController = new AbortController() - - setMaxListeners(Infinity, this.shutDownController.signal) - - this.pendingDialCount = components.metrics?.registerMetric('libp2p_dial_queue_pending_dials') - this.inProgressDialCount = components.metrics?.registerMetric('libp2p_dial_queue_in_progress_dials') - this.pendingDials = [] - - for (const [key, value] of Object.entries(init.resolvers ?? {})) { - resolvers.set(key, value) - } - - // controls dial concurrency - this.queue = new PQueue({ - concurrency: init.maxParallelDials ?? defaultOptions.maxParallelDials - }) - - // a job was added to the queue - this.queue.on('add', () => { - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - // a queued job started - this.queue.on('active', () => { - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - // a started job completed without error - this.queue.on('completed', () => { - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - // a started job errored - this.queue.on('error', (err) => { - this.log.error('error in dial queue', err) - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - // all queued jobs have been started - this.queue.on('empty', () => { - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - // add started jobs have run and the queue is empty - this.queue.on('idle', () => { - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - } - - /** - * Clears any pending dials - */ - stop (): void { - this.shutDownController.abort() - } - - /** - * Connects to a given peer, multiaddr or list of multiaddrs. - * - * If a peer is passed, all known multiaddrs will be tried. If a multiaddr or - * multiaddrs are passed only those will be dialled. - * - * Where a list of multiaddrs is passed, if any contain a peer id then all - * multiaddrs in the list must contain the same peer id. - * - * The dial to the first address that is successfully able to upgrade a connection - * will be used, all other dials will be aborted when that happens. - */ - async dial (peerIdOrMultiaddr: PeerId | Multiaddr | Multiaddr[], options: DialOptions = {}): Promise { - const { peerId, multiaddrs } = getPeerAddress(peerIdOrMultiaddr) - - const addrs: Address[] = multiaddrs.map(multiaddr => ({ - multiaddr, - isCertified: false - })) - - // create abort conditions - need to do this before `calculateMultiaddrs` as we may be about to - // resolve a dns addr which can time out - const signal = this.createDialAbortControllers(options.signal) - let addrsToDial: Address[] - - try { - // load addresses from address book, resolve and dnsaddrs, filter undiallables, add peer IDs, etc - addrsToDial = await this.calculateMultiaddrs(peerId, addrs, { - ...options, - signal - }) - } catch (err) { - signal.clear() - throw err - } - - // make sure we don't have an existing connection to any of the addresses we - // are about to dial - let existingConnection = Array.from(this.connections.values()).flat().find(conn => { - if (options.force === true) { - return false - } - - return addrsToDial.find(addr => { - return addr.multiaddr.equals(conn.remoteAddr) - }) - }) - - if (existingConnection != null) { - this.log('already connected to %a', existingConnection.remoteAddr) - return existingConnection - } - - // ready to dial, all async work finished - make sure we don't have any - // pending dials in progress for this peer or set of multiaddrs - const existingDial = this.pendingDials.find(dial => { - // is the dial for the same peer id? - if (dial.peerId != null && peerId != null && dial.peerId.equals(peerId)) { - return true - } - - // is the dial for the same set of multiaddrs? - if (addrsToDial.map(({ multiaddr }) => multiaddr.toString()).join() === dial.multiaddrs.map(multiaddr => multiaddr.toString()).join()) { - return true - } - - return false - }) - - if (existingDial != null) { - this.log('joining existing dial target for %p', peerId) - signal.clear() - return existingDial.promise - } - - this.log('creating dial target for', addrsToDial.map(({ multiaddr }) => multiaddr.toString())) - // @ts-expect-error .promise property is set below - const pendingDial: PendingDialInternal = { - id: randomId(), - status: 'queued', - peerId, - multiaddrs: addrsToDial.map(({ multiaddr }) => multiaddr) - } - - pendingDial.promise = this.performDial(pendingDial, { - ...options, - signal - }) - .finally(() => { - // remove our pending dial entry - this.pendingDials = this.pendingDials.filter(p => p.id !== pendingDial.id) - - // clean up abort signals/controllers - signal.clear() - }) - .catch(async err => { - this.log.error('dial failed to %s', pendingDial.multiaddrs.map(ma => ma.toString()).join(', '), err) - - if (peerId != null) { - // record the last failed dial - try { - await this.peerStore.patch(peerId, { - metadata: { - [LAST_DIAL_FAILURE_KEY]: uint8ArrayFromString(Date.now().toString()) - } - }) - } catch (err: any) { - this.log.error('could not update last dial failure key for %p', peerId, err) - } - } - - // Error is a timeout - if (signal.aborted) { - const error = new CodeError(err.message, ERR_TIMEOUT) - throw error - } - - throw err - }) - - // let other dials join this one - this.pendingDials.push(pendingDial) - - const connection = await pendingDial.promise - - // we may have been dialing a multiaddr without a peer id attached but by - // this point we have upgraded the connection so the remote peer information - // should be available - check again that we don't already have a connection - // to the remote multiaddr - existingConnection = Array.from(this.connections.values()).flat().find(conn => { - if (options.force === true) { - return false - } - - return conn.id !== connection.id && conn.remoteAddr.equals(connection.remoteAddr) - }) - - if (existingConnection != null) { - this.log('already connected to %a', existingConnection.remoteAddr) - await connection.close() - return existingConnection - } - - this.log('connection opened to %a', connection.remoteAddr) - return connection - } - - private createDialAbortControllers (userSignal?: AbortSignal): ClearableSignal { - // let any signal abort the dial - const signal = anySignal( - [AbortSignal.timeout(this.dialTimeout), - this.shutDownController.signal, - userSignal - ] - ) - - try { - // This emitter gets listened to a lot - setMaxListeners?.(Infinity, signal) - } catch {} - - return signal - } - - // eslint-disable-next-line complexity - private async calculateMultiaddrs (peerId?: PeerId, addrs: Address[] = [], options: DialOptions = {}): Promise { - // if a peer id or multiaddr(s) with a peer id, make sure it isn't our peer id and that we are allowed to dial it - if (peerId != null) { - if (this.peerId.equals(peerId)) { - throw new CodeError('Tried to dial self', codes.ERR_DIALED_SELF) - } - - if ((await this.connectionGater.denyDialPeer?.(peerId)) === true) { - throw new CodeError('The dial request is blocked by gater.allowDialPeer', codes.ERR_PEER_DIAL_INTERCEPTED) - } - - // if just a peer id was passed, load available multiaddrs for this peer from the address book - if (addrs.length === 0) { - this.log('loading multiaddrs for %p', peerId) - try { - const peer = await this.peerStore.get(peerId) - addrs.push(...peer.addresses) - this.log('loaded multiaddrs for %p', peerId, addrs.map(({ multiaddr }) => multiaddr.toString())) - } catch (err: any) { - if (err.code !== codes.ERR_NOT_FOUND) { - throw err - } - } - } - } - - // resolve addresses - this can result in a one-to-many translation when dnsaddrs are resolved - let resolvedAddresses = (await Promise.all( - addrs.map(async addr => { - const result = await resolveMultiaddrs(addr.multiaddr, { - ...options, - log: this.log - }) - - if (result.length === 1 && result[0].equals(addr.multiaddr)) { - return addr - } - - return result.map(multiaddr => ({ - multiaddr, - isCertified: false - })) - }) - )) - .flat() - - // ensure the peer id is appended to the multiaddr - if (peerId != null) { - const peerIdMultiaddr = `/p2p/${peerId.toString()}` - resolvedAddresses = resolvedAddresses.map(addr => { - const lastProto = addr.multiaddr.protos().pop() - - // do not append peer id to path multiaddrs - if (lastProto?.path === true) { - return addr - } - - // append peer id to multiaddr if it is not already present - if (addr.multiaddr.getPeerId() == null) { - return { - multiaddr: addr.multiaddr.encapsulate(peerIdMultiaddr), - isCertified: addr.isCertified - } - } - - return addr - }) - } - - const filteredAddrs = resolvedAddresses.filter(addr => { - // filter out any multiaddrs that we do not have transports for - if (this.transportManager.transportForMultiaddr(addr.multiaddr) == null) { - return false - } - - // if the resolved multiaddr has a PeerID but it's the wrong one, ignore it - // - this can happen with addresses like bootstrap.libp2p.io that resolve - // to multiple different peers - const addrPeerId = addr.multiaddr.getPeerId() - if (peerId != null && addrPeerId != null) { - return peerId.equals(addrPeerId) - } - - return true - }) - - // deduplicate addresses - const dedupedAddrs = new Map() - - for (const addr of filteredAddrs) { - const maStr = addr.multiaddr.toString() - const existing = dedupedAddrs.get(maStr) - - if (existing != null) { - existing.isCertified = existing.isCertified || addr.isCertified || false - continue - } - - dedupedAddrs.set(maStr, addr) - } - - const dedupedMultiaddrs = [...dedupedAddrs.values()] - - if (dedupedMultiaddrs.length === 0 || dedupedMultiaddrs.length > this.maxPeerAddrsToDial) { - this.log('addresses for %p before filtering', peerId ?? 'unknown peer', resolvedAddresses.map(({ multiaddr }) => multiaddr.toString())) - this.log('addresses for %p after filtering', peerId ?? 'unknown peer', dedupedMultiaddrs.map(({ multiaddr }) => multiaddr.toString())) - } - - // make sure we actually have some addresses to dial - if (dedupedMultiaddrs.length === 0) { - throw new CodeError('The dial request has no valid addresses', codes.ERR_NO_VALID_ADDRESSES) - } - - // make sure we don't have too many addresses to dial - if (dedupedMultiaddrs.length > this.maxPeerAddrsToDial) { - throw new CodeError('dial with more addresses than allowed', codes.ERR_TOO_MANY_ADDRESSES) - } - - const gatedAdrs: Address[] = [] - - for (const addr of dedupedMultiaddrs) { - if (this.connectionGater.denyDialMultiaddr != null && await this.connectionGater.denyDialMultiaddr(addr.multiaddr)) { - continue - } - - gatedAdrs.push(addr) - } - - const sortedGatedAddrs = gatedAdrs.sort(this.addressSorter) - - // make sure we actually have some addresses to dial - if (sortedGatedAddrs.length === 0) { - throw new CodeError('The connection gater denied all addresses in the dial request', codes.ERR_NO_VALID_ADDRESSES) - } - - return sortedGatedAddrs - } - - private async performDial (pendingDial: PendingDialInternal, options: DialOptions = {}): Promise { - const dialAbortControllers: Array<(AbortController | undefined)> = pendingDial.multiaddrs.map(() => new AbortController()) - - try { - // internal peer dial queue - only one dial per peer at a time - const peerDialQueue = new PQueue({ concurrency: 1 }) - peerDialQueue.on('error', (err) => { - this.log.error('error dialing %s %o', pendingDial.multiaddrs, err) - }) - - const conn = await Promise.any(pendingDial.multiaddrs.map(async (addr, i) => { - const controller = dialAbortControllers[i] - - if (controller == null) { - throw new CodeError('dialAction did not come with an AbortController', codes.ERR_INVALID_PARAMETERS) - } - - // let any signal abort the dial - const signal = combineSignals(controller.signal, options.signal) - signal.addEventListener('abort', () => { - this.log('dial to %a aborted', addr) - }) - const deferred = pDefer() - - await peerDialQueue.add(async () => { - if (signal.aborted) { - this.log('dial to %a was aborted before reaching the head of the peer dial queue', addr) - deferred.reject(new AbortError()) - return - } - - // add the individual dial to the dial queue so we don't breach maxConcurrentDials - await this.queue.add(async () => { - try { - if (signal.aborted) { - this.log('dial to %a was aborted before reaching the head of the dial queue', addr) - deferred.reject(new AbortError()) - return - } - - // update dial status - pendingDial.status = 'active' - - const conn = await this.transportManager.dial(addr, { - ...options, - signal - }) - - if (controller.signal.aborted) { - // another dial succeeded faster than this one - this.log('multiple dials succeeded, closing superfluous connection') - - conn.close().catch(err => { - this.log.error('error closing superfluous connection', err) - }) - - deferred.reject(new AbortError()) - return - } - - // remove the successful AbortController so it is not aborted - dialAbortControllers[i] = undefined - - // immediately abort any other dials - dialAbortControllers.forEach(c => { - if (c !== undefined) { - c.abort() - } - }) - - this.log('dial to %a succeeded', addr) - - // resolve the connection promise - deferred.resolve(conn) - } catch (err: any) { - // something only went wrong if our signal was not aborted - this.log.error('error during dial of %a', addr, err) - deferred.reject(err) - } - }, { - ...options, - signal - }).catch(err => { - deferred.reject(err) - }) - }, { - signal - }).catch(err => { - deferred.reject(err) - }).finally(() => { - signal.clear() - }) - - return deferred.promise - })) - - // dial succeeded or failed - if (conn == null) { - throw new CodeError('successful dial led to empty object returned from peer dial queue', codes.ERR_TRANSPORT_DIAL_FAILED) - } - - pendingDial.status = 'success' - - return conn - } catch (err: any) { - pendingDial.status = 'error' - - // if we only dialled one address, unwrap the AggregateError to provide more - // useful feedback to the user - if (pendingDial.multiaddrs.length === 1 && err.name === 'AggregateError') { - throw err.errors[0] - } - - throw err - } - } -} - -/** - * Returns a random string - */ -function randomId (): string { - return `${(parseInt(String(Math.random() * 1e9), 10)).toString()}${Date.now()}` -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/index.ts deleted file mode 100644 index 03240c4bf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/index.ts +++ /dev/null @@ -1,612 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { KEEP_ALIVE } from '@libp2p/interface/peer-store/tags' -import { PeerMap } from '@libp2p/peer-collections' -import { defaultAddressSort } from '@libp2p/utils/address-sort' -import { type Multiaddr, type Resolver, multiaddr } from '@multiformats/multiaddr' -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers' -import { RateLimiterMemory } from 'rate-limiter-flexible' -import { codes } from '../errors.js' -import { getPeerAddress } from '../get-peer.js' -import { AutoDial } from './auto-dial.js' -import { ConnectionPruner } from './connection-pruner.js' -import { AUTO_DIAL_CONCURRENCY, AUTO_DIAL_MAX_QUEUE_LENGTH, AUTO_DIAL_PRIORITY, DIAL_TIMEOUT, INBOUND_CONNECTION_THRESHOLD, MAX_CONNECTIONS, MAX_INCOMING_PENDING_CONNECTIONS, MAX_PARALLEL_DIALS, MAX_PEER_ADDRS_TO_DIAL, MIN_CONNECTIONS } from './constants.js' -import { DialQueue } from './dial-queue.js' -import type { PendingDial, AddressSorter, Libp2pEvents, AbortOptions, ComponentLogger, Logger } from '@libp2p/interface' -import type { Connection, MultiaddrConnection } from '@libp2p/interface/connection' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { Peer, PeerStore } from '@libp2p/interface/peer-store' -import type { Startable } from '@libp2p/interface/startable' -import type { ConnectionManager, OpenConnectionOptions } from '@libp2p/interface-internal/connection-manager' -import type { TransportManager } from '@libp2p/interface-internal/transport-manager' - -const DEFAULT_DIAL_PRIORITY = 50 - -export interface ConnectionManagerInit { - /** - * The maximum number of connections libp2p is willing to have before it starts - * pruning connections to reduce resource usage. (default: 300, 100 in browsers) - */ - maxConnections?: number - - /** - * The minimum number of connections below which libp2p will start to dial peers - * from the peer book. Setting this to 0 effectively disables this behaviour. - * (default: 50, 5 in browsers) - */ - minConnections?: number - - /** - * How long to wait between attempting to keep our number of concurrent connections - * above minConnections (default: 5000) - */ - autoDialInterval?: number - - /** - * When dialling peers from the peer book to keep the number of open connections - * above `minConnections`, add dials for this many peers to the dial queue - * at once. (default: 25) - */ - autoDialConcurrency?: number - - /** - * To allow user dials to take priority over auto dials, use this value as the - * dial priority. (default: 0) - */ - autoDialPriority?: number - - /** - * Limit the maximum number of peers to dial when trying to keep the number of - * open connections above `minConnections`. (default: 100) - */ - autoDialMaxQueueLength?: number - - /** - * When we've failed to dial a peer, do not autodial them again within this - * number of ms. (default: 1 minute, 7 minutes in browsers) - */ - autoDialPeerRetryThreshold?: number - - /** - * Newly discovered peers may be auto-dialed to increase the number of open - * connections, but they can be discovered in quick succession so add a small - * delay before attempting to dial them in case more peers have been - * discovered. (default: 10ms) - */ - autoDialDiscoveredPeersDebounce?: number - - /** - * Sort the known addresses of a peer before trying to dial, By default public - * addresses will be dialled before private (e.g. loopback or LAN) addresses. - */ - addressSorter?: AddressSorter - - /** - * The maximum number of dials across all peers to execute in parallel. - * (default: 100, 50 in browsers) - */ - maxParallelDials?: number - - /** - * Maximum number of addresses allowed for a given peer - if a peer has more - * addresses than this then the dial will fail. (default: 25) - */ - maxPeerAddrsToDial?: number - - /** - * How long a dial attempt is allowed to take, including DNS resolution - * of the multiaddr, opening a socket and upgrading it to a Connection. - */ - dialTimeout?: number - - /** - * When a new inbound connection is opened, the upgrade process (e.g. protect, - * encrypt, multiplex etc) must complete within this number of ms. (default: 30s) - */ - inboundUpgradeTimeout?: number - - /** - * Multiaddr resolvers to use when dialling - */ - resolvers?: Record - - /** - * A list of multiaddrs that will always be allowed (except if they are in the - * deny list) to open connections to this node even if we've reached maxConnections - */ - allow?: string[] - - /** - * A list of multiaddrs that will never be allowed to open connections to - * this node under any circumstances - */ - deny?: string[] - - /** - * If more than this many connections are opened per second by a single - * host, reject subsequent connections. (default: 5) - */ - inboundConnectionThreshold?: number - - /** - * The maximum number of parallel incoming connections allowed that have yet to - * complete the connection upgrade - e.g. choosing connection encryption, muxer, etc. - * (default: 10) - */ - maxIncomingPendingConnections?: number -} - -const defaultOptions = { - minConnections: MIN_CONNECTIONS, - maxConnections: MAX_CONNECTIONS, - inboundConnectionThreshold: INBOUND_CONNECTION_THRESHOLD, - maxIncomingPendingConnections: MAX_INCOMING_PENDING_CONNECTIONS, - autoDialConcurrency: AUTO_DIAL_CONCURRENCY, - autoDialPriority: AUTO_DIAL_PRIORITY, - autoDialMaxQueueLength: AUTO_DIAL_MAX_QUEUE_LENGTH -} - -export interface DefaultConnectionManagerComponents { - peerId: PeerId - metrics?: Metrics - peerStore: PeerStore - transportManager: TransportManager - connectionGater: ConnectionGater - events: TypedEventTarget - logger: ComponentLogger -} - -/** - * Responsible for managing known connections. - */ -export class DefaultConnectionManager implements ConnectionManager, Startable { - private started: boolean - private readonly connections: PeerMap - private readonly allow: Multiaddr[] - private readonly deny: Multiaddr[] - private readonly maxIncomingPendingConnections: number - private incomingPendingConnections: number - private readonly maxConnections: number - - public readonly dialQueue: DialQueue - public readonly autoDial: AutoDial - public readonly connectionPruner: ConnectionPruner - private readonly inboundConnectionRateLimiter: RateLimiterMemory - - private readonly peerStore: PeerStore - private readonly metrics?: Metrics - private readonly events: TypedEventTarget - private readonly log: Logger - - constructor (components: DefaultConnectionManagerComponents, init: ConnectionManagerInit = {}) { - this.maxConnections = init.maxConnections ?? defaultOptions.maxConnections - const minConnections = init.minConnections ?? defaultOptions.minConnections - - if (this.maxConnections < minConnections) { - throw new CodeError('Connection Manager maxConnections must be greater than minConnections', codes.ERR_INVALID_PARAMETERS) - } - - /** - * Map of connections per peer - */ - this.connections = new PeerMap() - - this.started = false - this.peerStore = components.peerStore - this.metrics = components.metrics - this.events = components.events - this.log = components.logger.forComponent('libp2p:connection-manager') - - this.onConnect = this.onConnect.bind(this) - this.onDisconnect = this.onDisconnect.bind(this) - this.events.addEventListener('connection:open', this.onConnect) - this.events.addEventListener('connection:close', this.onDisconnect) - - // allow/deny lists - this.allow = (init.allow ?? []).map(ma => multiaddr(ma)) - this.deny = (init.deny ?? []).map(ma => multiaddr(ma)) - - this.incomingPendingConnections = 0 - this.maxIncomingPendingConnections = init.maxIncomingPendingConnections ?? defaultOptions.maxIncomingPendingConnections - - // controls individual peers trying to dial us too quickly - this.inboundConnectionRateLimiter = new RateLimiterMemory({ - points: init.inboundConnectionThreshold ?? defaultOptions.inboundConnectionThreshold, - duration: 1 - }) - - // controls what happens when we don't have enough connections - this.autoDial = new AutoDial({ - connectionManager: this, - peerStore: components.peerStore, - events: components.events, - logger: components.logger - }, { - minConnections, - autoDialConcurrency: init.autoDialConcurrency ?? defaultOptions.autoDialConcurrency, - autoDialPriority: init.autoDialPriority ?? defaultOptions.autoDialPriority, - maxQueueLength: init.autoDialMaxQueueLength ?? defaultOptions.autoDialMaxQueueLength - }) - - // controls what happens when we have too many connections - this.connectionPruner = new ConnectionPruner({ - connectionManager: this, - peerStore: components.peerStore, - events: components.events, - logger: components.logger - }, { - maxConnections: this.maxConnections, - allow: this.allow - }) - - this.dialQueue = new DialQueue({ - peerId: components.peerId, - metrics: components.metrics, - peerStore: components.peerStore, - transportManager: components.transportManager, - connectionGater: components.connectionGater, - logger: components.logger - }, { - addressSorter: init.addressSorter ?? defaultAddressSort, - maxParallelDials: init.maxParallelDials ?? MAX_PARALLEL_DIALS, - maxPeerAddrsToDial: init.maxPeerAddrsToDial ?? MAX_PEER_ADDRS_TO_DIAL, - dialTimeout: init.dialTimeout ?? DIAL_TIMEOUT, - resolvers: init.resolvers ?? { - dnsaddr: dnsaddrResolver - }, - connections: this.connections - }) - } - - isStarted (): boolean { - return this.started - } - - /** - * Starts the Connection Manager. If Metrics are not enabled on libp2p - * only event loop and connection limits will be monitored. - */ - async start (): Promise { - // track inbound/outbound connections - this.metrics?.registerMetricGroup('libp2p_connection_manager_connections', { - calculate: () => { - const metric = { - inbound: 0, - outbound: 0 - } - - for (const conns of this.connections.values()) { - for (const conn of conns) { - if (conn.direction === 'inbound') { - metric.inbound++ - } else { - metric.outbound++ - } - } - } - - return metric - } - }) - - // track total number of streams per protocol - this.metrics?.registerMetricGroup('libp2p_protocol_streams_total', { - label: 'protocol', - calculate: () => { - const metric: Record = {} - - for (const conns of this.connections.values()) { - for (const conn of conns) { - for (const stream of conn.streams) { - const key = `${stream.direction} ${stream.protocol ?? 'unnegotiated'}` - - metric[key] = (metric[key] ?? 0) + 1 - } - } - } - - return metric - } - }) - - // track 90th percentile of streams per protocol - this.metrics?.registerMetricGroup('libp2p_connection_manager_protocol_streams_per_connection_90th_percentile', { - label: 'protocol', - calculate: () => { - const allStreams: Record = {} - - for (const conns of this.connections.values()) { - for (const conn of conns) { - const streams: Record = {} - - for (const stream of conn.streams) { - const key = `${stream.direction} ${stream.protocol ?? 'unnegotiated'}` - - streams[key] = (streams[key] ?? 0) + 1 - } - - for (const [protocol, count] of Object.entries(streams)) { - allStreams[protocol] = allStreams[protocol] ?? [] - allStreams[protocol].push(count) - } - } - } - - const metric: Record = {} - - for (let [protocol, counts] of Object.entries(allStreams)) { - counts = counts.sort((a, b) => a - b) - - const index = Math.floor(counts.length * 0.9) - metric[protocol] = counts[index] - } - - return metric - } - }) - - this.autoDial.start() - - this.started = true - this.log('started') - } - - async afterStart (): Promise { - // re-connect to any peers with the KEEP_ALIVE tag - void Promise.resolve() - .then(async () => { - const keepAlivePeers: Peer[] = await this.peerStore.all({ - filters: [(peer) => { - return peer.tags.has(KEEP_ALIVE) - }] - }) - - await Promise.all( - keepAlivePeers.map(async peer => { - await this.openConnection(peer.id) - .catch(err => { - this.log.error(err) - }) - }) - ) - }) - .catch(err => { - this.log.error(err) - }) - - this.autoDial.afterStart() - } - - /** - * Stops the Connection Manager - */ - async stop (): Promise { - this.dialQueue.stop() - this.autoDial.stop() - - // Close all connections we're tracking - const tasks: Array> = [] - for (const connectionList of this.connections.values()) { - for (const connection of connectionList) { - tasks.push((async () => { - try { - await connection.close() - } catch (err) { - this.log.error(err) - } - })()) - } - } - - this.log('closing %d connections', tasks.length) - await Promise.all(tasks) - this.connections.clear() - - this.log('stopped') - } - - onConnect (evt: CustomEvent): void { - void this._onConnect(evt).catch(err => { - this.log.error(err) - }) - } - - /** - * Tracks the incoming connection and check the connection limit - */ - async _onConnect (evt: CustomEvent): Promise { - const { detail: connection } = evt - - if (!this.started) { - // This can happen when we are in the process of shutting down the node - await connection.close() - return - } - - const peerId = connection.remotePeer - const storedConns = this.connections.get(peerId) - let isNewPeer = false - - if (storedConns != null) { - storedConns.push(connection) - } else { - isNewPeer = true - this.connections.set(peerId, [connection]) - } - - // only need to store RSA public keys, all other types are embedded in the peer id - if (peerId.publicKey != null && peerId.type === 'RSA') { - await this.peerStore.patch(peerId, { - publicKey: peerId.publicKey - }) - } - - if (isNewPeer) { - this.events.safeDispatchEvent('peer:connect', { detail: connection.remotePeer }) - } - } - - /** - * Removes the connection from tracking - */ - onDisconnect (evt: CustomEvent): void { - const { detail: connection } = evt - - if (!this.started) { - // This can happen when we are in the process of shutting down the node - return - } - - const peerId = connection.remotePeer - let storedConn = this.connections.get(peerId) - - if (storedConn != null && storedConn.length > 1) { - storedConn = storedConn.filter((conn) => conn.id !== connection.id) - this.connections.set(peerId, storedConn) - } else if (storedConn != null) { - this.connections.delete(peerId) - this.events.safeDispatchEvent('peer:disconnect', { detail: connection.remotePeer }) - } - } - - getConnections (peerId?: PeerId): Connection[] { - if (peerId != null) { - return this.connections.get(peerId) ?? [] - } - - let conns: Connection[] = [] - - for (const c of this.connections.values()) { - conns = conns.concat(c) - } - - return conns - } - - getConnectionsMap (): PeerMap { - return this.connections - } - - async openConnection (peerIdOrMultiaddr: PeerId | Multiaddr | Multiaddr[], options: OpenConnectionOptions = {}): Promise { - if (!this.isStarted()) { - throw new CodeError('Not started', codes.ERR_NODE_NOT_STARTED) - } - - options.signal?.throwIfAborted() - - const { peerId } = getPeerAddress(peerIdOrMultiaddr) - - if (peerId != null && options.force !== true) { - this.log('dial %p', peerId) - const existingConnection = this.getConnections(peerId) - .find(conn => !conn.transient) - - if (existingConnection != null) { - this.log('had an existing non-transient connection to %p', peerId) - - return existingConnection - } - } - - const connection = await this.dialQueue.dial(peerIdOrMultiaddr, { - ...options, - priority: options.priority ?? DEFAULT_DIAL_PRIORITY - }) - let peerConnections = this.connections.get(connection.remotePeer) - - if (peerConnections == null) { - peerConnections = [] - this.connections.set(connection.remotePeer, peerConnections) - } - - // we get notified of connections via the Upgrader emitting "connection" - // events, double check we aren't already tracking this connection before - // storing it - let trackedConnection = false - - for (const conn of peerConnections) { - if (conn.id === connection.id) { - trackedConnection = true - } - } - - if (!trackedConnection) { - peerConnections.push(connection) - } - - return connection - } - - async closeConnections (peerId: PeerId, options: AbortOptions = {}): Promise { - const connections = this.connections.get(peerId) ?? [] - - await Promise.all( - connections.map(async connection => { - try { - await connection.close(options) - } catch (err: any) { - connection.abort(err) - } - }) - ) - } - - async acceptIncomingConnection (maConn: MultiaddrConnection): Promise { - // check deny list - const denyConnection = this.deny.some(ma => { - return maConn.remoteAddr.toString().startsWith(ma.toString()) - }) - - if (denyConnection) { - this.log('connection from %a refused - connection remote address was in deny list', maConn.remoteAddr) - return false - } - - // check allow list - const allowConnection = this.allow.some(ma => { - return maConn.remoteAddr.toString().startsWith(ma.toString()) - }) - - if (allowConnection) { - this.incomingPendingConnections++ - - return true - } - - // check pending connections - if (this.incomingPendingConnections === this.maxIncomingPendingConnections) { - this.log('connection from %a refused - incomingPendingConnections exceeded by host', maConn.remoteAddr) - return false - } - - if (maConn.remoteAddr.isThinWaistAddress()) { - const host = maConn.remoteAddr.nodeAddress().address - - try { - await this.inboundConnectionRateLimiter.consume(host, 1) - } catch { - this.log('connection from %a refused - inboundConnectionThreshold exceeded by host %s', maConn.remoteAddr, host) - return false - } - } - - if (this.getConnections().length < this.maxConnections) { - this.incomingPendingConnections++ - - return true - } - - this.log('connection from %a refused - maxConnections exceeded', maConn.remoteAddr) - return false - } - - afterUpgradeInbound (): void { - this.incomingPendingConnections-- - } - - getDialQueue (): PendingDial[] { - return this.dialQueue.pendingDials - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/utils.ts deleted file mode 100644 index d32108e26..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection-manager/utils.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { setMaxListeners } from '@libp2p/interface/events' -import { type AbortOptions, multiaddr, type Multiaddr } from '@multiformats/multiaddr' -import { type ClearableSignal, anySignal } from 'any-signal' -import type { LoggerOptions } from '@libp2p/interface' - -/** - * Resolve multiaddr recursively - */ -export async function resolveMultiaddrs (ma: Multiaddr, options: AbortOptions & LoggerOptions): Promise { - // TODO: recursive logic should live in multiaddr once dns4/dns6 support is in place - // Now only supporting resolve for dnsaddr - const resolvableProto = ma.protoNames().includes('dnsaddr') - - // Multiaddr is not resolvable? End recursion! - if (!resolvableProto) { - return [ma] - } - - const resolvedMultiaddrs = await resolveRecord(ma, options) - const recursiveMultiaddrs = await Promise.all(resolvedMultiaddrs.map(async (nm) => { - return resolveMultiaddrs(nm, options) - })) - - const addrs = recursiveMultiaddrs.flat() - const output = addrs.reduce((array, newM) => { - if (array.find(m => m.equals(newM)) == null) { - array.push(newM) - } - return array - }, ([])) - - options.log('resolved %s to', ma, output.map(ma => ma.toString())) - - return output -} - -/** - * Resolve a given multiaddr. If this fails, an empty array will be returned - */ -async function resolveRecord (ma: Multiaddr, options: AbortOptions & LoggerOptions): Promise { - try { - ma = multiaddr(ma.toString()) // Use current multiaddr module - const multiaddrs = await ma.resolve(options) - return multiaddrs - } catch (err) { - options.log.error(`multiaddr ${ma.toString()} could not be resolved`, err) - return [] - } -} - -export function combineSignals (...signals: Array): ClearableSignal { - const sigs: AbortSignal[] = [] - - for (const sig of signals) { - if (sig != null) { - setMaxListeners(Infinity, sig) - sigs.push(sig) - } - } - - // let any signal abort the dial - const signal = anySignal(sigs) - - setMaxListeners(Infinity, signal) - - return signal -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection/index.ts deleted file mode 100644 index bbb248acb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/connection/index.ts +++ /dev/null @@ -1,208 +0,0 @@ -import { symbol } from '@libp2p/interface/connection' -import { CodeError } from '@libp2p/interface/errors' -import { setMaxListeners } from '@libp2p/interface/events' -import type { AbortOptions, Logger, ComponentLogger } from '@libp2p/interface' -import type { Direction, Connection, Stream, ConnectionTimeline, ConnectionStatus, NewStreamOptions } from '@libp2p/interface/connection' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { Multiaddr } from '@multiformats/multiaddr' - -const CLOSE_TIMEOUT = 500 - -interface ConnectionInit { - remoteAddr: Multiaddr - remotePeer: PeerId - newStream(protocols: string[], options?: AbortOptions): Promise - close(options?: AbortOptions): Promise - abort(err: Error): void - getStreams(): Stream[] - status: ConnectionStatus - direction: Direction - timeline: ConnectionTimeline - multiplexer?: string - encryption?: string - transient?: boolean - logger: ComponentLogger -} - -/** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ -export class ConnectionImpl implements Connection { - /** - * Connection identifier. - */ - public readonly id: string - - /** - * Observed multiaddr of the remote peer - */ - public readonly remoteAddr: Multiaddr - - /** - * Remote peer id - */ - public readonly remotePeer: PeerId - - public direction: Direction - public timeline: ConnectionTimeline - public multiplexer?: string - public encryption?: string - public status: ConnectionStatus - public transient: boolean - public readonly log: Logger - - /** - * User provided tags - * - */ - public tags: string[] - - /** - * Reference to the new stream function of the multiplexer - */ - private readonly _newStream: (protocols: string[], options?: NewStreamOptions) => Promise - - /** - * Reference to the close function of the raw connection - */ - private readonly _close: (options?: AbortOptions) => Promise - - private readonly _abort: (err: Error) => void - - /** - * Reference to the getStreams function of the muxer - */ - private readonly _getStreams: () => Stream[] - - /** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ - constructor (init: ConnectionInit) { - const { remoteAddr, remotePeer, newStream, close, abort, getStreams } = init - - this.id = `${(parseInt(String(Math.random() * 1e9))).toString(36)}${Date.now()}` - this.remoteAddr = remoteAddr - this.remotePeer = remotePeer - this.direction = init.direction - this.status = 'open' - this.timeline = init.timeline - this.multiplexer = init.multiplexer - this.encryption = init.encryption - this.transient = init.transient ?? false - this.log = init.logger.forComponent(`libp2p:connection:${this.direction}:${this.id}`) - - if (this.remoteAddr.getPeerId() == null) { - this.remoteAddr = this.remoteAddr.encapsulate(`/p2p/${this.remotePeer}`) - } - - this._newStream = newStream - this._close = close - this._abort = abort - this._getStreams = getStreams - this.tags = [] - } - - readonly [Symbol.toStringTag] = 'Connection' - - readonly [symbol] = true - - /** - * Get all the streams of the muxer - */ - get streams (): Stream[] { - return this._getStreams() - } - - /** - * Create a new stream from this connection - */ - async newStream (protocols: string | string[], options?: NewStreamOptions): Promise { - if (this.status === 'closing') { - throw new CodeError('the connection is being closed', 'ERR_CONNECTION_BEING_CLOSED') - } - - if (this.status === 'closed') { - throw new CodeError('the connection is closed', 'ERR_CONNECTION_CLOSED') - } - - if (!Array.isArray(protocols)) { - protocols = [protocols] - } - - if (this.transient && options?.runOnTransientConnection !== true) { - throw new CodeError('Cannot open protocol stream on transient connection', 'ERR_TRANSIENT_CONNECTION') - } - - const stream = await this._newStream(protocols, options) - - stream.direction = 'outbound' - - return stream - } - - /** - * Close the connection - */ - async close (options: AbortOptions = {}): Promise { - if (this.status === 'closed' || this.status === 'closing') { - return - } - - this.log('closing connection to %a', this.remoteAddr) - - this.status = 'closing' - - if (options.signal == null) { - const signal = AbortSignal.timeout(CLOSE_TIMEOUT) - setMaxListeners(Infinity, signal) - - options = { - ...options, - signal - } - } - - try { - this.log.trace('closing all streams') - - // close all streams gracefully - this can throw if we're not multiplexed - await Promise.all( - this.streams.map(async s => s.close(options)) - ) - - this.log.trace('closing underlying transport') - - // close raw connection - await this._close(options) - - this.log.trace('updating timeline with close time') - - this.status = 'closed' - this.timeline.close = Date.now() - } catch (err: any) { - this.log.error('error encountered during graceful close of connection to %a', this.remoteAddr, err) - this.abort(err) - } - } - - abort (err: Error): void { - this.log.error('aborting connection to %a due to error', this.remoteAddr, err) - - this.status = 'closing' - this.streams.forEach(s => { s.abort(err) }) - - this.log.error('all streams aborted', this.streams.length) - - // Abort raw connection - this._abort(err) - - this.timeline.close = Date.now() - this.status = 'closed' - } -} - -export function createConnection (init: ConnectionInit): Connection { - return new ConnectionImpl(init) -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/content-routing/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/content-routing/index.ts deleted file mode 100644 index a96c2bd9a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/content-routing/index.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import merge from 'it-merge' -import { pipe } from 'it-pipe' -import { codes, messages } from '../errors.js' -import { - storeAddresses, - uniquePeers, - requirePeers -} from './utils.js' -import type { AbortOptions } from '@libp2p/interface' -import type { ContentRouting } from '@libp2p/interface/content-routing' -import type { PeerInfo } from '@libp2p/interface/peer-info' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Startable } from '@libp2p/interface/startable' -import type { CID } from 'multiformats/cid' - -export interface CompoundContentRoutingInit { - routers: ContentRouting[] -} - -export interface CompoundContentRoutingComponents { - peerStore: PeerStore -} - -export class CompoundContentRouting implements ContentRouting, Startable { - private readonly routers: ContentRouting[] - private started: boolean - private readonly components: CompoundContentRoutingComponents - - constructor (components: CompoundContentRoutingComponents, init: CompoundContentRoutingInit) { - this.routers = init.routers ?? [] - this.started = false - this.components = components - } - - isStarted (): boolean { - return this.started - } - - async start (): Promise { - this.started = true - } - - async stop (): Promise { - this.started = false - } - - /** - * Iterates over all content routers in parallel to find providers of the given key - */ - async * findProviders (key: CID, options: AbortOptions = {}): AsyncIterable { - if (this.routers.length === 0) { - throw new CodeError('No content routers available', codes.ERR_NO_ROUTERS_AVAILABLE) - } - - yield * pipe( - merge( - ...this.routers.map(router => router.findProviders(key, options)) - ), - (source) => storeAddresses(source, this.components.peerStore), - (source) => uniquePeers(source), - (source) => requirePeers(source) - ) - } - - /** - * Iterates over all content routers in parallel to notify it is - * a provider of the given key - */ - async provide (key: CID, options: AbortOptions = {}): Promise { - if (this.routers.length === 0) { - throw new CodeError('No content routers available', codes.ERR_NO_ROUTERS_AVAILABLE) - } - - await Promise.all(this.routers.map(async (router) => { await router.provide(key, options) })) - } - - /** - * Store the given key/value pair in the available content routings - */ - async put (key: Uint8Array, value: Uint8Array, options?: AbortOptions): Promise { - if (!this.isStarted()) { - throw new CodeError(messages.NOT_STARTED_YET, codes.DHT_NOT_STARTED) - } - - await Promise.all(this.routers.map(async (router) => { - await router.put(key, value, options) - })) - } - - /** - * Get the value to the given key. - * Times out after 1 minute by default. - */ - async get (key: Uint8Array, options?: AbortOptions): Promise { - if (!this.isStarted()) { - throw new CodeError(messages.NOT_STARTED_YET, codes.DHT_NOT_STARTED) - } - - return Promise.any(this.routers.map(async (router) => { - return router.get(key, options) - })) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/content-routing/utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/content-routing/utils.ts deleted file mode 100644 index f114639c4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/content-routing/utils.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import filter from 'it-filter' -import map from 'it-map' -import type { PeerInfo } from '@libp2p/interface/peer-info' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Source } from 'it-stream-types' - -/** - * Store the multiaddrs from every peer in the passed peer store - */ -export async function * storeAddresses (source: Source, peerStore: PeerStore): AsyncIterable { - yield * map(source, async (peer) => { - // ensure we have the addresses for a given peer - await peerStore.merge(peer.id, { - multiaddrs: peer.multiaddrs - }) - - return peer - }) -} - -/** - * Filter peers by unique peer id - */ -export function uniquePeers (source: Source): AsyncIterable { - /** @type Set */ - const seen = new Set() - - return filter(source, (peer) => { - // dedupe by peer id - if (seen.has(peer.id.toString())) { - return false - } - - seen.add(peer.id.toString()) - - return true - }) -} - -/** - * Require at least `min` peers to be yielded from `source` - */ -export async function * requirePeers (source: Source, min: number = 1): AsyncIterable { - let seen = 0 - - for await (const peer of source) { - seen++ - - yield peer - } - - if (seen < min) { - throw new CodeError(`more peers required, seen: ${seen} min: ${min}`, 'NOT_FOUND') - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/errors.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/errors.ts deleted file mode 100644 index 0b84215aa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/errors.ts +++ /dev/null @@ -1,77 +0,0 @@ -export enum messages { - NOT_STARTED_YET = 'The libp2p node is not started yet', - DHT_DISABLED = 'DHT is not available', - PUBSUB_DISABLED = 'PubSub is not available', - CONN_ENCRYPTION_REQUIRED = 'At least one connection encryption module is required', - ERR_TRANSPORTS_REQUIRED = 'At least one transport module is required', - ERR_PROTECTOR_REQUIRED = 'Private network is enforced, but no protector was provided', - NOT_FOUND = 'Not found' -} - -export enum codes { - DHT_DISABLED = 'ERR_DHT_DISABLED', - ERR_PUBSUB_DISABLED = 'ERR_PUBSUB_DISABLED', - PUBSUB_NOT_STARTED = 'ERR_PUBSUB_NOT_STARTED', - DHT_NOT_STARTED = 'ERR_DHT_NOT_STARTED', - CONN_ENCRYPTION_REQUIRED = 'ERR_CONN_ENCRYPTION_REQUIRED', - ERR_TRANSPORTS_REQUIRED = 'ERR_TRANSPORTS_REQUIRED', - ERR_PROTECTOR_REQUIRED = 'ERR_PROTECTOR_REQUIRED', - ERR_PEER_DIAL_INTERCEPTED = 'ERR_PEER_DIAL_INTERCEPTED', - ERR_CONNECTION_INTERCEPTED = 'ERR_CONNECTION_INTERCEPTED', - ERR_INVALID_PROTOCOLS_FOR_STREAM = 'ERR_INVALID_PROTOCOLS_FOR_STREAM', - ERR_CONNECTION_ENDED = 'ERR_CONNECTION_ENDED', - ERR_CONNECTION_FAILED = 'ERR_CONNECTION_FAILED', - ERR_NODE_NOT_STARTED = 'ERR_NODE_NOT_STARTED', - ERR_ALREADY_ABORTED = 'ERR_ALREADY_ABORTED', - ERR_TOO_MANY_ADDRESSES = 'ERR_TOO_MANY_ADDRESSES', - ERR_NO_VALID_ADDRESSES = 'ERR_NO_VALID_ADDRESSES', - ERR_RELAYED_DIAL = 'ERR_RELAYED_DIAL', - ERR_DIALED_SELF = 'ERR_DIALED_SELF', - ERR_DISCOVERED_SELF = 'ERR_DISCOVERED_SELF', - ERR_DUPLICATE_TRANSPORT = 'ERR_DUPLICATE_TRANSPORT', - ERR_ENCRYPTION_FAILED = 'ERR_ENCRYPTION_FAILED', - ERR_HOP_REQUEST_FAILED = 'ERR_HOP_REQUEST_FAILED', - ERR_INVALID_KEY = 'ERR_INVALID_KEY', - ERR_INVALID_MESSAGE = 'ERR_INVALID_MESSAGE', - ERR_INVALID_PARAMETERS = 'ERR_INVALID_PARAMETERS', - ERR_INVALID_PEER = 'ERR_INVALID_PEER', - ERR_MUXER_UNAVAILABLE = 'ERR_MUXER_UNAVAILABLE', - ERR_NOT_FOUND = 'ERR_NOT_FOUND', - ERR_TRANSPORT_UNAVAILABLE = 'ERR_TRANSPORT_UNAVAILABLE', - ERR_TRANSPORT_DIAL_FAILED = 'ERR_TRANSPORT_DIAL_FAILED', - ERR_UNSUPPORTED_PROTOCOL = 'ERR_UNSUPPORTED_PROTOCOL', - ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED = 'ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED', - ERR_INVALID_MULTIADDR = 'ERR_INVALID_MULTIADDR', - ERR_SIGNATURE_NOT_VALID = 'ERR_SIGNATURE_NOT_VALID', - ERR_FIND_SELF = 'ERR_FIND_SELF', - ERR_NO_ROUTERS_AVAILABLE = 'ERR_NO_ROUTERS_AVAILABLE', - ERR_CONNECTION_NOT_MULTIPLEXED = 'ERR_CONNECTION_NOT_MULTIPLEXED', - ERR_NO_DIAL_TOKENS = 'ERR_NO_DIAL_TOKENS', - ERR_INVALID_CMS = 'ERR_INVALID_CMS', - ERR_MISSING_KEYS = 'ERR_MISSING_KEYS', - ERR_NO_KEY = 'ERR_NO_KEY', - ERR_INVALID_KEY_NAME = 'ERR_INVALID_KEY_NAME', - ERR_INVALID_KEY_TYPE = 'ERR_INVALID_KEY_TYPE', - ERR_KEY_ALREADY_EXISTS = 'ERR_KEY_ALREADY_EXISTS', - ERR_INVALID_KEY_SIZE = 'ERR_INVALID_KEY_SIZE', - ERR_KEY_NOT_FOUND = 'ERR_KEY_NOT_FOUND', - ERR_OLD_KEY_NAME_INVALID = 'ERR_OLD_KEY_NAME_INVALID', - ERR_NEW_KEY_NAME_INVALID = 'ERR_NEW_KEY_NAME_INVALID', - ERR_PASSWORD_REQUIRED = 'ERR_PASSWORD_REQUIRED', - ERR_PEM_REQUIRED = 'ERR_PEM_REQUIRED', - ERR_CANNOT_READ_KEY = 'ERR_CANNOT_READ_KEY', - ERR_MISSING_PRIVATE_KEY = 'ERR_MISSING_PRIVATE_KEY', - ERR_MISSING_PUBLIC_KEY = 'ERR_MISSING_PUBLIC_KEY', - ERR_INVALID_OLD_PASS_TYPE = 'ERR_INVALID_OLD_PASS_TYPE', - ERR_INVALID_NEW_PASS_TYPE = 'ERR_INVALID_NEW_PASS_TYPE', - ERR_INVALID_PASS_LENGTH = 'ERR_INVALID_PASS_LENGTH', - ERR_NOT_IMPLEMENTED = 'ERR_NOT_IMPLEMENTED', - ERR_WRONG_PING_ACK = 'ERR_WRONG_PING_ACK', - ERR_INVALID_RECORD = 'ERR_INVALID_RECORD', - ERR_ALREADY_SUCCEEDED = 'ERR_ALREADY_SUCCEEDED', - ERR_NO_HANDLER_FOR_PROTOCOL = 'ERR_NO_HANDLER_FOR_PROTOCOL', - ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS = 'ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS', - ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS = 'ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS', - ERR_CONNECTION_DENIED = 'ERR_CONNECTION_DENIED', - ERR_TRANSFER_LIMIT_EXCEEDED = 'ERR_TRANSFER_LIMIT_EXCEEDED' -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/get-peer.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/get-peer.ts deleted file mode 100644 index 8503fe7b6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/get-peer.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { isPeerId } from '@libp2p/interface/peer-id' -import { peerIdFromString } from '@libp2p/peer-id' -import { isMultiaddr } from '@multiformats/multiaddr' -import { codes } from './errors.js' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { Multiaddr } from '@multiformats/multiaddr' - -export interface PeerAddress { - peerId?: PeerId - multiaddrs: Multiaddr[] -} - -/** - * Extracts a PeerId and/or multiaddr from the passed PeerId or Multiaddr or an array of Multiaddrs - */ -export function getPeerAddress (peer: PeerId | Multiaddr | Multiaddr[]): PeerAddress { - if (isPeerId(peer)) { - return { peerId: peer, multiaddrs: [] } - } - - if (!Array.isArray(peer)) { - peer = [peer] - } - - let peerId: PeerId | undefined - - if (peer.length > 0) { - const peerIdStr = peer[0].getPeerId() - peerId = peerIdStr == null ? undefined : peerIdFromString(peerIdStr) - - // ensure PeerId is either not set or is consistent - peer.forEach(ma => { - if (!isMultiaddr(ma)) { - throw new CodeError('Invalid Multiaddr', codes.ERR_INVALID_MULTIADDR) - } - - const maPeerIdStr = ma.getPeerId() - - if (maPeerIdStr == null) { - if (peerId != null) { - throw new CodeError('Multiaddrs must all have the same peer id or have no peer id', codes.ERR_INVALID_PARAMETERS) - } - } else { - const maPeerId = peerIdFromString(maPeerIdStr) - - if (peerId == null || !peerId.equals(maPeerId)) { - throw new CodeError('Multiaddrs must all have the same peer id or have no peer id', codes.ERR_INVALID_PARAMETERS) - } - } - }) - } - - return { - peerId, - multiaddrs: peer - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/index.ts deleted file mode 100644 index 2c5fd44d4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/index.ts +++ /dev/null @@ -1,171 +0,0 @@ -/** - * @packageDocumentation - * - * Use the `createLibp2p` function to create a libp2p node. - * - * @example - * - * ```typescript - * import { createLibp2p } from 'libp2p' - * - * const node = await createLibp2p({ - * // ...other options - * }) - * ``` - */ - -import { createLibp2pNode } from './libp2p.js' -import type { AddressManagerInit } from './address-manager/index.js' -import type { Components } from './components.js' -import type { ConnectionManagerInit } from './connection-manager/index.js' -import type { TransportManagerInit } from './transport-manager.js' -import type { Libp2p, ServiceMap, RecursivePartial, ComponentLogger, NodeInfo } from '@libp2p/interface' -import type { ConnectionProtector } from '@libp2p/interface/connection' -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { ContentRouting } from '@libp2p/interface/content-routing' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerDiscovery } from '@libp2p/interface/peer-discovery' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerRouting } from '@libp2p/interface/peer-routing' -import type { StreamMuxerFactory } from '@libp2p/interface/stream-muxer' -import type { Transport } from '@libp2p/interface/transport' -import type { PersistentPeerStoreInit } from '@libp2p/peer-store' -import type { Datastore } from 'interface-datastore' - -export type ServiceFactoryMap = Record> = { - [Property in keyof T]: (components: Components) => T[Property] -} - -/** - * For Libp2p configurations and modules details read the [Configuration Document](./CONFIGURATION.md). - */ -export interface Libp2pInit }> { - /** - * peerId instance (it will be created if not provided) - */ - peerId: PeerId - - /** - * Metadata about the node - implementation name, version number, etc - */ - nodeInfo: NodeInfo - - /** - * Addresses for transport listening and to advertise to the network - */ - addresses: AddressManagerInit - - /** - * libp2p Connection Manager configuration - */ - connectionManager: ConnectionManagerInit - - /** - * A connection gater can deny new connections based on user criteria - */ - connectionGater: ConnectionGater - - /** - * libp2p transport manager configuration - */ - transportManager: TransportManagerInit - - /** - * An optional datastore to persist peer information, DHT records, etc. - * - * An in-memory datastore will be used if one is not provided. - */ - datastore: Datastore - - /** - * libp2p PeerStore configuration - */ - peerStore: PersistentPeerStoreInit - - /** - * An array that must include at least 1 compliant transport - */ - transports: Array<(components: Components) => Transport> - streamMuxers?: Array<(components: Components) => StreamMuxerFactory> - connectionEncryption?: Array<(components: Components) => ConnectionEncrypter> - peerDiscovery?: Array<(components: Components) => PeerDiscovery> - peerRouters?: Array<(components: Components) => PeerRouting> - contentRouters?: Array<(components: Components) => ContentRouting> - - /** - * A Metrics implementation can be supplied to collect metrics on this node - */ - metrics?(components: Components): Metrics - - /** - * A ConnectionProtector can be used to create a secure overlay on top of the network using pre-shared keys - */ - connectionProtector?(components: Components): ConnectionProtector - - /** - * Arbitrary libp2p modules - */ - services: ServiceFactoryMap - - /** - * An optional logging implementation that can be used to write runtime logs. - * - * Set the `DEBUG` env var or the `debug` key on LocalStorage to see logs. - * - * @example - * - * Node.js: - * - * ```console - * $ DEBUG="*libp2p:*" node myscript.js - * ``` - * - * Browsers: - * - * ```javascript - * localStorage.setItem('debug', '*libp2p:*') - * ``` - */ - logger?: ComponentLogger -} - -export type { Libp2p } - -export type Libp2pOptions> = RecursivePartial> & { start?: boolean } - -/** - * Returns a new instance of the Libp2p interface, generating a new PeerId - * if one is not passed as part of the options. - * - * The node will be started unless `start: false` is passed as an option. - * - * @example - * - * ```js - * import { createLibp2p } from 'libp2p' - * import { tcp } from '@libp2p/tcp' - * import { mplex } from '@libp2p/mplex' - * import { noise } from '@chainsafe/libp2p-noise' - * import { yamux } from '@chainsafe/libp2p-yamux' - * - * // specify options - * const options = { - * transports: [tcp()], - * streamMuxers: [yamux(), mplex()], - * connectionEncryption: [noise()] - * } - * - * // create libp2p - * const libp2p = await createLibp2p(options) - * ``` - */ -export async function createLibp2p }> (options: Libp2pOptions): Promise> { - const node = await createLibp2pNode(options) - - if (options.start !== false) { - await node.start() - } - - return node -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/libp2p.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/libp2p.ts deleted file mode 100644 index afe94969d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/libp2p.ts +++ /dev/null @@ -1,401 +0,0 @@ -import { unmarshalPublicKey } from '@libp2p/crypto/keys' -import { type ContentRouting, contentRouting } from '@libp2p/interface/content-routing' -import { CodeError } from '@libp2p/interface/errors' -import { TypedEventEmitter, CustomEvent, setMaxListeners } from '@libp2p/interface/events' -import { peerDiscovery } from '@libp2p/interface/peer-discovery' -import { type PeerRouting, peerRouting } from '@libp2p/interface/peer-routing' -import { defaultLogger } from '@libp2p/logger' -import { PeerSet } from '@libp2p/peer-collections' -import { peerIdFromString } from '@libp2p/peer-id' -import { createEd25519PeerId } from '@libp2p/peer-id-factory' -import { PersistentPeerStore } from '@libp2p/peer-store' -import { isMultiaddr, type Multiaddr } from '@multiformats/multiaddr' -import { MemoryDatastore } from 'datastore-core/memory' -import { concat as uint8ArrayConcat } from 'uint8arrays/concat' -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' -import { DefaultAddressManager } from './address-manager/index.js' -import { defaultComponents } from './components.js' -import { connectionGater } from './config/connection-gater.js' -import { validateConfig } from './config.js' -import { DefaultConnectionManager } from './connection-manager/index.js' -import { CompoundContentRouting } from './content-routing/index.js' -import { codes } from './errors.js' -import { DefaultPeerRouting } from './peer-routing.js' -import { DefaultRegistrar } from './registrar.js' -import { DefaultTransportManager } from './transport-manager.js' -import { DefaultUpgrader } from './upgrader.js' -import * as pkg from './version.js' -import type { Components } from './components.js' -import type { Libp2p, Libp2pInit, Libp2pOptions } from './index.js' -import type { Libp2pEvents, PendingDial, ServiceMap, AbortOptions, ComponentLogger, Logger } from '@libp2p/interface' -import type { Connection, NewStreamOptions, Stream } from '@libp2p/interface/connection' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerInfo } from '@libp2p/interface/peer-info' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Topology } from '@libp2p/interface/topology' -import type { StreamHandler, StreamHandlerOptions } from '@libp2p/interface-internal/registrar' - -export class Libp2pNode> extends TypedEventEmitter implements Libp2p { - public peerId: PeerId - public peerStore: PeerStore - public contentRouting: ContentRouting - public peerRouting: PeerRouting - public metrics?: Metrics - public services: T - public logger: ComponentLogger - - public components: Components - #started: boolean - private readonly log: Logger - - constructor (init: Libp2pInit) { - super() - - // event bus - components can listen to this emitter to be notified of system events - // and also cause them to be emitted - const events = new TypedEventEmitter() - const originalDispatch = events.dispatchEvent.bind(events) - events.dispatchEvent = (evt: any) => { - const internalResult = originalDispatch(evt) - const externalResult = this.dispatchEvent( - new CustomEvent(evt.type, { detail: evt.detail }) - ) - - return internalResult || externalResult - } - - // This emitter gets listened to a lot - setMaxListeners(Infinity, events) - - this.#started = false - this.peerId = init.peerId - this.logger = init.logger ?? defaultLogger() - this.log = this.logger.forComponent('libp2p') - // @ts-expect-error {} may not be of type T - this.services = {} - const components = this.components = defaultComponents({ - peerId: init.peerId, - nodeInfo: init.nodeInfo ?? { - name: pkg.name, - version: pkg.version - }, - logger: this.logger, - events, - datastore: init.datastore ?? new MemoryDatastore(), - connectionGater: connectionGater(init.connectionGater) - }) - - this.peerStore = this.configureComponent('peerStore', new PersistentPeerStore(components, { - addressFilter: this.components.connectionGater.filterMultiaddrForPeer, - ...init.peerStore - })) - - // Create Metrics - if (init.metrics != null) { - this.metrics = this.configureComponent('metrics', init.metrics(this.components)) - } - - components.events.addEventListener('peer:update', evt => { - // if there was no peer previously in the peer store this is a new peer - if (evt.detail.previous == null) { - const peerInfo: PeerInfo = { - id: evt.detail.peer.id, - multiaddrs: evt.detail.peer.addresses.map(a => a.multiaddr) - } - - components.events.safeDispatchEvent('peer:discovery', { detail: peerInfo }) - } - }) - - // Set up connection protector if configured - if (init.connectionProtector != null) { - this.configureComponent('connectionProtector', init.connectionProtector(components)) - } - - // Set up the Upgrader - this.components.upgrader = new DefaultUpgrader(this.components, { - connectionEncryption: (init.connectionEncryption ?? []).map((fn, index) => this.configureComponent(`connection-encryption-${index}`, fn(this.components))), - muxers: (init.streamMuxers ?? []).map((fn, index) => this.configureComponent(`stream-muxers-${index}`, fn(this.components))), - inboundUpgradeTimeout: init.connectionManager.inboundUpgradeTimeout - }) - - // Setup the transport manager - this.configureComponent('transportManager', new DefaultTransportManager(this.components, init.transportManager)) - - // Create the Connection Manager - this.configureComponent('connectionManager', new DefaultConnectionManager(this.components, init.connectionManager)) - - // Create the Registrar - this.configureComponent('registrar', new DefaultRegistrar(this.components)) - - // Addresses {listen, announce, noAnnounce} - this.configureComponent('addressManager', new DefaultAddressManager(this.components, init.addresses)) - - // Peer routers - const peerRouters: PeerRouting[] = (init.peerRouters ?? []).map((fn, index) => this.configureComponent(`peer-router-${index}`, fn(this.components))) - this.peerRouting = this.components.peerRouting = this.configureComponent('peerRouting', new DefaultPeerRouting(this.components, { - routers: peerRouters - })) - - // Content routers - const contentRouters: ContentRouting[] = (init.contentRouters ?? []).map((fn, index) => this.configureComponent(`content-router-${index}`, fn(this.components))) - this.contentRouting = this.components.contentRouting = this.configureComponent('contentRouting', new CompoundContentRouting(this.components, { - routers: contentRouters - })) - - // Discovery modules - ;(init.peerDiscovery ?? []).forEach((fn, index) => { - const service = this.configureComponent(`peer-discovery-${index}`, fn(this.components)) - - service.addEventListener('peer', (evt) => { - this.#onDiscoveryPeer(evt) - }) - }) - - // Transport modules - init.transports.forEach((fn, index) => { - this.components.transportManager.add(this.configureComponent(`transport-${index}`, fn(this.components))) - }) - - // User defined modules - if (init.services != null) { - for (const name of Object.keys(init.services)) { - const createService = init.services[name] - const service: any = createService(this.components) - - if (service == null) { - this.log.error('service factory %s returned null or undefined instance', name) - continue - } - - this.services[name as keyof T] = service - this.configureComponent(name, service) - - if (service[contentRouting] != null) { - this.log('registering service %s for content routing', name) - contentRouters.push(service[contentRouting]) - } - - if (service[peerRouting] != null) { - this.log('registering service %s for peer routing', name) - peerRouters.push(service[peerRouting]) - } - - if (service[peerDiscovery] != null) { - this.log('registering service %s for peer discovery', name) - service[peerDiscovery].addEventListener('peer', (evt: CustomEvent) => { - this.#onDiscoveryPeer(evt) - }) - } - } - } - } - - private configureComponent (name: string, component: T): T { - if (component == null) { - this.log.error('component %s was null or undefined', name) - } - - this.components[name] = component - - return component - } - - /** - * Starts the libp2p node and all its subsystems - */ - async start (): Promise { - if (this.#started) { - return - } - - this.#started = true - - this.log('libp2p is starting') - - try { - await this.components.beforeStart?.() - await this.components.start() - await this.components.afterStart?.() - - this.safeDispatchEvent('start', { detail: this }) - this.log('libp2p has started') - } catch (err: any) { - this.log.error('An error occurred starting libp2p', err) - await this.stop() - throw err - } - } - - /** - * Stop the libp2p node by closing its listeners and open connections - */ - async stop (): Promise { - if (!this.#started) { - return - } - - this.log('libp2p is stopping') - - this.#started = false - - await this.components.beforeStop?.() - await this.components.stop() - await this.components.afterStop?.() - - this.safeDispatchEvent('stop', { detail: this }) - this.log('libp2p has stopped') - } - - isStarted (): boolean { - return this.#started - } - - getConnections (peerId?: PeerId): Connection[] { - return this.components.connectionManager.getConnections(peerId) - } - - getDialQueue (): PendingDial[] { - return this.components.connectionManager.getDialQueue() - } - - getPeers (): PeerId[] { - const peerSet = new PeerSet() - - for (const conn of this.components.connectionManager.getConnections()) { - peerSet.add(conn.remotePeer) - } - - return Array.from(peerSet) - } - - async dial (peer: PeerId | Multiaddr | Multiaddr[], options: AbortOptions = {}): Promise { - return this.components.connectionManager.openConnection(peer, options) - } - - async dialProtocol (peer: PeerId | Multiaddr | Multiaddr[], protocols: string | string[], options: NewStreamOptions = {}): Promise { - if (protocols == null) { - throw new CodeError('no protocols were provided to open a stream', codes.ERR_INVALID_PROTOCOLS_FOR_STREAM) - } - - protocols = Array.isArray(protocols) ? protocols : [protocols] - - if (protocols.length === 0) { - throw new CodeError('no protocols were provided to open a stream', codes.ERR_INVALID_PROTOCOLS_FOR_STREAM) - } - - const connection = await this.dial(peer, options) - - return connection.newStream(protocols, options) - } - - getMultiaddrs (): Multiaddr[] { - return this.components.addressManager.getAddresses() - } - - getProtocols (): string[] { - return this.components.registrar.getProtocols() - } - - async hangUp (peer: PeerId | Multiaddr, options: AbortOptions = {}): Promise { - if (isMultiaddr(peer)) { - peer = peerIdFromString(peer.getPeerId() ?? '') - } - - await this.components.connectionManager.closeConnections(peer, options) - } - - /** - * Get the public key for the given peer id - */ - async getPublicKey (peer: PeerId, options: AbortOptions = {}): Promise { - this.log('getPublicKey %p', peer) - - if (peer.publicKey != null) { - return peer.publicKey - } - - const peerInfo = await this.peerStore.get(peer) - - if (peerInfo.id.publicKey != null) { - return peerInfo.id.publicKey - } - - const peerKey = uint8ArrayConcat([ - uint8ArrayFromString('/pk/'), - peer.multihash.digest - ]) - - // search any available content routing methods - const bytes = await this.contentRouting.get(peerKey, options) - // ensure the returned key is valid - unmarshalPublicKey(bytes) - - await this.peerStore.patch(peer, { - publicKey: bytes - }) - - return bytes - } - - async handle (protocols: string | string[], handler: StreamHandler, options?: StreamHandlerOptions): Promise { - if (!Array.isArray(protocols)) { - protocols = [protocols] - } - - await Promise.all( - protocols.map(async protocol => { - await this.components.registrar.handle(protocol, handler, options) - }) - ) - } - - async unhandle (protocols: string[] | string): Promise { - if (!Array.isArray(protocols)) { - protocols = [protocols] - } - - await Promise.all( - protocols.map(async protocol => { - await this.components.registrar.unhandle(protocol) - }) - ) - } - - async register (protocol: string, topology: Topology): Promise { - return this.components.registrar.register(protocol, topology) - } - - unregister (id: string): void { - this.components.registrar.unregister(id) - } - - /** - * Called whenever peer discovery services emit `peer` events and adds peers - * to the peer store. - */ - #onDiscoveryPeer (evt: CustomEvent): void { - const { detail: peer } = evt - - if (peer.id.toString() === this.peerId.toString()) { - this.log.error(new Error(codes.ERR_DISCOVERED_SELF)) - return - } - - void this.components.peerStore.merge(peer.id, { - multiaddrs: peer.multiaddrs - }) - .catch(err => { this.log.error(err) }) - } -} - -/** - * Returns a new Libp2pNode instance - this exposes more of the internals than the - * libp2p interface and is useful for testing and debugging. - */ -export async function createLibp2pNode > (options: Libp2pOptions): Promise> { - options.peerId ??= await createEd25519PeerId() - - return new Libp2pNode(validateConfig(options)) -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/peer-routing.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/peer-routing.ts deleted file mode 100644 index f5082cab5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/peer-routing.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import filter from 'it-filter' -import first from 'it-first' -import merge from 'it-merge' -import { pipe } from 'it-pipe' -import { - storeAddresses, - uniquePeers, - requirePeers -} from './content-routing/utils.js' -import { codes, messages } from './errors.js' -import type { AbortOptions, Logger } from '@libp2p/interface' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerInfo } from '@libp2p/interface/peer-info' -import type { PeerRouting } from '@libp2p/interface/peer-routing' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { ComponentLogger } from '@libp2p/logger' - -export interface PeerRoutingInit { - routers?: PeerRouting[] -} - -export interface DefaultPeerRoutingComponents { - peerId: PeerId - peerStore: PeerStore - logger: ComponentLogger -} - -export class DefaultPeerRouting implements PeerRouting { - private readonly log: Logger - private readonly peerId: PeerId - private readonly peerStore: PeerStore - private readonly routers: PeerRouting[] - - constructor (components: DefaultPeerRoutingComponents, init: PeerRoutingInit) { - this.log = components.logger.forComponent('libp2p:peer-routing') - this.peerId = components.peerId - this.peerStore = components.peerStore - this.routers = init.routers ?? [] - } - - /** - * Iterates over all peer routers in parallel to find the given peer - */ - async findPeer (id: PeerId, options?: AbortOptions): Promise { - if (this.routers.length === 0) { - throw new CodeError('No peer routers available', codes.ERR_NO_ROUTERS_AVAILABLE) - } - - if (id.toString() === this.peerId.toString()) { - throw new CodeError('Should not try to find self', codes.ERR_FIND_SELF) - } - - const self = this - - const output = await pipe( - merge( - ...this.routers.map(router => (async function * () { - try { - yield await router.findPeer(id, options) - } catch (err) { - self.log.error(err) - } - })()) - ), - (source) => filter(source, Boolean), - (source) => storeAddresses(source, this.peerStore), - async (source) => first(source) - ) - - if (output != null) { - return output - } - - throw new CodeError(messages.NOT_FOUND, codes.ERR_NOT_FOUND) - } - - /** - * Attempt to find the closest peers on the network to the given key - */ - async * getClosestPeers (key: Uint8Array, options?: AbortOptions): AsyncIterable { - if (this.routers.length === 0) { - throw new CodeError('No peer routers available', codes.ERR_NO_ROUTERS_AVAILABLE) - } - - yield * pipe( - merge( - ...this.routers.map(router => router.getClosestPeers(key, options)) - ), - (source) => storeAddresses(source, this.peerStore), - (source) => uniquePeers(source), - (source) => requirePeers(source) - ) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/registrar.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/registrar.ts deleted file mode 100644 index 11d70b05a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/registrar.ts +++ /dev/null @@ -1,234 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import merge from 'merge-options' -import { codes } from './errors.js' -import type { IdentifyResult, Libp2pEvents, Logger, PeerUpdate } from '@libp2p/interface' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Topology } from '@libp2p/interface/topology' -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager' -import type { StreamHandlerOptions, StreamHandlerRecord, Registrar, StreamHandler } from '@libp2p/interface-internal/registrar' -import type { ComponentLogger } from '@libp2p/logger' - -export const DEFAULT_MAX_INBOUND_STREAMS = 32 -export const DEFAULT_MAX_OUTBOUND_STREAMS = 64 - -export interface RegistrarComponents { - peerId: PeerId - connectionManager: ConnectionManager - peerStore: PeerStore - events: TypedEventTarget - logger: ComponentLogger -} - -/** - * Responsible for notifying registered protocols of events in the network. - */ -export class DefaultRegistrar implements Registrar { - private readonly log: Logger - private readonly topologies: Map> - private readonly handlers: Map - private readonly components: RegistrarComponents - - constructor (components: RegistrarComponents) { - this.log = components.logger.forComponent('libp2p:registrar') - this.topologies = new Map() - this.handlers = new Map() - this.components = components - - this._onDisconnect = this._onDisconnect.bind(this) - this._onPeerUpdate = this._onPeerUpdate.bind(this) - this._onPeerIdentify = this._onPeerIdentify.bind(this) - - this.components.events.addEventListener('peer:disconnect', this._onDisconnect) - this.components.events.addEventListener('peer:update', this._onPeerUpdate) - this.components.events.addEventListener('peer:identify', this._onPeerIdentify) - } - - getProtocols (): string[] { - return Array.from(new Set([ - ...this.handlers.keys() - ])).sort() - } - - getHandler (protocol: string): StreamHandlerRecord { - const handler = this.handlers.get(protocol) - - if (handler == null) { - throw new CodeError(`No handler registered for protocol ${protocol}`, codes.ERR_NO_HANDLER_FOR_PROTOCOL) - } - - return handler - } - - getTopologies (protocol: string): Topology[] { - const topologies = this.topologies.get(protocol) - - if (topologies == null) { - return [] - } - - return [ - ...topologies.values() - ] - } - - /** - * Registers the `handler` for each protocol - */ - async handle (protocol: string, handler: StreamHandler, opts?: StreamHandlerOptions): Promise { - if (this.handlers.has(protocol)) { - throw new CodeError(`Handler already registered for protocol ${protocol}`, codes.ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED) - } - - const options = merge.bind({ ignoreUndefined: true })({ - maxInboundStreams: DEFAULT_MAX_INBOUND_STREAMS, - maxOutboundStreams: DEFAULT_MAX_OUTBOUND_STREAMS - }, opts) - - this.handlers.set(protocol, { - handler, - options - }) - - // Add new protocol to self protocols in the peer store - await this.components.peerStore.merge(this.components.peerId, { - protocols: [protocol] - }) - } - - /** - * Removes the handler for each protocol. The protocol - * will no longer be supported on streams. - */ - async unhandle (protocols: string | string[]): Promise { - const protocolList = Array.isArray(protocols) ? protocols : [protocols] - - protocolList.forEach(protocol => { - this.handlers.delete(protocol) - }) - - // Update self protocols in the peer store - await this.components.peerStore.patch(this.components.peerId, { - protocols: this.getProtocols() - }) - } - - /** - * Register handlers for a set of multicodecs given - */ - async register (protocol: string, topology: Topology): Promise { - if (topology == null) { - throw new CodeError('invalid topology', codes.ERR_INVALID_PARAMETERS) - } - - // Create topology - const id = `${(Math.random() * 1e9).toString(36)}${Date.now()}` - - let topologies = this.topologies.get(protocol) - - if (topologies == null) { - topologies = new Map() - this.topologies.set(protocol, topologies) - } - - topologies.set(id, topology) - - return id - } - - /** - * Unregister topology - */ - unregister (id: string): void { - for (const [protocol, topologies] of this.topologies.entries()) { - if (topologies.has(id)) { - topologies.delete(id) - - if (topologies.size === 0) { - this.topologies.delete(protocol) - } - } - } - } - - /** - * Remove a disconnected peer from the record - */ - _onDisconnect (evt: CustomEvent): void { - const remotePeer = evt.detail - - void this.components.peerStore.get(remotePeer) - .then(peer => { - for (const protocol of peer.protocols) { - const topologies = this.topologies.get(protocol) - - if (topologies == null) { - // no topologies are interested in this protocol - continue - } - - for (const topology of topologies.values()) { - topology.onDisconnect?.(remotePeer) - } - } - }) - .catch(err => { - if (err.code === codes.ERR_NOT_FOUND) { - // peer has not completed identify so they are not in the peer store - return - } - - this.log.error('could not inform topologies of disconnecting peer %p', remotePeer, err) - }) - } - - /** - * When a peer is updated, if they have removed supported protocols notify any - * topologies interested in the removed protocols. - */ - _onPeerUpdate (evt: CustomEvent): void { - const { peer, previous } = evt.detail - const removed = (previous?.protocols ?? []).filter(protocol => !peer.protocols.includes(protocol)) - - for (const protocol of removed) { - const topologies = this.topologies.get(protocol) - - if (topologies == null) { - // no topologies are interested in this protocol - continue - } - - for (const topology of topologies.values()) { - topology.onDisconnect?.(peer.id) - } - } - } - - /** - * After identify has completed and we have received the list of supported - * protocols, notify any topologies interested in those protocols. - */ - _onPeerIdentify (evt: CustomEvent): void { - const protocols = evt.detail.protocols - const connection = evt.detail.connection - const peerId = evt.detail.peerId - - for (const protocol of protocols) { - const topologies = this.topologies.get(protocol) - - if (topologies == null) { - // no topologies are interested in this protocol - continue - } - - for (const topology of topologies.values()) { - if (connection.transient && topology.notifyOnTransient !== true) { - continue - } - - topology.onConnect?.(peerId, connection) - } - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/transport-manager.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/transport-manager.ts deleted file mode 100644 index a9b47d5cc..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/transport-manager.ts +++ /dev/null @@ -1,300 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { trackedMap } from '@libp2p/interface/metrics/tracked-map' -import { FaultTolerance } from '@libp2p/interface/transport' -import { codes } from './errors.js' -import type { Libp2pEvents, AbortOptions, ComponentLogger, Logger } from '@libp2p/interface' -import type { Connection } from '@libp2p/interface/connection' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { Metrics } from '@libp2p/interface/metrics' -import type { Startable } from '@libp2p/interface/startable' -import type { Listener, Transport, Upgrader } from '@libp2p/interface/transport' -import type { AddressManager } from '@libp2p/interface-internal/address-manager' -import type { TransportManager } from '@libp2p/interface-internal/transport-manager' -import type { Multiaddr } from '@multiformats/multiaddr' - -export interface TransportManagerInit { - faultTolerance?: FaultTolerance -} - -export interface DefaultTransportManagerComponents { - metrics?: Metrics - addressManager: AddressManager - upgrader: Upgrader - events: TypedEventTarget - logger: ComponentLogger -} - -export class DefaultTransportManager implements TransportManager, Startable { - private readonly log: Logger - private readonly components: DefaultTransportManagerComponents - private readonly transports: Map - private readonly listeners: Map - private readonly faultTolerance: FaultTolerance - private started: boolean - - constructor (components: DefaultTransportManagerComponents, init: TransportManagerInit = {}) { - this.log = components.logger.forComponent('libp2p:transports') - this.components = components - this.started = false - this.transports = new Map() - this.listeners = trackedMap({ - name: 'libp2p_transport_manager_listeners', - metrics: this.components.metrics - }) - this.faultTolerance = init.faultTolerance ?? FaultTolerance.FATAL_ALL - } - - /** - * Adds a `Transport` to the manager - */ - add (transport: Transport): void { - const tag = transport[Symbol.toStringTag] - - if (tag == null) { - throw new CodeError('Transport must have a valid tag', codes.ERR_INVALID_KEY) - } - - if (this.transports.has(tag)) { - throw new CodeError(`There is already a transport with the tag ${tag}`, codes.ERR_DUPLICATE_TRANSPORT) - } - - this.log('adding transport %s', tag) - - this.transports.set(tag, transport) - - if (!this.listeners.has(tag)) { - this.listeners.set(tag, []) - } - } - - isStarted (): boolean { - return this.started - } - - start (): void { - this.started = true - } - - async afterStart (): Promise { - // Listen on the provided transports for the provided addresses - const addrs = this.components.addressManager.getListenAddrs() - - await this.listen(addrs) - } - - /** - * Stops all listeners - */ - async stop (): Promise { - const tasks = [] - for (const [key, listeners] of this.listeners) { - this.log('closing listeners for %s', key) - while (listeners.length > 0) { - const listener = listeners.pop() - - if (listener == null) { - continue - } - - tasks.push(listener.close()) - } - } - - await Promise.all(tasks) - this.log('all listeners closed') - for (const key of this.listeners.keys()) { - this.listeners.set(key, []) - } - - this.started = false - } - - /** - * Dials the given Multiaddr over it's supported transport - */ - async dial (ma: Multiaddr, options?: AbortOptions): Promise { - const transport = this.transportForMultiaddr(ma) - - if (transport == null) { - throw new CodeError(`No transport available for address ${String(ma)}`, codes.ERR_TRANSPORT_UNAVAILABLE) - } - - try { - return await transport.dial(ma, { - ...options, - upgrader: this.components.upgrader - }) - } catch (err: any) { - if (err.code == null) { - err.code = codes.ERR_TRANSPORT_DIAL_FAILED - } - - throw err - } - } - - /** - * Returns all Multiaddr's the listeners are using - */ - getAddrs (): Multiaddr[] { - let addrs: Multiaddr[] = [] - for (const listeners of this.listeners.values()) { - for (const listener of listeners) { - addrs = [...addrs, ...listener.getAddrs()] - } - } - return addrs - } - - /** - * Returns all the transports instances - */ - getTransports (): Transport[] { - return Array.of(...this.transports.values()) - } - - /** - * Returns all the listener instances - */ - getListeners (): Listener[] { - return Array.of(...this.listeners.values()).flat() - } - - /** - * Finds a transport that matches the given Multiaddr - */ - transportForMultiaddr (ma: Multiaddr): Transport | undefined { - for (const transport of this.transports.values()) { - const addrs = transport.filter([ma]) - - if (addrs.length > 0) { - return transport - } - } - } - - /** - * Starts listeners for each listen Multiaddr - */ - async listen (addrs: Multiaddr[]): Promise { - if (!this.isStarted()) { - throw new CodeError('Not started', codes.ERR_NODE_NOT_STARTED) - } - - if (addrs == null || addrs.length === 0) { - this.log('no addresses were provided for listening, this node is dial only') - return - } - - const couldNotListen = [] - - for (const [key, transport] of this.transports.entries()) { - const supportedAddrs = transport.filter(addrs) - const tasks = [] - - // For each supported multiaddr, create a listener - for (const addr of supportedAddrs) { - this.log('creating listener for %s on %a', key, addr) - const listener = transport.createListener({ - upgrader: this.components.upgrader - }) - - let listeners: Listener[] = this.listeners.get(key) ?? [] - - if (listeners == null) { - listeners = [] - this.listeners.set(key, listeners) - } - - listeners.push(listener) - - // Track listen/close events - listener.addEventListener('listening', () => { - this.components.events.safeDispatchEvent('transport:listening', { - detail: listener - }) - }) - listener.addEventListener('close', () => { - const index = listeners.findIndex(l => l === listener) - - // remove the listener - listeners.splice(index, 1) - - this.components.events.safeDispatchEvent('transport:close', { - detail: listener - }) - }) - - // We need to attempt to listen on everything - tasks.push(listener.listen(addr)) - } - - // Keep track of transports we had no addresses for - if (tasks.length === 0) { - couldNotListen.push(key) - continue - } - - const results = await Promise.allSettled(tasks) - // If we are listening on at least 1 address, succeed. - // TODO: we should look at adding a retry (`p-retry`) here to better support - // listening on remote addresses as they may be offline. We could then potentially - // just wait for any (`p-any`) listener to succeed on each transport before returning - const isListening = results.find(r => r.status === 'fulfilled') - if ((isListening == null) && this.faultTolerance !== FaultTolerance.NO_FATAL) { - throw new CodeError(`Transport (${key}) could not listen on any available address`, codes.ERR_NO_VALID_ADDRESSES) - } - } - - // If no transports were able to listen, throw an error. This likely - // means we were given addresses we do not have transports for - if (couldNotListen.length === this.transports.size) { - const message = `no valid addresses were provided for transports [${couldNotListen.join(', ')}]` - if (this.faultTolerance === FaultTolerance.FATAL_ALL) { - throw new CodeError(message, codes.ERR_NO_VALID_ADDRESSES) - } - this.log(`libp2p in dial mode only: ${message}`) - } - } - - /** - * Removes the given transport from the manager. - * If a transport has any running listeners, they will be closed. - */ - async remove (key: string): Promise { - const listeners = this.listeners.get(key) ?? [] - this.log.trace('removing transport %s', key) - - // Close any running listeners - const tasks = [] - this.log.trace('closing listeners for %s', key) - while (listeners.length > 0) { - const listener = listeners.pop() - - if (listener == null) { - continue - } - - tasks.push(listener.close()) - } - await Promise.all(tasks) - - this.transports.delete(key) - this.listeners.delete(key) - } - - /** - * Removes all transports from the manager. - * If any listeners are running, they will be closed. - * - * @async - */ - async removeAll (): Promise { - const tasks = [] - for (const key of this.transports.keys()) { - tasks.push(this.remove(key)) - } - - await Promise.all(tasks) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/upgrader.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/upgrader.ts deleted file mode 100644 index 4310f07c7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/upgrader.ts +++ /dev/null @@ -1,744 +0,0 @@ -import { CodeError, ERR_TIMEOUT } from '@libp2p/interface/errors' -import { setMaxListeners } from '@libp2p/interface/events' -import * as mss from '@libp2p/multistream-select' -import { peerIdFromString } from '@libp2p/peer-id' -import { createConnection } from './connection/index.js' -import { INBOUND_UPGRADE_TIMEOUT } from './connection-manager/constants.js' -import { codes } from './errors.js' -import { DEFAULT_MAX_INBOUND_STREAMS, DEFAULT_MAX_OUTBOUND_STREAMS } from './registrar.js' -import type { Libp2pEvents, AbortOptions, ComponentLogger, Logger } from '@libp2p/interface' -import type { MultiaddrConnection, Connection, Stream, ConnectionProtector, NewStreamOptions } from '@libp2p/interface/connection' -import type { ConnectionEncrypter, SecuredConnection } from '@libp2p/interface/connection-encrypter' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { StreamMuxer, StreamMuxerFactory } from '@libp2p/interface/stream-muxer' -import type { Upgrader, UpgraderOptions } from '@libp2p/interface/transport' -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager' -import type { Registrar } from '@libp2p/interface-internal/registrar' - -const DEFAULT_PROTOCOL_SELECT_TIMEOUT = 30000 - -interface CreateConnectionOptions { - cryptoProtocol: string - direction: 'inbound' | 'outbound' - maConn: MultiaddrConnection - upgradedConn: MultiaddrConnection - remotePeer: PeerId - muxerFactory?: StreamMuxerFactory - transient?: boolean -} - -interface OnStreamOptions { - connection: Connection - stream: Stream - protocol: string -} - -export interface CryptoResult extends SecuredConnection { - protocol: string -} - -export interface UpgraderInit { - connectionEncryption: ConnectionEncrypter[] - muxers: StreamMuxerFactory[] - - /** - * An amount of ms by which an inbound connection upgrade - * must complete - */ - inboundUpgradeTimeout?: number -} - -function findIncomingStreamLimit (protocol: string, registrar: Registrar): number | undefined { - try { - const { options } = registrar.getHandler(protocol) - - return options.maxInboundStreams - } catch (err: any) { - if (err.code !== codes.ERR_NO_HANDLER_FOR_PROTOCOL) { - throw err - } - } - - return DEFAULT_MAX_INBOUND_STREAMS -} - -function findOutgoingStreamLimit (protocol: string, registrar: Registrar, options: NewStreamOptions = {}): number { - try { - const { options } = registrar.getHandler(protocol) - - if (options.maxOutboundStreams != null) { - return options.maxOutboundStreams - } - } catch (err: any) { - if (err.code !== codes.ERR_NO_HANDLER_FOR_PROTOCOL) { - throw err - } - } - - return options.maxOutboundStreams ?? DEFAULT_MAX_OUTBOUND_STREAMS -} - -function countStreams (protocol: string, direction: 'inbound' | 'outbound', connection: Connection): number { - let streamCount = 0 - - connection.streams.forEach(stream => { - if (stream.direction === direction && stream.protocol === protocol) { - streamCount++ - } - }) - - return streamCount -} - -export interface DefaultUpgraderComponents { - peerId: PeerId - metrics?: Metrics - connectionManager: ConnectionManager - connectionGater: ConnectionGater - connectionProtector?: ConnectionProtector - registrar: Registrar - peerStore: PeerStore - events: TypedEventTarget - logger: ComponentLogger -} - -type ConnectionDeniedType = keyof Pick - -export class DefaultUpgrader implements Upgrader { - private readonly components: DefaultUpgraderComponents - private readonly connectionEncryption: Map - private readonly muxers: Map - private readonly inboundUpgradeTimeout: number - private readonly events: TypedEventTarget - private readonly log: Logger - - constructor (components: DefaultUpgraderComponents, init: UpgraderInit) { - this.components = components - this.connectionEncryption = new Map() - this.log = components.logger.forComponent('libp2p:upgrader') - - init.connectionEncryption.forEach(encrypter => { - this.connectionEncryption.set(encrypter.protocol, encrypter) - }) - - this.muxers = new Map() - - init.muxers.forEach(muxer => { - this.muxers.set(muxer.protocol, muxer) - }) - - this.inboundUpgradeTimeout = init.inboundUpgradeTimeout ?? INBOUND_UPGRADE_TIMEOUT - this.events = components.events - } - - async shouldBlockConnection (remotePeer: PeerId, maConn: MultiaddrConnection, connectionType: ConnectionDeniedType): Promise { - const connectionGater = this.components.connectionGater[connectionType] - - if (connectionGater !== undefined) { - if (await connectionGater(remotePeer, maConn)) { - throw new CodeError(`The multiaddr connection is blocked by gater.${connectionType}`, codes.ERR_CONNECTION_INTERCEPTED) - } - } - } - - /** - * Upgrades an inbound connection - */ - async upgradeInbound (maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise { - const accept = await this.components.connectionManager.acceptIncomingConnection(maConn) - - if (!accept) { - throw new CodeError('connection denied', codes.ERR_CONNECTION_DENIED) - } - - let encryptedConn: MultiaddrConnection - let remotePeer - let upgradedConn: MultiaddrConnection - let muxerFactory: StreamMuxerFactory | undefined - let cryptoProtocol - - const signal = AbortSignal.timeout(this.inboundUpgradeTimeout) - - const onAbort = (): void => { - maConn.abort(new CodeError('inbound upgrade timeout', ERR_TIMEOUT)) - } - - signal.addEventListener('abort', onAbort, { once: true }) - - setMaxListeners(Infinity, signal) - - try { - if ((await this.components.connectionGater.denyInboundConnection?.(maConn)) === true) { - throw new CodeError('The multiaddr connection is blocked by gater.acceptConnection', codes.ERR_CONNECTION_INTERCEPTED) - } - - this.components.metrics?.trackMultiaddrConnection(maConn) - - this.log('starting the inbound connection upgrade') - - // Protect - let protectedConn = maConn - - if (opts?.skipProtection !== true) { - const protector = this.components.connectionProtector - - if (protector != null) { - this.log('protecting the inbound connection') - protectedConn = await protector.protect(maConn) - } - } - - try { - // Encrypt the connection - encryptedConn = protectedConn - if (opts?.skipEncryption !== true) { - ({ - conn: encryptedConn, - remotePeer, - protocol: cryptoProtocol - } = await this._encryptInbound(protectedConn)) - - const maConn: MultiaddrConnection = { - ...protectedConn, - ...encryptedConn - } - - await this.shouldBlockConnection(remotePeer, maConn, 'denyInboundEncryptedConnection') - } else { - const idStr = maConn.remoteAddr.getPeerId() - - if (idStr == null) { - throw new CodeError('inbound connection that skipped encryption must have a peer id', codes.ERR_INVALID_MULTIADDR) - } - - const remotePeerId = peerIdFromString(idStr) - - cryptoProtocol = 'native' - remotePeer = remotePeerId - } - - upgradedConn = encryptedConn - if (opts?.muxerFactory != null) { - muxerFactory = opts.muxerFactory - } else if (this.muxers.size > 0) { - // Multiplex the connection - const multiplexed = await this._multiplexInbound({ - ...protectedConn, - ...encryptedConn - }, this.muxers) - muxerFactory = multiplexed.muxerFactory - upgradedConn = multiplexed.stream - } - } catch (err: any) { - this.log.error('Failed to upgrade inbound connection', err) - throw err - } - - await this.shouldBlockConnection(remotePeer, maConn, 'denyInboundUpgradedConnection') - - this.log('successfully upgraded inbound connection') - - return this._createConnection({ - cryptoProtocol, - direction: 'inbound', - maConn, - upgradedConn, - muxerFactory, - remotePeer, - transient: opts?.transient - }) - } finally { - signal.removeEventListener('abort', onAbort) - - this.components.connectionManager.afterUpgradeInbound() - } - } - - /** - * Upgrades an outbound connection - */ - async upgradeOutbound (maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise { - const idStr = maConn.remoteAddr.getPeerId() - let remotePeerId: PeerId | undefined - - if (idStr != null) { - remotePeerId = peerIdFromString(idStr) - - await this.shouldBlockConnection(remotePeerId, maConn, 'denyOutboundConnection') - } - - let encryptedConn: MultiaddrConnection - let remotePeer: PeerId - let upgradedConn: MultiaddrConnection - let cryptoProtocol - let muxerFactory - - this.components.metrics?.trackMultiaddrConnection(maConn) - - this.log('Starting the outbound connection upgrade') - - // If the transport natively supports encryption, skip connection - // protector and encryption - - // Protect - let protectedConn = maConn - if (opts?.skipProtection !== true) { - const protector = this.components.connectionProtector - - if (protector != null) { - protectedConn = await protector.protect(maConn) - } - } - - try { - // Encrypt the connection - encryptedConn = protectedConn - if (opts?.skipEncryption !== true) { - ({ - conn: encryptedConn, - remotePeer, - protocol: cryptoProtocol - } = await this._encryptOutbound(protectedConn, remotePeerId)) - - const maConn: MultiaddrConnection = { - ...protectedConn, - ...encryptedConn - } - - await this.shouldBlockConnection(remotePeer, maConn, 'denyOutboundEncryptedConnection') - } else { - if (remotePeerId == null) { - throw new CodeError('Encryption was skipped but no peer id was passed', codes.ERR_INVALID_PEER) - } - - cryptoProtocol = 'native' - remotePeer = remotePeerId - } - - upgradedConn = encryptedConn - if (opts?.muxerFactory != null) { - muxerFactory = opts.muxerFactory - } else if (this.muxers.size > 0) { - // Multiplex the connection - const multiplexed = await this._multiplexOutbound({ - ...protectedConn, - ...encryptedConn - }, this.muxers) - muxerFactory = multiplexed.muxerFactory - upgradedConn = multiplexed.stream - } - } catch (err: any) { - this.log.error('Failed to upgrade outbound connection', err) - await maConn.close(err) - throw err - } - - await this.shouldBlockConnection(remotePeer, maConn, 'denyOutboundUpgradedConnection') - - this.log('Successfully upgraded outbound connection') - - return this._createConnection({ - cryptoProtocol, - direction: 'outbound', - maConn, - upgradedConn, - muxerFactory, - remotePeer, - transient: opts?.transient - }) - } - - /** - * A convenience method for generating a new `Connection` - */ - _createConnection (opts: CreateConnectionOptions): Connection { - const { - cryptoProtocol, - direction, - maConn, - upgradedConn, - remotePeer, - muxerFactory, - transient - } = opts - - let muxer: StreamMuxer | undefined - let newStream: ((multicodecs: string[], options?: AbortOptions) => Promise) | undefined - let connection: Connection // eslint-disable-line prefer-const - - if (muxerFactory != null) { - // Create the muxer - muxer = muxerFactory.createStreamMuxer({ - direction, - // Run anytime a remote stream is created - onIncomingStream: muxedStream => { - if (connection == null) { - return - } - - void Promise.resolve() - .then(async () => { - const protocols = this.components.registrar.getProtocols() - const { stream, protocol } = await mss.handle(muxedStream, protocols, { - log: muxedStream.log, - yieldBytes: false - }) - - if (connection == null) { - return - } - - connection.log('incoming stream opened on %s', protocol) - - const incomingLimit = findIncomingStreamLimit(protocol, this.components.registrar) - const streamCount = countStreams(protocol, 'inbound', connection) - - if (streamCount === incomingLimit) { - const err = new CodeError(`Too many inbound protocol streams for protocol "${protocol}" - limit ${incomingLimit}`, codes.ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS) - muxedStream.abort(err) - - throw err - } - - // after the handshake the returned stream can have early data so override - // the souce/sink - muxedStream.source = stream.source - muxedStream.sink = stream.sink - muxedStream.protocol = protocol - - // allow closing the write end of a not-yet-negotiated stream - if (stream.closeWrite != null) { - muxedStream.closeWrite = stream.closeWrite - } - - // allow closing the read end of a not-yet-negotiated stream - if (stream.closeRead != null) { - muxedStream.closeRead = stream.closeRead - } - - // make sure we don't try to negotiate a stream we are closing - if (stream.close != null) { - muxedStream.close = stream.close - } - - // If a protocol stream has been successfully negotiated and is to be passed to the application, - // the peerstore should ensure that the peer is registered with that protocol - await this.components.peerStore.merge(remotePeer, { - protocols: [protocol] - }) - - this.components.metrics?.trackProtocolStream(muxedStream, connection) - - this._onStream({ connection, stream: muxedStream, protocol }) - }) - .catch(async err => { - this.log.error('error handling incoming stream id %s', muxedStream.id, err.message, err.code, err.stack) - - if (muxedStream.timeline.close == null) { - await muxedStream.close() - } - }) - } - }) - - newStream = async (protocols: string[], options: NewStreamOptions = {}): Promise => { - if (muxer == null) { - throw new CodeError('Stream is not multiplexed', codes.ERR_MUXER_UNAVAILABLE) - } - - connection.log('starting new stream for protocols %s', protocols) - const muxedStream = await muxer.newStream() - connection.log.trace('started new stream %s for protocols %s', muxedStream.id, protocols) - - try { - if (options.signal == null) { - this.log('No abort signal was passed while trying to negotiate protocols %s falling back to default timeout', protocols) - - const signal = AbortSignal.timeout(DEFAULT_PROTOCOL_SELECT_TIMEOUT) - setMaxListeners(Infinity, signal) - - options = { - ...options, - signal - } - } - - muxedStream.log.trace('selecting protocol from protocols %s', protocols) - - const { - stream, - protocol - } = await mss.select(muxedStream, protocols, { - ...options, - log: muxedStream.log, - yieldBytes: true - }) - - muxedStream.log('selected protocol %s', protocol) - - const outgoingLimit = findOutgoingStreamLimit(protocol, this.components.registrar, options) - const streamCount = countStreams(protocol, 'outbound', connection) - - if (streamCount >= outgoingLimit) { - const err = new CodeError(`Too many outbound protocol streams for protocol "${protocol}" - limit ${outgoingLimit}`, codes.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS) - muxedStream.abort(err) - - throw err - } - - // If a protocol stream has been successfully negotiated and is to be passed to the application, - // the peerstore should ensure that the peer is registered with that protocol - await this.components.peerStore.merge(remotePeer, { - protocols: [protocol] - }) - - // after the handshake the returned stream can have early data so override - // the souce/sink - muxedStream.source = stream.source - muxedStream.sink = stream.sink - muxedStream.protocol = protocol - - // allow closing the write end of a not-yet-negotiated stream - if (stream.closeWrite != null) { - muxedStream.closeWrite = stream.closeWrite - } - - // allow closing the read end of a not-yet-negotiated stream - if (stream.closeRead != null) { - muxedStream.closeRead = stream.closeRead - } - - // make sure we don't try to negotiate a stream we are closing - if (stream.close != null) { - muxedStream.close = stream.close - } - - this.components.metrics?.trackProtocolStream(muxedStream, connection) - - return muxedStream - } catch (err: any) { - connection.log.error('could not create new stream for protocols %s', protocols, err) - - if (muxedStream.timeline.close == null) { - muxedStream.abort(err) - } - - if (err.code != null) { - throw err - } - - throw new CodeError(String(err), codes.ERR_UNSUPPORTED_PROTOCOL) - } - } - - // Pipe all data through the muxer - void Promise.all([ - muxer.sink(upgradedConn.source), - upgradedConn.sink(muxer.source) - ]).catch(err => { - this.log.error(err) - }) - } - - const _timeline = maConn.timeline - maConn.timeline = new Proxy(_timeline, { - set: (...args) => { - if (connection != null && args[1] === 'close' && args[2] != null && _timeline.close == null) { - // Wait for close to finish before notifying of the closure - (async () => { - try { - if (connection.status === 'open') { - await connection.close() - } - } catch (err: any) { - this.log.error(err) - } finally { - this.events.safeDispatchEvent('connection:close', { - detail: connection - }) - } - })().catch(err => { - this.log.error(err) - }) - } - - return Reflect.set(...args) - } - }) - maConn.timeline.upgraded = Date.now() - - const errConnectionNotMultiplexed = (): any => { - throw new CodeError('connection is not multiplexed', codes.ERR_CONNECTION_NOT_MULTIPLEXED) - } - - // Create the connection - connection = createConnection({ - remoteAddr: maConn.remoteAddr, - remotePeer, - status: 'open', - direction, - timeline: maConn.timeline, - multiplexer: muxer?.protocol, - encryption: cryptoProtocol, - transient, - logger: this.components.logger, - newStream: newStream ?? errConnectionNotMultiplexed, - getStreams: () => { if (muxer != null) { return muxer.streams } else { return [] } }, - close: async (options?: AbortOptions) => { - // Ensure remaining streams are closed gracefully - if (muxer != null) { - this.log.trace('close muxer') - await muxer.close(options) - } - - this.log.trace('close maconn') - // close the underlying transport - await maConn.close(options) - this.log.trace('closed maconn') - }, - abort: (err) => { - maConn.abort(err) - // Ensure remaining streams are aborted - if (muxer != null) { - muxer.abort(err) - } - } - }) - - this.events.safeDispatchEvent('connection:open', { - detail: connection - }) - - return connection - } - - /** - * Routes incoming streams to the correct handler - */ - _onStream (opts: OnStreamOptions): void { - const { connection, stream, protocol } = opts - const { handler, options } = this.components.registrar.getHandler(protocol) - - if (connection.transient && options.runOnTransientConnection !== true) { - throw new CodeError('Cannot open protocol stream on transient connection', 'ERR_TRANSIENT_CONNECTION') - } - - handler({ connection, stream }) - } - - /** - * Attempts to encrypt the incoming `connection` with the provided `cryptos` - */ - async _encryptInbound (connection: MultiaddrConnection): Promise { - const protocols = Array.from(this.connectionEncryption.keys()) - this.log('handling inbound crypto protocol selection', protocols) - - try { - const { stream, protocol } = await mss.handle(connection, protocols, { - log: connection.log - }) - const encrypter = this.connectionEncryption.get(protocol) - - if (encrypter == null) { - throw new Error(`no crypto module found for ${protocol}`) - } - - this.log('encrypting inbound connection using', protocol) - - return { - ...await encrypter.secureInbound(this.components.peerId, stream), - protocol - } - } catch (err: any) { - throw new CodeError(String(err), codes.ERR_ENCRYPTION_FAILED) - } - } - - /** - * Attempts to encrypt the given `connection` with the provided connection encrypters. - * The first `ConnectionEncrypter` module to succeed will be used - */ - async _encryptOutbound (connection: MultiaddrConnection, remotePeerId?: PeerId): Promise { - const protocols = Array.from(this.connectionEncryption.keys()) - this.log('selecting outbound crypto protocol', protocols) - - try { - connection.log.trace('selecting encrypter from %s', protocols) - - const { - stream, - protocol - } = await mss.select(connection, protocols, { - log: connection.log, - yieldBytes: true - }) - - const encrypter = this.connectionEncryption.get(protocol) - - if (encrypter == null) { - throw new Error(`no crypto module found for ${protocol}`) - } - - connection.log('encrypting outbound connection to %p using %p', remotePeerId) - - return { - ...await encrypter.secureOutbound(this.components.peerId, stream, remotePeerId), - protocol - } - } catch (err: any) { - throw new CodeError(String(err), codes.ERR_ENCRYPTION_FAILED) - } - } - - /** - * Selects one of the given muxers via multistream-select. That - * muxer will be used for all future streams on the connection. - */ - async _multiplexOutbound (connection: MultiaddrConnection, muxers: Map): Promise<{ stream: MultiaddrConnection, muxerFactory?: StreamMuxerFactory }> { - const protocols = Array.from(muxers.keys()) - this.log('outbound selecting muxer %s', protocols) - try { - connection.log.trace('selecting stream muxer from %s', protocols) - - const { - stream, - protocol - } = await mss.select(connection, protocols, { - log: connection.log, - yieldBytes: true - }) - - connection.log('selected %s as muxer protocol', protocol) - const muxerFactory = muxers.get(protocol) - - return { stream, muxerFactory } - } catch (err: any) { - connection.log.error('error multiplexing outbound stream', err) - throw new CodeError(String(err), codes.ERR_MUXER_UNAVAILABLE) - } - } - - /** - * Registers support for one of the given muxers via multistream-select. The - * selected muxer will be used for all future streams on the connection. - */ - async _multiplexInbound (connection: MultiaddrConnection, muxers: Map): Promise<{ stream: MultiaddrConnection, muxerFactory?: StreamMuxerFactory }> { - const protocols = Array.from(muxers.keys()) - this.log('inbound handling muxers %s', protocols) - try { - const { stream, protocol } = await mss.handle(connection, protocols, { - log: connection.log - }) - const muxerFactory = muxers.get(protocol) - - return { stream, muxerFactory } - } catch (err: any) { - this.log.error('error multiplexing inbound stream', err) - throw new CodeError(String(err), codes.ERR_MUXER_UNAVAILABLE) - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/version.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/version.ts deleted file mode 100644 index 36a3d88e7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/libp2p/src/version.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const version = '0.0.0' -export const name = 'libp2p' diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/index.min.js deleted file mode 100644 index 0beb5085b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/index.min.js +++ /dev/null @@ -1,51 +0,0 @@ -(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.ChainsafeLibp2PNoise = factory()}(typeof self !== 'undefined' ? self : this, function () { -"use strict";var ChainsafeLibp2PNoise=(()=>{var xu=Object.create;var On=Object.defineProperty;var mu=Object.getOwnPropertyDescriptor;var bu=Object.getOwnPropertyNames;var vu=Object.getPrototypeOf,wu=Object.prototype.hasOwnProperty;var ht=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),_t=(t,e)=>{for(var r in e)On(t,r,{get:e[r],enumerable:!0})},ha=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of bu(e))!wu.call(t,i)&&i!==r&&On(t,i,{get:()=>e[i],enumerable:!(n=mu(e,i))||n.enumerable});return t};var zt=(t,e,r)=>(r=t!=null?xu(vu(t)):{},ha(e||!t||!t.__esModule?On(r,"default",{value:t,enumerable:!0}):r,t)),Eu=t=>ha(On({},"__esModule",{value:!0}),t);var xa=ht((og,ga)=>{"use strict";function ya(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function Lu(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return ya(t,r)}catch{r.message=t.message,r.stack=t.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(t)),ya(new i,r)}}ga.exports=Lu});var lt=ht((h2,m0)=>{m0.exports={options:{usePureJavaScript:!1}}});var w0=ht((l2,v0)=>{var ks={};v0.exports=ks;var b0={};ks.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=il(t,e);else{var i=0,s=e.length,o=e.charAt(0),a=[0];for(i=0;i0;)a.push(f%s),f=f/s|0}for(i=0;t[i]===0&&i=0;--i)n+=e[a[i]]}if(r){var u=new RegExp(".{1,"+r+"}","g");n=n.match(u).join(`\r -`)}return n};ks.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=b0[e];if(!r){r=b0[e]=[];for(var n=0;n>=8;for(;f>0;)o.push(f&255),f>>=8}for(var u=0;t[u]===s&&u0;)s.push(a%n),a=a/n|0}var c="";for(r=0;t.at(r)===0&&r=0;--r)c+=e[s[r]];return c}});var Bt=ht((d2,A0)=>{var E0=lt(),S0=w0(),b=A0.exports=E0.util=E0.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){b.nextTick=process.nextTick,typeof setImmediate=="function"?b.setImmediate=setImmediate:b.setImmediate=b.nextTick;return}if(typeof setImmediate=="function"){b.setImmediate=function(){return setImmediate.apply(void 0,arguments)},b.nextTick=function(a){return setImmediate(a)};return}if(b.setImmediate=function(a){setTimeout(a,0)},typeof window<"u"&&typeof window.postMessage=="function"){let a=function(c){if(c.source===window&&c.data===t){c.stopPropagation();var f=e.slice();e.length=0,f.forEach(function(u){u()})}};var o=a,t="forge.setImmediate",e=[];b.setImmediate=function(c){e.push(c),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",a,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,i=document.createElement("div"),e=[];new MutationObserver(function(){var c=e.slice();e.length=0,c.forEach(function(f){f()})}).observe(i,{attributes:!0});var s=b.setImmediate;b.setImmediate=function(c){Date.now()-r>15?(r=Date.now(),s(c)):(e.push(c),e.length===1&&i.setAttribute("a",n=!n))}}b.nextTick=b.setImmediate})();b.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;b.globalScope=function(){return b.isNodejs?globalThis:typeof self>"u"?window:self}();b.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};b.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};b.isArrayBufferView=function(t){return t&&b.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function yn(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}b.ByteBuffer=Ps;function Ps(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(b.isArrayBuffer(t)||b.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;rsl&&(this.data.substr(0,1),this._constructedStringLength=0)};b.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};b.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};b.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};b.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};b.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};b.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(b.encodeUtf8(t))};b.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};b.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};b.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};b.ByteStringBuffer.prototype.putInt=function(t,e){yn(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};b.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};b.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};b.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};b.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};b.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};b.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};b.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};b.ByteStringBuffer.prototype.copy=function(){var t=b.createBuffer(this.data);return t.read=this.read,t};b.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};b.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};b.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};b.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};b.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};b.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};b.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};b.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};b.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};b.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};b.DataBuffer.prototype.putInt=function(t,e){yn(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};b.DataBuffer.prototype.putSignedInt=function(t,e){return yn(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};b.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};b.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};b.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};b.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};b.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};b.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};b.DataBuffer.prototype.copy=function(){return new b.DataBuffer(this)};b.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};b.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};b.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};b.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};b.xorBytes=function(t,e,r){for(var n="",i="",s="",o=0,a=0;r>0;--r,++o)i=t.charCodeAt(o)^e.charCodeAt(o),a>=10&&(n+=s,s="",a=0),s+=String.fromCharCode(i),++a;return n+=s,n};b.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var $e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",We=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],B0="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";b.encode64=function(t,e){for(var r="",n="",i,s,o,a=0;a>2),r+=$e.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=$e.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":$e.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};b.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,i,s,o=0;o>4),i!==64&&(e+=String.fromCharCode((n&15)<<4|i>>2),s!==64&&(e+=String.fromCharCode((i&3)<<6|s)));return e};b.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};b.decodeUtf8=function(t){return decodeURIComponent(escape(t))};b.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:S0.encode,decode:S0.decode}};b.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};b.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s>2),r+=$e.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=$e.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":$e.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};b.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,s,o,a,c=0,f=r;c>4,o!==64&&(n[f++]=(s&15)<<4|o>>2,a!==64&&(n[f++]=(o&3)<<6|a));return e?f-r:n.subarray(0,f)};b.binary.base58.encode=function(t,e){return b.binary.baseN.encode(t,B0,e)};b.binary.base58.decode=function(t,e){return b.binary.baseN.decode(t,B0,e)};b.text={utf8:{},utf16:{}};b.text.utf8.encode=function(t,e,r){t=b.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s"u"&&(r=["web","flash"]);var i,s=!1,o=null;for(var a in r){i=r[a];try{if(i==="flash"||i==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),s=i==="flash"}(i==="web"||i==="both")&&(e[0]=localStorage,n=t.apply(this,e),s=!0)}catch(c){o=c}if(s)break}if(!s)throw o;return n};b.setItem=function(t,e,r,n,i){pi(al,arguments,i)};b.getItem=function(t,e,r,n){return pi(cl,arguments,n)};b.removeItem=function(t,e,r,n){pi(fl,arguments,n)};b.clearItems=function(t,e,r){pi(ul,arguments,r)};b.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};b.format=function(t){for(var e=/%./g,r,n,i=0,s=[],o=0;r=e.exec(t);){n=t.substring(o,e.lastIndex-2),n.length>0&&s.push(n),o=e.lastIndex;var a=r[0][1];switch(a){case"s":case"o":i");break;case"%":s.push("%");break;default:s.push("<%"+a+"?>")}}return s.push(t.substring(o)),s.join("")};b.formatNumber=function(t,e,r,n){var i=t,s=isNaN(e=Math.abs(e))?2:e,o=r===void 0?",":r,a=n===void 0?".":n,c=i<0?"-":"",f=parseInt(i=Math.abs(+i||0).toFixed(s),10)+"",u=f.length>3?f.length%3:0;return c+(u?f.substr(0,u)+a:"")+f.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+a)+(s?o+Math.abs(i-f).toFixed(s).slice(2):"")};b.formatSize=function(t){return t>=1073741824?t=b.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=b.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=b.formatNumber(t/1024,0)+" KiB":t=b.formatNumber(t,0)+" bytes",t};b.bytesFromIP=function(t){return t.indexOf(".")!==-1?b.bytesFromIPv4(t):t.indexOf(":")!==-1?b.bytesFromIPv6(t):null};b.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=b.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1))}e.push(s)}if(r.length>0){var c=r[n];c.end-c.start>0&&(e.splice(c.start,c.end-c.start+1,""),c.start===0&&e.unshift(""),c.end===7&&e.push(""))}return e.join(":")};b.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in b&&!t.update)return e(null,b.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return b.cores=navigator.hardwareConcurrency,e(null,b.cores);if(typeof Worker>"u")return b.cores=1,e(null,b.cores);if(typeof Blob>"u")return b.cores=2,e(null,b.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(o){for(var a=Date.now(),c=a+4;Date.now()g.st&&u.stu.st&&g.st{var gn=lt();gn.pki=gn.pki||{};var Os=C0.exports=gn.pki.oids=gn.oids=gn.oids||{};function k(t,e){Os[t]=e,Os[e]=t}function ft(t,e){Os[t]=e}k("1.2.840.113549.1.1.1","rsaEncryption");k("1.2.840.113549.1.1.4","md5WithRSAEncryption");k("1.2.840.113549.1.1.5","sha1WithRSAEncryption");k("1.2.840.113549.1.1.7","RSAES-OAEP");k("1.2.840.113549.1.1.8","mgf1");k("1.2.840.113549.1.1.9","pSpecified");k("1.2.840.113549.1.1.10","RSASSA-PSS");k("1.2.840.113549.1.1.11","sha256WithRSAEncryption");k("1.2.840.113549.1.1.12","sha384WithRSAEncryption");k("1.2.840.113549.1.1.13","sha512WithRSAEncryption");k("1.3.101.112","EdDSA25519");k("1.2.840.10040.4.3","dsa-with-sha1");k("1.3.14.3.2.7","desCBC");k("1.3.14.3.2.26","sha1");k("1.3.14.3.2.29","sha1WithRSASignature");k("2.16.840.1.101.3.4.2.1","sha256");k("2.16.840.1.101.3.4.2.2","sha384");k("2.16.840.1.101.3.4.2.3","sha512");k("2.16.840.1.101.3.4.2.4","sha224");k("2.16.840.1.101.3.4.2.5","sha512-224");k("2.16.840.1.101.3.4.2.6","sha512-256");k("1.2.840.113549.2.2","md2");k("1.2.840.113549.2.5","md5");k("1.2.840.113549.1.7.1","data");k("1.2.840.113549.1.7.2","signedData");k("1.2.840.113549.1.7.3","envelopedData");k("1.2.840.113549.1.7.4","signedAndEnvelopedData");k("1.2.840.113549.1.7.5","digestedData");k("1.2.840.113549.1.7.6","encryptedData");k("1.2.840.113549.1.9.1","emailAddress");k("1.2.840.113549.1.9.2","unstructuredName");k("1.2.840.113549.1.9.3","contentType");k("1.2.840.113549.1.9.4","messageDigest");k("1.2.840.113549.1.9.5","signingTime");k("1.2.840.113549.1.9.6","counterSignature");k("1.2.840.113549.1.9.7","challengePassword");k("1.2.840.113549.1.9.8","unstructuredAddress");k("1.2.840.113549.1.9.14","extensionRequest");k("1.2.840.113549.1.9.20","friendlyName");k("1.2.840.113549.1.9.21","localKeyId");k("1.2.840.113549.1.9.22.1","x509Certificate");k("1.2.840.113549.1.12.10.1.1","keyBag");k("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");k("1.2.840.113549.1.12.10.1.3","certBag");k("1.2.840.113549.1.12.10.1.4","crlBag");k("1.2.840.113549.1.12.10.1.5","secretBag");k("1.2.840.113549.1.12.10.1.6","safeContentsBag");k("1.2.840.113549.1.5.13","pkcs5PBES2");k("1.2.840.113549.1.5.12","pkcs5PBKDF2");k("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");k("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");k("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");k("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");k("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");k("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");k("1.2.840.113549.2.7","hmacWithSHA1");k("1.2.840.113549.2.8","hmacWithSHA224");k("1.2.840.113549.2.9","hmacWithSHA256");k("1.2.840.113549.2.10","hmacWithSHA384");k("1.2.840.113549.2.11","hmacWithSHA512");k("1.2.840.113549.3.7","des-EDE3-CBC");k("2.16.840.1.101.3.4.1.2","aes128-CBC");k("2.16.840.1.101.3.4.1.22","aes192-CBC");k("2.16.840.1.101.3.4.1.42","aes256-CBC");k("2.5.4.3","commonName");k("2.5.4.4","surname");k("2.5.4.5","serialNumber");k("2.5.4.6","countryName");k("2.5.4.7","localityName");k("2.5.4.8","stateOrProvinceName");k("2.5.4.9","streetAddress");k("2.5.4.10","organizationName");k("2.5.4.11","organizationalUnitName");k("2.5.4.12","title");k("2.5.4.13","description");k("2.5.4.15","businessCategory");k("2.5.4.17","postalCode");k("2.5.4.42","givenName");k("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");k("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");k("2.16.840.1.113730.1.1","nsCertType");k("2.16.840.1.113730.1.13","nsComment");ft("2.5.29.1","authorityKeyIdentifier");ft("2.5.29.2","keyAttributes");ft("2.5.29.3","certificatePolicies");ft("2.5.29.4","keyUsageRestriction");ft("2.5.29.5","policyMapping");ft("2.5.29.6","subtreesConstraint");ft("2.5.29.7","subjectAltName");ft("2.5.29.8","issuerAltName");ft("2.5.29.9","subjectDirectoryAttributes");ft("2.5.29.10","basicConstraints");ft("2.5.29.11","nameConstraints");ft("2.5.29.12","policyConstraints");ft("2.5.29.13","basicConstraints");k("2.5.29.14","subjectKeyIdentifier");k("2.5.29.15","keyUsage");ft("2.5.29.16","privateKeyUsagePeriod");k("2.5.29.17","subjectAltName");k("2.5.29.18","issuerAltName");k("2.5.29.19","basicConstraints");ft("2.5.29.20","cRLNumber");ft("2.5.29.21","cRLReason");ft("2.5.29.22","expirationDate");ft("2.5.29.23","instructionCode");ft("2.5.29.24","invalidityDate");ft("2.5.29.25","cRLDistributionPoints");ft("2.5.29.26","issuingDistributionPoint");ft("2.5.29.27","deltaCRLIndicator");ft("2.5.29.28","issuingDistributionPoint");ft("2.5.29.29","certificateIssuer");ft("2.5.29.30","nameConstraints");k("2.5.29.31","cRLDistributionPoints");k("2.5.29.32","certificatePolicies");ft("2.5.29.33","policyMappings");ft("2.5.29.34","policyConstraints");k("2.5.29.35","authorityKeyIdentifier");ft("2.5.29.36","policyConstraints");k("2.5.29.37","extKeyUsage");ft("2.5.29.46","freshestCRL");ft("2.5.29.54","inhibitAnyPolicy");k("1.3.6.1.4.1.11129.2.4.2","timestampList");k("1.3.6.1.5.5.7.1.1","authorityInfoAccess");k("1.3.6.1.5.5.7.3.1","serverAuth");k("1.3.6.1.5.5.7.3.2","clientAuth");k("1.3.6.1.5.5.7.3.3","codeSigning");k("1.3.6.1.5.5.7.3.4","emailProtection");k("1.3.6.1.5.5.7.3.8","timeStamping")});var mn=ht((y2,T0)=>{var xt=lt();Bt();yi();var F=T0.exports=xt.asn1=xt.asn1||{};F.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};F.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};F.create=function(t,e,r,n,i){if(xt.util.isArray(n)){for(var s=[],o=0;oe){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}var hl=function(t,e){var r=t.getByte();if(e--,r!==128){var n,i=r&128;if(!i)n=r;else{var s=r&127;xn(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}};F.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof t=="string"&&(t=xt.util.createBuffer(t));var r=t.length(),n=gi(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=r,i.remaining=t.length(),i}return n};function gi(t,e,r,n){var i;xn(t,e,2);var s=t.getByte();e--;var o=s&192,a=s&31;i=t.length();var c=hl(t,e);if(e-=i-t.length(),c!==void 0&&c>e){if(n.strict){var f=new Error("Too few bytes to read ASN.1 value.");throw f.available=t.length(),f.remaining=e,f.requested=c,f}c=e}var u,h,l=(s&32)===32;if(l)if(u=[],c===void 0)for(;;){if(xn(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}i=t.length(),u.push(gi(t,e,r+1,n)),e-=i-t.length()}else for(;c>0;)i=t.length(),u.push(gi(t,c,r+1,n)),e-=i-t.length(),c-=i-t.length();if(u===void 0&&o===F.Class.UNIVERSAL&&a===F.Type.BITSTRING&&(h=t.bytes(c)),u===void 0&&n.decodeBitStrings&&o===F.Class.UNIVERSAL&&a===F.Type.BITSTRING&&c>1){var g=t.read,d=e,p=0;if(a===F.Type.BITSTRING&&(xn(t,e,1),p=t.getByte(),e--),p===0)try{i=t.length();var y={strict:!0,decodeBitStrings:!0},x=gi(t,e,r+1,y),v=i-t.length();e-=v,a==F.Type.BITSTRING&&v++;var m=x.tagClass;v===c&&(m===F.Class.UNIVERSAL||m===F.Class.CONTEXT_SPECIFIC)&&(u=[x])}catch{}u===void 0&&(t.read=g,e=d)}if(u===void 0){if(c===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=e}if(a===F.Type.BMPSTRING)for(u="";c>0;c-=2)xn(t,e,2),u+=String.fromCharCode(t.getInt16()),e-=2;else u=t.getBytes(c),e-=c}var A=h===void 0?null:{bitStringContents:h};return F.create(o,a,l,u,A)}F.toDer=function(t){var e=xt.util.createBuffer(),r=t.tagClass|t.type,n=xt.util.createBuffer(),i=!1;if("bitStringContents"in t&&(i=!0,t.original&&(i=F.equals(t,t.original))),i)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var s=0;s1&&(t.value.charCodeAt(0)===0&&!(t.value.charCodeAt(1)&128)||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var o=n.length(),a="";do a+=String.fromCharCode(o&255),o=o>>>8;while(o>0);e.putByte(a.length|128);for(var s=a.length-1;s>=0;--s)e.putByte(a.charCodeAt(s))}return e.putBuffer(n),e};F.oidToDer=function(t){var e=t.split("."),r=xt.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,i,s,o,a=2;a>>7,n||(o|=128),i.push(o),n=!1;while(s>0);for(var c=i.length-1;c>=0;--c)r.putByte(i[c])}return r};F.derToOid=function(t){var e;typeof t=="string"&&(t=xt.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;)r=t.getByte(),n=n<<7,r&128?n+=r&127:(e+="."+(n+r),n=0);return e};F.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),s=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=0;if(t.length>11){var c=t.charAt(10),f=10;c!=="+"&&c!=="-"&&(a=parseInt(t.substr(10,2),10),f+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,0),f&&(c=t.charAt(f),c==="+"||c==="-")){var u=parseInt(t.substr(f+1,2),10),h=parseInt(t.substr(f+4,2),10),l=u*60+h;l*=6e4,c==="+"?e.setTime(+e-l):e.setTime(+e+l)}return e};F.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),o=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),c=0,f=0,u=!1;t.charAt(t.length-1)==="Z"&&(u=!0);var h=t.length-5,l=t.charAt(h);if(l==="+"||l==="-"){var g=parseInt(t.substr(h+1,2),10),d=parseInt(t.substr(h+4,2),10);f=g*60+d,f*=6e4,l==="+"&&(f*=-1),u=!0}return t.charAt(14)==="."&&(c=parseFloat(t.substr(14),10)*1e3),u?(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,c),e.setTime(+e+f)):(e.setFullYear(r,n,i),e.setHours(s,o,a,c)),e};F.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};F.derToInteger=function(t){typeof t=="string"&&(t=xt.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};F.validate=function(t,e,r,n){var i=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(i=!0,e.value&&xt.util.isArray(e.value))for(var s=0,o=0;i&&o0&&(n+=` -`);for(var i="",s=0;s1?n+="0x"+xt.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var f=t.value.charCodeAt(0);f==1?n+=" (1 unused bit shown)":f>1&&(n+=" ("+f+" unused bits shown)")}}else if(t.type===F.Type.OCTETSTRING)I0.test(t.value)||(n+="("+t.value+") "),n+="0x"+xt.util.bytesToHex(t.value);else if(t.type===F.Type.UTF8)try{n+=xt.util.decodeUtf8(t.value)}catch(u){if(u.message==="URI malformed")n+="0x"+xt.util.bytesToHex(t.value)+" (malformed UTF8)";else throw u}else t.type===F.Type.PRINTABLESTRING||t.type===F.Type.IA5String?n+=t.value:I0.test(t.value)?n+="0x"+xt.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var Fs=ht((g2,_0)=>{var Nt=lt();Bt();_0.exports=Nt.cipher=Nt.cipher||{};Nt.cipher.algorithms=Nt.cipher.algorithms||{};Nt.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Nt.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Nt.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};Nt.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Nt.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Nt.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};Nt.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),Nt.cipher.algorithms[t]=e};Nt.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in Nt.cipher.algorithms?Nt.cipher.algorithms[t]:null};var Ms=Nt.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};Ms.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=Nt.util.createBuffer(),this.output=t.output||Nt.util.createBuffer(),this.mode.start(e)};Ms.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Ms.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var Hs=ht((x2,L0)=>{var Dt=lt();Bt();Dt.cipher=Dt.cipher||{};var nt=L0.exports=Dt.cipher.modes=Dt.cipher.modes||{};nt.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};nt.ecb.prototype.start=function(t){};nt.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};nt.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};nt.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=xi(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};nt.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};nt.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=xi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=xi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.ofb.prototype.decrypt=nt.ofb.prototype.encrypt;nt.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=xi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}mi(this._inBlock)};nt.ctr.prototype.decrypt=nt.ctr.prototype.encrypt;nt.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0,this._R=3774873600};nt.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=Dt.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=Dt.util.createBuffer(t.additionalData):r=Dt.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=Dt.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(Vs(n*8)))}this._inBlock=this._j0.slice(0),mi(this._inBlock),this._partialBytes=0,r=Dt.util.createBuffer(r),this._aDataLength=Vs(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};nt.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),mi(this._inBlock)};nt.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),mi(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};nt.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=t[n]>>>(7-r%8)*4&15,s=this._m[r][i];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};nt.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};nt.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,s=new Array(i),o=0;o>>1,i=new Array(r);i[n]=t.slice(0);for(var s=n>>>1;s>0;)this.pow(i[2*s],i[s]=[]),s>>=1;for(s=2;s4){var r=t;t=Dt.util.createBuffer();for(var n=0;n{var pt=lt();Fs();Hs();Bt();k0.exports=pt.aes=pt.aes||{};pt.aes.startEncrypting=function(t,e,r,n){var i=bi({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i};pt.aes.createEncryptionCipher=function(t,e){return bi({key:t,output:null,decrypt:!1,mode:e})};pt.aes.startDecrypting=function(t,e,r,n){var i=bi({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i};pt.aes.createDecryptionCipher=function(t,e){return bi({key:t,output:null,decrypt:!0,mode:e})};pt.aes.Algorithm=function(t,e){Gs||N0();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(n,i){return zs(r._w,n,i,!1)},decrypt:function(n,i){return zs(r._w,n,i,!0)}}}),r._init=!1};pt.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=pt.util.createBuffer(e);else if(pt.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=pt.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^a&255^99,$t[r]=a,qs[a]=r,c=t[a],i=t[r],s=t[i],o=t[s],f=c<<24^a<<16^a<<8^(a^c),u=(i^s^o)<<24^(r^o)<<16^(r^s^o)<<8^(r^i^o);for(var h=0;h<4;++h)ar[h][r]=f,ue[h][a]=u,f=f<<24|f>>>8,u=u<<24|u>>>8;r===0?r=n=1:(r=i^t[t[t[i^o]]],n^=t[t[n]])}}function D0(t,e){for(var r=t.slice(0),n,i=1,s=r.length,o=s+6+1,a=kr*o,c=s;c>>16&255]<<24^$t[n>>>8&255]<<16^$t[n&255]<<8^$t[n>>>24]^R0[i]<<24,i++):s>6&&c%s===4&&(n=$t[n>>>24]<<24^$t[n>>>16&255]<<16^$t[n>>>8&255]<<8^$t[n&255]),r[c]=r[c-s]^n;if(e){var f,u=ue[0],h=ue[1],l=ue[2],g=ue[3],d=r.slice(0);a=r.length;for(var c=0,p=a-kr;c>>24]]^h[$t[f>>>16&255]]^l[$t[f>>>8&255]]^g[$t[f&255]];r=d}return r}function zs(t,e,r,n){var i=t.length/4-1,s,o,a,c,f;n?(s=ue[0],o=ue[1],a=ue[2],c=ue[3],f=qs):(s=ar[0],o=ar[1],a=ar[2],c=ar[3],f=$t);var u,h,l,g,d,p,y;u=e[0]^t[0],h=e[n?3:1]^t[1],l=e[2]^t[2],g=e[n?1:3]^t[3];for(var x=3,v=1;v>>24]^o[h>>>16&255]^a[l>>>8&255]^c[g&255]^t[++x],p=s[h>>>24]^o[l>>>16&255]^a[g>>>8&255]^c[u&255]^t[++x],y=s[l>>>24]^o[g>>>16&255]^a[u>>>8&255]^c[h&255]^t[++x],g=s[g>>>24]^o[u>>>16&255]^a[h>>>8&255]^c[l&255]^t[++x],u=d,h=p,l=y;r[0]=f[u>>>24]<<24^f[h>>>16&255]<<16^f[l>>>8&255]<<8^f[g&255]^t[++x],r[n?3:1]=f[h>>>24]<<24^f[l>>>16&255]<<16^f[g>>>8&255]<<8^f[u&255]^t[++x],r[2]=f[l>>>24]<<24^f[g>>>16&255]<<16^f[u>>>8&255]<<8^f[h&255]^t[++x],r[n?1:3]=f[g>>>24]<<24^f[u>>>16&255]<<16^f[h>>>8&255]<<8^f[l&255]^t[++x]}function bi(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=pt.cipher.createDecipher(r,t.key):n=pt.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof pt.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var K0=ht((b2,U0)=>{var vt=lt();Fs();Hs();Bt();U0.exports=vt.des=vt.des||{};vt.des.startEncrypting=function(t,e,r,n){var i=vi({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};vt.des.createEncryptionCipher=function(t,e){return vi({key:t,output:null,decrypt:!1,mode:e})};vt.des.startDecrypting=function(t,e,r,n){var i=vi({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};vt.des.createDecryptionCipher=function(t,e){return vi({key:t,output:null,decrypt:!0,mode:e})};vt.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(n,i){return P0(r._keys,n,i,!1)},decrypt:function(n,i){return P0(r._keys,n,i,!0)}}}),r._init=!1};vt.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=vt.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=vl(e),this._init=!0}};pe("DES-ECB",vt.cipher.modes.ecb);pe("DES-CBC",vt.cipher.modes.cbc);pe("DES-CFB",vt.cipher.modes.cfb);pe("DES-OFB",vt.cipher.modes.ofb);pe("DES-CTR",vt.cipher.modes.ctr);pe("3DES-ECB",vt.cipher.modes.ecb);pe("3DES-CBC",vt.cipher.modes.cbc);pe("3DES-CFB",vt.cipher.modes.cfb);pe("3DES-OFB",vt.cipher.modes.ofb);pe("3DES-CTR",vt.cipher.modes.ctr);function pe(t,e){var r=function(){return new vt.des.Algorithm(t,e)};vt.cipher.registerAlgorithm(t,r)}var ll=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],dl=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],pl=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],yl=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],gl=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],xl=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],ml=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],bl=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function vl(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],a=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],l=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],d=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],p=t.length()>8?3:1,y=[],x=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,m,A=0;A>>4^B)&252645135,B^=m,S^=m<<4,m=(B>>>-16^S)&65535,S^=m,B^=m<<-16,m=(S>>>2^B)&858993459,B^=m,S^=m<<2,m=(B>>>-16^S)&65535,S^=m,B^=m<<-16,m=(S>>>1^B)&1431655765,B^=m,S^=m<<1,m=(B>>>8^S)&16711935,S^=m,B^=m<<8,m=(S>>>1^B)&1431655765,B^=m,S^=m<<1,m=S<<8|B>>>20&240,S=B<<24|B<<8&16711680|B>>>8&65280|B>>>24&240,B=m;for(var R=0;R>>26,B=B<<2|B>>>26):(S=S<<1|S>>>27,B=B<<1|B>>>27),S&=-15,B&=-15;var _=e[S>>>28]|r[S>>>24&15]|n[S>>>20&15]|i[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|a[S>>>4&15],O=c[B>>>28]|f[B>>>24&15]|u[B>>>20&15]|h[B>>>16&15]|l[B>>>12&15]|g[B>>>8&15]|d[B>>>4&15];m=(O>>>16^_)&65535,y[v++]=_^m,y[v++]=O^m<<16}}return y}function P0(t,e,r,n){var i=t.length===32?3:9,s;i===3?s=n?[30,-2,-2]:[0,32,2]:s=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,a=e[0],c=e[1];o=(a>>>4^c)&252645135,c^=o,a^=o<<4,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,a=a<<1|a>>>31,c=c<<1|c>>>31;for(var f=0;f>>4|c<<28)^t[l+1];o=a,a=c,c=o^(dl[g>>>24&63]|yl[g>>>16&63]|xl[g>>>8&63]|bl[g&63]|ll[d>>>24&63]|pl[d>>>16&63]|gl[d>>>8&63]|ml[d&63])}o=a,a=c,c=o}a=a>>>1|a<<31,c=c>>>1|c<<31,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(a>>>4^c)&252645135,c^=o,a^=o<<4,r[0]=a,r[1]=c}function vi(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=vt.cipher.createDecipher(r,t.key):n=vt.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof vt.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var cr=ht((v2,O0)=>{var wi=lt();O0.exports=wi.md=wi.md||{};wi.md.algorithms=wi.md.algorithms||{}});var F0=ht((w2,M0)=>{var Re=lt();cr();Bt();var wl=M0.exports=Re.hmac=Re.hmac||{};wl.create=function(){var t=null,e=null,r=null,n=null,i={};return i.start=function(s,o){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in Re.md.algorithms)e=Re.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else e=s;if(o===null)o=t;else{if(typeof o=="string")o=Re.util.createBuffer(o);else if(Re.util.isArray(o)){var a=o;o=Re.util.createBuffer();for(var c=0;ce.blockLength&&(e.start(),e.update(o.bytes()),o=e.digest()),r=Re.util.createBuffer(),n=Re.util.createBuffer(),f=o.length();for(var c=0;c{});var H0=ht((B2,V0)=>{var Wt=lt();F0();cr();Bt();var El=Wt.pkcs5=Wt.pkcs5||{},Ne;Wt.util.isNodejs&&!Wt.options.usePureJavaScript&&(Ne=Ei());V0.exports=Wt.pbkdf2=El.pbkdf2=function(t,e,r,n,i,s){if(typeof i=="function"&&(s=i,i=null),Wt.util.isNodejs&&!Wt.options.usePureJavaScript&&Ne.pbkdf2&&(i===null||typeof i!="object")&&(Ne.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?Ne.pbkdf2Sync.length===4?Ne.pbkdf2(t,e,r,n,function(m,A){if(m)return s(m);s(null,A.toString("binary"))}):Ne.pbkdf2(t,e,r,n,i,function(m,A){if(m)return s(m);s(null,A.toString("binary"))}):Ne.pbkdf2Sync.length===4?Ne.pbkdf2Sync(t,e,r,n).toString("binary"):Ne.pbkdf2Sync(t,e,r,n,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in Wt.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=Wt.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var a=new Error("Derived key is too long.");if(s)return s(a);throw a}var c=Math.ceil(n/o),f=n-(c-1)*o,u=Wt.hmac.create();u.start(i,t);var h="",l,g,d;if(!s){for(var p=1;p<=c;++p){u.start(null,null),u.update(e),u.update(Wt.util.int32ToBytes(p)),l=d=u.digest().getBytes();for(var y=2;y<=r;++y)u.start(null,null),u.update(d),g=u.digest().getBytes(),l=Wt.util.xorBytes(l,g,o),d=g;h+=pc)return s(null,h);u.start(null,null),u.update(e),u.update(Wt.util.int32ToBytes(p)),l=d=u.digest().getBytes(),y=2,v()}function v(){if(y<=r)return u.start(null,null),u.update(d),g=u.digest().getBytes(),l=Wt.util.xorBytes(l,g,o),d=g,++y,Wt.util.setImmediate(v);h+=p{var Bi=lt();Bt();var q0=z0.exports=Bi.pem=Bi.pem||{};q0.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r -`,n;if(t.procType&&(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=Si(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=Si(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=Si(n)),t.headers)for(var i=0;i65&&o!==-1){var a=e[o];a===","?(++o,e=e.substr(0,o)+`\r - `+e.substr(o)):e=e.substr(0,o)+`\r -`+a+e.substr(o+1),s=i-o-1,o=-1,++i}else(e[i]===" "||e[i]===" "||e[i]===",")&&(o=i);return e}function Sl(t){return t.replace(/^\s+/,"")}});var Q0=ht((C2,X0)=>{var ye=lt();cr();Bt();var W0=X0.exports=ye.sha256=ye.sha256||{};ye.md.sha256=ye.md.algorithms.sha256=W0;W0.create=function(){Y0||Bl();var t=null,e=ye.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),$0(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=ye.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(Ws.substr(0,n.blockLength-o));for(var a,c,f=n.fullMessageLength[0]*8,u=0;u>>0,f+=c,i.putInt32(f>>>0),f=a>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};$0(h,r,i);var l=ye.util.createBuffer();return l.putInt32(h.h0),l.putInt32(h.h1),l.putInt32(h.h2),l.putInt32(h.h3),l.putInt32(h.h4),l.putInt32(h.h5),l.putInt32(h.h6),l.putInt32(h.h7),l},n};var Ws=null,Y0=!1,Z0=null;function Bl(){Ws="\x80",Ws+=ye.util.fillString("\0",64),Z0=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Y0=!0}function $0(t,e,r){for(var n,i,s,o,a,c,f,u,h,l,g,d,p,y,x,v=r.length();v>=64;){for(f=0;f<16;++f)e[f]=r.getInt32();for(;f<64;++f)n=e[f-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=e[f-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[f]=n+e[f-7]+i+e[f-16]|0;for(u=t.h0,h=t.h1,l=t.h2,g=t.h3,d=t.h4,p=t.h5,y=t.h6,x=t.h7,f=0;f<64;++f)o=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),a=y^d&(p^y),s=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),c=u&h|l&(u^h),n=x+o+a+Z0[f]+e[f],i=s+c,x=y,y=p,p=d,d=g+n>>>0,g=l,l=h,h=u,u=n+i>>>0;t.h0=t.h0+u|0,t.h1=t.h1+h|0,t.h2=t.h2+l|0,t.h3=t.h3+g|0,t.h4=t.h4+d|0,t.h5=t.h5+p|0,t.h6=t.h6+y|0,t.h7=t.h7+x|0,v-=64}}});var j0=ht((I2,J0)=>{var ge=lt();Bt();var Ai=null;ge.util.isNodejs&&!ge.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Ai=Ei());var Al=J0.exports=ge.prng=ge.prng||{};Al.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();e.pools=n,e.pool=0,e.generate=function(f,u){if(!u)return e.generateSync(f);var h=e.plugin.cipher,l=e.plugin.increment,g=e.plugin.formatKey,d=e.plugin.formatSeed,p=ge.util.createBuffer();e.key=null,y();function y(x){if(x)return u(x);if(p.length()>=f)return u(null,p.getBytes(f));if(e.generated>1048575&&(e.key=null),e.key===null)return ge.util.nextTick(function(){s(y)});var v=h(e.key,e.seed);e.generated+=v.length,p.putBytes(v),e.key=g(h(e.key,l(e.seed))),e.seed=d(h(e.key,e.seed)),ge.util.setImmediate(y)}},e.generateSync=function(f){var u=e.plugin.cipher,h=e.plugin.increment,l=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var d=ge.util.createBuffer();d.length()1048575&&(e.key=null),e.key===null&&o();var p=u(e.key,e.seed);e.generated+=p.length,d.putBytes(p),e.key=l(u(e.key,h(e.seed))),e.seed=g(u(e.key,e.seed))}return d.getBytes(f)};function s(f){if(e.pools[0].messageLength>=32)return a(),f();var u=32-e.pools[0].messageLength<<5;e.seedFile(u,function(h,l){if(h)return f(h);e.collect(l),a(),f()})}function o(){if(e.pools[0].messageLength>=32)return a();var f=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(f)),a()}function a(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var f=e.plugin.md.create();f.update(e.keyBytes);for(var u=1,h=0;h<32;++h)e.reseeds%u===0&&(f.update(e.pools[h].digest().getBytes()),e.pools[h].start()),u=u<<1;e.keyBytes=f.digest().getBytes(),f.start(),f.update(e.keyBytes);var l=f.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(l),e.generated=0}function c(f){var u=null,h=ge.util.globalScope,l=h.crypto||h.msCrypto;l&&l.getRandomValues&&(u=function(S){return l.getRandomValues(S)});var g=ge.util.createBuffer();if(u)for(;g.length()>16),v+=(x&32767)<<16,v+=x>>15,v=(v&2147483647)+(v>>31),A=v&4294967295;for(var y=0;y<3;++y)m=A>>>(y<<3),m^=Math.floor(Math.random()*256),g.putByte(m&255)}return g.getBytes(f)}return Ai?(e.seedFile=function(f,u){Ai.randomBytes(f,function(h,l){if(h)return u(h);u(null,l.toString())})},e.seedFileSync=function(f){return Ai.randomBytes(f).toString()}):(e.seedFile=function(f,u){try{u(null,c(f))}catch(h){u(h)}},e.seedFileSync=c),e.collect=function(f){for(var u=f.length,h=0;h>l&255);e.collect(h)},e.registerWorker=function(f){if(f===self)e.seedFile=function(h,l){function g(d){var p=d.data;p.forge&&p.forge.prng&&(self.removeEventListener("message",g),l(p.forge.prng.err,p.forge.prng.bytes))}self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:h}}})};else{var u=function(h){var l=h.data;l.forge&&l.forge.prng&&e.seedFile(l.forge.prng.needed,function(g,d){f.postMessage({forge:{prng:{err:g,bytes:d}}})})};f.addEventListener("message",u)}},e}});var bn=ht((T2,Ys)=>{var kt=lt();$s();Q0();j0();Bt();(function(){if(kt.random&&kt.random.getBytes){Ys.exports=kt.random;return}(function(t){var e={},r=new Array(4),n=kt.util.createBuffer();e.formatKey=function(h){var l=kt.util.createBuffer(h);return h=new Array(4),h[0]=l.getInt32(),h[1]=l.getInt32(),h[2]=l.getInt32(),h[3]=l.getInt32(),kt.aes._expandKey(h,!1)},e.formatSeed=function(h){var l=kt.util.createBuffer(h);return h=new Array(4),h[0]=l.getInt32(),h[1]=l.getInt32(),h[2]=l.getInt32(),h[3]=l.getInt32(),h},e.cipher=function(h,l){return kt.aes._updateBlock(h,l,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=kt.md.sha256;function i(){var h=kt.prng.create(e);return h.getBytes=function(l,g){return h.generate(l,g)},h.getBytesSync=function(l){return h.generate(l)},h}var s=i(),o=null,a=kt.util.globalScope,c=a.crypto||a.msCrypto;if(c&&c.getRandomValues&&(o=function(h){return c.getRandomValues(h)}),kt.options.usePureJavaScript||!kt.util.isNodejs&&!o){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var f="";for(var u in navigator)try{typeof navigator[u]=="string"&&(f+=navigator[u])}catch{}s.collect(f),f=null}t&&(t().mousemove(function(h){s.collectInt(h.clientX,16),s.collectInt(h.clientY,16)}),t().keypress(function(h){s.collectInt(h.charCode,8)}))}if(!kt.random)kt.random=s;else for(var u in s)kt.random[u]=s[u];kt.random.createInstance=i,Ys.exports=kt.random})(typeof jQuery<"u"?jQuery:null)})()});var nc=ht((_2,rc)=>{var Yt=lt();Bt();var Zs=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],tc=[1,2,3,5],Cl=function(t,e){return t<>16-e},Il=function(t,e){return(t&65535)>>e|t<<16-e&65535};rc.exports=Yt.rc2=Yt.rc2||{};Yt.rc2.expandKey=function(t,e){typeof t=="string"&&(t=Yt.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),i=e,s=Math.ceil(i/8),o=255>>(i&7),a;for(a=n;a<128;a++)r.putByte(Zs[r.at(a-1)+r.at(a-n)&255]);for(r.setAt(128-s,Zs[r.at(128-s)&o]),a=127-s;a>=0;a--)r.setAt(a,Zs[r.at(a+1)^r.at(a+s)]);return r};var ec=function(t,e,r){var n=!1,i=null,s=null,o=null,a,c,f,u,h=[];for(t=Yt.rc2.expandKey(t,e),f=0;f<64;f++)h.push(t.getInt16Le());r?(a=function(d){for(f=0;f<4;f++)d[f]+=h[u]+(d[(f+3)%4]&d[(f+2)%4])+(~d[(f+3)%4]&d[(f+1)%4]),d[f]=Cl(d[f],tc[f]),u++},c=function(d){for(f=0;f<4;f++)d[f]+=h[d[(f+3)%4]&63]}):(a=function(d){for(f=3;f>=0;f--)d[f]=Il(d[f],tc[f]),d[f]-=h[u]+(d[(f+3)%4]&d[(f+2)%4])+(~d[(f+3)%4]&d[(f+1)%4]),u--},c=function(d){for(f=3;f>=0;f--)d[f]-=h[d[(f+3)%4]&63]});var l=function(d){var p=[];for(f=0;f<4;f++){var y=i.getInt16Le();o!==null&&(r?y^=o.getInt16Le():o.putInt16Le(y)),p.push(y&65535)}u=r?0:63;for(var x=0;x=8;)l([[5,a],[1,c],[6,a],[1,c],[5,a]])},finish:function(d){var p=!0;if(r)if(d)p=d(8,i,!r);else{var y=i.length()===8?8:8-i.length();i.fillWithByte(y,y)}if(p&&(n=!0,g.update()),!r&&(p=i.length()===0,p))if(d)p=d(8,s,!r);else{var x=s.length(),v=s.at(x-1);v>x?p=!1:s.truncate(v)}return p}},g};Yt.rc2.startEncrypting=function(t,e,r){var n=Yt.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};Yt.rc2.createEncryptionCipher=function(t,e){return ec(t,e,!0)};Yt.rc2.startDecrypting=function(t,e,r){var n=Yt.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};Yt.rc2.createDecryptionCipher=function(t,e){return ec(t,e,!1)}});var Ti=ht((L2,hc)=>{var Xs=lt();hc.exports=Xs.jsbn=Xs.jsbn||{};var De,Tl=0xdeadbeefcafe,ic=(Tl&16777215)==15715070;function D(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}Xs.jsbn.BigInteger=D;function ot(){return new D(null)}function _l(t,e,r,n,i,s){for(;--s>=0;){var o=e*this.data[t++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=o&67108863}return i}function Ll(t,e,r,n,i,s){for(var o=e&32767,a=e>>15;--s>=0;){var c=this.data[t]&32767,f=this.data[t++]>>15,u=a*c+f*o;c=o*c+((u&32767)<<15)+r.data[n]+(i&1073741823),i=(c>>>30)+(u>>>15)+a*f+(i>>>30),r.data[n++]=c&1073741823}return i}function sc(t,e,r,n,i,s){for(var o=e&16383,a=e>>14;--s>=0;){var c=this.data[t]&16383,f=this.data[t++]>>14,u=a*c+f*o;c=o*c+((u&16383)<<14)+r.data[n]+i,i=(c>>28)+(u>>14)+a*f,r.data[n++]=c&268435455}return i}typeof navigator>"u"?(D.prototype.am=sc,De=28):ic&&navigator.appName=="Microsoft Internet Explorer"?(D.prototype.am=Ll,De=30):ic&&navigator.appName!="Netscape"?(D.prototype.am=_l,De=26):(D.prototype.am=sc,De=28);D.prototype.DB=De;D.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function Dl(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}function Ye(t){var e=ot();return e.fromInt(t),e}function kl(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,i=!1,s=0;--n>=0;){var o=r==8?t[n]&255:ac(t,n);if(o<0){t.charAt(n)=="-"&&(i=!0);continue}i=!1,s==0?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB)}r==8&&t[0]&128&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}function Ul(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(a>a)>0&&(i=!0,s=oc(n));o>=0;)a>(a+=this.DB-e)):(n=this.data[o]>>(a-=e)&r,a<=0&&(a+=this.DB,--o)),n>0&&(i=!0),i&&(s+=oc(n));return i?s:"0"}function Kl(){var t=ot();return D.ZERO.subTo(this,t),t}function Ol(){return this.s<0?this.negate():this}function Ml(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}function Ii(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function Fl(){return this.t<=0?0:this.DB*(this.t-1)+Ii(this.data[this.t-1]^this.s&this.DM)}function Vl(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}function Hl(t,e){for(var r=t;r=0;--a)e.data[a+s+1]=this.data[a]>>n|o,o=(this.data[a]&i)<=0;--a)e.data[a]=0;e.data[s]=o,e.t=this.t+s+1,e.s=this.s,e.clamp()}function zl(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,i=this.DB-n,s=(1<>n;for(var o=r+1;o>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}function $l(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}function Yl(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,u=s.data[f-1];if(u!=0){var h=u*(1<1?s.data[f-2]>>this.F2:0),l=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(x,r)),D.ONE.dlShiftTo(f,x),x.subTo(s,s);s.t=0;){var v=r.data[--p]==u?this.DM:Math.floor(r.data[p]*l+(r.data[p-1]+d)*g);if((r.data[p]+=s.am(0,v,r,y,0,f))0&&r.rShiftTo(c,r),o<0&&D.ZERO.subTo(r,r)}}}function Zl(t){var e=ot();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(D.ZERO)>0&&t.subTo(e,e),e}function fr(t){this.m=t}function Xl(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function Ql(t){return t}function Jl(t){t.divRemTo(this.m,null,t)}function jl(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function td(t,e){t.squareTo(e),this.reduce(e)}fr.prototype.convert=Xl;fr.prototype.revert=Ql;fr.prototype.reduce=Jl;fr.prototype.mulTo=jl;fr.prototype.sqrTo=td;function ed(){if(this.t<1)return 0;var t=this.data[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function ur(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}function nd(t){var e=ot();return t.copyTo(e),this.reduce(e),e}function id(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function sd(t,e){t.squareTo(e),this.reduce(e)}function od(t,e,r){t.multiplyTo(e,r),this.reduce(r)}ur.prototype.convert=rd;ur.prototype.revert=nd;ur.prototype.reduce=id;ur.prototype.mulTo=od;ur.prototype.sqrTo=sd;function ad(){return(this.t>0?this.data[0]&1:this.s)==0}function cd(t,e){if(t>4294967295||t<1)return D.ONE;var r=ot(),n=ot(),i=e.convert(this),s=Ii(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,i,r);else{var o=r;r=n,n=o}return e.revert(r)}function fd(t,e){var r;return t<256||e.isEven()?r=new fr(e):r=new ur(e),this.exp(t,r)}D.prototype.copyTo=Nl;D.prototype.fromInt=Dl;D.prototype.fromString=kl;D.prototype.clamp=Pl;D.prototype.dlShiftTo=Vl;D.prototype.drShiftTo=Hl;D.prototype.lShiftTo=ql;D.prototype.rShiftTo=zl;D.prototype.subTo=Gl;D.prototype.multiplyTo=$l;D.prototype.squareTo=Wl;D.prototype.divRemTo=Yl;D.prototype.invDigit=ed;D.prototype.isEven=ad;D.prototype.exp=cd;D.prototype.toString=Ul;D.prototype.negate=Kl;D.prototype.abs=Ol;D.prototype.compareTo=Ml;D.prototype.bitLength=Fl;D.prototype.mod=Zl;D.prototype.modPowInt=fd;D.ZERO=Ye(0);D.ONE=Ye(1);function ud(){var t=ot();return this.copyTo(t),t}function hd(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}function dd(){return this.t==0?this.s:this.data[0]<<16>>16}function pd(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function yd(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function gd(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=Ye(r),i=ot(),s=ot(),o="";for(this.divRemTo(n,i,s);i.signum()>0;)o=(r+s.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,s);return s.intValue().toString(t)+o}function xd(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,s=0,o=0,a=0;a=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(o,0)),i&&D.ZERO.subTo(this,this)}function md(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(D.ONE.shiftLeft(t-1),Js,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(D.ONE.shiftLeft(t-1),this);else{var n=new Array,i=t&7;n.length=(t>>3)+1,e.nextBytes(n),i>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function vd(t){return this.compareTo(t)==0}function wd(t){return this.compareTo(t)<0?this:t}function Ed(t){return this.compareTo(t)>0?this:t}function Sd(t,e,r){var n,i,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),t&255||(t>>=8,e+=8),t&15||(t>>=4,e+=4),t&3||(t>>=2,e+=2),t&1||++e,e}function Dd(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}function Hd(t){var e=ot();return this.addTo(t,e),e}function qd(t){var e=ot();return this.subTo(t,e),e}function zd(t){var e=ot();return this.multiplyTo(t,e),e}function Gd(t){var e=ot();return this.divRemTo(t,e,null),e}function $d(t){var e=ot();return this.divRemTo(t,null,e),e}function Wd(t){var e=ot(),r=ot();return this.divRemTo(t,e,r),new Array(e,r)}function Yd(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Zd(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}function vn(){}function uc(t){return t}function Xd(t,e,r){t.multiplyTo(e,r)}function Qd(t,e){t.squareTo(e)}vn.prototype.convert=uc;vn.prototype.revert=uc;vn.prototype.mulTo=Xd;vn.prototype.sqrTo=Qd;function Jd(t){return this.exp(t,new vn)}function jd(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=ot();return t.copyTo(e),this.reduce(e),e}function rp(t){return t}function np(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function ip(t,e){t.squareTo(e),this.reduce(e)}function sp(t,e,r){t.multiplyTo(e,r),this.reduce(r)}Kr.prototype.convert=ep;Kr.prototype.revert=rp;Kr.prototype.reduce=np;Kr.prototype.mulTo=sp;Kr.prototype.sqrTo=ip;function op(t,e){var r=t.bitLength(),n,i=Ye(1),s;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new fr(e):e.isEven()?s=new Kr(e):s=new ur(e);var o=new Array,a=3,c=n-1,f=(1<1){var u=ot();for(s.sqrTo(o[1],u);a<=f;)o[a]=ot(),s.mulTo(u,o[a-2],o[a]),a+=2}var h=t.t-1,l,g=!0,d=ot(),p;for(r=Ii(t.data[h])-1;h>=0;){for(r>=c?l=t.data[h]>>r-c&f:(l=(t.data[h]&(1<0&&(l|=t.data[h-1]>>this.DB+r-c)),a=n;!(l&1);)l>>=1,--a;if((r-=a)<0&&(r+=this.DB,--h),g)o[l].copyTo(i),g=!1;else{for(;a>1;)s.sqrTo(i,d),s.sqrTo(d,i),a-=2;a>0?s.sqrTo(i,d):(p=i,i=d,d=p),s.mulTo(d,o[l],i)}for(;h>=0&&!(t.data[h]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function cp(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}function fp(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return D.ZERO;for(var r=t.clone(),n=this.clone(),i=Ye(1),s=Ye(0),o=Ye(0),a=Ye(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!i.isEven()||!s.isEven())&&(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!o.isEven()||!a.isEven())&&(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),s.subTo(a,s)):(n.subTo(r,n),e&&o.subTo(i,o),a.subTo(s,a))}if(n.compareTo(D.ONE)!=0)return D.ZERO;if(a.compareTo(t)>=0)return a.subtract(t);if(a.signum()<0)a.addTo(t,a);else return a;return a.signum()<0?a.add(t):a}var he=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],up=(1<<26)/he[he.length-1];function hp(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=he[he.length-1]){for(e=0;e=0);var a=s.modPow(n,this);if(a.compareTo(D.ONE)!=0&&a.compareTo(e)!=0){for(var c=1;c++{var xe=lt();cr();Bt();var dc=yc.exports=xe.sha1=xe.sha1||{};xe.md.sha1=xe.md.algorithms.sha1=dc;dc.create=function(){pc||pp();var t=null,e=xe.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),lc(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=xe.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(js.substr(0,n.blockLength-o));for(var a,c,f=n.fullMessageLength[0]*8,u=0;u>>0,f+=c,i.putInt32(f>>>0),f=a>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};lc(h,r,i);var l=xe.util.createBuffer();return l.putInt32(h.h0),l.putInt32(h.h1),l.putInt32(h.h2),l.putInt32(h.h3),l.putInt32(h.h4),l},n};var js=null,pc=!1;function pp(){js="\x80",js+=xe.util.fillString("\0",64),pc=!0}function lc(t,e,r){for(var n,i,s,o,a,c,f,u,h=r.length();h>=64;){for(i=t.h0,s=t.h1,o=t.h2,a=t.h3,c=t.h4,u=0;u<16;++u)n=r.getInt32(),e[u]=n,f=a^s&(o^a),n=(i<<5|i>>>27)+f+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<20;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,f=a^s&(o^a),n=(i<<5|i>>>27)+f+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<32;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<40;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<60;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s&o|a&(s^o),n=(i<<5|i>>>27)+f+c+2400959708+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<80;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+3395469782+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+s|0,t.h2=t.h2+o|0,t.h3=t.h3+a|0,t.h4=t.h4+c|0,h-=64}}});var bc=ht((N2,mc)=>{var me=lt();Bt();bn();gc();var xc=mc.exports=me.pkcs1=me.pkcs1||{};xc.encode_rsa_oaep=function(t,e,r){var n,i,s,o;typeof r=="string"?(n=r,i=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),s?s.start():s=me.md.sha1.create(),o||(o=s);var a=Math.ceil(t.n.bitLength()/8),c=a-2*s.digestLength-2;if(e.length>c){var f=new Error("RSAES-OAEP input message length is too long.");throw f.length=e.length,f.maxLength=c,f}n||(n=""),s.update(n,"raw");for(var u=s.digest(),h="",l=c-e.length,g=0;g>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+o),n+=r.digest().getBytes()}return n.substring(0,e)}});var vc=ht((D2,to)=>{var Ze=lt();Bt();Ti();bn();(function(){if(Ze.prime){to.exports=Ze.prime;return}var t=to.exports=Ze.prime=Ze.prime||{},e=Ze.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var i=function(h,l){return h|l};t.generateProbablePrime=function(h,l,g){typeof l=="function"&&(g=l,l={}),l=l||{};var d=l.algorithm||"PRIMEINC";typeof d=="string"&&(d={name:d}),d.options=d.options||{};var p=l.prng||Ze.random,y={nextBytes:function(x){for(var v=p.getBytesSync(x.length),m=0;ml&&(h=f(l,g)),h.isProbablePrime(p))return x(null,h);h.dAddOffset(r[d++%8],0)}while(y<0||+new Date-v"u")return o(h,l,g,d);var p=f(h,l),y=g.workers,x=g.workLoad||100,v=x*30/8,m=g.workerScript||"forge/prime.worker.js";if(y===-1)return Ze.util.estimateCores(function(S,B){S&&(B=2),y=B-1,A()});A();function A(){y=Math.max(1,y);for(var S=[],B=0;Bh&&(p=f(h,l));var z=p.toString(16);M.target.postMessage({hex:z,workLoad:x}),p.dAddOffset(v,0)}}}}function f(h,l){var g=new e(h,l),d=h-1;return g.testBit(d)||g.bitwiseTo(e.ONE.shiftLeft(d),i,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}function u(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}})()});var Ri=ht((k2,Ic)=>{var $=lt();mn();Ti();yi();bc();vc();bn();Bt();typeof st>"u"&&(st=$.jsbn.BigInteger);var st,eo=$.util.isNodejs?Ei():null,E=$.asn1,ne=$.util;$.pki=$.pki||{};Ic.exports=$.pki.rsa=$.rsa=$.rsa||{};var Q=$.pki,yp=[6,4,2,4,2,4,6,2],gp={name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},xp={name:"RSAPrivateKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},mp={name:"RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},bp=$.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},vp={name:"DigestInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:E.Class.UNIVERSAL,type:E.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},wp=function(t){var e;if(t.algorithm in Q.oids)e=Q.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=E.oidToDer(e).getBytes(),i=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]),s=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]);s.value.push(E.create(E.Class.UNIVERSAL,E.Type.OID,!1,n)),s.value.push(E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,""));var o=E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(s),i.value.push(o),E.toDer(i).getBytes()},Ac=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(st.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(st.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new st($.util.bytesToHex($.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(st.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var i=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(s)<0;)i=i.add(e.p);var o=i.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return o=o.multiply(n.modInverse(e.n)).mod(e.n),o};Q.rsa.encrypt=function(t,e,r){var n=r,i,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=Cc(t,e,r)):(i=$.util.createBuffer(),i.putBytes(t));for(var o=new st(i.toHex(),16),a=Ac(o,e,n),c=a.toString(16),f=$.util.createBuffer(),u=s-Math.ceil(c.length/2);u>0;)f.putByte(0),--u;return f.putBytes($.util.hexToBytes(c)),f.getBytes()};Q.rsa.decrypt=function(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=i,s}var o=new st($.util.createBuffer(t).toHex(),16);if(o.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var a=Ac(o,e,r),c=a.toString(16),f=$.util.createBuffer(),u=i-Math.ceil(c.length/2);u>0;)f.putByte(0),--u;return f.putBytes($.util.hexToBytes(c)),n!==!1?Li(f.getBytes(),e,r):f.getBytes()};Q.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||$.random,i={nextBytes:function(a){for(var c=n.getBytesSync(a.length),f=0;f>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+s);return o};Q.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new st(null);r.fromInt(30);for(var n=0,i=function(h,l){return h|l},s=+new Date,o,a=0;t.keys===null&&(e<=0||ac?t.pqState=0:t.num.isProbablePrime(Sp(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(yp[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(st.ONE),t.q1=t.q.subtract(st.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(st.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var u=t.e.modInverse(t.phi);t.keys={privateKey:Q.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Q.rsa.setPublicKey(t.n,t.e)}}o=+new Date,a+=o-s,s=o}return t.keys!==null};Q.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!$.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(wc("generateKeyPair"))return eo.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(a,c,f){if(a)return n(a);n(null,{privateKey:Q.privateKeyFromPem(f),publicKey:Q.publicKeyFromPem(c)})});if(Ec("generateKey")&&Ec("exportKey"))return ne.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:Bc(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(a){return ne.globalScope.crypto.subtle.exportKey("pkcs8",a.privateKey)}).then(void 0,function(a){n(a)}).then(function(a){if(a){var c=Q.privateKeyFromAsn1(E.fromDer($.util.createBuffer(a)));n(null,{privateKey:c,publicKey:Q.setRsaPublicKey(c.n,c.e)})}});if(Sc("generateKey")&&Sc("exportKey")){var i=ne.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:Bc(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(a){var c=a.target.result,f=ne.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);f.oncomplete=function(u){var h=u.target.result,l=Q.privateKeyFromAsn1(E.fromDer($.util.createBuffer(h)));n(null,{privateKey:l,publicKey:Q.setRsaPublicKey(l.n,l.e)})},f.onerror=function(u){n(u)}},i.onerror=function(a){n(a)};return}}else if(wc("generateKeyPairSync")){var s=eo.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Q.privateKeyFromPem(s.privateKey),publicKey:Q.publicKeyFromPem(s.publicKey)}}}var o=Q.rsa.createKeyPairGenerationState(t,e,r);if(!n)return Q.rsa.stepKeyPairGenerationState(o,0),o.keys;Ep(o,r,n)};Q.setRsaPublicKey=Q.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,i,s){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(a,c,f){return Cc(a,c,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(a,c){return $.pkcs1.encode_rsa_oaep(c,a,s)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(a){return a}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(n,r,!0);return Q.rsa.encrypt(o,r,!0)},r.verify=function(n,i,s,o){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),s==="RSASSA-PKCS1-V1_5"?s={verify:function(c,f){f=Li(f,r,!0);var u=E.fromDer(f,{parseAllBytes:o._parseAllDigestBytes}),h={},l=[];if(!E.validate(u,vp,h,l)){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=l,g}var d=E.derToOid(h.algorithmIdentifier);if(!(d===$.oids.md2||d===$.oids.md5||d===$.oids.sha1||d===$.oids.sha224||d===$.oids.sha256||d===$.oids.sha384||d===$.oids.sha512||d===$.oids["sha512-224"]||d===$.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=d,g}if((d===$.oids.md2||d===$.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return c===h.digest}}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:function(c,f){return f=Li(f,r,!0),c===f}});var a=Q.rsa.decrypt(i,r,!0,!1);return s.verify(n,a,r.n.bitLength())},r};Q.setRsaPrivateKey=Q.rsa.setPrivateKey=function(t,e,r,n,i,s,o,a){var c={n:t,e,d:r,p:n,q:i,dP:s,dQ:o,qInv:a};return c.decrypt=function(f,u,h){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var l=Q.rsa.decrypt(f,c,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:Li};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(g,d){return $.pkcs1.decode_rsa_oaep(d,g,h)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(g){return g}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(l,c,!1)},c.sign=function(f,u){var h=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:wp},h=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return f}},h=1);var l=u.encode(f,c.n.bitLength());return Q.rsa.encrypt(l,c,h)},c};Q.wrapRsaPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Q.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,E.toDer(t).getBytes())])};Q.privateKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,gp,e,r)&&(t=E.fromDer($.util.createBuffer(e.privateKey))),e={},r=[],!E.validate(t,xp,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,s,o,a,c,f,u,h;return i=$.util.createBuffer(e.privateKeyModulus).toHex(),s=$.util.createBuffer(e.privateKeyPublicExponent).toHex(),o=$.util.createBuffer(e.privateKeyPrivateExponent).toHex(),a=$.util.createBuffer(e.privateKeyPrime1).toHex(),c=$.util.createBuffer(e.privateKeyPrime2).toHex(),f=$.util.createBuffer(e.privateKeyExponent1).toHex(),u=$.util.createBuffer(e.privateKeyExponent2).toHex(),h=$.util.createBuffer(e.privateKeyCoefficient).toHex(),Q.setRsaPrivateKey(new st(i,16),new st(s,16),new st(o,16),new st(a,16),new st(c,16),new st(f,16),new st(u,16),new st(h,16))};Q.privateKeyToAsn1=Q.privateKeyToRSAPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.e)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.d)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.p)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.q)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.dP)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.dQ)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.qInv))])};Q.publicKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,bp,e,r)){var n=E.derToOid(e.publicKeyOid);if(n!==Q.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}t=e.rsaPublicKey}if(r=[],!E.validate(t,mp,e,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var s=$.util.createBuffer(e.publicKeyModulus).toHex(),o=$.util.createBuffer(e.publicKeyExponent).toHex();return Q.setRsaPublicKey(new st(s,16),new st(o,16))};Q.publicKeyToAsn1=Q.publicKeyToSubjectPublicKeyInfo=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Q.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.BITSTRING,!1,[Q.publicKeyToRSAPublicKey(t)])])};Q.publicKeyToRSAPublicKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.e))])};function Cc(t,e,r){var n=$.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=i-11,s}n.putByte(0),n.putByte(r);var o=i-3-t.length,a;if(r===0||r===1){a=r===0?0:255;for(var c=0;c0;){for(var f=0,u=$.random.getBytes(o),c=0;c"u")throw new Error("Encryption block is invalid.");var c=0;if(a===0){c=i-3-n;for(var f=0;f1;){if(s.getByte()!==255){--s.read;break}++c}else if(a===2)for(c=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++c}var u=s.getByte();if(u!==0||c!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function Ep(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),i();function i(){s(t.pBits,function(a,c){if(a)return r(a);if(t.p=c,t.q!==null)return o(a,t.q);s(t.qBits,o)})}function s(a,c){$.prime.generateProbablePrime(a,n,c)}function o(a,c){if(a)return r(a);if(t.q=c,t.p.compareTo(t.q)<0){var f=t.p;t.p=t.q,t.q=f}if(t.p.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)!==0){t.p=null,i();return}if(t.q.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)!==0){t.q=null,s(t.qBits,o);return}if(t.p1=t.p.subtract(st.ONE),t.q1=t.q.subtract(st.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(st.ONE)!==0){t.p=t.q=null,i();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,o);return}var u=t.e.modInverse(t.phi);t.keys={privateKey:Q.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Q.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function be(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=$.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function Sp(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function wc(t){return $.util.isNodejs&&typeof eo[t]=="function"}function Ec(t){return typeof ne.globalScope<"u"&&typeof ne.globalScope.crypto=="object"&&typeof ne.globalScope.crypto.subtle=="object"&&typeof ne.globalScope.crypto.subtle[t]=="function"}function Sc(t){return typeof ne.globalScope<"u"&&typeof ne.globalScope.msCrypto=="object"&&typeof ne.globalScope.msCrypto.subtle=="object"&&typeof ne.globalScope.msCrypto.subtle[t]=="function"}function Bc(t){for(var e=$.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{var H=lt();$s();mn();K0();cr();yi();H0();G0();bn();nc();Ri();Bt();typeof Tc>"u"&&(Tc=H.jsbn.BigInteger);var Tc,I=H.asn1,tt=H.pki=H.pki||{};Nc.exports=tt.pbe=H.pbe=H.pbe||{};var hr=tt.oids,Bp={name:"EncryptedPrivateKeyInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Ap={name:"PBES2Algorithms",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},Cp={name:"pkcs-12PbeParams",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"iterations"}]};tt.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=H.random.getBytesSync(r.saltSize),i=r.count,s=I.integerToDer(i),o,a,c;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var f,u,h;switch(r.algorithm){case"aes128":o=16,f=16,u=hr["aes128-CBC"],h=H.aes.createEncryptionCipher;break;case"aes192":o=24,f=16,u=hr["aes192-CBC"],h=H.aes.createEncryptionCipher;break;case"aes256":o=32,f=16,u=hr["aes256-CBC"],h=H.aes.createEncryptionCipher;break;case"des":o=8,f=8,u=hr.desCBC,h=H.des.createEncryptionCipher;break;default:var l=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw l.algorithm=r.algorithm,l}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),d=Rc(g),p=H.pkcs5.pbkdf2(e,n,i,o,d),y=H.random.getBytesSync(f),x=h(p);x.start(y),x.update(I.toDer(t)),x.finish(),c=x.output.getBytes();var v=Ip(n,s,o,g);a=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr.pkcs5PBES2).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr.pkcs5PBKDF2).getBytes()),v]),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(u).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,y)])])])}else if(r.algorithm==="3des"){o=24;var m=new H.util.ByteBuffer(n),p=tt.pbe.generatePkcs12Key(e,m,1,i,o),y=tt.pbe.generatePkcs12Key(e,m,2,i,o),x=H.des.createEncryptionCipher(p);x.start(y),x.update(I.toDer(t)),x.finish(),c=x.output.getBytes(),a=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,n),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,s.getBytes())])])}else{var l=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw l.algorithm=r.algorithm,l}var A=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[a,I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,c)]);return A};tt.decryptPrivateKeyInfo=function(t,e){var r=null,n={},i=[];if(!I.validate(t,Bp,n,i)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=I.derToOid(n.encryptionOid),a=tt.pbe.getCipher(o,n.encryptionParams,e),c=H.util.createBuffer(n.encryptedData);return a.update(c),a.finish()&&(r=I.fromDer(a.output)),r};tt.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:I.toDer(t).getBytes()};return H.pem.encode(r,{maxline:e})};tt.encryptedPrivateKeyFromPem=function(t){var e=H.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return I.fromDer(e.body)};tt.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=tt.wrapRsaPrivateKey(tt.privateKeyToAsn1(t));return n=tt.encryptPrivateKeyInfo(n,e,r),tt.encryptedPrivateKeyToPem(n)}var i,s,o,a;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,s=H.random.getBytesSync(8),a=H.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,s=H.random.getBytesSync(8),a=H.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var f=H.pbe.opensslDeriveBytes(e,s.substr(0,8),o),u=a(f);u.start(s),u.update(I.toDer(tt.privateKeyToAsn1(t))),u.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:H.util.bytesToHex(s).toUpperCase()},body:u.output.getBytes()};return H.pem.encode(h)};tt.decryptRsaPrivateKey=function(t,e){var r=null,n=H.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,o;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,o=H.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,o=H.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,o=H.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,o=H.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,o=H.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,o=function(h){return H.rc2.createDecryptionCipher(h,40)};break;case"RC2-64-CBC":s=8,o=function(h){return H.rc2.createDecryptionCipher(h,64)};break;case"RC2-128-CBC":s=16,o=function(h){return H.rc2.createDecryptionCipher(h,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var a=H.util.hexToBytes(n.dekInfo.parameters),c=H.pbe.opensslDeriveBytes(e,a.substr(0,8),s),f=o(c);if(f.start(a),f.update(H.util.createBuffer(n.body)),f.finish())r=f.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=tt.decryptPrivateKeyInfo(I.fromDer(r),e):r=I.fromDer(r),r!==null&&(r=tt.privateKeyFromAsn1(r)),r};tt.pbe.generatePkcs12Key=function(t,e,r,n,i,s){var o,a;if(typeof s>"u"||s===null){if(!("sha1"in H.md))throw new Error('"sha1" hash algorithm unavailable.');s=H.md.sha1.create()}var c=s.digestLength,f=s.blockLength,u=new H.util.ByteBuffer,h=new H.util.ByteBuffer;if(t!=null){for(a=0;a=0;a--)q=q>>8,q+=_.at(a)+U.at(a),U.setAt(a,q&255);M.putBuffer(U)}m=M,u.putBuffer(B)}return u.truncate(u.length()-i),u};tt.pbe.getCipher=function(t,e,r){switch(t){case tt.oids.pkcs5PBES2:return tt.pbe.getCipherForPBES2(t,e,r);case tt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case tt.oids["pbewithSHAAnd40BitRC2-CBC"]:return tt.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};tt.pbe.getCipherForPBES2=function(t,e,r){var n={},i=[];if(!I.validate(e,Ap,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}if(t=I.derToOid(n.kdfOid),t!==tt.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=I.derToOid(n.encOid),t!==tt.oids["aes128-CBC"]&&t!==tt.oids["aes192-CBC"]&&t!==tt.oids["aes256-CBC"]&&t!==tt.oids["des-EDE3-CBC"]&&t!==tt.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var o=n.kdfSalt,a=H.util.createBuffer(n.kdfIterationCount);a=a.getInt(a.length()<<3);var c,f;switch(tt.oids[t]){case"aes128-CBC":c=16,f=H.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,f=H.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,f=H.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,f=H.des.createDecryptionCipher;break;case"desCBC":c=8,f=H.des.createDecryptionCipher;break}var u=Lc(n.prfOid),h=H.pkcs5.pbkdf2(r,o,a,c,u),l=n.encIv,g=f(h);return g.start(l),g};tt.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},i=[];if(!I.validate(e,Cp,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=H.util.createBuffer(n.salt),a=H.util.createBuffer(n.iterations);a=a.getInt(a.length()<<3);var c,f,u;switch(t){case tt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,f=8,u=H.des.startDecrypting;break;case tt.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,f=8,u=function(p,y){var x=H.rc2.createDecryptionCipher(p,40);return x.start(y,null),x};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=Lc(n.prfOid),l=tt.pbe.generatePkcs12Key(r,o,1,a,c,h);h.start();var g=tt.pbe.generatePkcs12Key(r,o,2,a,f,h);return u(l,g)};tt.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in H.md))throw new Error('"md5" hash algorithm unavailable.');n=H.md.md5.create()}e===null&&(e="");for(var i=[_c(n,t+e)],s=16,o=1;s{var mt=lt();cr();Bt();var _n=wf.exports=mt.sha512=mt.sha512||{};mt.md.sha512=mt.md.algorithms.sha512=_n;var bf=mt.sha384=mt.sha512.sha384=mt.sha512.sha384||{};bf.create=function(){return _n.create("SHA-384")};mt.md.sha384=mt.md.algorithms.sha384=bf;mt.sha512.sha256=mt.sha512.sha256||{create:function(){return _n.create("SHA-512/256")}};mt.md["sha512/256"]=mt.md.algorithms["sha512/256"]=mt.sha512.sha256;mt.sha512.sha224=mt.sha512.sha224||{create:function(){return _n.create("SHA-512/224")}};mt.md["sha512/224"]=mt.md.algorithms["sha512/224"]=mt.sha512.sha224;_n.create=function(t){if(vf||Yy(),typeof t>"u"&&(t="SHA-512"),!(t in br))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=br[t],r=null,n=mt.util.createBuffer(),i=new Array(80),s=0;s<80;++s)i[s]=new Array(2);var o=64;switch(t){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var a={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength128=[];for(var c=a.messageLengthSize/4,f=0;f>>0,u>>>0];for(var h=a.fullMessageLength.length-1;h>=0;--h)a.fullMessageLength[h]+=u[1],u[1]=u[0]+(a.fullMessageLength[h]/4294967296>>>0),a.fullMessageLength[h]=a.fullMessageLength[h]>>>0,u[0]=u[1]/4294967296>>>0;return n.putBytes(c),mf(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),a},a.digest=function(){var c=mt.util.createBuffer();c.putBytes(n.bytes());var f=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize,u=f&a.blockLength-1;c.putBytes(Fo.substr(0,a.blockLength-u));for(var h,l,g=a.fullMessageLength[0]*8,d=0;d>>0,g+=l,c.putInt32(g>>>0),g=h>>>0;c.putInt32(g);for(var p=new Array(r.length),d=0;d=128;){for(C=0;C<16;++C)e[C][0]=r.getInt32()>>>0,e[C][1]=r.getInt32()>>>0;for(;C<80;++C)L=e[C-2],N=L[0],T=L[1],n=((N>>>19|T<<13)^(T>>>29|N<<3)^N>>>6)>>>0,i=((N<<13|T>>>19)^(T<<3|N>>>29)^(N<<26|T>>>6))>>>0,P=e[C-15],N=P[0],T=P[1],s=((N>>>1|T<<31)^(N>>>8|T<<24)^N>>>7)>>>0,o=((N<<31|T>>>1)^(N<<24|T>>>8)^(N<<25|T>>>7))>>>0,w=e[C-7],K=e[C-16],T=i+w[1]+o+K[1],e[C][0]=n+w[0]+s+K[0]+(T/4294967296>>>0)>>>0,e[C][1]=T>>>0;for(p=t[0][0],y=t[0][1],x=t[1][0],v=t[1][1],m=t[2][0],A=t[2][1],S=t[3][0],B=t[3][1],R=t[4][0],_=t[4][1],O=t[5][0],M=t[5][1],U=t[6][0],q=t[6][1],z=t[7][0],Z=t[7][1],C=0;C<80;++C)f=((R>>>14|_<<18)^(R>>>18|_<<14)^(_>>>9|R<<23))>>>0,u=((R<<18|_>>>14)^(R<<14|_>>>18)^(_<<23|R>>>9))>>>0,h=(U^R&(O^U))>>>0,l=(q^_&(M^q))>>>0,a=((p>>>28|y<<4)^(y>>>2|p<<30)^(y>>>7|p<<25))>>>0,c=((p<<4|y>>>28)^(y<<30|p>>>2)^(y<<25|p>>>7))>>>0,g=(p&x|m&(p^x))>>>0,d=(y&v|A&(y^v))>>>0,T=Z+u+l+Vo[C][1]+e[C][1],n=z+f+h+Vo[C][0]+e[C][0]+(T/4294967296>>>0)>>>0,i=T>>>0,T=c+d,s=a+g+(T/4294967296>>>0)>>>0,o=T>>>0,z=U,Z=q,U=O,q=M,O=R,M=_,T=B+i,R=S+n+(T/4294967296>>>0)>>>0,_=T>>>0,S=m,B=A,m=x,A=v,x=p,v=y,T=i+o,p=n+s+(T/4294967296>>>0)>>>0,y=T>>>0;T=t[0][1]+y,t[0][0]=t[0][0]+p+(T/4294967296>>>0)>>>0,t[0][1]=T>>>0,T=t[1][1]+v,t[1][0]=t[1][0]+x+(T/4294967296>>>0)>>>0,t[1][1]=T>>>0,T=t[2][1]+A,t[2][0]=t[2][0]+m+(T/4294967296>>>0)>>>0,t[2][1]=T>>>0,T=t[3][1]+B,t[3][0]=t[3][0]+S+(T/4294967296>>>0)>>>0,t[3][1]=T>>>0,T=t[4][1]+_,t[4][0]=t[4][0]+R+(T/4294967296>>>0)>>>0,t[4][1]=T>>>0,T=t[5][1]+M,t[5][0]=t[5][0]+O+(T/4294967296>>>0)>>>0,t[5][1]=T>>>0,T=t[6][1]+q,t[6][0]=t[6][0]+U+(T/4294967296>>>0)>>>0,t[6][1]=T>>>0,T=t[7][1]+Z,t[7][0]=t[7][0]+z+(T/4294967296>>>0)>>>0,t[7][1]=T>>>0,V-=128}}});var tu=ht((Cw,jf)=>{var jr=1e3,tn=jr*60,en=tn*60,Sr=en*24,B1=Sr*7,A1=Sr*365.25;jf.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return C1(t);if(r==="number"&&isFinite(t))return e.long?T1(t):I1(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function C1(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*A1;case"weeks":case"week":case"w":return r*B1;case"days":case"day":case"d":return r*Sr;case"hours":case"hour":case"hrs":case"hr":case"h":return r*en;case"minutes":case"minute":case"mins":case"min":case"m":return r*tn;case"seconds":case"second":case"secs":case"sec":case"s":return r*jr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function I1(t){var e=Math.abs(t);return e>=Sr?Math.round(t/Sr)+"d":e>=en?Math.round(t/en)+"h":e>=tn?Math.round(t/tn)+"m":e>=jr?Math.round(t/jr)+"s":t+"ms"}function T1(t){var e=Math.abs(t);return e>=Sr?Vi(t,e,Sr,"day"):e>=en?Vi(t,e,en,"hour"):e>=tn?Vi(t,e,tn,"minute"):e>=jr?Vi(t,e,jr,"second"):t+" ms"}function Vi(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var ru=ht((Iw,eu)=>{function _1(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=tu(),r.destroy=f,Object.keys(t).forEach(u=>{r[u]=t[u]}),r.names=[],r.skips=[],r.formatters={};function e(u){let h=0;for(let l=0;l{if(B==="%%")return"%";A++;let _=r.formatters[R];if(typeof _=="function"){let O=y[A];B=_.call(x,O),y.splice(A,1),A--}return B}),r.formatArgs.call(x,y),(x.log||r.log).apply(x,y)}return p.namespace=u,p.useColors=r.useColors(),p.color=r.selectColor(u),p.extend=n,p.destroy=r.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>l!==null?l:(g!==r.namespaces&&(g=r.namespaces,d=r.enabled(u)),d),set:y=>{l=y}}),typeof r.init=="function"&&r.init(p),p}function n(u,h){let l=r(this.namespace+(typeof h>"u"?":":h)+u);return l.log=this.log,l}function i(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let h,l=(typeof u=="string"?u:"").split(/[\s,]+/),g=l.length;for(h=0;h"-"+h)].join(",");return r.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let h,l;for(h=0,l=r.skips.length;h{jt.formatArgs=R1;jt.save=N1;jt.load=D1;jt.useColors=L1;jt.storage=k1();jt.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();jt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function L1(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function R1(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Hi.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}jt.log=console.debug||console.log||(()=>{});function N1(t){try{t?jt.storage.setItem("debug",t):jt.storage.removeItem("debug")}catch{}}function D1(){let t;try{t=jt.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function k1(){try{return localStorage}catch{}}Hi.exports=ru()(jt);var{formatters:P1}=Hi.exports;P1.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var V1={};_t(V1,{noise:()=>F1,pureJsCrypto:()=>di});function Me(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function rt(t=0){return globalThis.Buffer?.alloc!=null?Me(globalThis.Buffer.alloc(t)):new Uint8Array(t)}function It(t=0){return globalThis.Buffer?.allocUnsafe!=null?Me(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}var Su=Math.pow(2,7),Bu=Math.pow(2,14),Au=Math.pow(2,21),Zi=Math.pow(2,28),Xi=Math.pow(2,35),Qi=Math.pow(2,42),Ji=Math.pow(2,49),ct=128,Ht=127;function Be(t){if(tNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Cu(t,e,r=0){switch(Be(t)){case 8:e[r++]=t&255|ct,t/=128;case 7:e[r++]=t&255|ct,t/=128;case 6:e[r++]=t&255|ct,t/=128;case 5:e[r++]=t&255|ct,t/=128;case 4:e[r++]=t&255|ct,t>>>=7;case 3:e[r++]=t&255|ct,t>>>=7;case 2:e[r++]=t&255|ct,t>>>=7;case 1:{e[r++]=t&255,t>>>=7;break}default:throw new Error("unreachable")}return e}function Iu(t,e,r=0){switch(Be(t)){case 8:e.set(r++,t&255|ct),t/=128;case 7:e.set(r++,t&255|ct),t/=128;case 6:e.set(r++,t&255|ct),t/=128;case 5:e.set(r++,t&255|ct),t/=128;case 4:e.set(r++,t&255|ct),t>>>=7;case 3:e.set(r++,t&255|ct),t>>>=7;case 2:e.set(r++,t&255|ct),t>>>=7;case 1:{e.set(r++,t&255),t>>>=7;break}default:throw new Error("unreachable")}return e}function Tu(t,e){let r=t[e],n=0;if(n+=r&Ht,ri+s.length,0));let r=It(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return Me(r)}function Lt(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let r=0;for(let n of e)if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.push(n);else if(Fn(n))r+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}prepend(...e){this.prependAll(e)}prependAll(e){let r=0;for(let n of e.reverse())if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.unshift(n);else if(Fn(n))r+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}get(e){let r=da(this.bufs,e);return r.buf[r.index]}set(e,r){let n=da(this.bufs,e);n.buf[n.index]=r}write(e,r=0){if(e instanceof Uint8Array)for(let n=0;n0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,r){let{bufs:n,length:i}=this._subList(e,r);return Gt(n,i)}subarray(e,r){let{bufs:n,length:i}=this._subList(e,r);return n.length===1?n[0]:Gt(n,i)}sublist(e,r){let{bufs:n,length:i}=this._subList(e,r),s=new t;return s.length=i,s.bufs=n,s}_subList(e,r){if(e=e??0,r=r??this.length,e<0&&(e=this.length+e),r<0&&(r=this.length+r),e<0||r>this.length)throw new RangeError("index is out of bounds");if(e===r)return{bufs:[],length:0};if(e===0&&r===this.length)return{bufs:[...this.bufs],length:this.length};let n=[],i=0;for(let s=0;s=c)continue;let f=e>=a&&ea&&r<=c;if(f&&u){if(e===a&&r===c){n.push(o);break}let h=e-a;n.push(o.subarray(h,h+(r-e)));break}if(f){if(e===0){n.push(o);continue}n.push(o.subarray(e-a));continue}if(u){if(r===c){n.push(o);break}n.push(o.subarray(0,r-a));break}n.push(o)}return{bufs:n,length:r-e}}indexOf(e,r=0){if(!Fn(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(r=Number(r??0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),e.length===0)return r>this.length?this.length:r;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let s=256,o=new Int32Array(s);for(let h=0;h=0;l--){let g=this.get(h+l);if(n[l]!==g){u=Math.max(1,l-a[g]);break}}if(u===0)return h}return-1}getInt8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt8(0)}setInt8(e,r){let n=It(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,r),this.write(n,e)}getInt16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,r)}setInt16(e,r,n){let i=rt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,r,n),this.write(i,e)}getInt32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,r)}setInt32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,r,n),this.write(i,e)}getBigInt64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,r)}setBigInt64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,r,n),this.write(i,e)}getUint8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint8(0)}setUint8(e,r){let n=It(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,r),this.write(n,e)}getUint16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,r)}setUint16(e,r,n){let i=rt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,r,n),this.write(i,e)}getUint32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,r)}setUint32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,r,n),this.write(i,e)}getBigUint64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,r)}setBigUint64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,r,n),this.write(i,e)}getFloat32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,r)}setFloat32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,r,n),this.write(i,e)}getFloat64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,r)}setFloat64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,r,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof t)||e.bufs.length!==this.bufs.length)return!1;for(let r=0;ri+s.byteLength,0)),n.length=r,n}};function Vn(t){return t[Symbol.asyncIterator]!=null}var Hn=t=>{let e=Be(t),r=It(e);return la(t,r),Hn.bytes=e,r};Hn.bytes=0;function nn(t,e){e=e??{};let r=e.lengthEncoder??Hn;function*n(i){let s=r(i.byteLength);s instanceof Uint8Array?yield s:yield*s,i instanceof Uint8Array?yield i:yield*i}return Vn(t)?async function*(){for await(let i of t)yield*n(i)}():function*(){for(let i of t)yield*n(i)}()}nn.single=(t,e)=>{e=e??{};let r=e.lengthEncoder??Hn;return new Rt(r(t.byteLength),t)};var Br=zt(xa(),1);var Ru=8,Nu=1024*1024*4,er;(function(t){t[t.LENGTH=0]="LENGTH",t[t.DATA=1]="DATA"})(er||(er={}));var ts=t=>{let e=Mn(t);return ts.bytes=Be(e),e};ts.bytes=0;function sn(t,e){let r=new Rt,n=er.LENGTH,i=-1,s=e?.lengthDecoder??ts,o=e?.maxLengthLength??Ru,a=e?.maxDataLength??Nu;function*c(){for(;r.byteLength>0;){if(n===er.LENGTH)try{if(i=s(r),i<0)throw(0,Br.default)(new Error("invalid message length"),"ERR_INVALID_MSG_LENGTH");if(i>a)throw(0,Br.default)(new Error("message length too long"),"ERR_MSG_DATA_TOO_LONG");let f=s.bytes;r.consume(f),e?.onLength!=null&&e.onLength(i),n=er.DATA}catch(f){if(f instanceof RangeError){if(r.byteLength>o)throw(0,Br.default)(new Error("message length length too long"),"ERR_MSG_LENGTH_TOO_LONG");break}throw f}if(n===er.DATA){if(r.byteLength0)throw(0,Br.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}():function*(){for(let f of t)r.append(f),yield*c();if(r.byteLength>0)throw(0,Br.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}()}sn.fromReader=(t,e)=>{let r=1,n=async function*(){for(;;)try{let{done:s,value:o}=await t.next(r);if(s===!0)return;o!=null&&(yield o)}catch(s){if(s.code==="ERR_UNDER_READ")return{done:!0,value:null};throw s}finally{r=1}}();return sn(n,{...e??{},onLength:s=>{r=s}})};function oe(){let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}var qn=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=r??"ABORT_ERR"}};async function ma(t,e,r){if(e==null)return t;if(e.aborted)return Promise.reject(new qn(r?.errorMessage,r?.errorCode));let n,i=new qn(r?.errorMessage,r?.errorCode);try{return await Promise.race([t,new Promise((s,o)=>{n=()=>{o(i)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var es=class{needNext;haveNext;ended;nextResult;constructor(){this.ended=!1,this.needNext=oe(),this.needNext.resolve(),this.haveNext=oe()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("Have next but next was undefined");let e=this.nextResult;return this.nextResult=void 0,this.needNext.resolve(),this.needNext=oe(),e}async throw(e){return this.ended=!0,e!=null&&this.haveNext.reject(e),{done:!0,value:void 0}}async return(){let e={done:!0,value:void 0};return await this._push(void 0),e}async push(e,r){await this._push(e,r)}async end(e,r){e!=null?await this.throw(e):await this._push(void 0,r)}async _push(e,r){if(e!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");this.nextResult!=null&&await this.needNext.promise,e!=null?this.nextResult={done:!1,value:e}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=oe(),await ma(this.needNext.promise,r?.signal,r)}};function ba(){return new es}var zn=class extends Error{code;constructor(e,r){super(e),this.code=r}},rs=class extends zn{type;constructor(e){super(e,"ABORT_ERR"),this.type="aborted"}};function va(t,e){let r=ba();t.sink(r).catch(async o=>{await r.end(o)}),t.sink=async o=>{for await(let a of o)await r.push(a);await r.end()};let n=t.source;t.source[Symbol.iterator]!=null?n=t.source[Symbol.iterator]():t.source[Symbol.asyncIterator]!=null&&(n=t.source[Symbol.asyncIterator]());let i=new Rt;return{read:async(o,a)=>{a?.signal?.throwIfAborted();let c,f=new Promise((u,h)=>{c=()=>{h(new rs("Read aborted"))},a?.signal?.addEventListener("abort",c)});try{if(o==null){let{done:h,value:l}=await Promise.race([n.next(),f]);return h===!0?new Rt:l}for(;i.byteLength{a?.signal?.throwIfAborted(),o instanceof Uint8Array?await r.push(o,a):await r.push(o.subarray(),a)},unwrap:()=>{if(i.byteLength>0){let o=t.source;t.source=async function*(){e?.yieldBytes===!1?yield i:yield*i,yield*o}()}return t}}}var Gn=class extends Error{code;constructor(e,r){super(e),this.code=r}},wa=t=>Mn(t);wa.bytes=0;function ns(t,e={}){let r=va(t,e);return e.maxDataLength!=null&&e.maxLengthLength==null&&(e.maxLengthLength=Be(e.maxDataLength)),{read:async i=>{let s=-1,o=new Rt,a=e?.lengthDecoder??wa;for(;;){o.append(await r.read(1,i));try{s=a(o)}catch(c){if(c instanceof RangeError)continue;throw c}if(e?.maxLengthLength!=null&&o.byteLength>e.maxLengthLength)throw new Gn("message length length too long","ERR_MSG_LENGTH_TOO_LONG");if(s>-1)break}if(e?.maxDataLength!=null&&s>e.maxDataLength)throw new Gn("message length too long","ERR_MSG_DATA_TOO_LONG");return r.read(s,i)},write:async(i,s)=>{await r.write(nn.single(i,e),s)},writeV:async(i,s)=>{let o=new Rt(...i.map(a=>nn.single(a,e)));await r.write(o,s)},unwrap:()=>r.unwrap()}}function is(){let t=oe(),e=!1;return{sink:async r=>{if(e)throw new Error("already piped");e=!0,t.resolve(r)},source:async function*(){yield*await t.promise}()}}function Ea(){let t=is(),e=is();return[{source:t.source,sink:e.sink},{source:e.source,sink:t.sink}]}var $n=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},Ar=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new $n(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let r=this.head;this.head=r.next=new $n(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var ss=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function Wn(t={}){return ku(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},t)}function ku(t,e){e=e??{};let r=e.onEnd,n=new Ar,i,s,o,a=oe(),c=async()=>{try{return n.isEmpty()?o?{done:!0}:await new Promise((y,x)=>{s=v=>{s=null,n.push(v);try{y(t(n))}catch(m){x(m)}return i}}):t(n)}finally{n.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=oe()})}},f=y=>s!=null?s(y):(n.push(y),i),u=y=>(n=new Ar,s!=null?s({error:y}):(n.push({error:y}),i)),h=y=>{if(o)return i;if(e?.objectMode!==!0&&y?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return f({done:!1,value:y})},l=y=>o?i:(o=!0,y!=null?u(y):f({done:!0})),g=()=>(n=new Ar,l(),{done:!0}),d=y=>(l(y),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:c,return:g,throw:d,push:h,end:l,get readableLength(){return n.size},onEmpty:async y=>{let x=y?.signal;if(x?.throwIfAborted(),n.isEmpty())return;let v,m;x!=null&&(v=new Promise((A,S)=>{m=()=>{S(new ss)},x.addEventListener("abort",m)}));try{await Promise.race([a.promise,v])}finally{m!=null&&x!=null&&x?.removeEventListener("abort",m)}}},r==null)return i;let p=i;return i={[Symbol.asyncIterator](){return this},next(){return p.next()},throw(y){return p.throw(y),r!=null&&(r(y),r=void 0),{done:!0}},return(){return p.return(),r!=null&&(r(),r=void 0),{done:!0}},push:h,end(y){return p.end(y),r!=null&&(r(y),r=void 0),i},get readableLength(){return p.readableLength},onEmpty:y=>p.onEmpty(y)},i}function Pu(t){return t[Symbol.asyncIterator]!=null}function Uu(...t){let e=[];for(let r of t)Pu(r)||e.push(r);return e.length===t.length?function*(){for(let r of e)yield*r}():async function*(){let r=Wn({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(t.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var Sa=Uu;function Ba(t,...e){if(t==null)throw new Error("Empty pipeline");if(os(t)){let n=t;t=()=>n.source}else if(Ca(t)||Aa(t)){let n=t;t=()=>n}let r=[t,...e];if(r.length>1&&os(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n{let e;for(;t.length>0;)e=t.shift()(e);return e},Aa=t=>t?.[Symbol.asyncIterator]!=null,Ca=t=>t?.[Symbol.iterator]!=null,os=t=>t==null?!1:t.sink!=null&&t.source!=null,Ou=t=>e=>{let r=t.sink(e);if(r?.then!=null){let n=Wn({objectMode:!0});r.then(()=>{n.end()},o=>{n.end(o)});let i,s=t.source;if(Aa(s))i=async function*(){yield*s,n.end()};else if(Ca(s))i=function*(){yield*s,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return Sa(n,i())}return t.source};var Ia=!!globalThis.process?.env?.DUMP_SESSION_KEYS;var Mu=t=>t instanceof Uint8Array;var Ae=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Ta=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Fu=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Fu)throw new Error("Non little-endian hardware is not supported");function Yn(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Zn(t){if(typeof t=="string")t=Yn(t);else if(Mu(t))t=t.slice();else throw new Error(`expected Uint8Array, got ${typeof t}`);return t}var Vu=t=>Object.prototype.toString.call(t)==="[object Object]"&&t.constructor===Object;function _a(t,e){if(e!==void 0&&(typeof e!="object"||!Vu(e)))throw new Error("options must be object or undefined");return Object.assign(t,e)}function rr(t,e){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");if(typeof e=="number"&&t.length!==e)throw new Error(`Uint8Array length ${e} expected`)}function La(t,e){if(t.length!==e.length)throw new Error("equalBytes: Different size of Uint8Arrays");let r=!0;for(let n=0;n(Object.assign(e,t),e);function cs(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,f=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+f,a,n)}function Xn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function fs(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function Cr(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function us(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ra(t,e){Cr(t);let r=e.outputLen;if(t.lengtht[e++]&255|(t[e++]&255)<<8,hs=class{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=Zn(e),rr(e,32);let r=Ot(e,0),n=Ot(e,2),i=Ot(e,4),s=Ot(e,6),o=Ot(e,8),a=Ot(e,10),c=Ot(e,12),f=Ot(e,14);this.r[0]=r&8191,this.r[1]=(r>>>13|n<<3)&8191,this.r[2]=(n>>>10|i<<6)&7939,this.r[3]=(i>>>7|s<<9)&8191,this.r[4]=(s>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|f<<8)&8191,this.r[9]=f>>>5&127;for(let u=0;u<8;u++)this.pad[u]=Ot(e,16+2*u)}process(e,r,n=!1){let i=n?0:2048,{h:s,r:o}=this,a=o[0],c=o[1],f=o[2],u=o[3],h=o[4],l=o[5],g=o[6],d=o[7],p=o[8],y=o[9],x=Ot(e,r+0),v=Ot(e,r+2),m=Ot(e,r+4),A=Ot(e,r+6),S=Ot(e,r+8),B=Ot(e,r+10),R=Ot(e,r+12),_=Ot(e,r+14),O=s[0]+(x&8191),M=s[1]+((x>>>13|v<<3)&8191),U=s[2]+((v>>>10|m<<6)&8191),q=s[3]+((m>>>7|A<<9)&8191),z=s[4]+((A>>>4|S<<12)&8191),Z=s[5]+(S>>>1&8191),C=s[6]+((S>>>14|B<<2)&8191),N=s[7]+((B>>>11|R<<5)&8191),T=s[8]+((R>>>8|_<<8)&8191),L=s[9]+(_>>>5|i),w=0,P=w+O*a+M*(5*y)+U*(5*p)+q*(5*d)+z*(5*g);w=P>>>13,P&=8191,P+=Z*(5*l)+C*(5*h)+N*(5*u)+T*(5*f)+L*(5*c),w+=P>>>13,P&=8191;let K=w+O*c+M*a+U*(5*y)+q*(5*p)+z*(5*d);w=K>>>13,K&=8191,K+=Z*(5*g)+C*(5*l)+N*(5*h)+T*(5*u)+L*(5*f),w+=K>>>13,K&=8191;let V=w+O*f+M*c+U*a+q*(5*y)+z*(5*p);w=V>>>13,V&=8191,V+=Z*(5*d)+C*(5*g)+N*(5*l)+T*(5*h)+L*(5*u),w+=V>>>13,V&=8191;let W=w+O*u+M*f+U*c+q*a+z*(5*y);w=W>>>13,W&=8191,W+=Z*(5*p)+C*(5*d)+N*(5*g)+T*(5*l)+L*(5*h),w+=W>>>13,W&=8191;let Y=w+O*h+M*u+U*f+q*c+z*a;w=Y>>>13,Y&=8191,Y+=Z*(5*y)+C*(5*p)+N*(5*d)+T*(5*g)+L*(5*l),w+=Y>>>13,Y&=8191;let et=w+O*l+M*h+U*u+q*f+z*c;w=et>>>13,et&=8191,et+=Z*a+C*(5*y)+N*(5*p)+T*(5*d)+L*(5*g),w+=et>>>13,et&=8191;let X=w+O*g+M*l+U*h+q*u+z*f;w=X>>>13,X&=8191,X+=Z*c+C*a+N*(5*y)+T*(5*p)+L*(5*d),w+=X>>>13,X&=8191;let J=w+O*d+M*g+U*l+q*h+z*u;w=J>>>13,J&=8191,J+=Z*f+C*c+N*a+T*(5*y)+L*(5*p),w+=J>>>13,J&=8191;let dt=w+O*p+M*d+U*g+q*l+z*h;w=dt>>>13,dt&=8191,dt+=Z*u+C*f+N*c+T*a+L*(5*y),w+=dt>>>13,dt&=8191;let ut=w+O*y+M*p+U*d+q*g+z*l;w=ut>>>13,ut&=8191,ut+=Z*h+C*u+N*f+T*c+L*a,w+=ut>>>13,ut&=8191,w=(w<<2)+w|0,w=w+P|0,P=w&8191,w=w>>>13,K+=w,s[0]=P,s[1]=K,s[2]=V,s[3]=W,s[4]=Y,s[5]=et,s[6]=X,s[7]=J,s[8]=dt,s[9]=ut}finalize(){let{h:e,pad:r}=this,n=new Uint16Array(10),i=e[1]>>>13;e[1]&=8191;for(let a=2;a<10;a++)e[a]+=i,i=e[a]>>>13,e[a]&=8191;e[0]+=i*5,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,n[0]=e[0]+5,i=n[0]>>>13,n[0]&=8191;for(let a=1;a<10;a++)n[a]=e[a]+i,i=n[a]>>>13,n[a]&=8191;n[9]-=8192;let s=(i^1)-1;for(let a=0;a<10;a++)n[a]&=s;s=~s;for(let a=0;a<10;a++)e[a]=e[a]&s|n[a];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let o=e[0]+r[0];e[0]=o&65535;for(let a=1;a<8;a++)o=(e[a]+r[a]|0)+(o>>>16)|0,e[a]=o&65535}update(e){us(this);let{buffer:r,blockLen:n}=this;e=Zn(e);let i=e.length;for(let s=0;s>>0,e[s++]=n[o]>>>8;return e}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}};function Hu(t){let e=(n,i)=>t(i).update(Zn(n)).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}var Na=Hu(t=>new hs(t));var qu=Yn("expand 16-byte k"),zu=Yn("expand 32-byte k"),Gu=Ae(qu),$u=Ae(zu);function G(t,e){return t<>>32-e}function ls(t){return t.byteOffset%4===0}var Qn=64,Wu=16,ka=2**32-1,Da=new Uint32Array;function Yu(t,e,r,n,i,s,o,a){let c=i.length,f=new Uint8Array(Qn),u=Ae(f),h=ls(i)&&ls(s),l=h?Ae(i):Da,g=h?Ae(s):Da;for(let d=0;d=ka)throw new Error("arx: counter overflow");let p=Math.min(Qn,c-d);if(h&&p===Qn){let y=d/4;if(d%4!==0)throw new Error("arx: invalid block position");for(let x=0,v;x{Cr(a),Cr(c),Cr(f);let l=f.length;if(u||(u=new Uint8Array(l)),Cr(u),Xn(h),h<0||h>=ka)throw new Error("arx: counter overflow");if(u.length0;)g.pop().fill(0);return u}}function Ka(t,e,r,n,i,s=20){let o=t[0],a=t[1],c=t[2],f=t[3],u=e[0],h=e[1],l=e[2],g=e[3],d=e[4],p=e[5],y=e[6],x=e[7],v=i,m=r[0],A=r[1],S=r[2],B=o,R=a,_=c,O=f,M=u,U=h,q=l,z=g,Z=d,C=p,N=y,T=x,L=v,w=m,P=A,K=S;for(let W=0;W{t.update(e);let r=e.length%16;r&&t.update(Ju.subarray(r))},ju=new Uint8Array(32);function Ua(t,e,r,n,i){let s=t(e,r,ju),o=Na.create(s);i&&Pa(o,i),Pa(o,n);let a=new Uint8Array(16),c=Ta(a);cs(c,0,BigInt(i?i.length:0),!0),cs(c,8,BigInt(n.length),!0),o.update(a);let f=o.digest();return s.fill(0),f}var Oa=t=>(e,r,n)=>(rr(e,32),rr(r),{encrypt:(s,o)=>{let a=s.length,c=a+16;o?rr(o,c):o=new Uint8Array(c),t(e,r,s,o,1);let f=Ua(t,e,r,o.subarray(0,-16),n);return o.set(f,a),o},decrypt:(s,o)=>{let a=s.length,c=a-16;if(a<16)throw new Error("encrypted data must be at least 16 bytes");o?rr(o,c):o=new Uint8Array(c);let f=s.subarray(0,-16),u=s.subarray(-16),h=Ua(t,e,r,f,n);if(!La(u,h))throw new Error("invalid tag");return t(e,r,f,o,1),o}}),ps=as({blockSize:64,nonceLength:12,tagLength:16},Oa(Xu)),Zg=as({blockSize:64,nonceLength:24,tagLength:16},Oa(Qu));function Jn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function ys(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function on(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Jn(t.outputLen),Jn(t.blockLen)}function Ir(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ma(t,e){ys(t);let r=e.outputLen;if(t.lengtht instanceof Uint8Array;var ti=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ae=(t,e)=>t<<32-e|t>>>e,th=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!th)throw new Error("Non little-endian hardware is not supported");function gs(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Fe(t){if(typeof t=="string"&&(t=gs(t)),!Fa(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function ei(...t){let e=new Uint8Array(t.reduce((n,i)=>n+i.length,0)),r=0;return t.forEach(n=>{if(!Fa(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}var Tr=class{clone(){return this._cloneInto()}},tx={}.toString;function ri(t){let e=n=>t().update(Fe(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function nr(t=32){if(jn&&typeof jn.getRandomValues=="function")return jn.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function eh(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,f=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+f,a,n)}var _r=class extends Tr{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ti(this.buffer)}update(e){Ir(this);let{view:r,buffer:n,blockLen:i}=this;e=Fe(e);let s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let h=o;hu.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h>xs&ni)}:{h:Number(t>>xs&ni)|0,l:Number(t&ni)|0}}function rh(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),ih=(t,e,r)=>t>>>r,sh=(t,e,r)=>t<<32-r|e>>>r,oh=(t,e,r)=>t>>>r|e<<32-r,ah=(t,e,r)=>t<<32-r|e>>>r,ch=(t,e,r)=>t<<64-r|e>>>r-32,fh=(t,e,r)=>t>>>r-32|e<<64-r,uh=(t,e)=>e,hh=(t,e)=>t,lh=(t,e,r)=>t<>>32-r,dh=(t,e,r)=>e<>>32-r,ph=(t,e,r)=>e<>>64-r,yh=(t,e,r)=>t<>>64-r;function gh(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var xh=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),mh=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,bh=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),vh=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,wh=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Eh=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0;var Sh={fromBig:Va,split:rh,toBig:nh,shrSH:ih,shrSL:sh,rotrSH:oh,rotrSL:ah,rotrBH:ch,rotrBL:fh,rotr32H:uh,rotr32L:hh,rotlSH:lh,rotlSL:dh,rotlBH:ph,rotlBL:yh,add:gh,add3L:xh,add3H:mh,add4L:bh,add4H:vh,add5H:Eh,add5L:wh},j=Sh;var[Bh,Ah]=j.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Ve=new Uint32Array(80),He=new Uint32Array(80),ms=class extends _r{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:f,El:u,Fh:h,Fl:l,Gh:g,Gl:d,Hh:p,Hl:y}=this;return[e,r,n,i,s,o,a,c,f,u,h,l,g,d,p,y]}set(e,r,n,i,s,o,a,c,f,u,h,l,g,d,p,y){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=f|0,this.El=u|0,this.Fh=h|0,this.Fl=l|0,this.Gh=g|0,this.Gl=d|0,this.Hh=p|0,this.Hl=y|0}process(e,r){for(let m=0;m<16;m++,r+=4)Ve[m]=e.getUint32(r),He[m]=e.getUint32(r+=4);for(let m=16;m<80;m++){let A=Ve[m-15]|0,S=He[m-15]|0,B=j.rotrSH(A,S,1)^j.rotrSH(A,S,8)^j.shrSH(A,S,7),R=j.rotrSL(A,S,1)^j.rotrSL(A,S,8)^j.shrSL(A,S,7),_=Ve[m-2]|0,O=He[m-2]|0,M=j.rotrSH(_,O,19)^j.rotrBH(_,O,61)^j.shrSH(_,O,6),U=j.rotrSL(_,O,19)^j.rotrBL(_,O,61)^j.shrSL(_,O,6),q=j.add4L(R,U,He[m-7],He[m-16]),z=j.add4H(q,B,M,Ve[m-7],Ve[m-16]);Ve[m]=z|0,He[m]=q|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:f,Dl:u,Eh:h,El:l,Fh:g,Fl:d,Gh:p,Gl:y,Hh:x,Hl:v}=this;for(let m=0;m<80;m++){let A=j.rotrSH(h,l,14)^j.rotrSH(h,l,18)^j.rotrBH(h,l,41),S=j.rotrSL(h,l,14)^j.rotrSL(h,l,18)^j.rotrBL(h,l,41),B=h&g^~h&p,R=l&d^~l&y,_=j.add5L(v,S,R,Ah[m],He[m]),O=j.add5H(_,x,A,B,Bh[m],Ve[m]),M=_|0,U=j.rotrSH(n,i,28)^j.rotrBH(n,i,34)^j.rotrBH(n,i,39),q=j.rotrSL(n,i,28)^j.rotrBL(n,i,34)^j.rotrBL(n,i,39),z=n&s^n&a^s&a,Z=i&o^i&c^o&c;x=p|0,v=y|0,p=g|0,y=d|0,g=h|0,d=l|0,{h,l}=j.add(f|0,u|0,O|0,M|0),f=a|0,u=c|0,a=s|0,c=o|0,s=n|0,o=i|0;let C=j.add3L(M,q,Z);n=j.add3H(C,O,U,z),i=C|0}({h:n,l:i}=j.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=j.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=j.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:f,l:u}=j.add(this.Dh|0,this.Dl|0,f|0,u|0),{h,l}=j.add(this.Eh|0,this.El|0,h|0,l|0),{h:g,l:d}=j.add(this.Fh|0,this.Fl|0,g|0,d|0),{h:p,l:y}=j.add(this.Gh|0,this.Gl|0,p|0,y|0),{h:x,l:v}=j.add(this.Hh|0,this.Hl|0,x|0,v|0),this.set(n,i,s,o,a,c,f,u,h,l,g,d,p,y,x,v)}roundClean(){Ve.fill(0),He.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var bs=ri(()=>new ms);var oi={};_t(oi,{bitGet:()=>Nh,bitLen:()=>Rh,bitMask:()=>an,bitSet:()=>Dh,bytesToHex:()=>Ce,bytesToNumberBE:()=>Ie,bytesToNumberLE:()=>ce,concatBytes:()=>_e,createHmacDrbg:()=>Es,ensureBytes:()=>yt,equalBytes:()=>_h,hexToBytes:()=>ir,hexToNumber:()=>ws,numberToBytesBE:()=>qe,numberToBytesLE:()=>Te,numberToHexUnpadded:()=>za,numberToVarBytesBE:()=>Th,utf8ToBytes:()=>Lh,validateObject:()=>ee});var qa=BigInt(0),ii=BigInt(1),Ch=BigInt(2),si=t=>t instanceof Uint8Array,Ih=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Ce(t){if(!si(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0)),r=0;return t.forEach(n=>{if(!si(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function _h(t,e){if(t.length!==e.length)return!1;for(let r=0;rqa;t>>=ii,e+=1);return e}function Nh(t,e){return t>>BigInt(e)&ii}var Dh=(t,e,r)=>t|(r?ii:qa)<(Ch<new Uint8Array(t),Ha=t=>Uint8Array.from(t);function Es(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=vs(t),i=vs(t),s=0,o=()=>{n.fill(1),i.fill(0),s=0},a=(...h)=>r(i,n,...h),c=(h=vs())=>{i=a(Ha([0]),h),n=a(),h.length!==0&&(i=a(Ha([1]),h),n=a())},f=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let h=0,l=[];for(;h{o(),c(h);let g;for(;!(g=l(f()));)c();return o(),g}}var kh={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function ee(t,e,r={}){let n=(i,s,o)=>{let a=kh[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);let c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(let[i,s]of Object.entries(e))n(i,s,!1);for(let[i,s]of Object.entries(r))n(i,s,!0);return t}var Tt=BigInt(0),bt=BigInt(1),sr=BigInt(2),Ph=BigInt(3),Ss=BigInt(4),Ga=BigInt(5),$a=BigInt(8),Uh=BigInt(9),Kh=BigInt(16);function at(t,e){let r=t%e;return r>=Tt?r:e+r}function Bs(t,e,r){if(r<=Tt||e 0");if(r===bt)return Tt;let n=bt;for(;e>Tt;)e&bt&&(n=n*t%r),t=t*t%r,e>>=bt;return n}function gt(t,e,r){let n=t;for(;e-- >Tt;)n*=n,n%=r;return n}function ai(t,e){if(t===Tt||e<=Tt)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=at(t,e),n=e,i=Tt,s=bt,o=bt,a=Tt;for(;r!==Tt;){let f=n/r,u=n%r,h=i-o*f,l=s-a*f;n=r,r=u,i=o,s=a,o=h,a=l}if(n!==bt)throw new Error("invert: does not exist");return at(i,e)}function Oh(t){let e=(t-bt)/sr,r,n,i;for(r=t-bt,n=0;r%sr===Tt;r/=sr,n++);for(i=sr;i(at(t,e)&bt)===bt,Fh=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function As(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Fh.reduce((n,i)=>(n[i]="function",n),e);return ee(t,r)}function Vh(t,e,r){if(r 0");if(r===Tt)return t.ONE;if(r===bt)return e;let n=t.ONE,i=e;for(;r>Tt;)r&bt&&(n=t.mul(n,i)),i=t.sqr(i),r>>=bt;return n}function Hh(t,e){let r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function Cs(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function ci(t,e,r=!1,n={}){if(t<=Tt)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:s}=Cs(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=Mh(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:an(i),ZERO:Tt,ONE:bt,create:c=>at(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Tt<=c&&cc===Tt,isOdd:c=>(c&bt)===bt,neg:c=>at(-c,t),eql:(c,f)=>c===f,sqr:c=>at(c*c,t),add:(c,f)=>at(c+f,t),sub:(c,f)=>at(c-f,t),mul:(c,f)=>at(c*f,t),pow:(c,f)=>Vh(a,c,f),div:(c,f)=>at(c*ai(f,t),t),sqrN:c=>c*c,addN:(c,f)=>c+f,subN:(c,f)=>c-f,mulN:(c,f)=>c*f,inv:c=>ai(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>Hh(a,c),cmov:(c,f,u)=>u?f:c,toBytes:c=>r?Te(c,s):qe(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?ce(c):Ie(c)}});return Object.freeze(a)}function Ya(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}function Za(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function Is(t){let e=Za(t);return e+Math.ceil(e/2)}function Xa(t,e,r=!1){let n=t.length,i=Za(e),s=Is(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let o=r?Ie(t):ce(t),a=at(o,e-bt)+bt;return r?Te(a,i):qe(a,i)}var zh=BigInt(0),Ts=BigInt(1);function fi(t,e){let r=(i,s)=>{let o=s.negate();return i?o:s},n=i=>{let s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>zh;)s&Ts&&(o=o.add(a)),a=a.double(),s>>=Ts;return o},precomputeWindow(i,s){let{windows:o,windowSize:a}=n(s),c=[],f=i,u=f;for(let h=0;h>=g,y>c&&(y-=l,o+=Ts);let x=p,v=p+Math.abs(y)-1,m=d%2!==0,A=y<0;y===0?u=u.add(r(m,s[x])):f=f.add(r(A,s[v]))}return{p:f,f:u}},wNAFCached(i,s,o,a){let c=i._WINDOW_SIZE||1,f=s.get(i);return f||(f=this.precomputeWindow(i,c),c!==1&&s.set(i,a(f))),this.wNAF(c,f,o)}}}function cn(t){return As(t.Fp),ee(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Cs(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var fe=BigInt(0),Qt=BigInt(1),ui=BigInt(2),Gh=BigInt(8),$h={zip215:!0};function Wh(t){let e=cn(t);return ee(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function hi(t){let e=Wh(t),{Fp:r,n,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,f=ui<{try{return{isValid:!0,value:r.sqrt(L*r.inv(w))}}catch{return{isValid:!1,value:fe}}}),l=e.adjustScalarBytes||(L=>L),g=e.domain||((L,w,P)=>{if(w.length||P)throw new Error("Contexts/pre-hash are not supported");return L}),d=L=>typeof L=="bigint"&&fed(L)&&d(w)&&LL===fe||p(L,f);function x(L,w){if(p(L,w))return L;throw new Error(`Expected valid scalar < ${w}, got ${typeof L} ${L}`)}function v(L){return L===fe?L:x(L,n)}let m=new Map;function A(L){if(!(L instanceof S))throw new Error("ExtendedPoint expected")}class S{constructor(w,P,K,V){if(this.ex=w,this.ey=P,this.ez=K,this.et=V,!y(w))throw new Error("x required");if(!y(P))throw new Error("y required");if(!y(K))throw new Error("z required");if(!y(V))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(w){if(w instanceof S)throw new Error("extended point not allowed");let{x:P,y:K}=w||{};if(!y(P)||!y(K))throw new Error("invalid affine point");return new S(P,K,Qt,u(P*K))}static normalizeZ(w){let P=r.invertBatch(w.map(K=>K.ez));return w.map((K,V)=>K.toAffine(P[V])).map(S.fromAffine)}_setWindowSize(w){this._WINDOW_SIZE=w,m.delete(this)}assertValidity(){let{a:w,d:P}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:K,ey:V,ez:W,et:Y}=this,et=u(K*K),X=u(V*V),J=u(W*W),dt=u(J*J),ut=u(et*w),Ut=u(J*u(ut+X)),Kt=u(dt+u(P*u(et*X)));if(Ut!==Kt)throw new Error("bad point: equation left != right (1)");let Ct=u(K*V),Vt=u(W*Y);if(Ct!==Vt)throw new Error("bad point: equation left != right (2)")}equals(w){A(w);let{ex:P,ey:K,ez:V}=this,{ex:W,ey:Y,ez:et}=w,X=u(P*et),J=u(W*V),dt=u(K*et),ut=u(Y*V);return X===J&&dt===ut}is0(){return this.equals(S.ZERO)}negate(){return new S(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:w}=e,{ex:P,ey:K,ez:V}=this,W=u(P*P),Y=u(K*K),et=u(ui*u(V*V)),X=u(w*W),J=P+K,dt=u(u(J*J)-W-Y),ut=X+Y,Ut=ut-et,Kt=X-Y,Ct=u(dt*Ut),Vt=u(ut*Kt),Se=u(dt*Kt),tr=u(Ut*ut);return new S(Ct,Vt,tr,Se)}add(w){A(w);let{a:P,d:K}=e,{ex:V,ey:W,ez:Y,et}=this,{ex:X,ey:J,ez:dt,et:ut}=w;if(P===BigInt(-1)){let ia=u((W-V)*(J+X)),sa=u((W+V)*(J-X)),Yi=u(sa-ia);if(Yi===fe)return this.double();let oa=u(Y*ui*ut),aa=u(et*ui*dt),ca=aa+oa,fa=sa+ia,ua=aa-oa,du=u(ca*Yi),pu=u(fa*ua),yu=u(ca*ua),gu=u(Yi*fa);return new S(du,pu,gu,yu)}let Ut=u(V*X),Kt=u(W*J),Ct=u(et*K*ut),Vt=u(Y*dt),Se=u((V+W)*(X+J)-Ut-Kt),tr=Vt-Ct,rn=Vt+Ct,na=u(Kt-P*Ut),fu=u(Se*tr),uu=u(rn*na),hu=u(Se*na),lu=u(tr*rn);return new S(fu,uu,lu,hu)}subtract(w){return this.add(w.negate())}wNAF(w){return _.wNAFCached(this,m,w,S.normalizeZ)}multiply(w){let{p:P,f:K}=this.wNAF(x(w,n));return S.normalizeZ([P,K])[0]}multiplyUnsafe(w){let P=v(w);return P===fe?R:this.equals(R)||P===Qt?this:this.equals(B)?this.wNAF(P).p:_.unsafeLadder(this,P)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return _.unsafeLadder(this,n).is0()}toAffine(w){let{ex:P,ey:K,ez:V}=this,W=this.is0();w==null&&(w=W?Gh:r.inv(V));let Y=u(P*w),et=u(K*w),X=u(V*w);if(W)return{x:fe,y:Qt};if(X!==Qt)throw new Error("invZ was invalid");return{x:Y,y:et}}clearCofactor(){let{h:w}=e;return w===Qt?this:this.multiplyUnsafe(w)}static fromHex(w,P=!1){let{d:K,a:V}=e,W=r.BYTES;w=yt("pointHex",w,W);let Y=w.slice(),et=w[W-1];Y[W-1]=et&-129;let X=ce(Y);X===fe||(P?x(X,f):x(X,r.ORDER));let J=u(X*X),dt=u(J-Qt),ut=u(K*J-V),{isValid:Ut,value:Kt}=h(dt,ut);if(!Ut)throw new Error("Point.fromHex: invalid y coordinate");let Ct=(Kt&Qt)===Qt,Vt=(et&128)!==0;if(!P&&Kt===fe&&Vt)throw new Error("Point.fromHex: x=0 and x_0=1");return Vt!==Ct&&(Kt=u(-Kt)),S.fromAffine({x:Kt,y:X})}static fromPrivateKey(w){return U(w).point}toRawBytes(){let{x:w,y:P}=this.toAffine(),K=Te(P,r.BYTES);return K[K.length-1]|=w&Qt?128:0,K}toHex(){return Ce(this.toRawBytes())}}S.BASE=new S(e.Gx,e.Gy,Qt,u(e.Gx*e.Gy)),S.ZERO=new S(fe,Qt,Qt,fe);let{BASE:B,ZERO:R}=S,_=fi(S,a*8);function O(L){return at(L,n)}function M(L){return O(ce(L))}function U(L){let w=a;L=yt("private key",L,w);let P=yt("hashed private key",s(L),2*w),K=l(P.slice(0,w)),V=P.slice(w,2*w),W=M(K),Y=B.multiply(W),et=Y.toRawBytes();return{head:K,prefix:V,scalar:W,point:Y,pointBytes:et}}function q(L){return U(L).pointBytes}function z(L=new Uint8Array,...w){let P=_e(...w);return M(s(g(P,yt("context",L),!!i)))}function Z(L,w,P={}){L=yt("message",L),i&&(L=i(L));let{prefix:K,scalar:V,pointBytes:W}=U(w),Y=z(P.context,K,L),et=B.multiply(Y).toRawBytes(),X=z(P.context,et,W,L),J=O(Y+X*V);v(J);let dt=_e(et,Te(J,r.BYTES));return yt("result",dt,a*2)}let C=$h;function N(L,w,P,K=C){let{context:V,zip215:W}=K,Y=r.BYTES;L=yt("signature",L,2*Y),w=yt("message",w),i&&(w=i(w));let et=ce(L.slice(Y,2*Y)),X,J,dt;try{X=S.fromHex(P,W),J=S.fromHex(L.slice(0,Y),W),dt=B.multiplyUnsafe(et)}catch{return!1}if(!W&&X.isSmallOrder())return!1;let ut=z(V,J.toRawBytes(),X.toRawBytes(),w);return J.add(X.multiplyUnsafe(ut)).subtract(dt).clearCofactor().equals(S.ZERO)}return B._setWindowSize(8),{CURVE:e,getPublicKey:q,sign:Z,verify:N,ExtendedPoint:S,utils:{getExtendedPublicKey:U,randomPrivateKey:()=>o(r.BYTES),precompute(L=8,w=S.BASE){return w._setWindowSize(L),w.multiply(BigInt(3)),w}}}}var fn=BigInt(0),_s=BigInt(1);function Yh(t){return ee(t,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...t})}function Qa(t){let e=Yh(t),{P:r}=e,n=m=>at(m,r),i=e.montgomeryBits,s=Math.ceil(i/8),o=e.nByteLength,a=e.adjustScalarBytes||(m=>m),c=e.powPminus2||(m=>Bs(m,r-BigInt(2),r));function f(m,A,S){let B=n(m*(A-S));return A=n(A-B),S=n(S+B),[A,S]}function u(m){if(typeof m=="bigint"&&fn<=m&&m=fn;C--){let N=B>>C&_s;q^=N,z=f(q,_,M),_=z[0],M=z[1],z=f(q,O,U),O=z[0],U=z[1],q=N;let T=_+O,L=n(T*T),w=_-O,P=n(w*w),K=L-P,V=M+U,W=M-U,Y=n(W*T),et=n(V*w),X=Y+et,J=Y-et;M=n(X*X),U=n(R*n(J*J)),_=n(L*P),O=n(K*(L+n(h*K)))}z=f(q,_,M),_=z[0],M=z[1],z=f(q,O,U),O=z[0],U=z[1];let Z=c(O);return n(_*Z)}function g(m){return Te(n(m),s)}function d(m){let A=yt("u coordinate",m,s);return o===s&&(A[o-1]&=127),ce(A)}function p(m){let A=yt("scalar",m);if(A.length!==s&&A.length!==o)throw new Error(`Expected ${s} or ${o} bytes, got ${A.length}`);return ce(a(A))}function y(m,A){let S=d(A),B=p(m),R=l(S,B);if(R===fn)throw new Error("Invalid private or public key received");return g(R)}let x=g(e.Gu);function v(m){return y(m,x)}return{scalarMult:y,scalarMultBase:v,getSharedSecret:(m,A)=>y(m,A),getPublicKey:m=>v(m),utils:{randomPrivateKey:()=>e.randomBytes(e.nByteLength)},GuBytes:x}}var un=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Ja=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),Cx=BigInt(0),Zh=BigInt(1),Ls=BigInt(2),Xh=BigInt(5),ja=BigInt(10),Qh=BigInt(20),Jh=BigInt(40),t0=BigInt(80);function e0(t){let e=un,n=t*t%e*t%e,i=gt(n,Ls,e)*n%e,s=gt(i,Zh,e)*t%e,o=gt(s,Xh,e)*s%e,a=gt(o,ja,e)*o%e,c=gt(a,Qh,e)*a%e,f=gt(c,Jh,e)*c%e,u=gt(f,t0,e)*f%e,h=gt(u,t0,e)*f%e,l=gt(h,ja,e)*o%e;return{pow_p_5_8:gt(l,Ls,e)*t%e,b2:n}}function r0(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function jh(t,e){let r=un,n=at(e*e*e,r),i=at(n*n*e,r),s=e0(t*i).pow_p_5_8,o=at(t*n*s,r),a=at(e*o*o,r),c=o,f=at(o*Ja,r),u=a===t,h=a===at(-t,r),l=a===at(-t*Ja,r);return u&&(o=c),(h||l)&&(o=f),Wa(o,r)&&(o=at(-o,r)),{isValid:u||h,value:o}}var Le=ci(un,void 0,!0),Rs={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Le,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:bs,randomBytes:nr,adjustScalarBytes:r0,uvRatio:jh},Lr=hi(Rs);function n0(t,e,r){if(e.length>255)throw new Error("Context is too big");return ei(gs("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,e.length]),e,t)}var Ix=hi({...Rs,domain:n0}),Tx=hi({...Rs,domain:n0,prehash:bs}),hn=Qa({P:un,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:t=>{let e=un,{pow_p_5_8:r,b2:n}=e0(t);return at(gt(r,BigInt(3),e)*n,e)},adjustScalarBytes:r0,randomBytes:nr});var tl=(Le.ORDER+BigInt(3))/BigInt(8),_x=Le.pow(Ls,tl),Lx=Le.sqrt(Le.neg(Le.ONE)),Rx=(Le.ORDER-BigInt(5))/BigInt(8),Nx=BigInt(486662);var Dx=Ya(Le,Le.neg(BigInt(486664)));var kx=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Px=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Ux=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Kx=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var Ox=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var li=class extends Tr{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,on(e);let n=Fe(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew li(t,e).update(r).digest();Rr.create=(t,e)=>new li(t,e);function s0(t,e,r){return on(t),r===void 0&&(r=new Uint8Array(t.outputLen)),Rr(t,Fe(r),Fe(e))}var Ns=new Uint8Array([0]),i0=new Uint8Array;function o0(t,e,r,n=32){if(on(t),Jn(n),n>255*t.outputLen)throw new Error("Length should be <= 255*HashLen");let i=Math.ceil(n/t.outputLen);r===void 0&&(r=i0);let s=new Uint8Array(i*t.outputLen),o=Rr.create(t,e),a=o._cloneInto(),c=new Uint8Array(o.outputLen);for(let f=0;ft&e^~t&r,rl=(t,e,r)=>t&e^t&r^e&r,nl=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ze=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ge=new Uint32Array(64),Ds=class extends _r{constructor(){super(64,32,8,!1),this.A=ze[0]|0,this.B=ze[1]|0,this.C=ze[2]|0,this.D=ze[3]|0,this.E=ze[4]|0,this.F=ze[5]|0,this.G=ze[6]|0,this.H=ze[7]|0}get(){let{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let h=0;h<16;h++,r+=4)Ge[h]=e.getUint32(r,!1);for(let h=16;h<64;h++){let l=Ge[h-15],g=Ge[h-2],d=ae(l,7)^ae(l,18)^l>>>3,p=ae(g,17)^ae(g,19)^g>>>10;Ge[h]=p+Ge[h-7]+d+Ge[h-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:f,H:u}=this;for(let h=0;h<64;h++){let l=ae(a,6)^ae(a,11)^ae(a,25),g=u+l+el(a,c,f)+nl[h]+Ge[h]|0,p=(ae(n,2)^ae(n,13)^ae(n,22))+rl(n,i,s)|0;u=f,f=c,c=a,a=o+g|0,o=s,s=i,i=n,n=g+p|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,f=f+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,f,u)}roundClean(){Ge.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Nr=ri(()=>new Ds);var di={hashSHA256(t){return Nr(t)},getHKDF(t,e){let r=s0(Nr,e,t),i=o0(Nr,r,void 0,96),s=i.subarray(0,32),o=i.subarray(32,64),a=i.subarray(64,96);return[s,o,a]},generateX25519KeyPair(){let t=hn.utils.randomPrivateKey();return{publicKey:hn.getPublicKey(t),privateKey:t}},generateX25519KeyPairFromSeed(t){return{publicKey:hn.getPublicKey(t),privateKey:t}},generateX25519SharedKey(t,e){return hn.getSharedSecret(t,e)},chaCha20Poly1305Encrypt(t,e,r,n){return ps(n,e,r).encrypt(t)},chaCha20Poly1305Decrypt(t,e,r,n,i){return ps(n,e,r).decrypt(t,i)}};var a0=di;var Dr=t=>{let e=It(2);return new DataView(e.buffer,e.byteOffset,e.byteLength).setUint16(0,t,!1),e};Dr.bytes=2;var ln=t=>{if(t.length<2)throw RangeError("Could not decode int16BE");return t instanceof Uint8Array?new DataView(t.buffer,t.byteOffset,t.byteLength).getUint16(0,!1):t.getUint16(0)};ln.bytes=2;function c0(t){return new Rt(t.ne,t.ciphertext)}function f0(t){return new Rt(t.ne,t.ns,t.ciphertext)}function u0(t){return new Rt(t.ns,t.ciphertext)}function h0(t){if(t.length<32)throw new Error("Cannot decode stage 0 MessageBuffer: length less than 32 bytes.");return{ne:t.subarray(0,32),ciphertext:t.subarray(32,t.length),ns:rt(0)}}function l0(t){if(t.length<80)throw new Error("Cannot decode stage 1 MessageBuffer: length less than 80 bytes.");return{ne:t.subarray(0,32),ns:t.subarray(32,80),ciphertext:t.subarray(80,t.length)}}function d0(t){if(t.length<48)throw new Error("Cannot decode stage 2 MessageBuffer: length less than 48 bytes.");return{ne:rt(0),ns:t.subarray(0,48),ciphertext:t.subarray(48,t.length)}}var y0=16;function g0(t,e){return async function*(r){for await(let n of r)for(let i=0;in.length&&(s=n.length);let o=t.encrypt(n.subarray(i,s),t.session);e?.encryptedPackets.increment(),yield new Rt(Dr(o.byteLength),o)}}}function x0(t,e){return async function*(r){for await(let n of r)for(let i=0;in.length&&(s=n.length),s-y0Dp});function Tp(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,A=new Uint8Array(m);x!==v;){for(var S=d[x],B=0,R=m-1;(S!==0||B>>0,A[R]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");y=B,x++}for(var _=m-y;_!==m&&A[_]===0;)_++;for(var O=c.repeat(p);_>>0,m=new Uint8Array(v);d[p];){var A=r[d.charCodeAt(p)];if(A===255)return;for(var S=0,B=v-1;(A!==0||S>>0,m[B]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");x=S,p++}if(d[p]!==" "){for(var R=v-x;R!==v&&m[R]===0;)R++;for(var _=new Uint8Array(y+(v-R)),O=y;R!==v;)_[O++]=m[R++];return _}}}function g(d){var p=l(d);if(p)return p;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:l,decode:g}}var _p=Tp,Lp=_p,kc=Lp;var K2=new Uint8Array(0);var Pc=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var Uc=t=>new TextEncoder().encode(t),Kc=t=>new TextDecoder().decode(t);var ro=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},no=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Mc(this,e)}},io=class{constructor(e){this.decoders=e}or(e){return Mc(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Mc=(t,e)=>new io({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),so=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ro(e,r,n),this.decoder=new no(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Or=({name:t,prefix:e,encode:r,decode:n})=>new so(t,e,r,n),Xe=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=kc(r,e);return Or({prefix:t,name:e,encode:n,decode:s=>ke(i(s))})},Rp=(t,e,r,n)=>{let i={};for(let u=0;u=8&&(a-=8,o[f++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},Np=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<Or({prefix:e,name:t,encode(i){return Np(i,n,r)},decode(i){return Rp(i,n,r,t)}});var Dp=Xe({prefix:"9",name:"base10",alphabet:"0123456789"});var ao={};_t(ao,{base16:()=>kp,base16upper:()=>Pp});var kp=St({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Pp=St({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var co={};_t(co,{base2:()=>Up});var Up=St({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var fo={};_t(fo,{base256emoji:()=>Vp});var Fc=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Kp=Fc.reduce((t,e,r)=>(t[r]=e,t),[]),Op=Fc.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Mp(t){return t.reduce((e,r)=>(e+=Kp[r],e),"")}function Fp(t){let e=[];for(let r of t){let n=Op[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var Vp=Or({prefix:"\u{1F680}",name:"base256emoji",encode:Mp,decode:Fp});var uo={};_t(uo,{base32:()=>Qe,base32hex:()=>Gp,base32hexpad:()=>Wp,base32hexpadupper:()=>Yp,base32hexupper:()=>$p,base32pad:()=>qp,base32padupper:()=>zp,base32upper:()=>Hp,base32z:()=>Zp});var Qe=St({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Hp=St({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),qp=St({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),zp=St({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Gp=St({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),$p=St({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Wp=St({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Yp=St({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Zp=St({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ho={};_t(ho,{base36:()=>Xp,base36upper:()=>Qp});var Xp=Xe({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Qp=Xe({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var lo={};_t(lo,{base58btc:()=>Mt,base58flickr:()=>Jp});var Mt=Xe({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Jp=Xe({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var po={};_t(po,{base64:()=>Mr,base64pad:()=>jp,base64url:()=>ty,base64urlpad:()=>ey});var Mr=St({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),jp=St({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ty=St({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ey=St({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var yo={};_t(yo,{base8:()=>ry});var ry=St({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var go={};_t(go,{identity:()=>ny});var ny=Or({prefix:"\0",name:"identity",encode:t=>Kc(t),decode:t=>Uc(t)});var J2=new TextEncoder,j2=new TextDecoder;var mo={};_t(mo,{identity:()=>Je});var oy=qc,Vc=128,ay=127,cy=~ay,fy=Math.pow(2,31);function qc(t,e,r){e=e||[],r=r||0;for(var n=r;t>=fy;)e[r++]=t&255|Vc,t/=128;for(;t&cy;)e[r++]=t&255|Vc,t>>>=7;return e[r]=t|0,qc.bytes=r-n+1,e}var uy=xo,hy=128,Hc=127;function xo(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw xo.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&Hc)<=hy);return xo.bytes=s-n,r}var ly=Math.pow(2,7),dy=Math.pow(2,14),py=Math.pow(2,21),yy=Math.pow(2,28),gy=Math.pow(2,35),xy=Math.pow(2,42),my=Math.pow(2,49),by=Math.pow(2,56),vy=Math.pow(2,63),wy=function(t){return t[wn.decode(t,e),wn.decode.bytes],Fr=(t,e,r=0)=>(wn.encode(t,e,r),e),Vr=t=>wn.encodingLength(t);var ve=(t,e)=>{let r=e.byteLength,n=Vr(t),i=n+Vr(r),s=new Uint8Array(i+r);return Fr(t,s,0),Fr(r,s,n),s.set(e,i),new Hr(t,r,e,s)},Sn=t=>{let e=ke(t),[r,n]=En(e),[i,s]=En(e.subarray(n)),o=e.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new Hr(r,i,o,e)},zc=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&Pc(t.bytes,r.bytes)}},Hr=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var Gc=0,By="identity",$c=ke,Ay=t=>ve(Gc,$c(t)),Je={code:Gc,name:By,encode:$c,digest:Ay};var wo={};_t(wo,{sha256:()=>Ft,sha512:()=>Cy});var vo=({name:t,code:e,encode:r})=>new bo(t,e,r),bo=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?ve(this.code,r):r.then(n=>ve(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Yc=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Ft=vo({name:"sha2-256",code:18,encode:Yc("SHA-256")}),Cy=vo({name:"sha2-512",code:19,encode:Yc("SHA-512")});var Zc=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return Ty(r,Eo(t),e||Mt.encoder);default:return _y(r,Eo(t),e||Qe.encoder)}};var Xc=new WeakMap,Eo=t=>{let e=Xc.get(t);if(e==null){let r=new Map;return Xc.set(t,r),r}return e},lr=class t{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==Bn)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Ly)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=ve(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&zc(e.multihash,n.multihash)}toString(e){return Zc(this,e)}toJSON(){return{"/":Zc(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new t(n,i,s,o||Qc(n,i,s.bytes))}else if(r[Ry]===!0){let{version:n,multihash:i,code:s}=r,o=Sn(i);return t.create(n,s,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==Bn)throw new Error(`Version 0 CID must use dag-pb (code: ${Bn}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=Qc(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,Bn,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=ke(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new Hr(r.multihashCode,r.digestSize,s,i);return[r.version===0?t.createV0(o):t.createV1(r.codec,o),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,l]=En(e.subarray(r));return r+=l,h},i=n(),s=Bn;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),c=n(),f=r+c,u=f-o;return{version:i,codec:s,multihashCode:a,digestSize:c,multihashSize:u,size:f}}static parse(e,r){let[n,i]=Iy(e,r),s=t.decode(i);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Eo(s).set(n,e),s}},Iy=(t,e)=>{switch(t[0]){case"Q":{let r=e||Mt;return[Mt.prefix,r.decode(`${Mt.prefix}${t}`)]}case Mt.prefix:{let r=e||Mt;return[Mt.prefix,r.decode(t)]}case Qe.prefix:{let r=e||Qe;return[Qe.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},Ty=(t,e,r)=>{let{prefix:n}=r;if(n!==Mt.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let s=r.encode(t).slice(1);return e.set(n,s),s}else return i},_y=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let s=r.encode(t);return e.set(n,s),s}else return i},Bn=112,Ly=18,Qc=(t,e,r)=>{let n=Vr(t),i=n+Vr(e),s=new Uint8Array(i+r.byteLength);return Fr(t,s,0),Fr(e,s,n),s.set(r,i),s},Ry=Symbol.for("@ipld/js-cid/CID");var zr={...go,...co,...yo,...oo,...ao,...uo,...ho,...lo,...po,...fo},ym={...wo,...mo};function jc(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var Jc=jc("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),So=jc("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);let e=It(t.length);for(let r=0;rmr,Ed25519PublicKey:()=>Tn,generateKeyPair:()=>zy,generateKeyPairFromSeed:()=>yf,unmarshalEd25519PrivateKey:()=>Hy,unmarshalEd25519PublicKey:()=>qy});var Gr=32,Pe=64,ki=32;async function tf(){let t=Lr.utils.randomPrivateKey(),e=Lr.getPublicKey(t);return{privateKey:sf(t,e),publicKey:e}}async function ef(t){if(t.length!==ki)throw new TypeError('"seed" must be 32 bytes in length.');if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');let e=t,r=Lr.getPublicKey(e);return{privateKey:sf(e,r),publicKey:r}}async function rf(t,e){let r=t.subarray(0,ki);return Lr.sign(e,r)}async function nf(t,e,r){return Lr.verify(e,r,t)}function sf(t,e){let r=new Uint8Array(Pe);for(let n=0;n>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return dr;if(ePy)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,i=e-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>hf&&(i=0n,++n>hf&&(n=0n))),new t(Number(i),Number(n))}static fromNumber(e){if(e===0)return dr;let r=e<0;r&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new t(n,i)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):dr}},dr=new Xt(0,0);dr.toBigInt=function(){return 0n};dr.zzEncode=dr.zzDecode=function(){return this};dr.length=function(){return 1};var hf=4294967296n;function lf(t){let e=0,r=0;for(let n=0;n191&&a<224?s[o++]=(a&31)<<6|t[e++]&63:a>239&&a<365?(a=((a&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,s[o++]=55296+(a>>10),s[o++]=56320+(a&1023)):s[o++]=(a&15)<<12|(t[e++]&63)<<6|t[e++]&63,o>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,s)),o=0);return i!=null?(o>0&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))}function To(t,e,r){let n=r,i,s;for(let o=0;o>6|192,e[r++]=i&63|128):(i&64512)===55296&&((s=t.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(s&1023),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128);return r-n}function le(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Pi(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var _o=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,le(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw le(this,4);return Pi(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw le(this,4);return Pi(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw le(this,4);let e=cf(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw le(this,4);let e=uf(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw le(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return df(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw le(this,e);this.pos+=e}else do if(this.pos>=this.len)throw le(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Xt(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw le(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw le(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw le(this,8);let e=Pi(this.buf,this.pos+=4),r=Pi(this.buf,this.pos+=4);return new Xt(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Lo(t){return new _o(t instanceof Uint8Array?t:t.subarray())}function pr(t,e){let r=Lo(t);return e.decode(r)}function Ro(t){let e=t??8192,r=e>>>1,n,i=e;return function(o){if(o<1||o>r)return It(o);i+o>e&&(n=It(e),i=0);let a=n.subarray(i,i+=o);return i&7&&(i=(i|7)+1),a}}var yr=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function No(){}var ko=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},Uy=Ro();function Ky(t){return globalThis.Buffer!=null?It(t):Uy(t)}var In=class{len;head;tail;states;constructor(){this.len=0,this.head=new yr(No,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new yr(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new Po((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(An,10,Xt.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=Xt.fromBigInt(e);return this._push(An,r.length(),r)}uint64Number(e){let r=Xt.fromNumber(e);return this._push(An,r.length(),r)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=Xt.fromBigInt(e).zzEncode();return this._push(An,r.length(),r)}sint64Number(e){let r=Xt.fromNumber(e).zzEncode();return this._push(An,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(Do,1,e?1:0)}fixed32(e){return this._push(Cn,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=Xt.fromBigInt(e);return this._push(Cn,4,r.lo)._push(Cn,4,r.hi)}fixed64Number(e){let r=Xt.fromNumber(e);return this._push(Cn,4,r.lo)._push(Cn,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(af,4,e)}double(e){return this._push(ff,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(Do,1,0):this.uint32(r)._push(My,r,e)}string(e){let r=lf(e);return r!==0?this.uint32(r)._push(To,r,e):this._push(Do,1,0)}fork(){return this.states=new ko(this),this.head=this.tail=new yr(No,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new yr(No,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=Ky(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function Do(t,e,r){e[r]=t&255}function Oy(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var Po=class extends yr{next;constructor(e,r){super(Oy,e,r),this.next=void 0}};function An(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function Cn(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function My(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(In.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(Fy,e,t),this},In.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(Vy,e,t),this});function Fy(t,e,r){e.set(t,r)}function Vy(t,e,r){t.length<40?To(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(At(t),r)}function Uo(){return new In}function gr(t,e){let r=Uo();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var Wr;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(Wr||(Wr={}));function Ui(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function Ko(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(s,o){let a=e(s);o.int32(a)},n=function(s){let o=s.int32();return e(o)};return Ui("enum",Wr.VARINT,r,n)}function xr(t,e){return Ui("message",Wr.LENGTH_DELIMITED,t,e)}var wt;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.Secp256k1="Secp256k1"})(wt||(wt={}));var Oo;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.Secp256k1=2]="Secp256k1"})(Oo||(Oo={}));(function(t){t.codec=()=>Ko(Oo)})(wt||(wt={}));var we;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),wt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=wt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(we||(we={}));var Ee;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),wt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=wt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Ee||(Ee={}));var Tn=class{_key;constructor(e){this._key=Yr(e,Gr)}async verify(e,r){return nf(this._key,r,e)}marshal(){return this._key}get bytes(){return we.encode({Type:wt.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},mr=class{_key;_publicKey;constructor(e,r){this._key=Yr(e,Pe),this._publicKey=Yr(r,Gr)}async sign(e){return rf(this._key,e)}get public(){return new Tn(this._publicKey)}marshal(){return this._key}get bytes(){return Ee.encode({Type:wt.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=Je.digest(this.public.bytes);return Mt.encode(e.bytes).substring(1)}async export(e,r="libp2p-key"){if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function Hy(t){if(t.length>Pe){t=Yr(t,Pe+Gr);let n=t.subarray(0,Pe),i=t.subarray(Pe,t.length);return new mr(n,i)}t=Yr(t,Pe);let e=t.subarray(0,Pe),r=t.subarray(Gr);return new mr(e,r)}function qy(t){return t=Yr(t,Gr),new Tn(t)}async function zy(){let{privateKey:t,publicKey:e}=await tf();return new mr(t,e)}async function yf(t){let{privateKey:e,publicKey:r}=await ef(t);return new mr(e,r)}function Yr(t,e){if(t=Uint8Array.from(t??[]),t.length!==e)throw new it(`Key must be a Uint8Array of length ${e}, got ${t.length}`,"ERR_INVALID_KEY_TYPE");return t}function Et(t,e="utf8"){let r=Di[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var pb=zt(Bt(),1),yb=zt(Ti(),1),gf=zt(lt(),1);function de(t,e){let r=Uint8Array.from(t.abs().toByteArray());if(r=r[0]===0?r.subarray(1):r,e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Gt([new Uint8Array(e-r.length),r])}return Et(r,"base64url")}function Jt(t){let e=xf(t);return new gf.default.jsbn.BigInteger(Et(e,"base16"),16)}function xf(t,e){let r=At(t,"base64urlpad");if(e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Gt([new Uint8Array(e-r.length),r])}return r}var Gy={"P-256":256,"P-384":384,"P-521":521},$y=Object.keys(Gy),Cb=$y.join(" / ");var zo={};_t(zo,{MAX_KEY_SIZE:()=>Nn,RsaPrivateKey:()=>Zr,RsaPublicKey:()=>Rn,fromJwk:()=>n1,generateKeyPair:()=>i1,unmarshalRsaPrivateKey:()=>e1,unmarshalRsaPublicKey:()=>r1});var Ln=zt(lt(),1);var uv=zt(Ef(),1);function Oi(t){if(isNaN(t)||t<=0)throw new it("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return nr(t)}var $b=zt(Ri(),1),Ho=zt(lt(),1);function Sf(t,e){return e.map(r=>Jt(t[r]))}function Bf(t){return Ho.default.pki.setRsaPrivateKey(...Sf(t,["n","e","d","p","q","dp","dq","qi"]))}function Af(t){return Ho.default.pki.setRsaPublicKey(...Sf(t,["n","e"]))}var vr={};_t(vr,{jwkToPkcs1:()=>Xy,jwkToPkix:()=>Jy,pkcs1ToJwk:()=>Zy,pkixToJwk:()=>Qy});var Zb=zt(mn(),1),Xb=zt(Ri(),1);var Ue=zt(lt(),1);function Zy(t){let e=Ue.default.asn1.fromDer(Et(t,"ascii")),r=Ue.default.pki.privateKeyFromAsn1(e);return{kty:"RSA",n:de(r.n),e:de(r.e),d:de(r.d),p:de(r.p),q:de(r.q),dp:de(r.dP),dq:de(r.dQ),qi:de(r.qInv),alg:"RS256"}}function Xy(t){if(t.n==null||t.e==null||t.d==null||t.p==null||t.q==null||t.dp==null||t.dq==null||t.qi==null)throw new it("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ue.default.pki.privateKeyToAsn1({n:Jt(t.n),e:Jt(t.e),d:Jt(t.d),p:Jt(t.p),q:Jt(t.q),dP:Jt(t.dp),dQ:Jt(t.dq),qInv:Jt(t.qi)});return At(Ue.default.asn1.toDer(e).getBytes(),"ascii")}function Qy(t){let e=Ue.default.asn1.fromDer(Et(t,"ascii")),r=Ue.default.pki.publicKeyFromAsn1(e);return{kty:"RSA",n:de(r.n),e:de(r.e)}}function Jy(t){if(t.n==null||t.e==null)throw new it("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ue.default.pki.publicKeyToAsn1({n:Jt(t.n),e:Jt(t.e)});return At(Ue.default.asn1.toDer(e).getBytes(),"ascii")}async function Cf(t){let e=await Zt.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await _f(e);return{privateKey:r[0],publicKey:r[1]}}async function qo(t){let r=[await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await jy(t)],n=await _f({privateKey:r[0],publicKey:r[1]});return{privateKey:n[0],publicKey:n[1]}}async function If(t,e){let r=await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),n=await Zt.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(e));return new Uint8Array(n,0,n.byteLength)}async function Tf(t,e,r){let n=await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return Zt.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},n,e,r)}async function _f(t){if(t.privateKey==null||t.publicKey==null)throw new it("Private and public key are required","ERR_INVALID_PARAMETERS");return Promise.all([Zt.get().subtle.exportKey("jwk",t.privateKey),Zt.get().subtle.exportKey("jwk",t.publicKey)])}async function jy(t){return Zt.get().subtle.importKey("jwk",{kty:t.kty,n:t.n,e:t.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}function Lf(t,e,r,n){let i=e?Af(t):Bf(t),s=Et(Uint8Array.from(r),"ascii"),o=n(s,i);return At(o,"ascii")}function Rf(t,e){return Lf(t,!0,e,(r,n)=>n.encrypt(r))}function Nf(t,e){return Lf(t,!1,e,(r,n)=>n.decrypt(r))}function Mi(t){if(t.kty!=="RSA")throw new it("invalid key type","ERR_INVALID_KEY_TYPE");if(t.n==null)throw new it("invalid key modulus","ERR_INVALID_KEY_MODULUS");return At(t.n,"base64url").length*8}var Nn=8192,Rn=class{_key;constructor(e){this._key=e}async verify(e,r){return Tf(this._key,r,e)}marshal(){return vr.jwkToPkix(this._key)}get bytes(){return we.encode({Type:wt.RSA,Data:this.marshal()}).subarray()}encrypt(e){return Rf(this._key,e)}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},Zr=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r}genSecret(){return Oi(16)}async sign(e){return If(this._key,e)}get public(){if(this._publicKey==null)throw new it("public key not provided","ERR_PUBKEY_NOT_PROVIDED");return new Rn(this._publicKey)}decrypt(e){return Nf(this._key,e)}marshal(){return vr.jwkToPkcs1(this._key)}get bytes(){return Ee.encode({Type:wt.RSA,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=await this.public.hash();return Et(e,"base58btc")}async export(e,r="pkcs-8"){if(r==="pkcs-8"){let n=new Ln.default.util.ByteBuffer(this.marshal()),i=Ln.default.asn1.fromDer(n),s=Ln.default.pki.privateKeyFromAsn1(i),o={algorithm:"aes256",count:1e4,saltSize:128/8,prfAlgorithm:"sha512"};return Ln.default.pki.encryptRsaPrivateKey(s,e,o)}else{if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}}};async function e1(t){let e=vr.pkcs1ToJwk(t);if(Mi(e)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let r=await qo(e);return new Zr(r.privateKey,r.publicKey)}function r1(t){let e=vr.pkixToJwk(t);if(Mi(e)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");return new Rn(e)}async function n1(t){if(Mi(t)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await qo(t);return new Zr(e.privateKey,e.publicKey)}async function i1(t){if(t>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await Cf(t);return new Zr(e.privateKey,e.publicKey)}var Yo={};_t(Yo,{Secp256k1PrivateKey:()=>kn,Secp256k1PublicKey:()=>Dn,generateKeyPair:()=>g1,unmarshalSecp256k1PrivateKey:()=>p1,unmarshalSecp256k1PublicKey:()=>y1});function s1(t){let e=cn(t);ee(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:o1,hexToBytes:a1}=oi,wr={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){let{Err:e}=wr;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:o1(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=wr,r=typeof t=="string"?a1(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:s}=wr._parseInt(r.subarray(2)),{d:o,l:a}=wr._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){let e=f=>Number.parseInt(f[0],16)&8?"00"+f:f,r=f=>{let u=f.toString(16);return u.length&1?`0${u}`:u},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},Ke=BigInt(0),ie=BigInt(1),gv=BigInt(2),Df=BigInt(3),xv=BigInt(4);function c1(t){let e=s1(t),{Fp:r}=e,n=e.toBytes||((d,p,y)=>{let x=p.toAffine();return _e(Uint8Array.from([4]),r.toBytes(x.x),r.toBytes(x.y))}),i=e.fromBytes||(d=>{let p=d.subarray(1),y=r.fromBytes(p.subarray(0,r.BYTES)),x=r.fromBytes(p.subarray(r.BYTES,2*r.BYTES));return{x:y,y:x}});function s(d){let{a:p,b:y}=e,x=r.sqr(d),v=r.mul(x,d);return r.add(r.add(v,r.mul(d,p)),y)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(d){return typeof d=="bigint"&&Ker.eql(m,r.ZERO);return v(y)&&v(x)?h.ZERO:new h(y,x,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){let y=r.invertBatch(p.map(x=>x.pz));return p.map((x,v)=>x.toAffine(y[v])).map(h.fromAffine)}static fromHex(p){let y=h.fromAffine(i(yt("pointHex",p)));return y.assertValidity(),y}static fromPrivateKey(p){return h.BASE.multiply(c(p))}_setWindowSize(p){this._WINDOW_SIZE=p,f.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:p,y}=this.toAffine();if(!r.isValid(p)||!r.isValid(y))throw new Error("bad point: x or y not FE");let x=r.sqr(y),v=s(p);if(!r.eql(x,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:p}=this.toAffine();if(r.isOdd)return!r.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){u(p);let{px:y,py:x,pz:v}=this,{px:m,py:A,pz:S}=p,B=r.eql(r.mul(y,S),r.mul(m,v)),R=r.eql(r.mul(x,S),r.mul(A,v));return B&&R}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){let{a:p,b:y}=e,x=r.mul(y,Df),{px:v,py:m,pz:A}=this,S=r.ZERO,B=r.ZERO,R=r.ZERO,_=r.mul(v,v),O=r.mul(m,m),M=r.mul(A,A),U=r.mul(v,m);return U=r.add(U,U),R=r.mul(v,A),R=r.add(R,R),S=r.mul(p,R),B=r.mul(x,M),B=r.add(S,B),S=r.sub(O,B),B=r.add(O,B),B=r.mul(S,B),S=r.mul(U,S),R=r.mul(x,R),M=r.mul(p,M),U=r.sub(_,M),U=r.mul(p,U),U=r.add(U,R),R=r.add(_,_),_=r.add(R,_),_=r.add(_,M),_=r.mul(_,U),B=r.add(B,_),M=r.mul(m,A),M=r.add(M,M),_=r.mul(M,U),S=r.sub(S,_),R=r.mul(M,O),R=r.add(R,R),R=r.add(R,R),new h(S,B,R)}add(p){u(p);let{px:y,py:x,pz:v}=this,{px:m,py:A,pz:S}=p,B=r.ZERO,R=r.ZERO,_=r.ZERO,O=e.a,M=r.mul(e.b,Df),U=r.mul(y,m),q=r.mul(x,A),z=r.mul(v,S),Z=r.add(y,x),C=r.add(m,A);Z=r.mul(Z,C),C=r.add(U,q),Z=r.sub(Z,C),C=r.add(y,v);let N=r.add(m,S);return C=r.mul(C,N),N=r.add(U,z),C=r.sub(C,N),N=r.add(x,v),B=r.add(A,S),N=r.mul(N,B),B=r.add(q,z),N=r.sub(N,B),_=r.mul(O,C),B=r.mul(M,z),_=r.add(B,_),B=r.sub(q,_),_=r.add(q,_),R=r.mul(B,_),q=r.add(U,U),q=r.add(q,U),z=r.mul(O,z),C=r.mul(M,C),q=r.add(q,z),z=r.sub(U,z),z=r.mul(O,z),C=r.add(C,z),U=r.mul(q,C),R=r.add(R,U),U=r.mul(N,C),B=r.mul(Z,B),B=r.sub(B,U),U=r.mul(Z,q),_=r.mul(N,_),_=r.add(_,U),new h(B,R,_)}subtract(p){return this.add(p.negate())}is0(){return this.equals(h.ZERO)}wNAF(p){return g.wNAFCached(this,f,p,y=>{let x=r.invertBatch(y.map(v=>v.pz));return y.map((v,m)=>v.toAffine(x[m])).map(h.fromAffine)})}multiplyUnsafe(p){let y=h.ZERO;if(p===Ke)return y;if(a(p),p===ie)return this;let{endo:x}=e;if(!x)return g.unsafeLadder(this,p);let{k1neg:v,k1:m,k2neg:A,k2:S}=x.splitScalar(p),B=y,R=y,_=this;for(;m>Ke||S>Ke;)m&ie&&(B=B.add(_)),S&ie&&(R=R.add(_)),_=_.double(),m>>=ie,S>>=ie;return v&&(B=B.negate()),A&&(R=R.negate()),R=new h(r.mul(R.px,x.beta),R.py,R.pz),B.add(R)}multiply(p){a(p);let y=p,x,v,{endo:m}=e;if(m){let{k1neg:A,k1:S,k2neg:B,k2:R}=m.splitScalar(y),{p:_,f:O}=this.wNAF(S),{p:M,f:U}=this.wNAF(R);_=g.constTimeNegate(A,_),M=g.constTimeNegate(B,M),M=new h(r.mul(M.px,m.beta),M.py,M.pz),x=_.add(M),v=O.add(U)}else{let{p:A,f:S}=this.wNAF(y);x=A,v=S}return h.normalizeZ([x,v])[0]}multiplyAndAddUnsafe(p,y,x){let v=h.BASE,m=(S,B)=>B===Ke||B===ie||!S.equals(v)?S.multiplyUnsafe(B):S.multiply(B),A=m(this,y).add(m(p,x));return A.is0()?void 0:A}toAffine(p){let{px:y,py:x,pz:v}=this,m=this.is0();p==null&&(p=m?r.ONE:r.inv(v));let A=r.mul(y,p),S=r.mul(x,p),B=r.mul(v,p);if(m)return{x:r.ZERO,y:r.ZERO};if(!r.eql(B,r.ONE))throw new Error("invZ was invalid");return{x:A,y:S}}isTorsionFree(){let{h:p,isTorsionFree:y}=e;if(p===ie)return!0;if(y)return y(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:p,clearCofactor:y}=e;return p===ie?this:y?y(h,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),n(h,this,p)}toHex(p=!0){return Ce(this.toRawBytes(p))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);let l=e.nBitLength,g=fi(h,e.endo?Math.ceil(l/2):l);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function f1(t){let e=cn(t);return ee(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function kf(t){let e=f1(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(C){return KeCe(qe(C,e.nByteLength));function d(C){let N=n>>ie;return C>N}function p(C){return d(C)?a(-C):C}let y=(C,N,T)=>Ie(C.slice(N,T));class x{constructor(N,T,L){this.r=N,this.s=T,this.recovery=L,this.assertValidity()}static fromCompact(N){let T=e.nByteLength;return N=yt("compactSignature",N,T*2),new x(y(N,0,T),y(N,T,2*T))}static fromDER(N){let{r:T,s:L}=wr.toSig(yt("DER",N));return new x(T,L)}assertValidity(){if(!l(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!l(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(N){return new x(this.r,this.s,N)}recoverPublicKey(N){let{r:T,s:L,recovery:w}=this,P=R(yt("msgHash",N));if(w==null||![0,1,2,3].includes(w))throw new Error("recovery id invalid");let K=w===2||w===3?T+e.n:T;if(K>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let V=w&1?"03":"02",W=f.fromHex(V+g(K)),Y=c(K),et=a(-P*Y),X=a(L*Y),J=f.BASE.multiplyAndAddUnsafe(W,et,X);if(!J)throw new Error("point at infinify");return J.assertValidity(),J}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return ir(this.toDERHex())}toDERHex(){return wr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ir(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}let v={isValidPrivateKey(C){try{return u(C),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let C=Is(e.n);return Xa(e.randomBytes(C),e.n)},precompute(C=8,N=f.BASE){return N._setWindowSize(C),N.multiply(BigInt(3)),N}};function m(C,N=!0){return f.fromPrivateKey(C).toRawBytes(N)}function A(C){let N=C instanceof Uint8Array,T=typeof C=="string",L=(N||T)&&C.length;return N?L===i||L===s:T?L===2*i||L===2*s:C instanceof f}function S(C,N,T=!0){if(A(C))throw new Error("first arg must be private key");if(!A(N))throw new Error("second arg must be public key");return f.fromHex(N).multiply(u(C)).toRawBytes(T)}let B=e.bits2int||function(C){let N=Ie(C),T=C.length*8-e.nBitLength;return T>0?N>>BigInt(T):N},R=e.bits2int_modN||function(C){return a(B(C))},_=an(e.nBitLength);function O(C){if(typeof C!="bigint")throw new Error("bigint expected");if(!(Ke<=C&&C<_))throw new Error(`bigint expected < 2^${e.nBitLength}`);return qe(C,e.nByteLength)}function M(C,N,T=U){if(["recovered","canonical"].some(ut=>ut in T))throw new Error("sign() legacy options not supported");let{hash:L,randomBytes:w}=e,{lowS:P,prehash:K,extraEntropy:V}=T;P==null&&(P=!0),C=yt("msgHash",C),K&&(C=yt("prehashed msgHash",L(C)));let W=R(C),Y=u(N),et=[O(Y),O(W)];if(V!=null){let ut=V===!0?w(r.BYTES):V;et.push(yt("extraEntropy",ut))}let X=_e(...et),J=W;function dt(ut){let Ut=B(ut);if(!l(Ut))return;let Kt=c(Ut),Ct=f.BASE.multiply(Ut).toAffine(),Vt=a(Ct.x);if(Vt===Ke)return;let Se=a(Kt*a(J+Vt*Y));if(Se===Ke)return;let tr=(Ct.x===Vt?0:2)|Number(Ct.y&ie),rn=Se;return P&&d(Se)&&(rn=p(Se),tr^=1),new x(Vt,rn,tr)}return{seed:X,k2sig:dt}}let U={lowS:e.lowS,prehash:!1},q={lowS:e.lowS,prehash:!1};function z(C,N,T=U){let{seed:L,k2sig:w}=M(C,N,T),P=e;return Es(P.hash.outputLen,P.nByteLength,P.hmac)(L,w)}f.BASE._setWindowSize(8);function Z(C,N,T,L=q){let w=C;if(N=yt("msgHash",N),T=yt("publicKey",T),"strict"in L)throw new Error("options.strict was renamed to lowS");let{lowS:P,prehash:K}=L,V,W;try{if(typeof w=="string"||w instanceof Uint8Array)try{V=x.fromDER(w)}catch(Ct){if(!(Ct instanceof wr.Err))throw Ct;V=x.fromCompact(w)}else if(typeof w=="object"&&typeof w.r=="bigint"&&typeof w.s=="bigint"){let{r:Ct,s:Vt}=w;V=new x(Ct,Vt)}else throw new Error("PARSE");W=f.fromHex(T)}catch(Ct){if(Ct.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(P&&V.hasHighS())return!1;K&&(N=e.hash(N));let{r:Y,s:et}=V,X=R(N),J=c(et),dt=a(X*J),ut=a(Y*J),Ut=f.BASE.multiplyAndAddUnsafe(W,dt,ut)?.toAffine();return Ut?a(Ut.x)===Y:!1}return{CURVE:e,getPublicKey:m,getSharedSecret:S,sign:z,verify:Z,ProjectivePoint:f,Signature:x,utils:v}}function u1(t){return{hash:t,hmac:(e,...r)=>Rr(t,e,ei(...r)),randomBytes:nr}}function Pf(t,e){let r=n=>kf({...t,...u1(n)});return Object.freeze({...r(e),create:r})}var Of=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Uf=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h1=BigInt(1),Go=BigInt(2),Kf=(t,e)=>(t+e/Go)/e;function l1(t){let e=Of,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),f=t*t*t%e,u=f*f*t%e,h=gt(u,r,e)*u%e,l=gt(h,r,e)*u%e,g=gt(l,Go,e)*f%e,d=gt(g,i,e)*g%e,p=gt(d,s,e)*d%e,y=gt(p,a,e)*p%e,x=gt(y,c,e)*y%e,v=gt(x,a,e)*p%e,m=gt(v,r,e)*u%e,A=gt(m,o,e)*d%e,S=gt(A,n,e)*f%e,B=gt(S,Go,e);if(!$o.eql($o.sqr(B),t))throw new Error("Cannot find square root");return B}var $o=ci(Of,void 0,void 0,{sqrt:l1}),Oe=Pf({a:BigInt(0),b:BigInt(7),Fp:$o,n:Uf,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=Uf,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-h1*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=Kf(s*t,e),c=Kf(-n*t,e),f=at(t-a*r-c*i,e),u=at(-a*n-c*s,e),h=f>o,l=u>o;if(h&&(f=e-f),l&&(u=e-u),f>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:f,k2neg:l,k2:u}}}},Nr),Cv=BigInt(0);var Iv=Oe.ProjectivePoint;function Mf(){return Oe.utils.randomPrivateKey()}async function Ff(t,e){let{digest:r}=await Ft.digest(e);try{return Oe.sign(r,t).toDERRawBytes()}catch(n){throw new it(String(n),"ERR_INVALID_INPUT")}}async function Vf(t,e,r){try{let{digest:n}=await Ft.digest(r);return Oe.verify(e,n,t)}catch(n){throw new it(String(n),"ERR_INVALID_INPUT")}}function Hf(t){return Oe.ProjectivePoint.fromHex(t).toRawBytes(!0)}function qf(t){try{Oe.getPublicKey(t,!0)}catch(e){throw new it(String(e),"ERR_INVALID_PRIVATE_KEY")}}function Wo(t){try{Oe.ProjectivePoint.fromHex(t)}catch(e){throw new it(String(e),"ERR_INVALID_PUBLIC_KEY")}}function zf(t){try{return Oe.getPublicKey(t,!0)}catch(e){throw new it(String(e),"ERR_INVALID_PRIVATE_KEY")}}var Dn=class{_key;constructor(e){Wo(e),this._key=e}async verify(e,r){return Vf(this._key,r,e)}marshal(){return Hf(this._key)}get bytes(){return we.encode({Type:wt.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},kn=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r??zf(e),qf(this._key),Wo(this._publicKey)}async sign(e){return Ff(this._key,e)}get public(){return new Dn(this._publicKey)}marshal(){return this._key}get bytes(){return Ee.encode({Type:wt.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=await this.public.hash();return Et(e,"base58btc")}async export(e,r="libp2p-key"){if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function p1(t){return new kn(t)}function y1(t){return new Dn(t)}async function g1(){let t=Mf();return new kn(t)}var Er={rsa:zo,ed25519:Mo,secp256k1:Yo};function Gf(t){let e=Object.keys(Er).join(" / ");return new it(`invalid or unsupported key type ${t}. Must be ${e}`,"ERR_UNSUPPORTED_KEY_TYPE")}function $f(t){let e=we.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case wt.RSA:return Er.rsa.unmarshalRsaPublicKey(r);case wt.Ed25519:return Er.ed25519.unmarshalEd25519PublicKey(r);case wt.Secp256k1:return Er.secp256k1.unmarshalSecp256k1PublicKey(r);default:throw Gf(e.Type??"unknown")}}async function Wf(t){let e=Ee.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case wt.RSA:return Er.rsa.unmarshalRsaPrivateKey(r);case wt.Ed25519:return Er.ed25519.unmarshalEd25519PrivateKey(r);case wt.Secp256k1:return Er.secp256k1.unmarshalSecp256k1PrivateKey(r);default:throw Gf(e.Type??"RSA")}}var Yf=Symbol.for("@libp2p/peer-id");var m1=Symbol.for("nodejs.util.inspect.custom"),Zf=Object.values(zr).map(t=>t.decoder).reduce((t,e)=>t.or(e),zr.identity.decoder),Xf=114,Zo=36,Xo=37,Pn=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[Yf]=!0;toString(){return this.string==null&&(this.string=Mt.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return lr.createV1(Xf,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return Lt(this.multihash.bytes,e);if(typeof e=="string")return b1(e).equals(this);if(e?.multihash?.bytes!=null)return Lt(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[m1](){return`PeerId(${this.toString()})`}},Xr=class extends Pn{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},Qr=class extends Pn{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},Jr=class extends Pn{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function b1(t,e){if(e=e??Zf,t.charAt(0)==="1"||t.charAt(0)==="Q"){let r=Sn(Mt.decode(`z${t}`));return t.startsWith("12D")?new Qr({multihash:r}):t.startsWith("16U")?new Jr({multihash:r}):new Xr({multihash:r})}return v1(Zf.decode(t))}function v1(t){try{let e=Sn(t);if(e.code===Je.code){if(e.digest.length===Zo)return new Qr({multihash:e});if(e.digest.length===Xo)return new Jr({multihash:e})}if(e.code===Ft.code)return new Xr({multihash:e})}catch{return w1(lr.decode(t))}throw new Error("Supplied PeerID CID is invalid")}function w1(t){if(t==null||t.multihash==null||t.version==null||t.version===1&&t.code!==Xf)throw new Error("Supplied PeerID CID is invalid");let e=t.multihash;if(e.code===Ft.code)return new Xr({multihash:t.multihash});if(e.code===Je.code){if(e.digest.length===Zo)return new Qr({multihash:t.multihash});if(e.digest.length===Xo)return new Jr({multihash:t.multihash})}throw new Error("Supplied PeerID CID is invalid")}async function Qo(t,e){return t.length===Zo?new Qr({multihash:ve(Je.code,t),privateKey:e}):t.length===Xo?new Jr({multihash:ve(Je.code,t),privateKey:e}):new Xr({multihash:await Ft.digest(t),publicKey:t,privateKey:e})}var Fi;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{if(i.lengthDelimited!==!1&&n.fork(),r.webtransportCerthashes!=null)for(let s of r.webtransportCerthashes)n.uint32(10),n.bytes(s);i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={webtransportCerthashes:[]},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:{i.webtransportCerthashes.push(r.bytes());break}default:{r.skipType(o&7);break}}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Fi||(Fi={}));var Un;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.identityKey!=null&&r.identityKey.byteLength>0&&(n.uint32(10),n.bytes(r.identityKey)),r.identitySig!=null&&r.identitySig.byteLength>0&&(n.uint32(18),n.bytes(r.identitySig)),r.extensions!=null&&(n.uint32(34),Fi.codec().encode(r.extensions,n)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={identityKey:rt(0),identitySig:rt(0)},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:{i.identityKey=r.bytes();break}case 2:{i.identitySig=r.bytes();break}case 4:{i.extensions=Fi.codec().decode(r,r.uint32());break}default:{r.skipType(o&7);break}}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Un||(Un={}));async function Qf(t,e,r){let n=await S1(t,Jf(e));if(t.publicKey==null)throw new Error("PublicKey was missing from local PeerId");return E1(t.publicKey,n,r)}function E1(t,e,r){return Un.encode({identityKey:t,identitySig:e,extensions:r??{webtransportCerthashes:[]}}).subarray()}async function S1(t,e){if(t.privateKey==null)throw new Error("PrivateKey was missing from PeerId");return(await Wf(t.privateKey)).sign(e)}async function Jo(t){return Qo(t.identityKey)}function jo(t){return Un.decode(t)}function Jf(t){let e=At("noise-libp2p-static-key:");return Gt([e,t],e.length+t.length)}async function ta(t,e,r){let n=await Qo(e.identityKey);if(!n.equals(r))throw new Error(`Payload identity key ${n.toString()} does not match expected remote peer ${r.toString()}`);let i=Jf(t);if(n.publicKey==null)throw new Error("PublicKey was missing from PeerId");if(e.identitySig==null)throw new Error("Signature was missing from message");if(!await $f(n.publicKey).verify(i,e.identitySig))throw new Error("Static key doesn't match to peer that signed payload!");return n}function Kn(t){return!(!(t instanceof Uint8Array)||t.length!==32)}var te=zt(nu(),1);te.default.formatters.b=t=>t==null?"undefined":Mt.baseEncode(t);te.default.formatters.t=t=>t==null?"undefined":Qe.baseEncode(t);te.default.formatters.m=t=>t==null?"undefined":Mr.baseEncode(t);te.default.formatters.p=t=>t==null?"undefined":t.toString();te.default.formatters.c=t=>t==null?"undefined":t.toString();te.default.formatters.k=t=>t==null?"undefined":t.toString();te.default.formatters.a=t=>t==null?"undefined":t.toString();function U1(t){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=t,e.destroy=()=>!0,e.extend=()=>e,e}function iu(t){let e=U1(`${t}:trace`);return te.default.enabled(`${t}:trace`)&&te.default.names.map(r=>r.toString()).find(r=>r.includes(":trace"))!=null&&(e=(0,te.default)(`${t}:trace`)),Object.assign((0,te.default)(t),{error:(0,te.default)(`${t}:error`),trace:e})}var Pt=iu("libp2p:noise");var se;Ia?se=Pt:se=Object.assign(()=>{},{enabled:!1,trace:()=>{},error:()=>{}});function su(t){se(`LOCAL_STATIC_PUBLIC_KEY ${Et(t.publicKey,"hex")}`),se(`LOCAL_STATIC_PRIVATE_KEY ${Et(t.privateKey,"hex")}`)}function ea(t){t?(se(`LOCAL_PUBLIC_EPHEMERAL_KEY ${Et(t.publicKey,"hex")}`),se(`LOCAL_PRIVATE_EPHEMERAL_KEY ${Et(t.privateKey,"hex")}`)):se("Missing local ephemeral keys.")}function ou(t){se(`REMOTE_STATIC_PUBLIC_KEY ${Et(t,"hex")}`)}function ra(t){se(`REMOTE_EPHEMERAL_PUBLIC_KEY ${Et(t,"hex")}`)}function au(t){t.cs1&&t.cs2?(se(`CIPHER_STATE_1 ${t.cs1.n.getUint64()} ${Et(t.cs1.k,"hex")}`),se(`CIPHER_STATE_2 ${t.cs2.n.getUint64()} ${Et(t.cs2.k,"hex")}`)):se("Missing cipher state.")}var K1=0,O1=4294967295,M1="Cipherstate has reached maximum n, a new handshake must be performed",qi=class{n;bytes;view;constructor(e=K1){this.n=e,this.bytes=rt(12),this.view=new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength),this.view.setUint32(4,e,!0)}increment(){this.n++,this.view.setUint32(4,this.n,!0)}getBytes(){return this.bytes}getUint64(){return this.n}assertValue(){if(this.n>O1)throw new Error(M1)}};var zi=class{crypto;constructor(e){this.crypto=e}encryptWithAd(e,r,n){let i=this.encrypt(e.k,e.n,r,n);return e.n.increment(),i}decryptWithAd(e,r,n,i){let{plaintext:s,valid:o}=this.decrypt(e.k,e.n,r,n,i);return o&&e.n.increment(),{plaintext:s,valid:o}}hasKey(e){return!this.isEmptyKey(e.k)}createEmptyKey(){return rt(32)}isEmptyKey(e){let r=this.createEmptyKey();return Lt(r,e)}encrypt(e,r,n,i){return r.assertValue(),this.crypto.chaCha20Poly1305Encrypt(i,r.getBytes(),n,e)}encryptAndHash(e,r){let n;return this.hasKey(e.cs)?n=this.encryptWithAd(e.cs,e.h,r):n=r,this.mixHash(e,n),n}decrypt(e,r,n,i,s){r.assertValue();let o=this.crypto.chaCha20Poly1305Decrypt(i,r.getBytes(),n,e,s);return o?{plaintext:o,valid:!0}:{plaintext:rt(0),valid:!1}}decryptAndHash(e,r){let n,i=!0;return this.hasKey(e.cs)?{plaintext:n,valid:i}=this.decryptWithAd(e.cs,e.h,r):n=r,this.mixHash(e,r),{plaintext:n,valid:i}}dh(e,r){try{let n=this.crypto.generateX25519SharedKey(e,r);return n.length===32?n:n.subarray(0,32)}catch(n){let i=n;return Pt.error(i),rt(32)}}mixHash(e,r){e.h=this.getHash(e.h,r)}getHash(e,r){return this.crypto.hashSHA256(Gt([e,r],e.length+r.length))}mixKey(e,r){let[n,i]=this.crypto.getHKDF(e.ck,r);e.cs=this.initializeKey(i),e.ck=n}initializeKey(e){return{k:e,n:new qi}}initializeSymmetric(e){let r=At(e,"utf-8"),n=this.hashProtocolName(r),i=n,s=this.createEmptyKey();return{cs:this.initializeKey(s),ck:i,h:n}}hashProtocolName(e){if(e.length<=32){let r=rt(32);return r.set(e),r}else return this.getHash(e,rt(0))}split(e){let[r,n]=this.crypto.getHKDF(e.ck,rt(0)),i=this.initializeKey(r),s=this.initializeKey(n);return{cs1:i,cs2:s}}writeMessageRegular(e,r){let n=this.encryptWithAd(e,rt(0),r),i=this.createEmptyKey(),s=rt(0);return{ne:i,ns:s,ciphertext:n}}readMessageRegular(e,r){return this.decryptWithAd(e,rt(0),r.ciphertext)}};var Gi=class extends zi{initializeInitiator(e,r,n,i){let s="Noise_XX_25519_ChaChaPoly_SHA256",o=this.initializeSymmetric(s);this.mixHash(o,e);let a=rt(32);return{ss:o,s:r,rs:n,psk:i,re:a}}initializeResponder(e,r,n,i){let s="Noise_XX_25519_ChaChaPoly_SHA256",o=this.initializeSymmetric(s);this.mixHash(o,e);let a=rt(32);return{ss:o,s:r,rs:n,psk:i,re:a}}writeMessageA(e,r,n){let i=rt(0);n!==void 0?e.e=n:e.e=this.crypto.generateX25519KeyPair();let s=e.e.publicKey;this.mixHash(e.ss,s);let o=this.encryptAndHash(e.ss,r);return{ne:s,ns:i,ciphertext:o}}writeMessageB(e,r){e.e=this.crypto.generateX25519KeyPair();let n=e.e.publicKey;this.mixHash(e.ss,n),this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));let i=e.s.publicKey,s=this.encryptAndHash(e.ss,i);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));let o=this.encryptAndHash(e.ss,r);return{ne:n,ns:s,ciphertext:o}}writeMessageC(e,r){let n=e.s.publicKey,i=this.encryptAndHash(e.ss,n);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));let s=this.encryptAndHash(e.ss,r),a={ne:this.createEmptyKey(),ns:i,ciphertext:s},{cs1:c,cs2:f}=this.split(e.ss);return{h:e.ss.h,messageBuffer:a,cs1:c,cs2:f}}readMessageA(e,r){return Kn(r.ne)&&(e.re=r.ne),this.mixHash(e.ss,e.re),this.decryptAndHash(e.ss,r.ciphertext)}readMessageB(e,r){if(Kn(r.ne)&&(e.re=r.ne),this.mixHash(e.ss,e.re),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));let{plaintext:n,valid:i}=this.decryptAndHash(e.ss,r.ns);i&&Kn(n)&&(e.rs=n),this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));let{plaintext:s,valid:o}=this.decryptAndHash(e.ss,r.ciphertext);return{plaintext:s,valid:i&&o}}readMessageC(e,r){let{plaintext:n,valid:i}=this.decryptAndHash(e.ss,r.ns);if(i&&Kn(n)&&(e.rs=n),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));let{plaintext:s,valid:o}=this.decryptAndHash(e.ss,r.ciphertext),{cs1:a,cs2:c}=this.split(e.ss);return{h:e.ss.h,plaintext:s,valid:i&&o,cs1:a,cs2:c}}initSession(e,r,n){let i=this.createEmptyKey(),s=rt(32),o;return e?o=this.initializeInitiator(r,n,s,i):o=this.initializeResponder(r,n,s,i),{hs:o,i:e,mc:0}}sendMessage(e,r,n){let i;if(e.mc===0)i=this.writeMessageA(e.hs,r,n);else if(e.mc===1)i=this.writeMessageB(e.hs,r);else if(e.mc===2){let{h:s,messageBuffer:o,cs1:a,cs2:c}=this.writeMessageC(e.hs,r);i=o,e.h=s,e.cs1=a,e.cs2=c}else if(e.mc>2)if(e.i){if(!e.cs1)throw new Error("CS1 (cipher state) is not defined");i=this.writeMessageRegular(e.cs1,r)}else{if(!e.cs2)throw new Error("CS2 (cipher state) is not defined");i=this.writeMessageRegular(e.cs2,r)}else throw new Error("Session invalid.");return e.mc++,i}recvMessage(e,r){let n=rt(0),i=!1;if(e.mc===0)({plaintext:n,valid:i}=this.readMessageA(e.hs,r));else if(e.mc===1)({plaintext:n,valid:i}=this.readMessageB(e.hs,r));else if(e.mc===2){let{h:s,plaintext:o,valid:a,cs1:c,cs2:f}=this.readMessageC(e.hs,r);n=o,i=a,e.h=s,e.cs1=c,e.cs2=f}return e.mc++,{plaintext:n,valid:i}}};var $i=class{isInitiator;session;remotePeer;remoteExtensions={webtransportCerthashes:[]};payload;connection;xx;staticKeypair;prologue;constructor(e,r,n,i,s,o,a,c){this.isInitiator=e,this.payload=r,this.prologue=n,this.staticKeypair=s,this.connection=o,a&&(this.remotePeer=a),this.xx=c??new Gi(i),this.session=this.xx.initSession(this.isInitiator,this.prologue,this.staticKeypair)}async propose(){if(su(this.session.hs.s),this.isInitiator){Pt.trace("Stage 0 - Initiator starting to send first message.");let e=this.xx.sendMessage(this.session,rt(0));await this.connection.write(c0(e)),Pt.trace("Stage 0 - Initiator finished sending first message."),ea(this.session.hs.e)}else{Pt.trace("Stage 0 - Responder waiting to receive first message...");let e=h0((await this.connection.read()).subarray()),{valid:r}=this.xx.recvMessage(this.session,e);if(!r)throw new or("xx handshake stage 0 validation fail");Pt.trace("Stage 0 - Responder received first message."),ra(this.session.hs.re)}}async exchange(){if(this.isInitiator){Pt.trace("Stage 1 - Initiator waiting to receive first message from responder...");let e=l0((await this.connection.read()).subarray()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new or("xx handshake stage 1 validation fail");Pt.trace("Stage 1 - Initiator received the message."),ra(this.session.hs.re),ou(this.session.hs.rs),Pt.trace("Initiator going to check remote's signature...");try{let i=jo(r);this.remotePeer=this.remotePeer||await Jo(i),await ta(this.session.hs.rs,i,this.remotePeer),this.setRemoteNoiseExtension(i.extensions)}catch(i){let s=i;throw new pn(`Error occurred while verifying signed payload: ${s.message}`)}Pt.trace("All good with the signature!")}else{Pt.trace("Stage 1 - Responder sending out first message with signed payload and static key.");let e=this.xx.sendMessage(this.session,this.payload);await this.connection.write(f0(e)),Pt.trace("Stage 1 - Responder sent the second handshake message with signed payload."),ea(this.session.hs.e)}}async finish(){if(this.isInitiator){Pt.trace("Stage 2 - Initiator sending third handshake message.");let e=this.xx.sendMessage(this.session,this.payload);await this.connection.write(u0(e)),Pt.trace("Stage 2 - Initiator sent message with signed payload.")}else{Pt.trace("Stage 2 - Responder waiting for third handshake message...");let e=d0((await this.connection.read()).subarray()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new or("xx handshake stage 2 validation fail");Pt.trace("Stage 2 - Responder received the message, finished handshake.");try{let i=jo(r);this.remotePeer=this.remotePeer||await Jo(i),await ta(this.session.hs.rs,i,this.remotePeer),this.setRemoteNoiseExtension(i.extensions)}catch(i){let s=i;throw new pn(`Error occurred while verifying signed payload: ${s.message}`)}}au(this.session)}encrypt(e,r){let n=this.getCS(r);return this.xx.encryptWithAd(n,rt(0),e)}decrypt(e,r,n){let i=this.getCS(r,!1);return this.xx.decryptWithAd(i,rt(0),e,n)}getRemoteStaticKey(){return this.session.hs.rs}getCS(e,r=!0){if(!e.cs1||!e.cs2)throw new or("Handshake not completed properly, cipher state does not exist.");return this.isInitiator?r?e.cs1:e.cs2:r?e.cs2:e.cs1}setRemoteNoiseExtension(e){e&&(this.remoteExtensions=e)}};function cu(t){return{xxHandshakeSuccesses:t.registerCounter("libp2p_noise_xxhandshake_successes_total",{help:"Total count of noise xxHandshakes successes_"}),xxHandshakeErrors:t.registerCounter("libp2p_noise_xxhandshake_error_total",{help:"Total count of noise xxHandshakes errors"}),encryptedPackets:t.registerCounter("libp2p_noise_encrypted_packets_total",{help:"Total count of noise encrypted packets successfully"}),decryptedPackets:t.registerCounter("libp2p_noise_decrypted_packets_total",{help:"Total count of noise decrypted packets"}),decryptErrors:t.registerCounter("libp2p_noise_decrypt_errors_total",{help:"Total count of noise decrypt errors"})}}var Wi=class{protocol="/noise";crypto;prologue;staticKeys;extensions;metrics;constructor(e={}){let{staticNoiseKey:r,extensions:n,crypto:i,prologueBytes:s,metrics:o}=e;this.crypto=i??a0,this.extensions=n,this.metrics=o?cu(o):void 0,r?this.staticKeys=this.crypto.generateX25519KeyPairFromSeed(r):this.staticKeys=this.crypto.generateX25519KeyPair(),this.prologue=s??rt(0)}async secureOutbound(e,r,n){let i=ns(r,{lengthEncoder:Dr,lengthDecoder:ln,maxDataLength:65535}),s=await this.performHandshake({connection:i,isInitiator:!0,localPeer:e,remotePeer:n}),o=await this.createSecureConnection(i,s);return r.source=o.source,r.sink=o.sink,{conn:r,remoteExtensions:s.remoteExtensions,remotePeer:s.remotePeer}}async secureInbound(e,r,n){let i=ns(r,{lengthEncoder:Dr,lengthDecoder:ln,maxDataLength:65535}),s=await this.performHandshake({connection:i,isInitiator:!1,localPeer:e,remotePeer:n}),o=await this.createSecureConnection(i,s);return r.source=o.source,r.sink=o.sink,{conn:r,remotePeer:s.remotePeer,remoteExtensions:s.remoteExtensions}}async performHandshake(e){let r=await Qf(e.localPeer,this.staticKeys.publicKey,this.extensions);return this.performXXHandshake(e,r)}async performXXHandshake(e,r){let{isInitiator:n,remotePeer:i,connection:s}=e,o=new $i(n,r,this.prologue,this.crypto,this.staticKeys,s,i);try{await o.propose(),await o.exchange(),await o.finish(),this.metrics?.xxHandshakeSuccesses.increment()}catch(a){if(this.metrics?.xxHandshakeErrors.increment(),a instanceof Error)throw a.message=`Error occurred during XX handshake: ${a.message}`,a}return o}async createSecureConnection(e,r){let[n,i]=Ea(),s=e.unwrap();return await Ba(n,g0(r,this.metrics),s,o=>sn(o,{lengthDecoder:ln}),x0(r,this.metrics),n),i}};function F1(t={}){return()=>new Wi(t)}return Eu(V1);})(); -/*! Bundled license information: - -@noble/ciphers/esm/utils.js: - (*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *) - -@noble/hashes/esm/utils.js: - (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/modular.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/curve.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/edwards.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/montgomery.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/ed25519.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/weierstrass.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/_shortw_utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/secp256k1.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) -*/ -return ChainsafeLibp2PNoise})); diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/basic.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/basic.d.ts deleted file mode 100644 index 5b8bbb19b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/basic.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type bytes = Uint8Array; -export type bytes32 = Uint8Array; -export type bytes16 = Uint8Array; -export type uint64 = number; -//# sourceMappingURL=basic.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/basic.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/basic.d.ts.map deleted file mode 100644 index eeee2bada..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/basic.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../src/@types/basic.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG,UAAU,CAAA;AAC9B,MAAM,MAAM,OAAO,GAAG,UAAU,CAAA;AAChC,MAAM,MAAM,OAAO,GAAG,UAAU,CAAA;AAEhC,MAAM,MAAM,MAAM,GAAG,MAAM,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/basic.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/basic.js deleted file mode 100644 index f839d2b8c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/basic.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=basic.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/basic.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/basic.js.map deleted file mode 100644 index aa623d697..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/basic.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"basic.js","sourceRoot":"","sources":["../../../src/@types/basic.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake-interface.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake-interface.d.ts deleted file mode 100644 index 40a820d88..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake-interface.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { bytes } from './basic.js'; -import type { NoiseSession } from './handshake.js'; -import type { NoiseExtensions } from '../proto/payload.js'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export interface IHandshake { - session: NoiseSession; - remotePeer: PeerId; - remoteExtensions: NoiseExtensions; - encrypt: (plaintext: bytes, session: NoiseSession) => bytes; - decrypt: (ciphertext: bytes, session: NoiseSession, dst?: Uint8Array) => { - plaintext: bytes; - valid: boolean; - }; -} -//# sourceMappingURL=handshake-interface.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake-interface.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake-interface.d.ts.map deleted file mode 100644 index 2b64678a8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake-interface.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake-interface.d.ts","sourceRoot":"","sources":["../../../src/@types/handshake-interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,YAAY,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,eAAe,CAAA;IACjC,OAAO,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,KAAK,KAAK,CAAA;IAC3D,OAAO,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,UAAU,KAAK;QAAE,SAAS,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAA;CAC9G"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake-interface.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake-interface.js deleted file mode 100644 index 6cb504ea8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake-interface.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=handshake-interface.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake-interface.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake-interface.js.map deleted file mode 100644 index f59aae35f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake-interface.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake-interface.js","sourceRoot":"","sources":["../../../src/@types/handshake-interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake.d.ts deleted file mode 100644 index 558a55238..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { bytes, bytes32, uint64 } from './basic.js'; -import type { KeyPair } from './libp2p.js'; -import type { Nonce } from '../nonce.js'; -export type Hkdf = [bytes, bytes, bytes]; -export interface MessageBuffer { - ne: bytes32; - ns: bytes; - ciphertext: bytes; -} -export interface CipherState { - k: bytes32; - n: Nonce; -} -export interface SymmetricState { - cs: CipherState; - ck: bytes32; - h: bytes32; -} -export interface HandshakeState { - ss: SymmetricState; - s: KeyPair; - e?: KeyPair; - rs: bytes32; - re: bytes32; - psk: bytes32; -} -export interface NoiseSession { - hs: HandshakeState; - h?: bytes32; - cs1?: CipherState; - cs2?: CipherState; - mc: uint64; - i: boolean; -} -export interface INoisePayload { - identityKey: bytes; - identitySig: bytes; - data: bytes; -} -//# sourceMappingURL=handshake.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake.d.ts.map deleted file mode 100644 index e4a428b8e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake.d.ts","sourceRoot":"","sources":["../../../src/@types/handshake.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAExC,MAAM,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;AAExC,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAA;IACX,EAAE,EAAE,KAAK,CAAA;IACT,UAAU,EAAE,KAAK,CAAA;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,OAAO,CAAA;IAGV,CAAC,EAAE,KAAK,CAAA;CACT;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,WAAW,CAAA;IACf,EAAE,EAAE,OAAO,CAAA;IACX,CAAC,EAAE,OAAO,CAAA;CACX;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,cAAc,CAAA;IAClB,CAAC,EAAE,OAAO,CAAA;IACV,CAAC,CAAC,EAAE,OAAO,CAAA;IACX,EAAE,EAAE,OAAO,CAAA;IACX,EAAE,EAAE,OAAO,CAAA;IACX,GAAG,EAAE,OAAO,CAAA;CACb;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,cAAc,CAAA;IAClB,CAAC,CAAC,EAAE,OAAO,CAAA;IACX,GAAG,CAAC,EAAE,WAAW,CAAA;IACjB,GAAG,CAAC,EAAE,WAAW,CAAA;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,CAAC,EAAE,OAAO,CAAA;CACX;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,KAAK,CAAA;IAClB,WAAW,EAAE,KAAK,CAAA;IAClB,IAAI,EAAE,KAAK,CAAA;CACZ"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake.js deleted file mode 100644 index 39c1bf13f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=handshake.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake.js.map deleted file mode 100644 index bed86a99f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/handshake.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake.js","sourceRoot":"","sources":["../../../src/@types/handshake.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/libp2p.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/libp2p.d.ts deleted file mode 100644 index d573b2ab6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/libp2p.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { bytes32 } from './basic.js'; -import type { NoiseExtensions } from '../proto/payload.js'; -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter'; -export interface KeyPair { - publicKey: bytes32; - privateKey: bytes32; -} -export interface INoiseConnection extends ConnectionEncrypter { -} -//# sourceMappingURL=libp2p.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/libp2p.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/libp2p.d.ts.map deleted file mode 100644 index 07f8bb308..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/libp2p.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"libp2p.d.ts","sourceRoot":"","sources":["../../../src/@types/libp2p.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAEjF,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB,CAAC,eAAe,CAAC;CAAG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/libp2p.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/libp2p.js deleted file mode 100644 index 9b5e5678e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/libp2p.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=libp2p.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/libp2p.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/libp2p.js.map deleted file mode 100644 index efd4520e6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/@types/libp2p.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"libp2p.js","sourceRoot":"","sources":["../../../src/@types/libp2p.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/constants.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/constants.d.ts deleted file mode 100644 index 576fb1857..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/constants.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare const NOISE_MSG_MAX_LENGTH_BYTES = 65535; -export declare const NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG: number; -export declare const DUMP_SESSION_KEYS: boolean; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/constants.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/constants.d.ts.map deleted file mode 100644 index 8bb0fa819..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,QAAQ,CAAA;AAC/C,eAAO,MAAM,sCAAsC,QAAkC,CAAA;AAErF,eAAO,MAAM,iBAAiB,SAAsD,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/constants.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/constants.js deleted file mode 100644 index e1381b284..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/constants.js +++ /dev/null @@ -1,4 +0,0 @@ -export const NOISE_MSG_MAX_LENGTH_BYTES = 65535; -export const NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG = NOISE_MSG_MAX_LENGTH_BYTES - 16; -export const DUMP_SESSION_KEYS = Boolean(globalThis.process?.env?.DUMP_SESSION_KEYS); -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/constants.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/constants.js.map deleted file mode 100644 index d21a05013..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAA;AAC/C,MAAM,CAAC,MAAM,sCAAsC,GAAG,0BAA0B,GAAG,EAAE,CAAA;AAErF,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto.d.ts deleted file mode 100644 index c98b18b9a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { bytes32, bytes } from './@types/basic.js'; -import type { Hkdf } from './@types/handshake.js'; -import type { KeyPair } from './@types/libp2p.js'; -export interface ICryptoInterface { - hashSHA256: (data: Uint8Array) => Uint8Array; - getHKDF: (ck: bytes32, ikm: Uint8Array) => Hkdf; - generateX25519KeyPair: () => KeyPair; - generateX25519KeyPairFromSeed: (seed: Uint8Array) => KeyPair; - generateX25519SharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Uint8Array; - chaCha20Poly1305Encrypt: (plaintext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32) => bytes; - chaCha20Poly1305Decrypt: (ciphertext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array) => bytes | null; -} -//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto.d.ts.map deleted file mode 100644 index 21fb764ad..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,UAAU,CAAA;IAE5C,OAAO,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,KAAK,IAAI,CAAA;IAE/C,qBAAqB,EAAE,MAAM,OAAO,CAAA;IACpC,6BAA6B,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAA;IAC5D,uBAAuB,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,KAAK,UAAU,CAAA;IAEtF,uBAAuB,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,KAAK,KAAK,CAAA;IACxG,uBAAuB,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,UAAU,KAAK,KAAK,GAAG,IAAI,CAAA;CACnI"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto.js deleted file mode 100644 index d4b4414d0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto.js.map deleted file mode 100644 index e85268dce..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.browser.d.ts deleted file mode 100644 index c819d1f23..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.browser.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const defaultCrypto: import("..").ICryptoInterface; -//# sourceMappingURL=index.browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.browser.d.ts.map deleted file mode 100644 index 8ae396c49..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../../../src/crypto/index.browser.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,+BAAe,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.browser.js deleted file mode 100644 index 04eea2a62..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.browser.js +++ /dev/null @@ -1,3 +0,0 @@ -import { pureJsCrypto } from './js'; -export const defaultCrypto = pureJsCrypto; -//# sourceMappingURL=index.browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.browser.js.map deleted file mode 100644 index e96421aa8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../../../src/crypto/index.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAEnC,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.d.ts deleted file mode 100644 index cf8aff630..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ICryptoInterface } from '../crypto.js'; -export declare const defaultCrypto: ICryptoInterface; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.d.ts.map deleted file mode 100644 index 5f7efefc8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crypto/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AA2DpD,eAAO,MAAM,aAAa,EAAE,gBA+E3B,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.js deleted file mode 100644 index bde9ae3dd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.js +++ /dev/null @@ -1,138 +0,0 @@ -import crypto from 'node:crypto'; -import { newInstance, ChaCha20Poly1305 } from '@chainsafe/as-chacha20poly1305'; -import { digest } from '@chainsafe/as-sha256'; -import { isElectronMain } from 'wherearewe'; -import { pureJsCrypto } from './js.js'; -const ctx = newInstance(); -const asImpl = new ChaCha20Poly1305(ctx); -const CHACHA_POLY1305 = 'chacha20-poly1305'; -const PKCS8_PREFIX = Buffer.from([0x30, 0x2e, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x04, 0x22, 0x04, 0x20]); -const X25519_PREFIX = Buffer.from([0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x03, 0x21, 0x00]); -const nodeCrypto = { - hashSHA256(data) { - return crypto.createHash('sha256').update(data).digest(); - }, - chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - const cipher = crypto.createCipheriv(CHACHA_POLY1305, k, nonce, { - authTagLength: 16 - }); - cipher.setAAD(ad, { plaintextLength: plaintext.byteLength }); - const updated = cipher.update(plaintext); - const final = cipher.final(); - const tag = cipher.getAuthTag(); - const encrypted = Buffer.concat([updated, tag, final], updated.byteLength + tag.byteLength + final.byteLength); - return encrypted; - }, - chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, _dst) { - const authTag = ciphertext.subarray(ciphertext.length - 16); - const text = ciphertext.subarray(0, ciphertext.length - 16); - const decipher = crypto.createDecipheriv(CHACHA_POLY1305, k, nonce, { - authTagLength: 16 - }); - decipher.setAAD(ad, { - plaintextLength: text.byteLength - }); - decipher.setAuthTag(authTag); - const updated = decipher.update(text); - const final = decipher.final(); - if (final.byteLength > 0) { - return Buffer.concat([updated, final], updated.byteLength + final.byteLength); - } - return updated; - } -}; -const asCrypto = { - hashSHA256(data) { - return digest(data); - }, - chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - return asImpl.seal(k, nonce, plaintext, ad); - }, - chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) { - return asImpl.open(k, nonce, ciphertext, ad, dst); - } -}; -// benchmarks show that for chacha20poly1305 -// the as implementation is faster for smaller payloads(<1200) -// and the node implementation is faster for larger payloads -export const defaultCrypto = { - ...pureJsCrypto, - hashSHA256(data) { - return nodeCrypto.hashSHA256(data); - }, - chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - if (plaintext.length < 1200) { - return asCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k); - } - return nodeCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k); - }, - chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) { - if (ciphertext.length < 1200) { - return asCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst); - } - return nodeCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst); - }, - generateX25519KeyPair() { - const { publicKey, privateKey } = crypto.generateKeyPairSync('x25519', { - publicKeyEncoding: { - type: 'spki', - format: 'der' - }, - privateKeyEncoding: { - type: 'pkcs8', - format: 'der' - } - }); - return { - publicKey: publicKey.subarray(X25519_PREFIX.length), - privateKey: privateKey.subarray(PKCS8_PREFIX.length) - }; - }, - generateX25519KeyPairFromSeed(seed) { - const privateKey = crypto.createPrivateKey({ - key: Buffer.concat([ - PKCS8_PREFIX, - seed - ], PKCS8_PREFIX.byteLength + seed.byteLength), - type: 'pkcs8', - format: 'der' - }); - const publicKey = crypto.createPublicKey(privateKey) - .export({ - type: 'spki', - format: 'der' - }).subarray(X25519_PREFIX.length); - return { - publicKey, - privateKey: seed - }; - }, - generateX25519SharedKey(privateKey, publicKey) { - publicKey = Buffer.concat([ - X25519_PREFIX, - publicKey - ], X25519_PREFIX.byteLength + publicKey.byteLength); - privateKey = Buffer.concat([ - PKCS8_PREFIX, - privateKey - ], PKCS8_PREFIX.byteLength + privateKey.byteLength); - return crypto.diffieHellman({ - publicKey: crypto.createPublicKey({ - key: Buffer.from(publicKey, publicKey.byteOffset, publicKey.byteLength), - type: 'spki', - format: 'der' - }), - privateKey: crypto.createPrivateKey({ - key: Buffer.from(privateKey, privateKey.byteOffset, privateKey.byteLength), - type: 'pkcs8', - format: 'der' - }) - }); - } -}; -// no chacha20-poly1305 in electron https://github.com/electron/electron/issues/24024 -if (isElectronMain) { - defaultCrypto.chaCha20Poly1305Encrypt = asCrypto.chaCha20Poly1305Encrypt; - defaultCrypto.chaCha20Poly1305Decrypt = asCrypto.chaCha20Poly1305Decrypt; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.js.map deleted file mode 100644 index 8e5524ac5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/crypto/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAItC,MAAM,GAAG,GAAG,WAAW,EAAE,CAAA;AACzB,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,GAAG,CAAC,CAAA;AACxC,MAAM,eAAe,GAAG,mBAAmB,CAAA;AAC3C,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAA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AAE,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC;gBAC1E,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,KAAK;aACd,CAAC;SACH,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,qFAAqF;AACrF,IAAI,cAAc,EAAE;IAClB,aAAa,CAAC,uBAAuB,GAAG,QAAQ,CAAC,uBAAuB,CAAA;IACxE,aAAa,CAAC,uBAAuB,GAAG,QAAQ,CAAC,uBAAuB,CAAA;CACzE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/js.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/js.d.ts deleted file mode 100644 index 4020b8611..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/js.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ICryptoInterface } from '../crypto.js'; -export declare const pureJsCrypto: ICryptoInterface; -//# sourceMappingURL=js.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/js.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/js.d.ts.map deleted file mode 100644 index d9693c950..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/js.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"js.d.ts","sourceRoot":"","sources":["../../../src/crypto/js.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpD,eAAO,MAAM,YAAY,EAAE,gBA+C1B,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/js.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/js.js deleted file mode 100644 index b2aa8b079..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/js.js +++ /dev/null @@ -1,43 +0,0 @@ -import { chacha20poly1305 } from '@noble/ciphers/chacha'; -import { x25519 } from '@noble/curves/ed25519'; -import { extract, expand } from '@noble/hashes/hkdf'; -import { sha256 } from '@noble/hashes/sha256'; -export const pureJsCrypto = { - hashSHA256(data) { - return sha256(data); - }, - getHKDF(ck, ikm) { - const prk = extract(sha256, ikm, ck); - const okmU8Array = expand(sha256, prk, undefined, 96); - const okm = okmU8Array; - const k1 = okm.subarray(0, 32); - const k2 = okm.subarray(32, 64); - const k3 = okm.subarray(64, 96); - return [k1, k2, k3]; - }, - generateX25519KeyPair() { - const secretKey = x25519.utils.randomPrivateKey(); - const publicKey = x25519.getPublicKey(secretKey); - return { - publicKey, - privateKey: secretKey - }; - }, - generateX25519KeyPairFromSeed(seed) { - const publicKey = x25519.getPublicKey(seed); - return { - publicKey, - privateKey: seed - }; - }, - generateX25519SharedKey(privateKey, publicKey) { - return x25519.getSharedSecret(privateKey, publicKey); - }, - chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - return chacha20poly1305(k, nonce, ad).encrypt(plaintext); - }, - chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) { - return chacha20poly1305(k, nonce, ad).decrypt(ciphertext, dst); - } -}; -//# sourceMappingURL=js.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/js.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/js.js.map deleted file mode 100644 index a58e0e68d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/js.js.map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7C,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QAE3C,OAAO;YACL,SAAS;YACT,UAAU,EAAE,IAAI;SACjB,CAAA;IACH,CAAC;IAED,uBAAuB,CAAE,UAAsB,EAAE,SAAqB;QACpE,OAAO,MAAM,CAAC,eAAe,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;IACtD,CAAC;IAED,uBAAuB,CAAE,SAAqB,EAAE,KAAiB,EAAE,EAAc,EAAE,CAAU;QAC3F,OAAO,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAC1D,CAAC;IAED,uBAAuB,CAAE,UAAsB,EAAE,KAAiB,EAAE,EAAc,EAAE,CAAU,EAAE,GAAgB;QAC9G,OAAO,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;IAChE,CAAC;CACF,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/streaming.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/streaming.d.ts deleted file mode 100644 index a897b30ad..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/streaming.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import type { IHandshake } from '../@types/handshake-interface.js'; -import type { MetricsRegistry } from '../metrics.js'; -import type { Transform } from 'it-stream-types'; -export declare function encryptStream(handshake: IHandshake, metrics?: MetricsRegistry): Transform>; -export declare function decryptStream(handshake: IHandshake, metrics?: MetricsRegistry): Transform, AsyncGenerator>; -//# sourceMappingURL=streaming.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/streaming.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/streaming.d.ts.map deleted file mode 100644 index 76ac88dcd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/streaming.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../../src/crypto/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAG/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAKhD,wBAAgB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,CAgBvI;AAGD,wBAAgB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC,CA4BtJ"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/streaming.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/streaming.js deleted file mode 100644 index 5a6723913..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/streaming.js +++ /dev/null @@ -1,50 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import { NOISE_MSG_MAX_LENGTH_BYTES, NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG } from '../constants.js'; -import { uint16BEEncode } from '../encoder.js'; -const CHACHA_TAG_LENGTH = 16; -// Returns generator that encrypts payload from the user -export function encryptStream(handshake, metrics) { - return async function* (source) { - for await (const chunk of source) { - for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG) { - let end = i + NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG; - if (end > chunk.length) { - end = chunk.length; - } - const data = handshake.encrypt(chunk.subarray(i, end), handshake.session); - metrics?.encryptedPackets.increment(); - yield new Uint8ArrayList(uint16BEEncode(data.byteLength), data); - } - } - }; -} -// Decrypt received payload to the user -export function decryptStream(handshake, metrics) { - return async function* (source) { - for await (const chunk of source) { - for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES) { - let end = i + NOISE_MSG_MAX_LENGTH_BYTES; - if (end > chunk.length) { - end = chunk.length; - } - if (end - CHACHA_TAG_LENGTH < i) { - throw new Error('Invalid chunk'); - } - const encrypted = chunk.subarray(i, end); - // memory allocation is not cheap so reuse the encrypted Uint8Array - // see https://github.com/ChainSafe/js-libp2p-noise/pull/242#issue-1422126164 - // this is ok because chacha20 reads bytes one by one and don't reread after that - // it's also tested in https://github.com/ChainSafe/as-chacha20poly1305/pull/1/files#diff-25252846b58979dcaf4e41d47b3eadd7e4f335e7fb98da6c049b1f9cd011f381R48 - const dst = chunk.subarray(i, end - CHACHA_TAG_LENGTH); - const { plaintext: decrypted, valid } = handshake.decrypt(encrypted, handshake.session, dst); - if (!valid) { - metrics?.decryptErrors.increment(); - throw new Error('Failed to validate decrypted chunk'); - } - metrics?.decryptedPackets.increment(); - yield decrypted; - } - } - }; -} -//# sourceMappingURL=streaming.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/streaming.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/streaming.js.map deleted file mode 100644 index 302b7fff6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/crypto/streaming.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streaming.js","sourceRoot":"","sources":["../../../src/crypto/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,0BAA0B,EAAE,sCAAsC,EAAE,MAAM,iBAAiB,CAAA;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAK9C,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAE5B,wDAAwD;AACxD,MAAM,UAAU,aAAa,CAAE,SAAqB,EAAE,OAAyB;IAC7E,OAAO,KAAK,SAAU,CAAC,EAAE,MAAM;QAC7B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE;YAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,sCAAsC,EAAE;gBAC7E,IAAI,GAAG,GAAG,CAAC,GAAG,sCAAsC,CAAA;gBACpD,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE;oBACtB,GAAG,GAAG,KAAK,CAAC,MAAM,CAAA;iBACnB;gBAED,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;gBACzE,OAAO,EAAE,gBAAgB,CAAC,SAAS,EAAE,CAAA;gBAErC,MAAM,IAAI,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,CAAA;aAChE;SACF;IACH,CAAC,CAAA;AACH,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,aAAa,CAAE,SAAqB,EAAE,OAAyB;IAC7E,OAAO,KAAK,SAAU,CAAC,EAAE,MAAM;QAC7B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE;YAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,0BAA0B,EAAE;gBACjE,IAAI,GAAG,GAAG,CAAC,GAAG,0BAA0B,CAAA;gBACxC,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE;oBACtB,GAAG,GAAG,KAAK,CAAC,MAAM,CAAA;iBACnB;gBAED,IAAI,GAAG,GAAG,iBAAiB,GAAG,CAAC,EAAE;oBAC/B,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;iBACjC;gBACD,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;gBACxC,mEAAmE;gBACnE,6EAA6E;gBAC7E,iFAAiF;gBACjF,6JAA6J;gBAC7J,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,iBAAiB,CAAC,CAAA;gBACtD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;gBAC5F,IAAI,CAAC,KAAK,EAAE;oBACV,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,CAAA;oBAClC,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;iBACtD;gBACD,OAAO,EAAE,gBAAgB,CAAC,SAAS,EAAE,CAAA;gBACrC,MAAM,SAAS,CAAA;aAChB;SACF;IACH,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/encoder.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/encoder.d.ts deleted file mode 100644 index a24ce9256..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/encoder.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import type { bytes } from './@types/basic.js'; -import type { MessageBuffer } from './@types/handshake.js'; -import type { LengthDecoderFunction } from 'it-length-prefixed'; -export declare const uint16BEEncode: { - (value: number): Uint8Array; - bytes: number; -}; -export declare const uint16BEDecode: LengthDecoderFunction; -export declare function encode0(message: MessageBuffer): Uint8ArrayList; -export declare function encode1(message: MessageBuffer): Uint8ArrayList; -export declare function encode2(message: MessageBuffer): Uint8ArrayList; -export declare function decode0(input: bytes): MessageBuffer; -export declare function decode1(input: bytes): MessageBuffer; -export declare function decode2(input: bytes): MessageBuffer; -//# sourceMappingURL=encoder.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/encoder.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/encoder.d.ts.map deleted file mode 100644 index 76e8c0a65..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/encoder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encoder.d.ts","sourceRoot":"","sources":["../../src/encoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAE/D,eAAO,MAAM,cAAc;YAAW,MAAM,GAAG,UAAU;;CAIxD,CAAA;AAGD,eAAO,MAAM,cAAc,EAAE,qBAQ5B,CAAA;AAKD,wBAAgB,OAAO,CAAE,OAAO,EAAE,aAAa,GAAG,cAAc,CAE/D;AAED,wBAAgB,OAAO,CAAE,OAAO,EAAE,aAAa,GAAG,cAAc,CAE/D;AAED,wBAAgB,OAAO,CAAE,OAAO,EAAE,aAAa,GAAG,cAAc,CAE/D;AAED,wBAAgB,OAAO,CAAE,KAAK,EAAE,KAAK,GAAG,aAAa,CAUpD;AAED,wBAAgB,OAAO,CAAE,KAAK,EAAE,KAAK,GAAG,aAAa,CAUpD;AAED,wBAAgB,OAAO,CAAE,KAAK,EAAE,KAAK,GAAG,aAAa,CAUpD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/encoder.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/encoder.js deleted file mode 100644 index fb9145e54..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/encoder.js +++ /dev/null @@ -1,58 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import { alloc as uint8ArrayAlloc, allocUnsafe as uint8ArrayAllocUnsafe } from 'uint8arrays/alloc'; -export const uint16BEEncode = (value) => { - const target = uint8ArrayAllocUnsafe(2); - new DataView(target.buffer, target.byteOffset, target.byteLength).setUint16(0, value, false); - return target; -}; -uint16BEEncode.bytes = 2; -export const uint16BEDecode = (data) => { - if (data.length < 2) - throw RangeError('Could not decode int16BE'); - if (data instanceof Uint8Array) { - return new DataView(data.buffer, data.byteOffset, data.byteLength).getUint16(0, false); - } - return data.getUint16(0); -}; -uint16BEDecode.bytes = 2; -// Note: IK and XX encoder usage is opposite (XX uses in stages encode0 where IK uses encode1) -export function encode0(message) { - return new Uint8ArrayList(message.ne, message.ciphertext); -} -export function encode1(message) { - return new Uint8ArrayList(message.ne, message.ns, message.ciphertext); -} -export function encode2(message) { - return new Uint8ArrayList(message.ns, message.ciphertext); -} -export function decode0(input) { - if (input.length < 32) { - throw new Error('Cannot decode stage 0 MessageBuffer: length less than 32 bytes.'); - } - return { - ne: input.subarray(0, 32), - ciphertext: input.subarray(32, input.length), - ns: uint8ArrayAlloc(0) - }; -} -export function decode1(input) { - if (input.length < 80) { - throw new Error('Cannot decode stage 1 MessageBuffer: length less than 80 bytes.'); - } - return { - ne: input.subarray(0, 32), - ns: input.subarray(32, 80), - ciphertext: input.subarray(80, input.length) - }; -} -export function decode2(input) { - if (input.length < 48) { - throw new Error('Cannot decode stage 2 MessageBuffer: length less than 48 bytes.'); - } - return { - ne: uint8ArrayAlloc(0), - ns: input.subarray(0, 48), - ciphertext: input.subarray(48, input.length) - }; -} -//# sourceMappingURL=encoder.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/encoder.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/encoder.js.map deleted file mode 100644 index 243826435..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/encoder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encoder.js","sourceRoot":"","sources":["../../src/encoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,WAAW,IAAI,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAKlG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAc,EAAE;IAC1D,MAAM,MAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAA;IACvC,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;IAC5F,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AACD,cAAc,CAAC,KAAK,GAAG,CAAC,CAAA;AAExB,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AC;KACvB,CAAA;AACH,CAAC;AAED,MAAM,UAAU,OAAO,CAAE,KAAY;IACnC,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAA;KACnF;IAED,OAAO;QACL,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;QACzB,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;QAC1B,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC;KAC7C,CAAA;AACH,CAAC;AAED,MAAM,UAAU,OAAO,CAAE,KAAY;IACnC,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAA;KACnF;IAED,OAAO;QACL,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC;QACtB,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;QACzB,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC;KAC7C,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshake-xx.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshake-xx.d.ts deleted file mode 100644 index 8bde3f774..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshake-xx.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { XX } from './handshakes/xx.js'; -import type { bytes, bytes32 } from './@types/basic.js'; -import type { IHandshake } from './@types/handshake-interface.js'; -import type { NoiseSession } from './@types/handshake.js'; -import type { KeyPair } from './@types/libp2p.js'; -import type { ICryptoInterface } from './crypto.js'; -import type { NoiseExtensions } from './proto/payload.js'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { LengthPrefixedStream } from 'it-length-prefixed-stream'; -export declare class XXHandshake implements IHandshake { - isInitiator: boolean; - session: NoiseSession; - remotePeer: PeerId; - remoteExtensions: NoiseExtensions; - protected payload: bytes; - protected connection: LengthPrefixedStream; - protected xx: XX; - protected staticKeypair: KeyPair; - private readonly prologue; - constructor(isInitiator: boolean, payload: bytes, prologue: bytes32, crypto: ICryptoInterface, staticKeypair: KeyPair, connection: LengthPrefixedStream, remotePeer?: PeerId, handshake?: XX); - propose(): Promise; - exchange(): Promise; - finish(): Promise; - encrypt(plaintext: Uint8Array, session: NoiseSession): bytes; - decrypt(ciphertext: Uint8Array, session: NoiseSession, dst?: Uint8Array): { - plaintext: bytes; - valid: boolean; - }; - getRemoteStaticKey(): bytes; - private getCS; - protected setRemoteNoiseExtension(e: NoiseExtensions | null | undefined): void; -} -//# sourceMappingURL=handshake-xx.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshake-xx.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshake-xx.d.ts.map deleted file mode 100644 index cb8bec51a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshake-xx.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake-xx.d.ts","sourceRoot":"","sources":["../../src/handshake-xx.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAcvC,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,KAAK,EAA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kB,IAAK,KAAK;IAInC,OAAO,CAAC,KAAK;IAYb,SAAS,CAAC,uBAAuB,CAAE,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;CAKhF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshake-xx.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshake-xx.js deleted file mode 100644 index 373013b03..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshake-xx.js +++ /dev/null @@ -1,140 +0,0 @@ -import { InvalidCryptoExchangeError, UnexpectedPeerError } from '@libp2p/interface/errors'; -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { decode0, decode1, decode2, encode0, encode1, encode2 } from './encoder.js'; -import { XX } from './handshakes/xx.js'; -import { logger, logLocalStaticKeys, logLocalEphemeralKeys, logRemoteEphemeralKey, logRemoteStaticKey, logCipherState } from './logger.js'; -import { decodePayload, getPeerIdFromPayload, verifySignedPayload } from './utils.js'; -export class XXHandshake { - isInitiator; - session; - remotePeer; - remoteExtensions = { webtransportCerthashes: [] }; - payload; - connection; - xx; - staticKeypair; - prologue; - constructor(isInitiator, payload, prologue, crypto, staticKeypair, connection, remotePeer, handshake) { - this.isInitiator = isInitiator; - this.payload = payload; - this.prologue = prologue; - this.staticKeypair = staticKeypair; - this.connection = connection; - if (remotePeer) { - this.remotePeer = remotePeer; - } - this.xx = handshake ?? new XX(crypto); - this.session = this.xx.initSession(this.isInitiator, this.prologue, this.staticKeypair); - } - // stage 0 - async propose() { - logLocalStaticKeys(this.session.hs.s); - if (this.isInitiator) { - logger.trace('Stage 0 - Initiator starting to send first message.'); - const messageBuffer = this.xx.sendMessage(this.session, uint8ArrayAlloc(0)); - await this.connection.write(encode0(messageBuffer)); - logger.trace('Stage 0 - Initiator finished sending first message.'); - logLocalEphemeralKeys(this.session.hs.e); - } - else { - logger.trace('Stage 0 - Responder waiting to receive first message...'); - const receivedMessageBuffer = decode0((await this.connection.read()).subarray()); - const { valid } = this.xx.recvMessage(this.session, receivedMessageBuffer); - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 0 validation fail'); - } - logger.trace('Stage 0 - Responder received first message.'); - logRemoteEphemeralKey(this.session.hs.re); - } - } - // stage 1 - async exchange() { - if (this.isInitiator) { - logger.trace('Stage 1 - Initiator waiting to receive first message from responder...'); - const receivedMessageBuffer = decode1((await this.connection.read()).subarray()); - const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer); - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 1 validation fail'); - } - logger.trace('Stage 1 - Initiator received the message.'); - logRemoteEphemeralKey(this.session.hs.re); - logRemoteStaticKey(this.session.hs.rs); - logger.trace("Initiator going to check remote's signature..."); - try { - const decodedPayload = decodePayload(plaintext); - this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload); - await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer); - this.setRemoteNoiseExtension(decodedPayload.extensions); - } - catch (e) { - const err = e; - throw new UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`); - } - logger.trace('All good with the signature!'); - } - else { - logger.trace('Stage 1 - Responder sending out first message with signed payload and static key.'); - const messageBuffer = this.xx.sendMessage(this.session, this.payload); - await this.connection.write(encode1(messageBuffer)); - logger.trace('Stage 1 - Responder sent the second handshake message with signed payload.'); - logLocalEphemeralKeys(this.session.hs.e); - } - } - // stage 2 - async finish() { - if (this.isInitiator) { - logger.trace('Stage 2 - Initiator sending third handshake message.'); - const messageBuffer = this.xx.sendMessage(this.session, this.payload); - await this.connection.write(encode2(messageBuffer)); - logger.trace('Stage 2 - Initiator sent message with signed payload.'); - } - else { - logger.trace('Stage 2 - Responder waiting for third handshake message...'); - const receivedMessageBuffer = decode2((await this.connection.read()).subarray()); - const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer); - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 2 validation fail'); - } - logger.trace('Stage 2 - Responder received the message, finished handshake.'); - try { - const decodedPayload = decodePayload(plaintext); - this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload); - await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer); - this.setRemoteNoiseExtension(decodedPayload.extensions); - } - catch (e) { - const err = e; - throw new UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`); - } - } - logCipherState(this.session); - } - encrypt(plaintext, session) { - const cs = this.getCS(session); - return this.xx.encryptWithAd(cs, uint8ArrayAlloc(0), plaintext); - } - decrypt(ciphertext, session, dst) { - const cs = this.getCS(session, false); - return this.xx.decryptWithAd(cs, uint8ArrayAlloc(0), ciphertext, dst); - } - getRemoteStaticKey() { - return this.session.hs.rs; - } - getCS(session, encryption = true) { - if (!session.cs1 || !session.cs2) { - throw new InvalidCryptoExchangeError('Handshake not completed properly, cipher state does not exist.'); - } - if (this.isInitiator) { - return encryption ? session.cs1 : session.cs2; - } - else { - return encryption ? session.cs2 : session.cs1; - } - } - setRemoteNoiseExtension(e) { - if (e) { - this.remoteExtensions = e; - } - } -} -//# sourceMappingURL=handshake-xx.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshake-xx.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshake-xx.js.map deleted file mode 100644 index 1b47203b9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshake-xx.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake-xx.js","sourceRoot":"","sources":["../../src/handshake-xx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC1F,OAAO,EAAE,KAAK,IAAI,eAAe,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U,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA;SAC9C;aAAM;YACL,OAAO,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA;SAC9C;IACH,CAAC;IAES,uBAAuB,CAAE,CAAqC;QACtE,IAAI,CAAC,EAAE;YACL,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAA;SAC1B;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/abstract-handshake.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/abstract-handshake.d.ts deleted file mode 100644 index eb1e51754..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/abstract-handshake.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Nonce } from '../nonce.js'; -import type { bytes, bytes32 } from '../@types/basic.js'; -import type { CipherState, MessageBuffer, SymmetricState } from '../@types/handshake.js'; -import type { ICryptoInterface } from '../crypto.js'; -export interface DecryptedResult { - plaintext: bytes; - valid: boolean; -} -export interface SplitState { - cs1: CipherState; - cs2: CipherState; -} -export declare abstract class AbstractHandshake { - crypto: ICryptoInterface; - constructor(crypto: ICryptoInterface); - encryptWithAd(cs: CipherState, ad: Uint8Array, plaintext: Uint8Array): bytes; - decryptWithAd(cs: CipherState, ad: Uint8Array, ciphertext: Uint8Array, dst?: Uint8Array): DecryptedResult; - protected hasKey(cs: CipherState): boolean; - protected createEmptyKey(): bytes32; - protected isEmptyKey(k: bytes32): boolean; - protected encrypt(k: bytes32, n: Nonce, ad: Uint8Array, plaintext: Uint8Array): bytes; - protected encryptAndHash(ss: SymmetricState, plaintext: bytes): bytes; - protected decrypt(k: bytes32, n: Nonce, ad: bytes, ciphertext: bytes, dst?: Uint8Array): DecryptedResult; - protected decryptAndHash(ss: SymmetricState, ciphertext: bytes): DecryptedResult; - protected dh(privateKey: bytes32, publicKey: bytes32): bytes32; - protected mixHash(ss: SymmetricState, data: bytes): void; - protected getHash(a: Uint8Array, b: Uint8Array): bytes32; - protected mixKey(ss: SymmetricState, ikm: bytes32): void; - protected initializeKey(k: bytes32): CipherState; - protected initializeSymmetric(protocolName: string): SymmetricState; - protected hashProtocolName(protocolName: Uint8Array): bytes32; - protected split(ss: SymmetricState): SplitState; - protected writeMessageRegular(cs: CipherState, payload: bytes): MessageBuffer; - protected readMessageRegular(cs: CipherState, message: MessageBuffer): DecryptedResult; -} -//# sourceMappingURL=abstract-handshake.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/abstract-handshake.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/abstract-handshake.d.ts.map deleted file mode 100644 index 0ffc88414..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/abstract-handshake.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-handshake.d.ts","sourceRoot":"","sources":["../../../src/handshakes/abstract-handshake.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpD,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,KAAK,CAAA;IAChB,KAAK,EAAE,OAAO,CAAA;CACf;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,WAA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,OAAO;IAKzD,SAAS,CAAC,MAAM,CAAE,EAAE,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI;IAMzD,SAAS,CAAC,aAAa,CAAE,CAAC,EAAE,OAAO,GAAG,WAAW;IAMjD,SAAS,CAAC,mBAAmB,CAAE,YAAY,EAAE,MAAM,GAAG,cAAc;IAWpE,SAAS,CAAC,gBAAgB,CAAE,YAAY,EAAE,UAAU,GAAG,OAAO;IAU9D,SAAS,CAAC,KAAK,CAAE,EAAE,EAAE,cAAc,GAAG,UAAU;IAQhD,SAAS,CAAC,mBAAmB,CAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,GAAG,aAAa;IAQ9E,SAAS,CAAC,kBAAkB,CAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,GAAG,eAAe;CAGxF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/abstract-handshake.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/abstract-handshake.js deleted file mode 100644 index f1d205fe1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/abstract-handshake.js +++ /dev/null @@ -1,141 +0,0 @@ -import { fromString as uint8ArrayFromString } from 'uint8arrays'; -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; -import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; -import { logger } from '../logger.js'; -import { Nonce } from '../nonce.js'; -export class AbstractHandshake { - crypto; - constructor(crypto) { - this.crypto = crypto; - } - encryptWithAd(cs, ad, plaintext) { - const e = this.encrypt(cs.k, cs.n, ad, plaintext); - cs.n.increment(); - return e; - } - decryptWithAd(cs, ad, ciphertext, dst) { - const { plaintext, valid } = this.decrypt(cs.k, cs.n, ad, ciphertext, dst); - if (valid) - cs.n.increment(); - return { plaintext, valid }; - } - // Cipher state related - hasKey(cs) { - return !this.isEmptyKey(cs.k); - } - createEmptyKey() { - return uint8ArrayAlloc(32); - } - isEmptyKey(k) { - const emptyKey = this.createEmptyKey(); - return uint8ArrayEquals(emptyKey, k); - } - encrypt(k, n, ad, plaintext) { - n.assertValue(); - return this.crypto.chaCha20Poly1305Encrypt(plaintext, n.getBytes(), ad, k); - } - encryptAndHash(ss, plaintext) { - let ciphertext; - if (this.hasKey(ss.cs)) { - ciphertext = this.encryptWithAd(ss.cs, ss.h, plaintext); - } - else { - ciphertext = plaintext; - } - this.mixHash(ss, ciphertext); - return ciphertext; - } - decrypt(k, n, ad, ciphertext, dst) { - n.assertValue(); - const encryptedMessage = this.crypto.chaCha20Poly1305Decrypt(ciphertext, n.getBytes(), ad, k, dst); - if (encryptedMessage) { - return { - plaintext: encryptedMessage, - valid: true - }; - } - else { - return { - plaintext: uint8ArrayAlloc(0), - valid: false - }; - } - } - decryptAndHash(ss, ciphertext) { - let plaintext; - let valid = true; - if (this.hasKey(ss.cs)) { - ({ plaintext, valid } = this.decryptWithAd(ss.cs, ss.h, ciphertext)); - } - else { - plaintext = ciphertext; - } - this.mixHash(ss, ciphertext); - return { plaintext, valid }; - } - dh(privateKey, publicKey) { - try { - const derivedU8 = this.crypto.generateX25519SharedKey(privateKey, publicKey); - if (derivedU8.length === 32) { - return derivedU8; - } - return derivedU8.subarray(0, 32); - } - catch (e) { - const err = e; - logger.error(err); - return uint8ArrayAlloc(32); - } - } - mixHash(ss, data) { - ss.h = this.getHash(ss.h, data); - } - getHash(a, b) { - const u = this.crypto.hashSHA256(uint8ArrayConcat([a, b], a.length + b.length)); - return u; - } - mixKey(ss, ikm) { - const [ck, tempK] = this.crypto.getHKDF(ss.ck, ikm); - ss.cs = this.initializeKey(tempK); - ss.ck = ck; - } - initializeKey(k) { - return { k, n: new Nonce() }; - } - // Symmetric state related - initializeSymmetric(protocolName) { - const protocolNameBytes = uint8ArrayFromString(protocolName, 'utf-8'); - const h = this.hashProtocolName(protocolNameBytes); - const ck = h; - const key = this.createEmptyKey(); - const cs = this.initializeKey(key); - return { cs, ck, h }; - } - hashProtocolName(protocolName) { - if (protocolName.length <= 32) { - const h = uint8ArrayAlloc(32); - h.set(protocolName); - return h; - } - else { - return this.getHash(protocolName, uint8ArrayAlloc(0)); - } - } - split(ss) { - const [tempk1, tempk2] = this.crypto.getHKDF(ss.ck, uint8ArrayAlloc(0)); - const cs1 = this.initializeKey(tempk1); - const cs2 = this.initializeKey(tempk2); - return { cs1, cs2 }; - } - writeMessageRegular(cs, payload) { - const ciphertext = this.encryptWithAd(cs, uint8ArrayAlloc(0), payload); - const ne = this.createEmptyKey(); - const ns = uint8ArrayAlloc(0); - return { ne, ns, ciphertext }; - } - readMessageRegular(cs, message) { - return this.decryptWithAd(cs, uint8ArrayAlloc(0), message.ciphertext); - } -} -//# sourceMappingURL=abstract-handshake.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/abstract-handshake.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/abstract-handshake.js.map deleted file mode 100644 index 757420896..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/abstract-handshake.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-handshake.js","sourceRoot":"","sources":["../../../src/handshakes/abstract-handshake.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,E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MAAM,CAAC,CAAA;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAEtC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;IACrB,CAAC;IAES,mBAAmB,CAAE,EAAe,EAAE,OAAc;QAC5D,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;QACtE,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;QAChC,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,CAAC,CAAA;QAE7B,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,CAAA;IAC/B,CAAC;IAES,kBAAkB,CAAE,EAAe,EAAE,OAAsB;QACnE,OAAO,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;IACvE,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/xx.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/xx.d.ts deleted file mode 100644 index bf79dc414..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/xx.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { AbstractHandshake, type DecryptedResult } from './abstract-handshake.js'; -import type { bytes32, bytes } from '../@types/basic.js'; -import type { MessageBuffer, NoiseSession } from '../@types/handshake.js'; -import type { KeyPair } from '../@types/libp2p.js'; -export declare class XX extends AbstractHandshake { - private initializeInitiator; - private initializeResponder; - private writeMessageA; - private writeMessageB; - private writeMessageC; - private readMessageA; - private readMessageB; - private readMessageC; - initSession(initiator: boolean, prologue: bytes32, s: KeyPair): NoiseSession; - sendMessage(session: NoiseSession, message: bytes, ephemeral?: KeyPair): MessageBuffer; - recvMessage(session: NoiseSession, message: MessageBuffer): DecryptedResult; -} -//# sourceMappingURL=xx.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/xx.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/xx.d.ts.map deleted file mode 100644 index 76c3cbdac..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/xx.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx.d.ts","sourceRoot":"","sources":["../../../src/handshakes/xx.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACjF,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAA+B,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACtG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,qBAAa,EAAG,SAAQ,iBAAiB;IACvC,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,YAAY;IAmBpB,OAAO,CAAC,YAAY;IAgBb,WAAW,CAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,YAAY;IAkB7E,WAAW,CAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,aAAa;IAkCvF,WAAW,CAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,GAAG,eAAe;CAkBpF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/xx.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/xx.js deleted file mode 100644 index dbfa58f06..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/xx.js +++ /dev/null @@ -1,162 +0,0 @@ -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { isValidPublicKey } from '../utils.js'; -import { AbstractHandshake } from './abstract-handshake.js'; -export class XX extends AbstractHandshake { - initializeInitiator(prologue, s, rs, psk) { - const name = 'Noise_XX_25519_ChaChaPoly_SHA256'; - const ss = this.initializeSymmetric(name); - this.mixHash(ss, prologue); - const re = uint8ArrayAlloc(32); - return { ss, s, rs, psk, re }; - } - initializeResponder(prologue, s, rs, psk) { - const name = 'Noise_XX_25519_ChaChaPoly_SHA256'; - const ss = this.initializeSymmetric(name); - this.mixHash(ss, prologue); - const re = uint8ArrayAlloc(32); - return { ss, s, rs, psk, re }; - } - writeMessageA(hs, payload, e) { - const ns = uint8ArrayAlloc(0); - if (e !== undefined) { - hs.e = e; - } - else { - hs.e = this.crypto.generateX25519KeyPair(); - } - const ne = hs.e.publicKey; - this.mixHash(hs.ss, ne); - const ciphertext = this.encryptAndHash(hs.ss, payload); - return { ne, ns, ciphertext }; - } - writeMessageB(hs, payload) { - hs.e = this.crypto.generateX25519KeyPair(); - const ne = hs.e.publicKey; - this.mixHash(hs.ss, ne); - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re)); - const spk = hs.s.publicKey; - const ns = this.encryptAndHash(hs.ss, spk); - this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re)); - const ciphertext = this.encryptAndHash(hs.ss, payload); - return { ne, ns, ciphertext }; - } - writeMessageC(hs, payload) { - const spk = hs.s.publicKey; - const ns = this.encryptAndHash(hs.ss, spk); - this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re)); - const ciphertext = this.encryptAndHash(hs.ss, payload); - const ne = this.createEmptyKey(); - const messageBuffer = { ne, ns, ciphertext }; - const { cs1, cs2 } = this.split(hs.ss); - return { h: hs.ss.h, messageBuffer, cs1, cs2 }; - } - readMessageA(hs, message) { - if (isValidPublicKey(message.ne)) { - hs.re = message.ne; - } - this.mixHash(hs.ss, hs.re); - return this.decryptAndHash(hs.ss, message.ciphertext); - } - readMessageB(hs, message) { - if (isValidPublicKey(message.ne)) { - hs.re = message.ne; - } - this.mixHash(hs.ss, hs.re); - if (!hs.e) { - throw new Error('Handshake state `e` param is missing.'); - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re)); - const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns); - if (valid1 && isValidPublicKey(ns)) { - hs.rs = ns; - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs)); - const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext); - return { plaintext, valid: (valid1 && valid2) }; - } - readMessageC(hs, message) { - const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns); - if (valid1 && isValidPublicKey(ns)) { - hs.rs = ns; - } - if (!hs.e) { - throw new Error('Handshake state `e` param is missing.'); - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs)); - const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext); - const { cs1, cs2 } = this.split(hs.ss); - return { h: hs.ss.h, plaintext, valid: (valid1 && valid2), cs1, cs2 }; - } - initSession(initiator, prologue, s) { - const psk = this.createEmptyKey(); - const rs = uint8ArrayAlloc(32); // no static key yet - let hs; - if (initiator) { - hs = this.initializeInitiator(prologue, s, rs, psk); - } - else { - hs = this.initializeResponder(prologue, s, rs, psk); - } - return { - hs, - i: initiator, - mc: 0 - }; - } - sendMessage(session, message, ephemeral) { - let messageBuffer; - if (session.mc === 0) { - messageBuffer = this.writeMessageA(session.hs, message, ephemeral); - } - else if (session.mc === 1) { - messageBuffer = this.writeMessageB(session.hs, message); - } - else if (session.mc === 2) { - const { h, messageBuffer: resultingBuffer, cs1, cs2 } = this.writeMessageC(session.hs, message); - messageBuffer = resultingBuffer; - session.h = h; - session.cs1 = cs1; - session.cs2 = cs2; - } - else if (session.mc > 2) { - if (session.i) { - if (!session.cs1) { - throw new Error('CS1 (cipher state) is not defined'); - } - messageBuffer = this.writeMessageRegular(session.cs1, message); - } - else { - if (!session.cs2) { - throw new Error('CS2 (cipher state) is not defined'); - } - messageBuffer = this.writeMessageRegular(session.cs2, message); - } - } - else { - throw new Error('Session invalid.'); - } - session.mc++; - return messageBuffer; - } - recvMessage(session, message) { - let plaintext = uint8ArrayAlloc(0); - let valid = false; - if (session.mc === 0) { - ({ plaintext, valid } = this.readMessageA(session.hs, message)); - } - else if (session.mc === 1) { - ({ plaintext, valid } = this.readMessageB(session.hs, message)); - } - else if (session.mc === 2) { - const { h, plaintext: resultingPlaintext, valid: resultingValid, cs1, cs2 } = this.readMessageC(session.hs, message); - plaintext = resultingPlaintext; - valid = resultingValid; - session.h = h; - session.cs1 = cs1; - session.cs2 = cs2; - } - session.mc++; - return { plaintext, valid }; - } -} -//# sourceMappingURL=xx.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/xx.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/xx.js.map deleted file mode 100644 index e4e4a1586..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/handshakes/xx.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx.js","sourceRoot":"","sources":["../../../src/handshakes/xx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CA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AE,EAAE,CAAA;QACZ,OAAO,aAAa,CAAA;IACtB,CAAC;IAEM,WAAW,CAAE,OAAqB,EAAE,OAAsB;QAC/D,IAAI,SAAS,GAAU,eAAe,CAAC,CAAC,CAAC,CAAA;QACzC,IAAI,KAAK,GAAG,KAAK,CAAA;QACjB,IAAI,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE;YACpB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;SAChE;aAAM,IAAI,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE;YAC3B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;SAChE;aAAM,IAAI,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE;YAC3B,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;YACpH,SAAS,GAAG,kBAAkB,CAAA;YAC9B,KAAK,GAAG,cAAc,CAAA;YACtB,OAAO,CAAC,CAAC,GAAG,CAAC,CAAA;YACb,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA;YACjB,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA;SAClB;QACD,OAAO,CAAC,EAAE,EAAE,CAAA;QACZ,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;IAC7B,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/index.d.ts deleted file mode 100644 index 20ec9c473..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { NoiseInit } from './noise.js'; -import type { NoiseExtensions } from './proto/payload.js'; -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter'; -export type { ICryptoInterface } from './crypto.js'; -export { pureJsCrypto } from './crypto/js.js'; -export declare function noise(init?: NoiseInit): () => ConnectionEncrypter; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/index.d.ts.map deleted file mode 100644 index 4c067ef45..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AACjF,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,wBAAgB,KAAK,CAAE,IAAI,GAAE,SAAc,GAAG,MAAM,mBAAmB,CAAC,eAAe,CAAC,CAEvF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/index.js deleted file mode 100644 index 83cdd3f49..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import { Noise } from './noise.js'; -export { pureJsCrypto } from './crypto/js.js'; -export function noise(init = {}) { - return () => new Noise(init); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/index.js.map deleted file mode 100644 index fbdf2daf9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAKlC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,UAAU,KAAK,CAAE,OAAkB,EAAE;IACzC,OAAO,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/logger.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/logger.d.ts deleted file mode 100644 index 55e6ab35d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/logger.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { type Logger } from '@libp2p/logger'; -import type { NoiseSession } from './@types/handshake.js'; -import type { KeyPair } from './@types/libp2p.js'; -declare const log: Logger; -export { log as logger }; -export declare function logLocalStaticKeys(s: KeyPair): void; -export declare function logLocalEphemeralKeys(e: KeyPair | undefined): void; -export declare function logRemoteStaticKey(rs: Uint8Array): void; -export declare function logRemoteEphemeralKey(re: Uint8Array): void; -export declare function logCipherState(session: NoiseSession): void; -//# sourceMappingURL=logger.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/logger.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/logger.d.ts.map deleted file mode 100644 index 8873892ba..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/logger.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAU,MAAM,gBAAgB,CAAA;AAGpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAEjD,QAAA,MAAM,GAAG,QAAyB,CAAA;AAElC,OAAO,EAAE,GAAG,IAAI,MAAM,EAAE,CAAA;AAaxB,wBAAgB,kBAAkB,CAAE,CAAC,EAAE,OAAO,GAAG,IAAI,CAGpD;AAED,wBAAgB,qBAAqB,CAAE,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAOnE;AAED,wBAAgB,kBAAkB,CAAE,EAAE,EAAE,UAAU,GAAG,IAAI,CAExD;AAED,wBAAgB,qBAAqB,CAAE,EAAE,EAAE,UAAU,GAAG,IAAI,CAE3D;AAED,wBAAgB,cAAc,CAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CAO3D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/logger.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/logger.js deleted file mode 100644 index daf1e24aa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/logger.js +++ /dev/null @@ -1,45 +0,0 @@ -import { logger } from '@libp2p/logger'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { DUMP_SESSION_KEYS } from './constants.js'; -const log = logger('libp2p:noise'); -export { log as logger }; -let keyLogger; -if (DUMP_SESSION_KEYS) { - keyLogger = log; -} -else { - keyLogger = Object.assign(() => { }, { - enabled: false, - trace: () => { }, - error: () => { } - }); -} -export function logLocalStaticKeys(s) { - keyLogger(`LOCAL_STATIC_PUBLIC_KEY ${uint8ArrayToString(s.publicKey, 'hex')}`); - keyLogger(`LOCAL_STATIC_PRIVATE_KEY ${uint8ArrayToString(s.privateKey, 'hex')}`); -} -export function logLocalEphemeralKeys(e) { - if (e) { - keyLogger(`LOCAL_PUBLIC_EPHEMERAL_KEY ${uint8ArrayToString(e.publicKey, 'hex')}`); - keyLogger(`LOCAL_PRIVATE_EPHEMERAL_KEY ${uint8ArrayToString(e.privateKey, 'hex')}`); - } - else { - keyLogger('Missing local ephemeral keys.'); - } -} -export function logRemoteStaticKey(rs) { - keyLogger(`REMOTE_STATIC_PUBLIC_KEY ${uint8ArrayToString(rs, 'hex')}`); -} -export function logRemoteEphemeralKey(re) { - keyLogger(`REMOTE_EPHEMERAL_PUBLIC_KEY ${uint8ArrayToString(re, 'hex')}`); -} -export function logCipherState(session) { - if (session.cs1 && session.cs2) { - keyLogger(`CIPHER_STATE_1 ${session.cs1.n.getUint64()} ${uint8ArrayToString(session.cs1.k, 'hex')}`); - keyLogger(`CIPHER_STATE_2 ${session.cs2.n.getUint64()} ${uint8ArrayToString(session.cs2.k, 'hex')}`); - } - else { - keyLogger('Missing cipher state.'); - } -} -//# sourceMappingURL=logger.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/logger.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/logger.js.map deleted file mode 100644 index e408da6b8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/logger.js.map +++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kBAAkB,CAAE,EAAc;IAChD,SAAS,CAAC,4BAA4B,kBAAkB,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;AACxE,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAE,EAAc;IACnD,SAAS,CAAC,+BAA+B,kBAAkB,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;AAC3E,CAAC;AAED,MAAM,UAAU,cAAc,CAAE,OAAqB;IACnD,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE;QAC9B,SAAS,CAAC,kBAAkB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;QACpG,SAAS,CAAC,kBAAkB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;KACrG;SAAM;QACL,SAAS,CAAC,uBAAuB,CAAC,CAAA;KACnC;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/metrics.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/metrics.d.ts deleted file mode 100644 index 4fe5a1280..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/metrics.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Counter, Metrics } from '@libp2p/interface/metrics'; -export type MetricsRegistry = Record; -export declare function registerMetrics(metrics: Metrics): MetricsRegistry; -//# sourceMappingURL=metrics.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/metrics.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/metrics.d.ts.map deleted file mode 100644 index 5d29159ee..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/metrics.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../src/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEjE,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAErD,wBAAgB,eAAe,CAAE,OAAO,EAAE,OAAO,GAAG,eAAe,CA2BlE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/metrics.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/metrics.js deleted file mode 100644 index 1b5123db8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/metrics.js +++ /dev/null @@ -1,20 +0,0 @@ -export function registerMetrics(metrics) { - return { - xxHandshakeSuccesses: metrics.registerCounter('libp2p_noise_xxhandshake_successes_total', { - help: 'Total count of noise xxHandshakes successes_' - }), - xxHandshakeErrors: metrics.registerCounter('libp2p_noise_xxhandshake_error_total', { - help: 'Total count of noise xxHandshakes errors' - }), - encryptedPackets: metrics.registerCounter('libp2p_noise_encrypted_packets_total', { - help: 'Total count of noise encrypted packets successfully' - }), - decryptedPackets: metrics.registerCounter('libp2p_noise_decrypted_packets_total', { - help: 'Total count of noise decrypted packets' - }), - decryptErrors: metrics.registerCounter('libp2p_noise_decrypt_errors_total', { - help: 'Total count of noise decrypt errors' - }) - }; -} -//# sourceMappingURL=metrics.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/metrics.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/metrics.js.map deleted file mode 100644 index 9c23b331e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/metrics.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/metrics.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,eAAe,CAAE,OAAgB;IAC/C,OAAO;QACL,oBAAoB,EAAE,OAAO,CAAC,eAAe,CAC3C,0CAA0C,EAAE;YAC1C,IAAI,EAAE,8CAA8C;SACrD,CAAC;QAEJ,iBAAiB,EAAE,OAAO,CAAC,eAAe,CACxC,sCAAsC,EAAE;YACtC,IAAI,EAAE,0CAA0C;SACjD,CAAC;QAEJ,gBAAgB,EAAE,OAAO,CAAC,eAAe,CACvC,sCAAsC,EAAE;YACtC,IAAI,EAAE,qDAAqD;SAC5D,CAAC;QAEJ,gBAAgB,EAAE,OAAO,CAAC,eAAe,CACvC,sCAAsC,EAAE;YACtC,IAAI,EAAE,wCAAwC;SAC/C,CAAC;QAEJ,aAAa,EAAE,OAAO,CAAC,eAAe,CACpC,mCAAmC,EAAE;YACnC,IAAI,EAAE,qCAAqC;SAC5C,CAAC;KACL,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/noise.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/noise.d.ts deleted file mode 100644 index 51255c0e1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/noise.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { bytes } from './@types/basic.js'; -import type { INoiseConnection } from './@types/libp2p.js'; -import type { ICryptoInterface } from './crypto.js'; -import type { NoiseExtensions } from './proto/payload.js'; -import type { MultiaddrConnection } from '@libp2p/interface/connection'; -import type { SecuredConnection } from '@libp2p/interface/connection-encrypter'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { Duplex } from 'it-stream-types'; -import type { Uint8ArrayList } from 'uint8arraylist'; -export interface NoiseInit { - /** - * x25519 private key, reuse for faster handshakes - */ - staticNoiseKey?: bytes; - extensions?: NoiseExtensions; - crypto?: ICryptoInterface; - prologueBytes?: Uint8Array; - metrics?: Metrics; -} -export declare class Noise implements INoiseConnection { - protocol: string; - crypto: ICryptoInterface; - private readonly prologue; - private readonly staticKeys; - private readonly extensions?; - private readonly metrics?; - constructor(init?: NoiseInit); - /** - * Encrypt outgoing data to the remote party (handshake as initiator) - * - * @param {PeerId} localPeer - PeerId of the receiving peer - * @param {Stream} connection - streaming iterable duplex that will be encrypted - * @param {PeerId} remotePeer - PeerId of the remote peer. Used to validate the integrity of the remote peer. - * @returns {Promise>} - */ - secureOutbound> = MultiaddrConnection>(localPeer: PeerId, connection: Stream, remotePeer?: PeerId): Promise>; - /** - * Decrypt incoming data (handshake as responder). - * - * @param {PeerId} localPeer - PeerId of the receiving peer. - * @param {Stream} connection - streaming iterable duplex that will be encrypted. - * @param {PeerId} remotePeer - optional PeerId of the initiating peer, if known. This may only exist during transport upgrades. - * @returns {Promise>} - */ - secureInbound> = MultiaddrConnection>(localPeer: PeerId, connection: Stream, remotePeer?: PeerId): Promise>; - /** - * If Noise pipes supported, tries IK handshake first with XX as fallback if it fails. - * If noise pipes disabled or remote peer static key is unknown, use XX. - * - * @param {HandshakeParams} params - */ - private performHandshake; - private performXXHandshake; - private createSecureConnection; -} -//# sourceMappingURL=noise.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/noise.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/noise.d.ts.map deleted file mode 100644 index cec69f3cf..000000000 --- a/perf/impl/js-libp2p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AAI,GAAE,SAAc;IAgBjC;;;;;;;OAOG;IACU,cAAc,CAAE,MAAM,SAAS,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,GAAG,mBAAmB,EAAG,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IA2BxO;;;;;;;OAOG;IACU,aAAa,CAAE,MAAM,SAAS,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,GAAG,mBAAmB,EAAG,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IA2BvO;;;;;OAKG;YACW,gBAAgB;YAOhB,kBAAkB;YA+BlB,sBAAsB;CAmBrC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/noise.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/noise.js deleted file mode 100644 index ff97e2199..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/noise.js +++ /dev/null @@ -1,135 +0,0 @@ -import { decode } from 'it-length-prefixed'; -import { lpStream } from 'it-length-prefixed-stream'; -import { duplexPair } from 'it-pair/duplex'; -import { pipe } from 'it-pipe'; -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { NOISE_MSG_MAX_LENGTH_BYTES } from './constants.js'; -import { defaultCrypto } from './crypto/index.js'; -import { decryptStream, encryptStream } from './crypto/streaming.js'; -import { uint16BEDecode, uint16BEEncode } from './encoder.js'; -import { XXHandshake } from './handshake-xx.js'; -import { registerMetrics } from './metrics.js'; -import { getPayload } from './utils.js'; -export class Noise { - protocol = '/noise'; - crypto; - prologue; - staticKeys; - extensions; - metrics; - constructor(init = {}) { - const { staticNoiseKey, extensions, crypto, prologueBytes, metrics } = init; - this.crypto = crypto ?? defaultCrypto; - this.extensions = extensions; - this.metrics = metrics ? registerMetrics(metrics) : undefined; - if (staticNoiseKey) { - // accepts x25519 private key of length 32 - this.staticKeys = this.crypto.generateX25519KeyPairFromSeed(staticNoiseKey); - } - else { - this.staticKeys = this.crypto.generateX25519KeyPair(); - } - this.prologue = prologueBytes ?? uint8ArrayAlloc(0); - } - /** - * Encrypt outgoing data to the remote party (handshake as initiator) - * - * @param {PeerId} localPeer - PeerId of the receiving peer - * @param {Stream} connection - streaming iterable duplex that will be encrypted - * @param {PeerId} remotePeer - PeerId of the remote peer. Used to validate the integrity of the remote peer. - * @returns {Promise>} - */ - async secureOutbound(localPeer, connection, remotePeer) { - const wrappedConnection = lpStream(connection, { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - }); - const handshake = await this.performHandshake({ - connection: wrappedConnection, - isInitiator: true, - localPeer, - remotePeer - }); - const conn = await this.createSecureConnection(wrappedConnection, handshake); - connection.source = conn.source; - connection.sink = conn.sink; - return { - conn: connection, - remoteExtensions: handshake.remoteExtensions, - remotePeer: handshake.remotePeer - }; - } - /** - * Decrypt incoming data (handshake as responder). - * - * @param {PeerId} localPeer - PeerId of the receiving peer. - * @param {Stream} connection - streaming iterable duplex that will be encrypted. - * @param {PeerId} remotePeer - optional PeerId of the initiating peer, if known. This may only exist during transport upgrades. - * @returns {Promise>} - */ - async secureInbound(localPeer, connection, remotePeer) { - const wrappedConnection = lpStream(connection, { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - }); - const handshake = await this.performHandshake({ - connection: wrappedConnection, - isInitiator: false, - localPeer, - remotePeer - }); - const conn = await this.createSecureConnection(wrappedConnection, handshake); - connection.source = conn.source; - connection.sink = conn.sink; - return { - conn: connection, - remotePeer: handshake.remotePeer, - remoteExtensions: handshake.remoteExtensions - }; - } - /** - * If Noise pipes supported, tries IK handshake first with XX as fallback if it fails. - * If noise pipes disabled or remote peer static key is unknown, use XX. - * - * @param {HandshakeParams} params - */ - async performHandshake(params) { - const payload = await getPayload(params.localPeer, this.staticKeys.publicKey, this.extensions); - // run XX handshake - return this.performXXHandshake(params, payload); - } - async performXXHandshake(params, payload) { - const { isInitiator, remotePeer, connection } = params; - const handshake = new XXHandshake(isInitiator, payload, this.prologue, this.crypto, this.staticKeys, connection, remotePeer); - try { - await handshake.propose(); - await handshake.exchange(); - await handshake.finish(); - this.metrics?.xxHandshakeSuccesses.increment(); - } - catch (e) { - this.metrics?.xxHandshakeErrors.increment(); - if (e instanceof Error) { - e.message = `Error occurred during XX handshake: ${e.message}`; - throw e; - } - } - return handshake; - } - async createSecureConnection(connection, handshake) { - // Create encryption box/unbox wrapper - const [secure, user] = duplexPair(); - const network = connection.unwrap(); - await pipe(secure, // write to wrapper - encryptStream(handshake, this.metrics), // encrypt data + prefix with message length - network, // send to the remote peer - (source) => decode(source, { lengthDecoder: uint16BEDecode }), // read message length prefix - decryptStream(handshake, this.metrics), // decrypt the incoming data - secure // pipe to the wrapper - ); - return user; - } -} -//# sourceMappingURL=noise.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/noise.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/noise.js.map deleted file mode 100644 index dae7d9748..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/noise.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise.js","sourceRoot":"","sources":["../../src/noise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAA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AC,OAAO,GAAG,uCAAuC,CAAC,CAAC,OAAO,EAAE,CAAA;gBAC9D,MAAM,CAAC,CAAA;aACR;SACF;QAED,OAAO,SAAS,CAAA;IAClB,CAAC;IAEO,KAAK,CAAC,sBAAsB,CAClC,UAAqF,EACrF,SAAqB;QAErB,sCAAsC;QACtC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,UAAU,EAA+B,CAAA;QAChE,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,CAAA;QAEnC,MAAM,IAAI,CACR,MAAM,EAAE,mBAAmB;QAC3B,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,4CAA4C;QACpF,OAAO,EAAE,0BAA0B;QACnC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC,EAAE,6BAA6B;QAC5F,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,4BAA4B;QACpE,MAAM,CAAC,sBAAsB;SAC9B,CAAA;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/nonce.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/nonce.d.ts deleted file mode 100644 index 662855bd3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/nonce.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { bytes, uint64 } from './@types/basic.js'; -export declare const MIN_NONCE = 0; -export declare const MAX_NONCE = 4294967295; -/** - * The nonce is an uint that's increased over time. - * Maintaining different representations help improve performance. - */ -export declare class Nonce { - private n; - private readonly bytes; - private readonly view; - constructor(n?: number); - increment(): void; - getBytes(): bytes; - getUint64(): uint64; - assertValue(): void; -} -//# sourceMappingURL=nonce.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/nonce.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/nonce.d.ts.map deleted file mode 100644 index 6e502d077..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/nonce.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nonce.d.ts","sourceRoot":"","sources":["../../src/nonce.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAEtD,eAAO,MAAM,SAAS,IAAI,CAAA;AAO1B,eAAO,MAAM,SAAS,aAAa,CAAA;AAInC;;;GAGG;AACH,qBAAa,KAAK;IAChB,OAAO,CAAC,CAAC,CAAQ;IACjB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;IAC7B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;gBAElB,CAAC,SAAY;IAO1B,SAAS,IAAK,IAAI;IAMlB,QAAQ,IAAK,KAAK;IAIlB,SAAS,IAAK,MAAM;IAIpB,WAAW,IAAK,IAAI;CAKrB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/nonce.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/nonce.js deleted file mode 100644 index 0130475cf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/nonce.js +++ /dev/null @@ -1,42 +0,0 @@ -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -export const MIN_NONCE = 0; -// For performance reasons, the nonce is represented as a JS `number` -// Although JS `number` can safely represent integers up to 2 ** 53 - 1, we choose to only use -// 4 bytes to store the data for performance reason. -// This is a slight deviation from the noise spec, which describes the max nonce as 2 ** 64 - 2 -// The effect is that this implementation will need a new handshake to be performed after fewer messages are exchanged than other implementations with full uint64 nonces. -// this MAX_NONCE is still a large number of messages, so the practical effect of this is negligible. -export const MAX_NONCE = 0xffffffff; -const ERR_MAX_NONCE = 'Cipherstate has reached maximum n, a new handshake must be performed'; -/** - * The nonce is an uint that's increased over time. - * Maintaining different representations help improve performance. - */ -export class Nonce { - n; - bytes; - view; - constructor(n = MIN_NONCE) { - this.n = n; - this.bytes = uint8ArrayAlloc(12); - this.view = new DataView(this.bytes.buffer, this.bytes.byteOffset, this.bytes.byteLength); - this.view.setUint32(4, n, true); - } - increment() { - this.n++; - // Even though we're treating the nonce as 8 bytes, RFC7539 specifies 12 bytes for a nonce. - this.view.setUint32(4, this.n, true); - } - getBytes() { - return this.bytes; - } - getUint64() { - return this.n; - } - assertValue() { - if (this.n > MAX_NONCE) { - throw new Error(ERR_MAX_NONCE); - } - } -} -//# sourceMappingURL=nonce.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/nonce.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/nonce.js.map deleted file mode 100644 index d663be87f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/nonce.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nonce.js","sourceRoot":"","sources":["../../src/nonce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAG5D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAA;AAC1B,qEAAqE;AACrE,8FAA8F;AAC9F,oDAAoD;AACpD,+FAA+F;AAC/F,0KAA0K;AAC1K,qGAAqG;AACrG,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAA;AAEnC,MAAM,aAAa,GAAG,sEAAsE,CAAA;AAE5F;;;GAGG;AACH,MAAM,OAAO,KAAK;IACR,CAAC,CAAQ;IACA,KAAK,CAAO;IACZ,IAAI,CAAU;IAE/B,YAAa,CAAC,GAAG,SAAS;QACxB,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,KAAK,GAAG,eAAe,CAAC,EAAE,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QACzF,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;IACjC,CAAC;IAED,SAAS;QACP,IAAI,CAAC,CAAC,EAAE,CAAA;QACR,2FAA2F;QAC3F,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;IACtC,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,CAAC,CAAA;IACf,CAAC;IAED,WAAW;QACT,IAAI,IAAI,CAAC,CAAC,GAAG,SAAS,EAAE;YACtB,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAA;SAC/B;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/proto/payload.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/proto/payload.d.ts deleted file mode 100644 index 9d10fef73..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/proto/payload.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { type Codec } from 'protons-runtime'; -import type { Uint8ArrayList } from 'uint8arraylist'; -export interface NoiseExtensions { - webtransportCerthashes: Uint8Array[]; -} -export declare namespace NoiseExtensions { - const codec: () => Codec; - const encode: (obj: Partial) => Uint8Array; - const decode: (buf: Uint8Array | Uint8ArrayList) => NoiseExtensions; -} -export interface NoiseHandshakePayload { - identityKey: Uint8Array; - identitySig: Uint8Array; - extensions?: NoiseExtensions; -} -export declare namespace NoiseHandshakePayload { - const codec: () => Codec; - const encode: (obj: Partial) => Uint8Array; - const decode: (buf: Uint8Array | Uint8ArrayList) => NoiseHandshakePayload; -} -//# sourceMappingURL=payload.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/proto/payload.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/proto/payload.d.ts.map deleted file mode 100644 index 69519e688..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/proto/payload.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/proto/payload.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,KAAK,EAAyC,MAAM,iBAAiB,CAAA;AAEnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,WAAW,eAAe;IAC9B,sBAAsB,EAAE,UAAU,EAAE,CAAA;CACrC;AAED,yBAAiB,eAAe,CAAC;IAGxB,MAAM,KAAK,QAAO,MAAM,eAAe,CA4C7C,CAAA;IAEM,MAAM,MAAM,QAAS,QAAQ,eAAe,CAAC,KAAG,UAEtD,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,GAAG,cAAc,KAAG,eAEzD,CAAA;CACF;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,UAAU,CAAA;IACvB,WAAW,EAAE,UAAU,CAAA;IACvB,UAAU,CAAC,EAAE,eAAe,CAAA;CAC7B;AAED,yBAAiB,qBAAqB,CAAC;IAG9B,MAAM,KAAK,QAAO,MAAM,qBAAqB,CA6DnD,CAAA;IAEM,MAAM,MAAM,QAAS,QAAQ,qBAAqB,CAAC,KAAG,UAE5D,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,GAAG,cAAc,KAAG,qBAEzD,CAAA;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/proto/payload.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/proto/payload.js deleted file mode 100644 index 6ff217bdf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/proto/payload.js +++ /dev/null @@ -1,119 +0,0 @@ -/* eslint-disable import/export */ -/* eslint-disable complexity */ -/* eslint-disable @typescript-eslint/no-namespace */ -/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ -/* eslint-disable @typescript-eslint/no-empty-interface */ -import { decodeMessage, encodeMessage, message } from 'protons-runtime'; -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -export var NoiseExtensions; -(function (NoiseExtensions) { - let _codec; - NoiseExtensions.codec = () => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork(); - } - if (obj.webtransportCerthashes != null) { - for (const value of obj.webtransportCerthashes) { - w.uint32(10); - w.bytes(value); - } - } - if (opts.lengthDelimited !== false) { - w.ldelim(); - } - }, (reader, length) => { - const obj = { - webtransportCerthashes: [] - }; - const end = length == null ? reader.len : reader.pos + length; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - obj.webtransportCerthashes.push(reader.bytes()); - break; - } - default: { - reader.skipType(tag & 7); - break; - } - } - } - return obj; - }); - } - return _codec; - }; - NoiseExtensions.encode = (obj) => { - return encodeMessage(obj, NoiseExtensions.codec()); - }; - NoiseExtensions.decode = (buf) => { - return decodeMessage(buf, NoiseExtensions.codec()); - }; -})(NoiseExtensions || (NoiseExtensions = {})); -export var NoiseHandshakePayload; -(function (NoiseHandshakePayload) { - let _codec; - NoiseHandshakePayload.codec = () => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork(); - } - if ((obj.identityKey != null && obj.identityKey.byteLength > 0)) { - w.uint32(10); - w.bytes(obj.identityKey); - } - if ((obj.identitySig != null && obj.identitySig.byteLength > 0)) { - w.uint32(18); - w.bytes(obj.identitySig); - } - if (obj.extensions != null) { - w.uint32(34); - NoiseExtensions.codec().encode(obj.extensions, w); - } - if (opts.lengthDelimited !== false) { - w.ldelim(); - } - }, (reader, length) => { - const obj = { - identityKey: uint8ArrayAlloc(0), - identitySig: uint8ArrayAlloc(0) - }; - const end = length == null ? reader.len : reader.pos + length; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - obj.identityKey = reader.bytes(); - break; - } - case 2: { - obj.identitySig = reader.bytes(); - break; - } - case 4: { - obj.extensions = NoiseExtensions.codec().decode(reader, reader.uint32()); - break; - } - default: { - reader.skipType(tag & 7); - break; - } - } - } - return obj; - }); - } - return _codec; - }; - NoiseHandshakePayload.encode = (obj) => { - return encodeMessage(obj, NoiseHandshakePayload.codec()); - }; - NoiseHandshakePayload.decode = (buf) => { - return decodeMessage(buf, NoiseHandshakePayload.codec()); - }; -})(NoiseHandshakePayload || (NoiseHandshakePayload = {})); -//# sourceMappingURL=payload.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/proto/payload.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/proto/payload.js.map deleted file mode 100644 index d87a4016f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/proto/payload.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../src/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;wBACD,KAAK,CAAC,CAAC,CAAC;4BACN,GAAG,CAAC,UAAU,GAAG,eAAe,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;4BACxE,MAAK;yBACN;wBACD,OAAO,CAAC,CAAC;4BACP,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;4BACxB,MAAK;yBACN;qBACF;iBACF;gBAED,OAAO,GAAG,CAAA;YACZ,CAAC,CAAC,CAAA;SACH;QAED,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;IAEY,4BAAM,GAAG,CAAC,GAAmC,EAAc,EAAE;QACxE,OAAO,aAAa,CAAC,GAAG,EAAE,qBAAqB,CAAC,KAAK,EAAE,CAAC,CAAA;IAC1D,CAAC,CAAA;IAEY,4BAAM,GAAG,CAAC,GAAgC,EAAyB,EAAE;QAChF,OAAO,aAAa,CAAC,GAAG,EAAE,qBAAqB,CAAC,KAAK,EAAE,CAAC,CAAA;IAC1D,CAAC,CAAA;AACH,CAAC,EAzEgB,qBAAqB,KAArB,qBAAqB,QAyErC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/utils.d.ts deleted file mode 100644 index 84d925c27..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/utils.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { type NoiseExtensions, NoiseHandshakePayload } from './proto/payload.js'; -import type { bytes } from './@types/basic.js'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export declare function getPayload(localPeer: PeerId, staticPublicKey: bytes, extensions?: NoiseExtensions): Promise; -export declare function createHandshakePayload(libp2pPublicKey: Uint8Array, signedPayload: Uint8Array, extensions?: NoiseExtensions): bytes; -export declare function signPayload(peerId: PeerId, payload: bytes): Promise; -export declare function getPeerIdFromPayload(payload: NoiseHandshakePayload): Promise; -export declare function decodePayload(payload: bytes | Uint8Array): NoiseHandshakePayload; -export declare function getHandshakePayload(publicKey: bytes): bytes; -/** - * Verifies signed payload, throws on any irregularities. - * - * @param {bytes} noiseStaticKey - owner's noise static key - * @param {bytes} payload - decoded payload - * @param {PeerId} remotePeer - owner's libp2p peer ID - * @returns {Promise} - peer ID of payload owner - */ -export declare function verifySignedPayload(noiseStaticKey: bytes, payload: NoiseHandshakePayload, remotePeer: PeerId): Promise; -export declare function isValidPublicKey(pk: bytes): boolean; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/utils.d.ts.map deleted file mode 100644 index 50f0d9642..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,wBAAsB,UAAU,CAC9B,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,KAAK,EACtB,UAAU,CAAC,EAAE,eAAe,GAC3B,OAAO,CAAC,KAAK,CAAC,CAYhB;AAED,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,UAAU,EAC3B,aAAa,EAAE,UAAU,EACzB,UAAU,CAAC,EAAE,eAAe,GAC3B,KAAK,CAMP;AAED,wBAAsB,WAAW,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAQjF;AAED,wBAAsB,oBAAoB,CAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAE3F;AAED,wBAAgB,aAAa,CAAE,OAAO,EAAE,KAAK,GAAG,UAAU,GAAG,qBAAqB,CAEjF;AAED,wBAAgB,mBAAmB,CAAE,SAAS,EAAE,KAAK,GAAG,KAAK,CAG5D;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,cAAc,EAAE,KAAK,EACrB,OAAO,EAAE,qBAAqB,EAC9B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAyBjB;AAED,wBAAgB,gBAAgB,CAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAUpD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/utils.js deleted file mode 100644 index b88ea5ef4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/utils.js +++ /dev/null @@ -1,74 +0,0 @@ -import { unmarshalPublicKey, unmarshalPrivateKey } from '@libp2p/crypto/keys'; -import { peerIdFromKeys } from '@libp2p/peer-id'; -import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { NoiseHandshakePayload } from './proto/payload.js'; -export async function getPayload(localPeer, staticPublicKey, extensions) { - const signedPayload = await signPayload(localPeer, getHandshakePayload(staticPublicKey)); - if (localPeer.publicKey == null) { - throw new Error('PublicKey was missing from local PeerId'); - } - return createHandshakePayload(localPeer.publicKey, signedPayload, extensions); -} -export function createHandshakePayload(libp2pPublicKey, signedPayload, extensions) { - return NoiseHandshakePayload.encode({ - identityKey: libp2pPublicKey, - identitySig: signedPayload, - extensions: extensions ?? { webtransportCerthashes: [] } - }).subarray(); -} -export async function signPayload(peerId, payload) { - if (peerId.privateKey == null) { - throw new Error('PrivateKey was missing from PeerId'); - } - const privateKey = await unmarshalPrivateKey(peerId.privateKey); - return privateKey.sign(payload); -} -export async function getPeerIdFromPayload(payload) { - return peerIdFromKeys(payload.identityKey); -} -export function decodePayload(payload) { - return NoiseHandshakePayload.decode(payload); -} -export function getHandshakePayload(publicKey) { - const prefix = uint8ArrayFromString('noise-libp2p-static-key:'); - return uint8ArrayConcat([prefix, publicKey], prefix.length + publicKey.length); -} -/** - * Verifies signed payload, throws on any irregularities. - * - * @param {bytes} noiseStaticKey - owner's noise static key - * @param {bytes} payload - decoded payload - * @param {PeerId} remotePeer - owner's libp2p peer ID - * @returns {Promise} - peer ID of payload owner - */ -export async function verifySignedPayload(noiseStaticKey, payload, remotePeer) { - // Unmarshaling from PublicKey protobuf - const payloadPeerId = await peerIdFromKeys(payload.identityKey); - if (!payloadPeerId.equals(remotePeer)) { - throw new Error(`Payload identity key ${payloadPeerId.toString()} does not match expected remote peer ${remotePeer.toString()}`); - } - const generatedPayload = getHandshakePayload(noiseStaticKey); - if (payloadPeerId.publicKey == null) { - throw new Error('PublicKey was missing from PeerId'); - } - if (payload.identitySig == null) { - throw new Error('Signature was missing from message'); - } - const publicKey = unmarshalPublicKey(payloadPeerId.publicKey); - const valid = await publicKey.verify(generatedPayload, payload.identitySig); - if (!valid) { - throw new Error("Static key doesn't match to peer that signed payload!"); - } - return payloadPeerId; -} -export function isValidPublicKey(pk) { - if (!(pk instanceof Uint8Array)) { - return false; - } - if (pk.length !== 32) { - return false; - } - return true; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/utils.js.map deleted file mode 100644 index 7e09ad531..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/src/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAwB,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAIhF,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,SAAiB,EACjB,eAAsB,EACtB,UAA4B;IAE5B,MAAM,aAAa,GAAG,MAAM,WAAW,CAAC,SAAS,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAA;IAExF,IAAI,SAAS,CAAC,SAAS,IAAI,IAAI,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAA;KAC3D;IAED,OAAO,sBAAsB,CAC3B,SAAS,CAAC,SAAS,EACnB,aAAa,EACb,UAAU,CACX,CAAA;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,eAA2B,EAC3B,aAAyB,EACzB,UAA4B;IAE5B,OAAO,qBAAqB,CAAC,MAAM,CAAC;QAClC,WAAW,EAAE,eAAe;QAC5B,WAAW,EAAE,aAAa;QAC1B,UAAU,EAAE,UAAU,IAAI,EAAE,sBAAsB,EAAE,EAAE,EAAE;KACzD,CAAC,CAAC,QAAQ,EAAE,CAAA;AACf,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAE,MAAc,EAAE,OAAc;IAC/D,IAAI,MAAM,CAAC,UAAU,IAAI,IAAI,EAAE;QAC7B,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CA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tD;IAED,MAAM,SAAS,GAAG,kBAAkB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAA;IAE7D,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;IAE3E,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;KACzE;IAED,OAAO,aAAa,CAAA;AACtB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAE,EAAS;IACzC,IAAI,CAAC,CAAC,EAAE,YAAY,UAAU,CAAC,EAAE;QAC/B,OAAO,KAAK,CAAA;KACb;IAED,IAAI,EAAE,CAAC,MAAM,KAAK,EAAE,EAAE;QACpB,OAAO,KAAK,CAAA;KACb;IAED,OAAO,IAAI,CAAA;AACb,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/compliance.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/compliance.spec.d.ts deleted file mode 100644 index dac08d9d2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/compliance.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=compliance.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/compliance.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/compliance.spec.d.ts.map deleted file mode 100644 index dc9e71995..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/compliance.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.d.ts","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/compliance.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/compliance.spec.js deleted file mode 100644 index 68cfabeb5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/compliance.spec.js +++ /dev/null @@ -1,11 +0,0 @@ -import tests from '@libp2p/interface-compliance-tests/connection-encryption'; -import { Noise } from '../src/noise.js'; -describe('spec compliance tests', function () { - tests({ - async setup() { - return new Noise(); - }, - async teardown() { } - }); -}); -//# sourceMappingURL=compliance.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/compliance.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/compliance.spec.js.map deleted file mode 100644 index 43ca499a2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/compliance.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.js","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,0DAA0D,CAAA;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,QAAQ,CAAC,uBAAuB,EAAE;IAChC,KAAK,CAAC;QACJ,KAAK,CAAC,KAAK;YACT,OAAO,IAAI,KAAK,EAAE,CAAA;QACpB,CAAC;QACD,KAAK,CAAC,QAAQ,KAAK,CAAC;KACrB,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/fixtures/peer.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/fixtures/peer.d.ts deleted file mode 100644 index 7a23a4986..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/fixtures/peer.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PeerId } from '@libp2p/interface/peer-id'; -export declare function createPeerIdsFromFixtures(length: number): Promise; -export declare function createPeerIds(length: number): Promise; -//# sourceMappingURL=peer.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/fixtures/peer.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/fixtures/peer.d.ts.map deleted file mode 100644 index f076c8510..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/fixtures/peer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer.d.ts","sourceRoot":"","sources":["../../../test/fixtures/peer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAqBvD,wBAAsB,yBAAyB,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAIlF;AAED,wBAAsB,aAAa,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAQtE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/fixtures/peer.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/fixtures/peer.js deleted file mode 100644 index 307e38c37..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/fixtures/peer.js +++ /dev/null @@ -1,31 +0,0 @@ -import { createEd25519PeerId, createFromJSON } from '@libp2p/peer-id-factory'; -// ed25519 keys -const peers = [{ - id: '12D3KooWH45PiqBjfnEfDfCD6TqJrpqTBJvQDwGHvjGpaWwms46D', - privKey: 'CAESYBtKXrMwawAARmLScynQUuSwi/gGSkwqDPxi15N3dqDHa4T4iWupkMe5oYGwGH3Hyfvd/QcgSTqg71oYZJadJ6prhPiJa6mQx7mhgbAYfcfJ+939ByBJOqDvWhhklp0nqg==', - pubKey: 'CAESIGuE+IlrqZDHuaGBsBh9x8n73f0HIEk6oO9aGGSWnSeq' - }, { - id: '12D3KooWP63uzL78BRMpkQ7augMdNi1h3VBrVWZucKjyhzGVaSi1', - privKey: 'CAESYPxO3SHyfc2578hDmfkGGBY255JjiLuVavJWy+9ivlpsxSyVKf36ipyRGL6szGzHuFs5ceEuuGVrPMg/rW2Ch1bFLJUp/fqKnJEYvqzMbMe4Wzlx4S64ZWs8yD+tbYKHVg==', - pubKey: 'CAESIMUslSn9+oqckRi+rMxsx7hbOXHhLrhlazzIP61tgodW' - }, { - id: '12D3KooWF85R7CM2Wikdtb2sjwnd24e1tgojf3MEWwizmVB8PA6U', - privKey: 'CAESYNXoQ5CnooE939AEqE2JJGPqvhoFJn0xP+j9KwjfOfDkTtPyfn2kJ1gn3uOYTcmoHFU1bbETNtRVuPMi1fmDmqFO0/J+faQnWCfe45hNyagcVTVtsRM21FW48yLV+YOaoQ==', - pubKey: 'CAESIE7T8n59pCdYJ97jmE3JqBxVNW2xEzbUVbjzItX5g5qh' - }, { - id: '12D3KooWPCofiCjhdtezP4eMnqBjjutFZNHjV39F5LWNrCvaLnzT', - privKey: 'CAESYLhUut01XPu+yIPbtZ3WnxOd26FYuTMRn/BbdFYsZE2KxueKRlo9yIAxmFReoNFUKztUU4G2aUiTbqDQaA6i0MDG54pGWj3IgDGYVF6g0VQrO1RTgbZpSJNuoNBoDqLQwA==', - pubKey: 'CAESIMbnikZaPciAMZhUXqDRVCs7VFOBtmlIk26g0GgOotDA' - }]; -export async function createPeerIdsFromFixtures(length) { - return Promise.all(Array.from({ length }).map(async (_, i) => createFromJSON(peers[i]))); -} -export async function createPeerIds(length) { - const peerIds = []; - for (let i = 0; i < length; i++) { - const id = await createEd25519PeerId(); - peerIds.push(id); - } - return peerIds; -} -//# sourceMappingURL=peer.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/fixtures/peer.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/fixtures/peer.js.map deleted file mode 100644 index a0da6c2d9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/fixtures/peer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer.js","sourceRoot":"","sources":["../../../test/fixtures/peer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAG7E,eAAe;AACf,MAAM,KAAK,GAAG,CAAC;QACb,EAAE,EAAE,sDAAsD;QAC1D,OAAO,EAAE,0IAA0I;QACnJ,MAAM,EAAE,kDAAkD;KAC3D,EAAE;QACD,EAAE,EAAE,sDAAsD;QAC1D,OAAO,EAAE,0IAA0I;QACnJ,MAAM,EAAE,kDAAkD;KAC3D,EAAE;QACD,EAAE,EAAE,sDAAsD;QAC1D,OAAO,EAAE,0IAA0I;QACnJ,MAAM,EAAE,kDAAkD;KAC3D,EAAE;QACD,EAAE,EAAE,sDAAsD;QAC1D,OAAO,EAAE,0IAA0I;QACnJ,MAAM,EAAE,kDAAkD;KAC3D,CAAC,CAAA;AAEF,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAE,MAAc;IAC7D,OAAO,OAAO,CAAC,GAAG,CAChB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CACrE,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAE,MAAc;IACjD,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,MAAM,EAAE,GAAG,MAAM,mBAAmB,EAAE,CAAA;QACtC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;KACjB;IAED,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/handshakes/xx.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/handshakes/xx.spec.d.ts deleted file mode 100644 index 638a8ffa7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/handshakes/xx.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=xx.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/handshakes/xx.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/handshakes/xx.spec.d.ts.map deleted file mode 100644 index d46c424d4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/handshakes/xx.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx.spec.d.ts","sourceRoot":"","sources":["../../../test/handshakes/xx.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/handshakes/xx.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/handshakes/xx.spec.js deleted file mode 100644 index 1fb4f4029..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/handshakes/xx.spec.js +++ /dev/null @@ -1,126 +0,0 @@ -import { Buffer } from 'buffer'; -import { expect, assert } from 'aegir/chai'; -import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { pureJsCrypto } from '../../src/crypto/js.js'; -import { XX } from '../../src/handshakes/xx.js'; -import { createHandshakePayload, getHandshakePayload } from '../../src/utils.js'; -import { generateEd25519Keys } from '../utils.js'; -describe('XX Handshake', () => { - const prologue = Buffer.alloc(0); - it('Test creating new XX session', async () => { - try { - const xx = new XX(pureJsCrypto); - const kpInitiator = pureJsCrypto.generateX25519KeyPair(); - xx.initSession(true, prologue, kpInitiator); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('Test get HKDF', () => { - const ckBytes = Buffer.from('4e6f6973655f58585f32353531395f58436861436861506f6c795f53484132353600000000000000000000000000000000000000000000000000000000000000', 'hex'); - const ikm = Buffer.from('a3eae50ea37a47e8a7aa0c7cd8e16528670536dcd538cebfd724fb68ce44f1910ad898860666227d4e8dd50d22a9a64d1c0a6f47ace092510161e9e442953da3', 'hex'); - const ck = Buffer.alloc(32); - ckBytes.copy(ck); - const [k1, k2, k3] = pureJsCrypto.getHKDF(ck, ikm); - expect(uint8ArrayToString(k1, 'hex')).to.equal('cc5659adff12714982f806e2477a8d5ddd071def4c29bb38777b7e37046f6914'); - expect(uint8ArrayToString(k2, 'hex')).to.equal('a16ada915e551ab623f38be674bb4ef15d428ae9d80688899c9ef9b62ef208fa'); - expect(uint8ArrayToString(k3, 'hex')).to.equal('ff67bf9727e31b06efc203907e6786667d2c7a74ac412b4d31a80ba3fd766f68'); - }); - async function doHandshake(xx) { - const kpInit = pureJsCrypto.generateX25519KeyPair(); - const kpResp = pureJsCrypto.generateX25519KeyPair(); - // initiator setup - const libp2pInitKeys = await generateEd25519Keys(); - const initSignedPayload = await libp2pInitKeys.sign(getHandshakePayload(kpInit.publicKey)); - // responder setup - const libp2pRespKeys = await generateEd25519Keys(); - const respSignedPayload = await libp2pRespKeys.sign(getHandshakePayload(kpResp.publicKey)); - // initiator: new XX noise session - const nsInit = xx.initSession(true, prologue, kpInit); - // responder: new XX noise session - const nsResp = xx.initSession(false, prologue, kpResp); - /* STAGE 0 */ - // initiator creates payload - libp2pInitKeys.marshal().slice(0, 32); - const libp2pInitPubKey = libp2pInitKeys.marshal().slice(32, 64); - const payloadInitEnc = createHandshakePayload(libp2pInitPubKey, initSignedPayload); - // initiator sends message - const message = Buffer.concat([Buffer.alloc(0), payloadInitEnc]); - const messageBuffer = xx.sendMessage(nsInit, message); - expect(messageBuffer.ne.length).not.equal(0); - // responder receives message - xx.recvMessage(nsResp, messageBuffer); - /* STAGE 1 */ - // responder creates payload - libp2pRespKeys.marshal().slice(0, 32); - const libp2pRespPubKey = libp2pRespKeys.marshal().slice(32, 64); - const payloadRespEnc = createHandshakePayload(libp2pRespPubKey, respSignedPayload); - const message1 = Buffer.concat([message, payloadRespEnc]); - const messageBuffer2 = xx.sendMessage(nsResp, message1); - expect(messageBuffer2.ne.length).not.equal(0); - expect(messageBuffer2.ns.length).not.equal(0); - // initiator receive payload - xx.recvMessage(nsInit, messageBuffer2); - /* STAGE 2 */ - // initiator send message - const messageBuffer3 = xx.sendMessage(nsInit, Buffer.alloc(0)); - // responder receive message - xx.recvMessage(nsResp, messageBuffer3); - if (nsInit.cs1 == null || nsResp.cs1 == null || nsInit.cs2 == null || nsResp.cs2 == null) { - throw new Error('CipherState missing'); - } - assert(uint8ArrayEquals(nsInit.cs1.k, nsResp.cs1.k)); - assert(uint8ArrayEquals(nsInit.cs2.k, nsResp.cs2.k)); - return { nsInit, nsResp }; - } - it('Test handshake', async () => { - try { - const xx = new XX(pureJsCrypto); - await doHandshake(xx); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('Test symmetric encrypt and decrypt', async () => { - try { - const xx = new XX(pureJsCrypto); - const { nsInit, nsResp } = await doHandshake(xx); - const ad = Buffer.from('authenticated'); - const message = Buffer.from('HelloCrypto'); - if (nsInit.cs1 == null || nsResp.cs1 == null || nsInit.cs2 == null || nsResp.cs2 == null) { - throw new Error('CipherState missing'); - } - const ciphertext = xx.encryptWithAd(nsInit.cs1, ad, message); - assert(!uint8ArrayEquals(Buffer.from('HelloCrypto'), ciphertext), 'Encrypted message should not be same as plaintext.'); - const { plaintext: decrypted, valid } = xx.decryptWithAd(nsResp.cs1, ad, ciphertext); - assert(uint8ArrayEquals(Buffer.from('HelloCrypto'), decrypted), 'Decrypted text not equal to original message.'); - assert(valid); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('Test multiple messages encryption and decryption', async () => { - const xx = new XX(pureJsCrypto); - const { nsInit, nsResp } = await doHandshake(xx); - const ad = Buffer.from('authenticated'); - const message = Buffer.from('ethereum1'); - if (nsInit.cs1 == null || nsResp.cs1 == null || nsInit.cs2 == null || nsResp.cs2 == null) { - throw new Error('CipherState missing'); - } - const encrypted = xx.encryptWithAd(nsInit.cs1, ad, message); - const { plaintext: decrypted } = xx.decryptWithAd(nsResp.cs1, ad, encrypted); - assert.equal('ethereum1', uint8ArrayToString(decrypted, 'utf8'), 'Decrypted text not equal to original message.'); - const message2 = Buffer.from('ethereum2'); - const encrypted2 = xx.encryptWithAd(nsInit.cs1, ad, message2); - const { plaintext: decrypted2 } = xx.decryptWithAd(nsResp.cs1, ad, encrypted2); - assert.equal('ethereum2', uint8ArrayToString(decrypted2, 'utf-8'), 'Decrypted text not equal to original message.'); - }); -}); -//# sourceMappingURL=xx.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/handshakes/xx.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/handshakes/xx.spec.js.map deleted file mode 100644 index c1bd0610e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/handshakes/xx.spec.js.map +++ /dev/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C,GAAG,EAAE,EAAE,EAAE,UAAU,CAAC,CAAA;QAC9E,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,kBAAkB,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,+CAA+C,CAAC,CAAA;IACrH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/index.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/index.spec.d.ts deleted file mode 100644 index b37c2d278..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/index.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/index.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/index.spec.d.ts.map deleted file mode 100644 index 5c897805d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/index.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../test/index.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/index.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/index.spec.js deleted file mode 100644 index 19e71aa40..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/index.spec.js +++ /dev/null @@ -1,49 +0,0 @@ -import { expect } from 'aegir/chai'; -import { lpStream } from 'it-length-prefixed-stream'; -import { duplexPair } from 'it-pair/duplex'; -import sinon from 'sinon'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { noise } from '../src/index.js'; -import { Noise } from '../src/noise.js'; -import { createPeerIdsFromFixtures } from './fixtures/peer.js'; -function createCounterSpy() { - return sinon.spy({ - increment: () => { }, - reset: () => { } - }); -} -describe('Index', () => { - it('should expose class with tag and required functions', () => { - const noiseInstance = noise()(); - expect(noiseInstance.protocol).to.equal('/noise'); - expect(typeof (noiseInstance.secureInbound)).to.equal('function'); - expect(typeof (noiseInstance.secureOutbound)).to.equal('function'); - }); - it('should collect metrics', async () => { - const [localPeer, remotePeer] = await createPeerIdsFromFixtures(2); - const metricsRegistry = new Map(); - const metrics = { - registerCounter: (name) => { - const counter = createCounterSpy(); - metricsRegistry.set(name, counter); - return counter; - } - }; - const noiseInit = new Noise({ metrics: metrics }); - const noiseResp = new Noise({}); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection, localPeer) - ]); - const wrappedInbound = lpStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - await wrappedOutbound.write(uint8ArrayFromString('test')); - await wrappedInbound.read(); - expect(metricsRegistry.get('libp2p_noise_xxhandshake_successes_total')?.increment.callCount).to.equal(1); - expect(metricsRegistry.get('libp2p_noise_xxhandshake_error_total')?.increment.callCount).to.equal(0); - expect(metricsRegistry.get('libp2p_noise_encrypted_packets_total')?.increment.callCount).to.equal(1); - expect(metricsRegistry.get('libp2p_noise_decrypt_errors_total')?.increment.callCount).to.equal(0); - }); -}); -//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/index.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/index.spec.js.map deleted file mode 100644 index 65a6567d3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/index.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../test/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAI9D,SAAS,gBAAgB;IACvB,OAAO,KAAK,CAAC,GAAG,CAAC;QACf,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;QACnB,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;KAChB,CAAC,CAAA;AACJ,CAAC;AAED,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC7D,MAAM,aAAa,GAAG,KAAK,EAAE,EAAE,CAAA;QAC/B,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QACjD,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QACjE,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;IACpE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACtC,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AAC,sCAAsC,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACpG,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,sCAAsC,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACpG,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,mCAAmC,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACnG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/interop.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/interop.d.ts deleted file mode 100644 index f160cf14e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/interop.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=interop.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/interop.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/interop.d.ts.map deleted file mode 100644 index 14efbf496..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/interop.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interop.d.ts","sourceRoot":"","sources":["../../test/interop.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/interop.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/interop.js deleted file mode 100644 index 031d7f039..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/interop.js +++ /dev/null @@ -1,93 +0,0 @@ -import fs from 'fs'; -import { yamux } from '@chainsafe/libp2p-yamux'; -import { unmarshalPrivateKey } from '@libp2p/crypto/keys'; -import { createClient } from '@libp2p/daemon-client'; -import { createServer } from '@libp2p/daemon-server'; -import { connectInteropTests } from '@libp2p/interop'; -import { logger } from '@libp2p/logger'; -import { peerIdFromKeys } from '@libp2p/peer-id'; -import { tcp } from '@libp2p/tcp'; -import { multiaddr } from '@multiformats/multiaddr'; -import { execa } from 'execa'; -import { path as p2pd } from 'go-libp2p'; -import { createLibp2p } from 'libp2p'; -import pDefer from 'p-defer'; -import { noise } from '../src/index.js'; -async function createGoPeer(options) { - const controlPort = Math.floor(Math.random() * (50000 - 10000 + 1)) + 10000; - const apiAddr = multiaddr(`/ip4/0.0.0.0/tcp/${controlPort}`); - const log = logger(`go-libp2p:${controlPort}`); - const opts = [ - `-listen=${apiAddr.toString()}`, - '-hostAddrs=/ip4/0.0.0.0/tcp/0' - ]; - if (options.noise === true) { - opts.push('-noise=true'); - } - if (options.key != null) { - opts.push(`-id=${options.key}`); - } - const deferred = pDefer(); - const proc = execa(p2pd(), opts); - proc.stdout?.on('data', (buf) => { - const str = buf.toString(); - log(str); - // daemon has started - if (str.includes('Control socket:')) { - deferred.resolve(); - } - }); - proc.stderr?.on('data', (buf) => { - log.error(buf.toString()); - }); - await deferred.promise; - return { - client: createClient(apiAddr), - stop: async () => { - proc.kill(); - } - }; -} -async function createJsPeer(options) { - let peerId; - if (options.key != null) { - const keyFile = fs.readFileSync(options.key); - const privateKey = await unmarshalPrivateKey(keyFile); - peerId = await peerIdFromKeys(privateKey.public.bytes, privateKey.bytes); - } - const opts = { - peerId, - addresses: { - listen: ['/ip4/0.0.0.0/tcp/0'] - }, - transports: [tcp()], - streamMuxers: [yamux()], - connectionEncryption: [noise()] - }; - const node = await createLibp2p(opts); - const server = createServer(multiaddr('/ip4/0.0.0.0/tcp/0'), node); - await server.start(); - return { - client: createClient(server.getMultiaddr()), - stop: async () => { - await server.stop(); - await node.stop(); - } - }; -} -async function main() { - const factory = { - async spawn(options) { - if (options.type === 'go') { - return createGoPeer(options); - } - return createJsPeer(options); - } - }; - connectInteropTests(factory); -} -main().catch(err => { - console.error(err); // eslint-disable-line no-console - process.exit(1); -}); -//# sourceMappingURL=interop.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/interop.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/interop.js.map deleted file mode 100644 index 28efc87f8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/interop.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interop.js","sourceRoot":"","sources":["../../test/interop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,YAAY,EAAsB,MAAM,QAAQ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AA;YACnB,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;QACnB,CAAC;KACF,CAAA;AACH,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAkB;QAC7B,KAAK,CAAC,KAAK,CAAE,OAAqB;YAChC,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE;gBACzB,OAAO,YAAY,CAAC,OAAO,CAAC,CAAA;aAC7B;YAED,OAAO,YAAY,CAAC,OAAO,CAAC,CAAA;QAC9B,CAAC;KACF,CAAA;IAED,mBAAmB,CAAC,OAAO,CAAC,CAAA;AAC9B,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA,CAAC,iCAAiC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/noise.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/noise.spec.d.ts deleted file mode 100644 index f520ec336..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/noise.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=noise.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/noise.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/noise.spec.d.ts.map deleted file mode 100644 index 2e9faaa67..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/noise.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise.spec.d.ts","sourceRoot":"","sources":["../../test/noise.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/noise.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/noise.spec.js deleted file mode 100644 index b8a3acafb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/noise.spec.js +++ /dev/null @@ -1,182 +0,0 @@ -import { Buffer } from 'buffer'; -import { assert, expect } from 'aegir/chai'; -import { randomBytes } from 'iso-random-stream'; -import { byteStream } from 'it-byte-stream'; -import { lpStream } from 'it-length-prefixed-stream'; -import { duplexPair } from 'it-pair/duplex'; -import sinon from 'sinon'; -import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { NOISE_MSG_MAX_LENGTH_BYTES } from '../src/constants.js'; -import { pureJsCrypto } from '../src/crypto/js.js'; -import { decode0, decode2, encode1, uint16BEDecode, uint16BEEncode } from '../src/encoder.js'; -import { XXHandshake } from '../src/handshake-xx.js'; -import { XX } from '../src/handshakes/xx.js'; -import { Noise } from '../src/noise.js'; -import { createHandshakePayload, getHandshakePayload, getPayload, signPayload } from '../src/utils.js'; -import { createPeerIdsFromFixtures } from './fixtures/peer.js'; -import { getKeyPairFromPeerId } from './utils.js'; -describe('Noise', () => { - let remotePeer, localPeer; - const sandbox = sinon.createSandbox(); - before(async () => { - [localPeer, remotePeer] = await createPeerIdsFromFixtures(2); - }); - afterEach(function () { - sandbox.restore(); - }); - it('should communicate through encrypted streams without noise pipes', async () => { - try { - const noiseInit = new Noise({ staticNoiseKey: undefined, extensions: undefined }); - const noiseResp = new Noise({ staticNoiseKey: undefined, extensions: undefined }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection, localPeer) - ]); - const wrappedInbound = lpStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - await wrappedOutbound.write(Buffer.from('test')); - const response = await wrappedInbound.read(); - expect(uint8ArrayToString(response.slice())).equal('test'); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('should test that secureOutbound is spec compliant', async () => { - const noiseInit = new Noise({ staticNoiseKey: undefined }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, { wrapped, handshake }] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - (async () => { - const wrapped = lpStream(inboundConnection, { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - }); - const prologue = Buffer.alloc(0); - const staticKeys = pureJsCrypto.generateX25519KeyPair(); - const xx = new XX(pureJsCrypto); - const payload = await getPayload(remotePeer, staticKeys.publicKey); - const handshake = new XXHandshake(false, payload, prologue, pureJsCrypto, staticKeys, wrapped, localPeer, xx); - let receivedMessageBuffer = decode0((await wrapped.read()).slice()); - // The first handshake message contains the initiator's ephemeral public key - expect(receivedMessageBuffer.ne.length).equal(32); - xx.recvMessage(handshake.session, receivedMessageBuffer); - // Stage 1 - const { publicKey: libp2pPubKey } = getKeyPairFromPeerId(remotePeer); - const signedPayload = await signPayload(remotePeer, getHandshakePayload(staticKeys.publicKey)); - const handshakePayload = createHandshakePayload(libp2pPubKey, signedPayload); - const messageBuffer = xx.sendMessage(handshake.session, handshakePayload); - await wrapped.write(encode1(messageBuffer)); - // Stage 2 - finish handshake - receivedMessageBuffer = decode2((await wrapped.read()).slice()); - xx.recvMessage(handshake.session, receivedMessageBuffer); - return { wrapped, handshake }; - })() - ]); - const wrappedOutbound = byteStream(outbound.conn); - await wrappedOutbound.write(uint8ArrayFromString('test')); - // Check that noise message is prefixed with 16-bit big-endian unsigned integer - const data = (await wrapped.read()).slice(); - const { plaintext: decrypted, valid } = handshake.decrypt(data, handshake.session); - // Decrypted data should match - expect(uint8ArrayEquals(decrypted, uint8ArrayFromString('test'))).to.be.true(); - expect(valid).to.be.true(); - }); - it('should test large payloads', async function () { - this.timeout(10000); - try { - const noiseInit = new Noise({ staticNoiseKey: undefined }); - const noiseResp = new Noise({ staticNoiseKey: undefined }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection, localPeer) - ]); - const wrappedInbound = byteStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - const largePlaintext = randomBytes(60000); - await wrappedOutbound.write(Buffer.from(largePlaintext)); - const response = await wrappedInbound.read(60000); - expect(response.length).equals(largePlaintext.length); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('should working without remote peer provided in incoming connection', async () => { - try { - const staticKeysInitiator = pureJsCrypto.generateX25519KeyPair(); - const noiseInit = new Noise({ staticNoiseKey: staticKeysInitiator.privateKey }); - const staticKeysResponder = pureJsCrypto.generateX25519KeyPair(); - const noiseResp = new Noise({ staticNoiseKey: staticKeysResponder.privateKey }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection) - ]); - const wrappedInbound = lpStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - await wrappedOutbound.write(Buffer.from('test v2')); - const response = await wrappedInbound.read(); - expect(uint8ArrayToString(response.slice())).equal('test v2'); - if (inbound.remotePeer.publicKey == null || localPeer.publicKey == null || - outbound.remotePeer.publicKey == null || remotePeer.publicKey == null) { - throw new Error('Public key missing from PeerId'); - } - assert(uint8ArrayEquals(inbound.remotePeer.publicKey, localPeer.publicKey)); - assert(uint8ArrayEquals(outbound.remotePeer.publicKey, remotePeer.publicKey)); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('should accept and return Noise extension from remote peer', async () => { - try { - const certhashInit = Buffer.from('certhash data from init'); - const staticKeysInitiator = pureJsCrypto.generateX25519KeyPair(); - const noiseInit = new Noise({ staticNoiseKey: staticKeysInitiator.privateKey, extensions: { webtransportCerthashes: [certhashInit] } }); - const staticKeysResponder = pureJsCrypto.generateX25519KeyPair(); - const certhashResp = Buffer.from('certhash data from respon'); - const noiseResp = new Noise({ staticNoiseKey: staticKeysResponder.privateKey, extensions: { webtransportCerthashes: [certhashResp] } }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection) - ]); - assert(uint8ArrayEquals(inbound.remoteExtensions?.webtransportCerthashes[0] ?? new Uint8Array(), certhashInit)); - assert(uint8ArrayEquals(outbound.remoteExtensions?.webtransportCerthashes[0] ?? new Uint8Array(), certhashResp)); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('should accept a prologue', async () => { - try { - const noiseInit = new Noise({ staticNoiseKey: undefined, crypto: pureJsCrypto, prologueBytes: Buffer.from('Some prologue') }); - const noiseResp = new Noise({ staticNoiseKey: undefined, crypto: pureJsCrypto, prologueBytes: Buffer.from('Some prologue') }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection, localPeer) - ]); - const wrappedInbound = lpStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - await wrappedOutbound.write(Buffer.from('test')); - const response = await wrappedInbound.read(); - expect(uint8ArrayToString(response.slice())).equal('test'); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); -}); -//# sourceMappingURL=noise.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/noise.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/noise.spec.js.map deleted file mode 100644 index 0f925ef77..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/noise.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise.spec.js","sourceRoot":"","sources":["../../test/noise.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,UAAU,EAAE,WAAW,EAAE,MA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/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/utils.d.ts deleted file mode 100644 index c7109157e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/utils.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { KeyPair } from '../src/@types/libp2p.js'; -import type { PrivateKey } from '@libp2p/interface/keys'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export declare function generateEd25519Keys(): Promise; -export declare function getKeyPairFromPeerId(peerId: PeerId): KeyPair; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/utils.d.ts.map deleted file mode 100644 index 5d1b75ca9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../test/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,wBAAsB,mBAAmB,IAAK,OAAO,CAAC,UAAU,CAAC,CAEhE;AAED,wBAAgB,oBAAoB,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAS7D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/utils.js deleted file mode 100644 index decf6328f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/utils.js +++ /dev/null @@ -1,14 +0,0 @@ -import { keys } from '@libp2p/crypto'; -export async function generateEd25519Keys() { - return keys.generateKeyPair('Ed25519', 32); -} -export function getKeyPairFromPeerId(peerId) { - if (peerId.privateKey == null || peerId.publicKey == null) { - throw new Error('PrivateKey or PublicKey missing from PeerId'); - } - return { - privateKey: peerId.privateKey.subarray(0, 32), - publicKey: peerId.publicKey - }; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/utils.js.map deleted file mode 100644 index b318263c0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../test/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAKrC,MAAM,CAAC,KAAK,UAAU,mBAAmB;IACvC,OAAO,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;AAC5C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAE,MAAc;IAClD,IAAI,MAAM,CAAC,UAAU,IAAI,IAAI,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI,EAAE;QACzD,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;KAC/D;IAED,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;QAC7C,SAAS,EAAE,MAAM,CAAC,SAAS;KAC5B,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/xx-handshake.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/xx-handshake.spec.d.ts deleted file mode 100644 index 32a0f4c79..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/xx-handshake.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=xx-handshake.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/xx-handshake.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/xx-handshake.spec.d.ts.map deleted file mode 100644 index fa3bf2512..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/xx-handshake.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx-handshake.spec.d.ts","sourceRoot":"","sources":["../../test/xx-handshake.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/xx-handshake.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/xx-handshake.spec.js deleted file mode 100644 index a89a68b08..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/xx-handshake.spec.js +++ /dev/null @@ -1,119 +0,0 @@ -import { Buffer } from 'buffer'; -import { assert, expect } from 'aegir/chai'; -import { lpStream } from 'it-length-prefixed-stream'; -import { duplexPair } from 'it-pair/duplex'; -import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; -import { defaultCrypto } from '../src/crypto/index.js'; -import { XXHandshake } from '../src/handshake-xx.js'; -import { getPayload } from '../src/utils.js'; -import { createPeerIdsFromFixtures } from './fixtures/peer.js'; -describe('XX Handshake', () => { - let peerA, peerB, fakePeer; - before(async () => { - [peerA, peerB, fakePeer] = await createPeerIdsFromFixtures(3); - }); - it('should propose, exchange and finish handshake', async () => { - try { - const duplex = duplexPair(); - const connectionFrom = lpStream(duplex[0]); - const connectionTo = lpStream(duplex[1]); - const prologue = Buffer.alloc(0); - const staticKeysInitiator = defaultCrypto.generateX25519KeyPair(); - const staticKeysResponder = defaultCrypto.generateX25519KeyPair(); - const initPayload = await getPayload(peerA, staticKeysInitiator.publicKey); - const handshakeInitiator = new XXHandshake(true, initPayload, prologue, defaultCrypto, staticKeysInitiator, connectionFrom, peerB); - const respPayload = await getPayload(peerB, staticKeysResponder.publicKey); - const handshakeResponder = new XXHandshake(false, respPayload, prologue, defaultCrypto, staticKeysResponder, connectionTo, peerA); - await Promise.all([ - handshakeInitiator.propose(), - handshakeResponder.propose() - ]); - await Promise.all([ - handshakeResponder.exchange(), - handshakeInitiator.exchange() - ]); - await Promise.all([ - handshakeInitiator.finish(), - handshakeResponder.finish() - ]); - const sessionInitator = handshakeInitiator.session; - const sessionResponder = handshakeResponder.session; - // Test shared key - if (sessionInitator.cs1 && sessionResponder.cs1 && sessionInitator.cs2 && sessionResponder.cs2) { - assert(uint8ArrayEquals(sessionInitator.cs1.k, sessionResponder.cs1.k)); - assert(uint8ArrayEquals(sessionInitator.cs2.k, sessionResponder.cs2.k)); - } - else { - assert(false); - } - // Test encryption and decryption - const encrypted = handshakeInitiator.encrypt(Buffer.from('encryptthis'), handshakeInitiator.session); - const { plaintext: decrypted, valid } = handshakeResponder.decrypt(encrypted, handshakeResponder.session); - assert(uint8ArrayEquals(decrypted, Buffer.from('encryptthis'))); - assert(valid); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('Initiator should fail to exchange handshake if given wrong public key in payload', async () => { - try { - const duplex = duplexPair(); - const connectionFrom = lpStream(duplex[0]); - const connectionTo = lpStream(duplex[1]); - const prologue = Buffer.alloc(0); - const staticKeysInitiator = defaultCrypto.generateX25519KeyPair(); - const staticKeysResponder = defaultCrypto.generateX25519KeyPair(); - const initPayload = await getPayload(peerA, staticKeysInitiator.publicKey); - const handshakeInitiator = new XXHandshake(true, initPayload, prologue, defaultCrypto, staticKeysInitiator, connectionFrom, fakePeer); - const respPayload = await getPayload(peerB, staticKeysResponder.publicKey); - const handshakeResponder = new XXHandshake(false, respPayload, prologue, defaultCrypto, staticKeysResponder, connectionTo, peerA); - await Promise.all([ - handshakeInitiator.propose(), - handshakeResponder.propose() - ]); - await Promise.all([ - handshakeResponder.exchange(), - handshakeInitiator.exchange() - ]); - assert(false, 'Should throw exception'); - } - catch (e) { - const err = e; - expect(err.message).equals(`Error occurred while verifying signed payload: Payload identity key ${peerB.toString()} does not match expected remote peer ${fakePeer.toString()}`); - } - }); - it('Responder should fail to exchange handshake if given wrong public key in payload', async () => { - try { - const duplex = duplexPair(); - const connectionFrom = lpStream(duplex[0]); - const connectionTo = lpStream(duplex[1]); - const prologue = Buffer.alloc(0); - const staticKeysInitiator = defaultCrypto.generateX25519KeyPair(); - const staticKeysResponder = defaultCrypto.generateX25519KeyPair(); - const initPayload = await getPayload(peerA, staticKeysInitiator.publicKey); - const handshakeInitiator = new XXHandshake(true, initPayload, prologue, defaultCrypto, staticKeysInitiator, connectionFrom, peerB); - const respPayload = await getPayload(peerB, staticKeysResponder.publicKey); - const handshakeResponder = new XXHandshake(false, respPayload, prologue, defaultCrypto, staticKeysResponder, connectionTo, fakePeer); - await Promise.all([ - handshakeInitiator.propose(), - handshakeResponder.propose() - ]); - await Promise.all([ - handshakeResponder.exchange(), - handshakeInitiator.exchange() - ]); - await Promise.all([ - handshakeInitiator.finish(), - handshakeResponder.finish() - ]); - assert(false, 'Should throw exception'); - } - catch (e) { - const err = e; - expect(err.message).equals(`Error occurred while verifying signed payload: Payload identity key ${peerA.toString()} does not match expected remote peer ${fakePeer.toString()}`); - } - }); -}); -//# sourceMappingURL=xx-handshake.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/xx-handshake.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/xx-handshake.spec.js.map deleted file mode 100644 index 6b3161d8a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/test/xx-handshake.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx-handshake.spec.js","sourceRoot":"","sources":["../../test/xx-handshake.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAG9D,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAI,KAAa,EAAE,KAAa,EAAE,QAAgB,CAAA;IAElD,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,MAAM,yBAAyB,CAAC,CAAC,CAAC,CAAA;IAC/D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC7D,IAAI;YACF,MAAM,MAAM,GAAG,UAAU,EAAc,CAAA;YACvC,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;YAC1C,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;YAExC,M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,GAAG,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,uEAAuE,KAAK,CAAC,QAAQ,EAAE,wCAAwC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;SACjL;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/tsconfig.tsbuildinfo deleted file mode 100644 index def3f48e9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/constants.ts","../src/@types/basic.ts","../node_modules/protons-runtime/dist/src/codec.d.ts","../node_modules/uint8arraylist/dist/src/index.d.ts","../node_modules/protons-runtime/dist/src/decode.d.ts","../node_modules/protons-runtime/dist/src/encode.d.ts","../node_modules/protons-runtime/dist/src/codecs/enum.d.ts","../node_modules/protons-runtime/dist/src/codecs/message.d.ts","../node_modules/protons-runtime/dist/src/utils/reader.d.ts","../node_modules/protons-runtime/dist/src/utils/writer.d.ts","../node_modules/protons-runtime/dist/src/index.d.ts","../node_modules/uint8arrays/dist/src/alloc.d.ts","../src/proto/payload.ts","../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface/dist/src/peer-id/index.d.ts","../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-info/index.d.ts","../node_modules/@libp2p/interface/dist/src/content-routing/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/buffer/index.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@libp2p/interface/dist/src/events.d.ts","../node_modules/@libp2p/interface/dist/src/metrics/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-routing/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-store/index.d.ts","../node_modules/@libp2p/interface/dist/src/startable.d.ts","../node_modules/@libp2p/interface/dist/src/stream-handler/index.d.ts","../node_modules/@libp2p/interface/dist/src/topology/index.d.ts","../node_modules/it-stream-types/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/index.d.ts","../node_modules/@libp2p/interface/dist/src/transport/index.d.ts","../node_modules/@libp2p/interface/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-encrypter/index.d.ts","../src/@types/libp2p.ts","../src/nonce.ts","../src/@types/handshake.ts","../src/crypto.ts","../node_modules/it-length-prefixed/dist/src/encode.d.ts","../node_modules/it-reader/dist/src/index.d.ts","../node_modules/it-length-prefixed/dist/src/decode.d.ts","../node_modules/it-length-prefixed/dist/src/index.d.ts","../src/encoder.ts","../node_modules/@libp2p/interface/dist/src/errors.d.ts","../node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../node_modules/multiformats/dist/types/src/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../node_modules/multiformats/dist/types/src/varint.d.ts","../node_modules/multiformats/dist/types/src/bytes.d.ts","../node_modules/multiformats/dist/types/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ed25519-class.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/interface.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ecdh.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ephemeral-keys.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/key-stretcher.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/keys.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/rsa-class.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/secp256k1-class.d.ts","../node_modules/@libp2p/interface/dist/src/keys/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/index.d.ts","../node_modules/@libp2p/peer-id/dist/src/index.d.ts","../node_modules/uint8arrays/dist/src/concat.d.ts","../node_modules/multiformats/dist/types/src/codecs/raw.d.ts","../node_modules/multiformats/dist/types/src/codecs/json.d.ts","../node_modules/multiformats/dist/types/src/bases/base.d.ts","../node_modules/multiformats/dist/types/src/basics.d.ts","../node_modules/uint8arrays/dist/src/util/bases.d.ts","../node_modules/uint8arrays/dist/src/from-string.d.ts","../src/utils.ts","../node_modules/uint8arrays/dist/src/compare.d.ts","../node_modules/uint8arrays/dist/src/equals.d.ts","../node_modules/uint8arrays/dist/src/to-string.d.ts","../node_modules/uint8arrays/dist/src/xor.d.ts","../node_modules/uint8arrays/dist/src/index.d.ts","../node_modules/@libp2p/logger/dist/src/index.d.ts","../src/logger.ts","../src/handshakes/abstract-handshake.ts","../src/handshakes/xx.ts","../src/@types/handshake-interface.ts","../node_modules/it-byte-stream/dist/src/index.d.ts","../node_modules/it-length-prefixed-stream/dist/src/index.d.ts","../src/handshake-xx.ts","../node_modules/it-pair/dist/src/duplex.d.ts","../node_modules/it-pipe/dist/src/index.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/types.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/wasm.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/chacha20poly1305.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/poly1305.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/chacha20.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/index.d.ts","../node_modules/@chainsafe/as-sha256/lib/hashobject.d.ts","../node_modules/@chainsafe/as-sha256/lib/wasm.d.ts","../node_modules/@chainsafe/as-sha256/lib/sha256.d.ts","../node_modules/@chainsafe/as-sha256/lib/index.d.ts","../node_modules/wherearewe/dist/src/index.d.ts","../node_modules/@noble/ciphers/utils.d.ts","../node_modules/@noble/ciphers/chacha.d.ts","../node_modules/@noble/curves/abstract/utils.d.ts","../node_modules/@noble/curves/abstract/modular.d.ts","../node_modules/@noble/curves/abstract/curve.d.ts","../node_modules/@noble/curves/abstract/edwards.d.ts","../node_modules/@noble/curves/abstract/hash-to-curve.d.ts","../node_modules/@noble/curves/abstract/montgomery.d.ts","../node_modules/@noble/curves/ed25519.d.ts","../node_modules/@noble/hashes/utils.d.ts","../node_modules/@noble/hashes/hkdf.d.ts","../node_modules/@noble/hashes/_sha2.d.ts","../node_modules/@noble/hashes/sha256.d.ts","../src/crypto/js.ts","../src/crypto/index.ts","../src/metrics.ts","../src/crypto/streaming.ts","../src/noise.ts","../src/index.ts","../src/crypto/index.browser.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/index.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/connection-encryption/index.d.ts","../test/compliance.spec.ts","../node_modules/@types/chai/index.d.ts","../node_modules/@types/chai-as-promised/index.d.ts","../node_modules/chai-parentheses/index.d.ts","../node_modules/@types/chai-subset/index.d.ts","../node_modules/chai-bites/index.d.ts","../node_modules/@types/chai-string/index.d.ts","../node_modules/aegir/dist/utils/chai.d.ts","../node_modules/@types/sinonjs__fake-timers/index.d.ts","../node_modules/@types/sinon/index.d.ts","../node_modules/@libp2p/peer-id-factory/dist/src/index.d.ts","../test/fixtures/peer.ts","../test/index.spec.ts","../node_modules/it-pushable/dist/src/index.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/config.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/frame.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/stream.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/muxer.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/index.d.ts","../node_modules/@libp2p/daemon-protocol/dist/src/index.d.ts","../node_modules/@libp2p/daemon-protocol/dist/src/stream-handler.d.ts","../node_modules/@libp2p/daemon-client/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/pubsub/index.d.ts","../node_modules/protobufjs/index.d.ts","../node_modules/protobufjs/minimal.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/decoderpc.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message-cache.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/metrics.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/set.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-stats.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/compute-score.d.ts","../node_modules/denque/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/message-deliveries.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/tracer.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/config.d.ts","../node_modules/@libp2p/peer-collections/dist/src/map.d.ts","../node_modules/@libp2p/peer-collections/dist/src/set.d.ts","../node_modules/@libp2p/peer-collections/dist/src/list.d.ts","../node_modules/@libp2p/peer-collections/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/connection-manager/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/registrar/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/key.d.ts","../node_modules/interface-store/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/providers.d.ts","../node_modules/@libp2p/interface-internal/dist/src/address-manager/index.d.ts","../node_modules/progress-events/dist/src/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/record/record.d.ts","../node_modules/@libp2p/kad-dht/dist/src/record/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/index.d.ts","../node_modules/@libp2p/daemon-server/dist/src/index.d.ts","../node_modules/@libp2p/interop/dist/src/connect.d.ts","../node_modules/@libp2p/interop/dist/src/dht/index.d.ts","../node_modules/@libp2p/interop/dist/src/pubsub/index.d.ts","../node_modules/@libp2p/interop/dist/src/relay/index.d.ts","../node_modules/@libp2p/interop/dist/src/streams/index.d.ts","../node_modules/@libp2p/interop/dist/src/index.d.ts","../node_modules/@libp2p/tcp/dist/src/listener.d.ts","../node_modules/@libp2p/tcp/dist/src/index.d.ts","../node_modules/execa/index.d.ts","../node_modules/go-libp2p/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/transport-manager/index.d.ts","../node_modules/libp2p/dist/src/address-manager/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-gater/index.d.ts","../node_modules/libp2p/dist/src/components.d.ts","../node_modules/libp2p/dist/src/connection-manager/auto-dial.d.ts","../node_modules/libp2p/dist/src/connection-manager/connection-pruner.d.ts","../node_modules/eventemitter3/index.d.ts","../node_modules/p-queue/dist/queue.d.ts","../node_modules/p-queue/dist/options.d.ts","../node_modules/p-queue/dist/priority-queue.d.ts","../node_modules/p-queue/dist/index.d.ts","../node_modules/libp2p/dist/src/connection-manager/dial-queue.d.ts","../node_modules/libp2p/dist/src/connection-manager/index.d.ts","../node_modules/libp2p/dist/src/transport-manager.d.ts","../node_modules/@libp2p/interface/dist/src/peer-discovery/index.d.ts","../node_modules/@libp2p/keychain/dist/src/index.d.ts","../node_modules/@libp2p/peer-store/dist/src/index.d.ts","../node_modules/libp2p/dist/src/index.d.ts","../node_modules/p-defer/index.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface-peer-id/dist/src/index.d.ts","../test/interop.ts","../node_modules/iso-random-stream/dist/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/aes/index.d.ts","../node_modules/@libp2p/crypto/dist/src/hmac/index.d.ts","../node_modules/@libp2p/crypto/dist/src/pbkdf2.d.ts","../node_modules/@libp2p/crypto/dist/src/random-bytes.d.ts","../node_modules/@libp2p/crypto/dist/src/index.d.ts","../test/utils.ts","../test/noise.spec.ts","../test/xx-handshake.spec.ts","../test/handshakes/xx.spec.ts","../node_modules/keyv/src/index.d.ts","../node_modules/@types/http-cache-semantics/index.d.ts","../node_modules/@types/responselike/index.d.ts","../node_modules/@types/cacheable-request/index.d.ts","../node_modules/@types/ms/index.d.ts","../node_modules/@types/debug/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/keyv/index.d.ts","../node_modules/@types/linkify-it/index.d.ts","../node_modules/@types/mdurl/encode.d.ts","../node_modules/@types/mdurl/decode.d.ts","../node_modules/@types/mdurl/parse.d.ts","../node_modules/@types/mdurl/format.d.ts","../node_modules/@types/mdurl/index.d.ts","../node_modules/@types/markdown-it/lib/common/utils.d.ts","../node_modules/@types/markdown-it/lib/token.d.ts","../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../node_modules/@types/markdown-it/lib/ruler.d.ts","../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../node_modules/@types/markdown-it/lib/parser_block.d.ts","../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../node_modules/@types/markdown-it/lib/parser_core.d.ts","../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../node_modules/@types/markdown-it/lib/renderer.d.ts","../node_modules/@types/markdown-it/lib/index.d.ts","../node_modules/@types/markdown-it/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/mdast/index.d.ts","../node_modules/@types/minimatch/index.d.ts","../node_modules/@types/minimist/index.d.ts","../node_modules/@types/mocha/index.d.ts","../node_modules/@types/normalize-package-data/index.d.ts","../node_modules/@types/parse-json/index.d.ts","../node_modules/@types/retry/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts","../node_modules/@types/strip-bom/index.d.ts","../node_modules/@types/strip-json-comments/index.d.ts","../node_modules/@types/ungap__structured-clone/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts","../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"1bc2fdadc59c4529e51cd693e1bb45c0f9d6c4cf079b008fa3a17da4cd08af44","signature":"a5b2968580425f209992ad1d8a62ab079d84643e00e0f0b11f65fe6423a643f5"},{"version":"a00b40912153391370bfc844161907779723e82cd2d671b3bebea763212f048e","signature":"35095a100857bdbca3c31ddd6e1eb18259140dee0092d97e631889daf084eaec"},"fd617cc8eec6f43227ab572160bac9d23c723073e83a9b100bd15c758eff34c2","176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d","ec3786b43d68955ecdb12ce679d3bc61b6b25c4d0ac5bcdaf50fa4a746189b98","3155e98b0df0c1523715e8a1c75c8a67c401aeb58d6eccf8bd89d5d775b8c1cf","fa82b7b22d9df87323e31e9e2ad75911028f3e544647fd212424b3c4452fee3f","90aa0b916eef195a17c3dbd621746f82ac7969ecc3dbf27c81ee4c68c5af7f25","9ceec2a882368c0160a8a3879aa0efce0fb985751fc23ff6191006030969cfa4","cad5d6451789234434c28dd2d6a8267b0d64c479b1ad267321faa31ba90d570b","e0e8254f7a1a21b5768beb4dbc9d4574ce67aefa59d88251d16b17c658f2a69e","c33b700f5d0797c331e08b29f8440204e19cf035555ea9111321f881f1b4702a",{"version":"b2d663f1f5da5b395c5dc6ba6dbc633d61580235f82faaca06bf420fcdae46cf","signature":"6744c64cda78d6af7280d69c20ead828fa4296efe0b582548cb10ab66914993d"},"f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","4369b27ca2716a04200930b5f24fa87a6ed62d8c70f80a83270956b6b23c32ae","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"8d6138a264ddc6f94f16e99d4e117a2d6eb31b217891cf091b6437a2f114d561","affectsGlobalScope":true},"a882b74c4ba115c6e86371f3592a3accb2c50874b6fcd92a4f83d17a4d6993af","4a8722c7d7a4dac1616db1f41ad0113998ccbbbcd37af43def3fbe6b41208c83","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"0b3868d3f87c95ea73bdfab380e536843ec3573aa76233b97aac40518494ea24","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","30c2ec6abf6aaa60eb4f32fb1235531506b7961c6d1bdc7430711aec8fd85295","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"d48009cbe8a30a504031cc82e1286f78fed33b7a42abf7602c23b5547b382563","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"24ba151e213906027e2b1f5223d33575a3612b0234a0e2b56119520bbe0e594b","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","28c1fc8505da2181ee74c9fe902fac964159cfae266c4413905d50eaecea8a19","84b8cc86ad19115f2637401cdd220460a25542df478c966a5ffc5eeaf3825299",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc","010d5afec4b47ea596f6c59a25ce628fa4e31ea15fd51e73d44ca2d72a780be8","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","f5337c3ea7b8702ffe2718f56a24325a67d517c0d552ef71b8d578d9f33a99d3",{"version":"1cd9488f96f8d5657d4109a6ae188f65846e905c5b236fdf379c16362e7a60a7","signature":"612bf9cb0b0a7ce6eab9fa9c09da1b1e4e5ec8f6b94f282035bfc89f68d4f3c6"},{"version":"2dec630463aaa98bfbc039a798f1757b9d53fd8ebd1722817b05b4534133d8cb","signature":"1cc2659564153cef042b6a377a36a04d861398d678e7032ec42698d8c80ec77f"},{"version":"ad1764b2c66d631e98be0b8255b410a319857ece25c6e8ae9627a535a0241c6b","signature":"1f66808998faa0d77e425d4c5ae8f481c3234d4b8c1deff001e1af71b4b041f3"},{"version":"c99a598040f64ddf29965a42c440a61492300923e58015c9dbad51a95f245b53","signature":"2f37bd92ed3c6cbac299dbfd79abe367c5e5d72e098abdb8d3e3900badd53e88"},"f30cfcfff28ee8f87563225b47239bb07b9b11edd09dda0ea6499b18cca1a30e","0edb8a97ead1fefd337458449050857e80740e31a3f76cffa656262f4e651a50","db8e4b47dd8c22634e3a326e5a5f60aa71a8ad4a0458fc0aadb6951f1c7cdc54","5b7a6d3f5c1b1d94d6cbc6c1e113588e20ae61d583d0d0cb5ec3fd92926d3749",{"version":"57b66a49fde8cfb80495147e1e115f4d09e7d089a97bca210d7b737a9a3dfd40","signature":"7c86832b33e8881089597745da92dc33a29681874849008a13069039bd613ea6"},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","b9998d79c6cb4e43e9d812fec5ccafbedee623c589904e3e3f0439ef861e25dd","7a6f74294b8fb90f5e3832be21e25898dd81b2a1adc36dda6929813ba4135311","d25e693302c8e284b417884b40dbadffe693b0daff8999a000995114dbf74c49","a1d4ac1b15cd62c7346d976e3a01e6cbcd4f166ea6b7866907d25c5acc832d77","5d40e6a7071d0d1e6e558e17214ff786ecb3ea73e31b25a88c2cbe2435fa1252","c45242078469b9680653d6a0667b23b1b767ec908825a14bfa8bb1dde2e30dae","5dcd218cfe8eb7fd6a1e5668c1a98734ddefe888d17129f8844552dddda2a74d","0564c90e8c2577950a446d6197a3ab7ec433ad5ac98435378e8855427f4cbf24","e1712267198fc3dd7903d0b945d5049fd56d68cadaf986c0adc40235fee43488","df21f5c49d638cbd6bd322eeb5b16d8352ba14ccb88cc9b23a7d8d5c2eaaf659","f6d13788d90394a540d136fb8ba9a0a647d8baa2e51d2ae155d039b031f4717f","6af9cf238459fe6d7e2d61cd50a157a6f540905c9793718e0e6e5993ab0cd650","88de5467cd5e4c2c1384629806d56ac1215657bddf39ef9f60a0e05beee2b131","ff5820394809bfc32a7e4586ff11b3c07327a0f4c756709aef92f1cd73d6da48","bfe2af20f3ff0579331661ef4c5d2597e0c31a7a0d760e41eaff0502bf064c4d","f52a0e53f79d7fd1c1c55a3cbda59499d4cce75f3188969024cdc286b29ad3ea","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f",{"version":"9b48eef82666050e509dece807d29b825fde4909ac48c7f1cab67390973a03ec","signature":"220216e61adba5829f622fe331a5a99d4aeedcda11c983149ceff8a063d2585f"},"0eff9792dd66a9aef708b34dd51d2e46158ae518db6ab14f54c5a99e8551abe7","66336b5a5d5e897e932cbf1e306ff8ac8a9929971409a8049c8c8a249cd8b57c","a878d4c7237a7af50e96534295fcf723134d70cbb1e9bfd8365266b912aee6ec","1185e162cb22a9bc3e94b2ae2ba35ed943ee69beae5364b38680f7d8587e7d35","23b0b3d88c166dad8d63750b716b921c51053ad54b14a4e7e32fd526033566db","fbacab2238e299ccf6596c3bd404c7dcad2c5a88ecd254a8a38cf2d184a67c75",{"version":"177dfa229223890f5e22db17d46280f2d4a16ca4c9ab73e4bbff4a1fd12300b4","signature":"e8f2522c8a4cf550c9fcc6154869253bd9ece549be7b5aeaaa7b20f73fb5cd83"},{"version":"e82bddfda890f3c83d1ece8c1df0ce57769a2a82b0ff81aff1409b329a460fc2","signature":"3f39c6ba0e49842fc434134519c30a89d3ec16da9701cf4d1113abf2f2ccfa17"},{"version":"a9ed6ff8aa6f2ea797e06d0f8bb03a4f43ab73a8adf133166140ca1ea208b520","signature":"b73dc3c92a3cdfe4144eafad3b73c13787c5cffe4ec5b35cd0467e9a3ede9ec1"},{"version":"b55e067a9546ac1c237571f938f04ae6593e138a2c1a645ed9171dbc36ee764e","signature":"f30884bec83e02740b8a410ecba62ba558f571a554e1b377ac4b83dff125b57e"},"4de66b5983d6286bfe3606cf155a5b21043111389d0b4c7b23d3f4282099f7d4","3968eed4d327e075c2386fad0b39b5ad2fe1892f6409a3bb46660c46f58300a6",{"version":"36be103794251feb6152dd2c8ec5d0e5f841a189c920881bccfe27f7459f54ed","signature":"0cae8a9a58a4d4836626ea63c8e3e699e7bcdab24c31ef39009abaf97c704b1c"},"b1129d7c114eba7c7b155dc809d6371ef86a0738f7ca93b3efef9b796d6168d9","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6","ffff3307a2c3797cdc04d7493e94245c13a646194c87f5bf5d2432995b834cc3","a87bc62d9a6be405f53f883a422efd557775224cd2b6688440cd333aaac27169","3d08777d7a3f5c1899a21dc2bd9f0ca80cfe0badba576cae22f5b47b7f81b3eb","bbbfe3163d9421b837e4e203c24243344be38e4359b6fc15426943454d8949b6","8cf4dc652e929c4de69ce5079b98a0683757b2dde66a7cee93edcb5aa08d5c48","f74d877f1fc949fb61197bf32a41829a83ee6aea528787dc2788378baaaa0ecf","a62a02c433e6fee26404825310ad462433320ef2e9f80fa7b9156135fd975f8f","22f15ae5c80b3e795da92636aa03d8f981811d067d82bff01ca54093c0535ec0","b56d4bc83ec01834829979ad57de59b4947cd62f71b102ab0040b6960d5bdc81","a10213415bf98670b026b77a90c7933594f0b5c34bde5b74e80134fdf0331bba","00cd454fa42dca69cdea08d4cb9698e679ba9a31762c23d905e45ba92269ac3a","58765e8e715155b2940e868ab1534b1bfac7087f6b42f7810ef94cc077d62981","f1c4e4db3e1dd83c3749f174e662de845e1217017ead0c15074e3ba00db67b6e","5aaea3d4b3af0c8339006c30af04eafdeb21b0a1bba2f1d32540ade412ee80a7","eb72bbe04857681ebd08a48d3b0869969c335445c31de53a85f76b4a42b97c92","c8cc38cbba80bfd5719c1b9d7efcd76fc90d4497e8a9aa715db426993274f0ae","49b6ff487f2d72569e361f077397214fea20839712527f5fb9ed8bb877dd7db8","d3043c37eeeb10d8a5c0c2a3b9d72e23a5fed2e9a367c5b4154bc8d9283601f3","58ff317d61b47e8fc6688bd50e6770311691202553f119d1e1d79b64d864e200","cde49e6e1ab8a2b4202958e3267e898489b737198a0599c7d251f94d9dea658b","3c3ca314a2b01902ef19b499be6e052925a849f14e2d9185afb323df3d3a72b6","b4b4af7820e7888cf67beeb95d0d6144b3d854370a7b78a598e80dc268e74249","1e7146a407bf85762b80681cd4aa3b544000e30c9b24d04685dfa69f82a48fd9","a3c42863fed9b49c35144d60aa0b2865b5fede65ea0050a28f45381af6dae035",{"version":"d898e165d52d3df19f98e46a53df138c8e28b1ec7224e75140d419f7bc60c7f0","signature":"8db42cde9161c917ae86f075cb21c16d1fab5965db0c4f4b372b4e7a0276f82e"},{"version":"f2f278cd3ffe7eb472b5daaec63622a32623cdf0d71395dfe60895363af42dc7","signature":"a03bc49af672574771ede656f9c35be60c2ba44f45655aed449e7f9e5efae6aa"},{"version":"19e0cd3c787b3570a7e8c20aa0718062bfb65e97391bd700bf37612569f3fc68","signature":"39c164f8cfdeb33577063044cf89c43c19bb4f79fae41960e0a17c6de26272c5"},{"version":"d416db55d180900dcf6c3eb98c776c85f3b4f9c4a0907cb8ffdb505500136f18","signature":"7115ea7b230353fe5e5d9436fe7f5b8863dea85c1b7c030c58a75bdb9e844b91"},{"version":"699246380aaa11f56f67ba8a5583f035e79f3de9d5837fe1979c579bafc32156","signature":"4110b29391d0835f9b88a4c69cb7e1cdddbac43ca9ee86393ebc15567c271b4d"},{"version":"aaa8702650fe4efdb8e82d41231add24a0b809b17f55d52009dc469c8ee0b011","signature":"f2dc190b33c1e842552ab4117c29cc960edd8ce2327a22254ec47cbcbdbb91f7"},{"version":"96db0fd5e766faa06d7b4f3ccc7e3b7df29a4c1aa4f116eaec55e5936e321325","signature":"0017550b13ae859f43d4b435fdab5e5035b0d6f7b7959458f30f67e859882d4d"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","e9fd0c57db08c441b0f044449b651e5d9910fa6c7871dbcb4d266b9cd357e2ed",{"version":"bf471b46fd0e07028f318e408bc578f4a3e125333bb545445175e6ba50791ffe","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2","81c6dd936bf342efbb1b1a5440a4300db5d39d70a6ad49ebc91ca7033ae9ce79",{"version":"13acb84a8fa8264d596433ae541c83b13d226a9592e6a26b165002c38132b97a","signature":"e307a4efa11c7f907b4e98ebb9496837e1901f13a19d8b0ed8c51205b09d528f"},{"version":"303ae53a3993e592fa9602ec5c83bac6d5c074f6e73fca8b2007f6db3ecf25f8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","c8031a5db82b240f801a5684ab693e95e1e06dc76958894fe42d35acbd446f28","1633b84fd3346ad6500a88e7a119ac778bb6f6b2746a3b7b8164c5ef2721822f","37fa00014a0f86b91526c4fde9b31af33d3e3bd5892c0519aa0d96d7935de484","5c9d5e0cd18c905ee6f6bc6f85b02c4d5b6f64ad08e1181f63785fae04823db3","5abd603c11eeb815a1746ff003233ae03c8f4f34fcf7835742c30fff038d4100","df54eaa5ea53c6bb3a9548bc5d2f6fb22583ea3e8b936a4e8ec5acfd90422ff3","be8d072f400254824429edab10acbe595299b702c97b99cc47f8e8018b7102ff","1a319786bea64c944ba8dd33331090034468efbab9c2fb96552850033d62d8d8","33174450482b921bbf093e3d52f501f7f93b5fd612311aa86e7339f2800162aa","03e385ae2125c9aa9dead008b42a0ab20d0812c26c19ee210d84c2666113f867","688c9dfd2b7114f5f01022abb5b179659f990d5af5924f185c2644ca99fe7b77","932cade1c5802123b5831f332ad8a6297f0f7d14d0ee04f5a774408f393e2200","925a8770415572378b7b62dcd714e744b7ffed86de59bdbe1d25c68d9d1f7f51","38fc2c990835686053591402bd73803ef28e117fa49427763e62636fd16c76ad","85489033e86eba49bfef2ad7330f8bb57cf7ef6aeb341c00ae1a3e5b19a02f4f","d4936633d5453e441ad5ab182efad46a0e1285fe5f9f5c2948cad3e71b7c2c23","a1b60bd2328318dcbec30bdf529dad31a13315ff2df60c8bd71630c58a575b06","e7ad5aa8eb177708949df3abbfe5ccbe7b75c920fb3bdd89426c38c61f239da6","8cc6a35806cd10d448b0f2ab01fe0b6194ca57fdaced2d71781b68e83c55bd88","8f364fec0ef20506aa9cf00b5cd8b620c1c0389687b11a3a32b0b5d4716ad894","5d11703e2c5d4dbe00bbe79f3bc864d178cf8d6ebccc2d1448ea29e93654f029","f4e82c91aac3b61f3ad04f11a44c5b79f724ff8a09281d0afa24a6624633ff25","ed849d616865076f44a41c87f27698f7cdf230290c44bafc71d7c2bc6919b202","7b8b9017156ef8bf3bbe42785fac8956e5c9869f4a494536d7f548a7c1c7d98a","eb2f08ae9c540a5fb60a5edddc0860ca3dad54ec842301ca73441d9e54534af0","763bb8df872cbb8783e29e19bd7a1dea0f88f7fd7398343af38be8509a65df82","687ce021a76c91c0e0b08fa5b828de2916e1b1aa9a23394e8ebc4dd96b8ee776","c286b410193495d067668bcdbd13ea3f3a39001edff02edee248babf2652e563","ba1405da509cc84896a588978efc45400d4f9844ee738d750b59868b1ad1618a","83a1426ac1a9cf144141dfe10d71a68629623a7c28245c9ca0e0352bead501fd","2726c0a6a4a87fad11e6846e6b0b40b8924fbe66340adc512093c4273bc53e4e","c888daaa99fdf6c5712d98605fdcf21cbbaab756a629661a44cac44ede464d37","e044f60686dc70015a3b7e7c64ad0ac5ec5ec101a0aede0782ec077e136b6a65","a232f867897bbecfebf68df575a417af1afd9b5dd3d83fb4d59e0a133a0de93d","228dbc8825b7a45af7d416dee95c0a2162d7cf73ffddfd52357b7e548882bdaa","602baeb62ccf84672ba7afacb5a21b675171282397513cac8f06d3a8634f840c","8970ab047d89c71edf9973609dd62f61bb366abeabbff36a1200103b6c1c605b","36d756189d9295e3a964e5cd45cb8ac965d5d2ada53ed848e08608426c146d69","8bdb5c16e8b9ba625ec08d8189879a6fb47b2c3c458a5d43ebd53a8763b5712e","93597e08900c3ac5ec730c16c4fbe425f7342e1f0420967b2afd90d67a2abee1","af89ab13b40dd28cd91818fc6329914d2b9663591831f032ff0f0cb4a028d4a5","6e6733927ade923e34b243d6fbec1465cfc8ed6edf62c6e09ed00c529f0d93de","83b3a9e85f7967509436fcdfa9be9bd543fb54003a9233c5c0af087e4a2c11c8","dc92d6eccf12395aa1d47afb765d5e4a1cd2639a385db0e3e88e9937ad2b63a3","ffb6e0556a4b5323c8bdf12727d000e8a3633f0552fffc4b779ae88546be2770","1242141c87ba3396bead6f379f6d6778bd38d02017f243aa448d1454a5fdc90e","17a4105ddae0308e19ee8532bdeb76278efa9dc644366060ca644541d3fd831c","913ffa031f7455c53e99c75ae130a046612d2ee0e716ed92707e996cbd3952ea","44e897d02326bf4d8169ea9638fe0a4c53b8f85cc48ae2fcbbb67b2f72c1d805","288fb1b9df77067c3c2675bde87d23d4a3f01bb6f929f854f11bdb68662968ff","b43b5156bc2831b46f6226777e292ff1646b3651ce190708b6228a078d42da4a","c3e77c4aa1097a38dcf4a20a093ce65033a16f3a48dab0ae3c5f6661bc39b11c","93acb99d30b8a22b443bfefb333d15d6310af7bd76a832f9559f7af9535ed2ae","3053e413471eef0274bc90318db14072e6164fbcc77765ab9557a769370382b2","32cbe201bfe8ed7f4c323fb8a3fcfdfb451f22e84d3c49da33ceda2fbf9230be","50d536e2e8bdbb4234b6ade05992aa4227fbf0401aba24922734c3ddb4a3ff11","4e152867a5b1bea2dc6a2921c0196f877630fc144369f8c7b9a69905caa62741","445c1751941d390dedf7667ab0fef01d468089576c07eba15810bf69485e4589","7f2cc72a16a663ab9f8d99bd5658e583251ce0c003bf80a948973e15a7ef9596","6af42c3c33c7123e7b056a6fd272d470914f382fad5e99689fa4991ff610e757","60f7cf25a65631bcfc27276a9b7b584ad13c2a37f871376d5d02e2133bc5fef9","e1c0439c8c796ddfdd08206dfd2cf7a7defec9d83f7b1e873d908489bda18af4","27679e96d1bd38c5938178aaf4abe8627493090b63d6bae2ce8436e6a87ebe4d","a77fbecee25688f568e18b43f8f54195d6c278a2a9a687ada5ab3d2f726524eb","e29f2b3a93ca3392fe29fa8e7b93985e854b44fe28e2b5c113f08296095bd6b7","d27956c8b392088a06d882e1edb58aab4d5cf5ab1229b73f99329ab21f352147","d643518d0b08b3d8d6e7f1fa884bca57ef95caaa1c312abbd9e1d4ed0d51c370","8c15566043b036c0720caf51ca343754e84e34fbaaf4a58d8080cf4ab2d93734","d8c8d41b25ef1827daaff9d84db43593995ce075551e7f4d8f10e316261e86f0","22fcf82dcbb4743dc846e838434ad1c2843cd18476e534dd3b37f85ece99ac73","40924f439552f559ffa4e41d300a411646ac9f3b53e578a012f7c439d36c6a30","7a34c06f5ed61c8108b2b82b7834655f1933d6ead3c9f6ff9d12efee4cb4bcaf","ee24d63f039e5745a279243916c7bb2c3d405bc0158912c0f37471381b467087","459c0ca522af7a412ef771447fe2c558c9a4640cffa4f53bacac05d0378a3ae7","acd5d501223e3a7cdd229b501fce5fb071937b72bd05fa33e543eb21c8ee0aba","f196d5ed4194259ffb797a34001a5edb7a165cd110dc3e4d8f03f11e3531fe9b","683889752b7c95fffd073b82ea76d36b3fe548ef3bb9887eb903676eabd676ff","a439ff9443c77478bb024ea2d96fbc088bccc915adf6bb8aeb9ab21fd737a071","b40afc6ff175241970202125bc1b5996cf5783b2f755977691f8c6522ace9f14","8bfc11f55ca063b10f0335922693ca70885d8f59b20607dd501250d1b1e960db","a884051a029dc34c400dc1dbad39a878935d37ebbea62d357d17b25f0076b578",{"version":"1b1ca1d97df4268847d5c387b1a89c01ec2fdc2062def1216442c8f040dcb660","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"6e0011406961ab3d469f2a7c3fddc41a5c9fb6d9452c47b5389124da846ab07a","df1bbd333631040027035b56cb31093015e59ce977a590500ed09feab109939b","a4f27ea63e3ff26a94b6681967a5276a2df9ddb80ae990df1ad03c0fffb34eca","18418f70457cee30da01c21bc26869ceb1ae65564784136f7fe2f7f2ff8f740f","3d2ec84143e6462a786b5d9ecf06f4f6f67a59a1f16c5a3a5e41721ba8478b7f","892f412f701d356f85cd3cb7d48b87ffecc0d4f85a2005c1d53e5e08414df8b1",{"version":"14261c0d2da587df791a696c8272003a3c5c1d7dd3a91f459092a8ab99759ca3","signature":"23d9dffba690dd7b1cc3986e0d592011a8660f0cb7632037b83b157b659c1510"},{"version":"1bcee41416ce15644b7e0eb66c2bb9df82007068fc83675d48927495cde7bd57","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"28ff2e0cd9350ef52ad5d6a77ddf2650d0505bd3d8cb1db66e1e5abf798d0c92","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"86b69f4f564965d8fd203354ebfcc235e37958a8195b600161deb5b9982a4dde","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a","4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","852bcf5d92d819abdf34ba0759c311b61d5dac7b9963a6c3cc4f23b025dee8f3","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[61,62,73,[185,188],193,220,[227,230],233,[260,266],269,280,281,364,[371,374]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[164,236],[164,236,237],[164,237,238,239,240],[164,237],[164],[164,242,244],[164,243],[79,164,172,175,226,292,295,296,297,298,300,308,309,310,311,316,317],[164,295,297],[164,294,295],[164,293],[164,292,295,297,299],[164,301,303],[164,299,301,307],[164,305],[164,297,300,301,302,303,304,306],[164,297],[64,164,183],[164,297,300],[79,82,164,210,292,295],[164,226],[164,180,284,287],[64,164,179,180,182,282,283,284,286],[64,164,182,283,284,285],[164,211,366,367,368,369],[164,203],[164,201],[164,204],[164,202,205,206,207,208,209,210],[64,71,164],[64,78,79,82,83,164,179,289,290],[64,164,179],[82,164,182,183,289,318,327],[164,184,267],[82,164],[79,82,164,182,183,315],[164,178,183],[82,164,181,183],[164,358,362],[164,361,362],[164,361],[164,358,359,360],[64,79,164,179,183],[79,82,164,183],[64,79,82,164,179,182],[78,83,164,182],[134,164,171],[79,82,83,84,164,172,173,174,175,176,177,178,181,183],[164,183],[83,164,172],[76,78,164],[79,82,164],[79,83,164,182],[64,79,164,172,183,282],[64,164,179,182,183],[79,164,183],[82,164,172,180,182,183],[164,334],[164,291,329,330,331,332,333],[78,79,83,164,172,173,175,182,316,317,321,322,323,324,326],[79,164,176,201,321],[64,164,325],[79,164,210,321],[79,164],[164,312,313,314],[79,164,210],[74,76,78,79,164],[79,82,164,172,175,182,321],[82,164,173,181,335],[82,164,172,173,181,183,336],[80,81,164],[164,247],[164,250],[164,249,250,251],[164,249,251,252,253,254],[164,256],[164,256,258],[134,137,163,164,171,375,376,377],[164,270],[164,379],[164,405],[164,390],[164,394,395,396],[164,393],[164,395],[164,385,391,392,397,400,402,403,404],[164,392,398,399,405],[164,398,401],[164,392,393,398,405],[164,392,405],[164,407],[164,386,387,388,389],[85,164],[121,164],[122,127,155,164],[123,134,135,142,152,163,164],[123,124,134,142,164],[125,164],[126,127,135,143,164],[127,152,160,164],[128,130,134,142,164],[129,164],[130,131,164],[134,164],[132,134,164],[121,134,164],[134,135,136,152,163,164],[134,135,136,149,152,155,164],[119,164,168],[130,134,137,142,152,163,164],[134,135,137,138,142,152,160,163,164],[137,139,152,160,163,164],[85,86,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170],[134,140,164],[141,163,164,168],[130,134,142,152,164],[143,164],[144,164],[121,145,164],[146,162,164,168],[147,164],[148,164],[134,149,150,164],[149,151,164,166],[122,134,152,153,154,155,164],[122,152,154,164],[152,153,164],[155,164],[156,164],[121,152,164],[134,158,159,164],[158,159,164],[127,142,152,160,164],[161,164],[142,162,164],[122,137,148,163,164],[127,164],[152,164,165],[141,164,166],[164,167],[122,127,134,136,145,152,163,164,166,168],[152,164,169],[137,152,164,171],[164,415,454],[164,415,439,454],[164,454],[164,415],[164,415,440,454],[164,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453],[164,440,454],[164,277],[164,458],[134,152,164,171],[164,270,271,272,273,274,275],[164,270,271],[122,123,152,164],[164,319,320],[164,223],[64,164,179,192,231],[64,164,179,190,192],[64,164,179,192],[64,164,189,191],[164,179],[79,82,164,172,175,182,339],[79,84,164,172,173,174,175,176,181,182,183,316,317,321,323,339,341],[164,172,175,176,182,316],[82,164,172,175,182,316],[79,82,164,173,175,182,183,315,339,341,349],[79,82,164,172,173,175,176,182,183,315,316,339,341,343,344,350],[79,84,164,173,174,180,181,182,183,184,321,340,341,342,351,352,353,354,355],[82,164,172,173,176,181,182,183,323,339],[74,164],[164,201,214,215,216],[77,78,164],[77,164],[75,164],[164,195],[76,164],[76,164,197],[78,164,196,197,198,199,200],[74,75,76,77,164,195],[74,75,76,164],[164,345,346,347,348],[164,346],[164,346,347],[71,164],[63,164],[63,71,164],[63,64,164],[63,65,66,67,68,69,70,164],[164,218],[164,213,218,219,221,222,223,224],[164,201,217],[96,100,163,164],[96,152,163,164],[91,164],[93,96,160,163,164],[142,160,164],[164,171],[91,164,171],[93,96,142,163,164],[88,89,92,95,122,134,152,163,164],[88,94,164],[92,96,122,155,163,164,171],[122,164,171],[112,122,164,171],[90,91,164,171],[96,164],[90,91,92,93,94,95,96,97,98,100,101,102,103,104,105,106,107,108,109,110,111,113,114,115,116,117,118,164],[96,103,104,164],[94,96,104,105,164],[95,164],[88,91,96,164],[96,100,104,105,164],[100,164],[94,96,99,163,164],[88,93,94,96,100,103,164],[122,152,164],[91,96,112,122,164,168,171],[62,73,79,164,187],[62,164,185,186],[62,73,164,184],[62,164,185,187],[164,260],[127,164,185,188,241,245,246,260],[62,164,185,187,188,248,255,257,259],[61,64,164,179,193,230,262],[62,64,72,164,187,192],[62,72,73,79,164,185,187,188,193,194,220,227,229,230,232],[62,72,164,186,187,188,213,222,225,227],[62,72,164,185,187,220,228],[73,164,184,188,260,264],[61,164,185,187,223,226],[164,173],[61,62,64,72,73,79,164,173,179,183,184,185,188,192,193,220,230,232,233,234,235,261,262,263],[62,72,164],[64,71,72,164],[62,73,79,164,211,212,213,219],[164,264,268],[79,164,279],[122,164,185,187,220,222,223,229,260,276,371],[64,164,173,219,232,234,264,265,276,278,280],[82,135,164,211,212,226,265,288,291,328,334,336,337,338,356,357,363],[61,64,79,122,164,193,219,220,222,223,229,231,232,233,234,260,264,276,278,280,365,371],[79,164,185,210,370],[79,122,164,220,222,232,233,234,261,276,280],[62,73,79,187],[62,185,186],[62,73,184],[62,185,187],[265],[188],[64,179,230,262],[62,64,187,192],[62,73,79,185,187,188,229,230,232],[62,186,187,188],[62,185,187,228],[73,184,188,260,264],[185,187,226],[173],[62,64,73,79,173,179,183,184,185,188],[62],[64,71],[62,73,79],[79],[79,185,210]],"referencedMap":[[240,1],[238,2],[241,3],[239,4],[236,5],[237,5],[242,5],[245,6],[244,7],[243,5],[311,5],[318,8],[298,9],[296,10],[295,11],[300,12],[304,13],[308,14],[306,15],[301,5],[299,5],[307,16],[303,17],[309,18],[310,19],[297,20],[302,5],[283,21],[284,5],[288,22],[287,23],[286,24],[366,5],[367,5],[370,25],[204,26],[202,27],[205,28],[211,29],[203,5],[206,26],[207,30],[208,27],[209,27],[368,5],[369,5],[291,31],[289,30],[290,32],[328,33],[268,34],[267,5],[323,35],[316,36],[317,37],[339,38],[363,39],[359,5],[360,40],[362,41],[358,5],[361,42],[184,43],[341,44],[183,45],[84,46],[194,5],[172,47],[182,48],[210,5],[173,49],[353,50],[79,51],[83,52],[174,53],[175,52],[292,54],[176,5],[177,49],[180,55],[285,5],[178,56],[181,57],[329,58],[330,58],[334,59],[331,58],[332,58],[333,58],[327,60],[322,61],[326,62],[325,30],[354,63],[226,64],[315,65],[314,64],[312,64],[313,64],[279,66],[212,67],[355,68],[336,69],[335,70],[81,35],[82,71],[80,35],[248,72],[247,5],[251,73],[252,74],[253,74],[250,5],[254,5],[249,5],[255,75],[258,76],[257,76],[259,77],[256,5],[378,78],[271,79],[275,79],[273,79],[270,5],[380,80],[376,5],[381,5],[382,5],[383,5],[384,47],[385,5],[406,81],[391,82],[397,83],[395,5],[394,84],[396,85],[405,86],[400,87],[402,88],[403,89],[404,90],[398,5],[399,90],[401,90],[393,90],[392,5],[408,91],[387,5],[386,5],[389,82],[390,92],[388,82],[409,5],[410,5],[411,5],[379,5],[85,93],[86,93],[121,94],[122,95],[123,96],[124,97],[125,98],[126,99],[127,100],[128,101],[129,102],[130,103],[131,103],[133,104],[132,105],[134,106],[135,107],[136,108],[120,109],[170,5],[137,110],[138,111],[139,112],[171,113],[140,114],[141,115],[142,116],[143,117],[144,118],[145,119],[146,120],[147,121],[148,122],[149,123],[150,123],[151,124],[152,125],[154,126],[153,127],[155,128],[156,129],[157,130],[158,131],[159,132],[160,133],[161,134],[162,135],[163,136],[164,137],[165,138],[166,139],[167,140],[168,141],[169,142],[412,5],[413,5],[377,143],[414,5],[439,144],[440,145],[415,146],[418,146],[437,144],[438,144],[428,144],[427,147],[425,144],[420,144],[433,144],[431,144],[435,144],[419,144],[432,144],[436,144],[421,144],[422,144],[434,144],[416,144],[423,144],[424,144],[426,144],[430,144],[441,148],[429,144],[417,144],[454,149],[453,5],[448,148],[450,150],[449,148],[442,148],[443,148],[445,148],[447,148],[451,150],[452,150],[444,150],[446,150],[278,151],[277,5],[455,5],[456,5],[457,5],[407,5],[458,5],[459,152],[460,153],[276,154],[87,5],[274,79],[272,155],[305,5],[345,5],[337,156],[338,5],[321,157],[319,158],[320,5],[365,5],[231,32],[232,159],[191,160],[189,161],[192,162],[234,163],[235,163],[282,5],[190,32],[179,5],[375,104],[340,164],[342,165],[343,166],[344,167],[350,168],[351,169],[356,170],[352,171],[216,172],[74,5],[217,173],[75,174],[200,5],[78,175],[195,176],[215,177],[214,177],[197,178],[198,179],[76,5],[201,180],[196,181],[77,182],[199,5],[357,5],[349,183],[347,184],[348,185],[346,5],[324,5],[293,5],[294,11],[63,186],[67,187],[68,188],[65,189],[66,187],[71,190],[69,30],[70,186],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[64,5],[72,5],[221,5],[213,5],[222,5],[219,191],[225,192],[223,191],[218,193],[224,5],[103,194],[110,195],[102,194],[117,196],[94,197],[93,198],[116,199],[111,200],[114,201],[96,202],[95,203],[91,204],[90,205],[113,206],[92,207],[97,208],[98,5],[101,208],[88,5],[119,209],[118,208],[105,210],[106,211],[108,212],[104,213],[107,214],[112,199],[99,215],[100,216],[109,217],[89,218],[115,219],[246,5],[62,5],[230,220],[187,221],[185,222],[61,5],[188,223],[266,224],[261,225],[260,226],[263,227],[193,228],[233,229],[228,230],[229,231],[265,232],[227,233],[262,234],[264,235],[186,236],[73,237],[220,238],[269,239],[280,240],[374,241],[281,242],[364,243],[372,244],[371,245],[373,246]],"exportedModulesMap":[[240,1],[238,2],[241,3],[239,4],[236,5],[237,5],[242,5],[245,6],[244,7],[243,5],[311,5],[318,8],[298,9],[296,10],[295,11],[300,12],[304,13],[308,14],[306,15],[301,5],[299,5],[307,16],[303,17],[309,18],[310,19],[297,20],[302,5],[283,21],[284,5],[288,22],[287,23],[286,24],[366,5],[367,5],[370,25],[204,26],[202,27],[205,28],[211,29],[203,5],[206,26],[207,30],[208,27],[209,27],[368,5],[369,5],[291,31],[289,30],[290,32],[328,33],[268,34],[267,5],[323,35],[316,36],[317,37],[339,38],[363,39],[359,5],[360,40],[362,41],[358,5],[361,42],[184,43],[341,44],[183,45],[84,46],[194,5],[172,47],[182,48],[210,5],[173,49],[353,50],[79,51],[83,52],[174,53],[175,52],[292,54],[176,5],[177,49],[180,55],[285,5],[178,56],[181,57],[329,58],[330,58],[334,59],[331,58],[332,58],[333,58],[327,60],[322,61],[326,62],[325,30],[354,63],[226,64],[315,65],[314,64],[312,64],[313,64],[279,66],[212,67],[355,68],[336,69],[335,70],[81,35],[82,71],[80,35],[248,72],[247,5],[251,73],[252,74],[253,74],[250,5],[254,5],[249,5],[255,75],[258,76],[257,76],[259,77],[256,5],[378,78],[271,79],[275,79],[273,79],[270,5],[380,80],[376,5],[381,5],[382,5],[383,5],[384,47],[385,5],[406,81],[391,82],[397,83],[395,5],[394,84],[396,85],[405,86],[400,87],[402,88],[403,89],[404,90],[398,5],[399,90],[401,90],[393,90],[392,5],[408,91],[387,5],[386,5],[389,82],[390,92],[388,82],[409,5],[410,5],[411,5],[379,5],[85,93],[86,93],[121,94],[122,95],[123,96],[124,97],[125,98],[126,99],[127,100],[128,101],[129,102],[130,103],[131,103],[133,104],[132,105],[134,106],[135,107],[136,108],[120,109],[170,5],[137,110],[138,111],[139,112],[171,113],[140,114],[141,115],[142,116],[143,117],[144,118],[145,119],[146,120],[147,121],[148,122],[149,123],[150,123],[151,124],[152,125],[154,126],[153,127],[155,128],[156,129],[157,130],[158,131],[159,132],[160,133],[161,134],[162,135],[163,136],[164,137],[165,138],[166,139],[167,140],[168,141],[169,142],[412,5],[413,5],[377,143],[414,5],[439,144],[440,145],[415,146],[418,146],[437,144],[438,144],[428,144],[427,147],[425,144],[420,144],[433,144],[431,144],[435,144],[419,144],[432,144],[436,144],[421,144],[422,144],[434,144],[416,144],[423,144],[424,144],[426,144],[430,144],[441,148],[429,144],[417,144],[454,149],[453,5],[448,148],[450,150],[449,148],[442,148],[443,148],[445,148],[447,148],[451,150],[452,150],[444,150],[446,150],[278,151],[277,5],[455,5],[456,5],[457,5],[407,5],[458,5],[459,152],[460,153],[276,154],[87,5],[274,79],[272,155],[305,5],[345,5],[337,156],[338,5],[321,157],[319,158],[320,5],[365,5],[231,32],[232,159],[191,160],[189,161],[192,162],[234,163],[235,163],[282,5],[190,32],[179,5],[375,104],[340,164],[342,165],[343,166],[344,167],[350,168],[351,169],[356,170],[352,171],[216,172],[74,5],[217,173],[75,174],[200,5],[78,175],[195,176],[215,177],[214,177],[197,178],[198,179],[76,5],[201,180],[196,181],[77,182],[199,5],[357,5],[349,183],[347,184],[348,185],[346,5],[324,5],[293,5],[294,11],[63,186],[67,187],[68,188],[65,189],[66,187],[71,190],[69,30],[70,186],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[64,5],[72,5],[221,5],[213,5],[222,5],[219,191],[225,192],[223,191],[218,193],[224,5],[103,194],[110,195],[102,194],[117,196],[94,197],[93,198],[116,199],[111,200],[114,201],[96,202],[95,203],[91,204],[90,205],[113,206],[92,207],[97,208],[98,5],[101,208],[88,5],[119,209],[118,208],[105,210],[106,211],[108,212],[104,213],[107,214],[112,199],[99,215],[100,216],[109,217],[89,218],[115,219],[246,5],[230,247],[187,248],[185,249],[188,250],[266,251],[261,252],[260,252],[263,253],[193,254],[233,255],[228,256],[229,257],[265,258],[227,259],[262,260],[264,261],[186,262],[73,263],[220,264],[280,265],[371,266]],"semanticDiagnosticsPerFile":[240,238,241,239,236,237,242,245,244,243,311,318,298,296,295,300,304,308,306,301,299,307,303,309,310,297,302,283,284,288,287,286,366,367,370,204,202,205,211,203,206,207,208,209,368,369,291,289,290,328,268,267,323,316,317,339,363,359,360,362,358,361,184,341,183,84,194,172,182,210,173,353,79,83,174,175,292,176,177,180,285,178,181,329,330,334,331,332,333,327,322,326,325,354,226,315,314,312,313,279,212,355,336,335,81,82,80,248,247,251,252,253,250,254,249,255,258,257,259,256,378,271,275,273,270,380,376,381,382,383,384,385,406,391,397,395,394,396,405,400,402,403,404,398,399,401,393,392,408,387,386,389,390,388,409,410,411,379,85,86,121,122,123,124,125,126,127,128,129,130,131,133,132,134,135,136,120,170,137,138,139,171,140,141,142,143,144,145,146,147,148,149,150,151,152,154,153,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,412,413,377,414,439,440,415,418,437,438,428,427,425,420,433,431,435,419,432,436,421,422,434,416,423,424,426,430,441,429,417,454,453,448,450,449,442,443,445,447,451,452,444,446,278,277,455,456,457,407,458,459,460,276,87,274,272,305,345,337,338,321,319,320,365,231,232,191,189,192,234,235,282,190,179,375,340,342,343,344,350,351,356,352,216,74,217,75,200,78,195,215,214,197,198,76,201,196,77,199,357,349,347,348,346,324,293,294,63,67,68,65,66,71,69,70,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,64,72,221,213,222,219,225,223,218,224,103,110,102,117,94,93,116,111,114,96,95,91,90,113,92,97,98,101,88,119,118,105,106,108,104,107,112,99,100,109,89,115,246,62,230,187,185,61,188,266,261,260,263,193,233,228,229,265,227,262,264,186,73,220,269,280,374,281,364,372,371,373],"latestChangedDtsFile":"./test/handshakes/xx.spec.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/package.json deleted file mode 100644 index f57d80eba..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/package.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "name": "@chainsafe/libp2p-noise", - "version": "13.0.3", - "author": "ChainSafe ", - "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/ChainSafe/js-libp2p-noise#readme", - "repository": { - "type": "git", - "url": "git+https://github.com/ChainSafe/js-libp2p-noise.git" - }, - "bugs": { - "url": "https://github.com/ChainSafe/js-libp2p-noise/issues" - }, - "keywords": [ - "crypto", - "libp2p", - "noise" - ], - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - }, - "type": "module", - "types": "./dist/src/index.d.ts", - "files": [ - "src", - "dist", - "!dist/test", - "!**/*.tsbuildinfo" - ], - "exports": { - ".": { - "types": "./dist/src/index.d.ts", - "import": "./dist/src/index.js" - } - }, - "eslintConfig": { - "extends": "ipfs", - "parserOptions": { - "sourceType": "module" - }, - "rules": { - "@typescript-eslint/no-unused-vars": "error", - "@typescript-eslint/explicit-function-return-type": "warn", - "@typescript-eslint/strict-boolean-expressions": "off" - }, - "ignorePatterns": [ - "src/proto/payload.js", - "src/proto/payload.d.ts", - "test/fixtures/node-globals.js" - ] - }, - "scripts": { - "bench": "node benchmarks/benchmark.js", - "clean": "aegir clean", - "dep-check": "aegir dep-check", - "build": "aegir build", - "lint": "aegir lint", - "lint:fix": "aegir lint --fix", - "test": "aegir test", - "test:node": "aegir test -t node", - "test:browser": "aegir test -t browser -t webworker", - "test:electron-main": "aegir test -t electron-main", - "test:interop": "aegir test -t node -f dist/test/interop.js", - "docs": "aegir docs", - "proto:gen": "protons ./src/proto/payload.proto", - "prepublish": "npm run build" - }, - "dependencies": { - "@chainsafe/as-chacha20poly1305": "^0.1.0", - "@chainsafe/as-sha256": "^0.4.1", - "@libp2p/crypto": "^2.0.0", - "@libp2p/interface": "^0.1.0", - "@libp2p/logger": "^3.0.0", - "@libp2p/peer-id": "^3.0.0", - "@noble/ciphers": "^0.4.0", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "it-byte-stream": "^1.0.0", - "it-length-prefixed": "^9.0.1", - "it-length-prefixed-stream": "^1.0.0", - "it-pair": "^2.0.6", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.4", - "wherearewe": "^2.0.1" - }, - "devDependencies": { - "@chainsafe/libp2p-yamux": "^5.0.0", - "@libp2p/daemon-client": "^7.0.0", - "@libp2p/daemon-server": "^6.0.0", - "@libp2p/interface-compliance-tests": "^4.0.0", - "@libp2p/interface-peer-id": "^2.0.2", - "@libp2p/interop": "^9.0.0", - "@libp2p/peer-id-factory": "^3.0.0", - "@libp2p/tcp": "^8.0.0", - "@multiformats/multiaddr": "^12.1.0", - "@types/sinon": "^17.0.1", - "aegir": "^40.0.8", - "benchmark": "^2.1.4", - "execa": "^8.0.1", - "go-libp2p": "^1.0.3", - "iso-random-stream": "^2.0.2", - "libp2p": "^0.46.0", - "mkdirp": "^3.0.0", - "p-defer": "^4.0.0", - "protons": "^7.0.0", - "sinon": "^17.0.1" - }, - "browser": { - "./dist/src/crypto/index.js": "./dist/src/crypto/index.browser.js", - "util": false - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/@types/basic.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/@types/basic.ts deleted file mode 100644 index 364d1f89e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/@types/basic.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type bytes = Uint8Array -export type bytes32 = Uint8Array -export type bytes16 = Uint8Array - -export type uint64 = number diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/@types/handshake-interface.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/@types/handshake-interface.ts deleted file mode 100644 index 9b402b1fd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/@types/handshake-interface.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { bytes } from './basic.js' -import type { NoiseSession } from './handshake.js' -import type { NoiseExtensions } from '../proto/payload.js' -import type { PeerId } from '@libp2p/interface/peer-id' - -export interface IHandshake { - session: NoiseSession - remotePeer: PeerId - remoteExtensions: NoiseExtensions - encrypt: (plaintext: bytes, session: NoiseSession) => bytes - decrypt: (ciphertext: bytes, session: NoiseSession, dst?: Uint8Array) => { plaintext: bytes, valid: boolean } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/@types/handshake.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/@types/handshake.ts deleted file mode 100644 index ec333b703..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/@types/handshake.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { bytes, bytes32, uint64 } from './basic.js' -import type { KeyPair } from './libp2p.js' -import type { Nonce } from '../nonce.js' - -export type Hkdf = [bytes, bytes, bytes] - -export interface MessageBuffer { - ne: bytes32 - ns: bytes - ciphertext: bytes -} - -export interface CipherState { - k: bytes32 - // For performance reasons, the nonce is represented as a Nonce object - // The nonce is treated as a uint64, even though the underlying `number` only has 52 safely-available bits. - n: Nonce -} - -export interface SymmetricState { - cs: CipherState - ck: bytes32 // chaining key - h: bytes32 // handshake hash -} - -export interface HandshakeState { - ss: SymmetricState - s: KeyPair - e?: KeyPair - rs: bytes32 - re: bytes32 - psk: bytes32 -} - -export interface NoiseSession { - hs: HandshakeState - h?: bytes32 - cs1?: CipherState - cs2?: CipherState - mc: uint64 - i: boolean -} - -export interface INoisePayload { - identityKey: bytes - identitySig: bytes - data: bytes -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/@types/libp2p.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/@types/libp2p.ts deleted file mode 100644 index c20fe9395..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/@types/libp2p.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { bytes32 } from './basic.js' -import type { NoiseExtensions } from '../proto/payload.js' -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter' - -export interface KeyPair { - publicKey: bytes32 - privateKey: bytes32 -} - -export interface INoiseConnection extends ConnectionEncrypter {} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/constants.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/constants.ts deleted file mode 100644 index 7e8105c47..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/constants.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const NOISE_MSG_MAX_LENGTH_BYTES = 65535 -export const NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG = NOISE_MSG_MAX_LENGTH_BYTES - 16 - -export const DUMP_SESSION_KEYS = Boolean(globalThis.process?.env?.DUMP_SESSION_KEYS) diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/crypto.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/crypto.ts deleted file mode 100644 index 108dfee1c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/crypto.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { bytes32, bytes } from './@types/basic.js' -import type { Hkdf } from './@types/handshake.js' -import type { KeyPair } from './@types/libp2p.js' - -export interface ICryptoInterface { - hashSHA256: (data: Uint8Array) => Uint8Array - - getHKDF: (ck: bytes32, ikm: Uint8Array) => Hkdf - - generateX25519KeyPair: () => KeyPair - generateX25519KeyPairFromSeed: (seed: Uint8Array) => KeyPair - generateX25519SharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Uint8Array - - chaCha20Poly1305Encrypt: (plaintext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32) => bytes - chaCha20Poly1305Decrypt: (ciphertext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array) => bytes | null -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/crypto/index.browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/crypto/index.browser.ts deleted file mode 100644 index f691a85c5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/crypto/index.browser.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { pureJsCrypto } from './js' - -export const defaultCrypto = pureJsCrypto diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/crypto/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/crypto/index.ts deleted file mode 100644 index 946799c9b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/crypto/index.ts +++ /dev/null @@ -1,151 +0,0 @@ -import crypto from 'node:crypto' -import { newInstance, ChaCha20Poly1305 } from '@chainsafe/as-chacha20poly1305' -import { digest } from '@chainsafe/as-sha256' -import { isElectronMain } from 'wherearewe' -import { pureJsCrypto } from './js.js' -import type { KeyPair } from '../@types/libp2p.js' -import type { ICryptoInterface } from '../crypto.js' - -const ctx = newInstance() -const asImpl = new ChaCha20Poly1305(ctx) -const CHACHA_POLY1305 = 'chacha20-poly1305' -const PKCS8_PREFIX = Buffer.from([0x30, 0x2e, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x04, 0x22, 0x04, 0x20]) -const X25519_PREFIX = Buffer.from([0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x03, 0x21, 0x00]) -const nodeCrypto: Pick = { - hashSHA256 (data) { - return crypto.createHash('sha256').update(data).digest() - }, - - chaCha20Poly1305Encrypt (plaintext, nonce, ad, k) { - const cipher = crypto.createCipheriv(CHACHA_POLY1305, k, nonce, { - authTagLength: 16 - }) - cipher.setAAD(ad, { plaintextLength: plaintext.byteLength }) - const updated = cipher.update(plaintext) - const final = cipher.final() - const tag = cipher.getAuthTag() - - const encrypted = Buffer.concat([updated, tag, final], updated.byteLength + tag.byteLength + final.byteLength) - return encrypted - }, - - chaCha20Poly1305Decrypt (ciphertext, nonce, ad, k, _dst) { - const authTag = ciphertext.subarray(ciphertext.length - 16) - const text = ciphertext.subarray(0, ciphertext.length - 16) - const decipher = crypto.createDecipheriv(CHACHA_POLY1305, k, nonce, { - authTagLength: 16 - }) - decipher.setAAD(ad, { - plaintextLength: text.byteLength - }) - decipher.setAuthTag(authTag) - const updated = decipher.update(text) - const final = decipher.final() - if (final.byteLength > 0) { - return Buffer.concat([updated, final], updated.byteLength + final.byteLength) - } - return updated - } -} - -const asCrypto: Pick = { - hashSHA256 (data) { - return digest(data) - }, - chaCha20Poly1305Encrypt (plaintext, nonce, ad, k) { - return asImpl.seal(k, nonce, plaintext, ad) - }, - chaCha20Poly1305Decrypt (ciphertext, nonce, ad, k, dst) { - return asImpl.open(k, nonce, ciphertext, ad, dst) - } -} - -// benchmarks show that for chacha20poly1305 -// the as implementation is faster for smaller payloads(<1200) -// and the node implementation is faster for larger payloads -export const defaultCrypto: ICryptoInterface = { - ...pureJsCrypto, - hashSHA256 (data) { - return nodeCrypto.hashSHA256(data) - }, - chaCha20Poly1305Encrypt (plaintext, nonce, ad, k) { - if (plaintext.length < 1200) { - return asCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) - } - return nodeCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) - }, - chaCha20Poly1305Decrypt (ciphertext, nonce, ad, k, dst) { - if (ciphertext.length < 1200) { - return asCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) - } - return nodeCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) - }, - generateX25519KeyPair (): KeyPair { - const { publicKey, privateKey } = crypto.generateKeyPairSync('x25519', { - publicKeyEncoding: { - type: 'spki', - format: 'der' - }, - privateKeyEncoding: { - type: 'pkcs8', - format: 'der' - } - }) - - return { - publicKey: publicKey.subarray(X25519_PREFIX.length), - privateKey: privateKey.subarray(PKCS8_PREFIX.length) - } - }, - generateX25519KeyPairFromSeed (seed: Uint8Array): KeyPair { - const privateKey = crypto.createPrivateKey({ - key: Buffer.concat([ - PKCS8_PREFIX, - seed - ], PKCS8_PREFIX.byteLength + seed.byteLength), - type: 'pkcs8', - format: 'der' - }) - - const publicKey = crypto.createPublicKey(privateKey) - .export({ - type: 'spki', - format: 'der' - }).subarray(X25519_PREFIX.length) - - return { - publicKey, - privateKey: seed - } - }, - generateX25519SharedKey (privateKey: Uint8Array, publicKey: Uint8Array): Uint8Array { - publicKey = Buffer.concat([ - X25519_PREFIX, - publicKey - ], X25519_PREFIX.byteLength + publicKey.byteLength) - - privateKey = Buffer.concat([ - PKCS8_PREFIX, - privateKey - ], PKCS8_PREFIX.byteLength + privateKey.byteLength) - - return crypto.diffieHellman({ - publicKey: crypto.createPublicKey({ - key: Buffer.from(publicKey, publicKey.byteOffset, publicKey.byteLength), - type: 'spki', - format: 'der' - }), - privateKey: crypto.createPrivateKey({ - key: Buffer.from(privateKey, privateKey.byteOffset, privateKey.byteLength), - type: 'pkcs8', - format: 'der' - }) - }) - } -} - -// no chacha20-poly1305 in electron https://github.com/electron/electron/issues/24024 -if (isElectronMain) { - defaultCrypto.chaCha20Poly1305Encrypt = asCrypto.chaCha20Poly1305Encrypt - defaultCrypto.chaCha20Poly1305Decrypt = asCrypto.chaCha20Poly1305Decrypt -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/crypto/js.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/crypto/js.ts deleted file mode 100644 index e47d4761b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/crypto/js.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { chacha20poly1305 } from '@noble/ciphers/chacha' -import { x25519 } from '@noble/curves/ed25519' -import { extract, expand } from '@noble/hashes/hkdf' -import { sha256 } from '@noble/hashes/sha256' -import type { bytes, bytes32 } from '../@types/basic.js' -import type { Hkdf } from '../@types/handshake.js' -import type { KeyPair } from '../@types/libp2p.js' -import type { ICryptoInterface } from '../crypto.js' - -export const pureJsCrypto: ICryptoInterface = { - hashSHA256 (data: Uint8Array): Uint8Array { - return sha256(data) - }, - - getHKDF (ck: bytes32, ikm: Uint8Array): Hkdf { - const prk = extract(sha256, ikm, ck) - const okmU8Array = expand(sha256, prk, undefined, 96) - const okm = okmU8Array - - const k1 = okm.subarray(0, 32) - const k2 = okm.subarray(32, 64) - const k3 = okm.subarray(64, 96) - - return [k1, k2, k3] - }, - - generateX25519KeyPair (): KeyPair { - const secretKey = x25519.utils.randomPrivateKey() - const publicKey = x25519.getPublicKey(secretKey) - - return { - publicKey, - privateKey: secretKey - } - }, - - generateX25519KeyPairFromSeed (seed: Uint8Array): KeyPair { - const publicKey = x25519.getPublicKey(seed) - - return { - publicKey, - privateKey: seed - } - }, - - generateX25519SharedKey (privateKey: Uint8Array, publicKey: Uint8Array): Uint8Array { - return x25519.getSharedSecret(privateKey, publicKey) - }, - - chaCha20Poly1305Encrypt (plaintext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32): bytes { - return chacha20poly1305(k, nonce, ad).encrypt(plaintext) - }, - - chaCha20Poly1305Decrypt (ciphertext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array): bytes | null { - return chacha20poly1305(k, nonce, ad).decrypt(ciphertext, dst) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/crypto/streaming.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/crypto/streaming.ts deleted file mode 100644 index c3bebff18..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/crypto/streaming.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist' -import { NOISE_MSG_MAX_LENGTH_BYTES, NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG } from '../constants.js' -import { uint16BEEncode } from '../encoder.js' -import type { IHandshake } from '../@types/handshake-interface.js' -import type { MetricsRegistry } from '../metrics.js' -import type { Transform } from 'it-stream-types' - -const CHACHA_TAG_LENGTH = 16 - -// Returns generator that encrypts payload from the user -export function encryptStream (handshake: IHandshake, metrics?: MetricsRegistry): Transform> { - return async function * (source) { - for await (const chunk of source) { - for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG) { - let end = i + NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG - if (end > chunk.length) { - end = chunk.length - } - - const data = handshake.encrypt(chunk.subarray(i, end), handshake.session) - metrics?.encryptedPackets.increment() - - yield new Uint8ArrayList(uint16BEEncode(data.byteLength), data) - } - } - } -} - -// Decrypt received payload to the user -export function decryptStream (handshake: IHandshake, metrics?: MetricsRegistry): Transform, AsyncGenerator> { - return async function * (source) { - for await (const chunk of source) { - for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES) { - let end = i + NOISE_MSG_MAX_LENGTH_BYTES - if (end > chunk.length) { - end = chunk.length - } - - if (end - CHACHA_TAG_LENGTH < i) { - throw new Error('Invalid chunk') - } - const encrypted = chunk.subarray(i, end) - // memory allocation is not cheap so reuse the encrypted Uint8Array - // see https://github.com/ChainSafe/js-libp2p-noise/pull/242#issue-1422126164 - // this is ok because chacha20 reads bytes one by one and don't reread after that - // it's also tested in https://github.com/ChainSafe/as-chacha20poly1305/pull/1/files#diff-25252846b58979dcaf4e41d47b3eadd7e4f335e7fb98da6c049b1f9cd011f381R48 - const dst = chunk.subarray(i, end - CHACHA_TAG_LENGTH) - const { plaintext: decrypted, valid } = handshake.decrypt(encrypted, handshake.session, dst) - if (!valid) { - metrics?.decryptErrors.increment() - throw new Error('Failed to validate decrypted chunk') - } - metrics?.decryptedPackets.increment() - yield decrypted - } - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/encoder.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/encoder.ts deleted file mode 100644 index 8c4d203d4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/encoder.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist' -import { alloc as uint8ArrayAlloc, allocUnsafe as uint8ArrayAllocUnsafe } from 'uint8arrays/alloc' -import type { bytes } from './@types/basic.js' -import type { MessageBuffer } from './@types/handshake.js' -import type { LengthDecoderFunction } from 'it-length-prefixed' - -export const uint16BEEncode = (value: number): Uint8Array => { - const target = uint8ArrayAllocUnsafe(2) - new DataView(target.buffer, target.byteOffset, target.byteLength).setUint16(0, value, false) - return target -} -uint16BEEncode.bytes = 2 - -export const uint16BEDecode: LengthDecoderFunction = (data: Uint8Array | Uint8ArrayList): number => { - if (data.length < 2) throw RangeError('Could not decode int16BE') - - if (data instanceof Uint8Array) { - return new DataView(data.buffer, data.byteOffset, data.byteLength).getUint16(0, false) - } - - return data.getUint16(0) -} -uint16BEDecode.bytes = 2 - -// Note: IK and XX encoder usage is opposite (XX uses in stages encode0 where IK uses encode1) - -export function encode0 (message: MessageBuffer): Uint8ArrayList { - return new Uint8ArrayList(message.ne, message.ciphertext) -} - -export function encode1 (message: MessageBuffer): Uint8ArrayList { - return new Uint8ArrayList(message.ne, message.ns, message.ciphertext) -} - -export function encode2 (message: MessageBuffer): Uint8ArrayList { - return new Uint8ArrayList(message.ns, message.ciphertext) -} - -export function decode0 (input: bytes): MessageBuffer { - if (input.length < 32) { - throw new Error('Cannot decode stage 0 MessageBuffer: length less than 32 bytes.') - } - - return { - ne: input.subarray(0, 32), - ciphertext: input.subarray(32, input.length), - ns: uint8ArrayAlloc(0) - } -} - -export function decode1 (input: bytes): MessageBuffer { - if (input.length < 80) { - throw new Error('Cannot decode stage 1 MessageBuffer: length less than 80 bytes.') - } - - return { - ne: input.subarray(0, 32), - ns: input.subarray(32, 80), - ciphertext: input.subarray(80, input.length) - } -} - -export function decode2 (input: bytes): MessageBuffer { - if (input.length < 48) { - throw new Error('Cannot decode stage 2 MessageBuffer: length less than 48 bytes.') - } - - return { - ne: uint8ArrayAlloc(0), - ns: input.subarray(0, 48), - ciphertext: input.subarray(48, input.length) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/handshake-xx.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/handshake-xx.ts deleted file mode 100644 index 3b547dc03..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/handshake-xx.ts +++ /dev/null @@ -1,178 +0,0 @@ -import { InvalidCryptoExchangeError, UnexpectedPeerError } from '@libp2p/interface/errors' -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { decode0, decode1, decode2, encode0, encode1, encode2 } from './encoder.js' -import { XX } from './handshakes/xx.js' -import { - logger, - logLocalStaticKeys, - logLocalEphemeralKeys, - logRemoteEphemeralKey, - logRemoteStaticKey, - logCipherState -} from './logger.js' -import { - decodePayload, - getPeerIdFromPayload, - verifySignedPayload -} from './utils.js' -import type { bytes, bytes32 } from './@types/basic.js' -import type { IHandshake } from './@types/handshake-interface.js' -import type { CipherState, NoiseSession } from './@types/handshake.js' -import type { KeyPair } from './@types/libp2p.js' -import type { ICryptoInterface } from './crypto.js' -import type { NoiseExtensions } from './proto/payload.js' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { LengthPrefixedStream } from 'it-length-prefixed-stream' - -export class XXHandshake implements IHandshake { - public isInitiator: boolean - public session: NoiseSession - public remotePeer!: PeerId - public remoteExtensions: NoiseExtensions = { webtransportCerthashes: [] } - - protected payload: bytes - protected connection: LengthPrefixedStream - protected xx: XX - protected staticKeypair: KeyPair - - private readonly prologue: bytes32 - - constructor ( - isInitiator: boolean, - payload: bytes, - prologue: bytes32, - crypto: ICryptoInterface, - staticKeypair: KeyPair, - connection: LengthPrefixedStream, - remotePeer?: PeerId, - handshake?: XX - ) { - this.isInitiator = isInitiator - this.payload = payload - this.prologue = prologue - this.staticKeypair = staticKeypair - this.connection = connection - if (remotePeer) { - this.remotePeer = remotePeer - } - this.xx = handshake ?? new XX(crypto) - this.session = this.xx.initSession(this.isInitiator, this.prologue, this.staticKeypair) - } - - // stage 0 - public async propose (): Promise { - logLocalStaticKeys(this.session.hs.s) - if (this.isInitiator) { - logger.trace('Stage 0 - Initiator starting to send first message.') - const messageBuffer = this.xx.sendMessage(this.session, uint8ArrayAlloc(0)) - await this.connection.write(encode0(messageBuffer)) - logger.trace('Stage 0 - Initiator finished sending first message.') - logLocalEphemeralKeys(this.session.hs.e) - } else { - logger.trace('Stage 0 - Responder waiting to receive first message...') - const receivedMessageBuffer = decode0((await this.connection.read()).subarray()) - const { valid } = this.xx.recvMessage(this.session, receivedMessageBuffer) - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 0 validation fail') - } - logger.trace('Stage 0 - Responder received first message.') - logRemoteEphemeralKey(this.session.hs.re) - } - } - - // stage 1 - public async exchange (): Promise { - if (this.isInitiator) { - logger.trace('Stage 1 - Initiator waiting to receive first message from responder...') - const receivedMessageBuffer = decode1((await this.connection.read()).subarray()) - const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer) - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 1 validation fail') - } - logger.trace('Stage 1 - Initiator received the message.') - logRemoteEphemeralKey(this.session.hs.re) - logRemoteStaticKey(this.session.hs.rs) - - logger.trace("Initiator going to check remote's signature...") - try { - const decodedPayload = decodePayload(plaintext) - this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload) - await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer) - this.setRemoteNoiseExtension(decodedPayload.extensions) - } catch (e) { - const err = e as Error - throw new UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`) - } - logger.trace('All good with the signature!') - } else { - logger.trace('Stage 1 - Responder sending out first message with signed payload and static key.') - const messageBuffer = this.xx.sendMessage(this.session, this.payload) - await this.connection.write(encode1(messageBuffer)) - logger.trace('Stage 1 - Responder sent the second handshake message with signed payload.') - logLocalEphemeralKeys(this.session.hs.e) - } - } - - // stage 2 - public async finish (): Promise { - if (this.isInitiator) { - logger.trace('Stage 2 - Initiator sending third handshake message.') - const messageBuffer = this.xx.sendMessage(this.session, this.payload) - await this.connection.write(encode2(messageBuffer)) - logger.trace('Stage 2 - Initiator sent message with signed payload.') - } else { - logger.trace('Stage 2 - Responder waiting for third handshake message...') - const receivedMessageBuffer = decode2((await this.connection.read()).subarray()) - const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer) - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 2 validation fail') - } - logger.trace('Stage 2 - Responder received the message, finished handshake.') - - try { - const decodedPayload = decodePayload(plaintext) - this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload) - await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer) - this.setRemoteNoiseExtension(decodedPayload.extensions) - } catch (e) { - const err = e as Error - throw new UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`) - } - } - logCipherState(this.session) - } - - public encrypt (plaintext: Uint8Array, session: NoiseSession): bytes { - const cs = this.getCS(session) - - return this.xx.encryptWithAd(cs, uint8ArrayAlloc(0), plaintext) - } - - public decrypt (ciphertext: Uint8Array, session: NoiseSession, dst?: Uint8Array): { plaintext: bytes, valid: boolean } { - const cs = this.getCS(session, false) - - return this.xx.decryptWithAd(cs, uint8ArrayAlloc(0), ciphertext, dst) - } - - public getRemoteStaticKey (): bytes { - return this.session.hs.rs - } - - private getCS (session: NoiseSession, encryption = true): CipherState { - if (!session.cs1 || !session.cs2) { - throw new InvalidCryptoExchangeError('Handshake not completed properly, cipher state does not exist.') - } - - if (this.isInitiator) { - return encryption ? session.cs1 : session.cs2 - } else { - return encryption ? session.cs2 : session.cs1 - } - } - - protected setRemoteNoiseExtension (e: NoiseExtensions | null | undefined): void { - if (e) { - this.remoteExtensions = e - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/handshakes/abstract-handshake.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/handshakes/abstract-handshake.ts deleted file mode 100644 index 308d298c5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/handshakes/abstract-handshake.ts +++ /dev/null @@ -1,181 +0,0 @@ -import { fromString as uint8ArrayFromString } from 'uint8arrays' -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { concat as uint8ArrayConcat } from 'uint8arrays/concat' -import { equals as uint8ArrayEquals } from 'uint8arrays/equals' -import { logger } from '../logger.js' -import { Nonce } from '../nonce.js' -import type { bytes, bytes32 } from '../@types/basic.js' -import type { CipherState, MessageBuffer, SymmetricState } from '../@types/handshake.js' -import type { ICryptoInterface } from '../crypto.js' - -export interface DecryptedResult { - plaintext: bytes - valid: boolean -} - -export interface SplitState { - cs1: CipherState - cs2: CipherState -} - -export abstract class AbstractHandshake { - public crypto: ICryptoInterface - - constructor (crypto: ICryptoInterface) { - this.crypto = crypto - } - - public encryptWithAd (cs: CipherState, ad: Uint8Array, plaintext: Uint8Array): bytes { - const e = this.encrypt(cs.k, cs.n, ad, plaintext) - cs.n.increment() - - return e - } - - public decryptWithAd (cs: CipherState, ad: Uint8Array, ciphertext: Uint8Array, dst?: Uint8Array): DecryptedResult { - const { plaintext, valid } = this.decrypt(cs.k, cs.n, ad, ciphertext, dst) - if (valid) cs.n.increment() - - return { plaintext, valid } - } - - // Cipher state related - protected hasKey (cs: CipherState): boolean { - return !this.isEmptyKey(cs.k) - } - - protected createEmptyKey (): bytes32 { - return uint8ArrayAlloc(32) - } - - protected isEmptyKey (k: bytes32): boolean { - const emptyKey = this.createEmptyKey() - return uint8ArrayEquals(emptyKey, k) - } - - protected encrypt (k: bytes32, n: Nonce, ad: Uint8Array, plaintext: Uint8Array): bytes { - n.assertValue() - - return this.crypto.chaCha20Poly1305Encrypt(plaintext, n.getBytes(), ad, k) - } - - protected encryptAndHash (ss: SymmetricState, plaintext: bytes): bytes { - let ciphertext - if (this.hasKey(ss.cs)) { - ciphertext = this.encryptWithAd(ss.cs, ss.h, plaintext) - } else { - ciphertext = plaintext - } - - this.mixHash(ss, ciphertext) - return ciphertext - } - - protected decrypt (k: bytes32, n: Nonce, ad: bytes, ciphertext: bytes, dst?: Uint8Array): DecryptedResult { - n.assertValue() - - const encryptedMessage = this.crypto.chaCha20Poly1305Decrypt(ciphertext, n.getBytes(), ad, k, dst) - - if (encryptedMessage) { - return { - plaintext: encryptedMessage, - valid: true - } - } else { - return { - plaintext: uint8ArrayAlloc(0), - valid: false - } - } - } - - protected decryptAndHash (ss: SymmetricState, ciphertext: bytes): DecryptedResult { - let plaintext: bytes; let valid = true - if (this.hasKey(ss.cs)) { - ({ plaintext, valid } = this.decryptWithAd(ss.cs, ss.h, ciphertext)) - } else { - plaintext = ciphertext - } - - this.mixHash(ss, ciphertext) - return { plaintext, valid } - } - - protected dh (privateKey: bytes32, publicKey: bytes32): bytes32 { - try { - const derivedU8 = this.crypto.generateX25519SharedKey(privateKey, publicKey) - - if (derivedU8.length === 32) { - return derivedU8 - } - - return derivedU8.subarray(0, 32) - } catch (e) { - const err = e as Error - logger.error(err) - return uint8ArrayAlloc(32) - } - } - - protected mixHash (ss: SymmetricState, data: bytes): void { - ss.h = this.getHash(ss.h, data) - } - - protected getHash (a: Uint8Array, b: Uint8Array): bytes32 { - const u = this.crypto.hashSHA256(uint8ArrayConcat([a, b], a.length + b.length)) - return u - } - - protected mixKey (ss: SymmetricState, ikm: bytes32): void { - const [ck, tempK] = this.crypto.getHKDF(ss.ck, ikm) - ss.cs = this.initializeKey(tempK) - ss.ck = ck - } - - protected initializeKey (k: bytes32): CipherState { - return { k, n: new Nonce() } - } - - // Symmetric state related - - protected initializeSymmetric (protocolName: string): SymmetricState { - const protocolNameBytes = uint8ArrayFromString(protocolName, 'utf-8') - const h = this.hashProtocolName(protocolNameBytes) - - const ck = h - const key = this.createEmptyKey() - const cs: CipherState = this.initializeKey(key) - - return { cs, ck, h } - } - - protected hashProtocolName (protocolName: Uint8Array): bytes32 { - if (protocolName.length <= 32) { - const h = uint8ArrayAlloc(32) - h.set(protocolName) - return h - } else { - return this.getHash(protocolName, uint8ArrayAlloc(0)) - } - } - - protected split (ss: SymmetricState): SplitState { - const [tempk1, tempk2] = this.crypto.getHKDF(ss.ck, uint8ArrayAlloc(0)) - const cs1 = this.initializeKey(tempk1) - const cs2 = this.initializeKey(tempk2) - - return { cs1, cs2 } - } - - protected writeMessageRegular (cs: CipherState, payload: bytes): MessageBuffer { - const ciphertext = this.encryptWithAd(cs, uint8ArrayAlloc(0), payload) - const ne = this.createEmptyKey() - const ns = uint8ArrayAlloc(0) - - return { ne, ns, ciphertext } - } - - protected readMessageRegular (cs: CipherState, message: MessageBuffer): DecryptedResult { - return this.decryptWithAd(cs, uint8ArrayAlloc(0), message.ciphertext) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/handshakes/xx.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/handshakes/xx.ts deleted file mode 100644 index 61077388f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/handshakes/xx.ts +++ /dev/null @@ -1,185 +0,0 @@ -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { isValidPublicKey } from '../utils.js' -import { AbstractHandshake, type DecryptedResult } from './abstract-handshake.js' -import type { bytes32, bytes } from '../@types/basic.js' -import type { CipherState, HandshakeState, MessageBuffer, NoiseSession } from '../@types/handshake.js' -import type { KeyPair } from '../@types/libp2p.js' - -export class XX extends AbstractHandshake { - private initializeInitiator (prologue: bytes32, s: KeyPair, rs: bytes32, psk: bytes32): HandshakeState { - const name = 'Noise_XX_25519_ChaChaPoly_SHA256' - const ss = this.initializeSymmetric(name) - this.mixHash(ss, prologue) - const re = uint8ArrayAlloc(32) - - return { ss, s, rs, psk, re } - } - - private initializeResponder (prologue: bytes32, s: KeyPair, rs: bytes32, psk: bytes32): HandshakeState { - const name = 'Noise_XX_25519_ChaChaPoly_SHA256' - const ss = this.initializeSymmetric(name) - this.mixHash(ss, prologue) - const re = uint8ArrayAlloc(32) - - return { ss, s, rs, psk, re } - } - - private writeMessageA (hs: HandshakeState, payload: bytes, e?: KeyPair): MessageBuffer { - const ns = uint8ArrayAlloc(0) - - if (e !== undefined) { - hs.e = e - } else { - hs.e = this.crypto.generateX25519KeyPair() - } - - const ne = hs.e.publicKey - - this.mixHash(hs.ss, ne) - const ciphertext = this.encryptAndHash(hs.ss, payload) - - return { ne, ns, ciphertext } - } - - private writeMessageB (hs: HandshakeState, payload: bytes): MessageBuffer { - hs.e = this.crypto.generateX25519KeyPair() - const ne = hs.e.publicKey - this.mixHash(hs.ss, ne) - - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re)) - const spk = hs.s.publicKey - const ns = this.encryptAndHash(hs.ss, spk) - - this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re)) - const ciphertext = this.encryptAndHash(hs.ss, payload) - - return { ne, ns, ciphertext } - } - - private writeMessageC (hs: HandshakeState, payload: bytes): { messageBuffer: MessageBuffer, cs1: CipherState, cs2: CipherState, h: bytes } { - const spk = hs.s.publicKey - const ns = this.encryptAndHash(hs.ss, spk) - this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re)) - const ciphertext = this.encryptAndHash(hs.ss, payload) - const ne = this.createEmptyKey() - const messageBuffer: MessageBuffer = { ne, ns, ciphertext } - const { cs1, cs2 } = this.split(hs.ss) - - return { h: hs.ss.h, messageBuffer, cs1, cs2 } - } - - private readMessageA (hs: HandshakeState, message: MessageBuffer): DecryptedResult { - if (isValidPublicKey(message.ne)) { - hs.re = message.ne - } - - this.mixHash(hs.ss, hs.re) - return this.decryptAndHash(hs.ss, message.ciphertext) - } - - private readMessageB (hs: HandshakeState, message: MessageBuffer): DecryptedResult { - if (isValidPublicKey(message.ne)) { - hs.re = message.ne - } - - this.mixHash(hs.ss, hs.re) - if (!hs.e) { - throw new Error('Handshake state `e` param is missing.') - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re)) - const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns) - if (valid1 && isValidPublicKey(ns)) { - hs.rs = ns - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs)) - const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext) - return { plaintext, valid: (valid1 && valid2) } - } - - private readMessageC (hs: HandshakeState, message: MessageBuffer): { h: bytes, plaintext: bytes, valid: boolean, cs1: CipherState, cs2: CipherState } { - const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns) - if (valid1 && isValidPublicKey(ns)) { - hs.rs = ns - } - if (!hs.e) { - throw new Error('Handshake state `e` param is missing.') - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs)) - - const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext) - const { cs1, cs2 } = this.split(hs.ss) - - return { h: hs.ss.h, plaintext, valid: (valid1 && valid2), cs1, cs2 } - } - - public initSession (initiator: boolean, prologue: bytes32, s: KeyPair): NoiseSession { - const psk = this.createEmptyKey() - const rs = uint8ArrayAlloc(32) // no static key yet - let hs - - if (initiator) { - hs = this.initializeInitiator(prologue, s, rs, psk) - } else { - hs = this.initializeResponder(prologue, s, rs, psk) - } - - return { - hs, - i: initiator, - mc: 0 - } - } - - public sendMessage (session: NoiseSession, message: bytes, ephemeral?: KeyPair): MessageBuffer { - let messageBuffer: MessageBuffer - if (session.mc === 0) { - messageBuffer = this.writeMessageA(session.hs, message, ephemeral) - } else if (session.mc === 1) { - messageBuffer = this.writeMessageB(session.hs, message) - } else if (session.mc === 2) { - const { h, messageBuffer: resultingBuffer, cs1, cs2 } = this.writeMessageC(session.hs, message) - messageBuffer = resultingBuffer - session.h = h - session.cs1 = cs1 - session.cs2 = cs2 - } else if (session.mc > 2) { - if (session.i) { - if (!session.cs1) { - throw new Error('CS1 (cipher state) is not defined') - } - - messageBuffer = this.writeMessageRegular(session.cs1, message) - } else { - if (!session.cs2) { - throw new Error('CS2 (cipher state) is not defined') - } - - messageBuffer = this.writeMessageRegular(session.cs2, message) - } - } else { - throw new Error('Session invalid.') - } - - session.mc++ - return messageBuffer - } - - public recvMessage (session: NoiseSession, message: MessageBuffer): DecryptedResult { - let plaintext: bytes = uint8ArrayAlloc(0) - let valid = false - if (session.mc === 0) { - ({ plaintext, valid } = this.readMessageA(session.hs, message)) - } else if (session.mc === 1) { - ({ plaintext, valid } = this.readMessageB(session.hs, message)) - } else if (session.mc === 2) { - const { h, plaintext: resultingPlaintext, valid: resultingValid, cs1, cs2 } = this.readMessageC(session.hs, message) - plaintext = resultingPlaintext - valid = resultingValid - session.h = h - session.cs1 = cs1 - session.cs2 = cs2 - } - session.mc++ - return { plaintext, valid } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/index.ts deleted file mode 100644 index 3a42c8972..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Noise } from './noise.js' -import type { NoiseInit } from './noise.js' -import type { NoiseExtensions } from './proto/payload.js' -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter' -export type { ICryptoInterface } from './crypto.js' -export { pureJsCrypto } from './crypto/js.js' - -export function noise (init: NoiseInit = {}): () => ConnectionEncrypter { - return () => new Noise(init) -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/logger.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/logger.ts deleted file mode 100644 index b44ca7b42..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/logger.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { type Logger, logger } from '@libp2p/logger' -import { toString as uint8ArrayToString } from 'uint8arrays/to-string' -import { DUMP_SESSION_KEYS } from './constants.js' -import type { NoiseSession } from './@types/handshake.js' -import type { KeyPair } from './@types/libp2p.js' - -const log = logger('libp2p:noise') - -export { log as logger } - -let keyLogger: Logger -if (DUMP_SESSION_KEYS) { - keyLogger = log -} else { - keyLogger = Object.assign(() => { /* do nothing */ }, { - enabled: false, - trace: () => {}, - error: () => {} - }) -} - -export function logLocalStaticKeys (s: KeyPair): void { - keyLogger(`LOCAL_STATIC_PUBLIC_KEY ${uint8ArrayToString(s.publicKey, 'hex')}`) - keyLogger(`LOCAL_STATIC_PRIVATE_KEY ${uint8ArrayToString(s.privateKey, 'hex')}`) -} - -export function logLocalEphemeralKeys (e: KeyPair | undefined): void { - if (e) { - keyLogger(`LOCAL_PUBLIC_EPHEMERAL_KEY ${uint8ArrayToString(e.publicKey, 'hex')}`) - keyLogger(`LOCAL_PRIVATE_EPHEMERAL_KEY ${uint8ArrayToString(e.privateKey, 'hex')}`) - } else { - keyLogger('Missing local ephemeral keys.') - } -} - -export function logRemoteStaticKey (rs: Uint8Array): void { - keyLogger(`REMOTE_STATIC_PUBLIC_KEY ${uint8ArrayToString(rs, 'hex')}`) -} - -export function logRemoteEphemeralKey (re: Uint8Array): void { - keyLogger(`REMOTE_EPHEMERAL_PUBLIC_KEY ${uint8ArrayToString(re, 'hex')}`) -} - -export function logCipherState (session: NoiseSession): void { - if (session.cs1 && session.cs2) { - keyLogger(`CIPHER_STATE_1 ${session.cs1.n.getUint64()} ${uint8ArrayToString(session.cs1.k, 'hex')}`) - keyLogger(`CIPHER_STATE_2 ${session.cs2.n.getUint64()} ${uint8ArrayToString(session.cs2.k, 'hex')}`) - } else { - keyLogger('Missing cipher state.') - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/metrics.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/metrics.ts deleted file mode 100644 index 8d0b3a4e7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/metrics.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { Counter, Metrics } from '@libp2p/interface/metrics' - -export type MetricsRegistry = Record - -export function registerMetrics (metrics: Metrics): MetricsRegistry { - return { - xxHandshakeSuccesses: metrics.registerCounter( - 'libp2p_noise_xxhandshake_successes_total', { - help: 'Total count of noise xxHandshakes successes_' - }), - - xxHandshakeErrors: metrics.registerCounter( - 'libp2p_noise_xxhandshake_error_total', { - help: 'Total count of noise xxHandshakes errors' - }), - - encryptedPackets: metrics.registerCounter( - 'libp2p_noise_encrypted_packets_total', { - help: 'Total count of noise encrypted packets successfully' - }), - - decryptedPackets: metrics.registerCounter( - 'libp2p_noise_decrypted_packets_total', { - help: 'Total count of noise decrypted packets' - }), - - decryptErrors: metrics.registerCounter( - 'libp2p_noise_decrypt_errors_total', { - help: 'Total count of noise decrypt errors' - }) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/noise.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/noise.ts deleted file mode 100644 index 7996ef225..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/noise.ts +++ /dev/null @@ -1,201 +0,0 @@ -import { decode } from 'it-length-prefixed' -import { lpStream, type LengthPrefixedStream } from 'it-length-prefixed-stream' -import { duplexPair } from 'it-pair/duplex' -import { pipe } from 'it-pipe' -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { NOISE_MSG_MAX_LENGTH_BYTES } from './constants.js' -import { defaultCrypto } from './crypto/index.js' -import { decryptStream, encryptStream } from './crypto/streaming.js' -import { uint16BEDecode, uint16BEEncode } from './encoder.js' -import { XXHandshake } from './handshake-xx.js' -import { type MetricsRegistry, registerMetrics } from './metrics.js' -import { getPayload } from './utils.js' -import type { bytes } from './@types/basic.js' -import type { IHandshake } from './@types/handshake-interface.js' -import type { INoiseConnection, KeyPair } from './@types/libp2p.js' -import type { ICryptoInterface } from './crypto.js' -import type { NoiseExtensions } from './proto/payload.js' -import type { MultiaddrConnection } from '@libp2p/interface/connection' -import type { SecuredConnection } from '@libp2p/interface/connection-encrypter' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { Duplex } from 'it-stream-types' -import type { Uint8ArrayList } from 'uint8arraylist' - -interface HandshakeParams { - connection: LengthPrefixedStream - isInitiator: boolean - localPeer: PeerId - remotePeer?: PeerId -} - -export interface NoiseInit { - /** - * x25519 private key, reuse for faster handshakes - */ - staticNoiseKey?: bytes - extensions?: NoiseExtensions - crypto?: ICryptoInterface - prologueBytes?: Uint8Array - metrics?: Metrics -} - -export class Noise implements INoiseConnection { - public protocol = '/noise' - public crypto: ICryptoInterface - - private readonly prologue: Uint8Array - private readonly staticKeys: KeyPair - private readonly extensions?: NoiseExtensions - private readonly metrics?: MetricsRegistry - - constructor (init: NoiseInit = {}) { - const { staticNoiseKey, extensions, crypto, prologueBytes, metrics } = init - - this.crypto = crypto ?? defaultCrypto - this.extensions = extensions - this.metrics = metrics ? registerMetrics(metrics) : undefined - - if (staticNoiseKey) { - // accepts x25519 private key of length 32 - this.staticKeys = this.crypto.generateX25519KeyPairFromSeed(staticNoiseKey) - } else { - this.staticKeys = this.crypto.generateX25519KeyPair() - } - this.prologue = prologueBytes ?? uint8ArrayAlloc(0) - } - - /** - * Encrypt outgoing data to the remote party (handshake as initiator) - * - * @param {PeerId} localPeer - PeerId of the receiving peer - * @param {Stream} connection - streaming iterable duplex that will be encrypted - * @param {PeerId} remotePeer - PeerId of the remote peer. Used to validate the integrity of the remote peer. - * @returns {Promise>} - */ - public async secureOutbound > = MultiaddrConnection> (localPeer: PeerId, connection: Stream, remotePeer?: PeerId): Promise> { - const wrappedConnection = lpStream( - connection, - { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - } - ) - const handshake = await this.performHandshake({ - connection: wrappedConnection, - isInitiator: true, - localPeer, - remotePeer - }) - const conn = await this.createSecureConnection(wrappedConnection, handshake) - - connection.source = conn.source - connection.sink = conn.sink - - return { - conn: connection, - remoteExtensions: handshake.remoteExtensions, - remotePeer: handshake.remotePeer - } - } - - /** - * Decrypt incoming data (handshake as responder). - * - * @param {PeerId} localPeer - PeerId of the receiving peer. - * @param {Stream} connection - streaming iterable duplex that will be encrypted. - * @param {PeerId} remotePeer - optional PeerId of the initiating peer, if known. This may only exist during transport upgrades. - * @returns {Promise>} - */ - public async secureInbound > = MultiaddrConnection> (localPeer: PeerId, connection: Stream, remotePeer?: PeerId): Promise> { - const wrappedConnection = lpStream( - connection, - { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - } - ) - const handshake = await this.performHandshake({ - connection: wrappedConnection, - isInitiator: false, - localPeer, - remotePeer - }) - const conn = await this.createSecureConnection(wrappedConnection, handshake) - - connection.source = conn.source - connection.sink = conn.sink - - return { - conn: connection, - remotePeer: handshake.remotePeer, - remoteExtensions: handshake.remoteExtensions - } - } - - /** - * If Noise pipes supported, tries IK handshake first with XX as fallback if it fails. - * If noise pipes disabled or remote peer static key is unknown, use XX. - * - * @param {HandshakeParams} params - */ - private async performHandshake (params: HandshakeParams): Promise { - const payload = await getPayload(params.localPeer, this.staticKeys.publicKey, this.extensions) - - // run XX handshake - return this.performXXHandshake(params, payload) - } - - private async performXXHandshake ( - params: HandshakeParams, - payload: bytes - ): Promise { - const { isInitiator, remotePeer, connection } = params - const handshake = new XXHandshake( - isInitiator, - payload, - this.prologue, - this.crypto, - this.staticKeys, - connection, - remotePeer - ) - - try { - await handshake.propose() - await handshake.exchange() - await handshake.finish() - this.metrics?.xxHandshakeSuccesses.increment() - } catch (e: unknown) { - this.metrics?.xxHandshakeErrors.increment() - if (e instanceof Error) { - e.message = `Error occurred during XX handshake: ${e.message}` - throw e - } - } - - return handshake - } - - private async createSecureConnection ( - connection: LengthPrefixedStream>>, - handshake: IHandshake - ): Promise>> { - // Create encryption box/unbox wrapper - const [secure, user] = duplexPair() - const network = connection.unwrap() - - await pipe( - secure, // write to wrapper - encryptStream(handshake, this.metrics), // encrypt data + prefix with message length - network, // send to the remote peer - (source) => decode(source, { lengthDecoder: uint16BEDecode }), // read message length prefix - decryptStream(handshake, this.metrics), // decrypt the incoming data - secure // pipe to the wrapper - ) - - return user - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/nonce.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/nonce.ts deleted file mode 100644 index e19183dd8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/nonce.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import type { bytes, uint64 } from './@types/basic.js' - -export const MIN_NONCE = 0 -// For performance reasons, the nonce is represented as a JS `number` -// Although JS `number` can safely represent integers up to 2 ** 53 - 1, we choose to only use -// 4 bytes to store the data for performance reason. -// This is a slight deviation from the noise spec, which describes the max nonce as 2 ** 64 - 2 -// The effect is that this implementation will need a new handshake to be performed after fewer messages are exchanged than other implementations with full uint64 nonces. -// this MAX_NONCE is still a large number of messages, so the practical effect of this is negligible. -export const MAX_NONCE = 0xffffffff - -const ERR_MAX_NONCE = 'Cipherstate has reached maximum n, a new handshake must be performed' - -/** - * The nonce is an uint that's increased over time. - * Maintaining different representations help improve performance. - */ -export class Nonce { - private n: uint64 - private readonly bytes: bytes - private readonly view: DataView - - constructor (n = MIN_NONCE) { - this.n = n - this.bytes = uint8ArrayAlloc(12) - this.view = new DataView(this.bytes.buffer, this.bytes.byteOffset, this.bytes.byteLength) - this.view.setUint32(4, n, true) - } - - increment (): void { - this.n++ - // Even though we're treating the nonce as 8 bytes, RFC7539 specifies 12 bytes for a nonce. - this.view.setUint32(4, this.n, true) - } - - getBytes (): bytes { - return this.bytes - } - - getUint64 (): uint64 { - return this.n - } - - assertValue (): void { - if (this.n > MAX_NONCE) { - throw new Error(ERR_MAX_NONCE) - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/proto/payload.proto b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/proto/payload.proto deleted file mode 100644 index cdb2383cb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/proto/payload.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; - -message NoiseExtensions { - repeated bytes webtransport_certhashes = 1; -} - -message NoiseHandshakePayload { - bytes identity_key = 1; - bytes identity_sig = 2; - optional NoiseExtensions extensions = 4; -} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/proto/payload.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/proto/payload.ts deleted file mode 100644 index 5f8d5100f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/proto/payload.ts +++ /dev/null @@ -1,152 +0,0 @@ -/* eslint-disable import/export */ -/* eslint-disable complexity */ -/* eslint-disable @typescript-eslint/no-namespace */ -/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ -/* eslint-disable @typescript-eslint/no-empty-interface */ - -import { type Codec, decodeMessage, encodeMessage, message } from 'protons-runtime' -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import type { Uint8ArrayList } from 'uint8arraylist' - -export interface NoiseExtensions { - webtransportCerthashes: Uint8Array[] -} - -export namespace NoiseExtensions { - let _codec: Codec - - export const codec = (): Codec => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork() - } - - if (obj.webtransportCerthashes != null) { - for (const value of obj.webtransportCerthashes) { - w.uint32(10) - w.bytes(value) - } - } - - if (opts.lengthDelimited !== false) { - w.ldelim() - } - }, (reader, length) => { - const obj: any = { - webtransportCerthashes: [] - } - - const end = length == null ? reader.len : reader.pos + length - - while (reader.pos < end) { - const tag = reader.uint32() - - switch (tag >>> 3) { - case 1: { - obj.webtransportCerthashes.push(reader.bytes()) - break - } - default: { - reader.skipType(tag & 7) - break - } - } - } - - return obj - }) - } - - return _codec - } - - export const encode = (obj: Partial): Uint8Array => { - return encodeMessage(obj, NoiseExtensions.codec()) - } - - export const decode = (buf: Uint8Array | Uint8ArrayList): NoiseExtensions => { - return decodeMessage(buf, NoiseExtensions.codec()) - } -} - -export interface NoiseHandshakePayload { - identityKey: Uint8Array - identitySig: Uint8Array - extensions?: NoiseExtensions -} - -export namespace NoiseHandshakePayload { - let _codec: Codec - - export const codec = (): Codec => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork() - } - - if ((obj.identityKey != null && obj.identityKey.byteLength > 0)) { - w.uint32(10) - w.bytes(obj.identityKey) - } - - if ((obj.identitySig != null && obj.identitySig.byteLength > 0)) { - w.uint32(18) - w.bytes(obj.identitySig) - } - - if (obj.extensions != null) { - w.uint32(34) - NoiseExtensions.codec().encode(obj.extensions, w) - } - - if (opts.lengthDelimited !== false) { - w.ldelim() - } - }, (reader, length) => { - const obj: any = { - identityKey: uint8ArrayAlloc(0), - identitySig: uint8ArrayAlloc(0) - } - - const end = length == null ? reader.len : reader.pos + length - - while (reader.pos < end) { - const tag = reader.uint32() - - switch (tag >>> 3) { - case 1: { - obj.identityKey = reader.bytes() - break - } - case 2: { - obj.identitySig = reader.bytes() - break - } - case 4: { - obj.extensions = NoiseExtensions.codec().decode(reader, reader.uint32()) - break - } - default: { - reader.skipType(tag & 7) - break - } - } - } - - return obj - }) - } - - return _codec - } - - export const encode = (obj: Partial): Uint8Array => { - return encodeMessage(obj, NoiseHandshakePayload.codec()) - } - - export const decode = (buf: Uint8Array | Uint8ArrayList): NoiseHandshakePayload => { - return decodeMessage(buf, NoiseHandshakePayload.codec()) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/utils.ts deleted file mode 100644 index 993c9628c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/noise/src/utils.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { unmarshalPublicKey, unmarshalPrivateKey } from '@libp2p/crypto/keys' -import { peerIdFromKeys } from '@libp2p/peer-id' -import { concat as uint8ArrayConcat } from 'uint8arrays/concat' -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' -import { type NoiseExtensions, NoiseHandshakePayload } from './proto/payload.js' -import type { bytes } from './@types/basic.js' -import type { PeerId } from '@libp2p/interface/peer-id' - -export async function getPayload ( - localPeer: PeerId, - staticPublicKey: bytes, - extensions?: NoiseExtensions -): Promise { - const signedPayload = await signPayload(localPeer, getHandshakePayload(staticPublicKey)) - - if (localPeer.publicKey == null) { - throw new Error('PublicKey was missing from local PeerId') - } - - return createHandshakePayload( - localPeer.publicKey, - signedPayload, - extensions - ) -} - -export function createHandshakePayload ( - libp2pPublicKey: Uint8Array, - signedPayload: Uint8Array, - extensions?: NoiseExtensions -): bytes { - return NoiseHandshakePayload.encode({ - identityKey: libp2pPublicKey, - identitySig: signedPayload, - extensions: extensions ?? { webtransportCerthashes: [] } - }).subarray() -} - -export async function signPayload (peerId: PeerId, payload: bytes): Promise { - if (peerId.privateKey == null) { - throw new Error('PrivateKey was missing from PeerId') - } - - const privateKey = await unmarshalPrivateKey(peerId.privateKey) - - return privateKey.sign(payload) -} - -export async function getPeerIdFromPayload (payload: NoiseHandshakePayload): Promise { - return peerIdFromKeys(payload.identityKey) -} - -export function decodePayload (payload: bytes | Uint8Array): NoiseHandshakePayload { - return NoiseHandshakePayload.decode(payload) -} - -export function getHandshakePayload (publicKey: bytes): bytes { - const prefix = uint8ArrayFromString('noise-libp2p-static-key:') - return uint8ArrayConcat([prefix, publicKey], prefix.length + publicKey.length) -} - -/** - * Verifies signed payload, throws on any irregularities. - * - * @param {bytes} noiseStaticKey - owner's noise static key - * @param {bytes} payload - decoded payload - * @param {PeerId} remotePeer - owner's libp2p peer ID - * @returns {Promise} - peer ID of payload owner - */ -export async function verifySignedPayload ( - noiseStaticKey: bytes, - payload: NoiseHandshakePayload, - remotePeer: PeerId -): Promise { - // Unmarshaling from PublicKey protobuf - const payloadPeerId = await peerIdFromKeys(payload.identityKey) - if (!payloadPeerId.equals(remotePeer)) { - throw new Error(`Payload identity key ${payloadPeerId.toString()} does not match expected remote peer ${remotePeer.toString()}`) - } - const generatedPayload = getHandshakePayload(noiseStaticKey) - - if (payloadPeerId.publicKey == null) { - throw new Error('PublicKey was missing from PeerId') - } - - if (payload.identitySig == null) { - throw new Error('Signature was missing from message') - } - - const publicKey = unmarshalPublicKey(payloadPeerId.publicKey) - - const valid = await publicKey.verify(generatedPayload, payload.identitySig) - - if (!valid) { - throw new Error("Static key doesn't match to peer that signed payload!") - } - - return payloadPeerId -} - -export function isValidPublicKey (pk: bytes): boolean { - if (!(pk instanceof Uint8Array)) { - return false - } - - if (pk.length !== 32) { - return false - } - - return true -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/package-lock.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/package-lock.json deleted file mode 100644 index 7f8503d48..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/package-lock.json +++ /dev/null @@ -1,1143 +0,0 @@ -{ - "name": "@libp2p/perf-js-libp2p-1-0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@libp2p/perf-js-libp2p-1-0", - "dependencies": { - "@chainsafe/libp2p-noise": "^13.0.3", - "@chainsafe/libp2p-yamux": "^5.0.3", - "@libp2p/perf": "next", - "@libp2p/tcp": "next", - "libp2p": "next" - } - }, - "node_modules/@chainsafe/as-chacha20poly1305": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@chainsafe/as-chacha20poly1305/-/as-chacha20poly1305-0.1.0.tgz", - "integrity": "sha512-BpNcL8/lji/GM3+vZ/bgRWqJ1q5kwvTFmGPk7pxm/QQZDbaMI98waOHjEymTjq2JmdD/INdNBFOVSyJofXg7ew==" - }, - "node_modules/@chainsafe/as-sha256": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.4.1.tgz", - "integrity": "sha512-IqeeGwQihK6Y2EYLFofqs2eY2ep1I2MvQXHzOAI+5iQN51OZlUkrLgyAugu2x86xZewDk5xas7lNczkzFzF62w==" - }, - "node_modules/@chainsafe/is-ip": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@chainsafe/is-ip/-/is-ip-2.0.2.tgz", - "integrity": "sha512-ndGqEMG1W5WkGagaqOZHpPU172AGdxr+LD15sv3WIUvT5oCFUrG1Y0CW/v2Egwj4JXEvSibaIIIqImsm98y1nA==" - }, - "node_modules/@chainsafe/libp2p-noise": { - "version": "13.0.3", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-13.0.3.tgz", - "integrity": "sha512-hzfhKUEx5XHDaC21wgROhTUFelaeYojH3DFYhCvqFnhRPUjmz+WJh2jweKaUlysKTTrEHv+JJob/TDY/IS6fRw==", - "dependencies": { - "@chainsafe/as-chacha20poly1305": "^0.1.0", - "@chainsafe/as-sha256": "^0.4.1", - "@libp2p/crypto": "^2.0.0", - "@libp2p/interface": "^0.1.0", - "@libp2p/logger": "^3.0.0", - "@libp2p/peer-id": "^3.0.0", - "@noble/ciphers": "^0.4.0", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "it-byte-stream": "^1.0.0", - "it-length-prefixed": "^9.0.1", - "it-length-prefixed-stream": "^1.0.0", - "it-pair": "^2.0.6", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.4", - "wherearewe": "^2.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@chainsafe/libp2p-yamux": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-yamux/-/libp2p-yamux-5.0.3.tgz", - "integrity": "sha512-I2g8eJFm4xvyrD9Z8+8RvqpCBqHiFtcOGrl4sQXPkktw0cY5hvXf0knIjOLacoNOdAPKG9MNscT4Vojp+sb6cw==", - "dependencies": { - "@libp2p/interface": "^0.1.0", - "@libp2p/logger": "^3.0.0", - "get-iterator": "^2.0.1", - "it-foreach": "^2.0.3", - "it-pipe": "^3.0.1", - "it-pushable": "^3.2.0", - "uint8arraylist": "^2.4.3" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@chainsafe/netmask": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@chainsafe/netmask/-/netmask-2.0.0.tgz", - "integrity": "sha512-I3Z+6SWUoaljh3TBzCnCxjlUyN8tA+NAk5L6m9IxvCf1BENQTePzPMis97CoN/iMW1St3WN+AWCCRp+TTBRiDg==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.1" - } - }, - "node_modules/@libp2p/crypto": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8.tgz", - "integrity": "sha512-8e5fh6bsJNpSjhrggtlm8QF+BERjelJswIjRS69aKgxp24R4z2kDM4pRYPkfQjXJDLNDtqWtKNmePgX23+QJsA==", - "dependencies": { - "@libp2p/interface": "^0.1.6", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.0.1", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/interface": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6.tgz", - "integrity": "sha512-Lzc5cS/hXuoXhuAbVIxJIHLCYmfPcbU0vVgrpMoiP1Qb2Q3ETU4A46GB8s8mWXgSU6tr9RcqerUqzFYD6+OAag==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.5", - "abortable-iterator": "^5.0.1", - "it-pushable": "^3.2.0", - "it-stream-types": "^2.0.1", - "multiformats": "^12.0.1", - "p-defer": "^4.0.0", - "race-signal": "^1.0.0", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/interface-internal": { - "version": "0.1.9-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-0.1.9-0b4a2ee79.tgz", - "integrity": "sha512-IGrEs9QsJdYYsSOhniUEQzHVtgB7WNyRqMF8g6iVGn/rM1bJd8MM4syczPn7OQQbkAKqoLQL32XzGN2JgzAvZQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-collections": "4.0.8-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/interface-internal/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/logger": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-3.1.0.tgz", - "integrity": "sha512-qJbJBAhxHVsRBtQSOIkSLi0lskUSFjzE+zm0QvoyxzZKSz+mX41mZLbnofPIVOVauoDQ40dXpe7WDUOq8AbiQQ==", - "dependencies": { - "@libp2p/interface": "^0.1.6", - "@multiformats/multiaddr": "^12.1.5", - "debug": "^4.3.4", - "interface-datastore": "^8.2.0", - "multiformats": "^12.0.1" - } - }, - "node_modules/@libp2p/multistream-select": { - "version": "4.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/multistream-select/-/multistream-select-4.0.6-0b4a2ee79.tgz", - "integrity": "sha512-ylXXuNgeizJ8ALRCp3V1eXbfzibt+cJUYyZvrO2GK7sGYDGlRh7T3rNMCHaU7tuXKN92xrD7Owwnk9rNjFtA+g==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "it-length-prefixed": "^9.0.3", - "it-length-prefixed-stream": "^1.1.1", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "p-defer": "^4.0.0", - "uint8-varint": "^2.0.2", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/multistream-select/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-collections": { - "version": "4.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-4.0.8-0b4a2ee79.tgz", - "integrity": "sha512-LYLTIlAWNLsDGlK7dhZ9azqkr9vpq5NbvuqTWAKEv02pFbJlmgIMUtPL6XJeyk2BLiZQtgp/nP6cpdFSPZTrBw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79" - } - }, - "node_modules/@libp2p/peer-collections/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-collections/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-id": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6.tgz", - "integrity": "sha512-iN1Ia5gH2U1V/GOVRmLHmVY6fblxzrOPUoZrMYjHl/K4s+AiI7ym/527WDeQvhQpD7j3TfDwcAYforD2dLGpLw==", - "dependencies": { - "@libp2p/interface": "^0.1.6", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-id-factory": { - "version": "3.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id-factory/-/peer-id-factory-3.0.8-0b4a2ee79.tgz", - "integrity": "sha512-y7JrbVT4+ZAy7KDqwwfoBFHPjR5cBZI8+ySwbuyI1MApVxXjPenJdJZRInxQbUDjqWnQHP8dOa75lXhMowjxVg==", - "dependencies": { - "@libp2p/crypto": "2.0.8-0b4a2ee79", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "multiformats": "^12.1.3", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/crypto": { - "version": "2.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8-0b4a2ee79.tgz", - "integrity": "sha512-k6elAUnxMquhQYpCnlLmuU8NpfVU12XU0hFELsgC4TqKkC1PO7EuagngbjHilzyo1wpSAfaYGjAIjlQfjB50iw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.1.3", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-record": { - "version": "6.0.9-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-6.0.9-0b4a2ee79.tgz", - "integrity": "sha512-oZ7a2TidrdmpQuduqdgsZWPQbUPsGN87RTVg2+pgonSnzBtVV5ezHw9KRdhT/qJV4APlBPlRDv3uQU5/oFnqvA==", - "dependencies": { - "@libp2p/crypto": "2.0.8-0b4a2ee79", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "@libp2p/utils": "4.0.7-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "protons-runtime": "^5.0.0", - "uint8-varint": "^2.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-record/node_modules/@libp2p/crypto": { - "version": "2.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8-0b4a2ee79.tgz", - "integrity": "sha512-k6elAUnxMquhQYpCnlLmuU8NpfVU12XU0hFELsgC4TqKkC1PO7EuagngbjHilzyo1wpSAfaYGjAIjlQfjB50iw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.1.3", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-record/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-record/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-store": { - "version": "9.0.9-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-9.0.9-0b4a2ee79.tgz", - "integrity": "sha512-uiUsWo6RdOSgnmplpmcEWnETKp4SXeKAfEcwURgwpEAXsJhPx9UfY9kXMb4xov6ssfHWF8FnTPhlWSrLmCuO4A==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-collections": "4.0.8-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "@libp2p/peer-id-factory": "3.0.8-0b4a2ee79", - "@libp2p/peer-record": "6.0.9-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "interface-datastore": "^8.2.0", - "it-all": "^3.0.2", - "mortice": "^3.0.1", - "multiformats": "^12.1.3", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-store/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-store/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/perf": { - "version": "2.0.1-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/perf/-/perf-2.0.1-0b4a2ee79.tgz", - "integrity": "sha512-B3pDbyEQ6z0yWkh8vkEZE6HbMabS63BH8Gm3kDHCaZm3n40KoFxqwoBL0Iy82nxk0/20Mc3D/bprqzEj2YUlVw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/interface-internal": "0.1.9-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.3" - } - }, - "node_modules/@libp2p/perf/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/tcp": { - "version": "8.0.13-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/tcp/-/tcp-8.0.13-0b4a2ee79.tgz", - "integrity": "sha512-/KuO1ivDV/L4/lLL4gmvq5vXz/xgK2vt9eV8nuwgwOUqWsJEeMkQbdOwKKajrIc0tnk1OFzXb5Kpua2bML++jQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/utils": "4.0.7-0b4a2ee79", - "@multiformats/mafmt": "^12.1.6", - "@multiformats/multiaddr": "^12.1.10", - "@types/sinon": "^17.0.0", - "stream-to-it": "^0.2.2" - } - }, - "node_modules/@libp2p/tcp/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/utils": { - "version": "4.0.7-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-4.0.7-0b4a2ee79.tgz", - "integrity": "sha512-ZHjjlDvG5j+SDtcYNJUhONflbcHNbwdHZsHZlpjwaYyHb74ZvKzd9O5YJTXoAZyJgN2v0cJ814Pc2ObrjrqpTw==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.2", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "@multiformats/multiaddr-matcher": "^1.1.0", - "get-iterator": "^2.0.1", - "is-loopback-addr": "^2.0.1", - "it-pushable": "^3.2.2", - "it-stream-types": "^2.0.1", - "p-queue": "^7.4.1", - "private-ip": "^3.0.1", - "race-signal": "^1.0.1", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/utils/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@multiformats/mafmt": { - "version": "12.1.6", - "resolved": "https://registry.npmjs.org/@multiformats/mafmt/-/mafmt-12.1.6.tgz", - "integrity": "sha512-tlJRfL21X+AKn9b5i5VnaTD6bNttpSpcqwKVmDmSHLwxoz97fAHaepqFOk/l1fIu94nImIXneNbhsJx/RQNIww==", - "dependencies": { - "@multiformats/multiaddr": "^12.0.0" - } - }, - "node_modules/@multiformats/multiaddr": { - "version": "12.1.10", - "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-12.1.10.tgz", - "integrity": "sha512-Bi3nJ/SE17+te40OLxFOpr9CvRodusZZLYZb3e5a0w9RzQcHzfKnnlfqdysLXZ2W5vXgxCUL/Uhndl51Ff2S+Q==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.1", - "@chainsafe/netmask": "^2.0.0", - "@libp2p/interface": "^0.1.1", - "dns-over-http-resolver": "3.0.0", - "multiformats": "^12.0.1", - "uint8-varint": "^2.0.1", - "uint8arrays": "^4.0.2" - } - }, - "node_modules/@multiformats/multiaddr-matcher": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@multiformats/multiaddr-matcher/-/multiaddr-matcher-1.1.0.tgz", - "integrity": "sha512-B/QbKpAxaHYVXFnbTdTgYqPDxmqoF2RYffwYoOv1MWfi2vBCZLdzmEKUBKv6fQr6s+LJFSHn2j2vczmwMFCQIA==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.1", - "@multiformats/multiaddr": "^12.0.0", - "multiformats": "^12.0.1" - } - }, - "node_modules/@noble/ciphers": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.4.0.tgz", - "integrity": "sha512-xaUaUUDWbHIFSxaQ/pIe+33VG2mfJp6N/KxKLmZr5biWdNznCAmfu24QRhX10BbVAuqOahAoyp0S4M9md6GPDw==", - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/curves": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", - "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", - "dependencies": { - "@noble/hashes": "1.3.2" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/hashes": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", - "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@types/sinon": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.2.tgz", - "integrity": "sha512-Zt6heIGsdqERkxctIpvN5Pv3edgBrhoeb3yHyxffd4InN0AX2SVNKSrhdDZKGQICVOxWP/q4DyhpfPNMSrpIiA==", - "dependencies": { - "@types/sinonjs__fake-timers": "*" - } - }, - "node_modules/@types/sinonjs__fake-timers": { - "version": "8.1.5", - "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz", - "integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==" - }, - "node_modules/abortable-iterator": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/abortable-iterator/-/abortable-iterator-5.0.1.tgz", - "integrity": "sha512-hlZ5Z8UwqrKsJcelVPEqDduZowJPBQJ9ZhBC2FXpja3lXy8X6MoI5uMzIgmrA8+3jcVnp8TF/tx+IBBqYJNUrg==", - "dependencies": { - "get-iterator": "^2.0.0", - "it-stream-types": "^2.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/any-signal": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/any-signal/-/any-signal-4.1.1.tgz", - "integrity": "sha512-iADenERppdC+A2YKbOXXB2WUeABLaM6qnpZ70kZbPZ1cZMMJ7eF+3CaYm+/PhBizgkzlvssC7QuHS30oOiQYWA==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/datastore-core": { - "version": "9.2.3", - "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-9.2.3.tgz", - "integrity": "sha512-jcvrVDt+jp7lUp2WhMXXgX/hoi3VcJebN+z/ZXbIRKOVfNOF4bl8cvr7sQ1y9qITikgC2coXFYd79Wzt/n13ZQ==", - "dependencies": { - "@libp2p/logger": "^3.0.0", - "err-code": "^3.0.1", - "interface-store": "^5.0.0", - "it-all": "^3.0.1", - "it-drain": "^3.0.1", - "it-filter": "^3.0.0", - "it-map": "^3.0.1", - "it-merge": "^3.0.1", - "it-pipe": "^3.0.0", - "it-pushable": "^3.0.0", - "it-sort": "^3.0.1", - "it-take": "^3.0.1", - "uint8arrays": "^4.0.2" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/delay": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/delay/-/delay-6.0.0.tgz", - "integrity": "sha512-2NJozoOHQ4NuZuVIr5CWd0iiLVIRSDepakaovIN+9eIDHEhdCAEvSy2cuf1DCrPPQLvHmbqTHODlhHg8UCy4zw==", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/dns-over-http-resolver": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/dns-over-http-resolver/-/dns-over-http-resolver-3.0.0.tgz", - "integrity": "sha512-5+BI+B7n8LKhNaEZBYErr+CBd9t5nYtjunByLhrLGtZ+i3TRgiU8yE87pCjEBu2KOwNsD9ljpSXEbZ4S8xih5g==", - "dependencies": { - "debug": "^4.3.4", - "receptacle": "^1.3.2" - } - }, - "node_modules/err-code": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" - }, - "node_modules/eventemitter3": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" - }, - "node_modules/get-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-2.0.1.tgz", - "integrity": "sha512-7HuY/hebu4gryTDT7O/XY/fvY9wRByEGdK6QOa4of8npTcv0+NS6frFKABcf6S9EBAsveTuKTsZQQBFMMNILIg==" - }, - "node_modules/interface-datastore": { - "version": "8.2.5", - "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-8.2.5.tgz", - "integrity": "sha512-kvLGJMz3RPoJF/g5DbEvfWWempIiSBLVMf63b0PBsziVcSkj0ofzHYI86v8vqpGedkQ81DtPCUKyvX9W7zWvrQ==", - "dependencies": { - "interface-store": "^5.0.0", - "nanoid": "^4.0.0", - "uint8arrays": "^4.0.2" - } - }, - "node_modules/interface-store": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/interface-store/-/interface-store-5.1.4.tgz", - "integrity": "sha512-SI2co5IAxAybBc9egRM2bXvHOa1RPh5SQQkO6di6t/aX92RbtzP4t8raB0l3GTzQmJADaBbzz8Tfa1QLgfMdGQ==" - }, - "node_modules/ip-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-5.0.0.tgz", - "integrity": "sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ipaddr.js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz", - "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==", - "engines": { - "node": ">= 10" - } - }, - "node_modules/is-electron": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.2.2.tgz", - "integrity": "sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg==" - }, - "node_modules/is-loopback-addr": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-2.0.2.tgz", - "integrity": "sha512-26POf2KRCno/KTNL5Q0b/9TYnL00xEsSaLfiFRmjM7m7Lw7ZMmFybzzuX4CcsLAluZGd+niLUiMRxEooVE3aqg==" - }, - "node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/it-all": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-all/-/it-all-3.0.4.tgz", - "integrity": "sha512-UMiy0i9DqCHBdWvMbzdYvVGa5/w4t1cc4nchpbnjdLhklglv8mQeEYnii0gvKESJuL1zV32Cqdb33R6/GPfxpQ==" - }, - "node_modules/it-byte-stream": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/it-byte-stream/-/it-byte-stream-1.0.5.tgz", - "integrity": "sha512-wGHbXPE0ZiU0poJTgCNOW06+mh9yyCwdF8bVv0zxchgql6CMQd/2NEXXtmwWE+N65st8bi/KWUWcMU2pJU2fEw==", - "dependencies": { - "it-stream-types": "^2.0.1", - "p-defer": "^4.0.0", - "race-signal": "^1.0.1", - "uint8arraylist": "^2.4.1" - } - }, - "node_modules/it-drain": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/it-drain/-/it-drain-3.0.5.tgz", - "integrity": "sha512-qYFe4SWdvs9oJGUY5bSjvmiLUMLzFEODNOQUdYdCIkuIgQF+AUB2INhM4yQ09buJ2rhHKDFxvTD/+yUq6qg0XA==" - }, - "node_modules/it-filter": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-filter/-/it-filter-3.0.4.tgz", - "integrity": "sha512-e0sz+st4sudK/zH6GZ/gRTRP8A/ADuJFCYDmRgMbZvR79y5+v4ZXav850bBZk5wL9zXaYZFxS1v/6Qi+Vjwh5g==", - "dependencies": { - "it-peekable": "^3.0.0" - } - }, - "node_modules/it-first": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-first/-/it-first-3.0.4.tgz", - "integrity": "sha512-FtQl84iTNxN5EItP/JgL28V2rzNMkCzTUlNoj41eVdfix2z1DBuLnBqZ0hzYhGGa1rMpbQf0M7CQSA2adlrLJg==" - }, - "node_modules/it-foreach": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/it-foreach/-/it-foreach-2.0.6.tgz", - "integrity": "sha512-OVosBHJsdXpAyeFlCbe3IGZia+65UykyAznakNsKXK+b99dbhuu/mOnXxTadDEo1GWhKx+WA8RNanKkMf07zQw==", - "dependencies": { - "it-peekable": "^3.0.0" - } - }, - "node_modules/it-length-prefixed": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-9.0.3.tgz", - "integrity": "sha512-YAu424ceYpXctxtjcLOqn7vJq082CaoP8J646ZusYISfQc3bpzQErgTUqMFj81V262KG2W9/YMBHsy6A/4yvmg==", - "dependencies": { - "err-code": "^3.0.1", - "it-reader": "^6.0.1", - "it-stream-types": "^2.0.1", - "uint8-varint": "^2.0.1", - "uint8arraylist": "^2.0.0", - "uint8arrays": "^4.0.2" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-length-prefixed-stream": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/it-length-prefixed-stream/-/it-length-prefixed-stream-1.1.4.tgz", - "integrity": "sha512-6YcQ5jsaYnuXBqF+oSGjSdSY9jF7HWl7yh+dxYytXxbE2GcdiOpn6pLM7m6AlIID9MCzQqMY5nOzaiatQ8A3/A==", - "dependencies": { - "it-byte-stream": "^1.0.0", - "it-length-prefixed": "^9.0.1", - "it-stream-types": "^2.0.1", - "uint8-varint": "^2.0.1", - "uint8arraylist": "^2.4.1" - } - }, - "node_modules/it-map": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/it-map/-/it-map-3.0.5.tgz", - "integrity": "sha512-hB0TDXo/h4KSJJDSRLgAPmDroiXP6Fx1ck4Bzl3US9hHfZweTKsuiP0y4gXuTMcJlS6vj0bb+f70rhkD47ZA3w==", - "dependencies": { - "it-peekable": "^3.0.0" - } - }, - "node_modules/it-merge": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/it-merge/-/it-merge-3.0.3.tgz", - "integrity": "sha512-FYVU15KC5pb/GQX1Ims+lee8d4pdqGVCpWr0lkNj8o4xuNo7jY71k6GuEiWdP+T7W1bJqewSxX5yoTy5yZpRVA==", - "dependencies": { - "it-pushable": "^3.2.0" - } - }, - "node_modules/it-pair": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/it-pair/-/it-pair-2.0.6.tgz", - "integrity": "sha512-5M0t5RAcYEQYNG5BV7d7cqbdwbCAp5yLdzvkxsZmkuZsLbTdZzah6MQySYfaAQjNDCq6PUnDt0hqBZ4NwMfW6g==", - "dependencies": { - "it-stream-types": "^2.0.1", - "p-defer": "^4.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-peekable": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/it-peekable/-/it-peekable-3.0.3.tgz", - "integrity": "sha512-Wx21JX/rMzTEl9flx3DGHuPV1KQFGOl8uoKfQtmZHgPQtGb89eQ6RyVd82h3HuP9Ghpt0WgBDlmmdWeHXqyx7w==" - }, - "node_modules/it-pipe": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/it-pipe/-/it-pipe-3.0.1.tgz", - "integrity": "sha512-sIoNrQl1qSRg2seYSBH/3QxWhJFn9PKYvOf/bHdtCBF0bnghey44VyASsWzn5dAx0DCDDABq1hZIuzKmtBZmKA==", - "dependencies": { - "it-merge": "^3.0.0", - "it-pushable": "^3.1.2", - "it-stream-types": "^2.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-pushable": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-3.2.3.tgz", - "integrity": "sha512-gzYnXYK8Y5t5b/BnJUr7glfQLO4U5vyb05gPx/TyTw+4Bv1zM9gFk4YsOrnulWefMewlphCjKkakFvj1y99Tcg==", - "dependencies": { - "p-defer": "^4.0.0" - } - }, - "node_modules/it-reader": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/it-reader/-/it-reader-6.0.4.tgz", - "integrity": "sha512-XCWifEcNFFjjBHtor4Sfaj8rcpt+FkY0L6WdhD578SCDhV4VUm7fCkF3dv5a+fTcfQqvN9BsxBTvWbYO6iCjTg==", - "dependencies": { - "it-stream-types": "^2.0.1", - "uint8arraylist": "^2.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-sort": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-sort/-/it-sort-3.0.4.tgz", - "integrity": "sha512-tvnC93JZZWjX4UxALy0asow0dzXabkoaRbrPJKClTKhNCqw4gzHr+H5axf1gohcthedRRkqd/ae+wl7WqoxFhw==", - "dependencies": { - "it-all": "^3.0.0" - } - }, - "node_modules/it-stream-types": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/it-stream-types/-/it-stream-types-2.0.1.tgz", - "integrity": "sha512-6DmOs5r7ERDbvS4q8yLKENcj6Yecr7QQTqWApbZdfAUTEC947d+PEha7PCqhm//9oxaLYL7TWRekwhoXl2s6fg==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-take": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-take/-/it-take-3.0.4.tgz", - "integrity": "sha512-RG8HDjAZlvkzz5Nav4xq6gK5zNT+Ff1UTIf+CrSJW8nIl6N1FpBH5e7clUshiCn+MmmMoSdIEpw4UaTolszxhA==" - }, - "node_modules/libp2p": { - "version": "0.46.21-0b4a2ee79", - "resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.46.21-0b4a2ee79.tgz", - "integrity": "sha512-WLThU38PZfc2nYzKCZdVgsuWALtkWavwSXQy4pNhSf8fAzbRTjRdY1EqR/O3G2tI6CybdHVj1dCxMnvvM/YXuA==", - "dependencies": { - "@libp2p/crypto": "2.0.8-0b4a2ee79", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/interface-internal": "0.1.9-0b4a2ee79", - "@libp2p/logger": "3.1.0-0b4a2ee79", - "@libp2p/multistream-select": "4.0.6-0b4a2ee79", - "@libp2p/peer-collections": "4.0.8-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "@libp2p/peer-id-factory": "3.0.8-0b4a2ee79", - "@libp2p/peer-store": "9.0.9-0b4a2ee79", - "@libp2p/utils": "4.0.7-0b4a2ee79", - "@multiformats/mafmt": "^12.1.6", - "@multiformats/multiaddr": "^12.1.10", - "@multiformats/multiaddr-matcher": "^1.1.0", - "any-signal": "^4.1.1", - "datastore-core": "^9.0.1", - "delay": "^6.0.0", - "interface-datastore": "^8.2.0", - "it-all": "^3.0.2", - "it-drain": "^3.0.2", - "it-filter": "^3.0.1", - "it-first": "^3.0.3", - "it-map": "^3.0.4", - "it-merge": "^3.0.0", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "merge-options": "^3.0.4", - "multiformats": "^12.1.3", - "p-defer": "^4.0.0", - "p-queue": "^7.4.1", - "private-ip": "^3.0.1", - "rate-limiter-flexible": "^3.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/libp2p/node_modules/@libp2p/crypto": { - "version": "2.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8-0b4a2ee79.tgz", - "integrity": "sha512-k6elAUnxMquhQYpCnlLmuU8NpfVU12XU0hFELsgC4TqKkC1PO7EuagngbjHilzyo1wpSAfaYGjAIjlQfjB50iw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.1.3", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/libp2p/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/libp2p/node_modules/@libp2p/logger": { - "version": "3.1.0-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-3.1.0-0b4a2ee79.tgz", - "integrity": "sha512-haeXJplYP29dYTkwLlGI/dc7nQuRTbRte7GeMcNwrmCeODM3uo3D0O7+qS6RulmRDbvWqs3muCxZyRFSU4oB+A==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "debug": "^4.3.4", - "interface-datastore": "^8.2.0", - "multiformats": "^12.1.3" - } - }, - "node_modules/libp2p/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/merge-options": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", - "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", - "dependencies": { - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mortice": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mortice/-/mortice-3.0.1.tgz", - "integrity": "sha512-eyDUsl1nCR9+JtNksKnaESLP9MgAXCA4w1LTtsmOSQNsThnv++f36rrBu5fC/fdGIwTJZmbiaR/QewptH93pYA==", - "dependencies": { - "nanoid": "^4.0.0", - "observable-webworkers": "^2.0.1", - "p-queue": "^7.2.0", - "p-timeout": "^6.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/multiformats": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.3.tgz", - "integrity": "sha512-eajQ/ZH7qXZQR2AgtfpmSMizQzmyYVmCql7pdhldPuYQi4atACekbJaQplk6dWyIi10jCaFnd6pqvcEFXjbaJw==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/nanoid": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.2.tgz", - "integrity": "sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.js" - }, - "engines": { - "node": "^14 || ^16 || >=18" - } - }, - "node_modules/netmask": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", - "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/node-forge": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", - "engines": { - "node": ">= 6.13.0" - } - }, - "node_modules/observable-webworkers": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/observable-webworkers/-/observable-webworkers-2.0.1.tgz", - "integrity": "sha512-JI1vB0u3pZjoQKOK1ROWzp0ygxSi7Yb0iR+7UNsw4/Zn4cQ0P3R7XL38zac/Dy2tEA7Lg88/wIJTjF8vYXZ0uw==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/p-defer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-4.0.0.tgz", - "integrity": "sha512-Vb3QRvQ0Y5XnF40ZUWW7JfLogicVh/EnA5gBIvKDJoYpeI82+1E3AlB9yOcKFS0AhHrWVnAQO39fbR0G99IVEQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-queue": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.4.1.tgz", - "integrity": "sha512-vRpMXmIkYF2/1hLBKisKeVYJZ8S2tZ0zEAmIJgdVKP2nq0nh4qCdf8bgw+ZgKrkh71AOCaqzwbJJk1WtdcF3VA==", - "dependencies": { - "eventemitter3": "^5.0.1", - "p-timeout": "^5.0.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-queue/node_modules/p-timeout": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", - "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-timeout": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", - "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/private-ip": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/private-ip/-/private-ip-3.0.1.tgz", - "integrity": "sha512-Ezc16ANuhSHmWAE6lbXUKburNzGpR0J5X0Zh5Um/PZ/s57Fp+HYqYe6BYPH2QbqKr/5WebfzJQ1jq6Kj5dbRmA==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.1", - "ip-regex": "^5.0.0", - "ipaddr.js": "^2.1.0", - "netmask": "^2.0.2" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/protons-runtime": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-5.2.0.tgz", - "integrity": "sha512-jL3VSbXllgm17zurKQ/z+Ath0w+4BknJ+l/NLocfjAB8hbeASOZTNtb7zK3nDsKq2pHK9YFumNQvpkZ6gFfWhA==", - "dependencies": { - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/race-signal": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/race-signal/-/race-signal-1.0.2.tgz", - "integrity": "sha512-o3xNv0iTcIDQCXFlF6fPAMEBRjFxssgGoRqLbg06m+AdzEXXLUmoNOoUHTVz2NoBI8hHwKFKoC6IqyNtWr2bww==" - }, - "node_modules/rate-limiter-flexible": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/rate-limiter-flexible/-/rate-limiter-flexible-3.0.4.tgz", - "integrity": "sha512-LFrdT9Pl/TRxG143frHBPyESXHvS2tstLfAUM6shBbJ3M6YssT2cIUWFwAWVAU9Vl4Z2gUN7ZE7tSdQh/0aqcA==" - }, - "node_modules/receptacle": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/receptacle/-/receptacle-1.3.2.tgz", - "integrity": "sha512-HrsFvqZZheusncQRiEE7GatOAETrARKV/lnfYicIm8lbvp/JQOdADOfhjBd2DajvoszEyxSM6RlAAIZgEoeu/A==", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/stream-to-it": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/stream-to-it/-/stream-to-it-0.2.4.tgz", - "integrity": "sha512-4vEbkSs83OahpmBybNJXlJd7d6/RxzkkSdT3I0mnGt79Xd2Kk+e1JqbvAvsQfCeKj3aKb0QIWkyK3/n0j506vQ==", - "dependencies": { - "get-iterator": "^1.0.2" - } - }, - "node_modules/stream-to-it/node_modules/get-iterator": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-1.0.2.tgz", - "integrity": "sha512-v+dm9bNVfOYsY1OrhaCrmyOcYoSeVvbt+hHZ0Au+T+p1y+0Uyj9aMaGIeUTT6xdpRbWzDeYKvfOslPhggQMcsg==" - }, - "node_modules/uint8-varint": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/uint8-varint/-/uint8-varint-2.0.2.tgz", - "integrity": "sha512-LZXmBT0jiHR7J4oKM1GUhtdLFW1yPauzI8NjJlotXn92TprO9u8VMvEVR4QMk8xhUVUd+2fqfU2/kGbVHYSSWw==", - "dependencies": { - "uint8arraylist": "^2.0.0", - "uint8arrays": "^4.0.2" - } - }, - "node_modules/uint8arraylist": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-2.4.3.tgz", - "integrity": "sha512-oEVZr4/GrH87K0kjNce6z8pSCzLEPqHNLNR5sj8cJOySrTP8Vb/pMIbZKLJGhQKxm1TiZ31atNrpn820Pyqpow==", - "dependencies": { - "uint8arrays": "^4.0.2" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/uint8arrays": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.6.tgz", - "integrity": "sha512-4ZesjQhqOU2Ip6GPReIwN60wRxIupavL8T0Iy36BBHr2qyMrNxsPJvr7vpS4eFt8F8kSguWUPad6ZM9izs/vyw==", - "dependencies": { - "multiformats": "^12.0.1" - } - }, - "node_modules/wherearewe": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/wherearewe/-/wherearewe-2.0.1.tgz", - "integrity": "sha512-XUguZbDxCA2wBn2LoFtcEhXL6AXo+hVjGonwhSTTTU9SzbWG8Xu3onNIpzf9j/mYUcJQ0f+m37SzG77G851uFw==", - "dependencies": { - "is-electron": "^2.2.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/package.json deleted file mode 100644 index dc78f0d62..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "@libp2p/perf-js-libp2p-1-0", - "private": true, - "main": "index.js", - "type": "module", - "dependencies": { - "@chainsafe/libp2p-noise": "^13.0.3", - "@chainsafe/libp2p-yamux": "^5.0.3", - "@libp2p/perf": "next", - "@libp2p/tcp": "next", - "libp2p": "next" - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/perf b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/perf deleted file mode 100755 index 1a3e19c51..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/perf +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# In case this script is `kill`ed, `kill` its child process, namely the `node` -# process below. -cleanup() { - kill $node_pid -} -trap cleanup EXIT TERM - -# Find the path to the Node.js executable -node_path=$(which node) - -run_server=false -server_address="" -upload_bytes=0 -download_bytes=0 -transport="" - -# Parse named parameters manually -for ((i = 1; i <= $#; i++)); do - if [ "${!i}" == "--server-address" ]; then - server_address="${@:i+1:1}" - fi - if [ "${!i}" == "--upload-bytes" ]; then - upload_bytes="${@:i+1:1}" - fi - if [ "${!i}" == "--download-bytes" ]; then - download_bytes="${@:i+1:1}" - fi - if [ "${!i}" == "--transport" ]; then - transport="${@:i+1:1}" - fi - if [ "${!i}" == "--run-server" ]; then - run_server=true - fi -done - -# Run perf -node $(dirname "$0")/index.js --run-server=$run_server --server-address=$server_address --upload-bytes=$upload_bytes --download-bytes=$download_bytes --transport=$transport & - -node_pid=$! - -# Wait for `node_pid` to finish, or for it to be `kill`ed by the above -# `cleanup`. -wait $node_pid diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/index.min.js deleted file mode 100644 index 4e7453106..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/index.min.js +++ /dev/null @@ -1,3 +0,0 @@ -(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PTcp = factory()}(typeof self !== 'undefined' ? self : this, function () { -"use strict";var Libp2PTcp=(()=>{var Or=Object.create;var bt=Object.defineProperty;var Lr=Object.getOwnPropertyDescriptor;var Vr=Object.getOwnPropertyNames;var Fr=Object.getPrototypeOf,$r=Object.prototype.hasOwnProperty;var Y=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var Z=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),R=(r,t)=>{for(var e in t)bt(r,e,{get:t[e],enumerable:!0})},Ne=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vr(t))!$r.call(r,o)&&o!==e&&bt(r,o,{get:()=>t[o],enumerable:!(n=Lr(t,o))||n.enumerable});return r};var tt=(r,t,e)=>(e=r!=null?Or(Fr(r)):{},Ne(t||!r||!r.__esModule?bt(e,"default",{value:r,enumerable:!0}):e,r)),zr=r=>Ne(bt({},"__esModule",{value:!0}),r);var Dt=Z((Sc,Ir)=>{Ir.exports=r=>{if(r[Symbol.asyncIterator])return r;if(r.getReader)return async function*(){let t=r.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)return;yield n}}finally{t.releaseLock()}}();throw new Error("unknown stream")}});var Sr=Z((Tc,Cr)=>{Cr.exports=function(t){if(t){if(typeof t[Symbol.iterator]=="function")return t[Symbol.iterator]();if(typeof t[Symbol.asyncIterator]=="function")return t[Symbol.asyncIterator]();if(typeof t.next=="function")return t}throw new Error("argument is not an iterator or iterable")}});var Ae=Z((Pc,Tr)=>{var Mo=Sr();Tr.exports=r=>async t=>{t=Mo(t);let e=w=>{typeof w.return=="function"&&w.return()},n=null,o=null,s=w=>{n=w,o&&o(w),e(t)},i=null,a=!1,p=()=>{a=!0,i&&i()},f=null,m=!1,v=()=>{m=!0,f&&f()},x=null,u=()=>{x&&x()},d=()=>new Promise((w,S)=>{i=x=w,o=S,r.once("drain",u)}),E=()=>(e(t),new Promise((w,S)=>{if(a||m||n)return w();f=i=w,o=S})),N=()=>{r.removeListener("error",s),r.removeListener("close",p),r.removeListener("finish",v),r.removeListener("drain",u)};r.once("error",s),r.once("close",p),r.once("finish",v);try{for await(let w of t){if(!r.writable||r.destroyed||n)break;r.write(w)===!1&&await d()}}catch(w){n||r.destroy(),n=w}try{if(r.writable&&r.end(),await E(),n)throw n}finally{N()}}});var Ie=Z((Rc,Pr)=>{var Uo=Ae(),_o=Dt();Pr.exports=r=>({sink:Uo(r),source:_o(r)})});var Nr=Z((Nc,Rr)=>{var ko=Ie();Rr.exports=r=>async function*(t){let e=ko(r),n;if(e.sink(t).catch(o=>{n=o}),yield*e.source,n)throw n}});var Dr=Z((Dc,pt)=>{pt.exports=Dt();pt.exports.source=Dt();pt.exports.sink=Ae();pt.exports.transform=Nr();pt.exports.duplex=Ie()});var Go={};R(Go,{tcp:()=>jo});var kr=tt(Y("net"),1);var et=class r extends Error{code;type;constructor(t="The operation was aborted"){super(t),this.code=r.code,this.type=r.type}static code="ABORT_ERR";static type="aborted"},I=class extends Error{code;props;constructor(t,e,n){super(t),this.code=e,this.name=n?.name??"CodeError",this.props=n??{}}};var Me=Symbol.for("@libp2p/transport");var De;(function(r){r[r.FATAL_ALL=0]="FATAL_ALL",r[r.NO_FATAL=1]="NO_FATAL"})(De||(De={}));var Vt={};R(Vt,{base58btc:()=>T,base58flickr:()=>Xr});function Br(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n>>0,D=new Uint8Array(k);w!==S;){for(var O=d[w],B=0,_=k-1;(O!==0||B>>0,D[_]=O%a>>>0,O=O/a>>>0;if(O!==0)throw new Error("Non-zero carry");N=B,w++}for(var V=k-N;V!==k&&D[V]===0;)V++;for(var xt=p.repeat(E);V>>0,k=new Uint8Array(S);d[E];){var D=e[d.charCodeAt(E)];if(D===255)return;for(var O=0,B=S-1;(D!==0||O>>0,k[B]=D%256>>>0,D=D/256>>>0;if(D!==0)throw new Error("Non-zero carry");w=O,E++}if(d[E]!==" "){for(var _=S-w;_!==S&&k[_]===0;)_++;for(var V=new Uint8Array(N+(S-_)),xt=N;_!==S;)V[xt++]=k[_++];return V}}}function u(d){var E=x(d);if(E)return E;throw new Error(`Non-${t} character`)}return{encode:v,decodeUnsafe:x,decode:u}}var qr=Br,jr=qr,Ue=jr;var Qo=new Uint8Array(0);var _e=(r,t)=>{if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var ke=r=>new TextEncoder().encode(r),Oe=r=>new TextDecoder().decode(r);var _t=class{constructor(t,e,n){this.name=t,this.prefix=e,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},kt=class{constructor(t,e,n){if(this.name=t,this.prefix=e,e.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Ve(this,t)}},Ot=class{constructor(t){this.decoders=t}or(t){return Ve(this,t)}decode(t){let e=t[0],n=this.decoders[e];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Ve=(r,t)=>new Ot({...r.decoders||{[r.prefix]:r},...t.decoders||{[t.prefix]:t}}),Lt=class{constructor(t,e,n,o){this.name=t,this.prefix=e,this.baseEncode=n,this.baseDecode=o,this.encoder=new _t(t,e,n),this.decoder=new kt(t,e,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},rt=({name:r,prefix:t,encode:e,decode:n})=>new Lt(r,t,e,n),q=({prefix:r,name:t,alphabet:e})=>{let{encode:n,decode:o}=Ue(e,t);return rt({prefix:r,name:t,encode:n,decode:s=>M(o(s))})},Gr=(r,t,e,n)=>{let o={};for(let m=0;m=8&&(a-=8,i[f++]=255&p>>a)}if(a>=e||255&p<<8-a)throw new SyntaxError("Unexpected end of data");return i},Wr=(r,t,e)=>{let n=t[t.length-1]==="=",o=(1<e;)i-=e,s+=t[o&a>>i];if(i&&(s+=t[o&a<rt({prefix:t,name:r,encode(o){return Wr(o,n,e)},decode(o){return Gr(o,n,e,r)}});var T=q({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Xr=q({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Ft={};R(Ft,{base32:()=>F,base32hex:()=>Kr,base32hexpad:()=>Zr,base32hexpadupper:()=>tn,base32hexupper:()=>Yr,base32pad:()=>Jr,base32padupper:()=>Qr,base32upper:()=>Hr,base32z:()=>en});var F=b({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Hr=b({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Jr=b({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Qr=b({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Kr=b({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Yr=b({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Zr=b({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),tn=b({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),en=b({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var rn=ze,Fe=128,nn=127,on=~nn,sn=Math.pow(2,31);function ze(r,t,e){t=t||[],e=e||0;for(var n=e;r>=sn;)t[e++]=r&255|Fe,r/=128;for(;r&on;)t[e++]=r&255|Fe,r>>>=7;return t[e]=r|0,ze.bytes=e-n+1,t}var cn=$t,an=128,$e=127;function $t(r,n){var e=0,n=n||0,o=0,s=n,i,a=r.length;do{if(s>=a)throw $t.bytes=0,new RangeError("Could not decode varint");i=r[s++],e+=o<28?(i&$e)<=an);return $t.bytes=s-n,e}var ln=Math.pow(2,7),dn=Math.pow(2,14),un=Math.pow(2,21),pn=Math.pow(2,28),fn=Math.pow(2,35),hn=Math.pow(2,42),mn=Math.pow(2,49),gn=Math.pow(2,56),wn=Math.pow(2,63),xn=function(r){return r[ht.decode(r,t),ht.decode.bytes],nt=(r,t,e=0)=>(ht.encode(r,t,e),t),ot=r=>ht.encodingLength(r);var X=(r,t)=>{let e=t.byteLength,n=ot(r),o=n+ot(e),s=new Uint8Array(o+e);return nt(r,s,0),nt(e,s,n),s.set(t,o),new st(r,e,t,s)},vt=r=>{let t=M(r),[e,n]=mt(t),[o,s]=mt(t.subarray(n)),i=t.subarray(n+s);if(i.byteLength!==o)throw new Error("Incorrect length");return new st(e,o,i,t)},Be=(r,t)=>{if(r===t)return!0;{let e=t;return r.code===e.code&&r.size===e.size&&e.bytes instanceof Uint8Array&&_e(r.bytes,e.bytes)}},st=class{constructor(t,e,n,o){this.code=t,this.size=e,this.digest=n,this.bytes=o}};var qe=(r,t)=>{let{bytes:e,version:n}=r;switch(n){case 0:return En(e,zt(r),t||T.encoder);default:return An(e,zt(r),t||F.encoder)}};var je=new WeakMap,zt=r=>{let t=je.get(r);if(t==null){let e=new Map;return je.set(r,e),e}return t},j=class r{constructor(t,e,n,o){this.code=e,this.version=t,this.multihash=n,this.bytes=o,this["/"]=o}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:e}=this;if(t!==gt)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==In)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(e)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:e}=this.multihash,n=X(t,e);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return r.equals(this,t)}static equals(t,e){let n=e;return n&&t.code===n.code&&t.version===n.version&&Be(t.multihash,n.multihash)}toString(t){return qe(this,t)}toJSON(){return{"/":qe(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let e=t;if(e instanceof r)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){let{version:n,code:o,multihash:s,bytes:i}=e;return new r(n,o,s,i||Ge(n,o,s.bytes))}else if(e[Cn]===!0){let{version:n,multihash:o,code:s}=e,i=vt(o);return r.create(n,s,i)}else return null}static create(t,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(e!==gt)throw new Error(`Version 0 CID must use dag-pb (code: ${gt}) block encoding`);return new r(t,e,n,n.bytes)}case 1:{let o=Ge(t,e,n.bytes);return new r(t,e,n,o)}default:throw new Error("Invalid version")}}static createV0(t){return r.create(0,gt,t)}static createV1(t,e){return r.create(1,t,e)}static decode(t){let[e,n]=r.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return e}static decodeFirst(t){let e=r.inspectBytes(t),n=e.size-e.multihashSize,o=M(t.subarray(n,n+e.multihashSize));if(o.byteLength!==e.multihashSize)throw new Error("Incorrect length");let s=o.subarray(e.multihashSize-e.digestSize),i=new st(e.multihashCode,e.digestSize,s,o);return[e.version===0?r.createV0(i):r.createV1(e.codec,i),t.subarray(e.size)]}static inspectBytes(t){let e=0,n=()=>{let[v,x]=mt(t.subarray(e));return e+=x,v},o=n(),s=gt;if(o===18?(o=0,e=0):s=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let i=e,a=n(),p=n(),f=e+p,m=f-i;return{version:o,codec:s,multihashCode:a,digestSize:p,multihashSize:m,size:f}}static parse(t,e){let[n,o]=vn(t,e),s=r.decode(o);if(s.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return zt(s).set(n,t),s}},vn=(r,t)=>{switch(r[0]){case"Q":{let e=t||T;return[T.prefix,e.decode(`${T.prefix}${r}`)]}case T.prefix:{let e=t||T;return[T.prefix,e.decode(r)]}case F.prefix:{let e=t||F;return[F.prefix,e.decode(r)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],t.decode(r)]}}},En=(r,t,e)=>{let{prefix:n}=e;if(n!==T.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let o=t.get(n);if(o==null){let s=e.encode(r).slice(1);return t.set(n,s),s}else return o},An=(r,t,e)=>{let{prefix:n}=e,o=t.get(n);if(o==null){let s=e.encode(r);return t.set(n,s),s}else return o},gt=112,In=18,Ge=(r,t,e)=>{let n=ot(r),o=n+ot(t),s=new Uint8Array(o+e.byteLength);return nt(r,s,0),nt(t,s,n),s.set(e,o),s},Cn=Symbol.for("@ipld/js-cid/CID");function We(r,t){if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;eSn});var Sn=q({prefix:"9",name:"base10",alphabet:"0123456789"});var qt={};R(qt,{base16:()=>Tn,base16upper:()=>Pn});var Tn=b({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Pn=b({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var jt={};R(jt,{base2:()=>Rn});var Rn=b({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Gt={};R(Gt,{base256emoji:()=>_n});var Xe=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Nn=Xe.reduce((r,t,e)=>(r[e]=t,r),[]),Dn=Xe.reduce((r,t,e)=>(r[t.codePointAt(0)]=e,r),[]);function Mn(r){return r.reduce((t,e)=>(t+=Nn[e],t),"")}function Un(r){let t=[];for(let e of r){let n=Dn[e.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${e}`);t.push(n)}return new Uint8Array(t)}var _n=rt({prefix:"\u{1F680}",name:"base256emoji",encode:Mn,decode:Un});var Wt={};R(Wt,{base36:()=>kn,base36upper:()=>On});var kn=q({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),On=q({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Xt={};R(Xt,{base64:()=>Ln,base64pad:()=>Vn,base64url:()=>Fn,base64urlpad:()=>$n});var Ln=b({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Vn=b({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Fn=b({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),$n=b({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Ht={};R(Ht,{base8:()=>zn});var zn=b({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Jt={};R(Jt,{identity:()=>Bn});var Bn=rt({prefix:"\0",name:"identity",encode:r=>Oe(r),decode:r=>ke(r)});var ys=new TextEncoder,vs=new TextDecoder;var Qt={};R(Qt,{identity:()=>Xn});var He=0,Gn="identity",Je=M,Wn=r=>X(He,Je(r)),Xn={code:He,name:Gn,encode:Je,digest:Wn};var te={};R(te,{sha256:()=>Hn,sha512:()=>Jn});var Zt=tt(Y("crypto"),1);var Yt=({name:r,code:t,encode:e})=>new Kt(r,t,e),Kt=class{constructor(t,e,n){this.name=t,this.code=e,this.encode=n}digest(t){if(t instanceof Uint8Array){let e=this.encode(t);return e instanceof Uint8Array?X(this.code,e):e.then(n=>X(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Hn=Yt({name:"sha2-256",code:18,encode:r=>M(Zt.default.createHash("sha256").update(r).digest())}),Jn=Yt({name:"sha2-512",code:19,encode:r=>M(Zt.default.createHash("sha512").update(r).digest())});var wt={...Jt,...jt,...Ht,...Bt,...qt,...Ft,...Wt,...Vt,...Xt,...Gt},Ns={...te,...Qt};function ct(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function at(r=0){return globalThis.Buffer?.allocUnsafe!=null?ct(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function Ye(r,t,e,n){return{name:r,prefix:t,encoder:{name:r,prefix:t,encode:e},decoder:{decode:n}}}var Ke=Ye("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),ee=Ye("ascii","a",r=>{let t="a";for(let e=0;e{r=r.substring(1);let t=at(r.length);for(let e=0;eNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function to(r,t,e=0){switch(L(r)){case 8:t[e++]=r&255|h,r/=128;case 7:t[e++]=r&255|h,r/=128;case 6:t[e++]=r&255|h,r/=128;case 5:t[e++]=r&255|h,r/=128;case 4:t[e++]=r&255|h,r>>>=7;case 3:t[e++]=r&255|h,r>>>=7;case 2:t[e++]=r&255|h,r>>>=7;case 1:{t[e++]=r&255,r>>>=7;break}default:throw new Error("unreachable")}return t}function eo(r,t,e=0){switch(L(r)){case 8:t.set(e++,r&255|h),r/=128;case 7:t.set(e++,r&255|h),r/=128;case 6:t.set(e++,r&255|h),r/=128;case 5:t.set(e++,r&255|h),r/=128;case 4:t.set(e++,r&255|h),r>>>=7;case 3:t.set(e++,r&255|h),r>>>=7;case 2:t.set(e++,r&255|h),r>>>=7;case 1:{t.set(e++,r&255),r>>>=7;break}default:throw new Error("unreachable")}return t}function ro(r,t){let e=r[t],n=0;if(n+=e&C,eo+s.length,0));let e=at(t),n=0;for(let o of r)e.set(o,n),n+=o.length;return ct(e)}var At=class{index=0;input="";new(t){return this.index=0,this.input=t,this}readAtomically(t){let e=this.index,n=t();return n===void 0&&(this.index=e),n}parseWith(t){let e=t();if(this.index===this.input.length)return e}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(t){return this.readAtomically(()=>{let e=this.readChar();if(e===t)return e})}readSeparator(t,e,n){return this.readAtomically(()=>{if(!(e>0&&this.readGivenChar(t)===void 0))return n()})}readNumber(t,e,n,o){return this.readAtomically(()=>{let s=0,i=0,a=this.peekChar();if(a===void 0)return;let p=a==="0",f=2**(8*o)-1;for(;;){let m=this.readAtomically(()=>{let v=this.readChar();if(v===void 0)return;let x=Number.parseInt(v,t);if(!Number.isNaN(x))return x});if(m===void 0)break;if(s*=t,s+=m,s>f||(i+=1,e!==void 0&&i>e))return}if(i!==0)return!n&&p&&i>1?void 0:s})}readIPv4Addr(){return this.readAtomically(()=>{let t=new Uint8Array(4);for(let e=0;ethis.readNumber(10,3,!1,1));if(n===void 0)return;t[e]=n}return t})}readIPv6Addr(){let t=e=>{for(let n=0;nthis.readIPv4Addr());if(i!==void 0)return e[o]=i[0],e[o+1]=i[1],e[o+2]=i[2],e[o+3]=i[3],[o+4,!0]}let s=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(s===void 0)return[o,!1];e[o]=s>>8,e[o+1]=s&255}return[e.length,!1]};return this.readAtomically(()=>{let e=new Uint8Array(16),[n,o]=t(e);if(n===16)return e;if(o||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let s=new Uint8Array(14),i=16-(n+2),[a]=t(s.subarray(0,i));return e.set(s.subarray(0,a),16-a),e})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var Ws=new At;var ti=parseInt("0xFFFF",16),ei=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function ie(r,t="utf8"){let e=Et[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?ct(globalThis.Buffer.from(r,"utf-8")):e.decoder.decode(`${e.prefix}${r}`)}var U=Y("node:net");function It(r){return!!(0,U.isIP)(r)}var rr=U.isIPv4,lo=U.isIPv6,ce=function(r){let t=0;if(r=r.toString().trim(),rr(r)){let e=new Uint8Array(t+4);return r.split(/\./g).forEach(n=>{e[t++]=parseInt(n,10)&255}),e}if(lo(r)){let e=r.split(":",8),n;for(n=0;n0;n--)s.push("0");e.splice.apply(e,s)}let o=new Uint8Array(t+16);for(n=0;n>8&255,o[t++]=s&255}return o}throw new Error("invalid ip address")},nr=function(r,t=0,e){t=~~t,e=e??r.length-t;let n=new DataView(r.buffer);if(e===4){let o=[];for(let s=0;s{let t=fo(...r);ae[t.code]=t,dt[t.name]=t});function fo(r,t,e,n,o){return{code:r,size:t,name:e,resolvable:!!n,path:!!o}}function g(r){if(typeof r=="number"){if(ae[r]!=null)return ae[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(dt[r]!=null)return dt[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var Bi=g("ip4"),qi=g("ip6"),ji=g("ipcidr");function de(r,t){switch(g(r).code){case 4:case 41:return mo(t);case 42:return ir(t);case 6:case 273:case 33:case 132:return ar(t).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return ir(t);case 421:return bo(t);case 444:return cr(t);case 445:return cr(t);case 466:return xo(t);default:return P(t,"base16")}}function ue(r,t){switch(g(r).code){case 4:return or(t);case 41:return or(t);case 42:return sr(t);case 6:case 273:case 33:case 132:return pe(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return sr(t);case 421:return go(t);case 444:return yo(t);case 445:return vo(t);case 466:return wo(t);default:return ie(t,"base16")}}var le=Object.values(wt).map(r=>r.decoder),ho=function(){let r=le[0].or(le[1]);return le.slice(2).forEach(t=>r=r.or(t)),r}();function or(r){if(!It(r))throw new Error("invalid ip address");return ce(r)}function mo(r){let t=nr(r,0,r.length);if(t==null)throw new Error("ipBuff is required");if(!It(t))throw new Error("invalid ip address");return t}function pe(r){let t=new ArrayBuffer(2);return new DataView(t).setUint16(0,r),new Uint8Array(t)}function ar(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function sr(r){let t=ie(r),e=Uint8Array.from(lt(t.length));return $([e,t],e.length+t.length)}function ir(r){let t=H(r);if(r=r.slice(L(t)),r.length!==t)throw new Error("inconsistent lengths");return P(r)}function go(r){let t;r[0]==="Q"||r[0]==="1"?t=vt(T.decode(`z${r}`)).bytes:t=j.parse(r).multihash.bytes;let e=Uint8Array.from(lt(t.length));return $([e,t],e.length+t.length)}function wo(r){let t=ho.decode(r),e=Uint8Array.from(lt(t.length));return $([e,t],e.length+t.length)}function xo(r){let t=H(r),e=r.slice(L(t));if(e.length!==t)throw new Error("inconsistent lengths");return"u"+P(e,"base64url")}function bo(r){let t=H(r),e=r.slice(L(t));if(e.length!==t)throw new Error("inconsistent lengths");return P(e,"base58btc")}function yo(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==16)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion address.`);let e=F.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let o=pe(n);return $([e,o],e.length+o.length)}function vo(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==56)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion3 address.`);let e=F.decode(`b${t[0]}`),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let o=pe(n);return $([e,o],e.length+o.length)}function cr(r){let t=r.slice(0,r.length-2),e=r.slice(r.length-2),n=P(t,"base32"),o=ar(e);return`${n}:${o}`}function lr(r){r=fe(r);let t=[],e=[],n=null,o=r.split("/").slice(1);if(o.length===1&&o[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let s=0;s=o.length)throw ur("invalid address: "+r);if(a.path===!0){n=fe(o.slice(s).join("/")),t.push([a.code,ue(a.code,n)]),e.push([a.code,n]);break}let p=ue(a.code,o[s]);t.push([a.code,p]),e.push([a.code,de(a.code,p)])}return{string:dr(e),bytes:me(t),tuples:t,stringTuples:e,path:n}}function he(r){let t=[],e=[],n=null,o=0;for(;or.length)throw ur("Invalid address Uint8Array: "+P(r,"base16"));t.push([s,f]);let m=de(s,f);if(e.push([s,m]),a.path===!0){n=m;break}}return{bytes:Uint8Array.from(r),string:dr(e),tuples:t,stringTuples:e,path:n}}function dr(r){let t=[];return r.map(e=>{let n=g(e[0]);return t.push(n.name),e.length>1&&e[1]!=null&&t.push(e[1]),null}),fe(t.join("/"))}function me(r){return $(r.map(t=>{let e=g(t[0]),n=Uint8Array.from(lt(e.code));return t.length>1&&t[1]!=null&&(n=$([n,t[1]])),n}))}function Eo(r,t){if(r.size>0)return r.size/8;if(r.size===0)return 0;{let e=H(t instanceof Uint8Array?t:Uint8Array.from(t));return e+L(e)}}function fe(r){return"/"+r.trim().split("/").filter(t=>t).join("/")}function ur(r){return new Error("Error parsing address: "+r)}var Ao=Symbol.for("nodejs.util.inspect.custom"),ge=Symbol.for("@multiformats/js-multiaddr/multiaddr"),Io=[g("dns").code,g("dns4").code,g("dns6").code,g("dnsaddr").code],Ct=class r{bytes;#t;#e;#r;#n;[ge]=!0;constructor(t){t==null&&(t="");let e;if(t instanceof Uint8Array)e=he(t);else if(typeof t=="string"){if(t.length>0&&t.charAt(0)!=="/")throw new Error(`multiaddr "${t}" must start with a "/"`);e=lr(t)}else if(fr(t))e=he(t.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=e.bytes,this.#t=e.string,this.#e=e.tuples,this.#r=e.stringTuples,this.#n=e.path}toString(){return this.#t}toJSON(){return this.toString()}toOptions(){let t,e,n,o,s="",i=g("tcp"),a=g("udp"),p=g("ip4"),f=g("ip6"),m=g("dns6"),v=g("ip6zone");for(let[u,d]of this.stringTuples())u===v.code&&(s=`%${d??""}`),Io.includes(u)&&(e=i.name,o=443,n=`${d??""}${s}`,t=u===m.code?6:4),(u===i.code||u===a.code)&&(e=g(u).name,o=parseInt(d??"")),(u===p.code||u===f.code)&&(e=g(u).name,n=`${d??""}${s}`,t=u===f.code?6:4);if(t==null||e==null||n==null||o==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:t,host:n,transport:e,port:o}}protos(){return this.#e.map(([t])=>Object.assign({},g(t)))}protoCodes(){return this.#e.map(([t])=>t)}protoNames(){return this.#e.map(([t])=>g(t).name)}tuples(){return this.#e}stringTuples(){return this.#r}encapsulate(t){return t=new r(t),new r(this.toString()+t.toString())}decapsulate(t){let e=t.toString(),n=this.toString(),o=n.lastIndexOf(e);if(o<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${t.toString()}`);return new r(n.slice(0,o))}decapsulateCode(t){let e=this.tuples();for(let n=e.length-1;n>=0;n--)if(e[n][0]===t)return new r(me(e.slice(0,n)));return this}getPeerId(){try{let t=[];this.stringTuples().forEach(([n,o])=>{n===dt.p2p.code&&t.push([n,o]),n===dt["p2p-circuit"].code&&(t=[])});let e=t.pop();if(e?.[1]!=null){let n=e[1];return n[0]==="Q"||n[0]==="1"?P(T.decode(`z${n}`),"base58btc"):P(j.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#n}equals(t){return We(this.bytes,t.bytes)}async resolve(t){let e=this.protos().find(s=>s.resolvable);if(e==null)return[this];let n=pr.get(e.name);if(n==null)throw new I(`no available resolver for ${e.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,t)).map(s=>new r(s))}nodeAddress(){let t=this.toOptions();if(t.transport!=="tcp"&&t.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${t.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:t.family,address:t.host,port:t.port}}isThinWaistAddress(t){let e=(t??this).protos();return!(e.length!==2||e[0].code!==4&&e[0].code!==41||e[1].code!==6&&e[1].code!==273)}[Ao](){return`Multiaddr(${this.#t})`}};var pr=new Map;function fr(r){return!!r?.[ge]}function z(r){return new Ct(r)}var Co=c("dns4"),So=c("dns6"),To=c("dnsaddr"),Q=y(c("dns"),To,Co,So),Pt=y(c("ip4"),c("ip6")),W=y(l(Pt,c("tcp")),l(Q,c("tcp"))),Rt=l(Pt,c("udp")),Po=l(Rt,c("utp")),Ro=l(Rt,c("quic")),No=l(Rt,c("quic-v1")),we=y(l(W,c("ws")),l(Q,c("ws"))),St=y(l(we,c("p2p")),we),xe=y(l(W,c("wss")),l(Q,c("wss")),l(W,c("tls"),c("ws")),l(Q,c("tls"),c("ws"))),Tt=y(l(xe,c("p2p")),xe),be=y(l(W,c("http")),l(Pt,c("http")),l(Q,c("http"))),ye=y(l(W,c("https")),l(Pt,c("https")),l(Q,c("https"))),hr=l(Rt,c("webrtc-direct"),c("certhash")),wr=y(l(hr,c("p2p")),hr),mr=l(No,c("webtransport"),c("certhash"),c("certhash")),xr=y(l(mr,c("p2p")),mr),br=y(l(St,c("p2p-webrtc-star"),c("p2p")),l(Tt,c("p2p-webrtc-star"),c("p2p")),l(St,c("p2p-webrtc-star")),l(Tt,c("p2p-webrtc-star"))),gc=y(l(St,c("p2p-websocket-star"),c("p2p")),l(Tt,c("p2p-websocket-star"),c("p2p")),l(St,c("p2p-websocket-star")),l(Tt,c("p2p-websocket-star"))),yr=y(l(be,c("p2p-webrtc-direct"),c("p2p")),l(ye,c("p2p-webrtc-direct"),c("p2p")),l(be,c("p2p-webrtc-direct")),l(ye,c("p2p-webrtc-direct"))),K=y(we,xe,be,ye,br,yr,W,Po,Ro,Q,wr,xr),wc=y(l(K,c("p2p-stardust"),c("p2p")),l(K,c("p2p-stardust"))),G=y(l(K,c("p2p")),br,yr,wr,xr,c("p2p")),gr=y(l(G,c("p2p-circuit"),G),l(G,c("p2p-circuit")),l(c("p2p-circuit"),G),l(K,c("p2p-circuit")),l(c("p2p-circuit"),K),c("p2p-circuit")),vr=()=>y(l(gr,vr),gr),J=vr(),xc=y(l(J,G,J),l(G,J),l(J,G),J,G);var bc=y(l(J,c("webrtc"),c("p2p")),l(J,c("webrtc")),l(K,c("webrtc"),c("p2p")),l(K,c("webrtc")),c("webrtc"));function Er(r){function t(e){let n;try{n=z(e)}catch{return!1}let o=r(n.protoNames());return o===null?!1:o===!0||o===!1?o:o.length===0}return t}function l(...r){function t(e){if(e.length(n=typeof o=="function"?o().partialMatch(e):o.partialMatch(e),Array.isArray(n)&&(e=n),n===null)),n}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:Er(t),partialMatch:t}}function y(...r){function t(n){let o=null;return r.some(s=>{let i=typeof s=="function"?s().partialMatch(n):s.partialMatch(n);return i!=null?(o=i,!0):!1}),o}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:Er(t),partialMatch:t}}function c(r){let t=r;function e(o){let s;try{s=z(o)}catch{return!1}let i=s.protoNames();return i.length===1&&i[0]===t}function n(o){return o.length===0?null:o[0]===t?o.slice(1):null}return{toString:function(){return t},matches:e,partialMatch:n}}var _r=tt(Y("net"),1);var Nt=class extends EventTarget{#t=new Map;listenerCount(t){let e=this.#t.get(t);return e==null?0:e.length}addEventListener(t,e,n){super.addEventListener(t,e,n);let o=this.#t.get(t);o==null&&(o=[],this.#t.set(t,o)),o.push({callback:e,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(t,e,n){super.removeEventListener(t.toString(),e??null,n);let o=this.#t.get(t);o!=null&&(o=o.filter(({callback:s})=>s!==e),this.#t.set(t,o))}dispatchEvent(t){let e=super.dispatchEvent(t),n=this.#t.get(t.type);return n==null||(n=n.filter(({once:o})=>!o),this.#t.set(t.type,n)),e}safeDispatchEvent(t,e){return this.dispatchEvent(new ut(t,e))}},ve=class extends Event{detail;constructor(t,e){super(t,e),this.detail=e?.detail}},ut=globalThis.CustomEvent??ve;var Ee={ERR_INVALID_IP_PARAMETER:"ERR_INVALID_IP_PARAMETER",ERR_INVALID_PORT_PARAMETER:"ERR_INVALID_PORT_PARAMETER",ERR_INVALID_IP:"ERR_INVALID_IP"};function Ar(r,t){if(typeof r!="string")throw new I(`invalid ip provided: ${r}`,Ee.ERR_INVALID_IP_PARAMETER);if(typeof t=="string"&&(t=parseInt(t)),isNaN(t))throw new I(`invalid port provided: ${t}`,Ee.ERR_INVALID_PORT_PARAMETER);if((0,U.isIPv4)(r))return z(`/ip4/${r}/tcp/${t}`);if((0,U.isIPv6)(r))return z(`/ip6/${r}/tcp/${t}`);throw new I(`invalid ip:port for creating a multiaddr: ${r}:${t}`,Ee.ERR_INVALID_IP)}var Ur=tt(Dr(),1);var Ce=tt(Y("os"),1),Mr=tt(Y("path"),1);var Oo={ip4:"IPv4",ip6:"IPv6"};function ft(r,t={}){let e=r.getPath();return e!=null?Ce.default.platform()==="win32"?{path:Mr.default.join("\\\\.\\pipe\\",e)}:{path:e}:{...t,...r.toOptions()}}function Se(r,t,e){let n=o=>z(`/${r}/${o}/tcp/${e}`);return(Lo(t)?Fo(Oo[r]):[t]).map(n)}function Lo(r){return["0.0.0.0","::"].includes(r)}var Vo=Ce.default.networkInterfaces();function Fo(r){let t=[];for(let[,e]of Object.entries(Vo))if(e!=null)for(let n of e)n.family===r&&t.push(n.address);return t}var Mt=(r,t)=>{let e=t.logger.forComponent("libp2p:tcp:socket"),n=t.metrics,o=t.metricPrefix??"",s=t.socketInactivityTimeout??3e5,i=t.socketCloseTimeout??500;t.listeningAddr?.getPath()!=null&&(t.remoteAddr=t.listeningAddr),t.remoteAddr?.getPath()!=null&&(t.localAddr=t.remoteAddr);let a;if(t.remoteAddr!=null)a=t.remoteAddr;else{if(r.remoteAddress==null||r.remotePort==null)throw new I("Could not determine remote address or port","ERR_NO_REMOTE_ADDRESS");a=Ar(r.remoteAddress,r.remotePort)}let p=ft(a),f=p.path??`${p.host??""}:${p.port??""}`,{sink:m,source:v}=Ur.default.duplex(r);r.setTimeout(s,()=>{e("%s socket read timeout",f),n?.increment({[`${o}timeout`]:!0});let u;r.readable&&(u=new I("Socket read timeout","ERR_SOCKET_READ_TIMEOUT")),r.destroy(u)}),r.once("close",()=>{e("%s socket close",f),n?.increment({[`${o}close`]:!0}),x.timeline.close==null&&(x.timeline.close=Date.now())}),r.once("end",()=>{e("%s socket end",f),n?.increment({[`${o}end`]:!0})});let x={async sink(u){try{await m(async function*(){for await(let d of u)d instanceof Uint8Array?yield d:yield d.subarray()}())}catch(d){d.type!=="aborted"&&e(d)}r.end()},source:v,remoteAddr:a,timeline:{open:Date.now()},async close(u={}){if(r.destroyed){e("%s socket was already destroyed when trying to close",f);return}if(u.signal==null){let d=AbortSignal.timeout(i);u={...u,signal:d}}try{e("%s closing socket",f),await new Promise((d,E)=>{r.once("close",()=>{e("%s socket closed",f),d()}),r.once("error",N=>{e("%s socket error",f,N),x.timeline.close==null&&(x.timeline.close=Date.now()),E(N)}),r.setTimeout(i),r.end(),r.writableLength>0?r.once("drain",()=>{e("%s socket drained",f),r.destroy()}):r.destroy()})}catch(d){this.abort(d)}},abort:u=>{e("%s socket abort due to error",f,u),r.destroy(u)},log:e};return x};async function Te(r,t){try{await r.close()}catch(e){t.log.error("an error occurred closing the connection",e)}}var A;(function(r){r[r.INACTIVE=0]="INACTIVE",r[r.ACTIVE=1]="ACTIVE",r[r.PAUSED=2]="PAUSED"})(A||(A={}));var Ut=class extends Nt{context;server;connections=new Set;status={code:A.INACTIVE};metrics;addr;log;constructor(t){if(super(),this.context=t,t.keepAlive=t.keepAlive??!0,t.noDelay=t.noDelay??!0,this.log=t.logger.forComponent("libp2p:tcp:listener"),this.addr="unknown",this.server=_r.default.createServer(t,this.onSocket.bind(this)),t.maxConnections!==void 0&&(this.server.maxConnections=t.maxConnections),t.closeServerOnMaxConnections!=null&&t.closeServerOnMaxConnections.closeAbove= listenBelow","ERROR_CONNECTION_LIMITS");this.server.on("listening",()=>{if(t.metrics!=null){let e=this.server.address();e==null?this.addr="unknown":typeof e=="string"?this.addr=e:this.addr=`${e.address}:${e.port}`,t.metrics?.registerMetricGroup("libp2p_tcp_inbound_connections_total",{label:"address",help:"Current active connections in TCP listener",calculate:()=>({[this.addr]:this.connections.size})}),this.metrics={status:t.metrics.registerMetricGroup("libp2p_tcp_listener_status_info",{label:"address",help:"Current status of the TCP listener socket"}),errors:t.metrics.registerMetricGroup("libp2p_tcp_listener_errors_total",{label:"address",help:"Total count of TCP listener errors by type"}),events:t.metrics.registerMetricGroup("libp2p_tcp_listener_events_total",{label:"address",help:"Total count of TCP listener events by type"})},this.metrics?.status.update({[this.addr]:A.ACTIVE})}this.dispatchEvent(new ut("listening"))}).on("error",e=>{this.metrics?.errors.increment({[`${this.addr} listen_error`]:!0}),this.dispatchEvent(new ut("error",{detail:e}))}).on("close",()=>{this.metrics?.status.update({[this.addr]:this.status.code}),this.status.code!==A.PAUSED&&this.dispatchEvent(new ut("close"))})}onSocket(t){if(this.status.code!==A.ACTIVE)throw new I("Server is is not listening yet","ERR_SERVER_NOT_RUNNING");t.on("error",n=>{this.log("socket error",n),this.metrics?.events.increment({[`${this.addr} error`]:!0})});let e;try{e=Mt(t,{listeningAddr:this.status.listeningAddr,socketInactivityTimeout:this.context.socketInactivityTimeout,socketCloseTimeout:this.context.socketCloseTimeout,metrics:this.metrics?.events,metricPrefix:`${this.addr} `,logger:this.context.logger})}catch(n){this.log.error("inbound connection failed",n),this.metrics?.errors.increment({[`${this.addr} inbound_to_connection`]:!0});return}this.log("new inbound connection %s",e.remoteAddr);try{this.context.upgrader.upgradeInbound(e).then(n=>{this.log("inbound connection upgraded %s",e.remoteAddr),this.connections.add(e),t.once("close",()=>{this.connections.delete(e),this.context.closeServerOnMaxConnections!=null&&this.connections.size{this.log.error("error attempting to listen server once connection count under limit",o),this.context.closeServerOnMaxConnections?.onListenError?.(o)})}),this.context.handler!=null&&this.context.handler(n),this.context.closeServerOnMaxConnections!=null&&this.connections.size>=this.context.closeServerOnMaxConnections.closeAbove&&this.pause(!1).catch(o=>{this.log.error("error attempting to close server once connection count over limit",o)}),this.dispatchEvent(new ut("connection",{detail:n}))}).catch(async n=>{this.log.error("inbound connection failed",n),this.metrics?.errors.increment({[`${this.addr} inbound_upgrade`]:!0}),await Te(e,{log:this.log})}).catch(n=>{this.log.error("closing inbound connection failed",n)})}catch(n){this.log.error("inbound connection failed",n),Te(e,{log:this.log}).catch(o=>{this.log.error("closing inbound connection failed",o),this.metrics?.errors.increment({[`${this.addr} inbound_closing_failed`]:!0})})}}getAddrs(){if(this.status.code===A.INACTIVE)return[];let t=[],e=this.server.address(),{listeningAddr:n,peerId:o}=this.status;if(e==null)return[];if(typeof e=="string")t=[n];else try{n.toString().startsWith("/ip4")?t=t.concat(Se("ip4",e.address,e.port)):e.family==="IPv6"&&(t=t.concat(Se("ip6",e.address,e.port)))}catch(s){this.log.error("could not turn %s:%s into multiaddr",e.address,e.port,s)}return t.map(s=>o!=null?s.encapsulate(`/p2p/${o}`):s)}async listen(t){if(this.status.code===A.ACTIVE||this.status.code===A.PAUSED)throw new I("server is already listening","ERR_SERVER_ALREADY_LISTENING");let e=t.getPeerId(),n=e==null?t.decapsulateCode(421):t,{backlog:o}=this.context;try{this.status={code:A.ACTIVE,listeningAddr:n,peerId:e,netConfig:ft(n,{backlog:o})},await this.resume()}catch(s){throw this.status={code:A.INACTIVE},s}}async close(){await Promise.all([Promise.all(Array.from(this.connections.values()).map(async t=>Te(t,{log:this.log}))),this.pause(!0).catch(t=>{this.log.error("error attempting to close server once connection count over limit",t)})])}async resume(){if(this.server.listening||this.status.code===A.INACTIVE)return;let t=this.status.netConfig;await new Promise((e,n)=>{this.server.once("error",n),this.server.listen(t,e)}),this.status={...this.status,code:A.ACTIVE},this.log("Listening on %s",this.server.address())}async pause(t){if(!this.server.listening&&this.status.code===A.PAUSED&&t){this.status={code:A.INACTIVE};return}!this.server.listening||this.status.code!==A.ACTIVE||(this.log("Closing server on %s",this.server.address()),this.status=t?{code:A.INACTIVE}:{...this.status,code:A.PAUSED},await new Promise((e,n)=>{this.server.close(o=>{o!=null?n(o):e()})}))}};var Re=class{opts;metrics;components;log;constructor(t,e={}){this.log=t.logger.forComponent("libp2p:tcp"),this.opts=e,this.components=t,t.metrics!=null&&(this.metrics={dialerEvents:t.metrics.registerCounterGroup("libp2p_tcp_dialer_events_total",{label:"event",help:"Total count of TCP dialer events by type"})})}[Me]=!0;[Symbol.toStringTag]="@libp2p/tcp";async dial(t,e){e.keepAlive=e.keepAlive??!0,e.noDelay=e.noDelay??!0;let n=await this._connect(t,e);n.on("error",a=>{this.log("socket error",a)});let o=Mt(n,{remoteAddr:t,socketInactivityTimeout:this.opts.outboundSocketInactivityTimeout,socketCloseTimeout:this.opts.socketCloseTimeout,metrics:this.metrics?.dialerEvents,logger:this.components.logger}),s=()=>{o.close().catch(a=>{this.log.error("Error closing maConn after abort",a)})};e.signal?.addEventListener("abort",s,{once:!0}),this.log("new outbound connection %s",o.remoteAddr);let i=await e.upgrader.upgradeOutbound(o);if(this.log("outbound connection %s upgraded",o.remoteAddr),e.signal?.removeEventListener("abort",s),e.signal?.aborted===!0)throw i.close().catch(a=>{this.log.error("Error closing conn after abort",a)}),new et;return i}async _connect(t,e){if(e.signal?.aborted===!0)throw new et;return new Promise((n,o)=>{let s=Date.now(),i=ft(t,{...this.opts.dialOpts??{},...e});this.log("dialing %a",t);let a=kr.default.connect(i),p=u=>{let d=i.path??`${i.host??""}:${i.port}`;u.message=`connection error ${d}: ${u.message}`,this.metrics?.dialerEvents.increment({error:!0}),x(u)},f=()=>{this.log("connection timeout %a",t),this.metrics?.dialerEvents.increment({timeout:!0});let u=new I(`connection timeout after ${Date.now()-s}ms`,"ERR_CONNECT_TIMEOUT");a.emit("error",u)},m=()=>{this.log("connection opened %a",t),this.metrics?.dialerEvents.increment({connect:!0}),x()},v=()=>{this.log("connection aborted %a",t),this.metrics?.dialerEvents.increment({abort:!0}),a.destroy(),x(new et)},x=u=>{if(a.removeListener("error",p),a.removeListener("timeout",f),a.removeListener("connect",m),e.signal!=null&&e.signal.removeEventListener("abort",v),u!=null){o(u);return}n(a)};a.on("error",p),a.on("timeout",f),a.on("connect",m),e.signal!=null&&e.signal.addEventListener("abort",v)})}createListener(t){return new Ut({...this.opts.listenOpts??{},...t,maxConnections:this.opts.maxConnections,backlog:this.opts.backlog,closeServerOnMaxConnections:this.opts.closeServerOnMaxConnections,socketInactivityTimeout:this.opts.inboundSocketInactivityTimeout,socketCloseTimeout:this.opts.socketCloseTimeout,metrics:this.components.metrics,logger:this.components.logger})}filter(t){return t=Array.isArray(t)?t:[t],t.filter(e=>e.protoCodes().includes(290)?!1:e.protoCodes().includes(400)?!0:W.matches(e.decapsulateCode(421)))}};function jo(r={}){return t=>new Re(t,r)}return zr(Go);})(); -return Libp2PTcp})); diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/constants.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/constants.d.ts deleted file mode 100644 index f30b4f260..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/constants.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare const CODE_P2P = 421; -export declare const CODE_CIRCUIT = 290; -export declare const CODE_UNIX = 400; -export declare const CLOSE_TIMEOUT = 500; -export declare const SOCKET_TIMEOUT: number; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/constants.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/constants.d.ts.map deleted file mode 100644 index c31c9fd50..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,QAAQ,MAAM,CAAA;AAC3B,eAAO,MAAM,YAAY,MAAM,CAAA;AAC/B,eAAO,MAAM,SAAS,MAAM,CAAA;AAG5B,eAAO,MAAM,aAAa,MAAM,CAAA;AAGhC,eAAO,MAAM,cAAc,QAAY,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/constants.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/constants.js deleted file mode 100644 index 271d393f3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/constants.js +++ /dev/null @@ -1,9 +0,0 @@ -// p2p multi-address code -export const CODE_P2P = 421; -export const CODE_CIRCUIT = 290; -export const CODE_UNIX = 400; -// Time to wait for a connection to close gracefully before destroying it manually -export const CLOSE_TIMEOUT = 500; -// Close the socket if there is no activity after this long in ms -export const SOCKET_TIMEOUT = 5 * 60000; // 5 mins -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/constants.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/constants.js.map deleted file mode 100644 index f2a3aba59..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAA;AAC3B,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA;AAC/B,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAA;AAE5B,kFAAkF;AAClF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;AAEhC,iEAAiE;AACjE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,KAAK,CAAA,CAAC,SAAS"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/index.d.ts deleted file mode 100644 index c9fef833a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/index.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -/** - * @packageDocumentation - * - * A [libp2p transport](https://docs.libp2p.io/concepts/transports/overview/) based on the TCP networking stack. - * - * @example - * - * ```js - * import { tcp } from '@libp2p/tcp' - * import { multiaddr } from '@multiformats/multiaddr' - * import { pipe } from 'it-pipe' - * import all from 'it-all' - * - * // A simple upgrader that just returns the MultiaddrConnection - * const upgrader = { - * upgradeInbound: async maConn => maConn, - * upgradeOutbound: async maConn => maConn - * } - * - * const transport = tcp()() - * - * const listener = transport.createListener({ - * upgrader, - * handler: (socket) => { - * console.this.log('new connection opened') - * pipe( - * ['hello', ' ', 'World!'], - * socket - * ) - * } - * }) - * - * const addr = multiaddr('/ip4/127.0.0.1/tcp/9090') - * await listener.listen(addr) - * console.this.log('listening') - * - * const socket = await transport.dial(addr, { upgrader }) - * const values = await pipe( - * socket, - * all - * ) - * console.this.log(`Value: ${values.toString()}`) - * - * // Close connection after reading - * await listener.close() - * ``` - * - * Outputs: - * - * ```sh - * listening - * new connection opened - * Value: hello World! - * ``` - */ -import { type CreateListenerOptions, type DialOptions, type Transport } from '@libp2p/interface/transport'; -import { type CloseServerOnMaxConnectionsOpts } from './listener.js'; -import type { ComponentLogger } from '@libp2p/interface'; -import type { CounterGroup, Metrics } from '@libp2p/interface/metrics'; -import type { AbortOptions } from '@multiformats/multiaddr'; -export interface TCPOptions { - /** - * An optional number in ms that is used as an inactivity timeout after which the socket will be closed - */ - inboundSocketInactivityTimeout?: number; - /** - * An optional number in ms that is used as an inactivity timeout after which the socket will be closed - */ - outboundSocketInactivityTimeout?: number; - /** - * When closing a socket, wait this long for it to close gracefully before it is closed more forcibly - */ - socketCloseTimeout?: number; - /** - * Set this property to reject connections when the server's connection count gets high. - * https://nodejs.org/api/net.html#servermaxconnections - */ - maxConnections?: number; - /** - * Parameter to specify the maximum length of the queue of pending connections - * https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - backlog?: number; - /** - * Close server (stop listening for new connections) if connections exceed a limit. - * Open server (start listening for new connections) if connections fall below a limit. - */ - closeServerOnMaxConnections?: CloseServerOnMaxConnectionsOpts; - /** - * Options passed to `net.connect` for every opened TCP socket - */ - dialOpts?: TCPSocketOptions; - /** - * Options passed to every `net.createServer` for every TCP server - */ - listenOpts?: TCPSocketOptions; -} -/** - * Expose a subset of net.connect options - */ -export interface TCPSocketOptions extends AbortOptions { - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - noDelay?: boolean; - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - keepAlive?: boolean; - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - keepAliveInitialDelay?: number; - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#new-netsocketoptions - */ - allowHalfOpen?: boolean; -} -export interface TCPDialOptions extends DialOptions, TCPSocketOptions { -} -export interface TCPCreateListenerOptions extends CreateListenerOptions, TCPSocketOptions { -} -export interface TCPComponents { - metrics?: Metrics; - logger: ComponentLogger; -} -export interface TCPMetrics { - dialerEvents: CounterGroup; -} -export declare function tcp(init?: TCPOptions): (components: TCPComponents) => Transport; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/index.d.ts.map deleted file mode 100644 index 0a2362083..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAIH,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,WAAW,EAAU,KAAK,SAAS,EAAiB,MAAM,6BAA6B,CAAA;AAGjI,OAAO,EAAE,KAAK,+BAA+B,EAAe,MAAM,eAAe,CAAA;AAGjF,OAAO,KAAK,EAAE,eAAe,EAAU,MAAM,mBAAmB,CAAA;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACtE,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,yBAAyB,CAAA;AAGtE,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAA;IAEvC;;OAEG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAA;IAExC;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;OAGG;IACH,2BAA2B,CAAC,EAAE,+BAA+B,CAAA;IAE7D;;OAEG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAE3B;;OAEG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAE9B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,MAAM,WAAW,cAAe,SAAQ,WAAW,EAAE,gBAAgB;CAEpE;AAED,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB,EAAE,gBAAgB;CAExF;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,eAAe,CAAA;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,YAAY,CAAA;CAC3B;AAqLD,wBAAgB,GAAG,CAAE,IAAI,GAAE,UAAe,GAAG,CAAC,UAAU,EAAE,aAAa,KAAK,SAAS,CAIpF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/index.js deleted file mode 100644 index 31b4fa02f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/index.js +++ /dev/null @@ -1,213 +0,0 @@ -/** - * @packageDocumentation - * - * A [libp2p transport](https://docs.libp2p.io/concepts/transports/overview/) based on the TCP networking stack. - * - * @example - * - * ```js - * import { tcp } from '@libp2p/tcp' - * import { multiaddr } from '@multiformats/multiaddr' - * import { pipe } from 'it-pipe' - * import all from 'it-all' - * - * // A simple upgrader that just returns the MultiaddrConnection - * const upgrader = { - * upgradeInbound: async maConn => maConn, - * upgradeOutbound: async maConn => maConn - * } - * - * const transport = tcp()() - * - * const listener = transport.createListener({ - * upgrader, - * handler: (socket) => { - * console.this.log('new connection opened') - * pipe( - * ['hello', ' ', 'World!'], - * socket - * ) - * } - * }) - * - * const addr = multiaddr('/ip4/127.0.0.1/tcp/9090') - * await listener.listen(addr) - * console.this.log('listening') - * - * const socket = await transport.dial(addr, { upgrader }) - * const values = await pipe( - * socket, - * all - * ) - * console.this.log(`Value: ${values.toString()}`) - * - * // Close connection after reading - * await listener.close() - * ``` - * - * Outputs: - * - * ```sh - * listening - * new connection opened - * Value: hello World! - * ``` - */ -import net from 'net'; -import { AbortError, CodeError } from '@libp2p/interface/errors'; -import { symbol } from '@libp2p/interface/transport'; -import * as mafmt from '@multiformats/mafmt'; -import { CODE_CIRCUIT, CODE_P2P, CODE_UNIX } from './constants.js'; -import { TCPListener } from './listener.js'; -import { toMultiaddrConnection } from './socket-to-conn.js'; -import { multiaddrToNetConfig } from './utils.js'; -class TCP { - opts; - metrics; - components; - log; - constructor(components, options = {}) { - this.log = components.logger.forComponent('libp2p:tcp'); - this.opts = options; - this.components = components; - if (components.metrics != null) { - this.metrics = { - dialerEvents: components.metrics.registerCounterGroup('libp2p_tcp_dialer_events_total', { - label: 'event', - help: 'Total count of TCP dialer events by type' - }) - }; - } - } - [symbol] = true; - [Symbol.toStringTag] = '@libp2p/tcp'; - async dial(ma, options) { - options.keepAlive = options.keepAlive ?? true; - // options.signal destroys the socket before 'connect' event - const socket = await this._connect(ma, options); - // Avoid uncaught errors caused by unstable connections - socket.on('error', err => { - this.log('socket error', err); - }); - const maConn = toMultiaddrConnection(socket, { - remoteAddr: ma, - socketInactivityTimeout: this.opts.outboundSocketInactivityTimeout, - socketCloseTimeout: this.opts.socketCloseTimeout, - metrics: this.metrics?.dialerEvents, - logger: this.components.logger - }); - const onAbort = () => { - maConn.close().catch(err => { - this.log.error('Error closing maConn after abort', err); - }); - }; - options.signal?.addEventListener('abort', onAbort, { once: true }); - this.log('new outbound connection %s', maConn.remoteAddr); - const conn = await options.upgrader.upgradeOutbound(maConn); - this.log('outbound connection %s upgraded', maConn.remoteAddr); - options.signal?.removeEventListener('abort', onAbort); - if (options.signal?.aborted === true) { - conn.close().catch(err => { - this.log.error('Error closing conn after abort', err); - }); - throw new AbortError(); - } - return conn; - } - async _connect(ma, options) { - if (options.signal?.aborted === true) { - throw new AbortError(); - } - return new Promise((resolve, reject) => { - const start = Date.now(); - const cOpts = multiaddrToNetConfig(ma, { - ...(this.opts.dialOpts ?? {}), - ...options - }); - this.log('dialing %a', ma); - const rawSocket = net.connect(cOpts); - const onError = (err) => { - const cOptsStr = cOpts.path ?? `${cOpts.host ?? ''}:${cOpts.port}`; - err.message = `connection error ${cOptsStr}: ${err.message}`; - this.metrics?.dialerEvents.increment({ error: true }); - done(err); - }; - const onTimeout = () => { - this.log('connection timeout %a', ma); - this.metrics?.dialerEvents.increment({ timeout: true }); - const err = new CodeError(`connection timeout after ${Date.now() - start}ms`, 'ERR_CONNECT_TIMEOUT'); - // Note: this will result in onError() being called - rawSocket.emit('error', err); - }; - const onConnect = () => { - this.log('connection opened %a', ma); - this.metrics?.dialerEvents.increment({ connect: true }); - done(); - }; - const onAbort = () => { - this.log('connection aborted %a', ma); - this.metrics?.dialerEvents.increment({ abort: true }); - rawSocket.destroy(); - done(new AbortError()); - }; - const done = (err) => { - rawSocket.removeListener('error', onError); - rawSocket.removeListener('timeout', onTimeout); - rawSocket.removeListener('connect', onConnect); - if (options.signal != null) { - options.signal.removeEventListener('abort', onAbort); - } - if (err != null) { - reject(err); - return; - } - resolve(rawSocket); - }; - rawSocket.on('error', onError); - rawSocket.on('timeout', onTimeout); - rawSocket.on('connect', onConnect); - if (options.signal != null) { - options.signal.addEventListener('abort', onAbort); - } - }); - } - /** - * Creates a TCP listener. The provided `handler` function will be called - * anytime a new incoming Connection has been successfully upgraded via - * `upgrader.upgradeInbound`. - */ - createListener(options) { - return new TCPListener({ - ...(this.opts.listenOpts ?? {}), - ...options, - maxConnections: this.opts.maxConnections, - backlog: this.opts.backlog, - closeServerOnMaxConnections: this.opts.closeServerOnMaxConnections, - socketInactivityTimeout: this.opts.inboundSocketInactivityTimeout, - socketCloseTimeout: this.opts.socketCloseTimeout, - metrics: this.components.metrics, - logger: this.components.logger - }); - } - /** - * Takes a list of `Multiaddr`s and returns only valid TCP addresses - */ - filter(multiaddrs) { - multiaddrs = Array.isArray(multiaddrs) ? multiaddrs : [multiaddrs]; - return multiaddrs.filter(ma => { - if (ma.protoCodes().includes(CODE_CIRCUIT)) { - return false; - } - if (ma.protoCodes().includes(CODE_UNIX)) { - return true; - } - return mafmt.TCP.matches(ma.decapsulateCode(CODE_P2P)); - }); - } -} -export function tcp(init = {}) { - return (components) => { - return new TCP(components, init); - }; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/index.js.map deleted file mode 100644 index 820bf53ee..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,OAAO,GAAG,MA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AC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;QAElE,OAAO,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;YAC5B,IAAI,EAAE,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE;gBAC1C,OAAO,KAAK,CAAA;aACb;YAED,IAAI,EAAE,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;gBACvC,OAAO,IAAI,CAAA;aACZ;YAED,OAAO,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAA;QACxD,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AAED,MAAM,UAAU,GAAG,CAAE,OAAmB,EAAE;IACxC,OAAO,CAAC,UAAyB,EAAE,EAAE;QACnC,OAAO,IAAI,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/listener.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/listener.d.ts deleted file mode 100644 index 7ed8b5b06..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/listener.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import type { TCPCreateListenerOptions } from './index.js'; -import type { ComponentLogger } from '@libp2p/interface'; -import type { Connection } from '@libp2p/interface/connection'; -import type { CounterGroup, MetricGroup, Metrics } from '@libp2p/interface/metrics'; -import type { Listener, ListenerEvents, Upgrader } from '@libp2p/interface/transport'; -import type { Multiaddr } from '@multiformats/multiaddr'; -export interface CloseServerOnMaxConnectionsOpts { - /** Server listens once connection count is less than `listenBelow` */ - listenBelow: number; - /** Close server once connection count is greater than or equal to `closeAbove` */ - closeAbove: number; - onListenError?(err: Error): void; -} -interface Context extends TCPCreateListenerOptions { - handler?(conn: Connection): void; - upgrader: Upgrader; - socketInactivityTimeout?: number; - socketCloseTimeout?: number; - maxConnections?: number; - backlog?: number; - metrics?: Metrics; - closeServerOnMaxConnections?: CloseServerOnMaxConnectionsOpts; - logger: ComponentLogger; -} -export interface TCPListenerMetrics { - status: MetricGroup; - errors: CounterGroup; - events: CounterGroup; -} -export declare class TCPListener extends TypedEventEmitter implements Listener { - private readonly context; - private readonly server; - /** Keep track of open connections to destroy in case of timeout */ - private readonly connections; - private status; - private metrics?; - private addr; - private readonly log; - constructor(context: Context); - private onSocket; - getAddrs(): Multiaddr[]; - listen(ma: Multiaddr): Promise; - close(): Promise; - /** - * Can resume a stopped or start an inert server - */ - private resume; - private pause; -} -export {}; -//# sourceMappingURL=listener.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/listener.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/listener.d.ts.map deleted file mode 100644 index d81a9c284..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/listener.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../../src/listener.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAe,MAAM,0BAA0B,CAAA;AAQzE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAyB,MAAM,mBAAmB,CAAA;AAC/E,OAAO,KAAK,EAAuB,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACnF,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnF,OAAO,KAAK,EAAE,QAAQ,EA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AS,EAAE;IAgClB,MAAM,CAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBrC,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;IAY7B;;OAEG;YACW,MAAM;YAiBN,KAAK;CAgCpB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/listener.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/listener.js deleted file mode 100644 index d7f6962da..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/listener.js +++ /dev/null @@ -1,301 +0,0 @@ -import net from 'net'; -import { CodeError } from '@libp2p/interface/errors'; -import { TypedEventEmitter, CustomEvent } from '@libp2p/interface/events'; -import { CODE_P2P } from './constants.js'; -import { toMultiaddrConnection } from './socket-to-conn.js'; -import { getMultiaddrs, multiaddrToNetConfig } from './utils.js'; -/** - * Attempts to close the given maConn. If a failure occurs, it will be logged - */ -async function attemptClose(maConn, options) { - try { - await maConn.close(); - } - catch (err) { - options.log.error('an error occurred closing the connection', err); - } -} -var TCPListenerStatusCode; -(function (TCPListenerStatusCode) { - /** - * When server object is initialized but we don't know the listening address yet or - * the server object is stopped manually, can be resumed only by calling listen() - **/ - TCPListenerStatusCode[TCPListenerStatusCode["INACTIVE"] = 0] = "INACTIVE"; - TCPListenerStatusCode[TCPListenerStatusCode["ACTIVE"] = 1] = "ACTIVE"; - /* During the connection limits */ - TCPListenerStatusCode[TCPListenerStatusCode["PAUSED"] = 2] = "PAUSED"; -})(TCPListenerStatusCode || (TCPListenerStatusCode = {})); -export class TCPListener extends TypedEventEmitter { - context; - server; - /** Keep track of open connections to destroy in case of timeout */ - connections = new Set(); - status = { code: TCPListenerStatusCode.INACTIVE }; - metrics; - addr; - log; - constructor(context) { - super(); - this.context = context; - context.keepAlive = context.keepAlive ?? true; - this.log = context.logger.forComponent('libp2p:tcp:listener'); - this.addr = 'unknown'; - this.server = net.createServer(context, this.onSocket.bind(this)); - // https://nodejs.org/api/net.html#servermaxconnections - // If set reject connections when the server's connection count gets high - // Useful to prevent too resource exhaustion via many open connections on high bursts of activity - if (context.maxConnections !== undefined) { - this.server.maxConnections = context.maxConnections; - } - if (context.closeServerOnMaxConnections != null) { - // Sanity check options - if (context.closeServerOnMaxConnections.closeAbove < context.closeServerOnMaxConnections.listenBelow) { - throw new CodeError('closeAbove must be >= listenBelow', 'ERROR_CONNECTION_LIMITS'); - } - } - this.server - .on('listening', () => { - if (context.metrics != null) { - // we are listening, register metrics for our port - const address = this.server.address(); - if (address == null) { - this.addr = 'unknown'; - } - else if (typeof address === 'string') { - // unix socket - this.addr = address; - } - else { - this.addr = `${address.address}:${address.port}`; - } - context.metrics?.registerMetricGroup('libp2p_tcp_inbound_connections_total', { - label: 'address', - help: 'Current active connections in TCP listener', - calculate: () => { - return { - [this.addr]: this.connections.size - }; - } - }); - this.metrics = { - status: context.metrics.registerMetricGroup('libp2p_tcp_listener_status_info', { - label: 'address', - help: 'Current status of the TCP listener socket' - }), - errors: context.metrics.registerMetricGroup('libp2p_tcp_listener_errors_total', { - label: 'address', - help: 'Total count of TCP listener errors by type' - }), - events: context.metrics.registerMetricGroup('libp2p_tcp_listener_events_total', { - label: 'address', - help: 'Total count of TCP listener events by type' - }) - }; - this.metrics?.status.update({ - [this.addr]: TCPListenerStatusCode.ACTIVE - }); - } - this.dispatchEvent(new CustomEvent('listening')); - }) - .on('error', err => { - this.metrics?.errors.increment({ [`${this.addr} listen_error`]: true }); - this.dispatchEvent(new CustomEvent('error', { detail: err })); - }) - .on('close', () => { - this.metrics?.status.update({ - [this.addr]: this.status.code - }); - // If this event is emitted, the transport manager will remove the listener from it's cache - // in the meanwhile if the connections are dropped then listener will start listening again - // and the transport manager will not be able to close the server - if (this.status.code !== TCPListenerStatusCode.PAUSED) { - this.dispatchEvent(new CustomEvent('close')); - } - }); - } - onSocket(socket) { - if (this.status.code !== TCPListenerStatusCode.ACTIVE) { - throw new CodeError('Server is is not listening yet', 'ERR_SERVER_NOT_RUNNING'); - } - // Avoid uncaught errors caused by unstable connections - socket.on('error', err => { - this.log('socket error', err); - this.metrics?.events.increment({ [`${this.addr} error`]: true }); - }); - let maConn; - try { - maConn = toMultiaddrConnection(socket, { - listeningAddr: this.status.listeningAddr, - socketInactivityTimeout: this.context.socketInactivityTimeout, - socketCloseTimeout: this.context.socketCloseTimeout, - metrics: this.metrics?.events, - metricPrefix: `${this.addr} `, - logger: this.context.logger - }); - } - catch (err) { - this.log.error('inbound connection failed', err); - this.metrics?.errors.increment({ [`${this.addr} inbound_to_connection`]: true }); - return; - } - this.log('new inbound connection %s', maConn.remoteAddr); - try { - this.context.upgrader.upgradeInbound(maConn) - .then((conn) => { - this.log('inbound connection upgraded %s', maConn.remoteAddr); - this.connections.add(maConn); - socket.once('close', () => { - this.connections.delete(maConn); - if (this.context.closeServerOnMaxConnections != null && - this.connections.size < this.context.closeServerOnMaxConnections.listenBelow) { - // The most likely case of error is if the port taken by this application is binded by - // another process during the time the server if closed. In that case there's not much - // we can do. resume() will be called again every time a connection is dropped, which - // acts as an eventual retry mechanism. onListenError allows the consumer act on this. - this.resume().catch(e => { - this.log.error('error attempting to listen server once connection count under limit', e); - this.context.closeServerOnMaxConnections?.onListenError?.(e); - }); - } - }); - if (this.context.handler != null) { - this.context.handler(conn); - } - if (this.context.closeServerOnMaxConnections != null && - this.connections.size >= this.context.closeServerOnMaxConnections.closeAbove) { - this.pause(false).catch(e => { - this.log.error('error attempting to close server once connection count over limit', e); - }); - } - this.dispatchEvent(new CustomEvent('connection', { detail: conn })); - }) - .catch(async (err) => { - this.log.error('inbound connection failed', err); - this.metrics?.errors.increment({ [`${this.addr} inbound_upgrade`]: true }); - await attemptClose(maConn, { - log: this.log - }); - }) - .catch(err => { - this.log.error('closing inbound connection failed', err); - }); - } - catch (err) { - this.log.error('inbound connection failed', err); - attemptClose(maConn, { - log: this.log - }) - .catch(err => { - this.log.error('closing inbound connection failed', err); - this.metrics?.errors.increment({ [`${this.addr} inbound_closing_failed`]: true }); - }); - } - } - getAddrs() { - if (this.status.code === TCPListenerStatusCode.INACTIVE) { - return []; - } - let addrs = []; - const address = this.server.address(); - const { listeningAddr, peerId } = this.status; - if (address == null) { - return []; - } - if (typeof address === 'string') { - addrs = [listeningAddr]; - } - else { - try { - // Because TCP will only return the IPv6 version - // we need to capture from the passed multiaddr - if (listeningAddr.toString().startsWith('/ip4')) { - addrs = addrs.concat(getMultiaddrs('ip4', address.address, address.port)); - } - else if (address.family === 'IPv6') { - addrs = addrs.concat(getMultiaddrs('ip6', address.address, address.port)); - } - } - catch (err) { - this.log.error('could not turn %s:%s into multiaddr', address.address, address.port, err); - } - } - return addrs.map(ma => peerId != null ? ma.encapsulate(`/p2p/${peerId}`) : ma); - } - async listen(ma) { - if (this.status.code === TCPListenerStatusCode.ACTIVE || this.status.code === TCPListenerStatusCode.PAUSED) { - throw new CodeError('server is already listening', 'ERR_SERVER_ALREADY_LISTENING'); - } - const peerId = ma.getPeerId(); - const listeningAddr = peerId == null ? ma.decapsulateCode(CODE_P2P) : ma; - const { backlog } = this.context; - try { - this.status = { - code: TCPListenerStatusCode.ACTIVE, - listeningAddr, - peerId, - netConfig: multiaddrToNetConfig(listeningAddr, { backlog }) - }; - await this.resume(); - } - catch (err) { - this.status = { code: TCPListenerStatusCode.INACTIVE }; - throw err; - } - } - async close() { - // Close connections and server the same time to avoid any race condition - await Promise.all([ - Promise.all(Array.from(this.connections.values()).map(async (maConn) => attemptClose(maConn, { - log: this.log - }))), - this.pause(true).catch(e => { - this.log.error('error attempting to close server once connection count over limit', e); - }) - ]); - } - /** - * Can resume a stopped or start an inert server - */ - async resume() { - if (this.server.listening || this.status.code === TCPListenerStatusCode.INACTIVE) { - return; - } - const netConfig = this.status.netConfig; - await new Promise((resolve, reject) => { - // NOTE: 'listening' event is only fired on success. Any error such as port already binded, is emitted via 'error' - this.server.once('error', reject); - this.server.listen(netConfig, resolve); - }); - this.status = { ...this.status, code: TCPListenerStatusCode.ACTIVE }; - this.log('Listening on %s', this.server.address()); - } - async pause(permanent) { - if (!this.server.listening && this.status.code === TCPListenerStatusCode.PAUSED && permanent) { - this.status = { code: TCPListenerStatusCode.INACTIVE }; - return; - } - if (!this.server.listening || this.status.code !== TCPListenerStatusCode.ACTIVE) { - return; - } - this.log('Closing server on %s', this.server.address()); - // NodeJS implementation tracks listening status with `this._handle` property. - // - Server.close() sets this._handle to null immediately. If this._handle is null, ERR_SERVER_NOT_RUNNING is thrown - // - Server.listening returns `this._handle !== null` https://github.com/nodejs/node/blob/386d761943bb1b217fba27d6b80b658c23009e60/lib/net.js#L1675 - // - Server.listen() if `this._handle !== null` throws ERR_SERVER_ALREADY_LISTEN - // - // NOTE: Both listen and close are technically not async actions, so it's not necessary to track - // states 'pending-close' or 'pending-listen' - // From docs https://nodejs.org/api/net.html#serverclosecallback - // Stops the server from accepting new connections and keeps existing connections. - // 'close' event is emitted only emitted when all connections are ended. - // The optional callback will be called once the 'close' event occurs. - // We need to set this status before closing server, so other procedures are aware - // during the time the server is closing - this.status = permanent ? { code: TCPListenerStatusCode.INACTIVE } : { ...this.status, code: TCPListenerStatusCode.PAUSED }; - await new Promise((resolve, reject) => { - this.server.close(err => { (err != null) ? reject(err) : resolve(); }); - }); - } -} -//# sourceMappingURL=listener.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/listener.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/listener.js.map deleted file mode 100644 index 2e89d00b6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/listener.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listener.js","sourceRoot":"","sources":["../../src/listener.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB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AAC,MAAM,IAAI,SAAS,EAAE;YAC5F,IAAI,CAAC,MAAM,GAAG,EAAE,IAAI,EAAE,qBAAqB,CAAC,QAAQ,EAAE,CAAA;YACtD,OAAM;SACP;QAED,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,qBAAqB,CAAC,MAAM,EAAE;YAC/E,OAAM;SACP;QAED,IAAI,CAAC,GAAG,CAAC,sBAAsB,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;QAEvD,8EAA8E;QAC9E,oHAAoH;QACpH,mJAAmJ;QACnJ,gFAAgF;QAChF,EAAE;QACF,gGAAgG;QAChG,6CAA6C;QAE7C,gEAAgE;QAChE,kFAAkF;QAClF,wEAAwE;QACxE,sEAAsE;QAEtE,kFAAkF;QAClF,wCAAwC;QACxC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,qBAAqB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,qBAAqB,CAAC,MAAM,EAAE,CAAA;QAC3H,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA,CAAC,CAAC,CAAC,CAAA;QACvE,CAAC,CAAC,CAAA;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/socket-to-conn.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/socket-to-conn.d.ts deleted file mode 100644 index af459c198..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/socket-to-conn.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { ComponentLogger } from '@libp2p/interface'; -import type { MultiaddrConnection } from '@libp2p/interface/connection'; -import type { CounterGroup } from '@libp2p/interface/metrics'; -import type { Multiaddr } from '@multiformats/multiaddr'; -import type { Socket } from 'net'; -interface ToConnectionOptions { - listeningAddr?: Multiaddr; - remoteAddr?: Multiaddr; - localAddr?: Multiaddr; - socketInactivityTimeout?: number; - socketCloseTimeout?: number; - metrics?: CounterGroup; - metricPrefix?: string; - logger: ComponentLogger; -} -/** - * Convert a socket into a MultiaddrConnection - * https://github.com/libp2p/interface-transport#multiaddrconnection - */ -export declare const toMultiaddrConnection: (socket: Socket, options: ToConnectionOptions) => MultiaddrConnection; -export {}; -//# sourceMappingURL=socket-to-conn.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/socket-to-conn.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/socket-to-conn.d.ts.map deleted file mode 100644 index 36979c82f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/socket-to-conn.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"socket-to-conn.d.ts","sourceRoot":"","sources":["../../src/socket-to-conn.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAEjC,UAAU,mBAAmB;IAC3B,aAAa,CAAC,EAAE,SAAS,CAAA;IACzB,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE,eAAe,CAAA;CACxB;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,WAAY,MAAM,WAAW,mBAAmB,KAAG,mBA4KpF,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/socket-to-conn.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/socket-to-conn.js deleted file mode 100644 index 895d2cc0e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/socket-to-conn.js +++ /dev/null @@ -1,158 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { ipPortToMultiaddr as toMultiaddr } from '@libp2p/utils/ip-port-to-multiaddr'; -// @ts-expect-error no types -import toIterable from 'stream-to-it'; -import { CLOSE_TIMEOUT, SOCKET_TIMEOUT } from './constants.js'; -import { multiaddrToNetConfig } from './utils.js'; -/** - * Convert a socket into a MultiaddrConnection - * https://github.com/libp2p/interface-transport#multiaddrconnection - */ -export const toMultiaddrConnection = (socket, options) => { - const log = options.logger.forComponent('libp2p:tcp:socket'); - const metrics = options.metrics; - const metricPrefix = options.metricPrefix ?? ''; - const inactivityTimeout = options.socketInactivityTimeout ?? SOCKET_TIMEOUT; - const closeTimeout = options.socketCloseTimeout ?? CLOSE_TIMEOUT; - // Check if we are connected on a unix path - if (options.listeningAddr?.getPath() != null) { - options.remoteAddr = options.listeningAddr; - } - if (options.remoteAddr?.getPath() != null) { - options.localAddr = options.remoteAddr; - } - let remoteAddr; - if (options.remoteAddr != null) { - remoteAddr = options.remoteAddr; - } - else { - if (socket.remoteAddress == null || socket.remotePort == null) { - // this can be undefined if the socket is destroyed (for example, if the client disconnected) - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#socketremoteaddress - throw new CodeError('Could not determine remote address or port', 'ERR_NO_REMOTE_ADDRESS'); - } - remoteAddr = toMultiaddr(socket.remoteAddress, socket.remotePort); - } - const lOpts = multiaddrToNetConfig(remoteAddr); - const lOptsStr = lOpts.path ?? `${lOpts.host ?? ''}:${lOpts.port ?? ''}`; - const { sink, source } = toIterable.duplex(socket); - // by default there is no timeout - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#socketsettimeouttimeout-callback - socket.setTimeout(inactivityTimeout, () => { - log('%s socket read timeout', lOptsStr); - metrics?.increment({ [`${metricPrefix}timeout`]: true }); - // only destroy with an error if the remote has not sent the FIN message - let err; - if (socket.readable) { - err = new CodeError('Socket read timeout', 'ERR_SOCKET_READ_TIMEOUT'); - } - // if the socket times out due to inactivity we must manually close the connection - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#event-timeout - socket.destroy(err); - }); - socket.once('close', () => { - log('%s socket close', lOptsStr); - metrics?.increment({ [`${metricPrefix}close`]: true }); - // In instances where `close` was not explicitly called, - // such as an iterable stream ending, ensure we have set the close - // timeline - if (maConn.timeline.close == null) { - maConn.timeline.close = Date.now(); - } - }); - socket.once('end', () => { - // the remote sent a FIN packet which means no more data will be sent - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#event-end - log('%s socket end', lOptsStr); - metrics?.increment({ [`${metricPrefix}end`]: true }); - }); - const maConn = { - async sink(source) { - try { - await sink((async function* () { - for await (const buf of source) { - if (buf instanceof Uint8Array) { - yield buf; - } - else { - // is it faster to yield all the buffers or just one big buffer? - yield buf.subarray(); - } - } - })()); - } - catch (err) { - // If aborted we can safely ignore - if (err.type !== 'aborted') { - // If the source errored the socket will already have been destroyed by - // toIterable.duplex(). If the socket errored it will already be - // destroyed. There's nothing to do here except log the error & return. - log(err); - } - } - // we have finished writing, send the FIN message - socket.end(); - }, - source, - // If the remote address was passed, use it - it may have the peer ID encapsulated - remoteAddr, - timeline: { open: Date.now() }, - async close(options = {}) { - if (socket.destroyed) { - log('%s socket was already destroyed when trying to close', lOptsStr); - return; - } - if (options.signal == null) { - const signal = AbortSignal.timeout(closeTimeout); - options = { - ...options, - signal - }; - } - try { - log('%s closing socket', lOptsStr); - await new Promise((resolve, reject) => { - socket.once('close', () => { - // socket completely closed - log('%s socket closed', lOptsStr); - resolve(); - }); - socket.once('error', (err) => { - log('%s socket error', lOptsStr, err); - // error closing socket - if (maConn.timeline.close == null) { - maConn.timeline.close = Date.now(); - } - reject(err); - }); - // shorten inactivity timeout - socket.setTimeout(closeTimeout); - // close writable end of the socket - socket.end(); - if (socket.writableLength > 0) { - // there are outgoing bytes waiting to be sent - socket.once('drain', () => { - log('%s socket drained', lOptsStr); - // all bytes have been sent we can destroy the socket (maybe) before the timeout - socket.destroy(); - }); - } - else { - // nothing to send, destroy immediately, no need for the timeout - socket.destroy(); - } - }); - } - catch (err) { - this.abort(err); - } - }, - abort: (err) => { - log('%s socket abort due to error', lOptsStr, err); - socket.destroy(err); - }, - log - }; - return maConn; -}; -//# sourceMappingURL=socket-to-conn.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/socket-to-conn.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/socket-to-conn.js.map deleted file mode 100644 index 0814b79a2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/socket-to-conn.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"socket-to-conn.js","sourceRoot":"","sources":["../../src/socket-to-conn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CA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AAC,CAAA;aACH;YAAC,OAAO,GAAQ,EAAE;gBACjB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;aAChB;QACH,CAAC;QAED,KAAK,EAAE,CAAC,GAAU,EAAE,EAAE;YACpB,GAAG,CAAC,8BAA8B,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAA;YAElD,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QACrB,CAAC;QAED,GAAG;KACJ,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/utils.d.ts deleted file mode 100644 index fcaacb7f9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/utils.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// -import type { Multiaddr } from '@multiformats/multiaddr'; -import type { ListenOptions, IpcSocketConnectOpts, TcpSocketConnectOpts } from 'net'; -export type NetConfig = ListenOptions | (IpcSocketConnectOpts & TcpSocketConnectOpts); -export declare function multiaddrToNetConfig(addr: Multiaddr, config?: NetConfig): NetConfig; -export declare function getMultiaddrs(proto: 'ip4' | 'ip6', ip: string, port: number): Multiaddr[]; -export declare function isAnyAddr(ip: string): boolean; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/utils.d.ts.map deleted file mode 100644 index c29db63f2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,KAAK,CAAA;AAIpF,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,CAAC,oBAAoB,GAAG,oBAAoB,CAAC,CAAA;AAErF,wBAAgB,oBAAoB,CAAE,IAAI,EAAE,SAAS,EAAE,MAAM,GAAE,SAAc,GAAG,SAAS,CAexF;AAED,wBAAgB,aAAa,CAAE,KAAK,EAAE,KAAK,GAAG,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CAG1F;AAED,wBAAgB,SAAS,CAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAE9C"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/utils.js deleted file mode 100644 index 6516cfd6d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/utils.js +++ /dev/null @@ -1,41 +0,0 @@ -import os from 'os'; -import path from 'path'; -import { multiaddr } from '@multiformats/multiaddr'; -const ProtoFamily = { ip4: 'IPv4', ip6: 'IPv6' }; -export function multiaddrToNetConfig(addr, config = {}) { - const listenPath = addr.getPath(); - // unix socket listening - if (listenPath != null) { - if (os.platform() === 'win32') { - // Use named pipes on Windows systems. - return { path: path.join('\\\\.\\pipe\\', listenPath) }; - } - else { - return { path: listenPath }; - } - } - // tcp listening - return { ...config, ...addr.toOptions() }; -} -export function getMultiaddrs(proto, ip, port) { - const toMa = (ip) => multiaddr(`/${proto}/${ip}/tcp/${port}`); - return (isAnyAddr(ip) ? getNetworkAddrs(ProtoFamily[proto]) : [ip]).map(toMa); -} -export function isAnyAddr(ip) { - return ['0.0.0.0', '::'].includes(ip); -} -const networks = os.networkInterfaces(); -function getNetworkAddrs(family) { - const addresses = []; - for (const [, netAddrs] of Object.entries(networks)) { - if (netAddrs != null) { - for (const netAddr of netAddrs) { - if (netAddr.family === family) { - addresses.push(netAddr.address); - } - } - } - } - return addresses; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/utils.js.map deleted file mode 100644 index 882084ffd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/src/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAInD,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,CAAA;AAIhD,MAAM,UAAU,oBAAoB,CAAE,IAAe,EAAE,SAAoB,EAAE;IAC3E,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,CAAA;IAEjC,wBAAwB;IACxB,IAAI,UAAU,IAAI,IAAI,EAAE;QACtB,IAAI,EAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,EAAE;YAC7B,sCAAsC;YACtC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,EAAE,CAAA;SACxD;aAAM;YACL,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAA;SAC5B;KACF;IAED,gBAAgB;IAChB,OAAO,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,EAAE,CAAA;AAC3C,CAAC;AAED,MAAM,UAAU,aAAa,CAAE,KAAoB,EAAE,EAAU,EAAE,IAAY;IAC3E,MAAM,IAAI,GAAG,CAAC,EAAU,EAAa,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,IAAI,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAA;IAChF,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAC/E,CAAC;AAED,MAAM,UAAU,SAAS,CAAE,EAAU;IACnC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;AACvC,CAAC;AAED,MAAM,QAAQ,GAAG,EAAE,CAAC,iBAAiB,EAAE,CAAA;AAEvC,SAAS,eAAe,CAAE,MAAc;IACtC,MAAM,SAAS,GAAa,EAAE,CAAA;IAE9B,KAAK,MAAM,CAAC,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QACnD,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;gBAC9B,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE;oBAC7B,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;iBAChC;aACF;SACF;KACF;IAED,OAAO,SAAS,CAAA;AAClB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/compliance.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/compliance.spec.d.ts deleted file mode 100644 index dac08d9d2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/compliance.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=compliance.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/compliance.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/compliance.spec.d.ts.map deleted file mode 100644 index dc9e71995..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/compliance.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.d.ts","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/compliance.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/compliance.spec.js deleted file mode 100644 index a9a426d73..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/compliance.spec.js +++ /dev/null @@ -1,43 +0,0 @@ -import net from 'net'; -import tests from '@libp2p/interface-compliance-tests/transport'; -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import sinon from 'sinon'; -import { tcp } from '../src/index.js'; -describe('interface-transport compliance', () => { - tests({ - async setup() { - const transport = tcp()({ - logger: defaultLogger() - }); - const addrs = [ - multiaddr('/ip4/127.0.0.1/tcp/9091'), - multiaddr('/ip4/127.0.0.1/tcp/9092'), - multiaddr('/ip4/127.0.0.1/tcp/9093'), - multiaddr('/ip6/::/tcp/9094') - ]; - // Used by the dial tests to simulate a delayed connect - const connector = { - delay(delayMs) { - const netConnect = net.connect; - sinon.replace(net, 'connect', (opts) => { - const socket = netConnect(opts); - const socketEmit = socket.emit.bind(socket); - sinon.replace(socket, 'emit', (...args) => { - const time = args[0] === 'connect' ? delayMs : 0; - setTimeout(() => socketEmit(...args), time); - return true; - }); - return socket; - }); - }, - restore() { - sinon.restore(); - } - }; - return { transport, addrs, connector }; - }, - async teardown() { } - }); -}); -//# sourceMappingURL=compliance.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/compliance.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/compliance.spec.js.map deleted file mode 100644 index 1f1b3b2ef..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/compliance.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.js","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,KAAK,MAAM,8CAA8C,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAErC,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,KAAK,CAAC;QACJ,KAAK,CAAC,KAAK;YACT,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC;gBACtB,MAAM,EAAE,aAAa,EAAE;aACxB,CAAC,CAAA;YACF,MAAM,KAAK,GAAG;gBACZ,SAAS,CAAC,yBAAyB,CAAC;gBACpC,SAAS,CAAC,yBAAyB,CAAC;gBACpC,SAAS,CAAC,yBAAyB,CAAC;gBACpC,SAAS,CAAC,kBAAkB,CAAC;aAC9B,CAAA;YAED,uDAAuD;YACvD,MAAM,SAAS,GAAG;gBAChB,KAAK,CAAE,OAAe;oBACpB,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAA;oBAC9B,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC,IAAS,EAAE,EAAE;wBAC1C,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;wBAC/B,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;wBAC3C,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,IAAc,EAAE,EAAE;4BAClD,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;4BAChD,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;4BAC3C,OAAO,IAAI,CAAA;wBACb,CAAC,CAAC,CAAA;wBACF,OAAO,MAAM,CAAA;oBACf,CAAC,CAAC,CAAA;gBACJ,CAAC;gBACD,OAAO;oBACL,KAAK,CAAC,OAAO,EAAE,CAAA;gBACjB,CAAC;aACF,CAAA;YAED,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAA;QACxC,CAAC;QACD,KAAK,CAAC,QAAQ,KAAK,CAAC;KACrB,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection-limits.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection-limits.spec.d.ts deleted file mode 100644 index 502dc4ab3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection-limits.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=connection-limits.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection-limits.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection-limits.spec.d.ts.map deleted file mode 100644 index 4512df906..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection-limits.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-limits.spec.d.ts","sourceRoot":"","sources":["../../test/connection-limits.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection-limits.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection-limits.spec.js deleted file mode 100644 index 577c74dfd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection-limits.spec.js +++ /dev/null @@ -1,188 +0,0 @@ -import net from 'node:net'; -import { promisify } from 'util'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { tcp } from '../src/index.js'; -const buildSocketAssertions = (port, closeCallbacks) => { - function createSocket(i) { - const socket = net.connect({ host: '127.0.0.1', port }); - closeCallbacks.unshift(async function closeHandler() { - if (!socket.destroyed) { - socket.destroy(); - await new Promise((resolve) => socket.on('close', resolve)); - } - }); - return socket; - } - async function assertConnectedSocket(i) { - const socket = createSocket(i); - await new Promise((resolve, reject) => { - socket.once('connect', () => { - resolve(); - }); - socket.once('error', (err) => { - err.message = `Socket[${i}] ${err.message}`; - reject(err); - }); - }); - return socket; - } - async function assertRefusedSocket(i) { - const socket = createSocket(i); - await new Promise((resolve, reject) => { - socket.once('connect', () => { - reject(Error(`Socket[${i}] connected but was expected to reject`)); - }); - socket.once('error', (err) => { - if (err.message.includes('ECONNREFUSED')) { - resolve(); - } - else { - err.message = `Socket[${i}] unexpected error ${err.message}`; - reject(err); - } - }); - }); - return socket; - } - return { assertConnectedSocket, assertRefusedSocket }; -}; -async function assertServerConnections(listener, connections) { - // Expect server connections but allow time for sockets to connect or disconnect - for (let i = 0; i < 100; i++) { - // eslint-disable-next-line @typescript-eslint/dot-notation - if (listener['connections'].size === connections) { - return; - } - else { - await promisify(setTimeout)(10); - } - } - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(listener['connections'].size).equals(connections, 'invalid amount of server connections'); -} -describe('closeAbove/listenBelow', () => { - const afterEachCallbacks = []; - afterEach(async () => { - await Promise.all(afterEachCallbacks.map(fn => fn())); - afterEachCallbacks.length = 0; - }); - it('reject dial of connection above closeAbove', async () => { - const listenBelow = 2; - const closeAbove = 3; - const port = 9900; - const trasnport = tcp({ closeServerOnMaxConnections: { listenBelow, closeAbove } })({ - logger: defaultLogger() - }); - const upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - const listener = trasnport.createListener({ upgrader }); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.push(() => listener.close()); - await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`)); - const { assertConnectedSocket, assertRefusedSocket } = buildSocketAssertions(port, afterEachCallbacks); - await assertConnectedSocket(1); - await assertConnectedSocket(2); - await assertConnectedSocket(3); - await assertServerConnections(listener, 3); - // Limit reached, server should be closed here - await assertRefusedSocket(4); - await assertRefusedSocket(5); - await assertServerConnections(listener, 3); - }); - it('accepts dial of connection when connection drop listenBelow limit', async () => { - const listenBelow = 2; - const closeAbove = 3; - const port = 9900; - const trasnport = tcp({ closeServerOnMaxConnections: { listenBelow, closeAbove } })({ - logger: defaultLogger() - }); - const upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - const listener = trasnport.createListener({ upgrader }); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.push(() => listener.close()); - await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`)); - const { assertConnectedSocket } = buildSocketAssertions(port, afterEachCallbacks); - const socket1 = await assertConnectedSocket(1); - const socket2 = await assertConnectedSocket(2); - await assertConnectedSocket(3); - await assertServerConnections(listener, 3); - // Destroy sockets to be have connections < listenBelow - socket1.destroy(); - socket2.destroy(); - // After destroying 2 sockets connections will be below "listenBelow" limit - await assertServerConnections(listener, 1); - // Now it should be able to accept new connections - await assertConnectedSocket(4); - await assertConnectedSocket(5); - // 2 connections dropped and 2 new connections accepted - await assertServerConnections(listener, 3); - }); - it('should not emit "close" event when server is stopped due to "closeAbove" limit', async () => { - const listenBelow = 2; - const closeAbove = 3; - const port = 9900; - const trasnport = tcp({ closeServerOnMaxConnections: { listenBelow, closeAbove } })({ - logger: defaultLogger() - }); - const upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - const listener = trasnport.createListener({ upgrader }); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.push(() => listener.close()); - let closeEventCallCount = 0; - listener.addEventListener('close', () => { - closeEventCallCount += 1; - }); - await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`)); - const { assertConnectedSocket } = buildSocketAssertions(port, afterEachCallbacks); - await assertConnectedSocket(1); - await assertConnectedSocket(2); - await assertConnectedSocket(3); - await assertServerConnections(listener, 3); - // Limit reached, server should be closed but should not emit "close" event - expect(closeEventCallCount).equals(0); - }); - it('should emit "listening" event when server is resumed due to "listenBelow" limit', async () => { - const listenBelow = 2; - const closeAbove = 3; - const port = 9900; - const trasnport = tcp({ closeServerOnMaxConnections: { listenBelow, closeAbove } })({ - logger: defaultLogger() - }); - const upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - const listener = trasnport.createListener({ upgrader }); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.push(() => listener.close()); - let listeningEventCallCount = 0; - listener.addEventListener('listening', () => { - listeningEventCallCount += 1; - }); - await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`)); - const { assertConnectedSocket } = buildSocketAssertions(port, afterEachCallbacks); - // Server should be listening now - expect(listeningEventCallCount).equals(1); - const socket1 = await assertConnectedSocket(1); - const socket2 = await assertConnectedSocket(2); - await assertConnectedSocket(3); - // Limit reached, server should be closed now - await assertServerConnections(listener, 3); - // Close some sockets to resume listening - socket1.destroy(); - socket2.destroy(); - // Wait for listener to emit event - await promisify(setTimeout)(50); - // Server should emit the "listening" event again - expect(listeningEventCallCount).equals(2); - }); -}); -//# sourceMappingURL=connection-limits.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection-limits.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection-limits.spec.js.map deleted file mode 100644 index 801ffd48b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection-limits.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-limits.spec.js","sourceRoot":"","sources":["../../test/connection-limits.spec.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAA;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAGrC,MAAM,qBAAqB,GAAG,CAAC,IAAY,EAAE,cAA+C,EAAkH,EAAE;IAC9M,SAAS,YAAY,CAAE,C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,MAAM,qBAAqB,CAAC,CAAC,CAAC,CAAA;QAC9B,6CAA6C;QAC7C,MAAM,uBAAuB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;QAE1C,yCAAyC;QACzC,OAAO,CAAC,OAAO,EAAE,CAAA;QACjB,OAAO,CAAC,OAAO,EAAE,CAAA;QAEjB,kCAAkC;QAClC,MAAM,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAA;QAE/B,iDAAiD;QACjD,MAAM,CAAC,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection.spec.d.ts deleted file mode 100644 index 91628ea6f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=connection.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection.spec.d.ts.map deleted file mode 100644 index a6153fade..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection.spec.d.ts","sourceRoot":"","sources":["../../test/connection.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection.spec.js deleted file mode 100644 index d4bed18d2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection.spec.js +++ /dev/null @@ -1,73 +0,0 @@ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { tcp } from '../src/index.js'; -describe('valid localAddr and remoteAddr', () => { - let transport; - let upgrader; - beforeEach(() => { - transport = tcp()({ - logger: defaultLogger() - }); - upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - }); - const ma = multiaddr('/ip4/127.0.0.1/tcp/0'); - it('should resolve port 0', async () => { - // Create a Promise that resolves when a connection is handled - let handled; - const handlerPromise = new Promise(resolve => { handled = resolve; }); - const handler = (conn) => { handled(conn); }; - // Create a listener with the handler - const listener = transport.createListener({ - handler, - upgrader - }); - // Listen on the multi-address - await listener.listen(ma); - const localAddrs = listener.getAddrs(); - expect(localAddrs.length).to.equal(1); - // Dial to that address - await transport.dial(localAddrs[0], { - upgrader - }); - // Wait for the incoming dial to be handled - await handlerPromise; - // Close the listener - await listener.close(); - }); - it('should handle multiple simultaneous closes', async () => { - // Create a Promise that resolves when a connection is handled - let handled; - const handlerPromise = new Promise(resolve => { handled = resolve; }); - const handler = (conn) => { handled(conn); }; - // Create a listener with the handler - const listener = transport.createListener({ - handler, - upgrader - }); - // Listen on the multi-address - await listener.listen(ma); - const localAddrs = listener.getAddrs(); - expect(localAddrs.length).to.equal(1); - // Dial to that address - const dialerConn = await transport.dial(localAddrs[0], { - upgrader - }); - // Wait for the incoming dial to be handled - await handlerPromise; - // Close the dialer with two simultaneous calls to `close` - await Promise.race([ - new Promise((resolve, reject) => setTimeout(() => { reject(new Error('Timed out waiting for connection close')); }, 500)), - await Promise.all([ - dialerConn.close(), - dialerConn.close() - ]) - ]); - await listener.close(); - }); -}); -//# sourceMappingURL=connection.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection.spec.js.map deleted file mode 100644 index 7dc8f31d7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/connection.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection.spec.js","sourceRoot":"","sources":["../../test/connection.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAIrC,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,IAAI,SAAoB,CAAA;IACxB,IAAI,QAAkB,CAAA;IAEtB,UAAU,CAAC,GAAG,EAAE;QACd,SAAS,GAAG,GAAG,EAAE,CAAC;YAChB,MAAM,EAAE,aAAa,EAAE;SACxB,CAAC,CAAA;QACF,QAAQ,GAAG,YAAY,CAAC;YACtB,MAAM,EAAE,IAAI,iBAAiB,EAAE;SAChC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,MAAM,EAAE,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAA;IAE5C,EAAE,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE;QACrC,8DAA8D;QAC9D,IAAI,OAAmC,CAAA;QACvC,MAAM,cAAc,GAAG,IAAI,OAAO,CAAa,OAAO,CAAC,EAAE,GAAG,O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,CAAC,QAAQ,EAAE,CAAA;QACtC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAErC,uBAAuB;QACvB,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;YACrD,QAAQ;SACT,CAAC,CAAA;QAEF,2CAA2C;QAC3C,MAAM,cAAc,CAAA;QAEpB,0DAA0D;QAC1D,MAAM,OAAO,CAAC,IAAI,CAAC;YACjB,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC,CAAA,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YACxH,MAAM,OAAO,CAAC,GAAG,CAAC;gBAChB,UAAU,CAAC,KAAK,EAAE;gBAClB,UAAU,CAAC,KAAK,EAAE;aACnB,CAAC;SACH,CAAC,CAAA;QAEF,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAA;IACxB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/filter.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/filter.spec.d.ts deleted file mode 100644 index ab805424d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/filter.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=filter.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/filter.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/filter.spec.d.ts.map deleted file mode 100644 index cdd7b3f4c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/filter.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"filter.spec.d.ts","sourceRoot":"","sources":["../../test/filter.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/filter.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/filter.spec.js deleted file mode 100644 index 944a2d63c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/filter.spec.js +++ /dev/null @@ -1,38 +0,0 @@ -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { tcp } from '../src/index.js'; -describe('filter addrs', () => { - const base = '/ip4/127.0.0.1'; - const ipfs = '/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'; - const unix = '/tmp/some/file.sock'; - let transport; - before(() => { - transport = tcp()({ - logger: defaultLogger() - }); - }); - it('filter valid addrs for this transport', () => { - const ma1 = multiaddr(base + '/tcp/9090'); - const ma2 = multiaddr(base + '/udp/9090'); - const ma3 = multiaddr(base + '/tcp/9090/http'); - const ma4 = multiaddr(base + '/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'); - const ma5 = multiaddr(base + '/tcp/9090/http' + ipfs); - const ma6 = multiaddr('/ip4/127.0.0.1/tcp/9090/p2p-circuit' + ipfs); - const ma7 = multiaddr('/dns4/libp2p.io/tcp/9090'); - const ma8 = multiaddr('/dnsaddr/libp2p.io/tcp/9090'); - const ma9 = multiaddr('/unix' + unix); - const valid = transport.filter([ma1, ma2, ma3, ma4, ma5, ma6, ma7, ma8, ma9]); - expect(valid.length).to.equal(5); - expect(valid[0]).to.deep.equal(ma1); - expect(valid[1]).to.deep.equal(ma4); - expect(valid[4]).to.deep.equal(ma9); - }); - it('filter a single addr for this transport', () => { - const ma1 = multiaddr(base + '/tcp/9090'); - const valid = transport.filter([ma1]); - expect(valid.length).to.equal(1); - expect(valid[0]).to.eql(ma1); - }); -}); -//# sourceMappingURL=filter.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/filter.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/filter.spec.js.map deleted file mode 100644 index 6ffefe6d8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/filter.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"filter.spec.js","sourceRoot":"","sources":["../../test/filter.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAGrC,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,MAAM,IAAI,GAAG,gBAAgB,CAAA;IAC7B,MAAM,IAAI,GAAG,sDAAsD,CAAA;IACnE,MAAM,IAAI,GAAG,qBAAqB,CAAA;IAElC,IAAI,SAAoB,CAAA;IAExB,MAAM,CAAC,GAAG,EAAE;QACV,SAAS,GAAG,GAAG,EAAE,CAAC;YAChB,MAAM,EAAE,aAAa,EAAE;SACxB,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,GAAG,WAAW,CAAC,CAAA;QACzC,MAA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WAAW,CAAC,CAAA;QAEzC,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;QACrC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAChC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC9B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/listen-dial.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/listen-dial.spec.d.ts deleted file mode 100644 index a90db0054..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/listen-dial.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=listen-dial.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/listen-dial.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/listen-dial.spec.d.ts.map deleted file mode 100644 index e2e65e44e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/listen-dial.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listen-dial.spec.d.ts","sourceRoot":"","sources":["../../test/listen-dial.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/listen-dial.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/listen-dial.spec.js deleted file mode 100644 index db2b02346..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/listen-dial.spec.js +++ /dev/null @@ -1,308 +0,0 @@ -import os from 'os'; -import path from 'path'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockRegistrar, mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import all from 'it-all'; -import { pipe } from 'it-pipe'; -import pDefer from 'p-defer'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { tcp } from '../src/index.js'; -const isCI = process.env.CI; -describe('listen', () => { - let transport; - let listener; - let upgrader; - beforeEach(() => { - transport = tcp()({ - logger: defaultLogger() - }); - upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - }); - afterEach(async () => { - try { - if (listener != null) { - await listener.close(); - } - } - catch { - // some tests close the listener so ignore errors - } - }); - it('listen on path', async () => { - const mh = multiaddr(`/unix/${path.resolve(os.tmpdir(), `/tmp/p2pd-${Date.now()}.sock`)}`); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - }); - it('listen on port 0', async () => { - const mh = multiaddr('/ip4/127.0.0.1/tcp/0'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - }); - it('errors when listening on busy port', async () => { - const mh = multiaddr('/ip4/127.0.0.1/tcp/0'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const listener2 = transport.createListener({ - upgrader - }); - const mh2 = listener.getAddrs()[0]; - await expect(listener2.listen(mh2)).to.eventually.be.rejected() - .with.property('code', 'EADDRINUSE'); - }); - it('listen on IPv6 addr', async () => { - if (isCI != null) { - return; - } - const mh = multiaddr('/ip6/::/tcp/9090'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - }); - it('listen on any Interface', async () => { - const mh = multiaddr('/ip4/0.0.0.0/tcp/9090'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - }); - it('getAddrs', async () => { - const mh = multiaddr('/ip4/127.0.0.1/tcp/9090'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length).to.equal(1); - expect(multiaddrs[0]).to.deep.equal(mh); - }); - it('getAddrs on port 0 listen', async () => { - const mh = multiaddr('/ip4/127.0.0.1/tcp/0'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length).to.equal(1); - }); - it('getAddrs from listening on 0.0.0.0', async () => { - const mh = multiaddr('/ip4/0.0.0.0/tcp/9090'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length > 0).to.equal(true); - expect(multiaddrs[0].toString().indexOf('0.0.0.0')).to.equal(-1); - }); - it('getAddrs from listening on 0.0.0.0 and port 0', async () => { - const mh = multiaddr('/ip4/0.0.0.0/tcp/0'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length > 0).to.equal(true); - expect(multiaddrs[0].toString().indexOf('0.0.0.0')).to.equal(-1); - }); - it('getAddrs from listening on ip6 \'::\'', async () => { - const mh = multiaddr('/ip6/::/tcp/9090'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length > 0).to.equal(true); - expect(multiaddrs[0].toOptions().host).to.not.equal('::'); - }); - it('getAddrs preserves IPFS Id', async () => { - const mh = multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length).to.equal(1); - expect(multiaddrs[0]).to.deep.equal(mh); - }); -}); -describe('dial', () => { - const protocol = '/echo/1.0.0'; - let transport; - let upgrader; - beforeEach(async () => { - const registrar = mockRegistrar(); - void registrar.handle(protocol, (evt) => { - void pipe(evt.stream, evt.stream); - }); - upgrader = mockUpgrader({ - registrar, - events: new TypedEventEmitter() - }); - transport = tcp()({ - logger: defaultLogger() - }); - }); - it('dial on IPv4', async () => { - const ma = multiaddr('/ip4/127.0.0.1/tcp/9090'); - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const conn = await transport.dial(ma, { - upgrader - }); - const stream = await conn.newStream([protocol]); - const values = await pipe([uint8ArrayFromString('hey')], stream, async (source) => all(source)); - expect(values[0].subarray()).to.equalBytes(uint8ArrayFromString('hey')); - await conn.close(); - await listener.close(); - }); - it('dial on IPv6', async () => { - if (isCI != null) { - return; - } - const ma = multiaddr('/ip6/::/tcp/9090'); - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const conn = await transport.dial(ma, { - upgrader - }); - const stream = await conn.newStream([protocol]); - const values = await pipe([uint8ArrayFromString('hey')], stream, async (source) => all(source)); - expect(values[0].subarray()).to.equalBytes(uint8ArrayFromString('hey')); - await conn.close(); - await listener.close(); - }); - it('dial on path', async () => { - const ma = multiaddr(`/unix/${path.resolve(os.tmpdir(), `/tmp/p2pd-${Date.now()}.sock`)}`); - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const conn = await transport.dial(ma, { - upgrader - }); - const stream = await conn.newStream([protocol]); - const values = await pipe([uint8ArrayFromString('hey')], stream, async (source) => all(source)); - expect(values[0].subarray()).to.equalBytes(uint8ArrayFromString('hey')); - await conn.close(); - await listener.close(); - }); - it('dial and destroy on listener', async () => { - let handled; - const handledPromise = new Promise(resolve => { handled = resolve; }); - const ma = multiaddr('/ip6/::/tcp/9090'); - const listener = transport.createListener({ - handler: (conn) => { - // let multistream select finish before closing - setTimeout(() => { - void conn.close() - .then(() => { handled(); }); - }, 100); - }, - upgrader - }); - await listener.listen(ma); - const addrs = listener.getAddrs(); - const conn = await transport.dial(addrs[0], { - upgrader - }); - const stream = await conn.newStream([protocol]); - pipe(stream); - await handledPromise; - await conn.close(); - await listener.close(); - }); - it('dial and destroy on dialer', async () => { - if (isCI != null) { - return; - } - let handled; - const handledPromise = new Promise(resolve => { handled = resolve; }); - const ma = multiaddr('/ip6/::/tcp/9090'); - const listener = transport.createListener({ - handler: () => { - handled(); - }, - upgrader - }); - await listener.listen(ma); - const addrs = listener.getAddrs(); - const conn = await transport.dial(addrs[0], { - upgrader - }); - await conn.close(); - await handledPromise; - await listener.close(); - }); - it('dials on IPv4 with IPFS Id', async () => { - const ma = multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'); - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const conn = await transport.dial(ma, { - upgrader - }); - const stream = await conn.newStream([protocol]); - const values = await pipe([uint8ArrayFromString('hey')], stream, async (source) => all(source)); - expect(values[0].subarray()).to.equalBytes(uint8ArrayFromString('hey')); - await conn.close(); - await listener.close(); - }); - it('aborts during dial', async () => { - const ma = multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'); - const maConnPromise = pDefer(); - // @ts-expect-error missing return value - upgrader.upgradeOutbound = async (maConn) => { - maConnPromise.resolve(maConn); - // take a long time to give us time to abort the dial - await new Promise((resolve) => { - setTimeout(() => { resolve(); }, 100); - }); - }; - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const abortController = new AbortController(); - // abort once the upgrade process has started - void maConnPromise.promise.then(() => { abortController.abort(); }); - await expect(transport.dial(ma, { - upgrader, - signal: abortController.signal - })).to.eventually.be.rejected('The operation was aborted'); - await expect(maConnPromise.promise).to.eventually.have.nested.property('timeline.close') - .that.is.ok('did not gracefully close maConn'); - await listener.close(); - }); - it('aborts before dial', async () => { - const ma = multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'); - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const abortController = new AbortController(); - abortController.abort(); - await expect(transport.dial(ma, { - upgrader, - signal: abortController.signal - })).to.eventually.be.rejected('The operation was aborted'); - await listener.close(); - }); -}); -//# sourceMappingURL=listen-dial.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/listen-dial.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/listen-dial.spec.js.map deleted file mode 100644 index a83699924..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/listen-dial.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listen-dial.spec.js","sourceRoot":"","sources":["../../test/listen-dial.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,GAAG,MAAM,QAAQ,CAAA;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAIrC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAA;AAE3B,QAAQ,CAAC,QAAQ,EAAE,GAA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AE,eAAe,CAAC,MAAM;SAC/B,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAA;QAE1D,MAAM,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC;aACrF,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,iCAAiC,CAAC,CAAA;QAEhD,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAA;IACxB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;QAClC,MAAM,EAAE,GAAG,SAAS,CAAC,6EAA6E,CAAC,CAAA;QACnG,MAAM,QAAQ,GAAG,SAAS,CAAC,cAAc,CAAC;YACxC,QAAQ;SACT,CAAC,CAAA;QACF,MAAM,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QAEzB,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAA;QAC7C,eAAe,CAAC,KAAK,EAAE,CAAA;QAEvB,MAAM,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE;YAC9B,QAAQ;YACR,MAAM,EAAE,eAAe,CAAC,MAAM;SAC/B,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAA;QAE1D,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAA;IACxB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/max-connections.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/max-connections.spec.d.ts deleted file mode 100644 index 72a08e916..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/max-connections.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=max-connections.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/max-connections.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/max-connections.spec.d.ts.map deleted file mode 100644 index ab2ee9d2f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/max-connections.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"max-connections.spec.d.ts","sourceRoot":"","sources":["../../test/max-connections.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/max-connections.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/max-connections.spec.js deleted file mode 100644 index ab083765e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/max-connections.spec.js +++ /dev/null @@ -1,73 +0,0 @@ -import net from 'node:net'; -import { promisify } from 'node:util'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { tcp } from '../src/index.js'; -describe('maxConnections', () => { - const afterEachCallbacks = []; - afterEach(async () => { - await Promise.all(afterEachCallbacks.map(fn => fn())); - afterEachCallbacks.length = 0; - }); - it('reject dial of connection above maxConnections', async () => { - const maxConnections = 2; - const socketCount = 4; - const port = 9900; - const seenRemoteConnections = new Set(); - const transport = tcp({ maxConnections })({ - logger: defaultLogger() - }); - const upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - const listener = transport.createListener({ upgrader }); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.push(() => listener.close()); - await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`)); - listener.addEventListener('connection', (conn) => { - seenRemoteConnections.add(conn.detail.remoteAddr.toString()); - }); - const sockets = []; - for (let i = 0; i < socketCount; i++) { - const socket = net.connect({ host: '127.0.0.1', port }); - sockets.push(socket); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.unshift(async () => { - if (!socket.destroyed) { - socket.destroy(); - await new Promise((resolve) => socket.on('close', resolve)); - } - }); - // Wait for connection so the order of sockets is stable, sockets expected to be alive are always [0,1] - await new Promise((resolve, reject) => { - socket.on('connect', () => { - resolve(); - }); - socket.on('error', (err) => { - reject(err); - }); - }); - } - // With server.maxConnections the TCP socket is created and the initial handshake is completed - // Then in the server handler NodeJS javascript code will call socket.emit('drop') if over the limit - // https://github.com/nodejs/node/blob/fddc701d3c0eb4520f2af570876cc987ae6b4ba2/lib/net.js#L1706 - // Wait for some time for server to drop all sockets above limit - await promisify(setTimeout)(250); - expect(seenRemoteConnections.size).equals(maxConnections, 'wrong serverConnections'); - for (let i = 0; i < socketCount; i++) { - const socket = sockets[i]; - if (i < maxConnections) { - // Assert socket connected - expect(socket.destroyed).equals(false, `socket ${i} under limit must not be destroyed`); - } - else { - // Assert socket ended - expect(socket.destroyed).equals(true, `socket ${i} above limit must be destroyed`); - } - } - }); -}); -//# sourceMappingURL=max-connections.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/max-connections.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/max-connections.spec.js.map deleted file mode 100644 index 232ec408b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/max-connections.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"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,EAAE;oBACzB,MAAM,CAAC,GAAG,CAAC,CAAA;gBACb,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;SACH;QAED,8FAA8F;QAC9F,oGAAoG;QACpG,gGAAgG;QAEhG,gEAAgE;QAChE,MAAM,SAAS,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAA;QAEhC,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,yBAAyB,CAAC,CAAA;QAEpF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,CAAC,EAAE,EAAE;YACpC,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;YAEzB,IAAI,CAAC,GAAG,cAAc,EAAE;gBACtB,0BAA0B;gBAC1B,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,oCAAoC,CAAC,CAAA;aACxF;iBAAM;gBACL,sBAAsB;gBACtB,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,gCAAgC,CAAC,CAAA;aACnF;SACF;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/socket-to-conn.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/socket-to-conn.spec.d.ts deleted file mode 100644 index ca7834908..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/socket-to-conn.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=socket-to-conn.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/socket-to-conn.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/socket-to-conn.spec.d.ts.map deleted file mode 100644 index a1baee8e2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/socket-to-conn.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"socket-to-conn.spec.d.ts","sourceRoot":"","sources":["../../test/socket-to-conn.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/socket-to-conn.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/socket-to-conn.spec.js deleted file mode 100644 index bbd6a547f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/socket-to-conn.spec.js +++ /dev/null @@ -1,326 +0,0 @@ -import { createServer, Socket } from 'net'; -import os from 'os'; -import { defaultLogger } from '@libp2p/logger'; -import { expect } from 'aegir/chai'; -import defer from 'p-defer'; -import { toMultiaddrConnection } from '../src/socket-to-conn.js'; -async function setup(opts) { - const serverListening = defer(); - const server = createServer(opts?.server); - server.listen(0, () => { - serverListening.resolve(); - }); - await serverListening.promise; - const serverSocket = defer(); - const clientSocket = defer(); - server.once('connection', (socket) => { - serverSocket.resolve(socket); - }); - const address = server.address(); - if (address == null || typeof address === 'string') { - throw new Error('Wrong socket type'); - } - const client = new Socket(opts?.client); - client.once('connect', () => { - clientSocket.resolve(client); - }); - client.connect(address.port, address.address); - return { - server, - serverSocket: await serverSocket.promise, - clientSocket: await clientSocket.promise - }; -} -describe('socket-to-conn', () => { - let server; - let clientSocket; - let serverSocket; - afterEach(async () => { - if (serverSocket != null) { - serverSocket.destroy(); - } - if (clientSocket != null) { - clientSocket.destroy(); - } - if (server != null) { - server.close(); - } - }); - it('should destroy a socket that is closed by the client', async () => { - ({ server, clientSocket, serverSocket } = await setup()); - // promise that is resolved when client socket is closed - const clientClosed = defer(); - // promise that is resolved when client socket errors - const clientErrored = defer(); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - // promise that is resolved when our outgoing socket errors - const serverErrored = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - clientSocket.once('close', () => { - clientClosed.resolve(true); - }); - clientSocket.once('error', err => { - clientErrored.resolve(err); - }); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - serverSocket.once('error', err => { - serverErrored.resolve(err); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - // close the client for writing - clientSocket.end(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket that is forcibly closed by the client', async () => { - ({ server, clientSocket, serverSocket } = await setup()); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - // promise that is resolved when our outgoing socket errors - const serverErrored = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - serverSocket.once('error', err => { - serverErrored.resolve(err); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - // close the client for reading and writing immediately - clientSocket.destroy(); - // client closed the connection - error code is platform specific - if (os.platform() === 'linux') { - await expect(serverErrored.promise).to.eventually.have.property('code', 'ERR_SOCKET_READ_TIMEOUT'); - } - else { - await expect(serverErrored.promise).to.eventually.have.property('code', 'ECONNRESET'); - } - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket that is half-closed by the client', async () => { - ({ server, clientSocket, serverSocket } = await setup({ - client: { - allowHalfOpen: true - } - })); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - // promise that is resolved when our outgoing socket errors - const serverErrored = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - serverSocket.once('error', err => { - serverErrored.resolve(err); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - // close the client for writing - clientSocket.end(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // remote stopped sending us data - await expect(serverErrored.promise).to.eventually.have.property('code', 'ERR_SOCKET_READ_TIMEOUT'); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket after sinking', async () => { - ({ server, clientSocket, serverSocket } = await setup()); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - // promise that is resolved when our outgoing socket errors - const serverErrored = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - serverSocket.once('error', err => { - serverErrored.resolve(err); - }); - // send some data between the client and server - await inboundMaConn.sink(async function* () { - yield Uint8Array.from([0, 1, 2, 3]); - }()); - // server socket should no longer be writable - expect(serverSocket.writable).to.be.false(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // remote didn't send us any data - await expect(serverErrored.promise).to.eventually.have.property('code', 'ERR_SOCKET_READ_TIMEOUT'); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket when containing MultiaddrConnection is closed', async () => { - ({ server, clientSocket, serverSocket } = await setup()); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - socketCloseTimeout: 10, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - clientSocket.once('error', () => { }); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - await inboundMaConn.close(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket by timeout when containing MultiaddrConnection is closed', async () => { - ({ server, clientSocket, serverSocket } = await setup({ - server: { - allowHalfOpen: true - } - })); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - socketCloseTimeout: 10, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - clientSocket.once('error', () => { }); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - await inboundMaConn.close(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket by timeout when containing MultiaddrConnection is closed but remote keeps sending data', async () => { - ({ server, clientSocket, serverSocket } = await setup({ - server: { - allowHalfOpen: true - } - })); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 500, - socketCloseTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - clientSocket.once('error', () => { }); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - setInterval(() => { - clientSocket.write(`some data ${Date.now()}`); - }, 10).unref(); - await inboundMaConn.close(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket by timeout when containing MultiaddrConnection is closed but closing remote times out', async () => { - ({ server, clientSocket, serverSocket } = await setup()); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - // promise that is resolved when our outgoing socket errors - const serverErrored = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - socketCloseTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - clientSocket.once('error', () => { }); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - serverSocket.once('error', err => { - serverErrored.resolve(err); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - // stop reading data - clientSocket.pause(); - // have to write enough data quickly enough to overwhelm the client - while (serverSocket.writableLength < 1024) { - serverSocket.write('goodbyeeeeeeeeeeeeee'); - } - await inboundMaConn.close(); - // server socket should no longer be writable - expect(serverSocket.writable).to.be.false(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // remote didn't read our data - await expect(serverErrored.promise).to.eventually.have.property('code', 'ERR_SOCKET_READ_TIMEOUT'); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); -}); -//# sourceMappingURL=socket-to-conn.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/socket-to-conn.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/socket-to-conn.spec.js.map deleted file mode 100644 index be1c043ad..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/test/socket-to-conn.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"socket-to-conn.spec.js","sourceRoot":"","sources":["../../test/socket-to-conn.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAA4D,MAAM,KAAK,CAAA;AACpG,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,KAAK,UAAU,KAAK,CAAE,IAA8D;IAClF,MAAM,eAAe,GAAG,KAAK,EAAE,CAAA;IAE/B,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACzC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE;QACpB,eAAe,CAAC,OAAO,EAAE,CAAA;IAC3B,CAAC,CAAC,CAAA;IAEF,MAAM,eAAe,CAAC,OAAO,CAAA;IAE7B,MAAM,YAAY,GAAG,KAAK,EAAU,CAAA;IACpC,MAAM,YAAY,GAAG,KAAK,EAAU,C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,sBAAsB,CAAC,CAAA;SAC3C;QAED,MAAM,aAAa,CAAC,KAAK,EAAE,CAAA;QAE3B,6CAA6C;QAC7C,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;QAE3C,mDAAmD;QACnD,MAAM,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QAE1D,8BAA8B;QAC9B,MAAM,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAA;QAElG,sCAAsC;QACtC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;QAEtD,6BAA6B;QAC7B,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;IAC7C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/tsconfig.tsbuildinfo deleted file mode 100644 index 5ad19c0e0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/constants.ts","../../interface/dist/src/errors.d.ts","../../../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../../../node_modules/multiformats/dist/types/src/block/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../../../node_modules/multiformats/dist/types/src/link/interface.d.ts","../../../node_modules/multiformats/dist/types/src/cid.d.ts","../../interface/dist/src/peer-id/index.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../../interface/dist/src/peer-info/index.d.ts","../../interface/dist/src/content-routing/index.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../interface/dist/src/events.d.ts","../../interface/dist/src/metrics/index.d.ts","../../interface/dist/src/peer-routing/index.d.ts","../../interface/dist/src/peer-store/index.d.ts","../../interface/dist/src/startable.d.ts","../../interface/dist/src/stream-handler/index.d.ts","../../interface/dist/src/topology/index.d.ts","../../interface/dist/src/index.d.ts","../../../node_modules/it-stream-types/dist/src/index.d.ts","../../../node_modules/uint8arraylist/dist/src/index.d.ts","../../interface/dist/src/connection/index.d.ts","../../interface/dist/src/stream-muxer/index.d.ts","../../interface/dist/src/transport/index.d.ts","../../../node_modules/@multiformats/mafmt/dist/src/index.d.ts","../../utils/dist/src/ip-port-to-multiaddr.d.ts","../src/utils.ts","../src/socket-to-conn.ts","../src/listener.ts","../src/index.ts","../../interface-compliance-tests/dist/src/index.d.ts","../../interface-compliance-tests/dist/src/transport/index.d.ts","../../logger/dist/src/index.d.ts","../../../node_modules/@types/sinonjs__fake-timers/index.d.ts","../../../node_modules/@types/sinon/index.d.ts","../test/compliance.spec.ts","../../interface/dist/src/connection-gater/index.d.ts","../../interface-compliance-tests/dist/src/mocks/connection-gater.d.ts","../../../node_modules/it-pushable/dist/src/index.d.ts","../../interface/dist/src/pubsub/index.d.ts","../../peer-collections/dist/src/map.d.ts","../../peer-collections/dist/src/set.d.ts","../../peer-collections/dist/src/list.d.ts","../../peer-collections/dist/src/index.d.ts","../../interface-internal/dist/src/connection-manager/index.d.ts","../../interface-internal/dist/src/registrar/index.d.ts","../../interface-compliance-tests/dist/src/mocks/connection-manager.d.ts","../../interface-compliance-tests/dist/src/mocks/connection.d.ts","../../interface-compliance-tests/dist/src/mocks/multiaddr-connection.d.ts","../../utils/dist/src/abstract-stream.d.ts","../../interface-compliance-tests/dist/src/mocks/muxer.d.ts","../../interface-compliance-tests/dist/src/mocks/registrar.d.ts","../../interface-compliance-tests/dist/src/mocks/upgrader.d.ts","../../interface-compliance-tests/dist/src/mocks/duplex.d.ts","../../interface-compliance-tests/dist/src/mocks/metrics.d.ts","../../interface-compliance-tests/dist/src/mocks/index.d.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/@types/chai-as-promised/index.d.ts","../../../node_modules/chai-parentheses/index.d.ts","../../../node_modules/@types/chai-subset/index.d.ts","../../../node_modules/chai-bites/index.d.ts","../../../node_modules/@types/chai-string/index.d.ts","../../../node_modules/aegir/dist/utils/chai.d.ts","../test/connection-limits.spec.ts","../test/connection.spec.ts","../test/filter.spec.ts","../../../node_modules/it-all/dist/src/index.d.ts","../../../node_modules/it-pipe/dist/src/index.d.ts","../../../node_modules/p-defer/index.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../../../node_modules/multiformats/dist/types/src/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../../../node_modules/multiformats/dist/types/src/varint.d.ts","../../../node_modules/multiformats/dist/types/src/bytes.d.ts","../../../node_modules/multiformats/dist/types/src/index.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/raw.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/json.d.ts","../../../node_modules/multiformats/dist/types/src/bases/base.d.ts","../../../node_modules/multiformats/dist/types/src/basics.d.ts","../../../node_modules/uint8arrays/dist/src/util/bases.d.ts","../../../node_modules/uint8arrays/dist/src/from-string.d.ts","../test/listen-dial.spec.ts","../test/max-connections.spec.ts","../test/socket-to-conn.spec.ts","../../../node_modules/keyv/src/index.d.ts","../../../node_modules/@types/http-cache-semantics/index.d.ts","../../../node_modules/@types/responselike/index.d.ts","../../../node_modules/@types/cacheable-request/index.d.ts","../../../node_modules/@types/ms/index.d.ts","../../../node_modules/@types/debug/index.d.ts","../../../node_modules/@types/dns-packet/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/keyv/index.d.ts","../../../node_modules/@types/linkify-it/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/lodash.random/index.d.ts","../../../node_modules/@types/lodash.range/index.d.ts","../../../node_modules/@types/mdurl/encode.d.ts","../../../node_modules/@types/mdurl/decode.d.ts","../../../node_modules/@types/mdurl/parse.d.ts","../../../node_modules/@types/mdurl/format.d.ts","../../../node_modules/@types/mdurl/index.d.ts","../../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../../node_modules/@types/markdown-it/lib/token.d.ts","../../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../../node_modules/@types/markdown-it/lib/index.d.ts","../../../node_modules/@types/markdown-it/index.d.ts","../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/mdast/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/minimist/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/multicast-dns/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/retry/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/sinon-chai/index.d.ts","../../../node_modules/@types/strip-bom/index.d.ts","../../../node_modules/@types/strip-json-comments/index.d.ts","../../../node_modules/@types/which/index.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/@types/xsalsa20/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts","../../../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"de0ba34d2384a38c30f38e87b31bd91833c69a5982ab32ec668fd7424af46849","signature":"659e694bc8a9bb4b7f9e88bb9ed5e468553bb79655be46073907782c0a230cdd"},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","4369b27ca2716a04200930b5f24fa87a6ed62d8c70f80a83270956b6b23c32ae","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"8d6138a264ddc6f94f16e99d4e117a2d6eb31b217891cf091b6437a2f114d561","affectsGlobalScope":true},"a882b74c4ba115c6e86371f3592a3accb2c50874b6fcd92a4f83d17a4d6993af","4a8722c7d7a4dac1616db1f41ad0113998ccbbbcd37af43def3fbe6b41208c83","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"0b3868d3f87c95ea73bdfab380e536843ec3573aa76233b97aac40518494ea24","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","30c2ec6abf6aaa60eb4f32fb1235531506b7961c6d1bdc7430711aec8fd85295","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"d48009cbe8a30a504031cc82e1286f78fed33b7a42abf7602c23b5547b382563","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"24ba151e213906027e2b1f5223d33575a3612b0234a0e2b56119520bbe0e594b","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","28c1fc8505da2181ee74c9fe902fac964159cfae266c4413905d50eaecea8a19","84b8cc86ad19115f2637401cdd220460a25542df478c966a5ffc5eeaf3825299",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc","176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","1bf687d978bdd6d5aff10b9eb0ff0695179f8594d4446946fd0182d6d25fa433","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","5a16be1c0b59a91ed8de2c5699b7dad5e026d0315995eb75dcdd238be68b4be5","3d0fc7bb7dd39dc9df952e0fb97874ab25fd491392a4453fa7f4e65aef307ac9",{"version":"110cfb9b1e9ee74e80ba30f09f11c2ac736d8d22f7c218bcf499d1f22cb9665f","signature":"5cf5473735a956c4a6139812db63553581775fe34d14ab097c5fcd7ca03e84f0"},{"version":"ebd480a71e66942107907a4ad6e4f1a761f0ffbbdf1fb5ef6e5a4ed85140ee81","signature":"7ca4969ce0e2c0b679f9ce44846a7a8f78f6be7c1c0199143c053fc78061d09a"},{"version":"b1c33efa61ca3b6a2af1122a4c826a20fbada9e444d5a4000d419c30865b5b9f","signature":"0d6e9983d87ca882bd160af191909bce5c1d9b22f4bcb247d914b572cbddc076"},{"version":"fb1e831d934e1434623be095caedfc37eddf0b3fa2b12c284fd3ddce3572a44a","signature":"590815e7bd28778a71732b03b4852917e18bf42670cc1931e4f95ebe99157838"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","1dd1851e9ff4cfabdaa0aabb8db2b47de6b83aeda8413b7b09be3fc47654da49","cb4b40f34fe4b1d87c530a0f3c2c1e043e338829fab8cf5cbd92a91c8c1374b8","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2",{"version":"5b9845922dbc80d6b991193a227ab78001c9fb3ba2ae2c0fe4745f1e504c97de","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"7f2cc72a16a663ab9f8d99bd5658e583251ce0c003bf80a948973e15a7ef9596","f6e125b70d7118004733e6856a90163bbeb01a4633316fc2a2aaccbfca6ded6f","fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","03e385ae2125c9aa9dead008b42a0ab20d0812c26c19ee210d84c2666113f867","83a1426ac1a9cf144141dfe10d71a68629623a7c28245c9ca0e0352bead501fd","2726c0a6a4a87fad11e6846e6b0b40b8924fbe66340adc512093c4273bc53e4e","c888daaa99fdf6c5712d98605fdcf21cbbaab756a629661a44cac44ede464d37","e044f60686dc70015a3b7e7c64ad0ac5ec5ec101a0aede0782ec077e136b6a65","a232f867897bbecfebf68df575a417af1afd9b5dd3d83fb4d59e0a133a0de93d","228dbc8825b7a45af7d416dee95c0a2162d7cf73ffddfd52357b7e548882bdaa","46507ca157c8093e9b90b1c62be468ccb4aa693eaacae464b3935f6f24ccc9ff","af9a54fd33c9b0b2c05e433a71994ae07b75a3c4adbe82bdf6de863ce0f0e340","818068f6c587f5540e5cdc7b0f2ea6c04a0b9fe11745ca60f031bf349c17ba5c","75e0c62536016dac8cc0d825742ff7cc4c0455ebc86923e47edcc19edac0997c","d5840c8f2acfef007839d4e252ad45bf87219021c81de7de5cc98646f5d99d0d","f2601f76cd8ebb45e274730c33b44897fdea4bc742cb83fd98586754f08a3398","054dda98b75dec317926dddfb103939b99cccfc8ade63d7e6a2ef2f3343d37f9","a3f9f52ce73700565c8d9ba2aa75823ab8fc8e7258a27ecb828cd4257b8f918d","ad3490364b6442ca8694fc6cd364b63a5d807651a514837cc22ef29df624bb9d","4b5603a1ccca455500cfb39517d41ec011f31ba84bb6de44473344a237d89168",{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d",{"version":"4983ba4cc9c6d768887bfe5fd618ff2954bb68206282fa4a29e7eb4d0c1df478","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"1545b3a3656685251aa8b56ae4e8ecbbd4df62284dc2874e1e5ee7bb1d6f80ff","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"2a5f80090adbdc4a135707e558af382310da2c7051c88a1c9e639577a08946e6","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"5ccc3c7f73ef48c223635cd4506f21133560de7abc4c09c623327bb1b54386dc","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6","acd5d501223e3a7cdd229b501fce5fb071937b72bd05fa33e543eb21c8ee0aba","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","88de5467cd5e4c2c1384629806d56ac1215657bddf39ef9f60a0e05beee2b131","ff5820394809bfc32a7e4586ff11b3c07327a0f4c756709aef92f1cd73d6da48","bfe2af20f3ff0579331661ef4c5d2597e0c31a7a0d760e41eaff0502bf064c4d","f52a0e53f79d7fd1c1c55a3cbda59499d4cce75f3188969024cdc286b29ad3ea","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f",{"version":"2a9a98f0db379de58db189447b3c83fb4bcf617d837690a4f69c93dd5de62f9c","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"74ed4845b57c014f3d1642ba796be1d7c2afac634325949d242d764cb2b9e6e9","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"2827c4a7415fc665be3289cfefac6a0dc9c48135bc0b63bbcc2f05d27519e134","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","5bfd23a4c8765d347e296639b75f50f4dfca445d2eb41ea0892e68b8976a0cdf","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","b8442e9db28157344d1bc5d8a5a256f1692de213f0c0ddeb84359834015a008c","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","da2b6356b84a40111aaecb18304ea4e4fcb43d70efb1c13ca7d7a906445ee0d3","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","6f294731b495c65ecf46a5694f0082954b961cf05463bea823f8014098eaffa0","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","68a0d0c508e1b6d8d23a519a8a0a3303dc5baa4849ca049f21e5bad41945e3fc","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","b03afe4bec768ae333582915146f48b161e567a81b5ebc31c4d78af089770ac9","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","4f6a12044ee6f458db11964153830abbc499e73d065c51c329ec97407f4b13dd","13e834b958fe7e9010d2161497f98916974a0618be7a773281a253a948da8b0d","dae5c8e0ca15779492744cb4071c5b3c94c2121940fbaefb43ca9a045557a0c9","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"62a8effc4dd17bbc2c05927b4ca5f67e73fdb458e203b128c041d0d70ffa6b55","22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a",{"version":"525b52b38b44420fb1758c0917e7b67cf379f7f9477d2ba7343f3d5f50a44258","affectsGlobalScope":true},"4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","dc5fa6012f710446a9ed04156d986bd81d9119c93ecb63d85c6a9d493264b5dc","f7163a5d37d21f636f6a5cd1c064ce95fada21917859a64b6cc49a8b6fd5c1a8","5aac5efd20619b522faeeb0badf250834850c605ad8c5fb91c6502a54057f413","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[61,[176,179],185,[213,215],[232,234]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[71,153],[69,70,153],[123,126,152,153,160,235,236,237],[153,206],[153],[153,239],[153,160],[123,153,160],[153,259],[153,247,249,250,251,252,253,254,255,256,257,258,259],[153,247,248,250,251,252,253,254,255,256,257,258,259],[153,248,249,250,251,252,253,254,255,256,257,258,259],[153,247,248,249,251,252,253,254,255,256,257,258,259],[153,247,248,249,250,252,253,254,255,256,257,258,259],[153,247,248,249,250,251,253,254,255,256,257,258,259],[153,247,248,249,250,251,252,254,255,256,257,258,259],[153,247,248,249,250,251,252,253,255,256,257,258,259],[153,247,248,249,250,251,252,253,254,256,257,258,259],[153,247,248,249,250,251,252,253,254,255,257,258,259],[153,247,248,249,250,251,252,253,254,255,256,258,259],[153,247,248,249,250,251,252,253,254,255,256,257,259],[153,247,248,249,250,251,252,253,254,255,256,257,258],[153,281],[153,266],[153,270,271,272],[153,269],[153,271],[153,246,267,268,273,276,278,279,280],[153,268,274,275,281],[153,274,277],[153,268,269,274,281],[153,268,281],[153,283],[153,262,263,264,265],[117,123,153,160,241],[74,153],[110,153],[111,116,144,153],[112,123,124,131,141,152,153],[112,113,123,131,153],[114,153],[115,116,124,132,153],[116,141,149,153],[117,119,123,131,153],[118,153],[119,120,153],[123,153],[121,123,153],[110,123,153],[123,124,125,141,152,153],[123,124,125,138,141,144,153],[108,153,157],[119,123,126,131,141,152,153],[123,124,126,127,131,141,149,152,153],[126,128,141,149,152,153],[74,75,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159],[123,129,153],[130,152,153,157],[119,123,131,141,153],[132,153],[133,153],[110,134,153],[135,151,153,157],[136,153],[137,153],[123,138,139,153],[138,140,153,155],[111,123,141,142,143,144,153],[111,141,143,153],[141,142,153],[144,153],[145,153],[110,141,153],[123,147,148,153],[147,148,153],[116,131,141,149,153],[150,153],[131,151,153],[111,126,137,152,153],[116,153],[141,153,154],[130,153,155],[153,156],[111,116,123,125,134,141,152,153,155,157],[141,153,158],[126,141,153,160],[153,292,331],[153,292,316,331],[153,331],[153,292],[153,292,317,331],[153,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330],[153,317,331],[153,184,206],[153,183],[123,126,128,141,149,152,153,158,160],[153,338],[123,141,153,160],[153,206,207,208,209,210,211],[153,206,207],[153,169],[63,153],[153,225,226,227,228],[66,67,153],[66,153],[64,153],[153,219],[65,153],[65,153,221],[67,153,220,221,222,223,224],[63,64,65,66,153,219],[63,64,65,153],[153,230],[153,225,229],[85,89,152,153],[85,141,152,153],[80,153],[82,85,149,152,153],[131,149,153],[80,153,160],[82,85,131,152,153],[77,78,81,84,111,123,141,152,153],[77,83,153],[81,85,111,144,152,153,160],[111,153,160],[101,111,153,160],[79,80,153,160],[85,153],[79,80,81,82,83,84,85,86,87,89,90,91,92,93,94,95,96,97,98,99,100,102,103,104,105,106,107,153],[85,92,93,153],[83,85,93,94,153],[84,153],[77,80,85,153],[85,89,93,94,153],[89,153],[83,85,88,152,153],[77,82,83,85,89,92,153],[111,141,153],[80,85,101,111,153,157,160],[153,186],[68,71,153,161,168,189,194,195],[68,153,168,169,170,171,172,195],[153,169,170],[153,187,196,197,198,200,201,202,203,204],[153,162],[68,71,153,169,170,171],[153,171,172,188,199],[68,153,167,171,195],[153,161,168,173,195],[71,153,173,180],[68,71,153,168,171,193],[153,167,171],[68,71,153,171],[68,71,153,168,169,170],[67,72,153,168],[68,71,72,73,153,161,162,163,164,165,166,167,171,173],[153,171],[65,67,153],[68,71,153],[68,72,153,168],[68,153,161,170,171,188],[153,168,169,170,171],[68,153,171],[71,153,161,168,171,172],[68,153],[153,190,191,192],[61,62,71,131,153,162,168,171,173,174,176,177,178],[61,62,71,131,153,161,162,168,171,173,176,177,179],[61,62,71,131,153,162,168,171,175,176],[71,131,132,133,153],[71,131,153,179,181,182,184],[71,131,153,161,178,179,182,205,212],[71,153,161,171,173,179,182,205,212],[71,153,173,179,182,212],[71,132,133,153,161,171,173,179,182,205,212,216,217,218,231],[71,131,153,161,179,182,205,212],[131,132,153,177,182,212,218],[153,168,169,170,171,182],[71,162,168,173,178],[71,161,162,168,171,173,179],[71,131,162,168,171],[71,131]],"referencedMap":[[174,1],[70,1],[71,2],[69,1],[238,3],[207,4],[211,4],[209,4],[206,5],[240,6],[241,7],[236,5],[242,5],[243,5],[244,5],[245,8],[246,5],[260,9],[261,9],[248,10],[249,11],[247,12],[250,13],[251,14],[252,15],[253,16],[254,17],[255,18],[256,19],[257,20],[258,21],[259,22],[282,23],[267,24],[273,25],[271,5],[270,26],[272,27],[281,28],[276,29],[278,30],[279,31],[280,32],[274,5],[275,32],[277,32],[269,32],[268,5],[284,33],[263,5],[262,5],[265,24],[266,34],[264,24],[285,5],[286,5],[287,5],[239,5],[288,35],[74,36],[75,36],[110,37],[111,38],[112,39],[113,40],[114,41],[115,42],[116,43],[117,44],[118,45],[119,46],[120,46],[122,47],[121,48],[123,49],[124,50],[125,51],[109,52],[159,5],[126,53],[127,54],[128,55],[160,56],[129,57],[130,58],[131,59],[132,60],[133,61],[134,62],[135,63],[136,64],[137,65],[138,66],[139,66],[140,67],[141,68],[143,69],[142,70],[144,71],[145,72],[146,73],[147,74],[148,75],[149,76],[150,77],[151,78],[152,79],[153,80],[154,81],[155,82],[156,83],[157,84],[158,85],[289,5],[290,5],[237,86],[291,5],[316,87],[317,88],[292,89],[295,89],[314,87],[315,87],[305,87],[304,90],[302,87],[297,87],[310,87],[308,87],[312,87],[296,87],[309,87],[313,87],[298,87],[299,87],[311,87],[293,87],[300,87],[301,87],[303,87],[307,87],[318,91],[306,87],[294,87],[331,92],[330,5],[325,91],[327,93],[326,91],[319,91],[320,91],[322,91],[324,91],[328,93],[329,93],[321,93],[323,93],[332,94],[184,95],[183,5],[333,5],[334,5],[283,5],[335,5],[336,96],[337,7],[338,5],[339,97],[340,98],[212,99],[76,5],[210,4],[208,100],[216,5],[217,101],[188,5],[169,5],[235,47],[228,102],[63,5],[229,103],[64,104],[224,5],[67,105],[219,106],[227,107],[226,107],[221,108],[222,109],[65,5],[225,110],[220,111],[66,112],[223,5],[218,5],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[170,5],[231,113],[230,114],[92,115],[99,116],[91,115],[106,117],[83,118],[82,119],[105,7],[100,120],[103,121],[85,122],[84,123],[80,124],[79,125],[102,126],[81,127],[86,128],[87,5],[90,128],[77,5],[108,129],[107,128],[94,130],[95,131],[97,132],[93,133],[96,134],[101,7],[88,135],[89,136],[98,137],[78,138],[104,139],[180,5],[187,140],[196,141],[197,142],[203,143],[205,144],[204,145],[198,146],[200,147],[201,148],[202,149],[181,150],[194,151],[195,152],[186,153],[171,154],[73,155],[62,5],[161,8],[168,156],[162,157],[68,158],[72,159],[163,160],[164,159],[189,161],[165,5],[166,157],[172,162],[167,163],[173,164],[182,165],[193,166],[192,165],[190,165],[191,165],[61,5],[179,167],[178,168],[177,169],[176,170],[185,171],[213,172],[214,173],[215,174],[232,175],[233,176],[234,177],[199,178],[175,1]],"exportedModulesMap":[[174,1],[70,1],[71,2],[69,1],[238,3],[207,4],[211,4],[209,4],[206,5],[240,6],[241,7],[236,5],[242,5],[243,5],[244,5],[245,8],[246,5],[260,9],[261,9],[248,10],[249,11],[247,12],[250,13],[251,14],[252,15],[253,16],[254,17],[255,18],[256,19],[257,20],[258,21],[259,22],[282,23],[267,24],[273,25],[271,5],[270,26],[272,27],[281,28],[276,29],[278,30],[279,31],[280,32],[274,5],[275,32],[277,32],[269,32],[268,5],[284,33],[263,5],[262,5],[265,24],[266,34],[264,24],[285,5],[286,5],[287,5],[239,5],[288,35],[74,36],[75,36],[110,37],[111,38],[112,39],[113,40],[114,41],[115,42],[116,43],[117,44],[118,45],[119,46],[120,46],[122,47],[121,48],[123,49],[124,50],[125,51],[109,52],[159,5],[126,53],[127,54],[128,55],[160,56],[129,57],[130,58],[131,59],[132,60],[133,61],[134,62],[135,63],[136,64],[137,65],[138,66],[139,66],[140,67],[141,68],[143,69],[142,70],[144,71],[145,72],[146,73],[147,74],[148,75],[149,76],[150,77],[151,78],[152,79],[153,80],[154,81],[155,82],[156,83],[157,84],[158,85],[289,5],[290,5],[237,86],[291,5],[316,87],[317,88],[292,89],[295,89],[314,87],[315,87],[305,87],[304,90],[302,87],[297,87],[310,87],[308,87],[312,87],[296,87],[309,87],[313,87],[298,87],[299,87],[311,87],[293,87],[300,87],[301,87],[303,87],[307,87],[318,91],[306,87],[294,87],[331,92],[330,5],[325,91],[327,93],[326,91],[319,91],[320,91],[322,91],[324,91],[328,93],[329,93],[321,93],[323,93],[332,94],[184,95],[183,5],[333,5],[334,5],[283,5],[335,5],[336,96],[337,7],[338,5],[339,97],[340,98],[212,99],[76,5],[210,4],[208,100],[216,5],[217,101],[188,5],[169,5],[235,47],[228,102],[63,5],[229,103],[64,104],[224,5],[67,105],[219,106],[227,107],[226,107],[221,108],[222,109],[65,5],[225,110],[220,111],[66,112],[223,5],[218,5],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[170,5],[231,113],[230,114],[92,115],[99,116],[91,115],[106,117],[83,118],[82,119],[105,7],[100,120],[103,121],[85,122],[84,123],[80,124],[79,125],[102,126],[81,127],[86,128],[87,5],[90,128],[77,5],[108,129],[107,128],[94,130],[95,131],[97,132],[93,133],[96,134],[101,7],[88,135],[89,136],[98,137],[78,138],[104,139],[180,5],[187,140],[196,141],[197,142],[203,143],[205,144],[204,145],[198,146],[200,147],[201,148],[202,149],[181,150],[194,151],[195,152],[186,153],[171,154],[73,155],[62,5],[161,8],[168,156],[162,157],[68,158],[72,159],[163,160],[164,159],[189,161],[165,5],[166,157],[172,162],[167,163],[173,164],[182,165],[193,166],[192,165],[190,165],[191,165],[179,179],[178,180],[177,181],[176,182],[199,178],[175,1]],"semanticDiagnosticsPerFile":[174,70,71,69,238,207,211,209,206,240,241,236,242,243,244,245,246,260,261,248,249,247,250,251,252,253,254,255,256,257,258,259,282,267,273,271,270,272,281,276,278,279,280,274,275,277,269,268,284,263,262,265,266,264,285,286,287,239,288,74,75,110,111,112,113,114,115,116,117,118,119,120,122,121,123,124,125,109,159,126,127,128,160,129,130,131,132,133,134,135,136,137,138,139,140,141,143,142,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,289,290,237,291,316,317,292,295,314,315,305,304,302,297,310,308,312,296,309,313,298,299,311,293,300,301,303,307,318,306,294,331,330,325,327,326,319,320,322,324,328,329,321,323,332,184,183,333,334,283,335,336,337,338,339,340,212,76,210,208,216,217,188,169,235,228,63,229,64,224,67,219,227,226,221,222,65,225,220,66,223,218,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,170,231,230,92,99,91,106,83,82,105,100,103,85,84,80,79,102,81,86,87,90,77,108,107,94,95,97,93,96,101,88,89,98,78,104,180,187,196,197,203,205,204,198,200,201,202,181,194,195,186,171,73,62,161,168,162,68,72,163,164,189,165,166,172,167,173,182,193,192,190,191,61,179,178,177,176,185,213,214,215,232,233,234,199,175],"latestChangedDtsFile":"./test/socket-to-conn.spec.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/package.json deleted file mode 100644 index b39367234..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "@libp2p/tcp", - "version": "8.0.13", - "description": "A TCP transport for libp2p", - "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-tcp#readme", - "repository": { - "type": "git", - "url": "git+https://github.com/libp2p/js-libp2p.git" - }, - "bugs": { - "url": "https://github.com/libp2p/js-libp2p/issues" - }, - "keywords": [ - "IPFS", - "TCP", - "libp2p", - "network", - "p2p", - "peer", - "peer-to-peer" - ], - "type": "module", - "types": "./dist/src/index.d.ts", - "files": [ - "src", - "dist", - "!dist/test", - "!**/*.tsbuildinfo" - ], - "exports": { - ".": { - "types": "./dist/src/index.d.ts", - "import": "./dist/src/index.js" - } - }, - "eslintConfig": { - "extends": "ipfs", - "parserOptions": { - "project": true, - "sourceType": "module" - } - }, - "scripts": { - "clean": "aegir clean", - "lint": "aegir lint", - "dep-check": "aegir dep-check", - "build": "aegir build", - "test": "aegir test -t node -t electron-main", - "test:node": "aegir test -t node --cov", - "test:electron-main": "aegir test -t electron-main" - }, - "dependencies": { - "@libp2p/interface": "^0.1.6", - "@libp2p/utils": "^4.0.7", - "@multiformats/mafmt": "^12.1.6", - "@multiformats/multiaddr": "^12.1.10", - "@types/sinon": "^17.0.0", - "stream-to-it": "^0.2.2" - }, - "devDependencies": { - "@libp2p/interface-compliance-tests": "^4.1.5", - "@libp2p/logger": "^3.1.0", - "aegir": "^41.0.2", - "it-all": "^3.0.3", - "it-pipe": "^3.0.1", - "p-defer": "^4.0.0", - "sinon": "^17.0.0", - "uint8arrays": "^4.0.6" - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/src/constants.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/src/constants.ts deleted file mode 100644 index 650150074..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/src/constants.ts +++ /dev/null @@ -1,10 +0,0 @@ -// p2p multi-address code -export const CODE_P2P = 421 -export const CODE_CIRCUIT = 290 -export const CODE_UNIX = 400 - -// Time to wait for a connection to close gracefully before destroying it manually -export const CLOSE_TIMEOUT = 500 - -// Close the socket if there is no activity after this long in ms -export const SOCKET_TIMEOUT = 5 * 60000 // 5 mins diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/src/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/src/index.ts deleted file mode 100644 index 108c97441..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/src/index.ts +++ /dev/null @@ -1,341 +0,0 @@ -/** - * @packageDocumentation - * - * A [libp2p transport](https://docs.libp2p.io/concepts/transports/overview/) based on the TCP networking stack. - * - * @example - * - * ```js - * import { tcp } from '@libp2p/tcp' - * import { multiaddr } from '@multiformats/multiaddr' - * import { pipe } from 'it-pipe' - * import all from 'it-all' - * - * // A simple upgrader that just returns the MultiaddrConnection - * const upgrader = { - * upgradeInbound: async maConn => maConn, - * upgradeOutbound: async maConn => maConn - * } - * - * const transport = tcp()() - * - * const listener = transport.createListener({ - * upgrader, - * handler: (socket) => { - * console.this.log('new connection opened') - * pipe( - * ['hello', ' ', 'World!'], - * socket - * ) - * } - * }) - * - * const addr = multiaddr('/ip4/127.0.0.1/tcp/9090') - * await listener.listen(addr) - * console.this.log('listening') - * - * const socket = await transport.dial(addr, { upgrader }) - * const values = await pipe( - * socket, - * all - * ) - * console.this.log(`Value: ${values.toString()}`) - * - * // Close connection after reading - * await listener.close() - * ``` - * - * Outputs: - * - * ```sh - * listening - * new connection opened - * Value: hello World! - * ``` - */ - -import net from 'net' -import { AbortError, CodeError } from '@libp2p/interface/errors' -import { type CreateListenerOptions, type DialOptions, symbol, type Transport, type Listener } from '@libp2p/interface/transport' -import * as mafmt from '@multiformats/mafmt' -import { CODE_CIRCUIT, CODE_P2P, CODE_UNIX } from './constants.js' -import { type CloseServerOnMaxConnectionsOpts, TCPListener } from './listener.js' -import { toMultiaddrConnection } from './socket-to-conn.js' -import { multiaddrToNetConfig } from './utils.js' -import type { ComponentLogger, Logger } from '@libp2p/interface' -import type { Connection } from '@libp2p/interface/connection' -import type { CounterGroup, Metrics } from '@libp2p/interface/metrics' -import type { AbortOptions, Multiaddr } from '@multiformats/multiaddr' -import type { Socket, IpcSocketConnectOpts, TcpSocketConnectOpts } from 'net' - -export interface TCPOptions { - /** - * An optional number in ms that is used as an inactivity timeout after which the socket will be closed - */ - inboundSocketInactivityTimeout?: number - - /** - * An optional number in ms that is used as an inactivity timeout after which the socket will be closed - */ - outboundSocketInactivityTimeout?: number - - /** - * When closing a socket, wait this long for it to close gracefully before it is closed more forcibly - */ - socketCloseTimeout?: number - - /** - * Set this property to reject connections when the server's connection count gets high. - * https://nodejs.org/api/net.html#servermaxconnections - */ - maxConnections?: number - - /** - * Parameter to specify the maximum length of the queue of pending connections - * https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - backlog?: number - - /** - * Close server (stop listening for new connections) if connections exceed a limit. - * Open server (start listening for new connections) if connections fall below a limit. - */ - closeServerOnMaxConnections?: CloseServerOnMaxConnectionsOpts - - /** - * Options passed to `net.connect` for every opened TCP socket - */ - dialOpts?: TCPSocketOptions - - /** - * Options passed to every `net.createServer` for every TCP server - */ - listenOpts?: TCPSocketOptions -} - -/** - * Expose a subset of net.connect options - */ -export interface TCPSocketOptions extends AbortOptions { - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - noDelay?: boolean - - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - keepAlive?: boolean - - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - keepAliveInitialDelay?: number - - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#new-netsocketoptions - */ - allowHalfOpen?: boolean -} - -export interface TCPDialOptions extends DialOptions, TCPSocketOptions { - -} - -export interface TCPCreateListenerOptions extends CreateListenerOptions, TCPSocketOptions { - -} - -export interface TCPComponents { - metrics?: Metrics - logger: ComponentLogger -} - -export interface TCPMetrics { - dialerEvents: CounterGroup -} - -class TCP implements Transport { - private readonly opts: TCPOptions - private readonly metrics?: TCPMetrics - private readonly components: TCPComponents - private readonly log: Logger - - constructor (components: TCPComponents, options: TCPOptions = {}) { - this.log = components.logger.forComponent('libp2p:tcp') - this.opts = options - this.components = components - - if (components.metrics != null) { - this.metrics = { - dialerEvents: components.metrics.registerCounterGroup('libp2p_tcp_dialer_events_total', { - label: 'event', - help: 'Total count of TCP dialer events by type' - }) - } - } - } - - readonly [symbol] = true - - readonly [Symbol.toStringTag] = '@libp2p/tcp' - - async dial (ma: Multiaddr, options: TCPDialOptions): Promise { - options.keepAlive = options.keepAlive ?? true - options.noDelay = options.noDelay ?? true - - // options.signal destroys the socket before 'connect' event - const socket = await this._connect(ma, options) - - // Avoid uncaught errors caused by unstable connections - socket.on('error', err => { - this.log('socket error', err) - }) - - const maConn = toMultiaddrConnection(socket, { - remoteAddr: ma, - socketInactivityTimeout: this.opts.outboundSocketInactivityTimeout, - socketCloseTimeout: this.opts.socketCloseTimeout, - metrics: this.metrics?.dialerEvents, - logger: this.components.logger - }) - - const onAbort = (): void => { - maConn.close().catch(err => { - this.log.error('Error closing maConn after abort', err) - }) - } - options.signal?.addEventListener('abort', onAbort, { once: true }) - - this.log('new outbound connection %s', maConn.remoteAddr) - const conn = await options.upgrader.upgradeOutbound(maConn) - this.log('outbound connection %s upgraded', maConn.remoteAddr) - - options.signal?.removeEventListener('abort', onAbort) - - if (options.signal?.aborted === true) { - conn.close().catch(err => { - this.log.error('Error closing conn after abort', err) - }) - - throw new AbortError() - } - - return conn - } - - async _connect (ma: Multiaddr, options: TCPDialOptions): Promise { - if (options.signal?.aborted === true) { - throw new AbortError() - } - - return new Promise((resolve, reject) => { - const start = Date.now() - const cOpts = multiaddrToNetConfig(ma, { - ...(this.opts.dialOpts ?? {}), - ...options - }) as (IpcSocketConnectOpts & TcpSocketConnectOpts) - - this.log('dialing %a', ma) - const rawSocket = net.connect(cOpts) - - const onError = (err: Error): void => { - const cOptsStr = cOpts.path ?? `${cOpts.host ?? ''}:${cOpts.port}` - err.message = `connection error ${cOptsStr}: ${err.message}` - this.metrics?.dialerEvents.increment({ error: true }) - - done(err) - } - - const onTimeout = (): void => { - this.log('connection timeout %a', ma) - this.metrics?.dialerEvents.increment({ timeout: true }) - - const err = new CodeError(`connection timeout after ${Date.now() - start}ms`, 'ERR_CONNECT_TIMEOUT') - // Note: this will result in onError() being called - rawSocket.emit('error', err) - } - - const onConnect = (): void => { - this.log('connection opened %a', ma) - this.metrics?.dialerEvents.increment({ connect: true }) - done() - } - - const onAbort = (): void => { - this.log('connection aborted %a', ma) - this.metrics?.dialerEvents.increment({ abort: true }) - rawSocket.destroy() - done(new AbortError()) - } - - const done = (err?: any): void => { - rawSocket.removeListener('error', onError) - rawSocket.removeListener('timeout', onTimeout) - rawSocket.removeListener('connect', onConnect) - - if (options.signal != null) { - options.signal.removeEventListener('abort', onAbort) - } - - if (err != null) { - reject(err); return - } - - resolve(rawSocket) - } - - rawSocket.on('error', onError) - rawSocket.on('timeout', onTimeout) - rawSocket.on('connect', onConnect) - - if (options.signal != null) { - options.signal.addEventListener('abort', onAbort) - } - }) - } - - /** - * Creates a TCP listener. The provided `handler` function will be called - * anytime a new incoming Connection has been successfully upgraded via - * `upgrader.upgradeInbound`. - */ - createListener (options: TCPCreateListenerOptions): Listener { - return new TCPListener({ - ...(this.opts.listenOpts ?? {}), - ...options, - maxConnections: this.opts.maxConnections, - backlog: this.opts.backlog, - closeServerOnMaxConnections: this.opts.closeServerOnMaxConnections, - socketInactivityTimeout: this.opts.inboundSocketInactivityTimeout, - socketCloseTimeout: this.opts.socketCloseTimeout, - metrics: this.components.metrics, - logger: this.components.logger - }) - } - - /** - * Takes a list of `Multiaddr`s and returns only valid TCP addresses - */ - filter (multiaddrs: Multiaddr[]): Multiaddr[] { - multiaddrs = Array.isArray(multiaddrs) ? multiaddrs : [multiaddrs] - - return multiaddrs.filter(ma => { - if (ma.protoCodes().includes(CODE_CIRCUIT)) { - return false - } - - if (ma.protoCodes().includes(CODE_UNIX)) { - return true - } - - return mafmt.TCP.matches(ma.decapsulateCode(CODE_P2P)) - }) - } -} - -export function tcp (init: TCPOptions = {}): (components: TCPComponents) => Transport { - return (components: TCPComponents) => { - return new TCP(components, init) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/src/listener.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/src/listener.ts deleted file mode 100644 index 40ffcaf87..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/src/listener.ts +++ /dev/null @@ -1,381 +0,0 @@ -import net from 'net' -import { CodeError } from '@libp2p/interface/errors' -import { TypedEventEmitter, CustomEvent } from '@libp2p/interface/events' -import { CODE_P2P } from './constants.js' -import { toMultiaddrConnection } from './socket-to-conn.js' -import { - getMultiaddrs, - multiaddrToNetConfig, - type NetConfig -} from './utils.js' -import type { TCPCreateListenerOptions } from './index.js' -import type { ComponentLogger, Logger, LoggerOptions } from '@libp2p/interface' -import type { MultiaddrConnection, Connection } from '@libp2p/interface/connection' -import type { CounterGroup, MetricGroup, Metrics } from '@libp2p/interface/metrics' -import type { Listener, ListenerEvents, Upgrader } from '@libp2p/interface/transport' -import type { Multiaddr } from '@multiformats/multiaddr' - -/** - * Attempts to close the given maConn. If a failure occurs, it will be logged - */ -async function attemptClose (maConn: MultiaddrConnection, options: LoggerOptions): Promise { - try { - await maConn.close() - } catch (err) { - options.log.error('an error occurred closing the connection', err) - } -} - -export interface CloseServerOnMaxConnectionsOpts { - /** Server listens once connection count is less than `listenBelow` */ - listenBelow: number - /** Close server once connection count is greater than or equal to `closeAbove` */ - closeAbove: number - onListenError?(err: Error): void -} - -interface Context extends TCPCreateListenerOptions { - handler?(conn: Connection): void - upgrader: Upgrader - socketInactivityTimeout?: number - socketCloseTimeout?: number - maxConnections?: number - backlog?: number - metrics?: Metrics - closeServerOnMaxConnections?: CloseServerOnMaxConnectionsOpts - logger: ComponentLogger -} - -export interface TCPListenerMetrics { - status: MetricGroup - errors: CounterGroup - events: CounterGroup -} - -enum TCPListenerStatusCode { - /** - * When server object is initialized but we don't know the listening address yet or - * the server object is stopped manually, can be resumed only by calling listen() - **/ - INACTIVE = 0, - ACTIVE = 1, - /* During the connection limits */ - PAUSED = 2, -} - -type Status = { code: TCPListenerStatusCode.INACTIVE } | { - code: Exclude - listeningAddr: Multiaddr - peerId: string | null - netConfig: NetConfig -} - -export class TCPListener extends TypedEventEmitter implements Listener { - private readonly server: net.Server - /** Keep track of open connections to destroy in case of timeout */ - private readonly connections = new Set() - private status: Status = { code: TCPListenerStatusCode.INACTIVE } - private metrics?: TCPListenerMetrics - private addr: string - private readonly log: Logger - - constructor (private readonly context: Context) { - super() - - context.keepAlive = context.keepAlive ?? true - context.noDelay = context.noDelay ?? true - - this.log = context.logger.forComponent('libp2p:tcp:listener') - this.addr = 'unknown' - this.server = net.createServer(context, this.onSocket.bind(this)) - - // https://nodejs.org/api/net.html#servermaxconnections - // If set reject connections when the server's connection count gets high - // Useful to prevent too resource exhaustion via many open connections on high bursts of activity - if (context.maxConnections !== undefined) { - this.server.maxConnections = context.maxConnections - } - - if (context.closeServerOnMaxConnections != null) { - // Sanity check options - if (context.closeServerOnMaxConnections.closeAbove < context.closeServerOnMaxConnections.listenBelow) { - throw new CodeError('closeAbove must be >= listenBelow', 'ERROR_CONNECTION_LIMITS') - } - } - - this.server - .on('listening', () => { - if (context.metrics != null) { - // we are listening, register metrics for our port - const address = this.server.address() - - if (address == null) { - this.addr = 'unknown' - } else if (typeof address === 'string') { - // unix socket - this.addr = address - } else { - this.addr = `${address.address}:${address.port}` - } - - context.metrics?.registerMetricGroup('libp2p_tcp_inbound_connections_total', { - label: 'address', - help: 'Current active connections in TCP listener', - calculate: () => { - return { - [this.addr]: this.connections.size - } - } - }) - - this.metrics = { - status: context.metrics.registerMetricGroup('libp2p_tcp_listener_status_info', { - label: 'address', - help: 'Current status of the TCP listener socket' - }), - errors: context.metrics.registerMetricGroup('libp2p_tcp_listener_errors_total', { - label: 'address', - help: 'Total count of TCP listener errors by type' - }), - events: context.metrics.registerMetricGroup('libp2p_tcp_listener_events_total', { - label: 'address', - help: 'Total count of TCP listener events by type' - }) - } - - this.metrics?.status.update({ - [this.addr]: TCPListenerStatusCode.ACTIVE - }) - } - - this.dispatchEvent(new CustomEvent('listening')) - }) - .on('error', err => { - this.metrics?.errors.increment({ [`${this.addr} listen_error`]: true }) - this.dispatchEvent(new CustomEvent('error', { detail: err })) - }) - .on('close', () => { - this.metrics?.status.update({ - [this.addr]: this.status.code - }) - - // If this event is emitted, the transport manager will remove the listener from it's cache - // in the meanwhile if the connections are dropped then listener will start listening again - // and the transport manager will not be able to close the server - if (this.status.code !== TCPListenerStatusCode.PAUSED) { - this.dispatchEvent(new CustomEvent('close')) - } - }) - } - - private onSocket (socket: net.Socket): void { - if (this.status.code !== TCPListenerStatusCode.ACTIVE) { - throw new CodeError('Server is is not listening yet', 'ERR_SERVER_NOT_RUNNING') - } - // Avoid uncaught errors caused by unstable connections - socket.on('error', err => { - this.log('socket error', err) - this.metrics?.events.increment({ [`${this.addr} error`]: true }) - }) - - let maConn: MultiaddrConnection - try { - maConn = toMultiaddrConnection(socket, { - listeningAddr: this.status.listeningAddr, - socketInactivityTimeout: this.context.socketInactivityTimeout, - socketCloseTimeout: this.context.socketCloseTimeout, - metrics: this.metrics?.events, - metricPrefix: `${this.addr} `, - logger: this.context.logger - }) - } catch (err) { - this.log.error('inbound connection failed', err) - this.metrics?.errors.increment({ [`${this.addr} inbound_to_connection`]: true }) - return - } - - this.log('new inbound connection %s', maConn.remoteAddr) - try { - this.context.upgrader.upgradeInbound(maConn) - .then((conn) => { - this.log('inbound connection upgraded %s', maConn.remoteAddr) - this.connections.add(maConn) - - socket.once('close', () => { - this.connections.delete(maConn) - - if ( - this.context.closeServerOnMaxConnections != null && - this.connections.size < this.context.closeServerOnMaxConnections.listenBelow - ) { - // The most likely case of error is if the port taken by this application is binded by - // another process during the time the server if closed. In that case there's not much - // we can do. resume() will be called again every time a connection is dropped, which - // acts as an eventual retry mechanism. onListenError allows the consumer act on this. - this.resume().catch(e => { - this.log.error('error attempting to listen server once connection count under limit', e) - this.context.closeServerOnMaxConnections?.onListenError?.(e as Error) - }) - } - }) - - if (this.context.handler != null) { - this.context.handler(conn) - } - - if ( - this.context.closeServerOnMaxConnections != null && - this.connections.size >= this.context.closeServerOnMaxConnections.closeAbove - ) { - this.pause(false).catch(e => { - this.log.error('error attempting to close server once connection count over limit', e) - }) - } - - this.dispatchEvent(new CustomEvent('connection', { detail: conn })) - }) - .catch(async err => { - this.log.error('inbound connection failed', err) - this.metrics?.errors.increment({ [`${this.addr} inbound_upgrade`]: true }) - - await attemptClose(maConn, { - log: this.log - }) - }) - .catch(err => { - this.log.error('closing inbound connection failed', err) - }) - } catch (err) { - this.log.error('inbound connection failed', err) - - attemptClose(maConn, { - log: this.log - }) - .catch(err => { - this.log.error('closing inbound connection failed', err) - this.metrics?.errors.increment({ [`${this.addr} inbound_closing_failed`]: true }) - }) - } - } - - getAddrs (): Multiaddr[] { - if (this.status.code === TCPListenerStatusCode.INACTIVE) { - return [] - } - - let addrs: Multiaddr[] = [] - const address = this.server.address() - const { listeningAddr, peerId } = this.status - - if (address == null) { - return [] - } - - if (typeof address === 'string') { - addrs = [listeningAddr] - } else { - try { - // Because TCP will only return the IPv6 version - // we need to capture from the passed multiaddr - if (listeningAddr.toString().startsWith('/ip4')) { - addrs = addrs.concat(getMultiaddrs('ip4', address.address, address.port)) - } else if (address.family === 'IPv6') { - addrs = addrs.concat(getMultiaddrs('ip6', address.address, address.port)) - } - } catch (err) { - this.log.error('could not turn %s:%s into multiaddr', address.address, address.port, err) - } - } - - return addrs.map(ma => peerId != null ? ma.encapsulate(`/p2p/${peerId}`) : ma) - } - - async listen (ma: Multiaddr): Promise { - if (this.status.code === TCPListenerStatusCode.ACTIVE || this.status.code === TCPListenerStatusCode.PAUSED) { - throw new CodeError('server is already listening', 'ERR_SERVER_ALREADY_LISTENING') - } - - const peerId = ma.getPeerId() - const listeningAddr = peerId == null ? ma.decapsulateCode(CODE_P2P) : ma - const { backlog } = this.context - - try { - this.status = { - code: TCPListenerStatusCode.ACTIVE, - listeningAddr, - peerId, - netConfig: multiaddrToNetConfig(listeningAddr, { backlog }) - } - - await this.resume() - } catch (err) { - this.status = { code: TCPListenerStatusCode.INACTIVE } - throw err - } - } - - async close (): Promise { - // Close connections and server the same time to avoid any race condition - await Promise.all([ - Promise.all(Array.from(this.connections.values()).map(async maConn => attemptClose(maConn, { - log: this.log - }))), - this.pause(true).catch(e => { - this.log.error('error attempting to close server once connection count over limit', e) - }) - ]) - } - - /** - * Can resume a stopped or start an inert server - */ - private async resume (): Promise { - if (this.server.listening || this.status.code === TCPListenerStatusCode.INACTIVE) { - return - } - - const netConfig = this.status.netConfig - - await new Promise((resolve, reject) => { - // NOTE: 'listening' event is only fired on success. Any error such as port already binded, is emitted via 'error' - this.server.once('error', reject) - this.server.listen(netConfig, resolve) - }) - - this.status = { ...this.status, code: TCPListenerStatusCode.ACTIVE } - this.log('Listening on %s', this.server.address()) - } - - private async pause (permanent: boolean): Promise { - if (!this.server.listening && this.status.code === TCPListenerStatusCode.PAUSED && permanent) { - this.status = { code: TCPListenerStatusCode.INACTIVE } - return - } - - if (!this.server.listening || this.status.code !== TCPListenerStatusCode.ACTIVE) { - return - } - - this.log('Closing server on %s', this.server.address()) - - // NodeJS implementation tracks listening status with `this._handle` property. - // - Server.close() sets this._handle to null immediately. If this._handle is null, ERR_SERVER_NOT_RUNNING is thrown - // - Server.listening returns `this._handle !== null` https://github.com/nodejs/node/blob/386d761943bb1b217fba27d6b80b658c23009e60/lib/net.js#L1675 - // - Server.listen() if `this._handle !== null` throws ERR_SERVER_ALREADY_LISTEN - // - // NOTE: Both listen and close are technically not async actions, so it's not necessary to track - // states 'pending-close' or 'pending-listen' - - // From docs https://nodejs.org/api/net.html#serverclosecallback - // Stops the server from accepting new connections and keeps existing connections. - // 'close' event is emitted only emitted when all connections are ended. - // The optional callback will be called once the 'close' event occurs. - - // We need to set this status before closing server, so other procedures are aware - // during the time the server is closing - this.status = permanent ? { code: TCPListenerStatusCode.INACTIVE } : { ...this.status, code: TCPListenerStatusCode.PAUSED } - await new Promise((resolve, reject) => { - this.server.close(err => { (err != null) ? reject(err) : resolve() }) - }) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/src/socket-to-conn.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/src/socket-to-conn.ts deleted file mode 100644 index a24b126d5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/src/socket-to-conn.ts +++ /dev/null @@ -1,200 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { ipPortToMultiaddr as toMultiaddr } from '@libp2p/utils/ip-port-to-multiaddr' -// @ts-expect-error no types -import toIterable from 'stream-to-it' -import { CLOSE_TIMEOUT, SOCKET_TIMEOUT } from './constants.js' -import { multiaddrToNetConfig } from './utils.js' -import type { ComponentLogger } from '@libp2p/interface' -import type { MultiaddrConnection } from '@libp2p/interface/connection' -import type { CounterGroup } from '@libp2p/interface/metrics' -import type { AbortOptions, Multiaddr } from '@multiformats/multiaddr' -import type { Socket } from 'net' - -interface ToConnectionOptions { - listeningAddr?: Multiaddr - remoteAddr?: Multiaddr - localAddr?: Multiaddr - socketInactivityTimeout?: number - socketCloseTimeout?: number - metrics?: CounterGroup - metricPrefix?: string - logger: ComponentLogger -} - -/** - * Convert a socket into a MultiaddrConnection - * https://github.com/libp2p/interface-transport#multiaddrconnection - */ -export const toMultiaddrConnection = (socket: Socket, options: ToConnectionOptions): MultiaddrConnection => { - const log = options.logger.forComponent('libp2p:tcp:socket') - const metrics = options.metrics - const metricPrefix = options.metricPrefix ?? '' - const inactivityTimeout = options.socketInactivityTimeout ?? SOCKET_TIMEOUT - const closeTimeout = options.socketCloseTimeout ?? CLOSE_TIMEOUT - - // Check if we are connected on a unix path - if (options.listeningAddr?.getPath() != null) { - options.remoteAddr = options.listeningAddr - } - - if (options.remoteAddr?.getPath() != null) { - options.localAddr = options.remoteAddr - } - - let remoteAddr: Multiaddr - - if (options.remoteAddr != null) { - remoteAddr = options.remoteAddr - } else { - if (socket.remoteAddress == null || socket.remotePort == null) { - // this can be undefined if the socket is destroyed (for example, if the client disconnected) - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#socketremoteaddress - throw new CodeError('Could not determine remote address or port', 'ERR_NO_REMOTE_ADDRESS') - } - - remoteAddr = toMultiaddr(socket.remoteAddress, socket.remotePort) - } - - const lOpts = multiaddrToNetConfig(remoteAddr) - const lOptsStr = lOpts.path ?? `${lOpts.host ?? ''}:${lOpts.port ?? ''}` - const { sink, source } = toIterable.duplex(socket) - - // by default there is no timeout - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#socketsettimeouttimeout-callback - socket.setTimeout(inactivityTimeout, () => { - log('%s socket read timeout', lOptsStr) - metrics?.increment({ [`${metricPrefix}timeout`]: true }) - - // only destroy with an error if the remote has not sent the FIN message - let err: Error | undefined - if (socket.readable) { - err = new CodeError('Socket read timeout', 'ERR_SOCKET_READ_TIMEOUT') - } - - // if the socket times out due to inactivity we must manually close the connection - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#event-timeout - socket.destroy(err) - }) - - socket.once('close', () => { - log('%s socket close', lOptsStr) - metrics?.increment({ [`${metricPrefix}close`]: true }) - - // In instances where `close` was not explicitly called, - // such as an iterable stream ending, ensure we have set the close - // timeline - if (maConn.timeline.close == null) { - maConn.timeline.close = Date.now() - } - }) - - socket.once('end', () => { - // the remote sent a FIN packet which means no more data will be sent - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#event-end - log('%s socket end', lOptsStr) - metrics?.increment({ [`${metricPrefix}end`]: true }) - }) - - const maConn: MultiaddrConnection = { - async sink (source) { - try { - await sink((async function * () { - for await (const buf of source) { - if (buf instanceof Uint8Array) { - yield buf - } else { - // is it faster to yield all the buffers or just one big buffer? - yield buf.subarray() - } - } - })()) - } catch (err: any) { - // If aborted we can safely ignore - if (err.type !== 'aborted') { - // If the source errored the socket will already have been destroyed by - // toIterable.duplex(). If the socket errored it will already be - // destroyed. There's nothing to do here except log the error & return. - log(err) - } - } - - // we have finished writing, send the FIN message - socket.end() - }, - - source, - - // If the remote address was passed, use it - it may have the peer ID encapsulated - remoteAddr, - - timeline: { open: Date.now() }, - - async close (options: AbortOptions = {}) { - if (socket.destroyed) { - log('%s socket was already destroyed when trying to close', lOptsStr) - return - } - - if (options.signal == null) { - const signal = AbortSignal.timeout(closeTimeout) - - options = { - ...options, - signal - } - } - - try { - log('%s closing socket', lOptsStr) - await new Promise((resolve, reject) => { - socket.once('close', () => { - // socket completely closed - log('%s socket closed', lOptsStr) - resolve() - }) - socket.once('error', (err: Error) => { - log('%s socket error', lOptsStr, err) - - // error closing socket - if (maConn.timeline.close == null) { - maConn.timeline.close = Date.now() - } - - reject(err) - }) - - // shorten inactivity timeout - socket.setTimeout(closeTimeout) - - // close writable end of the socket - socket.end() - - if (socket.writableLength > 0) { - // there are outgoing bytes waiting to be sent - socket.once('drain', () => { - log('%s socket drained', lOptsStr) - - // all bytes have been sent we can destroy the socket (maybe) before the timeout - socket.destroy() - }) - } else { - // nothing to send, destroy immediately, no need for the timeout - socket.destroy() - } - }) - } catch (err: any) { - this.abort(err) - } - }, - - abort: (err: Error) => { - log('%s socket abort due to error', lOptsStr, err) - - socket.destroy(err) - }, - - log - } - - return maConn -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/src/utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/src/utils.ts deleted file mode 100644 index 7a44af4fa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/tcp/src/utils.ts +++ /dev/null @@ -1,53 +0,0 @@ -import os from 'os' -import path from 'path' -import { multiaddr } from '@multiformats/multiaddr' -import type { Multiaddr } from '@multiformats/multiaddr' -import type { ListenOptions, IpcSocketConnectOpts, TcpSocketConnectOpts } from 'net' - -const ProtoFamily = { ip4: 'IPv4', ip6: 'IPv6' } - -export type NetConfig = ListenOptions | (IpcSocketConnectOpts & TcpSocketConnectOpts) - -export function multiaddrToNetConfig (addr: Multiaddr, config: NetConfig = {}): NetConfig { - const listenPath = addr.getPath() - - // unix socket listening - if (listenPath != null) { - if (os.platform() === 'win32') { - // Use named pipes on Windows systems. - return { path: path.join('\\\\.\\pipe\\', listenPath) } - } else { - return { path: listenPath } - } - } - - // tcp listening - return { ...config, ...addr.toOptions() } -} - -export function getMultiaddrs (proto: 'ip4' | 'ip6', ip: string, port: number): Multiaddr[] { - const toMa = (ip: string): Multiaddr => multiaddr(`/${proto}/${ip}/tcp/${port}`) - return (isAnyAddr(ip) ? getNetworkAddrs(ProtoFamily[proto]) : [ip]).map(toMa) -} - -export function isAnyAddr (ip: string): boolean { - return ['0.0.0.0', '::'].includes(ip) -} - -const networks = os.networkInterfaces() - -function getNetworkAddrs (family: string): string[] { - const addresses: string[] = [] - - for (const [, netAddrs] of Object.entries(networks)) { - if (netAddrs != null) { - for (const netAddr of netAddrs) { - if (netAddr.family === family) { - addresses.push(netAddr.address) - } - } - } - } - - return addresses -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/index.min.js deleted file mode 100644 index 605add25f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/index.min.js +++ /dev/null @@ -1,3 +0,0 @@ -(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.ChainsafeLibp2PYamux = factory()}(typeof self !== 'undefined' ? self : this, function () { -"use strict";var ChainsafeLibp2PYamux=(()=>{var ot=Object.create;var H=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var lt=Object.getOwnPropertyNames;var ut=Object.getPrototypeOf,ct=Object.prototype.hasOwnProperty;var ue=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ht=(r,e)=>{for(var t in e)H(r,t,{get:e[t],enumerable:!0})},De=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of lt(e))!ct.call(r,s)&&s!==t&&H(r,s,{get:()=>e[s],enumerable:!(n=at(e,s))||n.enumerable});return r};var ft=(r,e,t)=>(t=r!=null?ot(ut(r)):{},De(e||!r||!r.__esModule?H(t,"default",{value:r,enumerable:!0}):t,r)),dt=r=>De(H({},"__esModule",{value:!0}),r);var Te=ue((Qt,Le)=>{var W=1e3,V=W*60,G=V*60,k=G*24,mt=k*7,pt=k*365.25;Le.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return gt(r);if(t==="number"&&isFinite(r))return e.long?bt(r):wt(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function gt(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*pt;case"weeks":case"week":case"w":return t*mt;case"days":case"day":case"d":return t*k;case"hours":case"hour":case"hrs":case"hr":case"h":return t*G;case"minutes":case"minute":case"mins":case"min":case"m":return t*V;case"seconds":case"second":case"secs":case"sec":case"s":return t*W;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function wt(r){var e=Math.abs(r);return e>=k?Math.round(r/k)+"d":e>=G?Math.round(r/G)+"h":e>=V?Math.round(r/V)+"m":e>=W?Math.round(r/W)+"s":r+"ms"}function bt(r){var e=Math.abs(r);return e>=k?j(r,e,k,"day"):e>=G?j(r,e,G,"hour"):e>=V?j(r,e,V,"minute"):e>=W?j(r,e,W,"second"):r+" ms"}function j(r,e,t,n){var s=e>=t*1.5;return Math.round(r/t)+" "+n+(s?"s":"")}});var Fe=ue((Zt,Ne)=>{function yt(r){t.debug=t,t.default=t,t.coerce=f,t.disable=i,t.enable=s,t.enabled=a,t.humanize=Te(),t.destroy=R,Object.keys(r).forEach(o=>{t[o]=r[o]}),t.names=[],t.skips=[],t.formatters={};function e(o){let l=0;for(let d=0;d{if(D==="%%")return"%";S++;let L=t.formatters[_];if(typeof L=="function"){let P=c[S];D=L.call(g,P),c.splice(S,1),S--}return D}),t.formatArgs.call(g,c),(g.log||t.log).apply(g,c)}return m.namespace=o,m.useColors=t.useColors(),m.color=t.selectColor(o),m.extend=n,m.destroy=t.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(N!==t.namespaces&&(N=t.namespaces,p=t.enabled(o)),p),set:c=>{d=c}}),typeof t.init=="function"&&t.init(m),m}function n(o,l){let d=t(this.namespace+(typeof l>"u"?":":l)+o);return d.log=this.log,d}function s(o){t.save(o),t.namespaces=o,t.names=[],t.skips=[];let l,d=(typeof o=="string"?o:"").split(/[\s,]+/),N=d.length;for(l=0;l"-"+l)].join(",");return t.enable(""),o}function a(o){if(o[o.length-1]==="*")return!0;let l,d;for(l=0,d=t.skips.length;l{v.formatArgs=St;v.save=Ct;v.load=Rt;v.useColors=Et;v.storage=xt();v.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();v.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Et(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function St(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+K.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,n=0;r[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(n=t))}),r.splice(n,0,e)}v.log=console.debug||console.log||(()=>{});function Ct(r){try{r?v.storage.setItem("debug",r):v.storage.removeItem("debug")}catch{}}function Rt(){let r;try{r=v.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function xt(){try{return localStorage}catch{}}K.exports=Fe()(v);var{formatters:_t}=K.exports;_t.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Xt={};ht(Xt,{GoAwayCode:()=>I,yamux:()=>zt});var h=class extends Error{code;props;constructor(e,t,n){super(e),this.code=t,this.name=n?.name??"CodeError",this.props=n??{}}};var ce=class extends Event{detail;constructor(e,t){super(e,t),this.detail=t?.detail}},Kt=globalThis.CustomEvent??ce;var he=(r,...e)=>{try{[...e]}catch{}};var A=ft(Ue(),1);function vt(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n>>0,S=new Uint8Array(E);g!==y;){for(var x=p[g],D=0,_=E-1;(x!==0||D>>0,S[_]=x%u>>>0,x=x/u>>>0;if(x!==0)throw new Error("Non-zero carry");c=D,g++}for(var L=E-c;L!==E&&S[L]===0;)L++;for(var P=f.repeat(m);L>>0,E=new Uint8Array(y);p[m];){var S=t[p.charCodeAt(m)];if(S===255)return;for(var x=0,D=y-1;(S!==0||x>>0,E[D]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");g=x,m++}if(p[m]!==" "){for(var _=y-g;_!==y&&E[_]===0;)_++;for(var L=new Uint8Array(c+(y-_)),P=c;_!==y;)L[P++]=E[_++];return L}}}function N(p){var m=d(p);if(m)return m;throw new Error(`Non-${e} character`)}return{encode:l,decodeUnsafe:d,decode:N}}var At=vt,It=At,Oe=It;var tr=new Uint8Array(0);var ke=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var fe=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},de=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Me(this,e)}},me=class{constructor(e){this.decoders=e}or(e){return Me(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Me=(r,e)=>new me({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),pe=class{constructor(e,t,n,s){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=s,this.encoder=new fe(e,t,n),this.decoder=new de(e,t,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Pe=({name:r,prefix:e,encode:t,decode:n})=>new pe(r,e,t,n),ge=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:s}=Oe(t,e);return Pe({prefix:r,name:e,encode:n,decode:i=>ke(s(i))})},Dt=(r,e,t,n)=>{let s={};for(let o=0;o=8&&(u-=8,a[R++]=255&f>>u)}if(u>=t||255&f<<8-u)throw new SyntaxError("Unexpected end of data");return a},Lt=(r,e,t)=>{let n=e[e.length-1]==="=",s=(1<t;)a-=t,i+=e[s&u>>a];if(a&&(i+=e[s&u<Pe({prefix:e,name:r,encode(s){return Lt(s,n,t)},decode(s){return Dt(s,n,t,r)}});var We=C({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ar=C({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),lr=C({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),ur=C({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),cr=C({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),hr=C({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),fr=C({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),dr=C({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),mr=C({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ve=ge({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),wr=ge({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Ge=C({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Er=C({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Sr=C({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Cr=C({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});A.default.formatters.b=r=>r==null?"undefined":Ve.baseEncode(r);A.default.formatters.t=r=>r==null?"undefined":We.baseEncode(r);A.default.formatters.m=r=>r==null?"undefined":Ge.baseEncode(r);A.default.formatters.p=r=>r==null?"undefined":r.toString();A.default.formatters.c=r=>r==null?"undefined":r.toString();A.default.formatters.k=r=>r==null?"undefined":r.toString();A.default.formatters.a=r=>r==null?"undefined":r.toString();function Tt(r){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=r,e.destroy=()=>!0,e.extend=()=>e,e}function J(r){let e=Tt(`${r}:trace`);return A.default.enabled(`${r}:trace`)&&A.default.names.map(t=>t.toString()).find(t=>t.includes(":trace"))!=null&&(e=(0,A.default)(`${r}:trace`)),Object.assign((0,A.default)(r),{error:(0,A.default)(`${r}:error`),trace:e})}function Q(r){if(r!=null){if(typeof r[Symbol.iterator]=="function")return r[Symbol.iterator]();if(typeof r[Symbol.asyncIterator]=="function")return r[Symbol.asyncIterator]();if(typeof r.next=="function")return r}throw new Error("argument is not an iterator or iterable")}function M(){let r={};return r.promise=new Promise((e,t)=>{r.resolve=e,r.reject=t}),r}var Z=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},B=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new Z(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let t=this.head;this.head=t.next=new Z(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let t=this.tail.next;this.tail.next=null,this.tail=t,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var we=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.code=t??"ABORT_ERR"}};function ee(r={}){return Nt(t=>{let n=t.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},r)}function Nt(r,e){e=e??{};let t=e.onEnd,n=new B,s,i,a,u=M(),f=async()=>{try{return n.isEmpty()?a?{done:!0}:await new Promise((c,g)=>{i=y=>{i=null,n.push(y);try{c(r(n))}catch(E){g(E)}return s}}):r(n)}finally{n.isEmpty()&&queueMicrotask(()=>{u.resolve(),u=M()})}},R=c=>i!=null?i(c):(n.push(c),s),o=c=>(n=new B,i!=null?i({error:c}):(n.push({error:c}),s)),l=c=>{if(a)return s;if(e?.objectMode!==!0&&c?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return R({done:!1,value:c})},d=c=>a?s:(a=!0,c!=null?o(c):R({done:!0})),N=()=>(n=new B,d(),{done:!0}),p=c=>(d(c),{done:!0});if(s={[Symbol.asyncIterator](){return this},next:f,return:N,throw:p,push:l,end:d,get readableLength(){return n.size},onEmpty:async c=>{let g=c?.signal;if(g?.throwIfAborted(),n.isEmpty())return;let y,E;g!=null&&(y=new Promise((S,x)=>{E=()=>{x(new we)},g.addEventListener("abort",E)}));try{await Promise.race([u.promise,y])}finally{E!=null&&g!=null&&g?.removeEventListener("abort",E)}}},t==null)return s;let m=s;return s={[Symbol.asyncIterator](){return this},next(){return m.next()},throw(c){return m.throw(c),t!=null&&(t(c),t=void 0),{done:!0}},return(){return m.return(),t!=null&&(t(),t=void 0),{done:!0}},push:l,end(c){return m.end(c),t!=null&&(t(c),t=void 0),s},get readableLength(){return m.readableLength},onEmpty:c=>m.onEmpty(c)},s}var z="ERR_INVALID_FRAME",be="ERR_UNREQUESTED_PING",ye="ERR_NOT_MATCHING_PING",Ee="ERR_STREAM_ALREADY_EXISTS",Se="ERR_DECODE_INVALID_VERSION",Ce="ERR_BOTH_CLIENTS",Re="ERR_RECV_WINDOW_EXCEEDED",Be=new Set([z,be,ye,Ee,Se,Ce,Re]),U="ERR_INVALID_CONFIG",te="ERR_MUXER_LOCAL_CLOSED",xe="ERR_MUXER_REMOTE_CLOSED";var ze="ERR_STREAM_ABORT",Xe="ERROR_MAX_OUTBOUND_STREAMS_EXCEEDED",Ye="ERR_DECODE_IN_PROGRESS",Y=256*1024,qe=16*1024*1024;var $e={log:J("libp2p:yamux"),enableKeepAlive:!0,keepAliveInterval:3e4,maxInboundStreams:1e3,maxOutboundStreams:1e3,initialStreamWindowSize:Y,maxStreamWindowSize:qe,maxMessageSize:64*1024};function He(r){if(r.keepAliveInterval<=0)throw new h("keep-alive interval must be positive",U);if(r.maxInboundStreams<0)throw new h("max inbound streams must be larger or equal 0",U);if(r.maxOutboundStreams<0)throw new h("max outbound streams must be larger or equal 0",U);if(r.initialStreamWindowSize2**32-1)throw new h("MaxStreamWindowSize must be less than equal MAX_UINT32",U);if(r.maxMessageSize<1024)throw new h("MaxMessageSize must be greater than a kilobyte",U)}function q(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function F(r=0){return globalThis.Buffer?.alloc!=null?q(globalThis.Buffer.alloc(r)):new Uint8Array(r)}function $(r=0){return globalThis.Buffer?.allocUnsafe!=null?q(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function _e(r,e){e==null&&(e=r.reduce((s,i)=>s+i.length,0));let t=$(e),n=0;for(let s of r)t.set(s,n),n+=s.length;return q(t)}function je(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let t=0;for(let n of e)if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.push(n);else if(re(n))t+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}prepend(...e){this.prependAll(e)}prependAll(e){let t=0;for(let n of e.reverse())if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.unshift(n);else if(re(n))t+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=Ke(this.bufs,e);return t.buf[t.index]}set(e,t){let n=Ke(this.bufs,e);n.buf[n.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let n=0;n0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,t){let{bufs:n,length:s}=this._subList(e,t);return _e(n,s)}subarray(e,t){let{bufs:n,length:s}=this._subList(e,t);return n.length===1?n[0]:_e(n,s)}sublist(e,t){let{bufs:n,length:s}=this._subList(e,t),i=new r;return i.length=s,i.bufs=n,i}_subList(e,t){if(e=e??0,t=t??this.length,e<0&&(e=this.length+e),t<0&&(t=this.length+t),e<0||t>this.length)throw new RangeError("index is out of bounds");if(e===t)return{bufs:[],length:0};if(e===0&&t===this.length)return{bufs:[...this.bufs],length:this.length};let n=[],s=0;for(let i=0;i=f)continue;let R=e>=u&&eu&&t<=f;if(R&&o){if(e===u&&t===f){n.push(a);break}let l=e-u;n.push(a.subarray(l,l+(t-e)));break}if(R){if(e===0){n.push(a);continue}n.push(a.subarray(e-u));continue}if(o){if(t===f){n.push(a);break}n.push(a.subarray(0,t-u));break}n.push(a)}return{bufs:n,length:t-e}}indexOf(e,t=0){if(!re(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(t=Number(t??0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),e.length===0)return t>this.length?this.length:t;let s=n.byteLength;if(s===0)throw new TypeError("search must be at least 1 byte long");let i=256,a=new Int32Array(i);for(let l=0;l=0;d--){let N=this.get(l+d);if(n[d]!==N){o=Math.max(1,d-u[N]);break}}if(o===0)return l}return-1}getInt8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}setInt8(e,t){let n=$(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,t),this.write(n,e)}getInt16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,t)}setInt16(e,t,n){let s=F(2);new DataView(s.buffer,s.byteOffset,s.byteLength).setInt16(0,t,n),this.write(s,e)}getInt32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,t)}setInt32(e,t,n){let s=F(4);new DataView(s.buffer,s.byteOffset,s.byteLength).setInt32(0,t,n),this.write(s,e)}getBigInt64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,t)}setBigInt64(e,t,n){let s=F(8);new DataView(s.buffer,s.byteOffset,s.byteLength).setBigInt64(0,t,n),this.write(s,e)}getUint8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}setUint8(e,t){let n=$(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,t),this.write(n,e)}getUint16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,t)}setUint16(e,t,n){let s=F(2);new DataView(s.buffer,s.byteOffset,s.byteLength).setUint16(0,t,n),this.write(s,e)}getUint32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,t)}setUint32(e,t,n){let s=F(4);new DataView(s.buffer,s.byteOffset,s.byteLength).setUint32(0,t,n),this.write(s,e)}getBigUint64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,t)}setBigUint64(e,t,n){let s=F(8);new DataView(s.buffer,s.byteOffset,s.byteLength).setBigUint64(0,t,n),this.write(s,e)}getFloat32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,t)}setFloat32(e,t,n){let s=F(4);new DataView(s.buffer,s.byteOffset,s.byteLength).setFloat32(0,t,n),this.write(s,e)}getFloat64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,t)}setFloat64(e,t,n){let s=F(8);new DataView(s.buffer,s.byteOffset,s.byteLength).setFloat64(0,t,n),this.write(s,e)}equals(e){if(e==null||!(e instanceof r)||e.bufs.length!==this.bufs.length)return!1;for(let t=0;ts+i.byteLength,0)),n.length=t,n}};var b;(function(r){r[r.Data=0]="Data",r[r.WindowUpdate=1]="WindowUpdate",r[r.Ping=2]="Ping",r[r.GoAway=3]="GoAway"})(b||(b={}));var w;(function(r){r[r.SYN=1]="SYN",r[r.ACK=2]="ACK",r[r.FIN=4]="FIN",r[r.RST=8]="RST"})(w||(w={}));var Zr=Object.values(w).filter(r=>typeof r!="string"),Qe=0,I;(function(r){r[r.NormalTermination=0]="NormalTermination",r[r.ProtocolError=1]="ProtocolError",r[r.InternalError=2]="InternalError"})(I||(I={}));var O=12;var Ze=2**24;function Ft(r){if(r[0]!==Qe)throw new h("Invalid frame version",Se);return{type:r[1],flag:(r[2]<<8)+r[3],streamID:r[4]*Ze+(r[5]<<16)+(r[6]<<8)+r[7],length:r[8]*Ze+(r[9]<<16)+(r[10]<<8)+r[11]}}var ne=class{source;buffer;frameInProgress;constructor(e){this.source=Ut(e),this.buffer=new X,this.frameInProgress=!1}async*emitFrames(){for await(let e of this.source)for(this.buffer.append(e);;){let t=this.readHeader();if(t===void 0)break;let{type:n,length:s}=t;n===b.Data?(this.frameInProgress=!0,yield{header:t,readData:this.readBytes.bind(this,s)}):yield{header:t}}}readHeader(){if(this.frameInProgress)throw new h("decoding frame already in progress",Ye);if(this.buffer.length=e)break}let t=this.buffer.sublist(0,e);return this.buffer.consume(e),this.frameInProgress=!1,t}};function Ut(r){if(r[Symbol.iterator]!==void 0){let e=r[Symbol.iterator]();return e.return=void 0,{[Symbol.iterator](){return e}}}else if(r[Symbol.asyncIterator]!==void 0){let e=r[Symbol.asyncIterator]();return e.return=void 0,{[Symbol.asyncIterator](){return e}}}else throw new Error("a source must be either an iterable or an async iterable")}function ve(r){let e=new Uint8Array(O);return e[1]=r.type,e[2]=r.flag>>>8,e[3]=r.flag,e[4]=r.streamID>>>24,e[5]=r.streamID>>>16,e[6]=r.streamID>>>8,e[7]=r.streamID,e[8]=r.length>>>24,e[9]=r.length>>>16,e[10]=r.length>>>8,e[11]=r.length,e}var se=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=t??"ABORT_ERR"}};async function ie(r,e,t){if(e==null)return r;if(e.aborted)return Promise.reject(new se(t?.errorMessage,t?.errorCode));let n,s=new se(t?.errorMessage,t?.errorCode);try{return await Promise.race([r,new Promise((i,a)=>{n=()=>{a(s)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}function et(r){return r==null?!1:typeof r.then=="function"&&typeof r.catch=="function"&&typeof r.finally=="function"}function tt(r,e){let t=Q(r).return?.();et(t)&&t.catch(n=>{e.error("could not cause iterator to return",n)})}var Ot="ERR_STREAM_RESET",kt="ERR_SINK_INVALID_STATE",Mt=5e3;function Ae(r){return r==null?!1:typeof r.then=="function"&&typeof r.catch=="function"&&typeof r.finally=="function"}var oe=class{id;direction;timeline;protocol;metadata;source;status;readStatus;writeStatus;log;sinkController;sinkEnd;closed;endErr;streamSource;onEnd;onCloseRead;onCloseWrite;onReset;onAbort;sendCloseWriteTimeout;constructor(e){this.sinkController=new AbortController,this.sinkEnd=M(),this.closed=M(),this.log=e.log,this.status="open",this.readStatus="ready",this.writeStatus="ready",this.id=e.id,this.metadata=e.metadata??{},this.direction=e.direction,this.timeline={open:Date.now()},this.sendCloseWriteTimeout=e.sendCloseWriteTimeout??Mt,this.onEnd=e.onEnd,this.onCloseRead=e?.onCloseRead,this.onCloseWrite=e?.onCloseWrite,this.onReset=e?.onReset,this.onAbort=e?.onAbort,this.source=this.streamSource=ee({onEnd:t=>{t!=null?this.log.trace("source ended with error",t):this.log.trace("source ended"),this.onSourceEnd(t)}}),this.sink=this.sink.bind(this)}async sink(e){if(this.writeStatus!=="ready")throw new h(`writable end state is "${this.writeStatus}" not "ready"`,kt);try{this.writeStatus="writing";let t={signal:this.sinkController.signal};if(this.direction==="outbound"){let s=this.sendNewStream(t);Ae(s)&&await s}let n=()=>{tt(e,this.log)};try{this.sinkController.signal.addEventListener("abort",n),this.log.trace("sink reading from source");for await(let s of e){s=s instanceof Uint8Array?new X(s):s;let i=this.sendData(s,t);Ae(i)&&await i}}finally{this.sinkController.signal.removeEventListener("abort",n)}this.log.trace('sink finished reading from source, write status is "%s"',this.writeStatus),this.writeStatus==="writing"&&(this.writeStatus="closing",this.log.trace("send close write to remote"),await this.sendCloseWrite({signal:AbortSignal.timeout(this.sendCloseWriteTimeout)}),this.writeStatus="closed"),this.onSinkEnd()}catch(t){throw this.log.trace("sink ended with error, calling abort with error",t),this.abort(t),t}finally{this.log.trace("resolve sink end"),this.sinkEnd.resolve()}}onSourceEnd(e){this.timeline.closeRead==null&&(this.timeline.closeRead=Date.now(),this.readStatus="closed",e!=null&&this.endErr==null&&(this.endErr=e),this.onCloseRead?.(),this.timeline.closeWrite!=null?(this.log.trace("source and sink ended"),this.timeline.close=Date.now(),this.status!=="aborted"&&this.status!=="reset"&&(this.status="closed"),this.onEnd!=null&&this.onEnd(this.endErr),this.closed.resolve()):this.log.trace("source ended, waiting for sink to end"))}onSinkEnd(e){this.timeline.closeWrite==null&&(this.timeline.closeWrite=Date.now(),this.writeStatus="closed",e!=null&&this.endErr==null&&(this.endErr=e),this.onCloseWrite?.(),this.timeline.closeRead!=null?(this.log.trace("sink and source ended"),this.timeline.close=Date.now(),this.status!=="aborted"&&this.status!=="reset"&&(this.status="closed"),this.onEnd!=null&&this.onEnd(this.endErr),this.closed.resolve()):this.log.trace("sink ended, waiting for source to end"))}async close(e){this.log.trace("closing gracefully"),this.status="closing",await Promise.all([this.closeRead(e),this.closeWrite(e)]),await ie(this.closed.promise,e?.signal),this.status="closed",this.log.trace("closed gracefully")}async closeRead(e={}){if(this.readStatus==="closing"||this.readStatus==="closed")return;this.log.trace('closing readable end of stream with starting read status "%s"',this.readStatus);let t=this.readStatus;this.readStatus="closing",this.status!=="reset"&&this.status!=="aborted"&&this.timeline.closeRead==null&&(this.log.trace("send close read to remote"),await this.sendCloseRead(e)),t==="ready"&&(this.log.trace("ending internal source queue with %d queued bytes",this.streamSource.readableLength),this.streamSource.end()),this.log.trace("closed readable end of stream")}async closeWrite(e={}){this.writeStatus==="closing"||this.writeStatus==="closed"||(this.log.trace('closing writable end of stream with starting write status "%s"',this.writeStatus),this.writeStatus==="ready"&&(this.log.trace("sink was never sunk, sink an empty array"),await ie(this.sink([]),e.signal)),this.writeStatus==="writing"&&await new Promise((t,n)=>{queueMicrotask(()=>{this.log.trace("aborting source passed to .sink"),this.sinkController.abort(),ie(this.sinkEnd.promise,e.signal).then(t,n)})}),this.writeStatus="closed",this.log.trace("closed writable end of stream"))}abort(e){if(this.status==="closed"||this.status==="aborted"||this.status==="reset")return;this.log("abort with error",e),this.log("try to send reset to remote");let t=this.sendReset();Ae(t)&&t.catch(n=>{this.log.error("error sending reset message",n)}),this.status="aborted",this.timeline.abort=Date.now(),this._closeSinkAndSource(e),this.onAbort?.(e)}reset(){if(this.status==="closed"||this.status==="aborted"||this.status==="reset")return;let e=new h("stream reset",Ot);this.status="reset",this.timeline.reset=Date.now(),this._closeSinkAndSource(e),this.onReset?.()}_closeSinkAndSource(e){this._closeSink(e),this._closeSource(e)}_closeSink(e){this.writeStatus==="writing"&&(this.log.trace("end sink source"),this.sinkController.abort()),this.onSinkEnd(e)}_closeSource(e){this.readStatus!=="closing"&&this.readStatus!=="closed"&&(this.log.trace("ending source with %d bytes to be read by consumer",this.streamSource.readableLength),this.readStatus="closing",this.streamSource.end(e))}remoteCloseWrite(){if(this.readStatus==="closing"||this.readStatus==="closed"){this.log("received remote close write but local source is already closed");return}this.log.trace("remote close write"),this._closeSource()}remoteCloseRead(){if(this.writeStatus==="closing"||this.writeStatus==="closed"){this.log("received remote close read but local sink is already closed");return}this.log.trace("remote close read"),this._closeSink()}destroy(){if(this.status==="closed"||this.status==="aborted"||this.status==="reset"){this.log("received destroy but we are already closed");return}this.log.trace("stream destroyed"),this._closeSinkAndSource()}sourcePush(e){this.streamSource.push(e)}sourceReadableLength(){return this.streamSource.readableLength}};function Pt(r){let[e,t]=r[Symbol.asyncIterator]!=null?[r[Symbol.asyncIterator](),Symbol.asyncIterator]:[r[Symbol.iterator](),Symbol.iterator],n=[];return{peek:()=>e.next(),push:s=>{n.push(s)},next:()=>n.length>0?{done:!1,value:n.shift()}:e.next(),[t](){return this}}}var rt=Pt;function Wt(r){return r[Symbol.asyncIterator]!=null}function nt(r){return r?.then!=null}function Vt(r,e){if(Wt(r))return async function*(){for await(let u of r){let f=e(u);nt(f)&&await f,yield u}}();let t=rt(r),{value:n,done:s}=t.next();if(s===!0)return function*(){}();if(typeof e(n)?.then=="function")return async function*(){yield n;for await(let u of t){let f=e(u);nt(f)&&await f,yield u}}();let a=e;return function*(){yield n;for(let u of t)a(u),yield u}()}var st=Vt;var T;(function(r){r[r.Init=0]="Init",r[r.SYNSent=1]="SYNSent",r[r.SYNReceived=2]="SYNReceived",r[r.Established=3]="Established",r[r.Finished=4]="Finished"})(T||(T={}));var ae=class extends oe{name;state;config;_id;sendWindowCapacity;sendWindowCapacityUpdate;recvWindow;recvWindowCapacity;epochStart;getRTT;sendFrame;constructor(e){super({...e,onEnd:t=>{this.state=T.Finished,e.onEnd?.(t)}}),this.config=e.config,this._id=parseInt(e.id,10),this.name=e.name,this.state=e.state,this.sendWindowCapacity=Y,this.recvWindow=this.config.initialStreamWindowSize,this.recvWindowCapacity=this.recvWindow,this.epochStart=Date.now(),this.getRTT=e.getRTT,this.sendFrame=e.sendFrame,this.source=st(this.source,()=>{this.sendWindowUpdate()})}async sendNewStream(){}async sendData(e,t={}){for(e=e.sublist();e.byteLength!==0;){if(this.sendWindowCapacity===0&&await this.waitForSendWindowCapacity(t),this.status!=="open")return;let n=Math.min(this.sendWindowCapacity,this.config.maxMessageSize-O,e.length),s=this.getSendFlags();this.sendFrame({type:b.Data,flag:s,streamID:this._id,length:n},e.sublist(0,n)),this.sendWindowCapacity-=n,e.consume(n)}}async sendReset(){this.sendFrame({type:b.WindowUpdate,flag:w.RST,streamID:this._id,length:0})}async sendCloseWrite(){let e=this.getSendFlags()|w.FIN;this.sendFrame({type:b.WindowUpdate,flag:e,streamID:this._id,length:0})}async sendCloseRead(){}async waitForSendWindowCapacity(e={}){if(this.sendWindowCapacity>0)return;let t,n,s=()=>{this.status==="open"?n(new h("stream aborted",ze)):t()};e.signal?.addEventListener("abort",s);try{await new Promise((i,a)=>{this.sendWindowCapacityUpdate=()=>{i()},n=a,t=i})}finally{e.signal?.removeEventListener("abort",s)}}handleWindowUpdate(e){this.log?.trace("stream received window update id=%s",this._id),this.processFlags(e.flag);let t=this.sendWindowCapacity;this.sendWindowCapacity+=e.length,t===0&&e.length>0&&this.sendWindowCapacityUpdate?.()}async handleData(e,t){if(this.log?.trace("stream received data id=%s",this._id),this.processFlags(e.flag),this.recvWindowCapacity-1&&t-this.epochStart=this.recvWindow&&e===0)return;let s=this.recvWindow-this.recvWindowCapacity;this.recvWindowCapacity=this.recvWindow,this.epochStart=t,this.sendFrame({type:b.WindowUpdate,flag:e,streamID:this._id,length:s})}};var it="/yamux/1.0.0",Gt=500,le=class{protocol=it;_init;constructor(e={}){this._init=e}createStreamMuxer(e){return new Ie({...this._init,...e})}},Ie=class{protocol=it;source;sink;config;log;closeController;nextStreamID;_streams;nextPingID;activePing;rtt;client;localGoAway;remoteGoAway;numInboundStreams;numOutboundStreams;onIncomingStream;onStreamEnd;constructor(e){this.client=e.direction==="outbound",this.config={...$e,...e},this.log=this.config.log,He(this.config),this.closeController=new AbortController,he(1/0,this.closeController.signal),this.onIncomingStream=e.onIncomingStream,this.onStreamEnd=e.onStreamEnd,this._streams=new Map,this.source=ee({onEnd:()=>{this.log?.trace("muxer source ended"),this._streams.forEach(t=>{t.destroy()})}}),this.sink=async t=>{let n=()=>{let a=Q(t);if(a.return!=null){let u=a.return();Bt(u)&&u.catch(f=>{this.log?.("could not cause sink source to return",f)})}},s,i;try{let a=new ne(t);try{this.closeController.signal.addEventListener("abort",n);for await(let u of a.emitFrames())await this.handleFrame(u.header,u.readData)}finally{this.closeController.signal.removeEventListener("abort",n)}s=I.NormalTermination}catch(a){let u=a.code;Be.has(u)?(this.log?.error("protocol error in sink",a),s=I.ProtocolError):(this.log?.error("internal error in sink",a),s=I.InternalError),i=a}this.log?.trace("muxer sink ended"),i!=null?this.abort(i,s):await this.close({reason:s})},this.numInboundStreams=0,this.numOutboundStreams=0,this.nextStreamID=this.client?1:2,this.nextPingID=0,this.rtt=-1,this.log?.trace("muxer created"),this.config.enableKeepAlive&&this.keepAliveLoop().catch(t=>this.log?.error("keepalive error: %s",t)),this.ping().catch(t=>this.log?.error("ping error: %s",t))}get streams(){return Array.from(this._streams.values())}newStream(e){if(this.remoteGoAway!==void 0)throw new h("muxer closed remotely",xe);if(this.localGoAway!==void 0)throw new h("muxer closed locally",te);let t=this.nextStreamID;if(this.nextStreamID+=2,this.numOutboundStreams>=this.config.maxOutboundStreams)throw new h("max outbound streams exceeded",Xe);this.log?.trace("new outgoing stream id=%s",t);let n=this._newStream(t,e,T.Init,"outbound");return this._streams.set(t,n),this.numOutboundStreams++,n.sendWindowUpdate(),n}async ping(){if(this.remoteGoAway!==void 0)throw new h("muxer closed remotely",xe);if(this.localGoAway!==void 0)throw new h("muxer closed locally",te);if(this.activePing===void 0){let e=()=>{};this.activePing={id:this.nextPingID++,promise:new Promise((s,i)=>{let a=()=>{i(new h("muxer closed locally",te))};this.closeController.signal.addEventListener("abort",a,{once:!0}),e=()=>{this.closeController.signal.removeEventListener("abort",a),s()}}),resolve:e};let t=Date.now();this.sendPing(this.activePing.id);try{await this.activePing.promise}finally{delete this.activePing}let n=Date.now();this.rtt=n-t}else await this.activePing.promise;return this.rtt}getRTT(){return this.rtt}async close(e={}){if(this.closeController.signal.aborted)return;let t=e?.reason??I.NormalTermination;if(this.log?.trace("muxer close reason=%s",t),e.signal==null){let n=AbortSignal.timeout(Gt);he(1/0,n),e={...e,signal:n}}try{await Promise.all([...this._streams.values()].map(async n=>n.close(e))),this.sendGoAway(t),this._closeMuxer()}catch(n){this.abort(n)}}abort(e,t){if(!this.closeController.signal.aborted){t=t??I.InternalError,this.log?.error("muxer abort reason=%s error=%s",t,e);for(let n of this._streams.values())n.abort(e);this.sendGoAway(t),this._closeMuxer()}}isClosed(){return this.closeController.signal.aborted}_closeMuxer(){this.closeController.abort(),this.source.end()}_newStream(e,t,n,s){if(this._streams.get(e)!=null)throw new h("Stream already exists",Ee,{id:e});let i=new ae({id:e.toString(),name:t,state:n,direction:s,sendFrame:this.sendFrame.bind(this),onEnd:()=>{this.closeStream(e),this.onStreamEnd?.(i)},log:J(`libp2p:yamux:${s}:${e}`),config:this.config,getRTT:this.getRTT.bind(this)});return i}closeStream(e){this.client===(e%2===0)?this.numInboundStreams--:this.numOutboundStreams--,this._streams.delete(e)}async keepAliveLoop(){let e=new Promise((t,n)=>{this.closeController.signal.addEventListener("abort",n,{once:!0})});for(this.log?.trace("muxer keepalive enabled interval=%s",this.config.keepAliveInterval);;){let t;try{await Promise.race([e,new Promise(n=>{t=setTimeout(n,this.config.keepAliveInterval)})]),this.ping().catch(n=>this.log?.error("ping error: %s",n))}catch{clearInterval(t);return}}}async handleFrame(e,t){let{streamID:n,type:s,length:i}=e;if(this.log?.trace("received frame %o",e),n===0)switch(s){case b.Ping:{this.handlePing(e);return}case b.GoAway:{this.handleGoAway(i);return}default:throw new h("Invalid frame type",z,{header:e})}else switch(e.type){case b.Data:case b.WindowUpdate:{await this.handleStreamMessage(e,t);return}default:throw new h("Invalid frame type",z,{header:e})}}handlePing(e){if(e.flag===w.SYN)this.log?.trace("received ping request pingId=%s",e.length),this.sendPing(e.length,w.ACK);else if(e.flag===w.ACK)this.log?.trace("received ping response pingId=%s",e.length),this.handlePingResponse(e.length);else throw new h("Invalid frame flag",z,{header:e})}handlePingResponse(e){if(this.activePing===void 0)throw new h("ping not requested",be);if(this.activePing.id!==e)throw new h("ping doesn't match our id",ye);this.activePing.resolve()}handleGoAway(e){this.log?.trace("received GoAway reason=%s",I[e]??"unknown"),this.remoteGoAway=e;for(let t of this._streams.values())t.reset();this._closeMuxer()}async handleStreamMessage(e,t){let{streamID:n,flag:s,type:i}=e;(s&w.SYN)===w.SYN&&this.incomingStream(n);let a=this._streams.get(n);if(a===void 0){if(i===b.Data){if(this.log?.("discarding data for stream id=%s",n),t===void 0)throw new Error("unreachable");await t()}else this.log?.("frame for missing stream id=%s",n);return}switch(i){case b.WindowUpdate:{a.handleWindowUpdate(e);return}case b.Data:{if(t===void 0)throw new Error("unreachable");await a.handleData(e,t);return}default:throw new Error("unreachable")}}incomingStream(e){if(this.client!==(e%2===0))throw new h("both endpoints are clients",Ce);if(this._streams.has(e))return;if(this.log?.trace("new incoming stream id=%s",e),this.localGoAway!==void 0){this.sendFrame({type:b.WindowUpdate,flag:w.RST,streamID:e,length:0});return}if(this.numInboundStreams>=this.config.maxInboundStreams){this.log?.("maxIncomingStreams exceeded, forcing stream reset"),this.sendFrame({type:b.WindowUpdate,flag:w.RST,streamID:e,length:0});return}let t=this._newStream(e,void 0,T.SYNReceived,"inbound");this.numInboundStreams++,this._streams.set(e,t),this.onIncomingStream?.(t)}sendFrame(e,t){if(this.log?.trace("sending frame %o",e),e.type===b.Data){if(t===void 0)throw new h("invalid frame",z);this.source.push(ve(e)),this.source.push(t)}else this.source.push(ve(e))}sendPing(e,t=w.SYN){t===w.SYN?this.log?.trace("sending ping request pingId=%s",e):this.log?.trace("sending ping response pingId=%s",e),this.sendFrame({type:b.Ping,flag:t,streamID:0,length:e})}sendGoAway(e=I.NormalTermination){this.log?.("sending GoAway reason=%s",I[e]),this.localGoAway=e,this.sendFrame({type:b.GoAway,flag:0,streamID:0,length:e})}};function Bt(r){return r!=null&&typeof r.then=="function"}function zt(r={}){return()=>new le(r)}return dt(Xt);})(); -return ChainsafeLibp2PYamux})); diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/config.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/config.d.ts deleted file mode 100644 index ff55522e1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/config.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { type Logger } from '@libp2p/logger'; -export interface Config { - /** - * Used to control the log destination - * - * It can be disabled by explicitly setting to `undefined` - */ - log?: Logger; - /** - * Used to do periodic keep alive messages using a ping. - */ - enableKeepAlive: boolean; - /** - * How often to perform the keep alive - * - * measured in milliseconds - */ - keepAliveInterval: number; - /** - * Maximum number of concurrent inbound streams that we accept. - * If the peer tries to open more streams, those will be reset immediately. - */ - maxInboundStreams: number; - /** - * Maximum number of concurrent outbound streams that we accept. - * If the application tries to open more streams, the call to `newStream` will throw - */ - maxOutboundStreams: number; - /** - * Used to control the initial window size that we allow for a stream. - * - * measured in bytes - */ - initialStreamWindowSize: number; - /** - * Used to control the maximum window size that we allow for a stream. - */ - maxStreamWindowSize: number; - /** - * Maximum size of a message that we'll send on a stream. - * This ensures that a single stream doesn't hog a connection. - */ - maxMessageSize: number; -} -export declare const defaultConfig: Config; -export declare function verifyConfig(config: Config): void; -//# sourceMappingURL=config.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/config.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/config.d.ts.map deleted file mode 100644 index f936d2ec5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/config.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAIpD,MAAM,WAAW,MAAM;IACrB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,eAAe,EAAE,OAAO,CAAA;IAExB;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAA;IAE1B;;;;OAIG;IACH,uBAAuB,EAAE,MAAM,CAAA;IAE/B;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAA;IAE3B;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,aAAa,EAAE,MAS3B,CAAA;AAED,wBAAgB,YAAY,CAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAsBlD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/config.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/config.js deleted file mode 100644 index b3f7ac179..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/config.js +++ /dev/null @@ -1,37 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { logger } from '@libp2p/logger'; -import { ERR_INVALID_CONFIG, INITIAL_STREAM_WINDOW, MAX_STREAM_WINDOW } from './constants.js'; -export const defaultConfig = { - log: logger('libp2p:yamux'), - enableKeepAlive: true, - keepAliveInterval: 30000, - maxInboundStreams: 1000, - maxOutboundStreams: 1000, - initialStreamWindowSize: INITIAL_STREAM_WINDOW, - maxStreamWindowSize: MAX_STREAM_WINDOW, - maxMessageSize: 64 * 1024 -}; -export function verifyConfig(config) { - if (config.keepAliveInterval <= 0) { - throw new CodeError('keep-alive interval must be positive', ERR_INVALID_CONFIG); - } - if (config.maxInboundStreams < 0) { - throw new CodeError('max inbound streams must be larger or equal 0', ERR_INVALID_CONFIG); - } - if (config.maxOutboundStreams < 0) { - throw new CodeError('max outbound streams must be larger or equal 0', ERR_INVALID_CONFIG); - } - if (config.initialStreamWindowSize < INITIAL_STREAM_WINDOW) { - throw new CodeError('InitialStreamWindowSize must be larger or equal 256 kB', ERR_INVALID_CONFIG); - } - if (config.maxStreamWindowSize < config.initialStreamWindowSize) { - throw new CodeError('MaxStreamWindowSize must be larger than the InitialStreamWindowSize', ERR_INVALID_CONFIG); - } - if (config.maxStreamWindowSize > 2 ** 32 - 1) { - throw new CodeError('MaxStreamWindowSize must be less than equal MAX_UINT32', ERR_INVALID_CONFIG); - } - if (config.maxMessageSize < 1024) { - throw new CodeError('MaxMessageSize must be greater than a kilobyte', ERR_INVALID_CONFIG); - } -} -//# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/config.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/config.js.map deleted file mode 100644 index 1f9fe8cb1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,MAAM,EAAe,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAsD7F,MAAM,CAAC,MAAM,aAAa,GAAW;IACnC,GAAG,EAA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-down-nagle/yamux/dist/src/constants.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/constants.d.ts deleted file mode 100644 index a9ad1e4d6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/constants.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -export declare const ERR_INVALID_FRAME = "ERR_INVALID_FRAME"; -export declare const ERR_UNREQUESTED_PING = "ERR_UNREQUESTED_PING"; -export declare const ERR_NOT_MATCHING_PING = "ERR_NOT_MATCHING_PING"; -export declare const ERR_STREAM_ALREADY_EXISTS = "ERR_STREAM_ALREADY_EXISTS"; -export declare const ERR_DECODE_INVALID_VERSION = "ERR_DECODE_INVALID_VERSION"; -export declare const ERR_BOTH_CLIENTS = "ERR_BOTH_CLIENTS"; -export declare const ERR_RECV_WINDOW_EXCEEDED = "ERR_RECV_WINDOW_EXCEEDED"; -export declare const PROTOCOL_ERRORS: Set; -export declare const ERR_INVALID_CONFIG = "ERR_INVALID_CONFIG"; -export declare const ERR_MUXER_LOCAL_CLOSED = "ERR_MUXER_LOCAL_CLOSED"; -export declare const ERR_MUXER_REMOTE_CLOSED = "ERR_MUXER_REMOTE_CLOSED"; -export declare const ERR_STREAM_RESET = "ERR_STREAM_RESET"; -export declare const ERR_STREAM_ABORT = "ERR_STREAM_ABORT"; -export declare const ERR_MAX_OUTBOUND_STREAMS_EXCEEDED = "ERROR_MAX_OUTBOUND_STREAMS_EXCEEDED"; -export declare const ERR_DECODE_IN_PROGRESS = "ERR_DECODE_IN_PROGRESS"; -/** - * INITIAL_STREAM_WINDOW is the initial stream window size. - * - * Not an implementation choice, this is defined in the specification - */ -export declare const INITIAL_STREAM_WINDOW: number; -/** - * Default max stream window - */ -export declare const MAX_STREAM_WINDOW: number; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/constants.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/constants.d.ts.map deleted file mode 100644 index 81d5aa8ae..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,sBAAsB,CAAA;AACpD,eAAO,MAAM,oBAAoB,yBAAyB,CAAA;AAC1D,eAAO,MAAM,qBAAqB,0BAA0B,CAAA;AAC5D,eAAO,MAAM,yBAAyB,8BAA8B,CAAA;AACpE,eAAO,MAAM,0BAA0B,+BAA+B,CAAA;AACtE,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAClD,eAAO,MAAM,wBAAwB,6BAA6B,CAAA;AAElE,eAAO,MAAM,eAAe,aAQ1B,CAAA;AAIF,eAAO,MAAM,kBAAkB,uBAAuB,CAAA;AACtD,eAAO,MAAM,sBAAsB,2BAA2B,CAAA;AAC9D,eAAO,MAAM,uBAAuB,4BAA4B,CAAA;AAChE,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAClD,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAClD,eAAO,MAAM,iCAAiC,wCAAwC,CAAA;AACtF,eAAO,MAAM,sBAAsB,2BAA2B,CAAA;AAE9D;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAa,CAAA;AAE/C;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAmB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/constants.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/constants.js deleted file mode 100644 index ddc95641a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/constants.js +++ /dev/null @@ -1,36 +0,0 @@ -// Protocol violation errors -export const ERR_INVALID_FRAME = 'ERR_INVALID_FRAME'; -export const ERR_UNREQUESTED_PING = 'ERR_UNREQUESTED_PING'; -export const ERR_NOT_MATCHING_PING = 'ERR_NOT_MATCHING_PING'; -export const ERR_STREAM_ALREADY_EXISTS = 'ERR_STREAM_ALREADY_EXISTS'; -export const ERR_DECODE_INVALID_VERSION = 'ERR_DECODE_INVALID_VERSION'; -export const ERR_BOTH_CLIENTS = 'ERR_BOTH_CLIENTS'; -export const ERR_RECV_WINDOW_EXCEEDED = 'ERR_RECV_WINDOW_EXCEEDED'; -export const PROTOCOL_ERRORS = new Set([ - ERR_INVALID_FRAME, - ERR_UNREQUESTED_PING, - ERR_NOT_MATCHING_PING, - ERR_STREAM_ALREADY_EXISTS, - ERR_DECODE_INVALID_VERSION, - ERR_BOTH_CLIENTS, - ERR_RECV_WINDOW_EXCEEDED -]); -// local errors -export const ERR_INVALID_CONFIG = 'ERR_INVALID_CONFIG'; -export const ERR_MUXER_LOCAL_CLOSED = 'ERR_MUXER_LOCAL_CLOSED'; -export const ERR_MUXER_REMOTE_CLOSED = 'ERR_MUXER_REMOTE_CLOSED'; -export const ERR_STREAM_RESET = 'ERR_STREAM_RESET'; -export const ERR_STREAM_ABORT = 'ERR_STREAM_ABORT'; -export const ERR_MAX_OUTBOUND_STREAMS_EXCEEDED = 'ERROR_MAX_OUTBOUND_STREAMS_EXCEEDED'; -export const ERR_DECODE_IN_PROGRESS = 'ERR_DECODE_IN_PROGRESS'; -/** - * INITIAL_STREAM_WINDOW is the initial stream window size. - * - * Not an implementation choice, this is defined in the specification - */ -export const INITIAL_STREAM_WINDOW = 256 * 1024; -/** - * Default max stream window - */ -export const MAX_STREAM_WINDOW = 16 * 1024 * 1024; -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/constants.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/constants.js.map deleted file mode 100644 index 6995fa29b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAE5B,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAA;AACpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAA;AAC1D,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAA;AAC5D,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAA;AACpE,MAAM,CAAC,MAAM,0BAA0B,GAAG,4BAA4B,CAAA;AACtE,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAA;AAClD,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAA;AAElE,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IACrC,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,yBAAyB;IACzB,0BAA0B;IAC1B,gBAAgB;IAChB,wBAAwB;CACzB,CAAC,CAAA;AAEF,eAAe;AAEf,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAA;AACtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAA;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAA;AAClD,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAA;AAClD,MAAM,CAAC,MAAM,iCAAiC,GAAG,qCAAqC,CAAA;AACtF,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAE9D;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,GAAG,IAAI,CAAA;AAE/C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/decode.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/decode.d.ts deleted file mode 100644 index 213b19340..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/decode.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import { type FrameHeader } from './frame.js'; -import type { Source } from 'it-stream-types'; -/** - * Decode a header from the front of a buffer - * - * @param data - Assumed to have enough bytes for a header - */ -export declare function decodeHeader(data: Uint8Array): FrameHeader; -/** - * Decodes yamux frames from a source - */ -export declare class Decoder { - private readonly source; - /** Buffer for in-progress frames */ - private readonly buffer; - /** Used to sanity check against decoding while in an inconsistent state */ - private frameInProgress; - constructor(source: Source); - /** - * Emits frames from the decoder source. - * - * Note: If `readData` is emitted, it _must_ be called before the next iteration - * Otherwise an error is thrown - */ - emitFrames(): AsyncGenerator<{ - header: FrameHeader; - readData?: () => Promise; - }>; - private readHeader; - private readBytes; -} -/** - * Strip the `return` method from a `Source` - */ -export declare function returnlessSource(source: Source): Source; -//# sourceMappingURL=decode.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/decode.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/decode.d.ts.map deleted file mode 100644 index e5734d620..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/decode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../src/decode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,EAAE,KAAK,WAAW,EAA2C,MAAM,YAAY,CAAA;AACtF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAM7C;;;;GAIG;AACH,wBAAgB,YAAY,CAAE,IAAI,EAAE,UAAU,GAAG,WAAW,CAU3D;AAED;;GAEG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;IAC5D,oCAAoC;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;IACvC,2EAA2E;IAC3E,OAAO,CAAC,eAAe,CAAS;gBAEnB,MAAM,EAAE,MAAM,CAAC,UAAU,GAAG,cAAc,CAAC;IAcxD;;;;;OAKG;IACK,UAAU,IAAK,cAAc,CAAC;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,CAAA;KAAE,CAAC;IA4BxG,OAAO,CAAC,UAAU;YAiBJ,SAAS;CAoBxB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAG,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAgBjE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/decode.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/decode.js deleted file mode 100644 index aaf020d66..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/decode.js +++ /dev/null @@ -1,131 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { Uint8ArrayList } from 'uint8arraylist'; -import { ERR_DECODE_INVALID_VERSION, ERR_DECODE_IN_PROGRESS } from './constants.js'; -import { FrameType, HEADER_LENGTH, YAMUX_VERSION } from './frame.js'; -// used to bitshift in decoding -// native bitshift can overflow into a negative number, so we bitshift by multiplying by a power of 2 -const twoPow24 = 2 ** 24; -/** - * Decode a header from the front of a buffer - * - * @param data - Assumed to have enough bytes for a header - */ -export function decodeHeader(data) { - if (data[0] !== YAMUX_VERSION) { - throw new CodeError('Invalid frame version', ERR_DECODE_INVALID_VERSION); - } - return { - type: data[1], - flag: (data[2] << 8) + data[3], - streamID: (data[4] * twoPow24) + (data[5] << 16) + (data[6] << 8) + data[7], - length: (data[8] * twoPow24) + (data[9] << 16) + (data[10] << 8) + data[11] - }; -} -/** - * Decodes yamux frames from a source - */ -export class Decoder { - source; - /** Buffer for in-progress frames */ - buffer; - /** Used to sanity check against decoding while in an inconsistent state */ - frameInProgress; - constructor(source) { - // Normally, when entering a for-await loop with an iterable/async iterable, the only ways to exit the loop are: - // 1. exhaust the iterable - // 2. throw an error - slow, undesirable if there's not actually an error - // 3. break or return - calls the iterable's `return` method, finalizing the iterable, no more iteration possible - // - // In this case, we want to enter (and exit) a for-await loop per chunked data frame and continue processing the iterable. - // To do this, we strip the `return` method from the iterator and can now `break` early and continue iterating. - // Exiting the main for-await is still possible via 1. and 2. - this.source = returnlessSource(source); - this.buffer = new Uint8ArrayList(); - this.frameInProgress = false; - } - /** - * Emits frames from the decoder source. - * - * Note: If `readData` is emitted, it _must_ be called before the next iteration - * Otherwise an error is thrown - */ - async *emitFrames() { - for await (const chunk of this.source) { - this.buffer.append(chunk); - // Loop to consume as many bytes from the buffer as possible - // Eg: when a single chunk contains several frames - while (true) { - const header = this.readHeader(); - if (header === undefined) { - break; - } - const { type, length } = header; - if (type === FrameType.Data) { - // This is a data frame, the frame body must still be read - // `readData` must be called before the next iteration here - this.frameInProgress = true; - yield { - header, - readData: this.readBytes.bind(this, length) - }; - } - else { - yield { header }; - } - } - } - } - readHeader() { - // Sanity check to ensure a header isn't read when another frame is partially decoded - // In practice this shouldn't happen - if (this.frameInProgress) { - throw new CodeError('decoding frame already in progress', ERR_DECODE_IN_PROGRESS); - } - if (this.buffer.length < HEADER_LENGTH) { - // not enough data yet - return; - } - const header = decodeHeader(this.buffer.subarray(0, HEADER_LENGTH)); - this.buffer.consume(HEADER_LENGTH); - return header; - } - async readBytes(length) { - if (this.buffer.length < length) { - for await (const chunk of this.source) { - this.buffer.append(chunk); - if (this.buffer.length >= length) { - // see note above, the iterator is not `return`ed here - break; - } - } - } - const out = this.buffer.sublist(0, length); - this.buffer.consume(length); - // The next frame can now be decoded - this.frameInProgress = false; - return out; - } -} -/** - * Strip the `return` method from a `Source` - */ -export function returnlessSource(source) { - if (source[Symbol.iterator] !== undefined) { - const iterator = source[Symbol.iterator](); - iterator.return = undefined; - return { - [Symbol.iterator]() { return iterator; } - }; - } - else if (source[Symbol.asyncIterator] !== undefined) { - const iterator = source[Symbol.asyncIterator](); - iterator.return = undefined; - return { - [Symbol.asyncIterator]() { return iterator; } - }; - } - else { - throw new Error('a source must be either an iterable or an async iterable'); - } -} -//# sourceMappingURL=decode.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/decode.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/decode.js.map deleted file mode 100644 index 4f017a489..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/decode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode.js","sourceRoot":"","sources":["../../src/decode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AACnF,OAAO,EAAoB,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAGtF,+BAA+B;AAC/B,qGAAqG;AACrG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\ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/encode.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/encode.d.ts deleted file mode 100644 index 22cda8ff5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/encode.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FrameHeader } from './frame.js'; -export declare function encodeHeader(header: FrameHeader): Uint8Array; -//# sourceMappingURL=encode.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/encode.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/encode.d.ts.map deleted file mode 100644 index 663e060f6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/encode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../src/encode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C,wBAAgB,YAAY,CAAE,MAAM,EAAE,WAAW,GAAG,UAAU,CAsB7D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/encode.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/encode.js deleted file mode 100644 index ef322918e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/encode.js +++ /dev/null @@ -1,19 +0,0 @@ -import { HEADER_LENGTH } from './frame.js'; -export function encodeHeader(header) { - const frame = new Uint8Array(HEADER_LENGTH); - // always assume version 0 - // frameView.setUint8(0, header.version) - frame[1] = header.type; - frame[2] = header.flag >>> 8; - frame[3] = header.flag; - frame[4] = header.streamID >>> 24; - frame[5] = header.streamID >>> 16; - frame[6] = header.streamID >>> 8; - frame[7] = header.streamID; - frame[8] = header.length >>> 24; - frame[9] = header.length >>> 16; - frame[10] = header.length >>> 8; - frame[11] = header.length; - return frame; -} -//# sourceMappingURL=encode.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/encode.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/encode.js.map deleted file mode 100644 index 2c3e44e75..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/encode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode.js","sourceRoot":"","sources":["../../src/encode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG1C,MAAM,UAAU,YAAY,CAAE,MAAmB;IAC/C,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,aAAa,CAAC,CAAA;IAE3C,0BAA0B;IAC1B,wCAAwC;IAExC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAA;IAEtB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,KAAK,CAAC,CAAA;IAC5B,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAA;IAEtB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,KAAK,EAAE,CAAA;IACjC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,KAAK,EAAE,CAAA;IACjC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAA;IAChC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAA;IAE1B,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,EAAE,CAAA;IAC/B,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,EAAE,CAAA;IAC/B,KAAK,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,CAAC,CAAA;IAC/B,KAAK,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,CAAA;IAEzB,OAAO,KAAK,CAAA;AACd,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/frame.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/frame.d.ts deleted file mode 100644 index 2ca65226f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/frame.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -export declare enum FrameType { - /** Used to transmit data. May transmit zero length payloads depending on the flags. */ - Data = 0, - /** Used to updated the senders receive window size. This is used to implement per-session flow control. */ - WindowUpdate = 1, - /** Used to measure RTT. It can also be used to heart-beat and do keep-alives over TCP. */ - Ping = 2, - /** Used to close a session. */ - GoAway = 3 -} -export declare enum Flag { - /** Signals the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate outbound. */ - SYN = 1, - /** Acknowledges the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate response. */ - ACK = 2, - /** Performs a half-close of a stream. May be sent with a data message or window update. */ - FIN = 4, - /** Reset a stream immediately. May be sent with a data or window update message. */ - RST = 8 -} -export declare const YAMUX_VERSION = 0; -export declare enum GoAwayCode { - NormalTermination = 0, - ProtocolError = 1, - InternalError = 2 -} -export declare const HEADER_LENGTH = 12; -export interface FrameHeader { - /** - * The version field is used for future backward compatibility. - * At the current time, the field is always set to 0, to indicate the initial version. - */ - version?: number; - /** The type field is used to switch the frame message type. */ - type: FrameType; - /** The flags field is used to provide additional information related to the message type. */ - flag: number; - /** - * The StreamID field is used to identify the logical stream the frame is addressing. - * The client side should use odd ID's, and the server even. - * This prevents any collisions. Additionally, the 0 ID is reserved to represent the session. - */ - streamID: number; - /** - * The meaning of the length field depends on the message type: - * * Data - provides the length of bytes following the header - * * Window update - provides a delta update to the window size - * * Ping - Contains an opaque value, echoed back - * * Go Away - Contains an error code - */ - length: number; -} -export declare function stringifyHeader(header: FrameHeader): string; -//# sourceMappingURL=frame.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/frame.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/frame.d.ts.map deleted file mode 100644 index eed8a553b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/frame.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../src/frame.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,uFAAuF;IACvF,IAAI,IAAM;IACV,2GAA2G;IAC3G,YAAY,IAAM;IAClB,0FAA0F;IAC1F,IAAI,IAAM;IACV,+BAA+B;IAC/B,MAAM,IAAM;CACb;AAED,oBAAY,IAAI;IACd,uIAAuI;IACvI,GAAG,IAAM;IACT,4IAA4I;IAC5I,GAAG,IAAM;IACT,2FAA2F;IAC3F,GAAG,IAAM;IACT,oFAAoF;IACpF,GAAG,IAAM;CACV;AAID,eAAO,MAAM,aAAa,IAAI,CAAA;AAE9B,oBAAY,UAAU;IACpB,iBAAiB,IAAM;IACvB,aAAa,IAAM;IACnB,aAAa,IAAM;CACpB;AAED,eAAO,MAAM,aAAa,KAAK,CAAA;AAE/B,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,+DAA+D;IAC/D,IAAI,EAAE,SAAS,CAAA;IACf,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,eAAe,CAAE,MAAM,EAAE,WAAW,GAAG,MAAM,CAG5D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/frame.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/frame.js deleted file mode 100644 index de1f1c83d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/frame.js +++ /dev/null @@ -1,36 +0,0 @@ -export var FrameType; -(function (FrameType) { - /** Used to transmit data. May transmit zero length payloads depending on the flags. */ - FrameType[FrameType["Data"] = 0] = "Data"; - /** Used to updated the senders receive window size. This is used to implement per-session flow control. */ - FrameType[FrameType["WindowUpdate"] = 1] = "WindowUpdate"; - /** Used to measure RTT. It can also be used to heart-beat and do keep-alives over TCP. */ - FrameType[FrameType["Ping"] = 2] = "Ping"; - /** Used to close a session. */ - FrameType[FrameType["GoAway"] = 3] = "GoAway"; -})(FrameType || (FrameType = {})); -export var Flag; -(function (Flag) { - /** Signals the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate outbound. */ - Flag[Flag["SYN"] = 1] = "SYN"; - /** Acknowledges the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate response. */ - Flag[Flag["ACK"] = 2] = "ACK"; - /** Performs a half-close of a stream. May be sent with a data message or window update. */ - Flag[Flag["FIN"] = 4] = "FIN"; - /** Reset a stream immediately. May be sent with a data or window update message. */ - Flag[Flag["RST"] = 8] = "RST"; -})(Flag || (Flag = {})); -const flagCodes = Object.values(Flag).filter((x) => typeof x !== 'string'); -export const YAMUX_VERSION = 0; -export var GoAwayCode; -(function (GoAwayCode) { - GoAwayCode[GoAwayCode["NormalTermination"] = 0] = "NormalTermination"; - GoAwayCode[GoAwayCode["ProtocolError"] = 1] = "ProtocolError"; - GoAwayCode[GoAwayCode["InternalError"] = 2] = "InternalError"; -})(GoAwayCode || (GoAwayCode = {})); -export const HEADER_LENGTH = 12; -export function stringifyHeader(header) { - const flags = flagCodes.filter(f => (header.flag & f) === f).map(f => Flag[f]).join('|'); - return `streamID=${header.streamID} type=${FrameType[header.type]} flag=${flags} length=${header.length}`; -} -//# sourceMappingURL=frame.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/frame.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/frame.js.map deleted file mode 100644 index 96ab043f8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/frame.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"frame.js","sourceRoot":"","sources":["../../src/frame.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,SASX;AATD,WAAY,SAAS;IACnB,uFAAuF;IACvF,yCAAU,CAAA;IACV,2GAA2G;IAC3G,yDAAkB,CAAA;IAClB,0FAA0F;IAC1F,yCAAU,CAAA;IACV,+BAA+B;IAC/B,6CAAY,CAAA;AACd,CAAC,EATW,SAAS,KAAT,SAAS,QASpB;AAED,MAAM,CAAN,IAAY,IASX;AATD,WAAY,IAAI;IACd,uIAAuI;IACvI,6BAAS,CAAA;IACT,4IAA4I;IAC5I,6BAAS,CAAA;IACT,2FAA2F;IAC3F,6BAAS,CAAA;IACT,oFAAoF;IACpF,6BAAS,CAAA;AACX,CAAC,EATW,IAAI,KAAJ,IAAI,QASf;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAW,CAAA;AAEpF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAA;AAE9B,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,qEAAuB,CAAA;IACvB,6DAAmB,CAAA;IACnB,6DAAmB,CAAA;AACrB,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAA;AA4B/B,MAAM,UAAU,eAAe,CAAE,MAAmB;IAClD,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACxF,OAAO,YAAY,MAAM,CAAC,QAAQ,SAAS,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,KAAK,WAAW,MAAM,CAAC,MAAM,EAAE,CAAA;AAC3G,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/index.d.ts deleted file mode 100644 index 53e2e5cb6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { YamuxMuxerInit } from './muxer.js'; -import type { StreamMuxerFactory } from '@libp2p/interface/stream-muxer'; -export { GoAwayCode } from './frame.js'; -export declare function yamux(init?: YamuxMuxerInit): () => StreamMuxerFactory; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/index.d.ts.map deleted file mode 100644 index e74ad16c9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,wBAAgB,KAAK,CAAE,IAAI,GAAE,cAAmB,GAAG,MAAM,kBAAkB,CAE1E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/index.js deleted file mode 100644 index 9bb750727..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import { Yamux } from './muxer.js'; -export { GoAwayCode } from './frame.js'; -export function yamux(init = {}) { - return () => new Yamux(init); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/index.js.map deleted file mode 100644 index a572a9651..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,MAAM,UAAU,KAAK,CAAE,OAAuB,EAAE;IAC9C,OAAO,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/muxer.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/muxer.d.ts deleted file mode 100644 index 15b2d6221..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/muxer.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { type Pushable } from 'it-pushable'; -import { type Config } from './config.js'; -import { GoAwayCode } from './frame.js'; -import { YamuxStream } from './stream.js'; -import type { AbortOptions } from '@libp2p/interface'; -import type { StreamMuxer, StreamMuxerFactory, StreamMuxerInit } from '@libp2p/interface/stream-muxer'; -import type { Sink, Source } from 'it-stream-types'; -import type { Uint8ArrayList } from 'uint8arraylist'; -export interface YamuxMuxerInit extends StreamMuxerInit, Partial { -} -export declare class Yamux implements StreamMuxerFactory { - protocol: string; - private readonly _init; - constructor(init?: YamuxMuxerInit); - createStreamMuxer(init?: YamuxMuxerInit): YamuxMuxer; -} -export interface CloseOptions extends AbortOptions { - reason?: GoAwayCode; -} -export declare class YamuxMuxer implements StreamMuxer { - protocol: string; - source: Pushable; - sink: Sink, Promise>; - private readonly config; - private readonly log?; - /** Used to close the muxer from either the sink or source */ - private readonly closeController; - /** The next stream id to be used when initiating a new stream */ - private nextStreamID; - /** Primary stream mapping, streamID => stream */ - private readonly _streams; - /** The next ping id to be used when pinging */ - private nextPingID; - /** Tracking info for the currently active ping */ - private activePing?; - /** Round trip time */ - private rtt; - /** True if client, false if server */ - private readonly client; - private localGoAway?; - private remoteGoAway?; - /** Number of tracked inbound streams */ - private numInboundStreams; - /** Number of tracked outbound streams */ - private numOutboundStreams; - private readonly onIncomingStream?; - private readonly onStreamEnd?; - constructor(init: YamuxMuxerInit); - get streams(): YamuxStream[]; - newStream(name?: string | undefined): YamuxStream; - /** - * Initiate a ping and wait for a response - * - * Note: only a single ping will be initiated at a time. - * If a ping is already in progress, a new ping will not be initiated. - * - * @returns the round-trip-time in milliseconds - */ - ping(): Promise; - /** - * Get the ping round trip time - * - * Note: Will return 0 if no successful ping has yet been completed - * - * @returns the round-trip-time in milliseconds - */ - getRTT(): number; - /** - * Close the muxer - */ - close(options?: CloseOptions): Promise; - abort(err: Error, reason?: GoAwayCode): void; - isClosed(): boolean; - /** - * Called when either the local or remote shuts down the muxer - */ - private _closeMuxer; - /** Create a new stream */ - private _newStream; - /** - * closeStream is used to close a stream once both sides have - * issued a close. - */ - private closeStream; - private keepAliveLoop; - private handleFrame; - private handlePing; - private handlePingResponse; - private handleGoAway; - private handleStreamMessage; - private incomingStream; - private sendFrame; - private sendPing; - private sendGoAway; -} -//# sourceMappingURL=muxer.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/muxer.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/muxer.d.ts.map deleted file mode 100644 index 7170c54fe..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/muxer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"muxer.d.ts","sourceRoot":"","sources":["../../src/muxer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,KAAK,MAAM,EAA+B,MAAM,aAAa,CAAA;AAItE,OAAO,EAAqC,UAAU,EAAE,MAAM,YAAY,CAAA;AAC1E,OAAO,EAAe,WAAW,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AACtG,OAA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EjC,wCAAwC;IACxC,OAAO,CAAC,iBAAiB,CAAQ;IACjC,yCAAyC;IACzC,OAAO,CAAC,kBAAkB,CAAQ;IAElC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAA0B;IAC5D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAA0B;gBAE1C,IAAI,EAAE,cAAc;IAgGjC,IAAI,OAAO,IAAK,WAAW,EAAE,CAE5B;IAED,SAAS,CAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW;IA6BlD;;;;;;;OAOG;IACG,IAAI,IAAK,OAAO,CAAC,MAAM,CAAC;IA+C9B;;;;;;OAMG;IACH,MAAM,IAAK,MAAM;IAIjB;;OAEG;IACG,KAAK,CAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAkCvD,KAAK,CAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI;IAsB7C,QAAQ,IAAK,OAAO;IAIpB;;OAEG;IACH,OAAO,CAAC,WAAW;IAQnB,0BAA0B;IAC1B,OAAO,CAAC,UAAU;IAuBlB;;;OAGG;IACH,OAAO,CAAC,WAAW;YASL,aAAa;YAqBb,WAAW;IA8BzB,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,YAAY;YAaN,mBAAmB;IAqCjC,OAAO,CAAC,cAAc;IAyCtB,OAAO,CAAC,SAAS;IAajB,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,UAAU;CAUnB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/muxer.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/muxer.js deleted file mode 100644 index ed71ec8f6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/muxer.js +++ /dev/null @@ -1,516 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { setMaxListeners } from '@libp2p/interface/events'; -import { logger } from '@libp2p/logger'; -import { getIterator } from 'get-iterator'; -import { pushable } from 'it-pushable'; -import { defaultConfig, verifyConfig } from './config.js'; -import { ERR_BOTH_CLIENTS, ERR_INVALID_FRAME, ERR_MAX_OUTBOUND_STREAMS_EXCEEDED, ERR_MUXER_LOCAL_CLOSED, ERR_MUXER_REMOTE_CLOSED, ERR_NOT_MATCHING_PING, ERR_STREAM_ALREADY_EXISTS, ERR_UNREQUESTED_PING, PROTOCOL_ERRORS } from './constants.js'; -import { Decoder } from './decode.js'; -import { encodeHeader } from './encode.js'; -import { Flag, FrameType, GoAwayCode } from './frame.js'; -import { StreamState, YamuxStream } from './stream.js'; -const YAMUX_PROTOCOL_ID = '/yamux/1.0.0'; -const CLOSE_TIMEOUT = 500; -export class Yamux { - protocol = YAMUX_PROTOCOL_ID; - _init; - constructor(init = {}) { - this._init = init; - } - createStreamMuxer(init) { - return new YamuxMuxer({ - ...this._init, - ...init - }); - } -} -export class YamuxMuxer { - protocol = YAMUX_PROTOCOL_ID; - source; - sink; - config; - log; - /** Used to close the muxer from either the sink or source */ - closeController; - /** The next stream id to be used when initiating a new stream */ - nextStreamID; - /** Primary stream mapping, streamID => stream */ - _streams; - /** The next ping id to be used when pinging */ - nextPingID; - /** Tracking info for the currently active ping */ - activePing; - /** Round trip time */ - rtt; - /** True if client, false if server */ - client; - localGoAway; - remoteGoAway; - /** Number of tracked inbound streams */ - numInboundStreams; - /** Number of tracked outbound streams */ - numOutboundStreams; - onIncomingStream; - onStreamEnd; - constructor(init) { - this.client = init.direction === 'outbound'; - this.config = { ...defaultConfig, ...init }; - this.log = this.config.log; - verifyConfig(this.config); - this.closeController = new AbortController(); - setMaxListeners(Infinity, this.closeController.signal); - this.onIncomingStream = init.onIncomingStream; - this.onStreamEnd = init.onStreamEnd; - this._streams = new Map(); - this.source = pushable({ - onEnd: () => { - this.log?.trace('muxer source ended'); - this._streams.forEach(stream => { - stream.destroy(); - }); - } - }); - this.sink = async (source) => { - const shutDownListener = () => { - const iterator = getIterator(source); - if (iterator.return != null) { - const res = iterator.return(); - if (isPromise(res)) { - res.catch(err => { - this.log?.('could not cause sink source to return', err); - }); - } - } - }; - let reason, error; - try { - const decoder = new Decoder(source); - try { - this.closeController.signal.addEventListener('abort', shutDownListener); - for await (const frame of decoder.emitFrames()) { - await this.handleFrame(frame.header, frame.readData); - } - } - finally { - this.closeController.signal.removeEventListener('abort', shutDownListener); - } - reason = GoAwayCode.NormalTermination; - } - catch (err) { - // either a protocol or internal error - const errCode = err.code; - if (PROTOCOL_ERRORS.has(errCode)) { - this.log?.error('protocol error in sink', err); - reason = GoAwayCode.ProtocolError; - } - else { - this.log?.error('internal error in sink', err); - reason = GoAwayCode.InternalError; - } - error = err; - } - this.log?.trace('muxer sink ended'); - if (error != null) { - this.abort(error, reason); - } - else { - await this.close({ reason }); - } - }; - this.numInboundStreams = 0; - this.numOutboundStreams = 0; - // client uses odd streamIDs, server uses even streamIDs - this.nextStreamID = this.client ? 1 : 2; - this.nextPingID = 0; - this.rtt = -1; - this.log?.trace('muxer created'); - if (this.config.enableKeepAlive) { - this.keepAliveLoop().catch(e => this.log?.error('keepalive error: %s', e)); - } - // send an initial ping to establish RTT - this.ping().catch(e => this.log?.error('ping error: %s', e)); - } - get streams() { - return Array.from(this._streams.values()); - } - newStream(name) { - if (this.remoteGoAway !== undefined) { - throw new CodeError('muxer closed remotely', ERR_MUXER_REMOTE_CLOSED); - } - if (this.localGoAway !== undefined) { - throw new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED); - } - const id = this.nextStreamID; - this.nextStreamID += 2; - // check against our configured maximum number of outbound streams - if (this.numOutboundStreams >= this.config.maxOutboundStreams) { - throw new CodeError('max outbound streams exceeded', ERR_MAX_OUTBOUND_STREAMS_EXCEEDED); - } - this.log?.trace('new outgoing stream id=%s', id); - const stream = this._newStream(id, name, StreamState.Init, 'outbound'); - this._streams.set(id, stream); - this.numOutboundStreams++; - // send a window update to open the stream on the receiver end - stream.sendWindowUpdate(); - return stream; - } - /** - * Initiate a ping and wait for a response - * - * Note: only a single ping will be initiated at a time. - * If a ping is already in progress, a new ping will not be initiated. - * - * @returns the round-trip-time in milliseconds - */ - async ping() { - if (this.remoteGoAway !== undefined) { - throw new CodeError('muxer closed remotely', ERR_MUXER_REMOTE_CLOSED); - } - if (this.localGoAway !== undefined) { - throw new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED); - } - // An active ping does not yet exist, handle the process here - if (this.activePing === undefined) { - // create active ping - let _resolve = () => { }; - this.activePing = { - id: this.nextPingID++, - // this promise awaits resolution or the close controller aborting - promise: new Promise((resolve, reject) => { - const closed = () => { - reject(new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED)); - }; - this.closeController.signal.addEventListener('abort', closed, { once: true }); - _resolve = () => { - this.closeController.signal.removeEventListener('abort', closed); - resolve(); - }; - }), - resolve: _resolve - }; - // send ping - const start = Date.now(); - this.sendPing(this.activePing.id); - // await pong - try { - await this.activePing.promise; - } - finally { - // clean-up active ping - delete this.activePing; - } - // update rtt - const end = Date.now(); - this.rtt = end - start; - } - else { - // an active ping is already in progress, piggyback off that - await this.activePing.promise; - } - return this.rtt; - } - /** - * Get the ping round trip time - * - * Note: Will return 0 if no successful ping has yet been completed - * - * @returns the round-trip-time in milliseconds - */ - getRTT() { - return this.rtt; - } - /** - * Close the muxer - */ - async close(options = {}) { - if (this.closeController.signal.aborted) { - // already closed - return; - } - const reason = options?.reason ?? GoAwayCode.NormalTermination; - this.log?.trace('muxer close reason=%s', reason); - if (options.signal == null) { - const signal = AbortSignal.timeout(CLOSE_TIMEOUT); - setMaxListeners(Infinity, signal); - options = { - ...options, - signal - }; - } - try { - await Promise.all([...this._streams.values()].map(async (s) => s.close(options))); - // send reason to the other side, allow the other side to close gracefully - this.sendGoAway(reason); - this._closeMuxer(); - } - catch (err) { - this.abort(err); - } - } - abort(err, reason) { - if (this.closeController.signal.aborted) { - // already closed - return; - } - reason = reason ?? GoAwayCode.InternalError; - // If reason was provided, use that, otherwise use the presence of `err` to determine the reason - this.log?.error('muxer abort reason=%s error=%s', reason, err); - // Abort all underlying streams - for (const stream of this._streams.values()) { - stream.abort(err); - } - // send reason to the other side, allow the other side to close gracefully - this.sendGoAway(reason); - this._closeMuxer(); - } - isClosed() { - return this.closeController.signal.aborted; - } - /** - * Called when either the local or remote shuts down the muxer - */ - _closeMuxer() { - // stop the sink and any other processes - this.closeController.abort(); - // stop the source - this.source.end(); - } - /** Create a new stream */ - _newStream(id, name, state, direction) { - if (this._streams.get(id) != null) { - throw new CodeError('Stream already exists', ERR_STREAM_ALREADY_EXISTS, { id }); - } - const stream = new YamuxStream({ - id: id.toString(), - name, - state, - direction, - sendFrame: this.sendFrame.bind(this), - onEnd: () => { - this.closeStream(id); - this.onStreamEnd?.(stream); - }, - log: logger(`libp2p:yamux:${direction}:${id}`), - config: this.config, - getRTT: this.getRTT.bind(this) - }); - return stream; - } - /** - * closeStream is used to close a stream once both sides have - * issued a close. - */ - closeStream(id) { - if (this.client === (id % 2 === 0)) { - this.numInboundStreams--; - } - else { - this.numOutboundStreams--; - } - this._streams.delete(id); - } - async keepAliveLoop() { - const abortPromise = new Promise((_resolve, reject) => { this.closeController.signal.addEventListener('abort', reject, { once: true }); }); - this.log?.trace('muxer keepalive enabled interval=%s', this.config.keepAliveInterval); - while (true) { - let timeoutId; - try { - await Promise.race([ - abortPromise, - new Promise((resolve) => { - timeoutId = setTimeout(resolve, this.config.keepAliveInterval); - }) - ]); - this.ping().catch(e => this.log?.error('ping error: %s', e)); - } - catch (e) { - // closed - clearInterval(timeoutId); - return; - } - } - } - async handleFrame(header, readData) { - const { streamID, type, length } = header; - this.log?.trace('received frame %o', header); - if (streamID === 0) { - switch (type) { - case FrameType.Ping: - { - this.handlePing(header); - return; - } - case FrameType.GoAway: - { - this.handleGoAway(length); - return; - } - default: - // Invalid state - throw new CodeError('Invalid frame type', ERR_INVALID_FRAME, { header }); - } - } - else { - switch (header.type) { - case FrameType.Data: - case FrameType.WindowUpdate: - { - await this.handleStreamMessage(header, readData); - return; - } - default: - // Invalid state - throw new CodeError('Invalid frame type', ERR_INVALID_FRAME, { header }); - } - } - } - handlePing(header) { - // If the ping is initiated by the sender, send a response - if (header.flag === Flag.SYN) { - this.log?.trace('received ping request pingId=%s', header.length); - this.sendPing(header.length, Flag.ACK); - } - else if (header.flag === Flag.ACK) { - this.log?.trace('received ping response pingId=%s', header.length); - this.handlePingResponse(header.length); - } - else { - // Invalid state - throw new CodeError('Invalid frame flag', ERR_INVALID_FRAME, { header }); - } - } - handlePingResponse(pingId) { - if (this.activePing === undefined) { - // this ping was not requested - throw new CodeError('ping not requested', ERR_UNREQUESTED_PING); - } - if (this.activePing.id !== pingId) { - // this ping doesn't match our active ping request - throw new CodeError('ping doesn\'t match our id', ERR_NOT_MATCHING_PING); - } - // valid ping response - this.activePing.resolve(); - } - handleGoAway(reason) { - this.log?.trace('received GoAway reason=%s', GoAwayCode[reason] ?? 'unknown'); - this.remoteGoAway = reason; - // If the other side is friendly, they would have already closed all streams before sending a GoAway - // In case they weren't, reset all streams - for (const stream of this._streams.values()) { - stream.reset(); - } - this._closeMuxer(); - } - async handleStreamMessage(header, readData) { - const { streamID, flag, type } = header; - if ((flag & Flag.SYN) === Flag.SYN) { - this.incomingStream(streamID); - } - const stream = this._streams.get(streamID); - if (stream === undefined) { - if (type === FrameType.Data) { - this.log?.('discarding data for stream id=%s', streamID); - if (readData === undefined) { - throw new Error('unreachable'); - } - await readData(); - } - else { - this.log?.('frame for missing stream id=%s', streamID); - } - return; - } - switch (type) { - case FrameType.WindowUpdate: { - stream.handleWindowUpdate(header); - return; - } - case FrameType.Data: { - if (readData === undefined) { - throw new Error('unreachable'); - } - await stream.handleData(header, readData); - return; - } - default: - throw new Error('unreachable'); - } - } - incomingStream(id) { - if (this.client !== (id % 2 === 0)) { - throw new CodeError('both endpoints are clients', ERR_BOTH_CLIENTS); - } - if (this._streams.has(id)) { - return; - } - this.log?.trace('new incoming stream id=%s', id); - if (this.localGoAway !== undefined) { - // reject (reset) immediately if we are doing a go away - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: id, - length: 0 - }); - return; - } - // check against our configured maximum number of inbound streams - if (this.numInboundStreams >= this.config.maxInboundStreams) { - this.log?.('maxIncomingStreams exceeded, forcing stream reset'); - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: id, - length: 0 - }); - return; - } - // allocate a new stream - const stream = this._newStream(id, undefined, StreamState.SYNReceived, 'inbound'); - this.numInboundStreams++; - // the stream should now be tracked - this._streams.set(id, stream); - this.onIncomingStream?.(stream); - } - sendFrame(header, data) { - this.log?.trace('sending frame %o', header); - if (header.type === FrameType.Data) { - if (data === undefined) { - throw new CodeError('invalid frame', ERR_INVALID_FRAME); - } - this.source.push(encodeHeader(header)); - this.source.push(data); - } - else { - this.source.push(encodeHeader(header)); - } - } - sendPing(pingId, flag = Flag.SYN) { - if (flag === Flag.SYN) { - this.log?.trace('sending ping request pingId=%s', pingId); - } - else { - this.log?.trace('sending ping response pingId=%s', pingId); - } - this.sendFrame({ - type: FrameType.Ping, - flag, - streamID: 0, - length: pingId - }); - } - sendGoAway(reason = GoAwayCode.NormalTermination) { - this.log?.('sending GoAway reason=%s', GoAwayCode[reason]); - this.localGoAway = reason; - this.sendFrame({ - type: FrameType.GoAway, - flag: 0, - streamID: 0, - length: reason - }); - } -} -function isPromise(thing) { - return thing != null && typeof thing.then === 'function'; -} -//# sourceMappingURL=muxer.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/muxer.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/muxer.js.map deleted file mode 100644 index eda0e0394..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all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CAAC,0BAA0B,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAA;QAC1D,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA;QACzB,IAAI,CAAC,SAAS,CAAC;YACb,IAAI,EAAE,SAAS,CAAC,MAAM;YACtB,IAAI,EAAE,CAAC;YACP,QAAQ,EAAE,CAAC;YACX,MAAM,EAAE,MAAM;SACf,CAAC,CAAA;IACJ,CAAC;CACF;AAED,SAAS,SAAS,CAAgB,KAAU;IAC1C,OAAO,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAA;AAC1D,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/stream.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/stream.d.ts deleted file mode 100644 index bd04f1215..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/stream.d.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { AbstractStream, type AbstractStreamInit } from '@libp2p/utils/abstract-stream'; -import { type FrameHeader } from './frame.js'; -import type { Config } from './config.js'; -import type { AbortOptions } from '@libp2p/interface'; -import type { Uint8ArrayList } from 'uint8arraylist'; -export declare enum StreamState { - Init = 0, - SYNSent = 1, - SYNReceived = 2, - Established = 3, - Finished = 4 -} -export interface YamuxStreamInit extends AbstractStreamInit { - name?: string; - sendFrame: (header: FrameHeader, body?: Uint8ArrayList) => void; - getRTT: () => number; - config: Config; - state: StreamState; -} -/** YamuxStream is used to represent a logical stream within a session */ -export declare class YamuxStream extends AbstractStream { - name?: string; - state: StreamState; - private readonly config; - private readonly _id; - /** The number of available bytes to send */ - private sendWindowCapacity; - /** Callback to notify that the sendWindowCapacity has been updated */ - private sendWindowCapacityUpdate?; - /** The number of bytes available to receive in a full window */ - private recvWindow; - /** The number of available bytes to receive */ - private recvWindowCapacity; - /** - * An 'epoch' is the time it takes to process and read data - * - * Used in conjunction with RTT to determine whether to increase the recvWindow - */ - private epochStart; - private readonly getRTT; - private readonly sendFrame; - constructor(init: YamuxStreamInit); - /** - * Send a message to the remote muxer informing them a new stream is being - * opened. - * - * This is a noop for Yamux because the first window update is sent when - * .newStream is called on the muxer which opens the stream on the remote. - */ - sendNewStream(): Promise; - /** - * Send a data message to the remote muxer - */ - sendData(buf: Uint8ArrayList, options?: AbortOptions): Promise; - /** - * Send a reset message to the remote muxer - */ - sendReset(): Promise; - /** - * Send a message to the remote muxer, informing them no more data messages - * will be sent by this end of the stream - */ - sendCloseWrite(): Promise; - /** - * Send a message to the remote muxer, informing them no more data messages - * will be read by this end of the stream - */ - sendCloseRead(): Promise; - /** - * Wait for the send window to be non-zero - * - * Will throw with ERR_STREAM_ABORT if the stream gets aborted - */ - waitForSendWindowCapacity(options?: AbortOptions): Promise; - /** - * handleWindowUpdate is called when the stream receives a window update frame - */ - handleWindowUpdate(header: FrameHeader): void; - /** - * handleData is called when the stream receives a data frame - */ - handleData(header: FrameHeader, readData: () => Promise): Promise; - /** - * processFlags is used to update the state of the stream based on set flags, if any. - */ - private processFlags; - /** - * getSendFlags determines any flags that are appropriate - * based on the current stream state. - * - * The state is updated as a side-effect. - */ - private getSendFlags; - /** - * potentially sends a window update enabling further writes to take place. - */ - sendWindowUpdate(): void; -} -//# sourceMappingURL=stream.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/stream.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/stream.d.ts.map deleted file mode 100644 index 62a15c3fd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/stream.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/stream.ts"],"names":[],"mappings":"AACA,OAAO,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0BlC;;;;;;OAMG;IACG,aAAa,IAAK,OAAO,CAAC,IAAI,CAAC;IAIrC;;OAEG;IACG,QAAQ,CAAE,GAAG,EAAE,cAAc,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgC/E;;OAEG;IACG,SAAS,IAAK,OAAO,CAAC,IAAI,CAAC;IASjC;;;OAGG;IACG,cAAc,IAAK,OAAO,CAAC,IAAI,CAAC;IAUtC;;;OAGG;IACG,aAAa,IAAK,OAAO,CAAC,IAAI,CAAC;IAIrC;;;;OAIG;IACG,yBAAyB,CAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IA8B3E;;OAEG;IACH,kBAAkB,CAAE,MAAM,EAAE,WAAW,GAAG,IAAI;IAa9C;;OAEG;IACG,UAAU,CAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAe9F;;OAEG;IACH,OAAO,CAAC,YAAY;IAcpB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAapB;;OAEG;IACH,gBAAgB,IAAK,IAAI;CAkC1B"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/stream.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/stream.js deleted file mode 100644 index 4b8a1f42d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/stream.js +++ /dev/null @@ -1,254 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { AbstractStream } from '@libp2p/utils/abstract-stream'; -import each from 'it-foreach'; -import { ERR_RECV_WINDOW_EXCEEDED, ERR_STREAM_ABORT, INITIAL_STREAM_WINDOW } from './constants.js'; -import { Flag, FrameType, HEADER_LENGTH } from './frame.js'; -export var StreamState; -(function (StreamState) { - StreamState[StreamState["Init"] = 0] = "Init"; - StreamState[StreamState["SYNSent"] = 1] = "SYNSent"; - StreamState[StreamState["SYNReceived"] = 2] = "SYNReceived"; - StreamState[StreamState["Established"] = 3] = "Established"; - StreamState[StreamState["Finished"] = 4] = "Finished"; -})(StreamState || (StreamState = {})); -/** YamuxStream is used to represent a logical stream within a session */ -export class YamuxStream extends AbstractStream { - name; - state; - config; - _id; - /** The number of available bytes to send */ - sendWindowCapacity; - /** Callback to notify that the sendWindowCapacity has been updated */ - sendWindowCapacityUpdate; - /** The number of bytes available to receive in a full window */ - recvWindow; - /** The number of available bytes to receive */ - recvWindowCapacity; - /** - * An 'epoch' is the time it takes to process and read data - * - * Used in conjunction with RTT to determine whether to increase the recvWindow - */ - epochStart; - getRTT; - sendFrame; - constructor(init) { - super({ - ...init, - onEnd: (err) => { - this.state = StreamState.Finished; - init.onEnd?.(err); - } - }); - this.config = init.config; - this._id = parseInt(init.id, 10); - this.name = init.name; - this.state = init.state; - this.sendWindowCapacity = INITIAL_STREAM_WINDOW; - this.recvWindow = this.config.initialStreamWindowSize; - this.recvWindowCapacity = this.recvWindow; - this.epochStart = Date.now(); - this.getRTT = init.getRTT; - this.sendFrame = init.sendFrame; - this.source = each(this.source, () => { - this.sendWindowUpdate(); - }); - } - /** - * Send a message to the remote muxer informing them a new stream is being - * opened. - * - * This is a noop for Yamux because the first window update is sent when - * .newStream is called on the muxer which opens the stream on the remote. - */ - async sendNewStream() { - } - /** - * Send a data message to the remote muxer - */ - async sendData(buf, options = {}) { - buf = buf.sublist(); - // send in chunks, waiting for window updates - while (buf.byteLength !== 0) { - // wait for the send window to refill - if (this.sendWindowCapacity === 0) { - await this.waitForSendWindowCapacity(options); - } - // check we didn't close while waiting for send window capacity - if (this.status !== 'open') { - return; - } - // send as much as we can - const toSend = Math.min(this.sendWindowCapacity, this.config.maxMessageSize - HEADER_LENGTH, buf.length); - const flags = this.getSendFlags(); - this.sendFrame({ - type: FrameType.Data, - flag: flags, - streamID: this._id, - length: toSend - }, buf.sublist(0, toSend)); - this.sendWindowCapacity -= toSend; - buf.consume(toSend); - } - } - /** - * Send a reset message to the remote muxer - */ - async sendReset() { - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: this._id, - length: 0 - }); - } - /** - * Send a message to the remote muxer, informing them no more data messages - * will be sent by this end of the stream - */ - async sendCloseWrite() { - const flags = this.getSendFlags() | Flag.FIN; - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: flags, - streamID: this._id, - length: 0 - }); - } - /** - * Send a message to the remote muxer, informing them no more data messages - * will be read by this end of the stream - */ - async sendCloseRead() { - } - /** - * Wait for the send window to be non-zero - * - * Will throw with ERR_STREAM_ABORT if the stream gets aborted - */ - async waitForSendWindowCapacity(options = {}) { - if (this.sendWindowCapacity > 0) { - return; - } - let resolve; - let reject; - const abort = () => { - if (this.status === 'open') { - reject(new CodeError('stream aborted', ERR_STREAM_ABORT)); - } - else { - // the stream was closed already, ignore the failure to send - resolve(); - } - }; - options.signal?.addEventListener('abort', abort); - try { - await new Promise((_resolve, _reject) => { - this.sendWindowCapacityUpdate = () => { - _resolve(); - }; - reject = _reject; - resolve = _resolve; - }); - } - finally { - options.signal?.removeEventListener('abort', abort); - } - } - /** - * handleWindowUpdate is called when the stream receives a window update frame - */ - handleWindowUpdate(header) { - this.log?.trace('stream received window update id=%s', this._id); - this.processFlags(header.flag); - // increase send window - const available = this.sendWindowCapacity; - this.sendWindowCapacity += header.length; - // if the update increments a 0 availability, notify the stream that sending can resume - if (available === 0 && header.length > 0) { - this.sendWindowCapacityUpdate?.(); - } - } - /** - * handleData is called when the stream receives a data frame - */ - async handleData(header, readData) { - this.log?.trace('stream received data id=%s', this._id); - this.processFlags(header.flag); - // check that our recv window is not exceeded - if (this.recvWindowCapacity < header.length) { - throw new CodeError('receive window exceeded', ERR_RECV_WINDOW_EXCEEDED, { available: this.recvWindowCapacity, recv: header.length }); - } - const data = await readData(); - this.recvWindowCapacity -= header.length; - this.sourcePush(data); - } - /** - * processFlags is used to update the state of the stream based on set flags, if any. - */ - processFlags(flags) { - if ((flags & Flag.ACK) === Flag.ACK) { - if (this.state === StreamState.SYNSent) { - this.state = StreamState.Established; - } - } - if ((flags & Flag.FIN) === Flag.FIN) { - this.remoteCloseWrite(); - } - if ((flags & Flag.RST) === Flag.RST) { - this.reset(); - } - } - /** - * getSendFlags determines any flags that are appropriate - * based on the current stream state. - * - * The state is updated as a side-effect. - */ - getSendFlags() { - switch (this.state) { - case StreamState.Init: - this.state = StreamState.SYNSent; - return Flag.SYN; - case StreamState.SYNReceived: - this.state = StreamState.Established; - return Flag.ACK; - default: - return 0; - } - } - /** - * potentially sends a window update enabling further writes to take place. - */ - sendWindowUpdate() { - // determine the flags if any - const flags = this.getSendFlags(); - // If the stream has already been established - // and we've processed data within the time it takes for 4 round trips - // then we (up to) double the recvWindow - const now = Date.now(); - const rtt = this.getRTT(); - if (flags === 0 && rtt > -1 && now - this.epochStart < rtt * 4) { - // we've already validated that maxStreamWindowSize can't be more than MAX_UINT32 - this.recvWindow = Math.min(this.recvWindow * 2, this.config.maxStreamWindowSize); - } - if (this.recvWindowCapacity >= this.recvWindow && flags === 0) { - // a window update isn't needed - return; - } - // update the receive window - const delta = this.recvWindow - this.recvWindowCapacity; - this.recvWindowCapacity = this.recvWindow; - // update the epoch start - this.epochStart = now; - // send window update - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: flags, - streamID: this._id, - length: delta - }); - } -} -//# sourceMappingURL=stream.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/stream.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/stream.js.map deleted file mode 100644 index 855e6e8fa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/src/stream.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stream.js","sourceRoot":"","sources":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AO,CAAC,CAAA;SACX;IACH,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,6BAA6B;QAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAA;QAEjC,6CAA6C;QAC7C,sEAAsE;QACtE,wCAAwC;QACxC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QACtB,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAA;QACzB,IAAI,KAAK,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,UAAU,GAAG,GAAG,GAAG,CAAC,EAAE;YAC9D,iFAAiF;YACjF,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAA;SACjF;QAED,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,UAAU,IAAI,KAAK,KAAK,CAAC,EAAE;YAC7D,+BAA+B;YAC/B,OAAM;SACP;QAED,4BAA4B;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAA;QACvD,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,UAAU,CAAA;QAEzC,yBAAyB;QACzB,IAAI,CAAC,UAAU,GAAG,GAAG,CAAA;QAErB,qBAAqB;QACrB,IAAI,CAAC,SAAS,CAAC;YACb,IAAI,EAAE,SAAS,CAAC,YAAY;YAC5B,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI,CAAC,GAAG;YAClB,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/codec.bench.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/codec.bench.d.ts deleted file mode 100644 index b4e5636f1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/codec.bench.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=codec.bench.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/codec.bench.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/codec.bench.d.ts.map deleted file mode 100644 index 73758eb99..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/codec.bench.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.bench.d.ts","sourceRoot":"","sources":["../../../test/bench/codec.bench.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/codec.bench.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/codec.bench.js deleted file mode 100644 index 84f5ae83d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/codec.bench.js +++ /dev/null @@ -1,46 +0,0 @@ -import { itBench } from '@dapplion/benchmark'; -import { decodeHeader } from '../../src/decode.js'; -import { encodeHeader } from '../../src/encode.js'; -import { Flag, FrameType } from '../../src/frame.js'; -import { decodeHeaderNaive, encodeHeaderNaive } from '../codec.util.js'; -describe('codec benchmark', () => { - for (const { encode, name } of [ - { encode: encodeHeader, name: 'encodeFrameHeader' }, - { encode: encodeHeaderNaive, name: 'encodeFrameHeaderNaive' } - ]) { - itBench({ - id: `frame header - ${name}`, - timeoutBench: 100000000, - beforeEach: () => { - return { - type: FrameType.WindowUpdate, - flag: Flag.ACK, - streamID: 0xffffffff, - length: 0xffffffff - }; - }, - fn: (header) => { - encode(header); - } - }); - } - for (const { decode, name } of [ - { decode: decodeHeader, name: 'decodeHeader' }, - { decode: decodeHeaderNaive, name: 'decodeHeaderNaive' } - ]) { - itBench({ - id: `frame header ${name}`, - beforeEach: () => { - const header = new Uint8Array(12); - for (let i = 1; i < 12; i++) { - header[i] = 255; - } - return header; - }, - fn: (header) => { - decode(header); - } - }); - } -}); -//# sourceMappingURL=codec.bench.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/codec.bench.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/codec.bench.js.map deleted file mode 100644 index 7721658d7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/codec.bench.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.bench.js","sourceRoot":"","sources":["../../../test/bench/codec.bench.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAoB,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEvE,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI;QAC7B,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,mBAAmB,EAAE;QACnD,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,wBAAwB,EAAE;KAC9D,EAAE;QACD,OAAO,CAAyB;YAC9B,EAAE,EAAE,kBAAkB,IAAI,EAAE;YAC5B,YAAY,EAAE,SAAS;YACvB,UAAU,EAAE,GAAG,EAAE;gBACf,OAAO;oBACL,IAAI,EAAE,SAAS,CAAC,YAAY;oBAC5B,IAAI,EAAE,IAAI,CAAC,GAAG;oBACd,QAAQ,EAAE,UAAU;oBACpB,MAAM,EAAE,UAAU;iBACnB,CAAA;YACH,CAAC;YACD,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE;gBACb,MAAM,CAAC,MAAM,CAAC,CAAA;YAChB,CAAC;SACF,CAAC,CAAA;KACH;IAED,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI;QAC7B,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE;QAC9C,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,mBAAmB,EAAE;KACzD,EAAE;QACD,OAAO,CAAwB;YAC7B,EAAE,EAAE,gBAAgB,IAAI,EAAE;YAC1B,UAAU,EAAE,GAAG,EAAE;gBACf,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAA;gBACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;oBAC3B,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;iBAChB;gBACD,OAAO,MAAM,CAAA;YACf,CAAC;YACD,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE;gBACb,MAAM,CAAC,MAAM,CAAC,CAAA;YAChB,CAAC;SACF,CAAC,CAAA;KACH;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/comparison.bench.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/comparison.bench.d.ts deleted file mode 100644 index cb9667d54..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/comparison.bench.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=comparison.bench.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/comparison.bench.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/comparison.bench.d.ts.map deleted file mode 100644 index c29eccddc..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/comparison.bench.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"comparison.bench.d.ts","sourceRoot":"","sources":["../../../test/bench/comparison.bench.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/comparison.bench.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/comparison.bench.js deleted file mode 100644 index 19512e4b7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/comparison.bench.js +++ /dev/null @@ -1,36 +0,0 @@ -import { itBench } from '@dapplion/benchmark'; -import drain from 'it-drain'; -import { pipe } from 'it-pipe'; -import { testClientServer as testMplexClientServer } from '../mplex.util.js'; -import { testClientServer as testYamuxClientServer } from '../util.js'; -describe('comparison benchmark', () => { - for (const { impl, name } of [ - { impl: testYamuxClientServer, name: 'yamux' }, - { impl: testMplexClientServer, name: 'mplex' } - ]) { - for (const { numMessages, msgSize } of [ - { numMessages: 1, msgSize: 2 ** 6 }, - { numMessages: 1, msgSize: 2 ** 10 }, - { numMessages: 1, msgSize: 2 ** 16 }, - { numMessages: 1, msgSize: 2 ** 20 }, - { numMessages: 1000, msgSize: 2 ** 6 }, - { numMessages: 1000, msgSize: 2 ** 10 }, - { numMessages: 1000, msgSize: 2 ** 16 }, - { numMessages: 1000, msgSize: 2 ** 20 } - ]) { - itBench({ - id: `${name} send and receive ${numMessages} ${msgSize / 1024}KB chunks`, - beforeEach: () => impl({ - onIncomingStream: (stream) => { - void pipe(stream, drain).then(async () => { await stream.close(); }); - } - }), - fn: async ({ client, server }) => { - const stream = await client.newStream(); - await pipe(Array.from({ length: numMessages }, () => new Uint8Array(msgSize)), stream, drain); - } - }); - } - } -}); -//# sourceMappingURL=comparison.bench.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/comparison.bench.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/comparison.bench.js.map deleted file mode 100644 index 1c0ac643f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/bench/comparison.bench.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"comparison.bench.js","sourceRoot":"","sources":["../../../test/bench/comparison.bench.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,gBAAgB,IAAI,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,EAAE,gBAAgB,IAAI,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEtE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;QAC3B,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,OAAO,EAAE;QAC9C,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,OAAO,EAAE;KAC/C,EAAE;QACD,KAAK,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI;YACrC,EAAE,WAAW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,KAAK,CAAC,CAAA;gBAC/F,CAAC;aACF,CAAC,CAAA;SACH;KACF;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.spec.d.ts deleted file mode 100644 index 633c75388..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=codec.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.spec.d.ts.map deleted file mode 100644 index 964547815..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.spec.d.ts","sourceRoot":"","sources":["../../test/codec.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.spec.js deleted file mode 100644 index 4d61ce230..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.spec.js +++ /dev/null @@ -1,28 +0,0 @@ -import { expect } from 'aegir/chai'; -import { decodeHeader } from '../src/decode.js'; -import { encodeHeader } from '../src/encode.js'; -import { Flag, FrameType, GoAwayCode, stringifyHeader } from '../src/frame.js'; -import { decodeHeaderNaive, encodeHeaderNaive } from './codec.util.js'; -const frames = [ - { header: { type: FrameType.Ping, flag: Flag.SYN, streamID: 0, length: 1 } }, - { header: { type: FrameType.WindowUpdate, flag: Flag.SYN, streamID: 1, length: 1 } }, - { header: { type: FrameType.GoAway, flag: 0, streamID: 0, length: GoAwayCode.NormalTermination } }, - { header: { type: FrameType.Ping, flag: Flag.ACK, streamID: 0, length: 100 } }, - { header: { type: FrameType.WindowUpdate, flag: 0, streamID: 99, length: 1000 } }, - { header: { type: FrameType.WindowUpdate, flag: 0, streamID: 0xffffffff, length: 0xffffffff } }, - { header: { type: FrameType.GoAway, flag: 0, streamID: 0, length: GoAwayCode.ProtocolError } } -]; -describe('codec', () => { - for (const { header } of frames) { - it(`should round trip encode/decode header ${stringifyHeader(header)}`, () => { - expect(decodeHeader(encodeHeader(header))).to.deep.equal(header); - }); - } - for (const { header } of frames) { - it(`should match naive implementations of encode/decode for header ${stringifyHeader(header)}`, () => { - expect(encodeHeader(header)).to.deep.equal(encodeHeaderNaive(header)); - expect(decodeHeader(encodeHeader(header))).to.deep.equal(decodeHeaderNaive(encodeHeaderNaive(header))); - }); - } -}); -//# sourceMappingURL=codec.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.spec.js.map deleted file mode 100644 index 178430d09..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.spec.js","sourceRoot":"","sources":["../../test/codec.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAoB,SAAS,EAAE,UAAU,EAAE,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AQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,MAAM,EAAE;QAC/B,EAAE,CAAC,0CAA0C,eAAe,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE;YAC3E,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAClE,CAAC,CAAC,CAAA;KACH;IAED,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,MAAM,EAAE;QAC/B,EAAE,CAAC,kEAAkE,eAAe,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE;YACnG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAA;YACrE,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACxG,CAAC,CAAC,CAAA;KACH;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.util.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.util.d.ts deleted file mode 100644 index 8b9852f73..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.util.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { type FrameHeader } from '../src/frame.js'; -export declare function decodeHeaderNaive(data: Uint8Array): FrameHeader; -export declare function encodeHeaderNaive(header: FrameHeader): Uint8Array; -//# sourceMappingURL=codec.util.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.util.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.util.d.ts.map deleted file mode 100644 index 16bcea9aa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.util.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.util.d.ts","sourceRoot":"","sources":["../../test/codec.util.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAgC,MAAM,iBAAiB,CAAA;AAIhF,wBAAgB,iBAAiB,CAAE,IAAI,EAAE,UAAU,GAAG,WAAW,CAYhE;AAED,wBAAgB,iBAAiB,CAAE,MAAM,EAAE,WAAW,GAAG,UAAU,CAclE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.util.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.util.js deleted file mode 100644 index 76b3cf281..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.util.js +++ /dev/null @@ -1,28 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { ERR_DECODE_INVALID_VERSION } from '../src/constants.js'; -import { HEADER_LENGTH, YAMUX_VERSION } from '../src/frame.js'; -// Slower encode / decode functions that use dataview -export function decodeHeaderNaive(data) { - const view = new DataView(data.buffer, data.byteOffset, data.byteLength); - if (view.getUint8(0) !== YAMUX_VERSION) { - throw new CodeError('Invalid frame version', ERR_DECODE_INVALID_VERSION); - } - return { - type: view.getUint8(1), - flag: view.getUint16(2, false), - streamID: view.getUint32(4, false), - length: view.getUint32(8, false) - }; -} -export function encodeHeaderNaive(header) { - const frame = new Uint8Array(HEADER_LENGTH); - const frameView = new DataView(frame.buffer, frame.byteOffset, frame.byteLength); - // always assume version 0 - // frameView.setUint8(0, header.version) - frameView.setUint8(1, header.type); - frameView.setUint16(2, header.flag, false); - frameView.setUint32(4, header.streamID, false); - frameView.setUint32(8, header.length, false); - return frame; -} -//# sourceMappingURL=codec.util.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.util.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.util.js.map deleted file mode 100644 index a90c06419..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/codec.util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.util.js","sourceRoot":"","sources":["../../test/codec.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAoB,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEhF,qDAAqD;AAErD,MAAM,UAAU,iBAAiB,CAAE,IAAgB;IACjD,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;IAExE,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,aAAa,EAAE;QACtC,MAAM,IAAI,SAAS,CAAC,uBAAuB,EAAE,0BAA0B,CAAC,CAAA;KACzE;IACD,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QACtB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC;QAC9B,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC;QAClC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC;KACjC,CAAA;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAE,MAAmB;IACpD,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,aAAa,CAAC,CAAA;IAE3C,MAAM,SAAS,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;IAEhF,0BAA0B;IAC1B,wCAAwC;IAExC,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;IAClC,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAC1C,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAC9C,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAE5C,OAAO,KAAK,CAAA;AACd,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/compliance.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/compliance.spec.d.ts deleted file mode 100644 index dac08d9d2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/compliance.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=compliance.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/compliance.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/compliance.spec.d.ts.map deleted file mode 100644 index dc9e71995..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/compliance.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.d.ts","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/compliance.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/compliance.spec.js deleted file mode 100644 index 0b8763a42..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/compliance.spec.js +++ /dev/null @@ -1,12 +0,0 @@ -/* eslint-env mocha */ -import tests from '@libp2p/interface-compliance-tests/stream-muxer'; -import { TestYamux } from './util.js'; -describe('compliance', () => { - tests({ - async setup() { - return new TestYamux({}); - }, - async teardown() { } - }); -}); -//# sourceMappingURL=compliance.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/compliance.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/compliance.spec.js.map deleted file mode 100644 index 9a46d97f8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/compliance.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.js","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,KAAK,MAAM,iDAAiD,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,KAAK,CAAC;QACJ,KAAK,CAAC,KAAK;YACT,OAAO,IAAI,SAAS,CAAC,EAAE,CAAC,CAAA;QAC1B,CAAC;QACD,KAAK,CAAC,QAAQ,KAAK,CAAC;KACrB,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/decode.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/decode.spec.d.ts deleted file mode 100644 index 07a9f5cbd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/decode.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const randomRanges: (length: number) => number[][]; -//# sourceMappingURL=decode.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/decode.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/decode.spec.d.ts.map deleted file mode 100644 index 1dc0b444d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/decode.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode.spec.d.ts","sourceRoot":"","sources":["../../test/decode.spec.ts"],"names":[],"mappings":"AAoDA,eAAO,MAAM,YAAY,WAAY,MAAM,KAAG,MAAM,EAAE,EAUrD,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/decode.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/decode.spec.js deleted file mode 100644 index 0a9f2be6b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/decode.spec.js +++ /dev/null @@ -1,298 +0,0 @@ -/* eslint-disable @typescript-eslint/dot-notation */ -import { expect } from 'aegir/chai'; -import { pushable } from 'it-pushable'; -import { ERR_DECODE_IN_PROGRESS } from '../src/constants.js'; -import { Decoder } from '../src/decode.js'; -import { encodeHeader } from '../src/encode.js'; -import { Flag, FrameType, GoAwayCode } from '../src/frame.js'; -import { timeout } from './util.js'; -const frames = [ - { header: { type: FrameType.Ping, flag: Flag.SYN, streamID: 0, length: 1 } }, - { header: { type: FrameType.WindowUpdate, flag: Flag.SYN, streamID: 1, length: 1 } }, - { header: { type: FrameType.GoAway, flag: 0, streamID: 0, length: GoAwayCode.NormalTermination } }, - { header: { type: FrameType.Ping, flag: Flag.ACK, streamID: 0, length: 100 } }, - { header: { type: FrameType.WindowUpdate, flag: 0, streamID: 99, length: 1000 } }, - { header: { type: FrameType.GoAway, flag: 0, streamID: 0, length: GoAwayCode.ProtocolError } } -]; -const data = (length) => Uint8Array.from(Array.from({ length }), (_, i) => i); -const expectEqualBytes = (actual, expected, reason) => { - expect(actual instanceof Uint8Array ? actual : actual.subarray(), reason).to.deep.equal(expected instanceof Uint8Array ? expected : expected.subarray()); -}; -const expectEqualDataFrame = (actual, expected, reason = '') => { - expect(actual.header, reason + ' header').to.deep.equal(expected.header); - if (actual.data == null && expected.data != null) { - expect.fail('actual has no data but expected does'); - } - if (actual.data != null && expected.data == null) { - expect.fail('actual has data but expected does not'); - } - if (actual.data != null && expected.data != null) { - expectEqualBytes(actual.data, expected.data, reason + ' data?: string'); - } -}; -const expectEqualDataFrames = (actual, expected) => { - if (actual.length !== expected.length) { - expect.fail('actual'); - } - for (let i = 0; i < actual.length; i++) { - expectEqualDataFrame(actual[i], expected[i], String(i)); - } -}; -const dataFrame = (length) => ({ - header: { type: FrameType.Data, flag: 0, streamID: 1, length }, - data: data(length) -}); -export const randomRanges = (length) => { - const indices = []; - let i = 0; - let j = 0; - while (i < length) { - j = i; - i += Math.floor(Math.random() * length); - indices.push([j, i]); - } - return indices; -}; -describe('Decoder internals', () => { - describe('readHeader', () => { - const frame = frames[0]; - const p = pushable(); - const d = new Decoder(p); - afterEach(() => { - d['buffer'].consume(d['buffer'].length); - }); - it('should handle an empty buffer', async () => { - expect(d['buffer'].length, 'a freshly created decoder should have an empty buffer').to.equal(0); - expect(d['readHeader'](), 'an empty buffer should read no header').to.equal(undefined); - }); - it('should handle buffer length == header length', async () => { - d['buffer'].append(encodeHeader(frame.header)); - expect(d['readHeader'](), 'the decoded header should match the input').to.deep.equal(frame.header); - expect(d['buffer'].length, 'the buffer should be fully drained').to.equal(0); - }); - it('should handle buffer length < header length', async () => { - const upTo = 2; - d['buffer'].append(encodeHeader(frame.header).slice(0, upTo)); - expect(d['readHeader'](), 'an buffer that has insufficient bytes should read no header').to.equal(undefined); - expect(d['buffer'].length, 'a buffer that has insufficient bytes should not be consumed').to.equal(upTo); - d['buffer'].append(encodeHeader(frame.header).slice(upTo)); - expect(d['readHeader'](), 'the decoded header should match the input').to.deep.equal(frame.header); - expect(d['buffer'].length, 'the buffer should be fully drained').to.equal(0); - }); - it('should handle buffer length > header length', async () => { - const more = 10; - d['buffer'].append(encodeHeader(frame.header)); - d['buffer'].append(new Uint8Array(more)); - expect(d['readHeader'](), 'the decoded header should match the input').to.deep.equal(frame.header); - expect(d['buffer'].length, 'the buffer should be partially drained').to.equal(more); - }); - }); - describe('readBytes', () => { - const p = pushable(); - const d = new Decoder(p); - afterEach(() => { - d['buffer'].consume(d['buffer'].length); - }); - it('should handle buffer length == requested length', async () => { - const requested = 10; - d['buffer'].append(data(requested)); - let actual; - try { - actual = await Promise.race([timeout(1), d['readBytes'](requested)]); - } - catch (e) { - expect.fail('readBytes timed out'); - } - expectEqualBytes(actual, data(requested), 'read bytes should equal input'); - expect(d['buffer'].length, 'buffer should be drained').to.deep.equal(0); - }); - it('should handle buffer length > requested length', async () => { - const requested = 10; - d['buffer'].append(data(requested * 2)); - let actual; - try { - actual = await Promise.race([timeout(1), d['readBytes'](requested)]); - } - catch (e) { - expect.fail('readBytes timed out'); - } - expectEqualBytes(actual, data(requested), 'read bytes should equal input'); - expect(d['buffer'].length, 'buffer should be partially drained').to.deep.equal(requested); - }); - it('should handle buffer length < requested length, data available', async () => { - const requested = 10; - p.push(data(requested)); - let actual; - try { - actual = await Promise.race([timeout(10), d['readBytes'](requested)]); - } - catch (e) { - expect.fail('readBytes timed out'); - } - expectEqualBytes(actual, data(requested), 'read bytes should equal input'); - expect(d['buffer'].length, 'buffer should be drained').to.deep.equal(0); - }); - it('should handle buffer length < requested length, data not available', async () => { - const requested = 10; - p.push(data(requested - 1)); - try { - await Promise.race([timeout(10), d['readBytes'](requested)]); - expect.fail('readBytes should not resolve until the source + buffer have enough bytes'); - } - catch (e) { - } - }); - }); -}); -describe('Decoder', () => { - describe('emitFrames', () => { - let p; - let d; - beforeEach(() => { - p = pushable(); - d = new Decoder(p); - }); - it('should emit frames from source chunked by frame', async () => { - const expected = []; - for (const [i, frame] of frames.entries()) { - p.push(encodeHeader(frame.header)); - expected.push(frame); - // sprinkle in more data frames - if (i % 2 === 1) { - const df = dataFrame(i * 100); - p.push(encodeHeader(df.header)); - p.push(df.data); - expected.push(df); - } - } - p.end(); - const actual = []; - for await (const frame of d.emitFrames()) { - if (frame.readData === undefined) { - actual.push(frame); - } - else { - actual.push({ header: frame.header, data: await frame.readData() }); - } - } - expectEqualDataFrames(actual, expected); - }); - it('should emit frames from source chunked by partial frame', async () => { - const chunkSize = 5; - const expected = []; - for (const [i, frame] of frames.entries()) { - const encoded = encodeHeader(frame.header); - for (let i = 0; i < encoded.length; i += chunkSize) { - p.push(encoded.slice(i, i + chunkSize)); - } - expected.push(frame); - // sprinkle in more data frames - if (i % 2 === 1) { - const df = dataFrame(i * 100); - const encoded = Uint8Array.from([...encodeHeader(df.header), ...df.data]); - for (let i = 0; i < encoded.length; i += chunkSize) { - p.push(encoded.slice(i, i + chunkSize)); - } - expected.push(df); - } - } - p.end(); - const actual = []; - for await (const frame of d.emitFrames()) { - if (frame.readData === undefined) { - actual.push(frame); - } - else { - actual.push({ header: frame.header, data: await frame.readData() }); - } - } - expect(p.readableLength).to.equal(0); - expectEqualDataFrames(actual, expected); - }); - it('should emit frames from source chunked by multiple frames', async () => { - const expected = []; - for (let i = 0; i < frames.length; i++) { - const encoded1 = encodeHeader(frames[i].header); - expected.push(frames[i]); - i++; - const encoded2 = encodeHeader(frames[i].header); - expected.push(frames[i]); - // sprinkle in more data frames - const df = dataFrame(i * 100); - const encoded3 = Uint8Array.from([...encodeHeader(df.header), ...df.data]); - expected.push(df); - const encodedChunk = new Uint8Array(encoded1.length + encoded2.length + encoded3.length); - encodedChunk.set(encoded1, 0); - encodedChunk.set(encoded2, encoded1.length); - encodedChunk.set(encoded3, encoded1.length + encoded2.length); - p.push(encodedChunk); - } - p.end(); - const actual = []; - for await (const frame of d.emitFrames()) { - if (frame.readData === undefined) { - actual.push(frame); - } - else { - actual.push({ header: frame.header, data: await frame.readData() }); - } - } - expectEqualDataFrames(actual, expected); - }); - it('should emit frames from source chunked chaoticly', async () => { - const expected = []; - const encodedFrames = []; - for (const [i, frame] of frames.entries()) { - encodedFrames.push(encodeHeader(frame.header)); - expected.push(frame); - // sprinkle in more data frames - if (i % 2 === 1) { - const df = dataFrame(i * 100); - encodedFrames.push(encodeHeader(df.header)); - encodedFrames.push(df.data); - expected.push(df); - } - } - // create a single byte array of all frames to send - // so that we can chunk them chaoticly - const encoded = new Uint8Array(encodedFrames.reduce((a, b) => a + b.length, 0)); - let i = 0; - for (const e of encodedFrames) { - encoded.set(e, i); - i += e.length; - } - for (const [i, j] of randomRanges(encoded.length)) { - p.push(encoded.slice(i, j)); - } - p.end(); - const actual = []; - for await (const frame of d.emitFrames()) { - if (frame.readData === undefined) { - actual.push(frame); - } - else { - actual.push({ header: frame.header, data: await frame.readData() }); - } - } - expectEqualDataFrames(actual, expected); - }); - it('should error decoding frame while another decode is in progress', async () => { - const df1 = dataFrame(100); - p.push(encodeHeader(df1.header)); - p.push(df1.data); - const df2 = dataFrame(100); - p.push(encodeHeader(df2.header)); - p.push(df2.data); - try { - for await (const frame of d.emitFrames()) { - void frame; - } - expect.fail('decoding another frame before the first is finished should error'); - } - catch (e) { - expect(e.code).to.equal(ERR_DECODE_IN_PROGRESS); - } - }); - }); -}); -//# sourceMappingURL=decode.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/decode.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/decode.spec.js.map deleted file mode 100644 index 28dc7fcbf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/decode.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode.spec.js","sourceRoot":"","sources":["../../test/decode.spec.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAiB,QAAQ,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAoB,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC/E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGnC,MAAM,MAAM,GAAsD;IAChE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE;IAC5E,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE;IACpF,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,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aACF;YAED,qBAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;QACzC,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,iEAAiE,EAAE,KAAK,IAAI,EAAE;YAC/E,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,CAAA;YAC1B,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;YAChC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAChB,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,CAAA;YAC1B,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;YAChC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAEhB,IAAI;gBACF,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE;oBACxC,KAAK,KAAK,CAAA;iBACX;gBACD,MAAM,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAA;aAChF;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,CAAE,CAAsB,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;aACtE;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/mplex.util.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/mplex.util.d.ts deleted file mode 100644 index fb351e2b8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/mplex.util.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { StreamMuxer, StreamMuxerInit } from '@libp2p/interface/stream-muxer'; -import type { Source, Transform } from 'it-stream-types'; -export declare function testYamuxMuxer(name: string, client: boolean, conf?: StreamMuxerInit): StreamMuxer; -/** - * Create a transform that can be paused and unpaused - */ -export declare function pauseableTransform(): { - transform: Transform, AsyncGenerator>; - pause: () => void; - unpause: () => void; -}; -export declare function testClientServer(conf?: StreamMuxerInit): { - client: StreamMuxer & { - pauseRead: () => void; - unpauseRead: () => void; - pauseWrite: () => void; - unpauseWrite: () => void; - }; - server: StreamMuxer & { - pauseRead: () => void; - unpauseRead: () => void; - pauseWrite: () => void; - unpauseWrite: () => void; - }; -}; -export declare function timeout(ms: number): Promise; -export declare function sleep(ms: number): Promise; -//# sourceMappingURL=mplex.util.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/mplex.util.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/mplex.util.d.ts.map deleted file mode 100644 index 608ff7d4b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/mplex.util.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mplex.util.d.ts","sourceRoot":"","sources":["../../test/mplex.util.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAClF,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAMxD,wBAAgB,cAAc,CAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,GAAE,eAAoB,GAAG,WAAW,CAKtG;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAE,CAAC,KAAM;IAAE,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAsBxI;AAED,wBAAgB,gBAAgB,CAAE,IAAI,GAAE,eAAoB,GAAG;IAC7D,MAAM,EAAE,WAAW,GAAG;QACpB,SAAS,EAAE,MAAM,IAAI,CAAA;QACrB,WAAW,EAAE,MAAM,IAAI,CAAA;QACvB,UAAU,EAAE,MAAM,IAAI,CAAA;QACtB,YAAY,EAAE,MAAM,IAAI,CAAA;KACzB,CAAA;IACD,MAAM,EAAE,WAAW,GAAG;QACpB,SAAS,EAAE,MAAM,IAAI,CAAA;QACrB,WAAW,EAAE,MAAM,IAAI,CAAA;QACvB,UAAU,EAAE,MAAM,IAAI,CAAA;QACtB,YAAY,EAAE,MAAM,IAAI,CAAA;KACzB,CAAA;CACF,CA0BA;AAED,wBAAsB,OAAO,CAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE3D;AAED,wBAAsB,KAAK,CAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEzD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/mplex.util.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/mplex.util.js deleted file mode 100644 index e4116a596..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/mplex.util.js +++ /dev/null @@ -1,72 +0,0 @@ -import { defaultLogger } from '@libp2p/logger'; -import { mplex } from '@libp2p/mplex'; -import { duplexPair } from 'it-pair/duplex'; -import { pipe } from 'it-pipe'; -import {} from 'uint8arraylist'; -const factory = mplex()({ - logger: defaultLogger() -}); -export function testYamuxMuxer(name, client, conf = {}) { - return factory.createStreamMuxer({ - ...conf, - direction: client ? 'outbound' : 'inbound' - }); -} -/** - * Create a transform that can be paused and unpaused - */ -export function pauseableTransform() { - let resolvePausePromise; - let pausePromise; - const unpause = () => { - resolvePausePromise?.(null); - }; - const pause = () => { - pausePromise = new Promise(resolve => { - resolvePausePromise = resolve; - }); - }; - const transform = async function* (source) { - for await (const d of source) { - if (pausePromise !== undefined) { - await pausePromise; - pausePromise = undefined; - resolvePausePromise = undefined; - } - yield d; - } - }; - return { transform, pause, unpause }; -} -export function testClientServer(conf = {}) { - const pair = duplexPair(); - const client = testYamuxMuxer('libp2p:mplex:client', true, conf); - const server = testYamuxMuxer('libp2p:mplex:server', false, conf); - const clientReadTransform = pauseableTransform(); - const clientWriteTransform = pauseableTransform(); - const serverReadTransform = pauseableTransform(); - const serverWriteTransform = pauseableTransform(); - void pipe(pair[0], clientReadTransform.transform, client, clientWriteTransform.transform, pair[0]); - void pipe(pair[1], serverReadTransform.transform, server, serverWriteTransform.transform, pair[1]); - return { - client: Object.assign(client, { - pauseRead: clientReadTransform.pause, - unpauseRead: clientReadTransform.unpause, - pauseWrite: clientWriteTransform.pause, - unpauseWrite: clientWriteTransform.unpause - }), - server: Object.assign(server, { - pauseRead: serverReadTransform.pause, - unpauseRead: serverReadTransform.unpause, - pauseWrite: serverWriteTransform.pause, - unpauseWrite: serverWriteTransform.unpause - }) - }; -} -export async function timeout(ms) { - return new Promise((_resolve, reject) => setTimeout(() => { reject(new Error(`timeout after ${ms}ms`)); }, ms)); -} -export async function sleep(ms) { - return new Promise(resolve => setTimeout(() => { resolve(ms); }, ms)); -} -//# sourceMappingURL=mplex.util.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/mplex.util.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/mplex.util.js.map deleted file mode 100644 index 36f21ff9e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/mplex.util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mplex.util.js","sourceRoot":"","sources":["../../test/mplex.util.ts"],"names":[],"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AoB,CAAC,OAAO;SAC3C,CAAC;KACH,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAE,EAAU;IACvC,OAAO,IAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,IAAI,KAAK,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAA,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAChH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,KAAK,CAAE,EAAU;IACrC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AACtE,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/muxer.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/muxer.spec.d.ts deleted file mode 100644 index 5855d5d5f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/muxer.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=muxer.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/muxer.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/muxer.spec.d.ts.map deleted file mode 100644 index cb814f4c4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/muxer.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"muxer.spec.d.ts","sourceRoot":"","sources":["../../test/muxer.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/muxer.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/muxer.spec.js deleted file mode 100644 index 6c38a5d23..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/muxer.spec.js +++ /dev/null @@ -1,118 +0,0 @@ -/* eslint-env mocha */ -import { expect } from 'aegir/chai'; -import { duplexPair } from 'it-pair/duplex'; -import { pipe } from 'it-pipe'; -import {} from 'uint8arraylist'; -import { ERR_MUXER_LOCAL_CLOSED } from '../src/constants.js'; -import { sleep, testClientServer, testYamuxMuxer } from './util.js'; -describe('muxer', () => { - let client; - let server; - afterEach(async () => { - if (client != null) { - await client.close(); - } - if (server != null) { - await server.close(); - } - }); - it('test repeated close', async () => { - const client1 = testYamuxMuxer('libp2p:yamux:1', true); - // inspect logs to ensure its only closed once - await client1.close(); - await client1.close(); - await client1.close(); - }); - it('test client<->client', async () => { - const pair = duplexPair(); - const client1 = testYamuxMuxer('libp2p:yamux:1', true); - const client2 = testYamuxMuxer('libp2p:yamux:2', true); - void pipe(pair[0], client1, pair[0]); - void pipe(pair[1], client2, pair[1]); - client1.newStream(); - client2.newStream(); - await sleep(20); - expect(client1.isClosed()).to.equal(true); - expect(client2.isClosed()).to.equal(true); - }); - it('test server<->server', async () => { - const pair = duplexPair(); - const client1 = testYamuxMuxer('libp2p:yamux:1', false); - const client2 = testYamuxMuxer('libp2p:yamux:2', false); - void pipe(pair[0], client1, pair[0]); - void pipe(pair[1], client2, pair[1]); - client1.newStream(); - client2.newStream(); - await sleep(20); - expect(client1.isClosed()).to.equal(true); - expect(client2.isClosed()).to.equal(true); - }); - it('test ping', async () => { - ({ client, server } = testClientServer()); - server.pauseRead(); - const clientRTT = client.ping(); - await sleep(10); - server.unpauseRead(); - expect(await clientRTT).to.not.equal(0); - server.pauseWrite(); - const serverRTT = server.ping(); - await sleep(10); - server.unpauseWrite(); - expect(await serverRTT).to.not.equal(0); - }); - it('test multiple simultaneous pings', async () => { - ({ client, server } = testClientServer()); - client.pauseWrite(); - const promise = [ - client.ping(), - client.ping(), - client.ping() - ]; - await sleep(10); - client.unpauseWrite(); - const clientRTTs = await Promise.all(promise); - expect(clientRTTs[0]).to.not.equal(0); - expect(clientRTTs[0]).to.equal(clientRTTs[1]); - expect(clientRTTs[1]).to.equal(clientRTTs[2]); - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(client['nextPingID']).to.equal(1); - await client.close(); - }); - it('test go away', async () => { - ({ client, server } = testClientServer()); - await client.close(); - expect(() => { - client.newStream(); - }).to.throw().with.property('code', ERR_MUXER_LOCAL_CLOSED, 'should not be able to open a stream after close'); - }); - it('test keep alive', async () => { - ({ client, server } = testClientServer({ enableKeepAlive: true, keepAliveInterval: 10 })); - await sleep(1000); - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(client['nextPingID']).to.be.gt(2); - await client.close(); - await server.close(); - }); - it('test max inbound streams', async () => { - ({ client, server } = testClientServer({ maxInboundStreams: 1 })); - client.newStream(); - client.newStream(); - await sleep(10); - expect(server.streams.length).to.equal(1); - expect(client.streams.length).to.equal(1); - }); - it('test max outbound streams', async () => { - ({ client, server } = testClientServer({ maxOutboundStreams: 1 })); - client.newStream(); - await sleep(10); - try { - client.newStream(); - expect.fail('stream creation should fail if exceeding maxOutboundStreams'); - } - catch (e) { - expect(server.streams.length).to.equal(1); - expect(client.streams.length).to.equal(1); - } - }); -}); -//# sourceMappingURL=muxer.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/muxer.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/muxer.spec.js.map deleted file mode 100644 index 98acb04d6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nag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CAAA;SAC1C;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/stream.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/stream.spec.d.ts deleted file mode 100644 index 2ce82973f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/stream.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=stream.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/stream.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/stream.spec.d.ts.map deleted file mode 100644 index 77bed1442..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/stream.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stream.spec.d.ts","sourceRoot":"","sources":["../../test/stream.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/stream.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/stream.spec.js deleted file mode 100644 index 7ecb7583c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/stream.spec.js +++ /dev/null @@ -1,198 +0,0 @@ -/* eslint-env mocha */ -import { expect } from 'aegir/chai'; -import { pipe } from 'it-pipe'; -import { pushable } from 'it-pushable'; -import { defaultConfig } from '../src/config.js'; -import { ERR_RECV_WINDOW_EXCEEDED } from '../src/constants.js'; -import { GoAwayCode } from '../src/frame.js'; -import { StreamState } from '../src/stream.js'; -import { sleep, testClientServer } from './util.js'; -describe('stream', () => { - let client; - let server; - afterEach(async () => { - if (client != null) { - await client.close(); - } - if (server != null) { - await server.close(); - } - }); - it('test send data - small', async () => { - ({ client, server } = testClientServer({ initialStreamWindowSize: defaultConfig.initialStreamWindowSize })); - const { default: drain } = await import('it-drain'); - const p = pushable(); - const c1 = client.newStream(); - await sleep(10); - const s1 = server.streams[0]; - const sendPipe = pipe(p, c1); - const recvPipe = pipe(s1, drain); - for (let i = 0; i < 10; i++) { - p.push(new Uint8Array(256)); - } - p.end(); - await Promise.all([sendPipe, recvPipe]); - // the window capacities should have refilled via window updates as received data was consumed - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(c1['sendWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(s1['recvWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - }); - it('test send data - large', async () => { - ({ client, server } = testClientServer({ initialStreamWindowSize: defaultConfig.initialStreamWindowSize })); - const { default: drain } = await import('it-drain'); - const p = pushable(); - const c1 = client.newStream(); - await sleep(10); - const s1 = server.streams[0]; - const sendPipe = pipe(p, c1); - const recvPipe = pipe(s1, drain); - // amount of data is greater than initial window size - // and each payload is also greater than the max message size - // this will payload chunking and also waiting for window updates before continuing to send - for (let i = 0; i < 10; i++) { - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - } - p.end(); - await Promise.all([sendPipe, recvPipe]); - // the window capacities should have refilled via window updates as received data was consumed - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(c1['sendWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(s1['recvWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - }); - it('test send data - large with increasing recv window size', async () => { - ({ client, server } = testClientServer({ initialStreamWindowSize: defaultConfig.initialStreamWindowSize })); - const { default: drain } = await import('it-drain'); - const p = pushable(); - const c1 = client.newStream(); - server.pauseWrite(); - void server.ping(); - await sleep(10); - server.unpauseWrite(); - const s1 = server.streams[0]; - const sendPipe = pipe(p, c1); - const recvPipe = pipe(s1, drain); - // amount of data is greater than initial window size - // and each payload is also greater than the max message size - // this will payload chunking and also waiting for window updates before continuing to send - for (let i = 0; i < 10; i++) { - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - } - p.end(); - await Promise.all([sendPipe, recvPipe]); - // the window capacities should have refilled via window updates as received data was consumed - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(c1['sendWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(s1['recvWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - }); - it('test many streams', async () => { - ({ client, server } = testClientServer()); - for (let i = 0; i < 1000; i++) { - client.newStream(); - } - await sleep(100); - expect(client.streams.length).to.equal(1000); - expect(server.streams.length).to.equal(1000); - }); - it('test many streams - ping pong', async () => { - ({ client, server } = testClientServer({ - // echo on incoming streams - onIncomingStream: (stream) => { void pipe(stream, stream); } - })); - const numStreams = 10; - const p = []; - for (let i = 0; i < numStreams; i++) { - client.newStream(); - p.push(pushable()); - } - await sleep(100); - for (let i = 0; i < numStreams; i++) { - const s = client.streams[i]; - void pipe(p[i], s); - p[i].push(new Uint8Array(16)); - } - await sleep(100); - expect(client.streams.length).to.equal(numStreams); - expect(server.streams.length).to.equal(numStreams); - await client.close(); - }); - it('test stream close', async () => { - ({ client, server } = testClientServer()); - const c1 = client.newStream(); - await c1.close(); - await sleep(5); - expect(c1.state).to.equal(StreamState.Finished); - const s1 = server.streams[0]; - expect(s1).to.not.be.undefined(); - expect(s1.state).to.equal(StreamState.SYNReceived); - }); - it('test stream close read', async () => { - ({ client, server } = testClientServer()); - const c1 = client.newStream(); - await c1.closeRead(); - await sleep(5); - const s1 = server.streams[0]; - expect(s1).to.not.be.undefined(); - expect(s1.readStatus).to.equal('ready'); - expect(s1.writeStatus).to.equal('ready'); - }); - it('test stream close write', async () => { - ({ client, server } = testClientServer()); - const c1 = client.newStream(); - await c1.closeWrite(); - await sleep(5); - expect(c1.readStatus).to.equal('ready'); - expect(c1.writeStatus).to.equal('closed'); - const s1 = server.streams[0]; - expect(s1).to.not.be.undefined(); - expect(s1.readStatus).to.equal('closed'); - expect(s1.writeStatus).to.equal('ready'); - }); - it('test window overflow', async () => { - ({ client, server } = testClientServer({ maxMessageSize: defaultConfig.initialStreamWindowSize, initialStreamWindowSize: defaultConfig.initialStreamWindowSize })); - const { default: drain } = await import('it-drain'); - const p = pushable(); - const c1 = client.newStream(); - await sleep(10); - const s1 = server.streams[0]; - const sendPipe = pipe(p, c1); - const c1SendData = c1.sendData.bind(c1); - c1.sendData = async (data) => { - await c1SendData(data); - // eslint-disable-next-line @typescript-eslint/dot-notation - c1['sendWindowCapacity'] = defaultConfig.initialStreamWindowSize * 10; - }; - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - await sleep(10); - const recvPipe = pipe(s1, drain); - p.end(); - try { - await Promise.all([sendPipe, recvPipe]); - } - catch (e) { - expect(e.code).to.equal(ERR_RECV_WINDOW_EXCEEDED); - } - expect(client).to.have.property('remoteGoAway', GoAwayCode.ProtocolError); - expect(server).to.have.property('localGoAway', GoAwayCode.ProtocolError); - }); - it('test stream sink error', async () => { - ({ client, server } = testClientServer()); - // don't let the server respond - server.pauseRead(); - const p = pushable(); - const c1 = client.newStream(); - const sendPipe = pipe(p, c1); - // send more data than the window size, will trigger a wait - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - await sleep(10); - // the client should close gracefully even though it was waiting to send more data - await client.close(); - p.end(); - await sendPipe; - }); -}); -//# sourceMappingURL=stream.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/stream.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/stream.spec.js.map deleted file mode 100644 index 995f83f08..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/stream.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stream.spec.js","sourceRoot":"","sources":["../../test/stream.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAiB,QAAQ,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAqB,MAAM,WAAW,CAAA;AAGtE,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,IAAI,MAAoB,CAAA;IACxB,IAAI,MAAoB,CAAA;IAExB,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;SACrB;QAED,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;SACrB;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACtC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAC,EAAE,uBAAuB,EAAE,aAAa,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAA;QAC3G,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAA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,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/util.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/util.d.ts deleted file mode 100644 index 0a268c96f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/util.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Yamux, YamuxMuxer, type YamuxMuxerInit } from '../src/muxer.js'; -import type { Config } from '../src/config.js'; -import type { Source, Transform } from 'it-stream-types'; -export declare const testConf: Partial; -/** - * Yamux must be configured with a client setting `client` to true - * and a server setting `client` to falsey - * - * Since the compliance tests create a dialer and listener, - * manually alternate setting `client` to true and false - */ -export declare class TestYamux extends Yamux { - createStreamMuxer(init?: YamuxMuxerInit): YamuxMuxer; -} -export declare function testYamuxMuxer(name: string, client: boolean, conf?: YamuxMuxerInit): YamuxMuxer; -/** - * Create a transform that can be paused and unpaused - */ -export declare function pauseableTransform(): { - transform: Transform, AsyncGenerator>; - pause: () => void; - unpause: () => void; -}; -export interface YamuxFixture extends YamuxMuxer { - pauseRead: () => void; - unpauseRead: () => void; - pauseWrite: () => void; - unpauseWrite: () => void; -} -export declare function testClientServer(conf?: YamuxMuxerInit): { - client: YamuxFixture; - server: YamuxFixture; -}; -export declare function timeout(ms: number): Promise; -export declare function sleep(ms: number): Promise; -//# sourceMappingURL=util.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/util.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/util.d.ts.map deleted file mode 100644 index bd692d2c1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/util.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.d.ts","source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C,CAEzD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/util.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/util.js deleted file mode 100644 index 2a3f55f27..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/util.js +++ /dev/null @@ -1,95 +0,0 @@ -import { logger } from '@libp2p/logger'; -import { duplexPair } from 'it-pair/duplex'; -import { pipe } from 'it-pipe'; -import { Yamux, YamuxMuxer } from '../src/muxer.js'; -import { Uint8ArrayList } from 'uint8arraylist'; -const isClient = (() => { - let client = false; - return () => { - const isClient = !client; - client = isClient; - return isClient; - }; -})(); -export const testConf = { - enableKeepAlive: false -}; -/** - * Yamux must be configured with a client setting `client` to true - * and a server setting `client` to falsey - * - * Since the compliance tests create a dialer and listener, - * manually alternate setting `client` to true and false - */ -export class TestYamux extends Yamux { - createStreamMuxer(init) { - const client = isClient(); - return super.createStreamMuxer({ ...testConf, ...init, direction: client ? 'outbound' : 'inbound', log: logger(`libp2p:yamux${client ? 1 : 2}`) }); - } -} -export function testYamuxMuxer(name, client, conf = {}) { - return new YamuxMuxer({ - ...testConf, - ...conf, - direction: client ? 'outbound' : 'inbound', - log: logger(name) - }); -} -/** - * Create a transform that can be paused and unpaused - */ -export function pauseableTransform() { - let resolvePausePromise; - let pausePromise; - const unpause = () => { - resolvePausePromise?.(null); - }; - const pause = () => { - pausePromise = new Promise(resolve => { - resolvePausePromise = resolve; - }); - }; - const transform = async function* (source) { - for await (const d of source) { - if (pausePromise !== undefined) { - await pausePromise; - pausePromise = undefined; - resolvePausePromise = undefined; - } - yield d; - } - }; - return { transform, pause, unpause }; -} -export function testClientServer(conf = {}) { - const pair = duplexPair(); - const client = testYamuxMuxer('libp2p:yamux:client', true, conf); - const server = testYamuxMuxer('libp2p:yamux:server', false, conf); - const clientReadTransform = pauseableTransform(); - const clientWriteTransform = pauseableTransform(); - const serverReadTransform = pauseableTransform(); - const serverWriteTransform = pauseableTransform(); - void pipe(pair[0], clientReadTransform.transform, client, clientWriteTransform.transform, pair[0]); - void pipe(pair[1], serverReadTransform.transform, server, serverWriteTransform.transform, pair[1]); - return { - client: Object.assign(client, { - pauseRead: clientReadTransform.pause, - unpauseRead: clientReadTransform.unpause, - pauseWrite: clientWriteTransform.pause, - unpauseWrite: clientWriteTransform.unpause - }), - server: Object.assign(server, { - pauseRead: serverReadTransform.pause, - unpauseRead: serverReadTransform.unpause, - pauseWrite: serverWriteTransform.pause, - unpauseWrite: serverWriteTransform.unpause - }) - }; -} -export async function timeout(ms) { - return new Promise((_resolve, reject) => setTimeout(() => { reject(new Error(`timeout after ${ms}ms`)); }, ms)); -} -export async function sleep(ms) { - return new Promise(resolve => setTimeout(() => { resolve(ms); }, ms)); -} -//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/util.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/util.js.map deleted file mode 100644 index f75486fb3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/test/util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../../test/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,UAAU,EAAuB,MAAM,iBAAiB,CAAA;AAGxE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE;IACrB,IAAI,MAAM,GAAG,KAAK,CAAA;IAClB,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;YAC5B,SAAS,EAAE,mBAAmB,CAAC,KAAK;YACpC,WAAW,EAAE,mBAAmB,CAAC,OAAO;YACxC,UAAU,EAAE,oBAAoB,CAAC,KAAK;YACtC,YAAY,EAAE,oBAAoB,CAAC,OAAO;SAC3C,CAAC;QACF,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;YAC5B,SAAS,EAAE,mBAAmB,CAAC,KAAK;YACpC,WAAW,EAAE,mBAAmB,CAAC,OAAO;YACxC,UAAU,EAAE,oBAAoB,CAAC,KAAK;YACtC,YAAY,EAAE,oBAAoB,CAAC,OAAO;SAC3C,CAAC;KACH,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAE,EAAU;IACvC,OAAO,IAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,IAAI,KAAK,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAA,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAChH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,KAAK,CAAE,EAAU;IACrC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AACtE,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/tsconfig.tsbuildinfo deleted file mode 100644 index fd5d9b451..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/@libp2p/interface/dist/src/errors.d.ts","../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface/dist/src/peer-id/index.d.ts","../node_modules/@libp2p/logger/dist/src/index.d.ts","../src/constants.ts","../src/config.ts","../node_modules/uint8arraylist/dist/src/index.d.ts","../src/frame.ts","../node_modules/it-stream-types/dist/src/index.d.ts","../src/decode.ts","../src/encode.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/buffer/index.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@libp2p/interface/dist/src/events.d.ts","../node_modules/get-iterator/dist/src/index.d.ts","../node_modules/it-pushable/dist/src/index.d.ts","../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-info/index.d.ts","../node_modules/@libp2p/interface/dist/src/content-routing/index.d.ts","../node_modules/@libp2p/interface/dist/src/metrics/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-routing/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-store/index.d.ts","../node_modules/@libp2p/interface/dist/src/startable.d.ts","../node_modules/@libp2p/interface/dist/src/stream-handler/index.d.ts","../node_modules/@libp2p/interface/dist/src/topology/index.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/index.d.ts","../node_modules/@libp2p/interface/dist/src/transport/index.d.ts","../node_modules/@libp2p/interface/dist/src/index.d.ts","../node_modules/@libp2p/utils/dist/src/abstract-stream.d.ts","../node_modules/it-foreach/dist/src/index.d.ts","../src/stream.ts","../src/muxer.ts","../src/index.ts","../node_modules/@types/chai/index.d.ts","../node_modules/@types/chai-as-promised/index.d.ts","../node_modules/chai-parentheses/index.d.ts","../node_modules/@types/chai-subset/index.d.ts","../node_modules/chai-bites/index.d.ts","../node_modules/@types/chai-string/index.d.ts","../node_modules/aegir/dist/utils/chai.d.ts","../test/codec.util.ts","../test/codec.spec.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/index.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/stream-muxer/index.d.ts","../node_modules/it-pair/dist/src/duplex.d.ts","../node_modules/it-pipe/dist/src/index.d.ts","../test/util.ts","../test/compliance.spec.ts","../test/decode.spec.ts","../node_modules/@libp2p/mplex/dist/src/message-types.d.ts","../node_modules/@libp2p/mplex/dist/src/stream.d.ts","../node_modules/@libp2p/mplex/dist/src/mplex.d.ts","../node_modules/@libp2p/mplex/dist/src/index.d.ts","../test/mplex.util.ts","../test/muxer.spec.ts","../node_modules/it-drain/dist/src/index.d.ts","../test/stream.spec.ts","../node_modules/@dapplion/benchmark/lib/utils/mochacliexports.d.ts","../node_modules/@dapplion/benchmark/lib/types.d.ts","../node_modules/@dapplion/benchmark/lib/mochaplugin/runbenchfn.d.ts","../node_modules/@dapplion/benchmark/lib/mochaplugin/index.d.ts","../node_modules/@dapplion/benchmark/lib/index.d.ts","../test/bench/codec.bench.ts","../test/bench/comparison.bench.ts","../node_modules/keyv/src/index.d.ts","../node_modules/@types/http-cache-semantics/index.d.ts","../node_modules/@types/responselike/index.d.ts","../node_modules/@types/cacheable-request/index.d.ts","../node_modules/@types/ms/index.d.ts","../node_modules/@types/debug/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/keyv/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/mdast/index.d.ts","../node_modules/@types/minimatch/index.d.ts","../node_modules/@types/minimist/index.d.ts","../node_modules/@types/mocha/index.d.ts","../node_modules/@types/node-fetch/node_modules/form-data/index.d.ts","../node_modules/@types/node-fetch/externals.d.ts","../node_modules/@types/node-fetch/index.d.ts","../node_modules/@types/normalize-package-data/index.d.ts","../node_modules/@types/parse-json/index.d.ts","../node_modules/@types/retry/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts","../node_modules/@types/strip-bom/index.d.ts","../node_modules/@types/strip-json-comments/index.d.ts","../node_modules/@types/tunnel/index.d.ts","../node_modules/@types/ungap__structured-clone/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts","../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","cb4b40f34fe4b1d87c530a0f3c2c1e043e338829fab8cf5cbd92a91c8c1374b8",{"version":"646beeaa0e97b5d4798f01ae89b23f6b865c431891809bb33aa5b789bfc0eb23","signature":"df7d1feb50bcbe0479167c592934b29c9883c99bed4c04847e497571ea25429d"},{"version":"973516e23e7bb3b05ac9e0db11801bc769bcc1ed70779b59299d6f128570a503","signature":"c8031a5db82b240f801a5684ab693e95e1e06dc76958894fe42d35acbd446f28"},"176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d",{"version":"77b3667a04dcec1bbf3d5958cdd117e58ea93543370e019d5d2f313b33475d76","signature":"1633b84fd3346ad6500a88e7a119ac778bb6f6b2746a3b7b8164c5ef2721822f"},"c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc",{"version":"0ad343b8866b3e51c60be77174d88f7e8c9e391816f329388daf36bd42c77c10","signature":"44287337e054ff7aa53fd7ccdafce53525bf3737f1258bc5c6fb7cdb94eefbf8"},{"version":"813aef3c48ba035ef86423017092460ca5cc552336f0519f71417c0e02d57c48","signature":"de47457474d7e0c031a66c92c6809813beced704dcff00b327252dbfbd735246"},"efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","285e512c7a0db217a0599e18c462d565fa35be4a5153dd7b80bee88c83e83ddf","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"7ae9dc7dbb58cd843065639707815df85c044babaa0947116f97bdb824d07204","affectsGlobalScope":true},"7aae1df2053572c2cfc2089a77847aadbb38eedbaa837a846c6a49fb37c6e5bd","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"dea4c00820d4fac5e530d4842aed2fb20d6744d75a674b95502cbd433f88bcb0","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"b7eadc0b0cba14ab854122810f330314132c5cfdb7800fceb82d521997a1f5b0","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"2225100373ca3d63bcc7f206e1177152d2e2161285a0bd83c8374db1503a0d1f","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","4a34b074b11c3597fb2ff890bc8f1484375b3b80793ab01f974534808d5777c7",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","485ae32287d8df9e74f68a9dc96c9211a7cfe8b302717043a988a40d930330d2","fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","1bf687d978bdd6d5aff10b9eb0ff0695179f8594d4446946fd0182d6d25fa433","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1","75e0c62536016dac8cc0d825742ff7cc4c0455ebc86923e47edcc19edac0997c","c66c95ed9fcebfc20ac8a59e7ea8bf41e1a3ead0e81206515102f4ca6c54272f",{"version":"cc4246e61d1268ead1c1b05994fb8a7f2ea4b3d7a5222c9747fd83e24c0d3d4b","signature":"de6afce5d1e6f2f81a5030fee9c7400a56b3c4077c5f9699cd71294c91e525cf"},{"version":"d45c99803572149f908205cdbe67a6d8a7c035ab5437876aeb0cd0863342ffc9","signature":"067ab20bf63d65f9b724398636d5083a71fb7d8cfe80a504ce2d2fe31400eab7"},{"version":"02ba3e55572e45071b1b6380d713eb8744a64e2f93d6239eea167cecb3ff0b2b","signature":"df54eaa5ea53c6bb3a9548bc5d2f6fb22583ea3e8b936a4e8ec5acfd90422ff3"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d",{"version":"2a5f6d929c1ab7dd044e4e1f27c2219138388f6ffbec5f495ce973c9682cbb4d","signature":"e0a5e1d0a21126716c6561a24e50810c24e63a549cb06d96d6cb675512c1b31c"},{"version":"8a54db2a8b7bfa3a68970b795708c982b45f76165538e8938a1fbdd7dbcd19f9","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","89020b28796eb67824a234b2d571d51ae6f9f944efa0201901df1447ff61ea87","b1129d7c114eba7c7b155dc809d6371ef86a0738f7ca93b3efef9b796d6168d9","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6",{"version":"d9dc238dc60f9f6fac4ac03ad8d1ed44774707befe91ed1b8e42f947df4ff69f","signature":"44f9c4f61b45a644c79fe6b15e09220e78c6bf3fbb46552fcae2ca0069c02e47"},{"version":"7ec913df1f630b388fb69f560287ddc7eecc83dd57587b38a20aa83353640e0f","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"68c22a33a565cfb46edaa7632c40ed3e49fdc735898e9b46fdd334ce0747cf15","signature":"d44159b9ee3018b60e80fd577633a4e1ee533c89f1b1042ceba9e41b655baaf1"},"22c980472aeac42a88c7954c9645c5cf0c511142afd048699daf516b25f9ea2d","aabcb267f8a73a9923157af617c47e2d707481760e60967dfa836613e2b7433b","52e581f4f22812920c916ebde59bad7175b5f6cdd4d33cb3f89333621a0a465f","b136dc0a448fd836eaf575f97ed9beeafe1f09752d72b75d5d71749b13815ba5",{"version":"a50419f7eb4aa63a5f3d08de48edfe781eaac9e3b4025e9dc95a2ea1068a3f08","signature":"6fbb5def100ea00a3a0eebe436f333b7d184445d2d1c1ff15ed6d9f531e005ea"},{"version":"427f54210f631b4b29e3362abddb472d04745871579d160f10a0d0b522021fc9","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"687ec53a7422d8cf80477fffa82a2db211f724039267931642befcd4907aec26",{"version":"04bc1356353c28c93ae6bbd171bd79783a74fa9cb0ac0b3dc95f2d110e3a1d55","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"4ef576c5a52f34423f6328a6834c6fc874c6683a0626c0f21d6b2209f460dffd","7b195dbf43d2194d18627fe3e190979b5bd2f0752001193260c89b01c36460e2","7350c835566c20d980134ad870a072daa93754c6b65d602a46f2bc2e2ae12165","ee9b614565fe2e96c3202c092ea4e4bc902f51d1508bf8015d8f2275686ab040","f6f278c43d4e70fe1abb2c826a0b1c1ea7c4f6ff50b272aacdda3b39c51f4d61",{"version":"507c17c9560d122d5a84b1a9c445f1dda6bab818e816490c92cae62cc85e177a","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"6fdcba0554752fe51578f0fadbbfa35ed5d3687ca9d48d533dfd49356879ea49","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"736097ddbb2903bef918bb3b5811ef1c9c5656f2a73bd39b22a91b9cc2525e50","4340936f4e937c452ae783514e7c7bbb7fc06d0c97993ff4865370d0962bb9cf","5009c081fd8ca3fcd6f3adcd071a1c79a933a400532b897822aad0943688a1f1","22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a","4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","882057f051daf834e4d01701066e1bac2d243b0c3eda702b25874402c1e0172d","852bcf5d92d819abdf34ba0759c311b61d5dac7b9963a6c3cc4f23b025dee8f3","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[69,70,72,74,75,[183,185],193,194,[199,201],206,207,209,215,216],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[155,213],[155,211,212],[155,211],[155,210],[155],[155,178,195],[67,71,73,155,168,180],[66,155,170,180],[125,155,162],[67,155,163,168,169,170,171,172,173,174,175,176,177,179],[155,169],[64,66,155],[67,155,168],[67,155,170,180],[71,73,155,169,180],[67,155,169],[155,163,168,169,178,180],[67,155],[155,178,204],[71,155],[71,73,155,169,178,180,202,203,205],[71,155,180,181,202],[68,71,73,155,169,180],[155,168],[155,166,167],[125,128,154,155,162,217,218,219],[155,186],[155,221],[155,227],[128,154,155,162,232,233],[128,143,155,162],[76,155],[112,155],[113,118,146,155],[114,125,126,133,143,154,155],[114,115,125,133,155],[116,155],[117,118,126,134,155],[118,143,151,155],[119,121,125,133,155],[120,155],[121,122,155],[125,155],[123,125,155],[112,125,155],[125,126,127,143,154,155],[125,126,127,140,143,146,155],[110,155,159],[121,125,128,133,143,154,155],[125,126,128,129,133,143,151,154,155],[128,130,143,151,154,155],[76,77,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161],[125,131,155],[132,154,155,159],[121,125,133,143,155],[134,155],[135,155],[112,136,155],[137,153,155,159],[138,155],[139,155],[125,140,141,155],[140,142,155,157],[113,125,143,144,145,146,155],[113,143,145,155],[143,144,155],[146,155],[147,155],[112,143,155],[125,149,150,155],[149,150,155],[118,133,143,151,155],[152,155],[133,153,155],[113,128,139,154,155],[118,155],[143,155,156],[132,155,157],[155,158],[113,118,125,127,136,143,154,155,157,159],[143,155,160],[155,238,277],[155,238,262,277],[155,277],[155,238],[155,238,263,277],[155,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276],[155,263,277],[128,130,155,162],[155,282],[125,143,155,162],[155,186,187,188,189,190,191],[155,186,187],[73,155],[65,66,155],[65,155],[62,63,64,155],[87,91,154,155],[87,143,154,155],[82,155],[84,87,151,154,155],[133,151,155],[155,162],[82,155,162],[84,87,133,154,155],[79,80,83,86,113,125,143,154,155],[79,85,155],[83,87,113,146,154,155,162],[113,155,162],[103,113,155,162],[81,82,155,162],[87,155],[81,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,155],[87,94,95,155],[85,87,95,96,155],[86,155],[79,82,87,155],[87,91,95,96,155],[91,155],[85,87,90,154,155],[79,84,85,87,91,94,155],[113,143,155],[82,87,103,113,155,159,162],[61,68,69,155],[61,69,71,72,73,155],[72,155],[72,155,178,184],[61,68,69,70,71,72,73,74,75,155,163,164,165,169,178,180,183],[61,69,70,71,72,155,180,181,182],[72,74,75,155,193,214],[155,198,199,206,208,214],[72,74,75,155,192,193],[61,69,72,155],[155,196,199],[69,71,72,74,75,155,165,192,199],[68,71,73,155,178,197,198,205],[69,71,155,192,197,198,199],[69,70,71,72,155,165,183,192,198,199,208],[68,70,71,73,155,184,197,198],[68],[71,72,73],[72],[72,178,184],[70,71,72,73,165,178,180,183],[70,71,72,180,181],[73,178],[70,73,184]],"referencedMap":[[214,1],[213,2],[212,3],[211,4],[210,5],[195,5],[196,6],[169,7],[171,8],[61,5],[163,9],[180,10],[172,11],[67,12],[170,13],[173,14],[174,13],[175,5],[176,11],[178,15],[177,16],[179,17],[68,18],[205,19],[202,20],[204,21],[203,22],[181,23],[167,24],[168,25],[166,24],[220,26],[187,27],[191,27],[189,27],[186,5],[222,28],[218,5],[223,5],[224,5],[225,5],[226,9],[228,29],[229,5],[230,5],[231,5],[221,5],[233,5],[234,30],[232,31],[76,32],[77,32],[112,33],[113,34],[114,35],[115,36],[116,37],[117,38],[118,39],[119,40],[120,41],[121,42],[122,42],[124,43],[123,44],[125,45],[126,46],[127,47],[111,48],[161,5],[128,49],[129,50],[130,51],[162,52],[131,53],[132,54],[133,55],[134,56],[135,57],[136,58],[137,59],[138,60],[139,61],[140,62],[141,62],[142,63],[143,64],[145,65],[144,66],[146,67],[147,68],[148,69],[149,70],[150,71],[151,72],[152,73],[153,74],[154,75],[155,76],[156,77],[157,78],[158,79],[159,80],[160,81],[235,5],[236,5],[219,31],[237,5],[262,82],[263,83],[238,84],[241,84],[260,82],[261,82],[251,82],[250,85],[248,82],[243,82],[256,82],[254,82],[258,82],[242,82],[255,82],[259,82],[244,82],[245,82],[257,82],[239,82],[246,82],[247,82],[249,82],[253,82],[264,86],[252,82],[240,82],[277,87],[276,5],[271,86],[273,88],[272,86],[265,86],[266,86],[268,86],[270,86],[274,88],[275,88],[267,88],[269,88],[278,5],[279,5],[280,89],[281,5],[227,5],[282,5],[283,90],[284,91],[192,92],[78,5],[190,27],[188,93],[164,5],[208,5],[182,5],[197,94],[198,94],[165,5],[73,5],[217,43],[62,5],[63,95],[66,96],[64,5],[65,97],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[71,5],[94,98],[101,99],[93,98],[108,100],[85,101],[84,102],[107,103],[102,104],[105,105],[87,106],[86,107],[82,108],[81,109],[104,110],[83,111],[88,112],[89,5],[92,112],[79,5],[110,113],[109,112],[96,114],[97,115],[99,116],[95,117],[98,118],[103,103],[90,119],[91,120],[100,121],[80,122],[106,123],[70,124],[69,5],[74,125],[75,126],[72,5],[185,127],[184,128],[183,129],[215,130],[216,131],[194,132],[193,133],[200,134],[201,135],[206,136],[207,137],[209,138],[199,139]],"exportedModulesMap":[[214,1],[213,2],[212,3],[211,4],[210,5],[195,5],[196,6],[169,7],[171,8],[61,5],[163,9],[180,10],[172,11],[67,12],[170,13],[173,14],[174,13],[175,5],[176,11],[178,15],[177,16],[179,17],[68,18],[205,19],[202,20],[204,21],[203,22],[181,23],[167,24],[168,25],[166,24],[220,26],[187,27],[191,27],[189,27],[186,5],[222,28],[218,5],[223,5],[224,5],[225,5],[226,9],[228,29],[229,5],[230,5],[231,5],[221,5],[233,5],[234,30],[232,31],[76,32],[77,32],[112,33],[113,34],[114,35],[115,36],[116,37],[117,38],[118,39],[119,40],[120,41],[121,42],[122,42],[124,43],[123,44],[125,45],[126,46],[127,47],[111,48],[161,5],[128,49],[129,50],[130,51],[162,52],[131,53],[132,54],[133,55],[134,56],[135,57],[136,58],[137,59],[138,60],[139,61],[140,62],[141,62],[142,63],[143,64],[145,65],[144,66],[146,67],[147,68],[148,69],[149,70],[150,71],[151,72],[152,73],[153,74],[154,75],[155,76],[156,77],[157,78],[158,79],[159,80],[160,81],[235,5],[236,5],[219,31],[237,5],[262,82],[263,83],[238,84],[241,84],[260,82],[261,82],[251,82],[250,85],[248,82],[243,82],[256,82],[254,82],[258,82],[242,82],[255,82],[259,82],[244,82],[245,82],[257,82],[239,82],[246,82],[247,82],[249,82],[253,82],[264,86],[252,82],[240,82],[277,87],[276,5],[271,86],[273,88],[272,86],[265,86],[266,86],[268,86],[270,86],[274,88],[275,88],[267,88],[269,88],[278,5],[279,5],[280,89],[281,5],[227,5],[282,5],[283,90],[284,91],[192,92],[78,5],[190,27],[188,93],[164,5],[208,5],[182,5],[197,94],[198,94],[165,5],[73,5],[217,43],[62,5],[63,95],[66,96],[64,5],[65,97],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[71,5],[94,98],[101,99],[93,98],[108,100],[85,101],[84,102],[107,103],[102,104],[105,105],[87,106],[86,107],[82,108],[81,109],[104,110],[83,111],[88,112],[89,5],[92,112],[79,5],[110,113],[109,112],[96,114],[97,115],[99,116],[95,117],[98,118],[103,103],[90,119],[91,120],[100,121],[80,122],[106,123],[70,140],[74,141],[75,142],[185,143],[184,144],[183,145],[193,142],[206,146],[199,147]],"semanticDiagnosticsPerFile":[214,213,212,211,210,195,196,169,171,61,163,180,172,67,170,173,174,175,176,178,177,179,68,205,202,204,203,181,167,168,166,220,187,191,189,186,222,218,223,224,225,226,228,229,230,231,221,233,234,232,76,77,112,113,114,115,116,117,118,119,120,121,122,124,123,125,126,127,111,161,128,129,130,162,131,132,133,134,135,136,137,138,139,140,141,142,143,145,144,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,235,236,219,237,262,263,238,241,260,261,251,250,248,243,256,254,258,242,255,259,244,245,257,239,246,247,249,253,264,252,240,277,276,271,273,272,265,266,268,270,274,275,267,269,278,279,280,281,227,282,283,284,192,78,190,188,164,208,182,197,198,165,73,217,62,63,66,64,65,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,71,94,101,93,108,85,84,107,102,105,87,86,82,81,104,83,88,89,92,79,110,109,96,97,99,95,98,103,90,91,100,80,106,70,69,74,75,72,185,184,183,215,216,194,193,200,201,206,207,209,199],"latestChangedDtsFile":"./src/stream.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/package.json deleted file mode 100644 index 9b436b752..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/package.json +++ /dev/null @@ -1,191 +0,0 @@ -{ - "name": "@chainsafe/libp2p-yamux", - "version": "5.0.3", - "description": "Yamux stream multiplexer for libp2p", - "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/ChainSafe/js-libp2p-yamux#readme", - "repository": { - "type": "git", - "url": "git+https://github.com/ChainSafe/js-libp2p-yamux.git" - }, - "bugs": { - "url": "https://github.com/ChainSafe/js-libp2p-yamux/issues" - }, - "keywords": [ - "IPFS", - "libp2p", - "multiplexer", - "muxer", - "stream" - ], - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - }, - "type": "module", - "types": "./dist/src/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "*", - "dist/*", - "dist/src/*", - "dist/src/*/index" - ], - "src/*": [ - "*", - "dist/*", - "dist/src/*", - "dist/src/*/index" - ] - } - }, - "files": [ - "src", - "dist", - "!dist/test", - "!**/*.tsbuildinfo" - ], - "exports": { - ".": { - "types": "./dist/src/index.d.ts", - "import": "./dist/src/index.js" - }, - "./config": { - "types": "./dist/src/config.d.ts", - "import": "./dist/src/config.js" - }, - "./stream": { - "types": "./dist/src/stream.d.ts", - "import": "./dist/src/stream.js" - } - }, - "eslintConfig": { - "extends": "ipfs", - "parserOptions": { - "sourceType": "module" - }, - "ignorePatterns": [ - "src/*.d.ts" - ] - }, - "release": { - "branches": [ - "master" - ], - "plugins": [ - [ - "@semantic-release/commit-analyzer", - { - "preset": "conventionalcommits", - "releaseRules": [ - { - "breaking": true, - "release": "major" - }, - { - "revert": true, - "release": "patch" - }, - { - "type": "feat", - "release": "minor" - }, - { - "type": "fix", - "release": "patch" - }, - { - "type": "docs", - "release": "patch" - }, - { - "type": "test", - "release": "patch" - }, - { - "type": "deps", - "release": "patch" - }, - { - "scope": "no-release", - "release": false - } - ] - } - ], - [ - "@semantic-release/release-notes-generator", - { - "preset": "conventionalcommits", - "presetConfig": { - "types": [ - { - "type": "feat", - "section": "Features" - }, - { - "type": "fix", - "section": "Bug Fixes" - }, - { - "type": "chore", - "section": "Trivial Changes" - }, - { - "type": "docs", - "section": "Documentation" - }, - { - "type": "deps", - "section": "Dependencies" - }, - { - "type": "test", - "section": "Tests" - } - ] - } - } - ], - "@semantic-release/changelog", - "@semantic-release/npm", - "@semantic-release/github", - "@semantic-release/git" - ] - }, - "scripts": { - "clean": "aegir clean", - "lint": "aegir lint", - "dep-check": "aegir dep-check", - "benchmark": "benchmark dist/test/bench/*.bench.js --timeout 400000", - "build": "aegir build", - "test": "aegir test", - "test:chrome": "aegir test -t browser", - "test:chrome-webworker": "aegir test -t webworker", - "test:firefox": "aegir test -t browser -- --browser firefox", - "test:firefox-webworker": "aegir test -t webworker -- --browser firefox", - "test:node": "aegir test -t node --cov", - "test:electron-main": "aegir test -t electron-main", - "release": "aegir release", - "docs": "aegir docs" - }, - "dependencies": { - "@libp2p/interface": "next", - "@libp2p/logger": "next", - "get-iterator": "^2.0.1", - "it-foreach": "^2.0.3", - "it-pipe": "^3.0.1", - "it-pushable": "^3.2.0", - "uint8arraylist": "^2.4.3" - }, - "devDependencies": { - "@dapplion/benchmark": "^0.2.4", - "@libp2p/interface-compliance-tests": "next", - "@libp2p/mplex": "next", - "aegir": "^40.0.1", - "it-drain": "^3.0.2", - "it-pair": "^2.0.6", - "it-stream-types": "^2.0.1" - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/config.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/config.ts deleted file mode 100644 index 887e461f5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/config.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { logger, type Logger } from '@libp2p/logger' -import { ERR_INVALID_CONFIG, INITIAL_STREAM_WINDOW, MAX_STREAM_WINDOW } from './constants.js' - -// TOOD use config items or delete them -export interface Config { - /** - * Used to control the log destination - * - * It can be disabled by explicitly setting to `undefined` - */ - log?: Logger - - /** - * Used to do periodic keep alive messages using a ping. - */ - enableKeepAlive: boolean - - /** - * How often to perform the keep alive - * - * measured in milliseconds - */ - keepAliveInterval: number - - /** - * Maximum number of concurrent inbound streams that we accept. - * If the peer tries to open more streams, those will be reset immediately. - */ - maxInboundStreams: number - - /** - * Maximum number of concurrent outbound streams that we accept. - * If the application tries to open more streams, the call to `newStream` will throw - */ - maxOutboundStreams: number - - /** - * Used to control the initial window size that we allow for a stream. - * - * measured in bytes - */ - initialStreamWindowSize: number - - /** - * Used to control the maximum window size that we allow for a stream. - */ - maxStreamWindowSize: number - - /** - * Maximum size of a message that we'll send on a stream. - * This ensures that a single stream doesn't hog a connection. - */ - maxMessageSize: number -} - -export const defaultConfig: Config = { - log: logger('libp2p:yamux'), - enableKeepAlive: true, - keepAliveInterval: 30_000, - maxInboundStreams: 1_000, - maxOutboundStreams: 1_000, - initialStreamWindowSize: INITIAL_STREAM_WINDOW, - maxStreamWindowSize: MAX_STREAM_WINDOW, - maxMessageSize: 64 * 1024 -} - -export function verifyConfig (config: Config): void { - if (config.keepAliveInterval <= 0) { - throw new CodeError('keep-alive interval must be positive', ERR_INVALID_CONFIG) - } - if (config.maxInboundStreams < 0) { - throw new CodeError('max inbound streams must be larger or equal 0', ERR_INVALID_CONFIG) - } - if (config.maxOutboundStreams < 0) { - throw new CodeError('max outbound streams must be larger or equal 0', ERR_INVALID_CONFIG) - } - if (config.initialStreamWindowSize < INITIAL_STREAM_WINDOW) { - throw new CodeError('InitialStreamWindowSize must be larger or equal 256 kB', ERR_INVALID_CONFIG) - } - if (config.maxStreamWindowSize < config.initialStreamWindowSize) { - throw new CodeError('MaxStreamWindowSize must be larger than the InitialStreamWindowSize', ERR_INVALID_CONFIG) - } - if (config.maxStreamWindowSize > 2 ** 32 - 1) { - throw new CodeError('MaxStreamWindowSize must be less than equal MAX_UINT32', ERR_INVALID_CONFIG) - } - if (config.maxMessageSize < 1024) { - throw new CodeError('MaxMessageSize must be greater than a kilobyte', ERR_INVALID_CONFIG) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/constants.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/constants.ts deleted file mode 100644 index d28830008..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/constants.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Protocol violation errors - -export const ERR_INVALID_FRAME = 'ERR_INVALID_FRAME' -export const ERR_UNREQUESTED_PING = 'ERR_UNREQUESTED_PING' -export const ERR_NOT_MATCHING_PING = 'ERR_NOT_MATCHING_PING' -export const ERR_STREAM_ALREADY_EXISTS = 'ERR_STREAM_ALREADY_EXISTS' -export const ERR_DECODE_INVALID_VERSION = 'ERR_DECODE_INVALID_VERSION' -export const ERR_BOTH_CLIENTS = 'ERR_BOTH_CLIENTS' -export const ERR_RECV_WINDOW_EXCEEDED = 'ERR_RECV_WINDOW_EXCEEDED' - -export const PROTOCOL_ERRORS = new Set([ - ERR_INVALID_FRAME, - ERR_UNREQUESTED_PING, - ERR_NOT_MATCHING_PING, - ERR_STREAM_ALREADY_EXISTS, - ERR_DECODE_INVALID_VERSION, - ERR_BOTH_CLIENTS, - ERR_RECV_WINDOW_EXCEEDED -]) - -// local errors - -export const ERR_INVALID_CONFIG = 'ERR_INVALID_CONFIG' -export const ERR_MUXER_LOCAL_CLOSED = 'ERR_MUXER_LOCAL_CLOSED' -export const ERR_MUXER_REMOTE_CLOSED = 'ERR_MUXER_REMOTE_CLOSED' -export const ERR_STREAM_RESET = 'ERR_STREAM_RESET' -export const ERR_STREAM_ABORT = 'ERR_STREAM_ABORT' -export const ERR_MAX_OUTBOUND_STREAMS_EXCEEDED = 'ERROR_MAX_OUTBOUND_STREAMS_EXCEEDED' -export const ERR_DECODE_IN_PROGRESS = 'ERR_DECODE_IN_PROGRESS' - -/** - * INITIAL_STREAM_WINDOW is the initial stream window size. - * - * Not an implementation choice, this is defined in the specification - */ -export const INITIAL_STREAM_WINDOW = 256 * 1024 - -/** - * Default max stream window - */ -export const MAX_STREAM_WINDOW = 16 * 1024 * 1024 diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/decode.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/decode.ts deleted file mode 100644 index 8433f8f2c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/decode.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { Uint8ArrayList } from 'uint8arraylist' -import { ERR_DECODE_INVALID_VERSION, ERR_DECODE_IN_PROGRESS } from './constants.js' -import { type FrameHeader, FrameType, HEADER_LENGTH, YAMUX_VERSION } from './frame.js' -import type { Source } from 'it-stream-types' - -// used to bitshift in decoding -// native bitshift can overflow into a negative number, so we bitshift by multiplying by a power of 2 -const twoPow24 = 2 ** 24 - -/** - * Decode a header from the front of a buffer - * - * @param data - Assumed to have enough bytes for a header - */ -export function decodeHeader (data: Uint8Array): FrameHeader { - if (data[0] !== YAMUX_VERSION) { - throw new CodeError('Invalid frame version', ERR_DECODE_INVALID_VERSION) - } - return { - type: data[1], - flag: (data[2] << 8) + data[3], - streamID: (data[4] * twoPow24) + (data[5] << 16) + (data[6] << 8) + data[7], - length: (data[8] * twoPow24) + (data[9] << 16) + (data[10] << 8) + data[11] - } -} - -/** - * Decodes yamux frames from a source - */ -export class Decoder { - private readonly source: Source - /** Buffer for in-progress frames */ - private readonly buffer: Uint8ArrayList - /** Used to sanity check against decoding while in an inconsistent state */ - private frameInProgress: boolean - - constructor (source: Source) { - // Normally, when entering a for-await loop with an iterable/async iterable, the only ways to exit the loop are: - // 1. exhaust the iterable - // 2. throw an error - slow, undesirable if there's not actually an error - // 3. break or return - calls the iterable's `return` method, finalizing the iterable, no more iteration possible - // - // In this case, we want to enter (and exit) a for-await loop per chunked data frame and continue processing the iterable. - // To do this, we strip the `return` method from the iterator and can now `break` early and continue iterating. - // Exiting the main for-await is still possible via 1. and 2. - this.source = returnlessSource(source) - this.buffer = new Uint8ArrayList() - this.frameInProgress = false - } - - /** - * Emits frames from the decoder source. - * - * Note: If `readData` is emitted, it _must_ be called before the next iteration - * Otherwise an error is thrown - */ - async * emitFrames (): AsyncGenerator<{ header: FrameHeader, readData?: () => Promise }> { - for await (const chunk of this.source) { - this.buffer.append(chunk) - - // Loop to consume as many bytes from the buffer as possible - // Eg: when a single chunk contains several frames - while (true) { - const header = this.readHeader() - if (header === undefined) { - break - } - - const { type, length } = header - if (type === FrameType.Data) { - // This is a data frame, the frame body must still be read - // `readData` must be called before the next iteration here - this.frameInProgress = true - yield { - header, - readData: this.readBytes.bind(this, length) - } - } else { - yield { header } - } - } - } - } - - private readHeader (): FrameHeader | undefined { - // Sanity check to ensure a header isn't read when another frame is partially decoded - // In practice this shouldn't happen - if (this.frameInProgress) { - throw new CodeError('decoding frame already in progress', ERR_DECODE_IN_PROGRESS) - } - - if (this.buffer.length < HEADER_LENGTH) { - // not enough data yet - return - } - - const header = decodeHeader(this.buffer.subarray(0, HEADER_LENGTH)) - this.buffer.consume(HEADER_LENGTH) - return header - } - - private async readBytes (length: number): Promise { - if (this.buffer.length < length) { - for await (const chunk of this.source) { - this.buffer.append(chunk) - - if (this.buffer.length >= length) { - // see note above, the iterator is not `return`ed here - break - } - } - } - - const out = this.buffer.sublist(0, length) - this.buffer.consume(length) - - // The next frame can now be decoded - this.frameInProgress = false - - return out - } -} - -/** - * Strip the `return` method from a `Source` - */ -export function returnlessSource (source: Source): Source { - if ((source as Iterable)[Symbol.iterator] !== undefined) { - const iterator = (source as Iterable)[Symbol.iterator]() - iterator.return = undefined - return { - [Symbol.iterator] () { return iterator } - } - } else if ((source as AsyncIterable)[Symbol.asyncIterator] !== undefined) { - const iterator = (source as AsyncIterable)[Symbol.asyncIterator]() - iterator.return = undefined - return { - [Symbol.asyncIterator] () { return iterator } - } - } else { - throw new Error('a source must be either an iterable or an async iterable') - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/encode.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/encode.ts deleted file mode 100644 index 6353c0091..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/encode.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { HEADER_LENGTH } from './frame.js' -import type { FrameHeader } from './frame.js' - -export function encodeHeader (header: FrameHeader): Uint8Array { - const frame = new Uint8Array(HEADER_LENGTH) - - // always assume version 0 - // frameView.setUint8(0, header.version) - - frame[1] = header.type - - frame[2] = header.flag >>> 8 - frame[3] = header.flag - - frame[4] = header.streamID >>> 24 - frame[5] = header.streamID >>> 16 - frame[6] = header.streamID >>> 8 - frame[7] = header.streamID - - frame[8] = header.length >>> 24 - frame[9] = header.length >>> 16 - frame[10] = header.length >>> 8 - frame[11] = header.length - - return frame -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/frame.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/frame.ts deleted file mode 100644 index b9f41289e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/frame.ts +++ /dev/null @@ -1,64 +0,0 @@ -export enum FrameType { - /** Used to transmit data. May transmit zero length payloads depending on the flags. */ - Data = 0x0, - /** Used to updated the senders receive window size. This is used to implement per-session flow control. */ - WindowUpdate = 0x1, - /** Used to measure RTT. It can also be used to heart-beat and do keep-alives over TCP. */ - Ping = 0x2, - /** Used to close a session. */ - GoAway = 0x3, -} - -export enum Flag { - /** Signals the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate outbound. */ - SYN = 0x1, - /** Acknowledges the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate response. */ - ACK = 0x2, - /** Performs a half-close of a stream. May be sent with a data message or window update. */ - FIN = 0x4, - /** Reset a stream immediately. May be sent with a data or window update message. */ - RST = 0x8, -} - -const flagCodes = Object.values(Flag).filter((x) => typeof x !== 'string') as Flag[] - -export const YAMUX_VERSION = 0 - -export enum GoAwayCode { - NormalTermination = 0x0, - ProtocolError = 0x1, - InternalError = 0x2, -} - -export const HEADER_LENGTH = 12 - -export interface FrameHeader { - /** - * The version field is used for future backward compatibility. - * At the current time, the field is always set to 0, to indicate the initial version. - */ - version?: number - /** The type field is used to switch the frame message type. */ - type: FrameType - /** The flags field is used to provide additional information related to the message type. */ - flag: number - /** - * The StreamID field is used to identify the logical stream the frame is addressing. - * The client side should use odd ID's, and the server even. - * This prevents any collisions. Additionally, the 0 ID is reserved to represent the session. - */ - streamID: number - /** - * The meaning of the length field depends on the message type: - * * Data - provides the length of bytes following the header - * * Window update - provides a delta update to the window size - * * Ping - Contains an opaque value, echoed back - * * Go Away - Contains an error code - */ - length: number -} - -export function stringifyHeader (header: FrameHeader): string { - const flags = flagCodes.filter(f => (header.flag & f) === f).map(f => Flag[f]).join('|') - return `streamID=${header.streamID} type=${FrameType[header.type]} flag=${flags} length=${header.length}` -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/index.ts deleted file mode 100644 index ade3ad883..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Yamux } from './muxer.js' -import type { YamuxMuxerInit } from './muxer.js' -import type { StreamMuxerFactory } from '@libp2p/interface/stream-muxer' -export { GoAwayCode } from './frame.js' - -export function yamux (init: YamuxMuxerInit = {}): () => StreamMuxerFactory { - return () => new Yamux(init) -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/muxer.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/muxer.ts deleted file mode 100644 index 8b4d491ed..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/muxer.ts +++ /dev/null @@ -1,598 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { setMaxListeners } from '@libp2p/interface/events' -import { logger, type Logger } from '@libp2p/logger' -import { getIterator } from 'get-iterator' -import { pushable, type Pushable } from 'it-pushable' -import { type Config, defaultConfig, verifyConfig } from './config.js' -import { ERR_BOTH_CLIENTS, ERR_INVALID_FRAME, ERR_MAX_OUTBOUND_STREAMS_EXCEEDED, ERR_MUXER_LOCAL_CLOSED, ERR_MUXER_REMOTE_CLOSED, ERR_NOT_MATCHING_PING, ERR_STREAM_ALREADY_EXISTS, ERR_UNREQUESTED_PING, PROTOCOL_ERRORS } from './constants.js' -import { Decoder } from './decode.js' -import { encodeHeader } from './encode.js' -import { Flag, type FrameHeader, FrameType, GoAwayCode } from './frame.js' -import { StreamState, YamuxStream } from './stream.js' -import type { AbortOptions } from '@libp2p/interface' -import type { Stream } from '@libp2p/interface/connection' -import type { StreamMuxer, StreamMuxerFactory, StreamMuxerInit } from '@libp2p/interface/stream-muxer' -import type { Sink, Source } from 'it-stream-types' -import type { Uint8ArrayList } from 'uint8arraylist' - -const YAMUX_PROTOCOL_ID = '/yamux/1.0.0' -const CLOSE_TIMEOUT = 500 - -export interface YamuxMuxerInit extends StreamMuxerInit, Partial { -} - -export class Yamux implements StreamMuxerFactory { - protocol = YAMUX_PROTOCOL_ID - private readonly _init: YamuxMuxerInit - - constructor (init: YamuxMuxerInit = {}) { - this._init = init - } - - createStreamMuxer (init?: YamuxMuxerInit): YamuxMuxer { - return new YamuxMuxer({ - ...this._init, - ...init - }) - } -} - -export interface CloseOptions extends AbortOptions { - reason?: GoAwayCode -} - -export class YamuxMuxer implements StreamMuxer { - protocol = YAMUX_PROTOCOL_ID - source: Pushable - sink: Sink, Promise> - - private readonly config: Config - private readonly log?: Logger - - /** Used to close the muxer from either the sink or source */ - private readonly closeController: AbortController - - /** The next stream id to be used when initiating a new stream */ - private nextStreamID: number - /** Primary stream mapping, streamID => stream */ - private readonly _streams: Map - - /** The next ping id to be used when pinging */ - private nextPingID: number - /** Tracking info for the currently active ping */ - private activePing?: { id: number, promise: Promise, resolve: () => void } - /** Round trip time */ - private rtt: number - - /** True if client, false if server */ - private readonly client: boolean - - private localGoAway?: GoAwayCode - private remoteGoAway?: GoAwayCode - - /** Number of tracked inbound streams */ - private numInboundStreams: number - /** Number of tracked outbound streams */ - private numOutboundStreams: number - - private readonly onIncomingStream?: (stream: Stream) => void - private readonly onStreamEnd?: (stream: Stream) => void - - constructor (init: YamuxMuxerInit) { - this.client = init.direction === 'outbound' - this.config = { ...defaultConfig, ...init } - this.log = this.config.log - verifyConfig(this.config) - - this.closeController = new AbortController() - setMaxListeners(Infinity, this.closeController.signal) - - this.onIncomingStream = init.onIncomingStream - this.onStreamEnd = init.onStreamEnd - - this._streams = new Map() - - this.source = pushable({ - onEnd: (): void => { - this.log?.trace('muxer source ended') - - this._streams.forEach(stream => { - stream.destroy() - }) - } - }) - - this.sink = async (source: Source): Promise => { - const shutDownListener = (): void => { - const iterator = getIterator(source) - - if (iterator.return != null) { - const res = iterator.return() - - if (isPromise(res)) { - res.catch(err => { - this.log?.('could not cause sink source to return', err) - }) - } - } - } - - let reason, error - try { - const decoder = new Decoder(source) - - try { - this.closeController.signal.addEventListener('abort', shutDownListener) - - for await (const frame of decoder.emitFrames()) { - await this.handleFrame(frame.header, frame.readData) - } - } finally { - this.closeController.signal.removeEventListener('abort', shutDownListener) - } - - reason = GoAwayCode.NormalTermination - } catch (err: unknown) { - // either a protocol or internal error - const errCode = (err as { code: string }).code - if (PROTOCOL_ERRORS.has(errCode)) { - this.log?.error('protocol error in sink', err) - reason = GoAwayCode.ProtocolError - } else { - this.log?.error('internal error in sink', err) - reason = GoAwayCode.InternalError - } - - error = err as Error - } - - this.log?.trace('muxer sink ended') - - if (error != null) { - this.abort(error, reason) - } else { - await this.close({ reason }) - } - } - - this.numInboundStreams = 0 - this.numOutboundStreams = 0 - - // client uses odd streamIDs, server uses even streamIDs - this.nextStreamID = this.client ? 1 : 2 - - this.nextPingID = 0 - this.rtt = -1 - - this.log?.trace('muxer created') - - if (this.config.enableKeepAlive) { - this.keepAliveLoop().catch(e => this.log?.error('keepalive error: %s', e)) - } - - // send an initial ping to establish RTT - this.ping().catch(e => this.log?.error('ping error: %s', e)) - } - - get streams (): YamuxStream[] { - return Array.from(this._streams.values()) - } - - newStream (name?: string | undefined): YamuxStream { - if (this.remoteGoAway !== undefined) { - throw new CodeError('muxer closed remotely', ERR_MUXER_REMOTE_CLOSED) - } - if (this.localGoAway !== undefined) { - throw new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED) - } - - const id = this.nextStreamID - this.nextStreamID += 2 - - // check against our configured maximum number of outbound streams - if (this.numOutboundStreams >= this.config.maxOutboundStreams) { - throw new CodeError('max outbound streams exceeded', ERR_MAX_OUTBOUND_STREAMS_EXCEEDED) - } - - this.log?.trace('new outgoing stream id=%s', id) - - const stream = this._newStream(id, name, StreamState.Init, 'outbound') - this._streams.set(id, stream) - - this.numOutboundStreams++ - - // send a window update to open the stream on the receiver end - stream.sendWindowUpdate() - - return stream - } - - /** - * Initiate a ping and wait for a response - * - * Note: only a single ping will be initiated at a time. - * If a ping is already in progress, a new ping will not be initiated. - * - * @returns the round-trip-time in milliseconds - */ - async ping (): Promise { - if (this.remoteGoAway !== undefined) { - throw new CodeError('muxer closed remotely', ERR_MUXER_REMOTE_CLOSED) - } - if (this.localGoAway !== undefined) { - throw new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED) - } - - // An active ping does not yet exist, handle the process here - if (this.activePing === undefined) { - // create active ping - let _resolve = (): void => {} - this.activePing = { - id: this.nextPingID++, - // this promise awaits resolution or the close controller aborting - promise: new Promise((resolve, reject) => { - const closed = (): void => { - reject(new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED)) - } - this.closeController.signal.addEventListener('abort', closed, { once: true }) - _resolve = (): void => { - this.closeController.signal.removeEventListener('abort', closed) - resolve() - } - }), - resolve: _resolve - } - // send ping - const start = Date.now() - this.sendPing(this.activePing.id) - // await pong - try { - await this.activePing.promise - } finally { - // clean-up active ping - delete this.activePing - } - // update rtt - const end = Date.now() - this.rtt = end - start - } else { - // an active ping is already in progress, piggyback off that - await this.activePing.promise - } - return this.rtt - } - - /** - * Get the ping round trip time - * - * Note: Will return 0 if no successful ping has yet been completed - * - * @returns the round-trip-time in milliseconds - */ - getRTT (): number { - return this.rtt - } - - /** - * Close the muxer - */ - async close (options: CloseOptions = {}): Promise { - if (this.closeController.signal.aborted) { - // already closed - return - } - - const reason = options?.reason ?? GoAwayCode.NormalTermination - - this.log?.trace('muxer close reason=%s', reason) - - if (options.signal == null) { - const signal = AbortSignal.timeout(CLOSE_TIMEOUT) - setMaxListeners(Infinity, signal) - - options = { - ...options, - signal - } - } - - try { - await Promise.all( - [...this._streams.values()].map(async s => s.close(options)) - ) - - // send reason to the other side, allow the other side to close gracefully - this.sendGoAway(reason) - - this._closeMuxer() - } catch (err: any) { - this.abort(err) - } - } - - abort (err: Error, reason?: GoAwayCode): void { - if (this.closeController.signal.aborted) { - // already closed - return - } - - reason = reason ?? GoAwayCode.InternalError - - // If reason was provided, use that, otherwise use the presence of `err` to determine the reason - this.log?.error('muxer abort reason=%s error=%s', reason, err) - - // Abort all underlying streams - for (const stream of this._streams.values()) { - stream.abort(err) - } - - // send reason to the other side, allow the other side to close gracefully - this.sendGoAway(reason) - - this._closeMuxer() - } - - isClosed (): boolean { - return this.closeController.signal.aborted - } - - /** - * Called when either the local or remote shuts down the muxer - */ - private _closeMuxer (): void { - // stop the sink and any other processes - this.closeController.abort() - - // stop the source - this.source.end() - } - - /** Create a new stream */ - private _newStream (id: number, name: string | undefined, state: StreamState, direction: 'inbound' | 'outbound'): YamuxStream { - if (this._streams.get(id) != null) { - throw new CodeError('Stream already exists', ERR_STREAM_ALREADY_EXISTS, { id }) - } - - const stream = new YamuxStream({ - id: id.toString(), - name, - state, - direction, - sendFrame: this.sendFrame.bind(this), - onEnd: () => { - this.closeStream(id) - this.onStreamEnd?.(stream) - }, - log: logger(`libp2p:yamux:${direction}:${id}`), - config: this.config, - getRTT: this.getRTT.bind(this) - }) - - return stream - } - - /** - * closeStream is used to close a stream once both sides have - * issued a close. - */ - private closeStream (id: number): void { - if (this.client === (id % 2 === 0)) { - this.numInboundStreams-- - } else { - this.numOutboundStreams-- - } - this._streams.delete(id) - } - - private async keepAliveLoop (): Promise { - const abortPromise = new Promise((_resolve, reject) => { this.closeController.signal.addEventListener('abort', reject, { once: true }) }) - this.log?.trace('muxer keepalive enabled interval=%s', this.config.keepAliveInterval) - while (true) { - let timeoutId - try { - await Promise.race([ - abortPromise, - new Promise((resolve) => { - timeoutId = setTimeout(resolve, this.config.keepAliveInterval) - }) - ]) - this.ping().catch(e => this.log?.error('ping error: %s', e)) - } catch (e) { - // closed - clearInterval(timeoutId) - return - } - } - } - - private async handleFrame (header: FrameHeader, readData?: () => Promise): Promise { - const { - streamID, - type, - length - } = header - this.log?.trace('received frame %o', header) - - if (streamID === 0) { - switch (type) { - case FrameType.Ping: - { this.handlePing(header); return } - case FrameType.GoAway: - { this.handleGoAway(length); return } - default: - // Invalid state - throw new CodeError('Invalid frame type', ERR_INVALID_FRAME, { header }) - } - } else { - switch (header.type) { - case FrameType.Data: - case FrameType.WindowUpdate: - { await this.handleStreamMessage(header, readData); return } - default: - // Invalid state - throw new CodeError('Invalid frame type', ERR_INVALID_FRAME, { header }) - } - } - } - - private handlePing (header: FrameHeader): void { - // If the ping is initiated by the sender, send a response - if (header.flag === Flag.SYN) { - this.log?.trace('received ping request pingId=%s', header.length) - this.sendPing(header.length, Flag.ACK) - } else if (header.flag === Flag.ACK) { - this.log?.trace('received ping response pingId=%s', header.length) - this.handlePingResponse(header.length) - } else { - // Invalid state - throw new CodeError('Invalid frame flag', ERR_INVALID_FRAME, { header }) - } - } - - private handlePingResponse (pingId: number): void { - if (this.activePing === undefined) { - // this ping was not requested - throw new CodeError('ping not requested', ERR_UNREQUESTED_PING) - } - if (this.activePing.id !== pingId) { - // this ping doesn't match our active ping request - throw new CodeError('ping doesn\'t match our id', ERR_NOT_MATCHING_PING) - } - - // valid ping response - this.activePing.resolve() - } - - private handleGoAway (reason: GoAwayCode): void { - this.log?.trace('received GoAway reason=%s', GoAwayCode[reason] ?? 'unknown') - this.remoteGoAway = reason - - // If the other side is friendly, they would have already closed all streams before sending a GoAway - // In case they weren't, reset all streams - for (const stream of this._streams.values()) { - stream.reset() - } - - this._closeMuxer() - } - - private async handleStreamMessage (header: FrameHeader, readData?: () => Promise): Promise { - const { streamID, flag, type } = header - - if ((flag & Flag.SYN) === Flag.SYN) { - this.incomingStream(streamID) - } - - const stream = this._streams.get(streamID) - if (stream === undefined) { - if (type === FrameType.Data) { - this.log?.('discarding data for stream id=%s', streamID) - if (readData === undefined) { - throw new Error('unreachable') - } - await readData() - } else { - this.log?.('frame for missing stream id=%s', streamID) - } - return - } - - switch (type) { - case FrameType.WindowUpdate: { - stream.handleWindowUpdate(header); return - } - case FrameType.Data: { - if (readData === undefined) { - throw new Error('unreachable') - } - - await stream.handleData(header, readData); return - } - default: - throw new Error('unreachable') - } - } - - private incomingStream (id: number): void { - if (this.client !== (id % 2 === 0)) { - throw new CodeError('both endpoints are clients', ERR_BOTH_CLIENTS) - } - if (this._streams.has(id)) { - return - } - - this.log?.trace('new incoming stream id=%s', id) - - if (this.localGoAway !== undefined) { - // reject (reset) immediately if we are doing a go away - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: id, - length: 0 - }); return - } - - // check against our configured maximum number of inbound streams - if (this.numInboundStreams >= this.config.maxInboundStreams) { - this.log?.('maxIncomingStreams exceeded, forcing stream reset') - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: id, - length: 0 - }); return - } - - // allocate a new stream - const stream = this._newStream(id, undefined, StreamState.SYNReceived, 'inbound') - - this.numInboundStreams++ - // the stream should now be tracked - this._streams.set(id, stream) - - this.onIncomingStream?.(stream) - } - - private sendFrame (header: FrameHeader, data?: Uint8ArrayList): void { - this.log?.trace('sending frame %o', header) - if (header.type === FrameType.Data) { - if (data === undefined) { - throw new CodeError('invalid frame', ERR_INVALID_FRAME) - } - this.source.push(encodeHeader(header)) - this.source.push(data) - } else { - this.source.push(encodeHeader(header)) - } - } - - private sendPing (pingId: number, flag: Flag = Flag.SYN): void { - if (flag === Flag.SYN) { - this.log?.trace('sending ping request pingId=%s', pingId) - } else { - this.log?.trace('sending ping response pingId=%s', pingId) - } - this.sendFrame({ - type: FrameType.Ping, - flag, - streamID: 0, - length: pingId - }) - } - - private sendGoAway (reason: GoAwayCode = GoAwayCode.NormalTermination): void { - this.log?.('sending GoAway reason=%s', GoAwayCode[reason]) - this.localGoAway = reason - this.sendFrame({ - type: FrameType.GoAway, - flag: 0, - streamID: 0, - length: reason - }) - } -} - -function isPromise (thing: any): thing is Promise { - return thing != null && typeof thing.then === 'function' -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/stream.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/stream.ts deleted file mode 100644 index a87737caa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down-nagle/yamux/src/stream.ts +++ /dev/null @@ -1,302 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { AbstractStream, type AbstractStreamInit } from '@libp2p/utils/abstract-stream' -import each from 'it-foreach' -import { ERR_RECV_WINDOW_EXCEEDED, ERR_STREAM_ABORT, INITIAL_STREAM_WINDOW } from './constants.js' -import { Flag, type FrameHeader, FrameType, HEADER_LENGTH } from './frame.js' -import type { Config } from './config.js' -import type { AbortOptions } from '@libp2p/interface' -import type { Uint8ArrayList } from 'uint8arraylist' - -export enum StreamState { - Init, - SYNSent, - SYNReceived, - Established, - Finished, -} - -export interface YamuxStreamInit extends AbstractStreamInit { - name?: string - sendFrame: (header: FrameHeader, body?: Uint8ArrayList) => void - getRTT: () => number - config: Config - state: StreamState -} - -/** YamuxStream is used to represent a logical stream within a session */ -export class YamuxStream extends AbstractStream { - name?: string - state: StreamState - - private readonly config: Config - private readonly _id: number - - /** The number of available bytes to send */ - private sendWindowCapacity: number - /** Callback to notify that the sendWindowCapacity has been updated */ - private sendWindowCapacityUpdate?: () => void - - /** The number of bytes available to receive in a full window */ - private recvWindow: number - /** The number of available bytes to receive */ - private recvWindowCapacity: number - - /** - * An 'epoch' is the time it takes to process and read data - * - * Used in conjunction with RTT to determine whether to increase the recvWindow - */ - private epochStart: number - private readonly getRTT: () => number - - private readonly sendFrame: (header: FrameHeader, body?: Uint8ArrayList) => void - - constructor (init: YamuxStreamInit) { - super({ - ...init, - onEnd: (err?: Error) => { - this.state = StreamState.Finished - init.onEnd?.(err) - } - }) - - this.config = init.config - this._id = parseInt(init.id, 10) - this.name = init.name - this.state = init.state - this.sendWindowCapacity = INITIAL_STREAM_WINDOW - this.recvWindow = this.config.initialStreamWindowSize - this.recvWindowCapacity = this.recvWindow - this.epochStart = Date.now() - this.getRTT = init.getRTT - - this.sendFrame = init.sendFrame - - this.source = each(this.source, () => { - this.sendWindowUpdate() - }) - } - - /** - * Send a message to the remote muxer informing them a new stream is being - * opened. - * - * This is a noop for Yamux because the first window update is sent when - * .newStream is called on the muxer which opens the stream on the remote. - */ - async sendNewStream (): Promise { - - } - - /** - * Send a data message to the remote muxer - */ - async sendData (buf: Uint8ArrayList, options: AbortOptions = {}): Promise { - buf = buf.sublist() - - // send in chunks, waiting for window updates - while (buf.byteLength !== 0) { - // wait for the send window to refill - if (this.sendWindowCapacity === 0) { - await this.waitForSendWindowCapacity(options) - } - - // check we didn't close while waiting for send window capacity - if (this.status !== 'open') { - return - } - - // send as much as we can - const toSend = Math.min(this.sendWindowCapacity, this.config.maxMessageSize - HEADER_LENGTH, buf.length) - const flags = this.getSendFlags() - - this.sendFrame({ - type: FrameType.Data, - flag: flags, - streamID: this._id, - length: toSend - }, buf.sublist(0, toSend)) - - this.sendWindowCapacity -= toSend - - buf.consume(toSend) - } - } - - /** - * Send a reset message to the remote muxer - */ - async sendReset (): Promise { - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: this._id, - length: 0 - }) - } - - /** - * Send a message to the remote muxer, informing them no more data messages - * will be sent by this end of the stream - */ - async sendCloseWrite (): Promise { - const flags = this.getSendFlags() | Flag.FIN - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: flags, - streamID: this._id, - length: 0 - }) - } - - /** - * Send a message to the remote muxer, informing them no more data messages - * will be read by this end of the stream - */ - async sendCloseRead (): Promise { - - } - - /** - * Wait for the send window to be non-zero - * - * Will throw with ERR_STREAM_ABORT if the stream gets aborted - */ - async waitForSendWindowCapacity (options: AbortOptions = {}): Promise { - if (this.sendWindowCapacity > 0) { - return - } - - let resolve: () => void - let reject: (err: Error) => void - const abort = (): void => { - if (this.status === 'open') { - reject(new CodeError('stream aborted', ERR_STREAM_ABORT)) - } else { - // the stream was closed already, ignore the failure to send - resolve() - } - } - options.signal?.addEventListener('abort', abort) - - try { - await new Promise((_resolve, _reject) => { - this.sendWindowCapacityUpdate = () => { - _resolve() - } - reject = _reject - resolve = _resolve - }) - } finally { - options.signal?.removeEventListener('abort', abort) - } - } - - /** - * handleWindowUpdate is called when the stream receives a window update frame - */ - handleWindowUpdate (header: FrameHeader): void { - this.log?.trace('stream received window update id=%s', this._id) - this.processFlags(header.flag) - - // increase send window - const available = this.sendWindowCapacity - this.sendWindowCapacity += header.length - // if the update increments a 0 availability, notify the stream that sending can resume - if (available === 0 && header.length > 0) { - this.sendWindowCapacityUpdate?.() - } - } - - /** - * handleData is called when the stream receives a data frame - */ - async handleData (header: FrameHeader, readData: () => Promise): Promise { - this.log?.trace('stream received data id=%s', this._id) - this.processFlags(header.flag) - - // check that our recv window is not exceeded - if (this.recvWindowCapacity < header.length) { - throw new CodeError('receive window exceeded', ERR_RECV_WINDOW_EXCEEDED, { available: this.recvWindowCapacity, recv: header.length }) - } - - const data = await readData() - this.recvWindowCapacity -= header.length - - this.sourcePush(data) - } - - /** - * processFlags is used to update the state of the stream based on set flags, if any. - */ - private processFlags (flags: number): void { - if ((flags & Flag.ACK) === Flag.ACK) { - if (this.state === StreamState.SYNSent) { - this.state = StreamState.Established - } - } - if ((flags & Flag.FIN) === Flag.FIN) { - this.remoteCloseWrite() - } - if ((flags & Flag.RST) === Flag.RST) { - this.reset() - } - } - - /** - * getSendFlags determines any flags that are appropriate - * based on the current stream state. - * - * The state is updated as a side-effect. - */ - private getSendFlags (): number { - switch (this.state) { - case StreamState.Init: - this.state = StreamState.SYNSent - return Flag.SYN - case StreamState.SYNReceived: - this.state = StreamState.Established - return Flag.ACK - default: - return 0 - } - } - - /** - * potentially sends a window update enabling further writes to take place. - */ - sendWindowUpdate (): void { - // determine the flags if any - const flags = this.getSendFlags() - - // If the stream has already been established - // and we've processed data within the time it takes for 4 round trips - // then we (up to) double the recvWindow - const now = Date.now() - const rtt = this.getRTT() - if (flags === 0 && rtt > -1 && now - this.epochStart < rtt * 4) { - // we've already validated that maxStreamWindowSize can't be more than MAX_UINT32 - this.recvWindow = Math.min(this.recvWindow * 2, this.config.maxStreamWindowSize) - } - - if (this.recvWindowCapacity >= this.recvWindow && flags === 0) { - // a window update isn't needed - return - } - - // update the receive window - const delta = this.recvWindow - this.recvWindowCapacity - this.recvWindowCapacity = this.recvWindow - - // update the epoch start - this.epochStart = now - - // send window update - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: flags, - streamID: this._id, - length: delta - }) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/index.min.js index 0beb5085b..cd5ccfacd 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/index.min.js +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/index.min.js @@ -12,7 +12,7 @@ `,r};q0.decode=function(t){for(var e=[],r=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,n=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,i=/\r?\n/,s;s=r.exec(t),!!s;){var o=s[1];o==="NEW CERTIFICATE REQUEST"&&(o="CERTIFICATE REQUEST");var a={type:o,procType:null,contentDomain:null,dekInfo:null,headers:[],body:Bi.util.decode64(s[3])};if(e.push(a),!!s[2]){for(var c=s[2].split(i),f=0;s&&f65&&o!==-1){var a=e[o];a===","?(++o,e=e.substr(0,o)+`\r `+e.substr(o)):e=e.substr(0,o)+`\r -`+a+e.substr(o+1),s=i-o-1,o=-1,++i}else(e[i]===" "||e[i]===" "||e[i]===",")&&(o=i);return e}function Sl(t){return t.replace(/^\s+/,"")}});var Q0=ht((C2,X0)=>{var ye=lt();cr();Bt();var W0=X0.exports=ye.sha256=ye.sha256||{};ye.md.sha256=ye.md.algorithms.sha256=W0;W0.create=function(){Y0||Bl();var t=null,e=ye.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),$0(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=ye.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(Ws.substr(0,n.blockLength-o));for(var a,c,f=n.fullMessageLength[0]*8,u=0;u>>0,f+=c,i.putInt32(f>>>0),f=a>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};$0(h,r,i);var l=ye.util.createBuffer();return l.putInt32(h.h0),l.putInt32(h.h1),l.putInt32(h.h2),l.putInt32(h.h3),l.putInt32(h.h4),l.putInt32(h.h5),l.putInt32(h.h6),l.putInt32(h.h7),l},n};var Ws=null,Y0=!1,Z0=null;function Bl(){Ws="\x80",Ws+=ye.util.fillString("\0",64),Z0=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Y0=!0}function $0(t,e,r){for(var n,i,s,o,a,c,f,u,h,l,g,d,p,y,x,v=r.length();v>=64;){for(f=0;f<16;++f)e[f]=r.getInt32();for(;f<64;++f)n=e[f-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=e[f-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[f]=n+e[f-7]+i+e[f-16]|0;for(u=t.h0,h=t.h1,l=t.h2,g=t.h3,d=t.h4,p=t.h5,y=t.h6,x=t.h7,f=0;f<64;++f)o=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),a=y^d&(p^y),s=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),c=u&h|l&(u^h),n=x+o+a+Z0[f]+e[f],i=s+c,x=y,y=p,p=d,d=g+n>>>0,g=l,l=h,h=u,u=n+i>>>0;t.h0=t.h0+u|0,t.h1=t.h1+h|0,t.h2=t.h2+l|0,t.h3=t.h3+g|0,t.h4=t.h4+d|0,t.h5=t.h5+p|0,t.h6=t.h6+y|0,t.h7=t.h7+x|0,v-=64}}});var j0=ht((I2,J0)=>{var ge=lt();Bt();var Ai=null;ge.util.isNodejs&&!ge.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Ai=Ei());var Al=J0.exports=ge.prng=ge.prng||{};Al.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();e.pools=n,e.pool=0,e.generate=function(f,u){if(!u)return e.generateSync(f);var h=e.plugin.cipher,l=e.plugin.increment,g=e.plugin.formatKey,d=e.plugin.formatSeed,p=ge.util.createBuffer();e.key=null,y();function y(x){if(x)return u(x);if(p.length()>=f)return u(null,p.getBytes(f));if(e.generated>1048575&&(e.key=null),e.key===null)return ge.util.nextTick(function(){s(y)});var v=h(e.key,e.seed);e.generated+=v.length,p.putBytes(v),e.key=g(h(e.key,l(e.seed))),e.seed=d(h(e.key,e.seed)),ge.util.setImmediate(y)}},e.generateSync=function(f){var u=e.plugin.cipher,h=e.plugin.increment,l=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var d=ge.util.createBuffer();d.length()1048575&&(e.key=null),e.key===null&&o();var p=u(e.key,e.seed);e.generated+=p.length,d.putBytes(p),e.key=l(u(e.key,h(e.seed))),e.seed=g(u(e.key,e.seed))}return d.getBytes(f)};function s(f){if(e.pools[0].messageLength>=32)return a(),f();var u=32-e.pools[0].messageLength<<5;e.seedFile(u,function(h,l){if(h)return f(h);e.collect(l),a(),f()})}function o(){if(e.pools[0].messageLength>=32)return a();var f=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(f)),a()}function a(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var f=e.plugin.md.create();f.update(e.keyBytes);for(var u=1,h=0;h<32;++h)e.reseeds%u===0&&(f.update(e.pools[h].digest().getBytes()),e.pools[h].start()),u=u<<1;e.keyBytes=f.digest().getBytes(),f.start(),f.update(e.keyBytes);var l=f.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(l),e.generated=0}function c(f){var u=null,h=ge.util.globalScope,l=h.crypto||h.msCrypto;l&&l.getRandomValues&&(u=function(S){return l.getRandomValues(S)});var g=ge.util.createBuffer();if(u)for(;g.length()>16),v+=(x&32767)<<16,v+=x>>15,v=(v&2147483647)+(v>>31),A=v&4294967295;for(var y=0;y<3;++y)m=A>>>(y<<3),m^=Math.floor(Math.random()*256),g.putByte(m&255)}return g.getBytes(f)}return Ai?(e.seedFile=function(f,u){Ai.randomBytes(f,function(h,l){if(h)return u(h);u(null,l.toString())})},e.seedFileSync=function(f){return Ai.randomBytes(f).toString()}):(e.seedFile=function(f,u){try{u(null,c(f))}catch(h){u(h)}},e.seedFileSync=c),e.collect=function(f){for(var u=f.length,h=0;h>l&255);e.collect(h)},e.registerWorker=function(f){if(f===self)e.seedFile=function(h,l){function g(d){var p=d.data;p.forge&&p.forge.prng&&(self.removeEventListener("message",g),l(p.forge.prng.err,p.forge.prng.bytes))}self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:h}}})};else{var u=function(h){var l=h.data;l.forge&&l.forge.prng&&e.seedFile(l.forge.prng.needed,function(g,d){f.postMessage({forge:{prng:{err:g,bytes:d}}})})};f.addEventListener("message",u)}},e}});var bn=ht((T2,Ys)=>{var kt=lt();$s();Q0();j0();Bt();(function(){if(kt.random&&kt.random.getBytes){Ys.exports=kt.random;return}(function(t){var e={},r=new Array(4),n=kt.util.createBuffer();e.formatKey=function(h){var l=kt.util.createBuffer(h);return h=new Array(4),h[0]=l.getInt32(),h[1]=l.getInt32(),h[2]=l.getInt32(),h[3]=l.getInt32(),kt.aes._expandKey(h,!1)},e.formatSeed=function(h){var l=kt.util.createBuffer(h);return h=new Array(4),h[0]=l.getInt32(),h[1]=l.getInt32(),h[2]=l.getInt32(),h[3]=l.getInt32(),h},e.cipher=function(h,l){return kt.aes._updateBlock(h,l,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=kt.md.sha256;function i(){var h=kt.prng.create(e);return h.getBytes=function(l,g){return h.generate(l,g)},h.getBytesSync=function(l){return h.generate(l)},h}var s=i(),o=null,a=kt.util.globalScope,c=a.crypto||a.msCrypto;if(c&&c.getRandomValues&&(o=function(h){return c.getRandomValues(h)}),kt.options.usePureJavaScript||!kt.util.isNodejs&&!o){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var f="";for(var u in navigator)try{typeof navigator[u]=="string"&&(f+=navigator[u])}catch{}s.collect(f),f=null}t&&(t().mousemove(function(h){s.collectInt(h.clientX,16),s.collectInt(h.clientY,16)}),t().keypress(function(h){s.collectInt(h.charCode,8)}))}if(!kt.random)kt.random=s;else for(var u in s)kt.random[u]=s[u];kt.random.createInstance=i,Ys.exports=kt.random})(typeof jQuery<"u"?jQuery:null)})()});var nc=ht((_2,rc)=>{var Yt=lt();Bt();var Zs=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],tc=[1,2,3,5],Cl=function(t,e){return t<>16-e},Il=function(t,e){return(t&65535)>>e|t<<16-e&65535};rc.exports=Yt.rc2=Yt.rc2||{};Yt.rc2.expandKey=function(t,e){typeof t=="string"&&(t=Yt.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),i=e,s=Math.ceil(i/8),o=255>>(i&7),a;for(a=n;a<128;a++)r.putByte(Zs[r.at(a-1)+r.at(a-n)&255]);for(r.setAt(128-s,Zs[r.at(128-s)&o]),a=127-s;a>=0;a--)r.setAt(a,Zs[r.at(a+1)^r.at(a+s)]);return r};var ec=function(t,e,r){var n=!1,i=null,s=null,o=null,a,c,f,u,h=[];for(t=Yt.rc2.expandKey(t,e),f=0;f<64;f++)h.push(t.getInt16Le());r?(a=function(d){for(f=0;f<4;f++)d[f]+=h[u]+(d[(f+3)%4]&d[(f+2)%4])+(~d[(f+3)%4]&d[(f+1)%4]),d[f]=Cl(d[f],tc[f]),u++},c=function(d){for(f=0;f<4;f++)d[f]+=h[d[(f+3)%4]&63]}):(a=function(d){for(f=3;f>=0;f--)d[f]=Il(d[f],tc[f]),d[f]-=h[u]+(d[(f+3)%4]&d[(f+2)%4])+(~d[(f+3)%4]&d[(f+1)%4]),u--},c=function(d){for(f=3;f>=0;f--)d[f]-=h[d[(f+3)%4]&63]});var l=function(d){var p=[];for(f=0;f<4;f++){var y=i.getInt16Le();o!==null&&(r?y^=o.getInt16Le():o.putInt16Le(y)),p.push(y&65535)}u=r?0:63;for(var x=0;x=8;)l([[5,a],[1,c],[6,a],[1,c],[5,a]])},finish:function(d){var p=!0;if(r)if(d)p=d(8,i,!r);else{var y=i.length()===8?8:8-i.length();i.fillWithByte(y,y)}if(p&&(n=!0,g.update()),!r&&(p=i.length()===0,p))if(d)p=d(8,s,!r);else{var x=s.length(),v=s.at(x-1);v>x?p=!1:s.truncate(v)}return p}},g};Yt.rc2.startEncrypting=function(t,e,r){var n=Yt.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};Yt.rc2.createEncryptionCipher=function(t,e){return ec(t,e,!0)};Yt.rc2.startDecrypting=function(t,e,r){var n=Yt.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};Yt.rc2.createDecryptionCipher=function(t,e){return ec(t,e,!1)}});var Ti=ht((L2,hc)=>{var Xs=lt();hc.exports=Xs.jsbn=Xs.jsbn||{};var De,Tl=0xdeadbeefcafe,ic=(Tl&16777215)==15715070;function D(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}Xs.jsbn.BigInteger=D;function ot(){return new D(null)}function _l(t,e,r,n,i,s){for(;--s>=0;){var o=e*this.data[t++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=o&67108863}return i}function Ll(t,e,r,n,i,s){for(var o=e&32767,a=e>>15;--s>=0;){var c=this.data[t]&32767,f=this.data[t++]>>15,u=a*c+f*o;c=o*c+((u&32767)<<15)+r.data[n]+(i&1073741823),i=(c>>>30)+(u>>>15)+a*f+(i>>>30),r.data[n++]=c&1073741823}return i}function sc(t,e,r,n,i,s){for(var o=e&16383,a=e>>14;--s>=0;){var c=this.data[t]&16383,f=this.data[t++]>>14,u=a*c+f*o;c=o*c+((u&16383)<<14)+r.data[n]+i,i=(c>>28)+(u>>14)+a*f,r.data[n++]=c&268435455}return i}typeof navigator>"u"?(D.prototype.am=sc,De=28):ic&&navigator.appName=="Microsoft Internet Explorer"?(D.prototype.am=Ll,De=30):ic&&navigator.appName!="Netscape"?(D.prototype.am=_l,De=26):(D.prototype.am=sc,De=28);D.prototype.DB=De;D.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function Dl(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}function Ye(t){var e=ot();return e.fromInt(t),e}function kl(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,i=!1,s=0;--n>=0;){var o=r==8?t[n]&255:ac(t,n);if(o<0){t.charAt(n)=="-"&&(i=!0);continue}i=!1,s==0?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB)}r==8&&t[0]&128&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}function Ul(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(a>a)>0&&(i=!0,s=oc(n));o>=0;)a>(a+=this.DB-e)):(n=this.data[o]>>(a-=e)&r,a<=0&&(a+=this.DB,--o)),n>0&&(i=!0),i&&(s+=oc(n));return i?s:"0"}function Kl(){var t=ot();return D.ZERO.subTo(this,t),t}function Ol(){return this.s<0?this.negate():this}function Ml(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}function Ii(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function Fl(){return this.t<=0?0:this.DB*(this.t-1)+Ii(this.data[this.t-1]^this.s&this.DM)}function Vl(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}function Hl(t,e){for(var r=t;r=0;--a)e.data[a+s+1]=this.data[a]>>n|o,o=(this.data[a]&i)<=0;--a)e.data[a]=0;e.data[s]=o,e.t=this.t+s+1,e.s=this.s,e.clamp()}function zl(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,i=this.DB-n,s=(1<>n;for(var o=r+1;o>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}function $l(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}function Yl(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,u=s.data[f-1];if(u!=0){var h=u*(1<1?s.data[f-2]>>this.F2:0),l=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(x,r)),D.ONE.dlShiftTo(f,x),x.subTo(s,s);s.t=0;){var v=r.data[--p]==u?this.DM:Math.floor(r.data[p]*l+(r.data[p-1]+d)*g);if((r.data[p]+=s.am(0,v,r,y,0,f))0&&r.rShiftTo(c,r),o<0&&D.ZERO.subTo(r,r)}}}function Zl(t){var e=ot();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(D.ZERO)>0&&t.subTo(e,e),e}function fr(t){this.m=t}function Xl(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function Ql(t){return t}function Jl(t){t.divRemTo(this.m,null,t)}function jl(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function td(t,e){t.squareTo(e),this.reduce(e)}fr.prototype.convert=Xl;fr.prototype.revert=Ql;fr.prototype.reduce=Jl;fr.prototype.mulTo=jl;fr.prototype.sqrTo=td;function ed(){if(this.t<1)return 0;var t=this.data[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function ur(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}function nd(t){var e=ot();return t.copyTo(e),this.reduce(e),e}function id(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function sd(t,e){t.squareTo(e),this.reduce(e)}function od(t,e,r){t.multiplyTo(e,r),this.reduce(r)}ur.prototype.convert=rd;ur.prototype.revert=nd;ur.prototype.reduce=id;ur.prototype.mulTo=od;ur.prototype.sqrTo=sd;function ad(){return(this.t>0?this.data[0]&1:this.s)==0}function cd(t,e){if(t>4294967295||t<1)return D.ONE;var r=ot(),n=ot(),i=e.convert(this),s=Ii(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,i,r);else{var o=r;r=n,n=o}return e.revert(r)}function fd(t,e){var r;return t<256||e.isEven()?r=new fr(e):r=new ur(e),this.exp(t,r)}D.prototype.copyTo=Nl;D.prototype.fromInt=Dl;D.prototype.fromString=kl;D.prototype.clamp=Pl;D.prototype.dlShiftTo=Vl;D.prototype.drShiftTo=Hl;D.prototype.lShiftTo=ql;D.prototype.rShiftTo=zl;D.prototype.subTo=Gl;D.prototype.multiplyTo=$l;D.prototype.squareTo=Wl;D.prototype.divRemTo=Yl;D.prototype.invDigit=ed;D.prototype.isEven=ad;D.prototype.exp=cd;D.prototype.toString=Ul;D.prototype.negate=Kl;D.prototype.abs=Ol;D.prototype.compareTo=Ml;D.prototype.bitLength=Fl;D.prototype.mod=Zl;D.prototype.modPowInt=fd;D.ZERO=Ye(0);D.ONE=Ye(1);function ud(){var t=ot();return this.copyTo(t),t}function hd(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}function dd(){return this.t==0?this.s:this.data[0]<<16>>16}function pd(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function yd(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function gd(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=Ye(r),i=ot(),s=ot(),o="";for(this.divRemTo(n,i,s);i.signum()>0;)o=(r+s.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,s);return s.intValue().toString(t)+o}function xd(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,s=0,o=0,a=0;a=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(o,0)),i&&D.ZERO.subTo(this,this)}function md(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(D.ONE.shiftLeft(t-1),Js,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(D.ONE.shiftLeft(t-1),this);else{var n=new Array,i=t&7;n.length=(t>>3)+1,e.nextBytes(n),i>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function vd(t){return this.compareTo(t)==0}function wd(t){return this.compareTo(t)<0?this:t}function Ed(t){return this.compareTo(t)>0?this:t}function Sd(t,e,r){var n,i,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),t&255||(t>>=8,e+=8),t&15||(t>>=4,e+=4),t&3||(t>>=2,e+=2),t&1||++e,e}function Dd(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}function Hd(t){var e=ot();return this.addTo(t,e),e}function qd(t){var e=ot();return this.subTo(t,e),e}function zd(t){var e=ot();return this.multiplyTo(t,e),e}function Gd(t){var e=ot();return this.divRemTo(t,e,null),e}function $d(t){var e=ot();return this.divRemTo(t,null,e),e}function Wd(t){var e=ot(),r=ot();return this.divRemTo(t,e,r),new Array(e,r)}function Yd(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Zd(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}function vn(){}function uc(t){return t}function Xd(t,e,r){t.multiplyTo(e,r)}function Qd(t,e){t.squareTo(e)}vn.prototype.convert=uc;vn.prototype.revert=uc;vn.prototype.mulTo=Xd;vn.prototype.sqrTo=Qd;function Jd(t){return this.exp(t,new vn)}function jd(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=ot();return t.copyTo(e),this.reduce(e),e}function rp(t){return t}function np(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function ip(t,e){t.squareTo(e),this.reduce(e)}function sp(t,e,r){t.multiplyTo(e,r),this.reduce(r)}Kr.prototype.convert=ep;Kr.prototype.revert=rp;Kr.prototype.reduce=np;Kr.prototype.mulTo=sp;Kr.prototype.sqrTo=ip;function op(t,e){var r=t.bitLength(),n,i=Ye(1),s;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new fr(e):e.isEven()?s=new Kr(e):s=new ur(e);var o=new Array,a=3,c=n-1,f=(1<1){var u=ot();for(s.sqrTo(o[1],u);a<=f;)o[a]=ot(),s.mulTo(u,o[a-2],o[a]),a+=2}var h=t.t-1,l,g=!0,d=ot(),p;for(r=Ii(t.data[h])-1;h>=0;){for(r>=c?l=t.data[h]>>r-c&f:(l=(t.data[h]&(1<0&&(l|=t.data[h-1]>>this.DB+r-c)),a=n;!(l&1);)l>>=1,--a;if((r-=a)<0&&(r+=this.DB,--h),g)o[l].copyTo(i),g=!1;else{for(;a>1;)s.sqrTo(i,d),s.sqrTo(d,i),a-=2;a>0?s.sqrTo(i,d):(p=i,i=d,d=p),s.mulTo(d,o[l],i)}for(;h>=0&&!(t.data[h]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function cp(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}function fp(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return D.ZERO;for(var r=t.clone(),n=this.clone(),i=Ye(1),s=Ye(0),o=Ye(0),a=Ye(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!i.isEven()||!s.isEven())&&(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!o.isEven()||!a.isEven())&&(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),s.subTo(a,s)):(n.subTo(r,n),e&&o.subTo(i,o),a.subTo(s,a))}if(n.compareTo(D.ONE)!=0)return D.ZERO;if(a.compareTo(t)>=0)return a.subtract(t);if(a.signum()<0)a.addTo(t,a);else return a;return a.signum()<0?a.add(t):a}var he=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],up=(1<<26)/he[he.length-1];function hp(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=he[he.length-1]){for(e=0;e=0);var a=s.modPow(n,this);if(a.compareTo(D.ONE)!=0&&a.compareTo(e)!=0){for(var c=1;c++{var xe=lt();cr();Bt();var dc=yc.exports=xe.sha1=xe.sha1||{};xe.md.sha1=xe.md.algorithms.sha1=dc;dc.create=function(){pc||pp();var t=null,e=xe.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),lc(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=xe.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(js.substr(0,n.blockLength-o));for(var a,c,f=n.fullMessageLength[0]*8,u=0;u>>0,f+=c,i.putInt32(f>>>0),f=a>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};lc(h,r,i);var l=xe.util.createBuffer();return l.putInt32(h.h0),l.putInt32(h.h1),l.putInt32(h.h2),l.putInt32(h.h3),l.putInt32(h.h4),l},n};var js=null,pc=!1;function pp(){js="\x80",js+=xe.util.fillString("\0",64),pc=!0}function lc(t,e,r){for(var n,i,s,o,a,c,f,u,h=r.length();h>=64;){for(i=t.h0,s=t.h1,o=t.h2,a=t.h3,c=t.h4,u=0;u<16;++u)n=r.getInt32(),e[u]=n,f=a^s&(o^a),n=(i<<5|i>>>27)+f+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<20;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,f=a^s&(o^a),n=(i<<5|i>>>27)+f+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<32;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<40;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<60;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s&o|a&(s^o),n=(i<<5|i>>>27)+f+c+2400959708+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<80;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+3395469782+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+s|0,t.h2=t.h2+o|0,t.h3=t.h3+a|0,t.h4=t.h4+c|0,h-=64}}});var bc=ht((N2,mc)=>{var me=lt();Bt();bn();gc();var xc=mc.exports=me.pkcs1=me.pkcs1||{};xc.encode_rsa_oaep=function(t,e,r){var n,i,s,o;typeof r=="string"?(n=r,i=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),s?s.start():s=me.md.sha1.create(),o||(o=s);var a=Math.ceil(t.n.bitLength()/8),c=a-2*s.digestLength-2;if(e.length>c){var f=new Error("RSAES-OAEP input message length is too long.");throw f.length=e.length,f.maxLength=c,f}n||(n=""),s.update(n,"raw");for(var u=s.digest(),h="",l=c-e.length,g=0;g>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+o),n+=r.digest().getBytes()}return n.substring(0,e)}});var vc=ht((D2,to)=>{var Ze=lt();Bt();Ti();bn();(function(){if(Ze.prime){to.exports=Ze.prime;return}var t=to.exports=Ze.prime=Ze.prime||{},e=Ze.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var i=function(h,l){return h|l};t.generateProbablePrime=function(h,l,g){typeof l=="function"&&(g=l,l={}),l=l||{};var d=l.algorithm||"PRIMEINC";typeof d=="string"&&(d={name:d}),d.options=d.options||{};var p=l.prng||Ze.random,y={nextBytes:function(x){for(var v=p.getBytesSync(x.length),m=0;ml&&(h=f(l,g)),h.isProbablePrime(p))return x(null,h);h.dAddOffset(r[d++%8],0)}while(y<0||+new Date-v"u")return o(h,l,g,d);var p=f(h,l),y=g.workers,x=g.workLoad||100,v=x*30/8,m=g.workerScript||"forge/prime.worker.js";if(y===-1)return Ze.util.estimateCores(function(S,B){S&&(B=2),y=B-1,A()});A();function A(){y=Math.max(1,y);for(var S=[],B=0;Bh&&(p=f(h,l));var z=p.toString(16);M.target.postMessage({hex:z,workLoad:x}),p.dAddOffset(v,0)}}}}function f(h,l){var g=new e(h,l),d=h-1;return g.testBit(d)||g.bitwiseTo(e.ONE.shiftLeft(d),i,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}function u(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}})()});var Ri=ht((k2,Ic)=>{var $=lt();mn();Ti();yi();bc();vc();bn();Bt();typeof st>"u"&&(st=$.jsbn.BigInteger);var st,eo=$.util.isNodejs?Ei():null,E=$.asn1,ne=$.util;$.pki=$.pki||{};Ic.exports=$.pki.rsa=$.rsa=$.rsa||{};var Q=$.pki,yp=[6,4,2,4,2,4,6,2],gp={name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},xp={name:"RSAPrivateKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},mp={name:"RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},bp=$.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},vp={name:"DigestInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:E.Class.UNIVERSAL,type:E.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},wp=function(t){var e;if(t.algorithm in Q.oids)e=Q.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=E.oidToDer(e).getBytes(),i=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]),s=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]);s.value.push(E.create(E.Class.UNIVERSAL,E.Type.OID,!1,n)),s.value.push(E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,""));var o=E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(s),i.value.push(o),E.toDer(i).getBytes()},Ac=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(st.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(st.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new st($.util.bytesToHex($.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(st.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var i=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(s)<0;)i=i.add(e.p);var o=i.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return o=o.multiply(n.modInverse(e.n)).mod(e.n),o};Q.rsa.encrypt=function(t,e,r){var n=r,i,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=Cc(t,e,r)):(i=$.util.createBuffer(),i.putBytes(t));for(var o=new st(i.toHex(),16),a=Ac(o,e,n),c=a.toString(16),f=$.util.createBuffer(),u=s-Math.ceil(c.length/2);u>0;)f.putByte(0),--u;return f.putBytes($.util.hexToBytes(c)),f.getBytes()};Q.rsa.decrypt=function(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=i,s}var o=new st($.util.createBuffer(t).toHex(),16);if(o.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var a=Ac(o,e,r),c=a.toString(16),f=$.util.createBuffer(),u=i-Math.ceil(c.length/2);u>0;)f.putByte(0),--u;return f.putBytes($.util.hexToBytes(c)),n!==!1?Li(f.getBytes(),e,r):f.getBytes()};Q.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||$.random,i={nextBytes:function(a){for(var c=n.getBytesSync(a.length),f=0;f>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+s);return o};Q.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new st(null);r.fromInt(30);for(var n=0,i=function(h,l){return h|l},s=+new Date,o,a=0;t.keys===null&&(e<=0||ac?t.pqState=0:t.num.isProbablePrime(Sp(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(yp[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(st.ONE),t.q1=t.q.subtract(st.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(st.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var u=t.e.modInverse(t.phi);t.keys={privateKey:Q.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Q.rsa.setPublicKey(t.n,t.e)}}o=+new Date,a+=o-s,s=o}return t.keys!==null};Q.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!$.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(wc("generateKeyPair"))return eo.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(a,c,f){if(a)return n(a);n(null,{privateKey:Q.privateKeyFromPem(f),publicKey:Q.publicKeyFromPem(c)})});if(Ec("generateKey")&&Ec("exportKey"))return ne.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:Bc(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(a){return ne.globalScope.crypto.subtle.exportKey("pkcs8",a.privateKey)}).then(void 0,function(a){n(a)}).then(function(a){if(a){var c=Q.privateKeyFromAsn1(E.fromDer($.util.createBuffer(a)));n(null,{privateKey:c,publicKey:Q.setRsaPublicKey(c.n,c.e)})}});if(Sc("generateKey")&&Sc("exportKey")){var i=ne.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:Bc(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(a){var c=a.target.result,f=ne.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);f.oncomplete=function(u){var h=u.target.result,l=Q.privateKeyFromAsn1(E.fromDer($.util.createBuffer(h)));n(null,{privateKey:l,publicKey:Q.setRsaPublicKey(l.n,l.e)})},f.onerror=function(u){n(u)}},i.onerror=function(a){n(a)};return}}else if(wc("generateKeyPairSync")){var s=eo.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Q.privateKeyFromPem(s.privateKey),publicKey:Q.publicKeyFromPem(s.publicKey)}}}var o=Q.rsa.createKeyPairGenerationState(t,e,r);if(!n)return Q.rsa.stepKeyPairGenerationState(o,0),o.keys;Ep(o,r,n)};Q.setRsaPublicKey=Q.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,i,s){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(a,c,f){return Cc(a,c,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(a,c){return $.pkcs1.encode_rsa_oaep(c,a,s)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(a){return a}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(n,r,!0);return Q.rsa.encrypt(o,r,!0)},r.verify=function(n,i,s,o){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),s==="RSASSA-PKCS1-V1_5"?s={verify:function(c,f){f=Li(f,r,!0);var u=E.fromDer(f,{parseAllBytes:o._parseAllDigestBytes}),h={},l=[];if(!E.validate(u,vp,h,l)){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=l,g}var d=E.derToOid(h.algorithmIdentifier);if(!(d===$.oids.md2||d===$.oids.md5||d===$.oids.sha1||d===$.oids.sha224||d===$.oids.sha256||d===$.oids.sha384||d===$.oids.sha512||d===$.oids["sha512-224"]||d===$.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=d,g}if((d===$.oids.md2||d===$.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return c===h.digest}}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:function(c,f){return f=Li(f,r,!0),c===f}});var a=Q.rsa.decrypt(i,r,!0,!1);return s.verify(n,a,r.n.bitLength())},r};Q.setRsaPrivateKey=Q.rsa.setPrivateKey=function(t,e,r,n,i,s,o,a){var c={n:t,e,d:r,p:n,q:i,dP:s,dQ:o,qInv:a};return c.decrypt=function(f,u,h){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var l=Q.rsa.decrypt(f,c,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:Li};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(g,d){return $.pkcs1.decode_rsa_oaep(d,g,h)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(g){return g}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(l,c,!1)},c.sign=function(f,u){var h=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:wp},h=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return f}},h=1);var l=u.encode(f,c.n.bitLength());return Q.rsa.encrypt(l,c,h)},c};Q.wrapRsaPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Q.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,E.toDer(t).getBytes())])};Q.privateKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,gp,e,r)&&(t=E.fromDer($.util.createBuffer(e.privateKey))),e={},r=[],!E.validate(t,xp,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,s,o,a,c,f,u,h;return i=$.util.createBuffer(e.privateKeyModulus).toHex(),s=$.util.createBuffer(e.privateKeyPublicExponent).toHex(),o=$.util.createBuffer(e.privateKeyPrivateExponent).toHex(),a=$.util.createBuffer(e.privateKeyPrime1).toHex(),c=$.util.createBuffer(e.privateKeyPrime2).toHex(),f=$.util.createBuffer(e.privateKeyExponent1).toHex(),u=$.util.createBuffer(e.privateKeyExponent2).toHex(),h=$.util.createBuffer(e.privateKeyCoefficient).toHex(),Q.setRsaPrivateKey(new st(i,16),new st(s,16),new st(o,16),new st(a,16),new st(c,16),new st(f,16),new st(u,16),new st(h,16))};Q.privateKeyToAsn1=Q.privateKeyToRSAPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.e)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.d)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.p)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.q)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.dP)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.dQ)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.qInv))])};Q.publicKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,bp,e,r)){var n=E.derToOid(e.publicKeyOid);if(n!==Q.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}t=e.rsaPublicKey}if(r=[],!E.validate(t,mp,e,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var s=$.util.createBuffer(e.publicKeyModulus).toHex(),o=$.util.createBuffer(e.publicKeyExponent).toHex();return Q.setRsaPublicKey(new st(s,16),new st(o,16))};Q.publicKeyToAsn1=Q.publicKeyToSubjectPublicKeyInfo=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Q.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.BITSTRING,!1,[Q.publicKeyToRSAPublicKey(t)])])};Q.publicKeyToRSAPublicKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.e))])};function Cc(t,e,r){var n=$.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=i-11,s}n.putByte(0),n.putByte(r);var o=i-3-t.length,a;if(r===0||r===1){a=r===0?0:255;for(var c=0;c0;){for(var f=0,u=$.random.getBytes(o),c=0;c"u")throw new Error("Encryption block is invalid.");var c=0;if(a===0){c=i-3-n;for(var f=0;f1;){if(s.getByte()!==255){--s.read;break}++c}else if(a===2)for(c=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++c}var u=s.getByte();if(u!==0||c!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function Ep(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),i();function i(){s(t.pBits,function(a,c){if(a)return r(a);if(t.p=c,t.q!==null)return o(a,t.q);s(t.qBits,o)})}function s(a,c){$.prime.generateProbablePrime(a,n,c)}function o(a,c){if(a)return r(a);if(t.q=c,t.p.compareTo(t.q)<0){var f=t.p;t.p=t.q,t.q=f}if(t.p.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)!==0){t.p=null,i();return}if(t.q.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)!==0){t.q=null,s(t.qBits,o);return}if(t.p1=t.p.subtract(st.ONE),t.q1=t.q.subtract(st.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(st.ONE)!==0){t.p=t.q=null,i();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,o);return}var u=t.e.modInverse(t.phi);t.keys={privateKey:Q.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Q.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function be(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=$.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function Sp(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function wc(t){return $.util.isNodejs&&typeof eo[t]=="function"}function Ec(t){return typeof ne.globalScope<"u"&&typeof ne.globalScope.crypto=="object"&&typeof ne.globalScope.crypto.subtle=="object"&&typeof ne.globalScope.crypto.subtle[t]=="function"}function Sc(t){return typeof ne.globalScope<"u"&&typeof ne.globalScope.msCrypto=="object"&&typeof ne.globalScope.msCrypto.subtle=="object"&&typeof ne.globalScope.msCrypto.subtle[t]=="function"}function Bc(t){for(var e=$.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{var H=lt();$s();mn();K0();cr();yi();H0();G0();bn();nc();Ri();Bt();typeof Tc>"u"&&(Tc=H.jsbn.BigInteger);var Tc,I=H.asn1,tt=H.pki=H.pki||{};Nc.exports=tt.pbe=H.pbe=H.pbe||{};var hr=tt.oids,Bp={name:"EncryptedPrivateKeyInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Ap={name:"PBES2Algorithms",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},Cp={name:"pkcs-12PbeParams",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"iterations"}]};tt.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=H.random.getBytesSync(r.saltSize),i=r.count,s=I.integerToDer(i),o,a,c;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var f,u,h;switch(r.algorithm){case"aes128":o=16,f=16,u=hr["aes128-CBC"],h=H.aes.createEncryptionCipher;break;case"aes192":o=24,f=16,u=hr["aes192-CBC"],h=H.aes.createEncryptionCipher;break;case"aes256":o=32,f=16,u=hr["aes256-CBC"],h=H.aes.createEncryptionCipher;break;case"des":o=8,f=8,u=hr.desCBC,h=H.des.createEncryptionCipher;break;default:var l=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw l.algorithm=r.algorithm,l}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),d=Rc(g),p=H.pkcs5.pbkdf2(e,n,i,o,d),y=H.random.getBytesSync(f),x=h(p);x.start(y),x.update(I.toDer(t)),x.finish(),c=x.output.getBytes();var v=Ip(n,s,o,g);a=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr.pkcs5PBES2).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr.pkcs5PBKDF2).getBytes()),v]),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(u).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,y)])])])}else if(r.algorithm==="3des"){o=24;var m=new H.util.ByteBuffer(n),p=tt.pbe.generatePkcs12Key(e,m,1,i,o),y=tt.pbe.generatePkcs12Key(e,m,2,i,o),x=H.des.createEncryptionCipher(p);x.start(y),x.update(I.toDer(t)),x.finish(),c=x.output.getBytes(),a=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,n),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,s.getBytes())])])}else{var l=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw l.algorithm=r.algorithm,l}var A=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[a,I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,c)]);return A};tt.decryptPrivateKeyInfo=function(t,e){var r=null,n={},i=[];if(!I.validate(t,Bp,n,i)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=I.derToOid(n.encryptionOid),a=tt.pbe.getCipher(o,n.encryptionParams,e),c=H.util.createBuffer(n.encryptedData);return a.update(c),a.finish()&&(r=I.fromDer(a.output)),r};tt.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:I.toDer(t).getBytes()};return H.pem.encode(r,{maxline:e})};tt.encryptedPrivateKeyFromPem=function(t){var e=H.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return I.fromDer(e.body)};tt.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=tt.wrapRsaPrivateKey(tt.privateKeyToAsn1(t));return n=tt.encryptPrivateKeyInfo(n,e,r),tt.encryptedPrivateKeyToPem(n)}var i,s,o,a;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,s=H.random.getBytesSync(8),a=H.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,s=H.random.getBytesSync(8),a=H.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var f=H.pbe.opensslDeriveBytes(e,s.substr(0,8),o),u=a(f);u.start(s),u.update(I.toDer(tt.privateKeyToAsn1(t))),u.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:H.util.bytesToHex(s).toUpperCase()},body:u.output.getBytes()};return H.pem.encode(h)};tt.decryptRsaPrivateKey=function(t,e){var r=null,n=H.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,o;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,o=H.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,o=H.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,o=H.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,o=H.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,o=H.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,o=function(h){return H.rc2.createDecryptionCipher(h,40)};break;case"RC2-64-CBC":s=8,o=function(h){return H.rc2.createDecryptionCipher(h,64)};break;case"RC2-128-CBC":s=16,o=function(h){return H.rc2.createDecryptionCipher(h,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var a=H.util.hexToBytes(n.dekInfo.parameters),c=H.pbe.opensslDeriveBytes(e,a.substr(0,8),s),f=o(c);if(f.start(a),f.update(H.util.createBuffer(n.body)),f.finish())r=f.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=tt.decryptPrivateKeyInfo(I.fromDer(r),e):r=I.fromDer(r),r!==null&&(r=tt.privateKeyFromAsn1(r)),r};tt.pbe.generatePkcs12Key=function(t,e,r,n,i,s){var o,a;if(typeof s>"u"||s===null){if(!("sha1"in H.md))throw new Error('"sha1" hash algorithm unavailable.');s=H.md.sha1.create()}var c=s.digestLength,f=s.blockLength,u=new H.util.ByteBuffer,h=new H.util.ByteBuffer;if(t!=null){for(a=0;a=0;a--)q=q>>8,q+=_.at(a)+U.at(a),U.setAt(a,q&255);M.putBuffer(U)}m=M,u.putBuffer(B)}return u.truncate(u.length()-i),u};tt.pbe.getCipher=function(t,e,r){switch(t){case tt.oids.pkcs5PBES2:return tt.pbe.getCipherForPBES2(t,e,r);case tt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case tt.oids["pbewithSHAAnd40BitRC2-CBC"]:return tt.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};tt.pbe.getCipherForPBES2=function(t,e,r){var n={},i=[];if(!I.validate(e,Ap,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}if(t=I.derToOid(n.kdfOid),t!==tt.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=I.derToOid(n.encOid),t!==tt.oids["aes128-CBC"]&&t!==tt.oids["aes192-CBC"]&&t!==tt.oids["aes256-CBC"]&&t!==tt.oids["des-EDE3-CBC"]&&t!==tt.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var o=n.kdfSalt,a=H.util.createBuffer(n.kdfIterationCount);a=a.getInt(a.length()<<3);var c,f;switch(tt.oids[t]){case"aes128-CBC":c=16,f=H.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,f=H.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,f=H.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,f=H.des.createDecryptionCipher;break;case"desCBC":c=8,f=H.des.createDecryptionCipher;break}var u=Lc(n.prfOid),h=H.pkcs5.pbkdf2(r,o,a,c,u),l=n.encIv,g=f(h);return g.start(l),g};tt.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},i=[];if(!I.validate(e,Cp,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=H.util.createBuffer(n.salt),a=H.util.createBuffer(n.iterations);a=a.getInt(a.length()<<3);var c,f,u;switch(t){case tt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,f=8,u=H.des.startDecrypting;break;case tt.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,f=8,u=function(p,y){var x=H.rc2.createDecryptionCipher(p,40);return x.start(y,null),x};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=Lc(n.prfOid),l=tt.pbe.generatePkcs12Key(r,o,1,a,c,h);h.start();var g=tt.pbe.generatePkcs12Key(r,o,2,a,f,h);return u(l,g)};tt.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in H.md))throw new Error('"md5" hash algorithm unavailable.');n=H.md.md5.create()}e===null&&(e="");for(var i=[_c(n,t+e)],s=16,o=1;s{var mt=lt();cr();Bt();var _n=wf.exports=mt.sha512=mt.sha512||{};mt.md.sha512=mt.md.algorithms.sha512=_n;var bf=mt.sha384=mt.sha512.sha384=mt.sha512.sha384||{};bf.create=function(){return _n.create("SHA-384")};mt.md.sha384=mt.md.algorithms.sha384=bf;mt.sha512.sha256=mt.sha512.sha256||{create:function(){return _n.create("SHA-512/256")}};mt.md["sha512/256"]=mt.md.algorithms["sha512/256"]=mt.sha512.sha256;mt.sha512.sha224=mt.sha512.sha224||{create:function(){return _n.create("SHA-512/224")}};mt.md["sha512/224"]=mt.md.algorithms["sha512/224"]=mt.sha512.sha224;_n.create=function(t){if(vf||Yy(),typeof t>"u"&&(t="SHA-512"),!(t in br))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=br[t],r=null,n=mt.util.createBuffer(),i=new Array(80),s=0;s<80;++s)i[s]=new Array(2);var o=64;switch(t){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var a={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength128=[];for(var c=a.messageLengthSize/4,f=0;f>>0,u>>>0];for(var h=a.fullMessageLength.length-1;h>=0;--h)a.fullMessageLength[h]+=u[1],u[1]=u[0]+(a.fullMessageLength[h]/4294967296>>>0),a.fullMessageLength[h]=a.fullMessageLength[h]>>>0,u[0]=u[1]/4294967296>>>0;return n.putBytes(c),mf(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),a},a.digest=function(){var c=mt.util.createBuffer();c.putBytes(n.bytes());var f=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize,u=f&a.blockLength-1;c.putBytes(Fo.substr(0,a.blockLength-u));for(var h,l,g=a.fullMessageLength[0]*8,d=0;d>>0,g+=l,c.putInt32(g>>>0),g=h>>>0;c.putInt32(g);for(var p=new Array(r.length),d=0;d=128;){for(C=0;C<16;++C)e[C][0]=r.getInt32()>>>0,e[C][1]=r.getInt32()>>>0;for(;C<80;++C)L=e[C-2],N=L[0],T=L[1],n=((N>>>19|T<<13)^(T>>>29|N<<3)^N>>>6)>>>0,i=((N<<13|T>>>19)^(T<<3|N>>>29)^(N<<26|T>>>6))>>>0,P=e[C-15],N=P[0],T=P[1],s=((N>>>1|T<<31)^(N>>>8|T<<24)^N>>>7)>>>0,o=((N<<31|T>>>1)^(N<<24|T>>>8)^(N<<25|T>>>7))>>>0,w=e[C-7],K=e[C-16],T=i+w[1]+o+K[1],e[C][0]=n+w[0]+s+K[0]+(T/4294967296>>>0)>>>0,e[C][1]=T>>>0;for(p=t[0][0],y=t[0][1],x=t[1][0],v=t[1][1],m=t[2][0],A=t[2][1],S=t[3][0],B=t[3][1],R=t[4][0],_=t[4][1],O=t[5][0],M=t[5][1],U=t[6][0],q=t[6][1],z=t[7][0],Z=t[7][1],C=0;C<80;++C)f=((R>>>14|_<<18)^(R>>>18|_<<14)^(_>>>9|R<<23))>>>0,u=((R<<18|_>>>14)^(R<<14|_>>>18)^(_<<23|R>>>9))>>>0,h=(U^R&(O^U))>>>0,l=(q^_&(M^q))>>>0,a=((p>>>28|y<<4)^(y>>>2|p<<30)^(y>>>7|p<<25))>>>0,c=((p<<4|y>>>28)^(y<<30|p>>>2)^(y<<25|p>>>7))>>>0,g=(p&x|m&(p^x))>>>0,d=(y&v|A&(y^v))>>>0,T=Z+u+l+Vo[C][1]+e[C][1],n=z+f+h+Vo[C][0]+e[C][0]+(T/4294967296>>>0)>>>0,i=T>>>0,T=c+d,s=a+g+(T/4294967296>>>0)>>>0,o=T>>>0,z=U,Z=q,U=O,q=M,O=R,M=_,T=B+i,R=S+n+(T/4294967296>>>0)>>>0,_=T>>>0,S=m,B=A,m=x,A=v,x=p,v=y,T=i+o,p=n+s+(T/4294967296>>>0)>>>0,y=T>>>0;T=t[0][1]+y,t[0][0]=t[0][0]+p+(T/4294967296>>>0)>>>0,t[0][1]=T>>>0,T=t[1][1]+v,t[1][0]=t[1][0]+x+(T/4294967296>>>0)>>>0,t[1][1]=T>>>0,T=t[2][1]+A,t[2][0]=t[2][0]+m+(T/4294967296>>>0)>>>0,t[2][1]=T>>>0,T=t[3][1]+B,t[3][0]=t[3][0]+S+(T/4294967296>>>0)>>>0,t[3][1]=T>>>0,T=t[4][1]+_,t[4][0]=t[4][0]+R+(T/4294967296>>>0)>>>0,t[4][1]=T>>>0,T=t[5][1]+M,t[5][0]=t[5][0]+O+(T/4294967296>>>0)>>>0,t[5][1]=T>>>0,T=t[6][1]+q,t[6][0]=t[6][0]+U+(T/4294967296>>>0)>>>0,t[6][1]=T>>>0,T=t[7][1]+Z,t[7][0]=t[7][0]+z+(T/4294967296>>>0)>>>0,t[7][1]=T>>>0,V-=128}}});var tu=ht((Cw,jf)=>{var jr=1e3,tn=jr*60,en=tn*60,Sr=en*24,B1=Sr*7,A1=Sr*365.25;jf.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return C1(t);if(r==="number"&&isFinite(t))return e.long?T1(t):I1(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function C1(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*A1;case"weeks":case"week":case"w":return r*B1;case"days":case"day":case"d":return r*Sr;case"hours":case"hour":case"hrs":case"hr":case"h":return r*en;case"minutes":case"minute":case"mins":case"min":case"m":return r*tn;case"seconds":case"second":case"secs":case"sec":case"s":return r*jr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function I1(t){var e=Math.abs(t);return e>=Sr?Math.round(t/Sr)+"d":e>=en?Math.round(t/en)+"h":e>=tn?Math.round(t/tn)+"m":e>=jr?Math.round(t/jr)+"s":t+"ms"}function T1(t){var e=Math.abs(t);return e>=Sr?Vi(t,e,Sr,"day"):e>=en?Vi(t,e,en,"hour"):e>=tn?Vi(t,e,tn,"minute"):e>=jr?Vi(t,e,jr,"second"):t+" ms"}function Vi(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var ru=ht((Iw,eu)=>{function _1(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=tu(),r.destroy=f,Object.keys(t).forEach(u=>{r[u]=t[u]}),r.names=[],r.skips=[],r.formatters={};function e(u){let h=0;for(let l=0;l{if(B==="%%")return"%";A++;let _=r.formatters[R];if(typeof _=="function"){let O=y[A];B=_.call(x,O),y.splice(A,1),A--}return B}),r.formatArgs.call(x,y),(x.log||r.log).apply(x,y)}return p.namespace=u,p.useColors=r.useColors(),p.color=r.selectColor(u),p.extend=n,p.destroy=r.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>l!==null?l:(g!==r.namespaces&&(g=r.namespaces,d=r.enabled(u)),d),set:y=>{l=y}}),typeof r.init=="function"&&r.init(p),p}function n(u,h){let l=r(this.namespace+(typeof h>"u"?":":h)+u);return l.log=this.log,l}function i(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let h,l=(typeof u=="string"?u:"").split(/[\s,]+/),g=l.length;for(h=0;h"-"+h)].join(",");return r.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let h,l;for(h=0,l=r.skips.length;h{jt.formatArgs=R1;jt.save=N1;jt.load=D1;jt.useColors=L1;jt.storage=k1();jt.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();jt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function L1(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function R1(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Hi.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}jt.log=console.debug||console.log||(()=>{});function N1(t){try{t?jt.storage.setItem("debug",t):jt.storage.removeItem("debug")}catch{}}function D1(){let t;try{t=jt.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function k1(){try{return localStorage}catch{}}Hi.exports=ru()(jt);var{formatters:P1}=Hi.exports;P1.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var V1={};_t(V1,{noise:()=>F1,pureJsCrypto:()=>di});function Me(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function rt(t=0){return globalThis.Buffer?.alloc!=null?Me(globalThis.Buffer.alloc(t)):new Uint8Array(t)}function It(t=0){return globalThis.Buffer?.allocUnsafe!=null?Me(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}var Su=Math.pow(2,7),Bu=Math.pow(2,14),Au=Math.pow(2,21),Zi=Math.pow(2,28),Xi=Math.pow(2,35),Qi=Math.pow(2,42),Ji=Math.pow(2,49),ct=128,Ht=127;function Be(t){if(tNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Cu(t,e,r=0){switch(Be(t)){case 8:e[r++]=t&255|ct,t/=128;case 7:e[r++]=t&255|ct,t/=128;case 6:e[r++]=t&255|ct,t/=128;case 5:e[r++]=t&255|ct,t/=128;case 4:e[r++]=t&255|ct,t>>>=7;case 3:e[r++]=t&255|ct,t>>>=7;case 2:e[r++]=t&255|ct,t>>>=7;case 1:{e[r++]=t&255,t>>>=7;break}default:throw new Error("unreachable")}return e}function Iu(t,e,r=0){switch(Be(t)){case 8:e.set(r++,t&255|ct),t/=128;case 7:e.set(r++,t&255|ct),t/=128;case 6:e.set(r++,t&255|ct),t/=128;case 5:e.set(r++,t&255|ct),t/=128;case 4:e.set(r++,t&255|ct),t>>>=7;case 3:e.set(r++,t&255|ct),t>>>=7;case 2:e.set(r++,t&255|ct),t>>>=7;case 1:{e.set(r++,t&255),t>>>=7;break}default:throw new Error("unreachable")}return e}function Tu(t,e){let r=t[e],n=0;if(n+=r&Ht,ri+s.length,0));let r=It(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return Me(r)}function Lt(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let r=0;for(let n of e)if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.push(n);else if(Fn(n))r+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}prepend(...e){this.prependAll(e)}prependAll(e){let r=0;for(let n of e.reverse())if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.unshift(n);else if(Fn(n))r+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}get(e){let r=da(this.bufs,e);return r.buf[r.index]}set(e,r){let n=da(this.bufs,e);n.buf[n.index]=r}write(e,r=0){if(e instanceof Uint8Array)for(let n=0;n0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,r){let{bufs:n,length:i}=this._subList(e,r);return Gt(n,i)}subarray(e,r){let{bufs:n,length:i}=this._subList(e,r);return n.length===1?n[0]:Gt(n,i)}sublist(e,r){let{bufs:n,length:i}=this._subList(e,r),s=new t;return s.length=i,s.bufs=n,s}_subList(e,r){if(e=e??0,r=r??this.length,e<0&&(e=this.length+e),r<0&&(r=this.length+r),e<0||r>this.length)throw new RangeError("index is out of bounds");if(e===r)return{bufs:[],length:0};if(e===0&&r===this.length)return{bufs:[...this.bufs],length:this.length};let n=[],i=0;for(let s=0;s=c)continue;let f=e>=a&&ea&&r<=c;if(f&&u){if(e===a&&r===c){n.push(o);break}let h=e-a;n.push(o.subarray(h,h+(r-e)));break}if(f){if(e===0){n.push(o);continue}n.push(o.subarray(e-a));continue}if(u){if(r===c){n.push(o);break}n.push(o.subarray(0,r-a));break}n.push(o)}return{bufs:n,length:r-e}}indexOf(e,r=0){if(!Fn(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(r=Number(r??0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),e.length===0)return r>this.length?this.length:r;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let s=256,o=new Int32Array(s);for(let h=0;h=0;l--){let g=this.get(h+l);if(n[l]!==g){u=Math.max(1,l-a[g]);break}}if(u===0)return h}return-1}getInt8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt8(0)}setInt8(e,r){let n=It(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,r),this.write(n,e)}getInt16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,r)}setInt16(e,r,n){let i=rt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,r,n),this.write(i,e)}getInt32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,r)}setInt32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,r,n),this.write(i,e)}getBigInt64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,r)}setBigInt64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,r,n),this.write(i,e)}getUint8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint8(0)}setUint8(e,r){let n=It(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,r),this.write(n,e)}getUint16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,r)}setUint16(e,r,n){let i=rt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,r,n),this.write(i,e)}getUint32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,r)}setUint32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,r,n),this.write(i,e)}getBigUint64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,r)}setBigUint64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,r,n),this.write(i,e)}getFloat32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,r)}setFloat32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,r,n),this.write(i,e)}getFloat64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,r)}setFloat64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,r,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof t)||e.bufs.length!==this.bufs.length)return!1;for(let r=0;ri+s.byteLength,0)),n.length=r,n}};function Vn(t){return t[Symbol.asyncIterator]!=null}var Hn=t=>{let e=Be(t),r=It(e);return la(t,r),Hn.bytes=e,r};Hn.bytes=0;function nn(t,e){e=e??{};let r=e.lengthEncoder??Hn;function*n(i){let s=r(i.byteLength);s instanceof Uint8Array?yield s:yield*s,i instanceof Uint8Array?yield i:yield*i}return Vn(t)?async function*(){for await(let i of t)yield*n(i)}():function*(){for(let i of t)yield*n(i)}()}nn.single=(t,e)=>{e=e??{};let r=e.lengthEncoder??Hn;return new Rt(r(t.byteLength),t)};var Br=zt(xa(),1);var Ru=8,Nu=1024*1024*4,er;(function(t){t[t.LENGTH=0]="LENGTH",t[t.DATA=1]="DATA"})(er||(er={}));var ts=t=>{let e=Mn(t);return ts.bytes=Be(e),e};ts.bytes=0;function sn(t,e){let r=new Rt,n=er.LENGTH,i=-1,s=e?.lengthDecoder??ts,o=e?.maxLengthLength??Ru,a=e?.maxDataLength??Nu;function*c(){for(;r.byteLength>0;){if(n===er.LENGTH)try{if(i=s(r),i<0)throw(0,Br.default)(new Error("invalid message length"),"ERR_INVALID_MSG_LENGTH");if(i>a)throw(0,Br.default)(new Error("message length too long"),"ERR_MSG_DATA_TOO_LONG");let f=s.bytes;r.consume(f),e?.onLength!=null&&e.onLength(i),n=er.DATA}catch(f){if(f instanceof RangeError){if(r.byteLength>o)throw(0,Br.default)(new Error("message length length too long"),"ERR_MSG_LENGTH_TOO_LONG");break}throw f}if(n===er.DATA){if(r.byteLength0)throw(0,Br.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}():function*(){for(let f of t)r.append(f),yield*c();if(r.byteLength>0)throw(0,Br.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}()}sn.fromReader=(t,e)=>{let r=1,n=async function*(){for(;;)try{let{done:s,value:o}=await t.next(r);if(s===!0)return;o!=null&&(yield o)}catch(s){if(s.code==="ERR_UNDER_READ")return{done:!0,value:null};throw s}finally{r=1}}();return sn(n,{...e??{},onLength:s=>{r=s}})};function oe(){let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}var qn=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=r??"ABORT_ERR"}};async function ma(t,e,r){if(e==null)return t;if(e.aborted)return Promise.reject(new qn(r?.errorMessage,r?.errorCode));let n,i=new qn(r?.errorMessage,r?.errorCode);try{return await Promise.race([t,new Promise((s,o)=>{n=()=>{o(i)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var es=class{needNext;haveNext;ended;nextResult;constructor(){this.ended=!1,this.needNext=oe(),this.needNext.resolve(),this.haveNext=oe()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("Have next but next was undefined");let e=this.nextResult;return this.nextResult=void 0,this.needNext.resolve(),this.needNext=oe(),e}async throw(e){return this.ended=!0,e!=null&&this.haveNext.reject(e),{done:!0,value:void 0}}async return(){let e={done:!0,value:void 0};return await this._push(void 0),e}async push(e,r){await this._push(e,r)}async end(e,r){e!=null?await this.throw(e):await this._push(void 0,r)}async _push(e,r){if(e!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");this.nextResult!=null&&await this.needNext.promise,e!=null?this.nextResult={done:!1,value:e}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=oe(),await ma(this.needNext.promise,r?.signal,r)}};function ba(){return new es}var zn=class extends Error{code;constructor(e,r){super(e),this.code=r}},rs=class extends zn{type;constructor(e){super(e,"ABORT_ERR"),this.type="aborted"}};function va(t,e){let r=ba();t.sink(r).catch(async o=>{await r.end(o)}),t.sink=async o=>{for await(let a of o)await r.push(a);await r.end()};let n=t.source;t.source[Symbol.iterator]!=null?n=t.source[Symbol.iterator]():t.source[Symbol.asyncIterator]!=null&&(n=t.source[Symbol.asyncIterator]());let i=new Rt;return{read:async(o,a)=>{a?.signal?.throwIfAborted();let c,f=new Promise((u,h)=>{c=()=>{h(new rs("Read aborted"))},a?.signal?.addEventListener("abort",c)});try{if(o==null){let{done:h,value:l}=await Promise.race([n.next(),f]);return h===!0?new Rt:l}for(;i.byteLength{a?.signal?.throwIfAborted(),o instanceof Uint8Array?await r.push(o,a):await r.push(o.subarray(),a)},unwrap:()=>{if(i.byteLength>0){let o=t.source;t.source=async function*(){e?.yieldBytes===!1?yield i:yield*i,yield*o}()}return t}}}var Gn=class extends Error{code;constructor(e,r){super(e),this.code=r}},wa=t=>Mn(t);wa.bytes=0;function ns(t,e={}){let r=va(t,e);return e.maxDataLength!=null&&e.maxLengthLength==null&&(e.maxLengthLength=Be(e.maxDataLength)),{read:async i=>{let s=-1,o=new Rt,a=e?.lengthDecoder??wa;for(;;){o.append(await r.read(1,i));try{s=a(o)}catch(c){if(c instanceof RangeError)continue;throw c}if(e?.maxLengthLength!=null&&o.byteLength>e.maxLengthLength)throw new Gn("message length length too long","ERR_MSG_LENGTH_TOO_LONG");if(s>-1)break}if(e?.maxDataLength!=null&&s>e.maxDataLength)throw new Gn("message length too long","ERR_MSG_DATA_TOO_LONG");return r.read(s,i)},write:async(i,s)=>{await r.write(nn.single(i,e),s)},writeV:async(i,s)=>{let o=new Rt(...i.map(a=>nn.single(a,e)));await r.write(o,s)},unwrap:()=>r.unwrap()}}function is(){let t=oe(),e=!1;return{sink:async r=>{if(e)throw new Error("already piped");e=!0,t.resolve(r)},source:async function*(){yield*await t.promise}()}}function Ea(){let t=is(),e=is();return[{source:t.source,sink:e.sink},{source:e.source,sink:t.sink}]}var $n=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},Ar=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new $n(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let r=this.head;this.head=r.next=new $n(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var ss=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function Wn(t={}){return ku(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},t)}function ku(t,e){e=e??{};let r=e.onEnd,n=new Ar,i,s,o,a=oe(),c=async()=>{try{return n.isEmpty()?o?{done:!0}:await new Promise((y,x)=>{s=v=>{s=null,n.push(v);try{y(t(n))}catch(m){x(m)}return i}}):t(n)}finally{n.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=oe()})}},f=y=>s!=null?s(y):(n.push(y),i),u=y=>(n=new Ar,s!=null?s({error:y}):(n.push({error:y}),i)),h=y=>{if(o)return i;if(e?.objectMode!==!0&&y?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return f({done:!1,value:y})},l=y=>o?i:(o=!0,y!=null?u(y):f({done:!0})),g=()=>(n=new Ar,l(),{done:!0}),d=y=>(l(y),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:c,return:g,throw:d,push:h,end:l,get readableLength(){return n.size},onEmpty:async y=>{let x=y?.signal;if(x?.throwIfAborted(),n.isEmpty())return;let v,m;x!=null&&(v=new Promise((A,S)=>{m=()=>{S(new ss)},x.addEventListener("abort",m)}));try{await Promise.race([a.promise,v])}finally{m!=null&&x!=null&&x?.removeEventListener("abort",m)}}},r==null)return i;let p=i;return i={[Symbol.asyncIterator](){return this},next(){return p.next()},throw(y){return p.throw(y),r!=null&&(r(y),r=void 0),{done:!0}},return(){return p.return(),r!=null&&(r(),r=void 0),{done:!0}},push:h,end(y){return p.end(y),r!=null&&(r(y),r=void 0),i},get readableLength(){return p.readableLength},onEmpty:y=>p.onEmpty(y)},i}function Pu(t){return t[Symbol.asyncIterator]!=null}function Uu(...t){let e=[];for(let r of t)Pu(r)||e.push(r);return e.length===t.length?function*(){for(let r of e)yield*r}():async function*(){let r=Wn({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(t.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var Sa=Uu;function Ba(t,...e){if(t==null)throw new Error("Empty pipeline");if(os(t)){let n=t;t=()=>n.source}else if(Ca(t)||Aa(t)){let n=t;t=()=>n}let r=[t,...e];if(r.length>1&&os(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n{let e;for(;t.length>0;)e=t.shift()(e);return e},Aa=t=>t?.[Symbol.asyncIterator]!=null,Ca=t=>t?.[Symbol.iterator]!=null,os=t=>t==null?!1:t.sink!=null&&t.source!=null,Ou=t=>e=>{let r=t.sink(e);if(r?.then!=null){let n=Wn({objectMode:!0});r.then(()=>{n.end()},o=>{n.end(o)});let i,s=t.source;if(Aa(s))i=async function*(){yield*s,n.end()};else if(Ca(s))i=function*(){yield*s,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return Sa(n,i())}return t.source};var Ia=!!globalThis.process?.env?.DUMP_SESSION_KEYS;var Mu=t=>t instanceof Uint8Array;var Ae=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Ta=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Fu=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Fu)throw new Error("Non little-endian hardware is not supported");function Yn(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Zn(t){if(typeof t=="string")t=Yn(t);else if(Mu(t))t=t.slice();else throw new Error(`expected Uint8Array, got ${typeof t}`);return t}var Vu=t=>Object.prototype.toString.call(t)==="[object Object]"&&t.constructor===Object;function _a(t,e){if(e!==void 0&&(typeof e!="object"||!Vu(e)))throw new Error("options must be object or undefined");return Object.assign(t,e)}function rr(t,e){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");if(typeof e=="number"&&t.length!==e)throw new Error(`Uint8Array length ${e} expected`)}function La(t,e){if(t.length!==e.length)throw new Error("equalBytes: Different size of Uint8Arrays");let r=!0;for(let n=0;n(Object.assign(e,t),e);function cs(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,f=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+f,a,n)}function Xn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function fs(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function Cr(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function us(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ra(t,e){Cr(t);let r=e.outputLen;if(t.lengtht[e++]&255|(t[e++]&255)<<8,hs=class{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=Zn(e),rr(e,32);let r=Ot(e,0),n=Ot(e,2),i=Ot(e,4),s=Ot(e,6),o=Ot(e,8),a=Ot(e,10),c=Ot(e,12),f=Ot(e,14);this.r[0]=r&8191,this.r[1]=(r>>>13|n<<3)&8191,this.r[2]=(n>>>10|i<<6)&7939,this.r[3]=(i>>>7|s<<9)&8191,this.r[4]=(s>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|f<<8)&8191,this.r[9]=f>>>5&127;for(let u=0;u<8;u++)this.pad[u]=Ot(e,16+2*u)}process(e,r,n=!1){let i=n?0:2048,{h:s,r:o}=this,a=o[0],c=o[1],f=o[2],u=o[3],h=o[4],l=o[5],g=o[6],d=o[7],p=o[8],y=o[9],x=Ot(e,r+0),v=Ot(e,r+2),m=Ot(e,r+4),A=Ot(e,r+6),S=Ot(e,r+8),B=Ot(e,r+10),R=Ot(e,r+12),_=Ot(e,r+14),O=s[0]+(x&8191),M=s[1]+((x>>>13|v<<3)&8191),U=s[2]+((v>>>10|m<<6)&8191),q=s[3]+((m>>>7|A<<9)&8191),z=s[4]+((A>>>4|S<<12)&8191),Z=s[5]+(S>>>1&8191),C=s[6]+((S>>>14|B<<2)&8191),N=s[7]+((B>>>11|R<<5)&8191),T=s[8]+((R>>>8|_<<8)&8191),L=s[9]+(_>>>5|i),w=0,P=w+O*a+M*(5*y)+U*(5*p)+q*(5*d)+z*(5*g);w=P>>>13,P&=8191,P+=Z*(5*l)+C*(5*h)+N*(5*u)+T*(5*f)+L*(5*c),w+=P>>>13,P&=8191;let K=w+O*c+M*a+U*(5*y)+q*(5*p)+z*(5*d);w=K>>>13,K&=8191,K+=Z*(5*g)+C*(5*l)+N*(5*h)+T*(5*u)+L*(5*f),w+=K>>>13,K&=8191;let V=w+O*f+M*c+U*a+q*(5*y)+z*(5*p);w=V>>>13,V&=8191,V+=Z*(5*d)+C*(5*g)+N*(5*l)+T*(5*h)+L*(5*u),w+=V>>>13,V&=8191;let W=w+O*u+M*f+U*c+q*a+z*(5*y);w=W>>>13,W&=8191,W+=Z*(5*p)+C*(5*d)+N*(5*g)+T*(5*l)+L*(5*h),w+=W>>>13,W&=8191;let Y=w+O*h+M*u+U*f+q*c+z*a;w=Y>>>13,Y&=8191,Y+=Z*(5*y)+C*(5*p)+N*(5*d)+T*(5*g)+L*(5*l),w+=Y>>>13,Y&=8191;let et=w+O*l+M*h+U*u+q*f+z*c;w=et>>>13,et&=8191,et+=Z*a+C*(5*y)+N*(5*p)+T*(5*d)+L*(5*g),w+=et>>>13,et&=8191;let X=w+O*g+M*l+U*h+q*u+z*f;w=X>>>13,X&=8191,X+=Z*c+C*a+N*(5*y)+T*(5*p)+L*(5*d),w+=X>>>13,X&=8191;let J=w+O*d+M*g+U*l+q*h+z*u;w=J>>>13,J&=8191,J+=Z*f+C*c+N*a+T*(5*y)+L*(5*p),w+=J>>>13,J&=8191;let dt=w+O*p+M*d+U*g+q*l+z*h;w=dt>>>13,dt&=8191,dt+=Z*u+C*f+N*c+T*a+L*(5*y),w+=dt>>>13,dt&=8191;let ut=w+O*y+M*p+U*d+q*g+z*l;w=ut>>>13,ut&=8191,ut+=Z*h+C*u+N*f+T*c+L*a,w+=ut>>>13,ut&=8191,w=(w<<2)+w|0,w=w+P|0,P=w&8191,w=w>>>13,K+=w,s[0]=P,s[1]=K,s[2]=V,s[3]=W,s[4]=Y,s[5]=et,s[6]=X,s[7]=J,s[8]=dt,s[9]=ut}finalize(){let{h:e,pad:r}=this,n=new Uint16Array(10),i=e[1]>>>13;e[1]&=8191;for(let a=2;a<10;a++)e[a]+=i,i=e[a]>>>13,e[a]&=8191;e[0]+=i*5,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,n[0]=e[0]+5,i=n[0]>>>13,n[0]&=8191;for(let a=1;a<10;a++)n[a]=e[a]+i,i=n[a]>>>13,n[a]&=8191;n[9]-=8192;let s=(i^1)-1;for(let a=0;a<10;a++)n[a]&=s;s=~s;for(let a=0;a<10;a++)e[a]=e[a]&s|n[a];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let o=e[0]+r[0];e[0]=o&65535;for(let a=1;a<8;a++)o=(e[a]+r[a]|0)+(o>>>16)|0,e[a]=o&65535}update(e){us(this);let{buffer:r,blockLen:n}=this;e=Zn(e);let i=e.length;for(let s=0;s>>0,e[s++]=n[o]>>>8;return e}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}};function Hu(t){let e=(n,i)=>t(i).update(Zn(n)).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}var Na=Hu(t=>new hs(t));var qu=Yn("expand 16-byte k"),zu=Yn("expand 32-byte k"),Gu=Ae(qu),$u=Ae(zu);function G(t,e){return t<>>32-e}function ls(t){return t.byteOffset%4===0}var Qn=64,Wu=16,ka=2**32-1,Da=new Uint32Array;function Yu(t,e,r,n,i,s,o,a){let c=i.length,f=new Uint8Array(Qn),u=Ae(f),h=ls(i)&&ls(s),l=h?Ae(i):Da,g=h?Ae(s):Da;for(let d=0;d=ka)throw new Error("arx: counter overflow");let p=Math.min(Qn,c-d);if(h&&p===Qn){let y=d/4;if(d%4!==0)throw new Error("arx: invalid block position");for(let x=0,v;x{Cr(a),Cr(c),Cr(f);let l=f.length;if(u||(u=new Uint8Array(l)),Cr(u),Xn(h),h<0||h>=ka)throw new Error("arx: counter overflow");if(u.length0;)g.pop().fill(0);return u}}function Ka(t,e,r,n,i,s=20){let o=t[0],a=t[1],c=t[2],f=t[3],u=e[0],h=e[1],l=e[2],g=e[3],d=e[4],p=e[5],y=e[6],x=e[7],v=i,m=r[0],A=r[1],S=r[2],B=o,R=a,_=c,O=f,M=u,U=h,q=l,z=g,Z=d,C=p,N=y,T=x,L=v,w=m,P=A,K=S;for(let W=0;W{t.update(e);let r=e.length%16;r&&t.update(Ju.subarray(r))},ju=new Uint8Array(32);function Ua(t,e,r,n,i){let s=t(e,r,ju),o=Na.create(s);i&&Pa(o,i),Pa(o,n);let a=new Uint8Array(16),c=Ta(a);cs(c,0,BigInt(i?i.length:0),!0),cs(c,8,BigInt(n.length),!0),o.update(a);let f=o.digest();return s.fill(0),f}var Oa=t=>(e,r,n)=>(rr(e,32),rr(r),{encrypt:(s,o)=>{let a=s.length,c=a+16;o?rr(o,c):o=new Uint8Array(c),t(e,r,s,o,1);let f=Ua(t,e,r,o.subarray(0,-16),n);return o.set(f,a),o},decrypt:(s,o)=>{let a=s.length,c=a-16;if(a<16)throw new Error("encrypted data must be at least 16 bytes");o?rr(o,c):o=new Uint8Array(c);let f=s.subarray(0,-16),u=s.subarray(-16),h=Ua(t,e,r,f,n);if(!La(u,h))throw new Error("invalid tag");return t(e,r,f,o,1),o}}),ps=as({blockSize:64,nonceLength:12,tagLength:16},Oa(Xu)),Zg=as({blockSize:64,nonceLength:24,tagLength:16},Oa(Qu));function Jn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function ys(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function on(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Jn(t.outputLen),Jn(t.blockLen)}function Ir(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ma(t,e){ys(t);let r=e.outputLen;if(t.lengtht instanceof Uint8Array;var ti=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ae=(t,e)=>t<<32-e|t>>>e,th=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!th)throw new Error("Non little-endian hardware is not supported");function gs(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Fe(t){if(typeof t=="string"&&(t=gs(t)),!Fa(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function ei(...t){let e=new Uint8Array(t.reduce((n,i)=>n+i.length,0)),r=0;return t.forEach(n=>{if(!Fa(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}var Tr=class{clone(){return this._cloneInto()}},tx={}.toString;function ri(t){let e=n=>t().update(Fe(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function nr(t=32){if(jn&&typeof jn.getRandomValues=="function")return jn.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function eh(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,f=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+f,a,n)}var _r=class extends Tr{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ti(this.buffer)}update(e){Ir(this);let{view:r,buffer:n,blockLen:i}=this;e=Fe(e);let s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let h=o;hu.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h>xs&ni)}:{h:Number(t>>xs&ni)|0,l:Number(t&ni)|0}}function rh(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),ih=(t,e,r)=>t>>>r,sh=(t,e,r)=>t<<32-r|e>>>r,oh=(t,e,r)=>t>>>r|e<<32-r,ah=(t,e,r)=>t<<32-r|e>>>r,ch=(t,e,r)=>t<<64-r|e>>>r-32,fh=(t,e,r)=>t>>>r-32|e<<64-r,uh=(t,e)=>e,hh=(t,e)=>t,lh=(t,e,r)=>t<>>32-r,dh=(t,e,r)=>e<>>32-r,ph=(t,e,r)=>e<>>64-r,yh=(t,e,r)=>t<>>64-r;function gh(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var xh=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),mh=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,bh=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),vh=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,wh=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Eh=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0;var Sh={fromBig:Va,split:rh,toBig:nh,shrSH:ih,shrSL:sh,rotrSH:oh,rotrSL:ah,rotrBH:ch,rotrBL:fh,rotr32H:uh,rotr32L:hh,rotlSH:lh,rotlSL:dh,rotlBH:ph,rotlBL:yh,add:gh,add3L:xh,add3H:mh,add4L:bh,add4H:vh,add5H:Eh,add5L:wh},j=Sh;var[Bh,Ah]=j.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Ve=new Uint32Array(80),He=new Uint32Array(80),ms=class extends _r{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:f,El:u,Fh:h,Fl:l,Gh:g,Gl:d,Hh:p,Hl:y}=this;return[e,r,n,i,s,o,a,c,f,u,h,l,g,d,p,y]}set(e,r,n,i,s,o,a,c,f,u,h,l,g,d,p,y){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=f|0,this.El=u|0,this.Fh=h|0,this.Fl=l|0,this.Gh=g|0,this.Gl=d|0,this.Hh=p|0,this.Hl=y|0}process(e,r){for(let m=0;m<16;m++,r+=4)Ve[m]=e.getUint32(r),He[m]=e.getUint32(r+=4);for(let m=16;m<80;m++){let A=Ve[m-15]|0,S=He[m-15]|0,B=j.rotrSH(A,S,1)^j.rotrSH(A,S,8)^j.shrSH(A,S,7),R=j.rotrSL(A,S,1)^j.rotrSL(A,S,8)^j.shrSL(A,S,7),_=Ve[m-2]|0,O=He[m-2]|0,M=j.rotrSH(_,O,19)^j.rotrBH(_,O,61)^j.shrSH(_,O,6),U=j.rotrSL(_,O,19)^j.rotrBL(_,O,61)^j.shrSL(_,O,6),q=j.add4L(R,U,He[m-7],He[m-16]),z=j.add4H(q,B,M,Ve[m-7],Ve[m-16]);Ve[m]=z|0,He[m]=q|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:f,Dl:u,Eh:h,El:l,Fh:g,Fl:d,Gh:p,Gl:y,Hh:x,Hl:v}=this;for(let m=0;m<80;m++){let A=j.rotrSH(h,l,14)^j.rotrSH(h,l,18)^j.rotrBH(h,l,41),S=j.rotrSL(h,l,14)^j.rotrSL(h,l,18)^j.rotrBL(h,l,41),B=h&g^~h&p,R=l&d^~l&y,_=j.add5L(v,S,R,Ah[m],He[m]),O=j.add5H(_,x,A,B,Bh[m],Ve[m]),M=_|0,U=j.rotrSH(n,i,28)^j.rotrBH(n,i,34)^j.rotrBH(n,i,39),q=j.rotrSL(n,i,28)^j.rotrBL(n,i,34)^j.rotrBL(n,i,39),z=n&s^n&a^s&a,Z=i&o^i&c^o&c;x=p|0,v=y|0,p=g|0,y=d|0,g=h|0,d=l|0,{h,l}=j.add(f|0,u|0,O|0,M|0),f=a|0,u=c|0,a=s|0,c=o|0,s=n|0,o=i|0;let C=j.add3L(M,q,Z);n=j.add3H(C,O,U,z),i=C|0}({h:n,l:i}=j.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=j.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=j.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:f,l:u}=j.add(this.Dh|0,this.Dl|0,f|0,u|0),{h,l}=j.add(this.Eh|0,this.El|0,h|0,l|0),{h:g,l:d}=j.add(this.Fh|0,this.Fl|0,g|0,d|0),{h:p,l:y}=j.add(this.Gh|0,this.Gl|0,p|0,y|0),{h:x,l:v}=j.add(this.Hh|0,this.Hl|0,x|0,v|0),this.set(n,i,s,o,a,c,f,u,h,l,g,d,p,y,x,v)}roundClean(){Ve.fill(0),He.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var bs=ri(()=>new ms);var oi={};_t(oi,{bitGet:()=>Nh,bitLen:()=>Rh,bitMask:()=>an,bitSet:()=>Dh,bytesToHex:()=>Ce,bytesToNumberBE:()=>Ie,bytesToNumberLE:()=>ce,concatBytes:()=>_e,createHmacDrbg:()=>Es,ensureBytes:()=>yt,equalBytes:()=>_h,hexToBytes:()=>ir,hexToNumber:()=>ws,numberToBytesBE:()=>qe,numberToBytesLE:()=>Te,numberToHexUnpadded:()=>za,numberToVarBytesBE:()=>Th,utf8ToBytes:()=>Lh,validateObject:()=>ee});var qa=BigInt(0),ii=BigInt(1),Ch=BigInt(2),si=t=>t instanceof Uint8Array,Ih=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Ce(t){if(!si(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0)),r=0;return t.forEach(n=>{if(!si(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function _h(t,e){if(t.length!==e.length)return!1;for(let r=0;rqa;t>>=ii,e+=1);return e}function Nh(t,e){return t>>BigInt(e)&ii}var Dh=(t,e,r)=>t|(r?ii:qa)<(Ch<new Uint8Array(t),Ha=t=>Uint8Array.from(t);function Es(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=vs(t),i=vs(t),s=0,o=()=>{n.fill(1),i.fill(0),s=0},a=(...h)=>r(i,n,...h),c=(h=vs())=>{i=a(Ha([0]),h),n=a(),h.length!==0&&(i=a(Ha([1]),h),n=a())},f=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let h=0,l=[];for(;h{o(),c(h);let g;for(;!(g=l(f()));)c();return o(),g}}var kh={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function ee(t,e,r={}){let n=(i,s,o)=>{let a=kh[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);let c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(let[i,s]of Object.entries(e))n(i,s,!1);for(let[i,s]of Object.entries(r))n(i,s,!0);return t}var Tt=BigInt(0),bt=BigInt(1),sr=BigInt(2),Ph=BigInt(3),Ss=BigInt(4),Ga=BigInt(5),$a=BigInt(8),Uh=BigInt(9),Kh=BigInt(16);function at(t,e){let r=t%e;return r>=Tt?r:e+r}function Bs(t,e,r){if(r<=Tt||e 0");if(r===bt)return Tt;let n=bt;for(;e>Tt;)e&bt&&(n=n*t%r),t=t*t%r,e>>=bt;return n}function gt(t,e,r){let n=t;for(;e-- >Tt;)n*=n,n%=r;return n}function ai(t,e){if(t===Tt||e<=Tt)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=at(t,e),n=e,i=Tt,s=bt,o=bt,a=Tt;for(;r!==Tt;){let f=n/r,u=n%r,h=i-o*f,l=s-a*f;n=r,r=u,i=o,s=a,o=h,a=l}if(n!==bt)throw new Error("invert: does not exist");return at(i,e)}function Oh(t){let e=(t-bt)/sr,r,n,i;for(r=t-bt,n=0;r%sr===Tt;r/=sr,n++);for(i=sr;i(at(t,e)&bt)===bt,Fh=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function As(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Fh.reduce((n,i)=>(n[i]="function",n),e);return ee(t,r)}function Vh(t,e,r){if(r 0");if(r===Tt)return t.ONE;if(r===bt)return e;let n=t.ONE,i=e;for(;r>Tt;)r&bt&&(n=t.mul(n,i)),i=t.sqr(i),r>>=bt;return n}function Hh(t,e){let r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function Cs(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function ci(t,e,r=!1,n={}){if(t<=Tt)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:s}=Cs(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=Mh(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:an(i),ZERO:Tt,ONE:bt,create:c=>at(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Tt<=c&&cc===Tt,isOdd:c=>(c&bt)===bt,neg:c=>at(-c,t),eql:(c,f)=>c===f,sqr:c=>at(c*c,t),add:(c,f)=>at(c+f,t),sub:(c,f)=>at(c-f,t),mul:(c,f)=>at(c*f,t),pow:(c,f)=>Vh(a,c,f),div:(c,f)=>at(c*ai(f,t),t),sqrN:c=>c*c,addN:(c,f)=>c+f,subN:(c,f)=>c-f,mulN:(c,f)=>c*f,inv:c=>ai(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>Hh(a,c),cmov:(c,f,u)=>u?f:c,toBytes:c=>r?Te(c,s):qe(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?ce(c):Ie(c)}});return Object.freeze(a)}function Ya(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}function Za(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function Is(t){let e=Za(t);return e+Math.ceil(e/2)}function Xa(t,e,r=!1){let n=t.length,i=Za(e),s=Is(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let o=r?Ie(t):ce(t),a=at(o,e-bt)+bt;return r?Te(a,i):qe(a,i)}var zh=BigInt(0),Ts=BigInt(1);function fi(t,e){let r=(i,s)=>{let o=s.negate();return i?o:s},n=i=>{let s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>zh;)s&Ts&&(o=o.add(a)),a=a.double(),s>>=Ts;return o},precomputeWindow(i,s){let{windows:o,windowSize:a}=n(s),c=[],f=i,u=f;for(let h=0;h>=g,y>c&&(y-=l,o+=Ts);let x=p,v=p+Math.abs(y)-1,m=d%2!==0,A=y<0;y===0?u=u.add(r(m,s[x])):f=f.add(r(A,s[v]))}return{p:f,f:u}},wNAFCached(i,s,o,a){let c=i._WINDOW_SIZE||1,f=s.get(i);return f||(f=this.precomputeWindow(i,c),c!==1&&s.set(i,a(f))),this.wNAF(c,f,o)}}}function cn(t){return As(t.Fp),ee(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Cs(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var fe=BigInt(0),Qt=BigInt(1),ui=BigInt(2),Gh=BigInt(8),$h={zip215:!0};function Wh(t){let e=cn(t);return ee(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function hi(t){let e=Wh(t),{Fp:r,n,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,f=ui<{try{return{isValid:!0,value:r.sqrt(L*r.inv(w))}}catch{return{isValid:!1,value:fe}}}),l=e.adjustScalarBytes||(L=>L),g=e.domain||((L,w,P)=>{if(w.length||P)throw new Error("Contexts/pre-hash are not supported");return L}),d=L=>typeof L=="bigint"&&fed(L)&&d(w)&&LL===fe||p(L,f);function x(L,w){if(p(L,w))return L;throw new Error(`Expected valid scalar < ${w}, got ${typeof L} ${L}`)}function v(L){return L===fe?L:x(L,n)}let m=new Map;function A(L){if(!(L instanceof S))throw new Error("ExtendedPoint expected")}class S{constructor(w,P,K,V){if(this.ex=w,this.ey=P,this.ez=K,this.et=V,!y(w))throw new Error("x required");if(!y(P))throw new Error("y required");if(!y(K))throw new Error("z required");if(!y(V))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(w){if(w instanceof S)throw new Error("extended point not allowed");let{x:P,y:K}=w||{};if(!y(P)||!y(K))throw new Error("invalid affine point");return new S(P,K,Qt,u(P*K))}static normalizeZ(w){let P=r.invertBatch(w.map(K=>K.ez));return w.map((K,V)=>K.toAffine(P[V])).map(S.fromAffine)}_setWindowSize(w){this._WINDOW_SIZE=w,m.delete(this)}assertValidity(){let{a:w,d:P}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:K,ey:V,ez:W,et:Y}=this,et=u(K*K),X=u(V*V),J=u(W*W),dt=u(J*J),ut=u(et*w),Ut=u(J*u(ut+X)),Kt=u(dt+u(P*u(et*X)));if(Ut!==Kt)throw new Error("bad point: equation left != right (1)");let Ct=u(K*V),Vt=u(W*Y);if(Ct!==Vt)throw new Error("bad point: equation left != right (2)")}equals(w){A(w);let{ex:P,ey:K,ez:V}=this,{ex:W,ey:Y,ez:et}=w,X=u(P*et),J=u(W*V),dt=u(K*et),ut=u(Y*V);return X===J&&dt===ut}is0(){return this.equals(S.ZERO)}negate(){return new S(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:w}=e,{ex:P,ey:K,ez:V}=this,W=u(P*P),Y=u(K*K),et=u(ui*u(V*V)),X=u(w*W),J=P+K,dt=u(u(J*J)-W-Y),ut=X+Y,Ut=ut-et,Kt=X-Y,Ct=u(dt*Ut),Vt=u(ut*Kt),Se=u(dt*Kt),tr=u(Ut*ut);return new S(Ct,Vt,tr,Se)}add(w){A(w);let{a:P,d:K}=e,{ex:V,ey:W,ez:Y,et}=this,{ex:X,ey:J,ez:dt,et:ut}=w;if(P===BigInt(-1)){let ia=u((W-V)*(J+X)),sa=u((W+V)*(J-X)),Yi=u(sa-ia);if(Yi===fe)return this.double();let oa=u(Y*ui*ut),aa=u(et*ui*dt),ca=aa+oa,fa=sa+ia,ua=aa-oa,du=u(ca*Yi),pu=u(fa*ua),yu=u(ca*ua),gu=u(Yi*fa);return new S(du,pu,gu,yu)}let Ut=u(V*X),Kt=u(W*J),Ct=u(et*K*ut),Vt=u(Y*dt),Se=u((V+W)*(X+J)-Ut-Kt),tr=Vt-Ct,rn=Vt+Ct,na=u(Kt-P*Ut),fu=u(Se*tr),uu=u(rn*na),hu=u(Se*na),lu=u(tr*rn);return new S(fu,uu,lu,hu)}subtract(w){return this.add(w.negate())}wNAF(w){return _.wNAFCached(this,m,w,S.normalizeZ)}multiply(w){let{p:P,f:K}=this.wNAF(x(w,n));return S.normalizeZ([P,K])[0]}multiplyUnsafe(w){let P=v(w);return P===fe?R:this.equals(R)||P===Qt?this:this.equals(B)?this.wNAF(P).p:_.unsafeLadder(this,P)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return _.unsafeLadder(this,n).is0()}toAffine(w){let{ex:P,ey:K,ez:V}=this,W=this.is0();w==null&&(w=W?Gh:r.inv(V));let Y=u(P*w),et=u(K*w),X=u(V*w);if(W)return{x:fe,y:Qt};if(X!==Qt)throw new Error("invZ was invalid");return{x:Y,y:et}}clearCofactor(){let{h:w}=e;return w===Qt?this:this.multiplyUnsafe(w)}static fromHex(w,P=!1){let{d:K,a:V}=e,W=r.BYTES;w=yt("pointHex",w,W);let Y=w.slice(),et=w[W-1];Y[W-1]=et&-129;let X=ce(Y);X===fe||(P?x(X,f):x(X,r.ORDER));let J=u(X*X),dt=u(J-Qt),ut=u(K*J-V),{isValid:Ut,value:Kt}=h(dt,ut);if(!Ut)throw new Error("Point.fromHex: invalid y coordinate");let Ct=(Kt&Qt)===Qt,Vt=(et&128)!==0;if(!P&&Kt===fe&&Vt)throw new Error("Point.fromHex: x=0 and x_0=1");return Vt!==Ct&&(Kt=u(-Kt)),S.fromAffine({x:Kt,y:X})}static fromPrivateKey(w){return U(w).point}toRawBytes(){let{x:w,y:P}=this.toAffine(),K=Te(P,r.BYTES);return K[K.length-1]|=w&Qt?128:0,K}toHex(){return Ce(this.toRawBytes())}}S.BASE=new S(e.Gx,e.Gy,Qt,u(e.Gx*e.Gy)),S.ZERO=new S(fe,Qt,Qt,fe);let{BASE:B,ZERO:R}=S,_=fi(S,a*8);function O(L){return at(L,n)}function M(L){return O(ce(L))}function U(L){let w=a;L=yt("private key",L,w);let P=yt("hashed private key",s(L),2*w),K=l(P.slice(0,w)),V=P.slice(w,2*w),W=M(K),Y=B.multiply(W),et=Y.toRawBytes();return{head:K,prefix:V,scalar:W,point:Y,pointBytes:et}}function q(L){return U(L).pointBytes}function z(L=new Uint8Array,...w){let P=_e(...w);return M(s(g(P,yt("context",L),!!i)))}function Z(L,w,P={}){L=yt("message",L),i&&(L=i(L));let{prefix:K,scalar:V,pointBytes:W}=U(w),Y=z(P.context,K,L),et=B.multiply(Y).toRawBytes(),X=z(P.context,et,W,L),J=O(Y+X*V);v(J);let dt=_e(et,Te(J,r.BYTES));return yt("result",dt,a*2)}let C=$h;function N(L,w,P,K=C){let{context:V,zip215:W}=K,Y=r.BYTES;L=yt("signature",L,2*Y),w=yt("message",w),i&&(w=i(w));let et=ce(L.slice(Y,2*Y)),X,J,dt;try{X=S.fromHex(P,W),J=S.fromHex(L.slice(0,Y),W),dt=B.multiplyUnsafe(et)}catch{return!1}if(!W&&X.isSmallOrder())return!1;let ut=z(V,J.toRawBytes(),X.toRawBytes(),w);return J.add(X.multiplyUnsafe(ut)).subtract(dt).clearCofactor().equals(S.ZERO)}return B._setWindowSize(8),{CURVE:e,getPublicKey:q,sign:Z,verify:N,ExtendedPoint:S,utils:{getExtendedPublicKey:U,randomPrivateKey:()=>o(r.BYTES),precompute(L=8,w=S.BASE){return w._setWindowSize(L),w.multiply(BigInt(3)),w}}}}var fn=BigInt(0),_s=BigInt(1);function Yh(t){return ee(t,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...t})}function Qa(t){let e=Yh(t),{P:r}=e,n=m=>at(m,r),i=e.montgomeryBits,s=Math.ceil(i/8),o=e.nByteLength,a=e.adjustScalarBytes||(m=>m),c=e.powPminus2||(m=>Bs(m,r-BigInt(2),r));function f(m,A,S){let B=n(m*(A-S));return A=n(A-B),S=n(S+B),[A,S]}function u(m){if(typeof m=="bigint"&&fn<=m&&m=fn;C--){let N=B>>C&_s;q^=N,z=f(q,_,M),_=z[0],M=z[1],z=f(q,O,U),O=z[0],U=z[1],q=N;let T=_+O,L=n(T*T),w=_-O,P=n(w*w),K=L-P,V=M+U,W=M-U,Y=n(W*T),et=n(V*w),X=Y+et,J=Y-et;M=n(X*X),U=n(R*n(J*J)),_=n(L*P),O=n(K*(L+n(h*K)))}z=f(q,_,M),_=z[0],M=z[1],z=f(q,O,U),O=z[0],U=z[1];let Z=c(O);return n(_*Z)}function g(m){return Te(n(m),s)}function d(m){let A=yt("u coordinate",m,s);return o===s&&(A[o-1]&=127),ce(A)}function p(m){let A=yt("scalar",m);if(A.length!==s&&A.length!==o)throw new Error(`Expected ${s} or ${o} bytes, got ${A.length}`);return ce(a(A))}function y(m,A){let S=d(A),B=p(m),R=l(S,B);if(R===fn)throw new Error("Invalid private or public key received");return g(R)}let x=g(e.Gu);function v(m){return y(m,x)}return{scalarMult:y,scalarMultBase:v,getSharedSecret:(m,A)=>y(m,A),getPublicKey:m=>v(m),utils:{randomPrivateKey:()=>e.randomBytes(e.nByteLength)},GuBytes:x}}var un=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Ja=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),Cx=BigInt(0),Zh=BigInt(1),Ls=BigInt(2),Xh=BigInt(5),ja=BigInt(10),Qh=BigInt(20),Jh=BigInt(40),t0=BigInt(80);function e0(t){let e=un,n=t*t%e*t%e,i=gt(n,Ls,e)*n%e,s=gt(i,Zh,e)*t%e,o=gt(s,Xh,e)*s%e,a=gt(o,ja,e)*o%e,c=gt(a,Qh,e)*a%e,f=gt(c,Jh,e)*c%e,u=gt(f,t0,e)*f%e,h=gt(u,t0,e)*f%e,l=gt(h,ja,e)*o%e;return{pow_p_5_8:gt(l,Ls,e)*t%e,b2:n}}function r0(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function jh(t,e){let r=un,n=at(e*e*e,r),i=at(n*n*e,r),s=e0(t*i).pow_p_5_8,o=at(t*n*s,r),a=at(e*o*o,r),c=o,f=at(o*Ja,r),u=a===t,h=a===at(-t,r),l=a===at(-t*Ja,r);return u&&(o=c),(h||l)&&(o=f),Wa(o,r)&&(o=at(-o,r)),{isValid:u||h,value:o}}var Le=ci(un,void 0,!0),Rs={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Le,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:bs,randomBytes:nr,adjustScalarBytes:r0,uvRatio:jh},Lr=hi(Rs);function n0(t,e,r){if(e.length>255)throw new Error("Context is too big");return ei(gs("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,e.length]),e,t)}var Ix=hi({...Rs,domain:n0}),Tx=hi({...Rs,domain:n0,prehash:bs}),hn=Qa({P:un,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:t=>{let e=un,{pow_p_5_8:r,b2:n}=e0(t);return at(gt(r,BigInt(3),e)*n,e)},adjustScalarBytes:r0,randomBytes:nr});var tl=(Le.ORDER+BigInt(3))/BigInt(8),_x=Le.pow(Ls,tl),Lx=Le.sqrt(Le.neg(Le.ONE)),Rx=(Le.ORDER-BigInt(5))/BigInt(8),Nx=BigInt(486662);var Dx=Ya(Le,Le.neg(BigInt(486664)));var kx=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Px=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Ux=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Kx=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var Ox=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var li=class extends Tr{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,on(e);let n=Fe(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew li(t,e).update(r).digest();Rr.create=(t,e)=>new li(t,e);function s0(t,e,r){return on(t),r===void 0&&(r=new Uint8Array(t.outputLen)),Rr(t,Fe(r),Fe(e))}var Ns=new Uint8Array([0]),i0=new Uint8Array;function o0(t,e,r,n=32){if(on(t),Jn(n),n>255*t.outputLen)throw new Error("Length should be <= 255*HashLen");let i=Math.ceil(n/t.outputLen);r===void 0&&(r=i0);let s=new Uint8Array(i*t.outputLen),o=Rr.create(t,e),a=o._cloneInto(),c=new Uint8Array(o.outputLen);for(let f=0;ft&e^~t&r,rl=(t,e,r)=>t&e^t&r^e&r,nl=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ze=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ge=new Uint32Array(64),Ds=class extends _r{constructor(){super(64,32,8,!1),this.A=ze[0]|0,this.B=ze[1]|0,this.C=ze[2]|0,this.D=ze[3]|0,this.E=ze[4]|0,this.F=ze[5]|0,this.G=ze[6]|0,this.H=ze[7]|0}get(){let{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let h=0;h<16;h++,r+=4)Ge[h]=e.getUint32(r,!1);for(let h=16;h<64;h++){let l=Ge[h-15],g=Ge[h-2],d=ae(l,7)^ae(l,18)^l>>>3,p=ae(g,17)^ae(g,19)^g>>>10;Ge[h]=p+Ge[h-7]+d+Ge[h-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:f,H:u}=this;for(let h=0;h<64;h++){let l=ae(a,6)^ae(a,11)^ae(a,25),g=u+l+el(a,c,f)+nl[h]+Ge[h]|0,p=(ae(n,2)^ae(n,13)^ae(n,22))+rl(n,i,s)|0;u=f,f=c,c=a,a=o+g|0,o=s,s=i,i=n,n=g+p|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,f=f+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,f,u)}roundClean(){Ge.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Nr=ri(()=>new Ds);var di={hashSHA256(t){return Nr(t)},getHKDF(t,e){let r=s0(Nr,e,t),i=o0(Nr,r,void 0,96),s=i.subarray(0,32),o=i.subarray(32,64),a=i.subarray(64,96);return[s,o,a]},generateX25519KeyPair(){let t=hn.utils.randomPrivateKey();return{publicKey:hn.getPublicKey(t),privateKey:t}},generateX25519KeyPairFromSeed(t){return{publicKey:hn.getPublicKey(t),privateKey:t}},generateX25519SharedKey(t,e){return hn.getSharedSecret(t,e)},chaCha20Poly1305Encrypt(t,e,r,n){return ps(n,e,r).encrypt(t)},chaCha20Poly1305Decrypt(t,e,r,n,i){return ps(n,e,r).decrypt(t,i)}};var a0=di;var Dr=t=>{let e=It(2);return new DataView(e.buffer,e.byteOffset,e.byteLength).setUint16(0,t,!1),e};Dr.bytes=2;var ln=t=>{if(t.length<2)throw RangeError("Could not decode int16BE");return t instanceof Uint8Array?new DataView(t.buffer,t.byteOffset,t.byteLength).getUint16(0,!1):t.getUint16(0)};ln.bytes=2;function c0(t){return new Rt(t.ne,t.ciphertext)}function f0(t){return new Rt(t.ne,t.ns,t.ciphertext)}function u0(t){return new Rt(t.ns,t.ciphertext)}function h0(t){if(t.length<32)throw new Error("Cannot decode stage 0 MessageBuffer: length less than 32 bytes.");return{ne:t.subarray(0,32),ciphertext:t.subarray(32,t.length),ns:rt(0)}}function l0(t){if(t.length<80)throw new Error("Cannot decode stage 1 MessageBuffer: length less than 80 bytes.");return{ne:t.subarray(0,32),ns:t.subarray(32,80),ciphertext:t.subarray(80,t.length)}}function d0(t){if(t.length<48)throw new Error("Cannot decode stage 2 MessageBuffer: length less than 48 bytes.");return{ne:rt(0),ns:t.subarray(0,48),ciphertext:t.subarray(48,t.length)}}var y0=16;function g0(t,e){return async function*(r){for await(let n of r)for(let i=0;in.length&&(s=n.length);let o=t.encrypt(n.subarray(i,s),t.session);e?.encryptedPackets.increment(),yield new Rt(Dr(o.byteLength),o)}}}function x0(t,e){return async function*(r){for await(let n of r)for(let i=0;in.length&&(s=n.length),s-y0Dp});function Tp(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,A=new Uint8Array(m);x!==v;){for(var S=d[x],B=0,R=m-1;(S!==0||B>>0,A[R]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");y=B,x++}for(var _=m-y;_!==m&&A[_]===0;)_++;for(var O=c.repeat(p);_>>0,m=new Uint8Array(v);d[p];){var A=r[d.charCodeAt(p)];if(A===255)return;for(var S=0,B=v-1;(A!==0||S>>0,m[B]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");x=S,p++}if(d[p]!==" "){for(var R=v-x;R!==v&&m[R]===0;)R++;for(var _=new Uint8Array(y+(v-R)),O=y;R!==v;)_[O++]=m[R++];return _}}}function g(d){var p=l(d);if(p)return p;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:l,decode:g}}var _p=Tp,Lp=_p,kc=Lp;var K2=new Uint8Array(0);var Pc=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var Uc=t=>new TextEncoder().encode(t),Kc=t=>new TextDecoder().decode(t);var ro=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},no=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Mc(this,e)}},io=class{constructor(e){this.decoders=e}or(e){return Mc(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Mc=(t,e)=>new io({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),so=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ro(e,r,n),this.decoder=new no(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Or=({name:t,prefix:e,encode:r,decode:n})=>new so(t,e,r,n),Xe=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=kc(r,e);return Or({prefix:t,name:e,encode:n,decode:s=>ke(i(s))})},Rp=(t,e,r,n)=>{let i={};for(let u=0;u=8&&(a-=8,o[f++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},Np=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<Or({prefix:e,name:t,encode(i){return Np(i,n,r)},decode(i){return Rp(i,n,r,t)}});var Dp=Xe({prefix:"9",name:"base10",alphabet:"0123456789"});var ao={};_t(ao,{base16:()=>kp,base16upper:()=>Pp});var kp=St({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Pp=St({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var co={};_t(co,{base2:()=>Up});var Up=St({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var fo={};_t(fo,{base256emoji:()=>Vp});var Fc=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Kp=Fc.reduce((t,e,r)=>(t[r]=e,t),[]),Op=Fc.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Mp(t){return t.reduce((e,r)=>(e+=Kp[r],e),"")}function Fp(t){let e=[];for(let r of t){let n=Op[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var Vp=Or({prefix:"\u{1F680}",name:"base256emoji",encode:Mp,decode:Fp});var uo={};_t(uo,{base32:()=>Qe,base32hex:()=>Gp,base32hexpad:()=>Wp,base32hexpadupper:()=>Yp,base32hexupper:()=>$p,base32pad:()=>qp,base32padupper:()=>zp,base32upper:()=>Hp,base32z:()=>Zp});var Qe=St({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Hp=St({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),qp=St({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),zp=St({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Gp=St({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),$p=St({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Wp=St({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Yp=St({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Zp=St({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ho={};_t(ho,{base36:()=>Xp,base36upper:()=>Qp});var Xp=Xe({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Qp=Xe({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var lo={};_t(lo,{base58btc:()=>Mt,base58flickr:()=>Jp});var Mt=Xe({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Jp=Xe({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var po={};_t(po,{base64:()=>Mr,base64pad:()=>jp,base64url:()=>ty,base64urlpad:()=>ey});var Mr=St({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),jp=St({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ty=St({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ey=St({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var yo={};_t(yo,{base8:()=>ry});var ry=St({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var go={};_t(go,{identity:()=>ny});var ny=Or({prefix:"\0",name:"identity",encode:t=>Kc(t),decode:t=>Uc(t)});var J2=new TextEncoder,j2=new TextDecoder;var mo={};_t(mo,{identity:()=>Je});var oy=qc,Vc=128,ay=127,cy=~ay,fy=Math.pow(2,31);function qc(t,e,r){e=e||[],r=r||0;for(var n=r;t>=fy;)e[r++]=t&255|Vc,t/=128;for(;t&cy;)e[r++]=t&255|Vc,t>>>=7;return e[r]=t|0,qc.bytes=r-n+1,e}var uy=xo,hy=128,Hc=127;function xo(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw xo.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&Hc)<=hy);return xo.bytes=s-n,r}var ly=Math.pow(2,7),dy=Math.pow(2,14),py=Math.pow(2,21),yy=Math.pow(2,28),gy=Math.pow(2,35),xy=Math.pow(2,42),my=Math.pow(2,49),by=Math.pow(2,56),vy=Math.pow(2,63),wy=function(t){return t[wn.decode(t,e),wn.decode.bytes],Fr=(t,e,r=0)=>(wn.encode(t,e,r),e),Vr=t=>wn.encodingLength(t);var ve=(t,e)=>{let r=e.byteLength,n=Vr(t),i=n+Vr(r),s=new Uint8Array(i+r);return Fr(t,s,0),Fr(r,s,n),s.set(e,i),new Hr(t,r,e,s)},Sn=t=>{let e=ke(t),[r,n]=En(e),[i,s]=En(e.subarray(n)),o=e.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new Hr(r,i,o,e)},zc=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&Pc(t.bytes,r.bytes)}},Hr=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var Gc=0,By="identity",$c=ke,Ay=t=>ve(Gc,$c(t)),Je={code:Gc,name:By,encode:$c,digest:Ay};var wo={};_t(wo,{sha256:()=>Ft,sha512:()=>Cy});var vo=({name:t,code:e,encode:r})=>new bo(t,e,r),bo=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?ve(this.code,r):r.then(n=>ve(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Yc=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Ft=vo({name:"sha2-256",code:18,encode:Yc("SHA-256")}),Cy=vo({name:"sha2-512",code:19,encode:Yc("SHA-512")});var Zc=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return Ty(r,Eo(t),e||Mt.encoder);default:return _y(r,Eo(t),e||Qe.encoder)}};var Xc=new WeakMap,Eo=t=>{let e=Xc.get(t);if(e==null){let r=new Map;return Xc.set(t,r),r}return e},lr=class t{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==Bn)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Ly)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=ve(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&zc(e.multihash,n.multihash)}toString(e){return Zc(this,e)}toJSON(){return{"/":Zc(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new t(n,i,s,o||Qc(n,i,s.bytes))}else if(r[Ry]===!0){let{version:n,multihash:i,code:s}=r,o=Sn(i);return t.create(n,s,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==Bn)throw new Error(`Version 0 CID must use dag-pb (code: ${Bn}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=Qc(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,Bn,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=ke(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new Hr(r.multihashCode,r.digestSize,s,i);return[r.version===0?t.createV0(o):t.createV1(r.codec,o),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,l]=En(e.subarray(r));return r+=l,h},i=n(),s=Bn;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),c=n(),f=r+c,u=f-o;return{version:i,codec:s,multihashCode:a,digestSize:c,multihashSize:u,size:f}}static parse(e,r){let[n,i]=Iy(e,r),s=t.decode(i);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Eo(s).set(n,e),s}},Iy=(t,e)=>{switch(t[0]){case"Q":{let r=e||Mt;return[Mt.prefix,r.decode(`${Mt.prefix}${t}`)]}case Mt.prefix:{let r=e||Mt;return[Mt.prefix,r.decode(t)]}case Qe.prefix:{let r=e||Qe;return[Qe.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},Ty=(t,e,r)=>{let{prefix:n}=r;if(n!==Mt.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let s=r.encode(t).slice(1);return e.set(n,s),s}else return i},_y=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let s=r.encode(t);return e.set(n,s),s}else return i},Bn=112,Ly=18,Qc=(t,e,r)=>{let n=Vr(t),i=n+Vr(e),s=new Uint8Array(i+r.byteLength);return Fr(t,s,0),Fr(e,s,n),s.set(r,i),s},Ry=Symbol.for("@ipld/js-cid/CID");var zr={...go,...co,...yo,...oo,...ao,...uo,...ho,...lo,...po,...fo},ym={...wo,...mo};function jc(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var Jc=jc("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),So=jc("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);let e=It(t.length);for(let r=0;rmr,Ed25519PublicKey:()=>Tn,generateKeyPair:()=>zy,generateKeyPairFromSeed:()=>yf,unmarshalEd25519PrivateKey:()=>Hy,unmarshalEd25519PublicKey:()=>qy});var Gr=32,Pe=64,ki=32;async function tf(){let t=Lr.utils.randomPrivateKey(),e=Lr.getPublicKey(t);return{privateKey:sf(t,e),publicKey:e}}async function ef(t){if(t.length!==ki)throw new TypeError('"seed" must be 32 bytes in length.');if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');let e=t,r=Lr.getPublicKey(e);return{privateKey:sf(e,r),publicKey:r}}async function rf(t,e){let r=t.subarray(0,ki);return Lr.sign(e,r)}async function nf(t,e,r){return Lr.verify(e,r,t)}function sf(t,e){let r=new Uint8Array(Pe);for(let n=0;n>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return dr;if(ePy)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,i=e-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>hf&&(i=0n,++n>hf&&(n=0n))),new t(Number(i),Number(n))}static fromNumber(e){if(e===0)return dr;let r=e<0;r&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new t(n,i)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):dr}},dr=new Xt(0,0);dr.toBigInt=function(){return 0n};dr.zzEncode=dr.zzDecode=function(){return this};dr.length=function(){return 1};var hf=4294967296n;function lf(t){let e=0,r=0;for(let n=0;n191&&a<224?s[o++]=(a&31)<<6|t[e++]&63:a>239&&a<365?(a=((a&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,s[o++]=55296+(a>>10),s[o++]=56320+(a&1023)):s[o++]=(a&15)<<12|(t[e++]&63)<<6|t[e++]&63,o>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,s)),o=0);return i!=null?(o>0&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))}function To(t,e,r){let n=r,i,s;for(let o=0;o>6|192,e[r++]=i&63|128):(i&64512)===55296&&((s=t.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(s&1023),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128);return r-n}function le(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Pi(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var _o=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,le(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw le(this,4);return Pi(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw le(this,4);return Pi(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw le(this,4);let e=cf(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw le(this,4);let e=uf(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw le(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return df(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw le(this,e);this.pos+=e}else do if(this.pos>=this.len)throw le(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Xt(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw le(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw le(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw le(this,8);let e=Pi(this.buf,this.pos+=4),r=Pi(this.buf,this.pos+=4);return new Xt(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Lo(t){return new _o(t instanceof Uint8Array?t:t.subarray())}function pr(t,e){let r=Lo(t);return e.decode(r)}function Ro(t){let e=t??8192,r=e>>>1,n,i=e;return function(o){if(o<1||o>r)return It(o);i+o>e&&(n=It(e),i=0);let a=n.subarray(i,i+=o);return i&7&&(i=(i|7)+1),a}}var yr=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function No(){}var ko=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},Uy=Ro();function Ky(t){return globalThis.Buffer!=null?It(t):Uy(t)}var In=class{len;head;tail;states;constructor(){this.len=0,this.head=new yr(No,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new yr(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new Po((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(An,10,Xt.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=Xt.fromBigInt(e);return this._push(An,r.length(),r)}uint64Number(e){let r=Xt.fromNumber(e);return this._push(An,r.length(),r)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=Xt.fromBigInt(e).zzEncode();return this._push(An,r.length(),r)}sint64Number(e){let r=Xt.fromNumber(e).zzEncode();return this._push(An,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(Do,1,e?1:0)}fixed32(e){return this._push(Cn,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=Xt.fromBigInt(e);return this._push(Cn,4,r.lo)._push(Cn,4,r.hi)}fixed64Number(e){let r=Xt.fromNumber(e);return this._push(Cn,4,r.lo)._push(Cn,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(af,4,e)}double(e){return this._push(ff,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(Do,1,0):this.uint32(r)._push(My,r,e)}string(e){let r=lf(e);return r!==0?this.uint32(r)._push(To,r,e):this._push(Do,1,0)}fork(){return this.states=new ko(this),this.head=this.tail=new yr(No,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new yr(No,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=Ky(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function Do(t,e,r){e[r]=t&255}function Oy(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var Po=class extends yr{next;constructor(e,r){super(Oy,e,r),this.next=void 0}};function An(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function Cn(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function My(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(In.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(Fy,e,t),this},In.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(Vy,e,t),this});function Fy(t,e,r){e.set(t,r)}function Vy(t,e,r){t.length<40?To(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(At(t),r)}function Uo(){return new In}function gr(t,e){let r=Uo();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var Wr;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(Wr||(Wr={}));function Ui(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function Ko(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(s,o){let a=e(s);o.int32(a)},n=function(s){let o=s.int32();return e(o)};return Ui("enum",Wr.VARINT,r,n)}function xr(t,e){return Ui("message",Wr.LENGTH_DELIMITED,t,e)}var wt;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.Secp256k1="Secp256k1"})(wt||(wt={}));var Oo;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.Secp256k1=2]="Secp256k1"})(Oo||(Oo={}));(function(t){t.codec=()=>Ko(Oo)})(wt||(wt={}));var we;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),wt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=wt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(we||(we={}));var Ee;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),wt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=wt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Ee||(Ee={}));var Tn=class{_key;constructor(e){this._key=Yr(e,Gr)}async verify(e,r){return nf(this._key,r,e)}marshal(){return this._key}get bytes(){return we.encode({Type:wt.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},mr=class{_key;_publicKey;constructor(e,r){this._key=Yr(e,Pe),this._publicKey=Yr(r,Gr)}async sign(e){return rf(this._key,e)}get public(){return new Tn(this._publicKey)}marshal(){return this._key}get bytes(){return Ee.encode({Type:wt.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=Je.digest(this.public.bytes);return Mt.encode(e.bytes).substring(1)}async export(e,r="libp2p-key"){if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function Hy(t){if(t.length>Pe){t=Yr(t,Pe+Gr);let n=t.subarray(0,Pe),i=t.subarray(Pe,t.length);return new mr(n,i)}t=Yr(t,Pe);let e=t.subarray(0,Pe),r=t.subarray(Gr);return new mr(e,r)}function qy(t){return t=Yr(t,Gr),new Tn(t)}async function zy(){let{privateKey:t,publicKey:e}=await tf();return new mr(t,e)}async function yf(t){let{privateKey:e,publicKey:r}=await ef(t);return new mr(e,r)}function Yr(t,e){if(t=Uint8Array.from(t??[]),t.length!==e)throw new it(`Key must be a Uint8Array of length ${e}, got ${t.length}`,"ERR_INVALID_KEY_TYPE");return t}function Et(t,e="utf8"){let r=Di[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var pb=zt(Bt(),1),yb=zt(Ti(),1),gf=zt(lt(),1);function de(t,e){let r=Uint8Array.from(t.abs().toByteArray());if(r=r[0]===0?r.subarray(1):r,e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Gt([new Uint8Array(e-r.length),r])}return Et(r,"base64url")}function Jt(t){let e=xf(t);return new gf.default.jsbn.BigInteger(Et(e,"base16"),16)}function xf(t,e){let r=At(t,"base64urlpad");if(e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Gt([new Uint8Array(e-r.length),r])}return r}var Gy={"P-256":256,"P-384":384,"P-521":521},$y=Object.keys(Gy),Cb=$y.join(" / ");var zo={};_t(zo,{MAX_KEY_SIZE:()=>Nn,RsaPrivateKey:()=>Zr,RsaPublicKey:()=>Rn,fromJwk:()=>n1,generateKeyPair:()=>i1,unmarshalRsaPrivateKey:()=>e1,unmarshalRsaPublicKey:()=>r1});var Ln=zt(lt(),1);var uv=zt(Ef(),1);function Oi(t){if(isNaN(t)||t<=0)throw new it("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return nr(t)}var $b=zt(Ri(),1),Ho=zt(lt(),1);function Sf(t,e){return e.map(r=>Jt(t[r]))}function Bf(t){return Ho.default.pki.setRsaPrivateKey(...Sf(t,["n","e","d","p","q","dp","dq","qi"]))}function Af(t){return Ho.default.pki.setRsaPublicKey(...Sf(t,["n","e"]))}var vr={};_t(vr,{jwkToPkcs1:()=>Xy,jwkToPkix:()=>Jy,pkcs1ToJwk:()=>Zy,pkixToJwk:()=>Qy});var Zb=zt(mn(),1),Xb=zt(Ri(),1);var Ue=zt(lt(),1);function Zy(t){let e=Ue.default.asn1.fromDer(Et(t,"ascii")),r=Ue.default.pki.privateKeyFromAsn1(e);return{kty:"RSA",n:de(r.n),e:de(r.e),d:de(r.d),p:de(r.p),q:de(r.q),dp:de(r.dP),dq:de(r.dQ),qi:de(r.qInv),alg:"RS256"}}function Xy(t){if(t.n==null||t.e==null||t.d==null||t.p==null||t.q==null||t.dp==null||t.dq==null||t.qi==null)throw new it("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ue.default.pki.privateKeyToAsn1({n:Jt(t.n),e:Jt(t.e),d:Jt(t.d),p:Jt(t.p),q:Jt(t.q),dP:Jt(t.dp),dQ:Jt(t.dq),qInv:Jt(t.qi)});return At(Ue.default.asn1.toDer(e).getBytes(),"ascii")}function Qy(t){let e=Ue.default.asn1.fromDer(Et(t,"ascii")),r=Ue.default.pki.publicKeyFromAsn1(e);return{kty:"RSA",n:de(r.n),e:de(r.e)}}function Jy(t){if(t.n==null||t.e==null)throw new it("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ue.default.pki.publicKeyToAsn1({n:Jt(t.n),e:Jt(t.e)});return At(Ue.default.asn1.toDer(e).getBytes(),"ascii")}async function Cf(t){let e=await Zt.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await _f(e);return{privateKey:r[0],publicKey:r[1]}}async function qo(t){let r=[await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await jy(t)],n=await _f({privateKey:r[0],publicKey:r[1]});return{privateKey:n[0],publicKey:n[1]}}async function If(t,e){let r=await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),n=await Zt.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(e));return new Uint8Array(n,0,n.byteLength)}async function Tf(t,e,r){let n=await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return Zt.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},n,e,r)}async function _f(t){if(t.privateKey==null||t.publicKey==null)throw new it("Private and public key are required","ERR_INVALID_PARAMETERS");return Promise.all([Zt.get().subtle.exportKey("jwk",t.privateKey),Zt.get().subtle.exportKey("jwk",t.publicKey)])}async function jy(t){return Zt.get().subtle.importKey("jwk",{kty:t.kty,n:t.n,e:t.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}function Lf(t,e,r,n){let i=e?Af(t):Bf(t),s=Et(Uint8Array.from(r),"ascii"),o=n(s,i);return At(o,"ascii")}function Rf(t,e){return Lf(t,!0,e,(r,n)=>n.encrypt(r))}function Nf(t,e){return Lf(t,!1,e,(r,n)=>n.decrypt(r))}function Mi(t){if(t.kty!=="RSA")throw new it("invalid key type","ERR_INVALID_KEY_TYPE");if(t.n==null)throw new it("invalid key modulus","ERR_INVALID_KEY_MODULUS");return At(t.n,"base64url").length*8}var Nn=8192,Rn=class{_key;constructor(e){this._key=e}async verify(e,r){return Tf(this._key,r,e)}marshal(){return vr.jwkToPkix(this._key)}get bytes(){return we.encode({Type:wt.RSA,Data:this.marshal()}).subarray()}encrypt(e){return Rf(this._key,e)}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},Zr=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r}genSecret(){return Oi(16)}async sign(e){return If(this._key,e)}get public(){if(this._publicKey==null)throw new it("public key not provided","ERR_PUBKEY_NOT_PROVIDED");return new Rn(this._publicKey)}decrypt(e){return Nf(this._key,e)}marshal(){return vr.jwkToPkcs1(this._key)}get bytes(){return Ee.encode({Type:wt.RSA,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=await this.public.hash();return Et(e,"base58btc")}async export(e,r="pkcs-8"){if(r==="pkcs-8"){let n=new Ln.default.util.ByteBuffer(this.marshal()),i=Ln.default.asn1.fromDer(n),s=Ln.default.pki.privateKeyFromAsn1(i),o={algorithm:"aes256",count:1e4,saltSize:128/8,prfAlgorithm:"sha512"};return Ln.default.pki.encryptRsaPrivateKey(s,e,o)}else{if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}}};async function e1(t){let e=vr.pkcs1ToJwk(t);if(Mi(e)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let r=await qo(e);return new Zr(r.privateKey,r.publicKey)}function r1(t){let e=vr.pkixToJwk(t);if(Mi(e)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");return new Rn(e)}async function n1(t){if(Mi(t)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await qo(t);return new Zr(e.privateKey,e.publicKey)}async function i1(t){if(t>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await Cf(t);return new Zr(e.privateKey,e.publicKey)}var Yo={};_t(Yo,{Secp256k1PrivateKey:()=>kn,Secp256k1PublicKey:()=>Dn,generateKeyPair:()=>g1,unmarshalSecp256k1PrivateKey:()=>p1,unmarshalSecp256k1PublicKey:()=>y1});function s1(t){let e=cn(t);ee(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:o1,hexToBytes:a1}=oi,wr={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){let{Err:e}=wr;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:o1(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=wr,r=typeof t=="string"?a1(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:s}=wr._parseInt(r.subarray(2)),{d:o,l:a}=wr._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){let e=f=>Number.parseInt(f[0],16)&8?"00"+f:f,r=f=>{let u=f.toString(16);return u.length&1?`0${u}`:u},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},Ke=BigInt(0),ie=BigInt(1),gv=BigInt(2),Df=BigInt(3),xv=BigInt(4);function c1(t){let e=s1(t),{Fp:r}=e,n=e.toBytes||((d,p,y)=>{let x=p.toAffine();return _e(Uint8Array.from([4]),r.toBytes(x.x),r.toBytes(x.y))}),i=e.fromBytes||(d=>{let p=d.subarray(1),y=r.fromBytes(p.subarray(0,r.BYTES)),x=r.fromBytes(p.subarray(r.BYTES,2*r.BYTES));return{x:y,y:x}});function s(d){let{a:p,b:y}=e,x=r.sqr(d),v=r.mul(x,d);return r.add(r.add(v,r.mul(d,p)),y)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(d){return typeof d=="bigint"&&Ker.eql(m,r.ZERO);return v(y)&&v(x)?h.ZERO:new h(y,x,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){let y=r.invertBatch(p.map(x=>x.pz));return p.map((x,v)=>x.toAffine(y[v])).map(h.fromAffine)}static fromHex(p){let y=h.fromAffine(i(yt("pointHex",p)));return y.assertValidity(),y}static fromPrivateKey(p){return h.BASE.multiply(c(p))}_setWindowSize(p){this._WINDOW_SIZE=p,f.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:p,y}=this.toAffine();if(!r.isValid(p)||!r.isValid(y))throw new Error("bad point: x or y not FE");let x=r.sqr(y),v=s(p);if(!r.eql(x,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:p}=this.toAffine();if(r.isOdd)return!r.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){u(p);let{px:y,py:x,pz:v}=this,{px:m,py:A,pz:S}=p,B=r.eql(r.mul(y,S),r.mul(m,v)),R=r.eql(r.mul(x,S),r.mul(A,v));return B&&R}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){let{a:p,b:y}=e,x=r.mul(y,Df),{px:v,py:m,pz:A}=this,S=r.ZERO,B=r.ZERO,R=r.ZERO,_=r.mul(v,v),O=r.mul(m,m),M=r.mul(A,A),U=r.mul(v,m);return U=r.add(U,U),R=r.mul(v,A),R=r.add(R,R),S=r.mul(p,R),B=r.mul(x,M),B=r.add(S,B),S=r.sub(O,B),B=r.add(O,B),B=r.mul(S,B),S=r.mul(U,S),R=r.mul(x,R),M=r.mul(p,M),U=r.sub(_,M),U=r.mul(p,U),U=r.add(U,R),R=r.add(_,_),_=r.add(R,_),_=r.add(_,M),_=r.mul(_,U),B=r.add(B,_),M=r.mul(m,A),M=r.add(M,M),_=r.mul(M,U),S=r.sub(S,_),R=r.mul(M,O),R=r.add(R,R),R=r.add(R,R),new h(S,B,R)}add(p){u(p);let{px:y,py:x,pz:v}=this,{px:m,py:A,pz:S}=p,B=r.ZERO,R=r.ZERO,_=r.ZERO,O=e.a,M=r.mul(e.b,Df),U=r.mul(y,m),q=r.mul(x,A),z=r.mul(v,S),Z=r.add(y,x),C=r.add(m,A);Z=r.mul(Z,C),C=r.add(U,q),Z=r.sub(Z,C),C=r.add(y,v);let N=r.add(m,S);return C=r.mul(C,N),N=r.add(U,z),C=r.sub(C,N),N=r.add(x,v),B=r.add(A,S),N=r.mul(N,B),B=r.add(q,z),N=r.sub(N,B),_=r.mul(O,C),B=r.mul(M,z),_=r.add(B,_),B=r.sub(q,_),_=r.add(q,_),R=r.mul(B,_),q=r.add(U,U),q=r.add(q,U),z=r.mul(O,z),C=r.mul(M,C),q=r.add(q,z),z=r.sub(U,z),z=r.mul(O,z),C=r.add(C,z),U=r.mul(q,C),R=r.add(R,U),U=r.mul(N,C),B=r.mul(Z,B),B=r.sub(B,U),U=r.mul(Z,q),_=r.mul(N,_),_=r.add(_,U),new h(B,R,_)}subtract(p){return this.add(p.negate())}is0(){return this.equals(h.ZERO)}wNAF(p){return g.wNAFCached(this,f,p,y=>{let x=r.invertBatch(y.map(v=>v.pz));return y.map((v,m)=>v.toAffine(x[m])).map(h.fromAffine)})}multiplyUnsafe(p){let y=h.ZERO;if(p===Ke)return y;if(a(p),p===ie)return this;let{endo:x}=e;if(!x)return g.unsafeLadder(this,p);let{k1neg:v,k1:m,k2neg:A,k2:S}=x.splitScalar(p),B=y,R=y,_=this;for(;m>Ke||S>Ke;)m&ie&&(B=B.add(_)),S&ie&&(R=R.add(_)),_=_.double(),m>>=ie,S>>=ie;return v&&(B=B.negate()),A&&(R=R.negate()),R=new h(r.mul(R.px,x.beta),R.py,R.pz),B.add(R)}multiply(p){a(p);let y=p,x,v,{endo:m}=e;if(m){let{k1neg:A,k1:S,k2neg:B,k2:R}=m.splitScalar(y),{p:_,f:O}=this.wNAF(S),{p:M,f:U}=this.wNAF(R);_=g.constTimeNegate(A,_),M=g.constTimeNegate(B,M),M=new h(r.mul(M.px,m.beta),M.py,M.pz),x=_.add(M),v=O.add(U)}else{let{p:A,f:S}=this.wNAF(y);x=A,v=S}return h.normalizeZ([x,v])[0]}multiplyAndAddUnsafe(p,y,x){let v=h.BASE,m=(S,B)=>B===Ke||B===ie||!S.equals(v)?S.multiplyUnsafe(B):S.multiply(B),A=m(this,y).add(m(p,x));return A.is0()?void 0:A}toAffine(p){let{px:y,py:x,pz:v}=this,m=this.is0();p==null&&(p=m?r.ONE:r.inv(v));let A=r.mul(y,p),S=r.mul(x,p),B=r.mul(v,p);if(m)return{x:r.ZERO,y:r.ZERO};if(!r.eql(B,r.ONE))throw new Error("invZ was invalid");return{x:A,y:S}}isTorsionFree(){let{h:p,isTorsionFree:y}=e;if(p===ie)return!0;if(y)return y(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:p,clearCofactor:y}=e;return p===ie?this:y?y(h,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),n(h,this,p)}toHex(p=!0){return Ce(this.toRawBytes(p))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);let l=e.nBitLength,g=fi(h,e.endo?Math.ceil(l/2):l);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function f1(t){let e=cn(t);return ee(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function kf(t){let e=f1(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(C){return KeCe(qe(C,e.nByteLength));function d(C){let N=n>>ie;return C>N}function p(C){return d(C)?a(-C):C}let y=(C,N,T)=>Ie(C.slice(N,T));class x{constructor(N,T,L){this.r=N,this.s=T,this.recovery=L,this.assertValidity()}static fromCompact(N){let T=e.nByteLength;return N=yt("compactSignature",N,T*2),new x(y(N,0,T),y(N,T,2*T))}static fromDER(N){let{r:T,s:L}=wr.toSig(yt("DER",N));return new x(T,L)}assertValidity(){if(!l(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!l(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(N){return new x(this.r,this.s,N)}recoverPublicKey(N){let{r:T,s:L,recovery:w}=this,P=R(yt("msgHash",N));if(w==null||![0,1,2,3].includes(w))throw new Error("recovery id invalid");let K=w===2||w===3?T+e.n:T;if(K>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let V=w&1?"03":"02",W=f.fromHex(V+g(K)),Y=c(K),et=a(-P*Y),X=a(L*Y),J=f.BASE.multiplyAndAddUnsafe(W,et,X);if(!J)throw new Error("point at infinify");return J.assertValidity(),J}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return ir(this.toDERHex())}toDERHex(){return wr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ir(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}let v={isValidPrivateKey(C){try{return u(C),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let C=Is(e.n);return Xa(e.randomBytes(C),e.n)},precompute(C=8,N=f.BASE){return N._setWindowSize(C),N.multiply(BigInt(3)),N}};function m(C,N=!0){return f.fromPrivateKey(C).toRawBytes(N)}function A(C){let N=C instanceof Uint8Array,T=typeof C=="string",L=(N||T)&&C.length;return N?L===i||L===s:T?L===2*i||L===2*s:C instanceof f}function S(C,N,T=!0){if(A(C))throw new Error("first arg must be private key");if(!A(N))throw new Error("second arg must be public key");return f.fromHex(N).multiply(u(C)).toRawBytes(T)}let B=e.bits2int||function(C){let N=Ie(C),T=C.length*8-e.nBitLength;return T>0?N>>BigInt(T):N},R=e.bits2int_modN||function(C){return a(B(C))},_=an(e.nBitLength);function O(C){if(typeof C!="bigint")throw new Error("bigint expected");if(!(Ke<=C&&C<_))throw new Error(`bigint expected < 2^${e.nBitLength}`);return qe(C,e.nByteLength)}function M(C,N,T=U){if(["recovered","canonical"].some(ut=>ut in T))throw new Error("sign() legacy options not supported");let{hash:L,randomBytes:w}=e,{lowS:P,prehash:K,extraEntropy:V}=T;P==null&&(P=!0),C=yt("msgHash",C),K&&(C=yt("prehashed msgHash",L(C)));let W=R(C),Y=u(N),et=[O(Y),O(W)];if(V!=null){let ut=V===!0?w(r.BYTES):V;et.push(yt("extraEntropy",ut))}let X=_e(...et),J=W;function dt(ut){let Ut=B(ut);if(!l(Ut))return;let Kt=c(Ut),Ct=f.BASE.multiply(Ut).toAffine(),Vt=a(Ct.x);if(Vt===Ke)return;let Se=a(Kt*a(J+Vt*Y));if(Se===Ke)return;let tr=(Ct.x===Vt?0:2)|Number(Ct.y&ie),rn=Se;return P&&d(Se)&&(rn=p(Se),tr^=1),new x(Vt,rn,tr)}return{seed:X,k2sig:dt}}let U={lowS:e.lowS,prehash:!1},q={lowS:e.lowS,prehash:!1};function z(C,N,T=U){let{seed:L,k2sig:w}=M(C,N,T),P=e;return Es(P.hash.outputLen,P.nByteLength,P.hmac)(L,w)}f.BASE._setWindowSize(8);function Z(C,N,T,L=q){let w=C;if(N=yt("msgHash",N),T=yt("publicKey",T),"strict"in L)throw new Error("options.strict was renamed to lowS");let{lowS:P,prehash:K}=L,V,W;try{if(typeof w=="string"||w instanceof Uint8Array)try{V=x.fromDER(w)}catch(Ct){if(!(Ct instanceof wr.Err))throw Ct;V=x.fromCompact(w)}else if(typeof w=="object"&&typeof w.r=="bigint"&&typeof w.s=="bigint"){let{r:Ct,s:Vt}=w;V=new x(Ct,Vt)}else throw new Error("PARSE");W=f.fromHex(T)}catch(Ct){if(Ct.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(P&&V.hasHighS())return!1;K&&(N=e.hash(N));let{r:Y,s:et}=V,X=R(N),J=c(et),dt=a(X*J),ut=a(Y*J),Ut=f.BASE.multiplyAndAddUnsafe(W,dt,ut)?.toAffine();return Ut?a(Ut.x)===Y:!1}return{CURVE:e,getPublicKey:m,getSharedSecret:S,sign:z,verify:Z,ProjectivePoint:f,Signature:x,utils:v}}function u1(t){return{hash:t,hmac:(e,...r)=>Rr(t,e,ei(...r)),randomBytes:nr}}function Pf(t,e){let r=n=>kf({...t,...u1(n)});return Object.freeze({...r(e),create:r})}var Of=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Uf=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h1=BigInt(1),Go=BigInt(2),Kf=(t,e)=>(t+e/Go)/e;function l1(t){let e=Of,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),f=t*t*t%e,u=f*f*t%e,h=gt(u,r,e)*u%e,l=gt(h,r,e)*u%e,g=gt(l,Go,e)*f%e,d=gt(g,i,e)*g%e,p=gt(d,s,e)*d%e,y=gt(p,a,e)*p%e,x=gt(y,c,e)*y%e,v=gt(x,a,e)*p%e,m=gt(v,r,e)*u%e,A=gt(m,o,e)*d%e,S=gt(A,n,e)*f%e,B=gt(S,Go,e);if(!$o.eql($o.sqr(B),t))throw new Error("Cannot find square root");return B}var $o=ci(Of,void 0,void 0,{sqrt:l1}),Oe=Pf({a:BigInt(0),b:BigInt(7),Fp:$o,n:Uf,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=Uf,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-h1*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=Kf(s*t,e),c=Kf(-n*t,e),f=at(t-a*r-c*i,e),u=at(-a*n-c*s,e),h=f>o,l=u>o;if(h&&(f=e-f),l&&(u=e-u),f>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:f,k2neg:l,k2:u}}}},Nr),Cv=BigInt(0);var Iv=Oe.ProjectivePoint;function Mf(){return Oe.utils.randomPrivateKey()}async function Ff(t,e){let{digest:r}=await Ft.digest(e);try{return Oe.sign(r,t).toDERRawBytes()}catch(n){throw new it(String(n),"ERR_INVALID_INPUT")}}async function Vf(t,e,r){try{let{digest:n}=await Ft.digest(r);return Oe.verify(e,n,t)}catch(n){throw new it(String(n),"ERR_INVALID_INPUT")}}function Hf(t){return Oe.ProjectivePoint.fromHex(t).toRawBytes(!0)}function qf(t){try{Oe.getPublicKey(t,!0)}catch(e){throw new it(String(e),"ERR_INVALID_PRIVATE_KEY")}}function Wo(t){try{Oe.ProjectivePoint.fromHex(t)}catch(e){throw new it(String(e),"ERR_INVALID_PUBLIC_KEY")}}function zf(t){try{return Oe.getPublicKey(t,!0)}catch(e){throw new it(String(e),"ERR_INVALID_PRIVATE_KEY")}}var Dn=class{_key;constructor(e){Wo(e),this._key=e}async verify(e,r){return Vf(this._key,r,e)}marshal(){return Hf(this._key)}get bytes(){return we.encode({Type:wt.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},kn=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r??zf(e),qf(this._key),Wo(this._publicKey)}async sign(e){return Ff(this._key,e)}get public(){return new Dn(this._publicKey)}marshal(){return this._key}get bytes(){return Ee.encode({Type:wt.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=await this.public.hash();return Et(e,"base58btc")}async export(e,r="libp2p-key"){if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function p1(t){return new kn(t)}function y1(t){return new Dn(t)}async function g1(){let t=Mf();return new kn(t)}var Er={rsa:zo,ed25519:Mo,secp256k1:Yo};function Gf(t){let e=Object.keys(Er).join(" / ");return new it(`invalid or unsupported key type ${t}. Must be ${e}`,"ERR_UNSUPPORTED_KEY_TYPE")}function $f(t){let e=we.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case wt.RSA:return Er.rsa.unmarshalRsaPublicKey(r);case wt.Ed25519:return Er.ed25519.unmarshalEd25519PublicKey(r);case wt.Secp256k1:return Er.secp256k1.unmarshalSecp256k1PublicKey(r);default:throw Gf(e.Type??"unknown")}}async function Wf(t){let e=Ee.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case wt.RSA:return Er.rsa.unmarshalRsaPrivateKey(r);case wt.Ed25519:return Er.ed25519.unmarshalEd25519PrivateKey(r);case wt.Secp256k1:return Er.secp256k1.unmarshalSecp256k1PrivateKey(r);default:throw Gf(e.Type??"RSA")}}var Yf=Symbol.for("@libp2p/peer-id");var m1=Symbol.for("nodejs.util.inspect.custom"),Zf=Object.values(zr).map(t=>t.decoder).reduce((t,e)=>t.or(e),zr.identity.decoder),Xf=114,Zo=36,Xo=37,Pn=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[Yf]=!0;toString(){return this.string==null&&(this.string=Mt.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return lr.createV1(Xf,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return Lt(this.multihash.bytes,e);if(typeof e=="string")return b1(e).equals(this);if(e?.multihash?.bytes!=null)return Lt(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[m1](){return`PeerId(${this.toString()})`}},Xr=class extends Pn{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},Qr=class extends Pn{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},Jr=class extends Pn{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function b1(t,e){if(e=e??Zf,t.charAt(0)==="1"||t.charAt(0)==="Q"){let r=Sn(Mt.decode(`z${t}`));return t.startsWith("12D")?new Qr({multihash:r}):t.startsWith("16U")?new Jr({multihash:r}):new Xr({multihash:r})}return v1(Zf.decode(t))}function v1(t){try{let e=Sn(t);if(e.code===Je.code){if(e.digest.length===Zo)return new Qr({multihash:e});if(e.digest.length===Xo)return new Jr({multihash:e})}if(e.code===Ft.code)return new Xr({multihash:e})}catch{return w1(lr.decode(t))}throw new Error("Supplied PeerID CID is invalid")}function w1(t){if(t==null||t.multihash==null||t.version==null||t.version===1&&t.code!==Xf)throw new Error("Supplied PeerID CID is invalid");let e=t.multihash;if(e.code===Ft.code)return new Xr({multihash:t.multihash});if(e.code===Je.code){if(e.digest.length===Zo)return new Qr({multihash:t.multihash});if(e.digest.length===Xo)return new Jr({multihash:t.multihash})}throw new Error("Supplied PeerID CID is invalid")}async function Qo(t,e){return t.length===Zo?new Qr({multihash:ve(Je.code,t),privateKey:e}):t.length===Xo?new Jr({multihash:ve(Je.code,t),privateKey:e}):new Xr({multihash:await Ft.digest(t),publicKey:t,privateKey:e})}var Fi;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{if(i.lengthDelimited!==!1&&n.fork(),r.webtransportCerthashes!=null)for(let s of r.webtransportCerthashes)n.uint32(10),n.bytes(s);i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={webtransportCerthashes:[]},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:{i.webtransportCerthashes.push(r.bytes());break}default:{r.skipType(o&7);break}}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Fi||(Fi={}));var Un;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.identityKey!=null&&r.identityKey.byteLength>0&&(n.uint32(10),n.bytes(r.identityKey)),r.identitySig!=null&&r.identitySig.byteLength>0&&(n.uint32(18),n.bytes(r.identitySig)),r.extensions!=null&&(n.uint32(34),Fi.codec().encode(r.extensions,n)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={identityKey:rt(0),identitySig:rt(0)},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:{i.identityKey=r.bytes();break}case 2:{i.identitySig=r.bytes();break}case 4:{i.extensions=Fi.codec().decode(r,r.uint32());break}default:{r.skipType(o&7);break}}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Un||(Un={}));async function Qf(t,e,r){let n=await S1(t,Jf(e));if(t.publicKey==null)throw new Error("PublicKey was missing from local PeerId");return E1(t.publicKey,n,r)}function E1(t,e,r){return Un.encode({identityKey:t,identitySig:e,extensions:r??{webtransportCerthashes:[]}}).subarray()}async function S1(t,e){if(t.privateKey==null)throw new Error("PrivateKey was missing from PeerId");return(await Wf(t.privateKey)).sign(e)}async function Jo(t){return Qo(t.identityKey)}function jo(t){return Un.decode(t)}function Jf(t){let e=At("noise-libp2p-static-key:");return Gt([e,t],e.length+t.length)}async function ta(t,e,r){let n=await Qo(e.identityKey);if(!n.equals(r))throw new Error(`Payload identity key ${n.toString()} does not match expected remote peer ${r.toString()}`);let i=Jf(t);if(n.publicKey==null)throw new Error("PublicKey was missing from PeerId");if(e.identitySig==null)throw new Error("Signature was missing from message");if(!await $f(n.publicKey).verify(i,e.identitySig))throw new Error("Static key doesn't match to peer that signed payload!");return n}function Kn(t){return!(!(t instanceof Uint8Array)||t.length!==32)}var te=zt(nu(),1);te.default.formatters.b=t=>t==null?"undefined":Mt.baseEncode(t);te.default.formatters.t=t=>t==null?"undefined":Qe.baseEncode(t);te.default.formatters.m=t=>t==null?"undefined":Mr.baseEncode(t);te.default.formatters.p=t=>t==null?"undefined":t.toString();te.default.formatters.c=t=>t==null?"undefined":t.toString();te.default.formatters.k=t=>t==null?"undefined":t.toString();te.default.formatters.a=t=>t==null?"undefined":t.toString();function U1(t){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=t,e.destroy=()=>!0,e.extend=()=>e,e}function iu(t){let e=U1(`${t}:trace`);return te.default.enabled(`${t}:trace`)&&te.default.names.map(r=>r.toString()).find(r=>r.includes(":trace"))!=null&&(e=(0,te.default)(`${t}:trace`)),Object.assign((0,te.default)(t),{error:(0,te.default)(`${t}:error`),trace:e})}var Pt=iu("libp2p:noise");var se;Ia?se=Pt:se=Object.assign(()=>{},{enabled:!1,trace:()=>{},error:()=>{}});function su(t){se(`LOCAL_STATIC_PUBLIC_KEY ${Et(t.publicKey,"hex")}`),se(`LOCAL_STATIC_PRIVATE_KEY ${Et(t.privateKey,"hex")}`)}function ea(t){t?(se(`LOCAL_PUBLIC_EPHEMERAL_KEY ${Et(t.publicKey,"hex")}`),se(`LOCAL_PRIVATE_EPHEMERAL_KEY ${Et(t.privateKey,"hex")}`)):se("Missing local ephemeral keys.")}function ou(t){se(`REMOTE_STATIC_PUBLIC_KEY ${Et(t,"hex")}`)}function ra(t){se(`REMOTE_EPHEMERAL_PUBLIC_KEY ${Et(t,"hex")}`)}function au(t){t.cs1&&t.cs2?(se(`CIPHER_STATE_1 ${t.cs1.n.getUint64()} ${Et(t.cs1.k,"hex")}`),se(`CIPHER_STATE_2 ${t.cs2.n.getUint64()} ${Et(t.cs2.k,"hex")}`)):se("Missing cipher state.")}var K1=0,O1=4294967295,M1="Cipherstate has reached maximum n, a new handshake must be performed",qi=class{n;bytes;view;constructor(e=K1){this.n=e,this.bytes=rt(12),this.view=new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength),this.view.setUint32(4,e,!0)}increment(){this.n++,this.view.setUint32(4,this.n,!0)}getBytes(){return this.bytes}getUint64(){return this.n}assertValue(){if(this.n>O1)throw new Error(M1)}};var zi=class{crypto;constructor(e){this.crypto=e}encryptWithAd(e,r,n){let i=this.encrypt(e.k,e.n,r,n);return e.n.increment(),i}decryptWithAd(e,r,n,i){let{plaintext:s,valid:o}=this.decrypt(e.k,e.n,r,n,i);return o&&e.n.increment(),{plaintext:s,valid:o}}hasKey(e){return!this.isEmptyKey(e.k)}createEmptyKey(){return rt(32)}isEmptyKey(e){let r=this.createEmptyKey();return Lt(r,e)}encrypt(e,r,n,i){return r.assertValue(),this.crypto.chaCha20Poly1305Encrypt(i,r.getBytes(),n,e)}encryptAndHash(e,r){let n;return this.hasKey(e.cs)?n=this.encryptWithAd(e.cs,e.h,r):n=r,this.mixHash(e,n),n}decrypt(e,r,n,i,s){r.assertValue();let o=this.crypto.chaCha20Poly1305Decrypt(i,r.getBytes(),n,e,s);return o?{plaintext:o,valid:!0}:{plaintext:rt(0),valid:!1}}decryptAndHash(e,r){let n,i=!0;return this.hasKey(e.cs)?{plaintext:n,valid:i}=this.decryptWithAd(e.cs,e.h,r):n=r,this.mixHash(e,r),{plaintext:n,valid:i}}dh(e,r){try{let n=this.crypto.generateX25519SharedKey(e,r);return n.length===32?n:n.subarray(0,32)}catch(n){let i=n;return Pt.error(i),rt(32)}}mixHash(e,r){e.h=this.getHash(e.h,r)}getHash(e,r){return this.crypto.hashSHA256(Gt([e,r],e.length+r.length))}mixKey(e,r){let[n,i]=this.crypto.getHKDF(e.ck,r);e.cs=this.initializeKey(i),e.ck=n}initializeKey(e){return{k:e,n:new qi}}initializeSymmetric(e){let r=At(e,"utf-8"),n=this.hashProtocolName(r),i=n,s=this.createEmptyKey();return{cs:this.initializeKey(s),ck:i,h:n}}hashProtocolName(e){if(e.length<=32){let r=rt(32);return r.set(e),r}else return this.getHash(e,rt(0))}split(e){let[r,n]=this.crypto.getHKDF(e.ck,rt(0)),i=this.initializeKey(r),s=this.initializeKey(n);return{cs1:i,cs2:s}}writeMessageRegular(e,r){let n=this.encryptWithAd(e,rt(0),r),i=this.createEmptyKey(),s=rt(0);return{ne:i,ns:s,ciphertext:n}}readMessageRegular(e,r){return this.decryptWithAd(e,rt(0),r.ciphertext)}};var Gi=class extends zi{initializeInitiator(e,r,n,i){let s="Noise_XX_25519_ChaChaPoly_SHA256",o=this.initializeSymmetric(s);this.mixHash(o,e);let a=rt(32);return{ss:o,s:r,rs:n,psk:i,re:a}}initializeResponder(e,r,n,i){let s="Noise_XX_25519_ChaChaPoly_SHA256",o=this.initializeSymmetric(s);this.mixHash(o,e);let a=rt(32);return{ss:o,s:r,rs:n,psk:i,re:a}}writeMessageA(e,r,n){let i=rt(0);n!==void 0?e.e=n:e.e=this.crypto.generateX25519KeyPair();let s=e.e.publicKey;this.mixHash(e.ss,s);let o=this.encryptAndHash(e.ss,r);return{ne:s,ns:i,ciphertext:o}}writeMessageB(e,r){e.e=this.crypto.generateX25519KeyPair();let n=e.e.publicKey;this.mixHash(e.ss,n),this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));let i=e.s.publicKey,s=this.encryptAndHash(e.ss,i);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));let o=this.encryptAndHash(e.ss,r);return{ne:n,ns:s,ciphertext:o}}writeMessageC(e,r){let n=e.s.publicKey,i=this.encryptAndHash(e.ss,n);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));let s=this.encryptAndHash(e.ss,r),a={ne:this.createEmptyKey(),ns:i,ciphertext:s},{cs1:c,cs2:f}=this.split(e.ss);return{h:e.ss.h,messageBuffer:a,cs1:c,cs2:f}}readMessageA(e,r){return Kn(r.ne)&&(e.re=r.ne),this.mixHash(e.ss,e.re),this.decryptAndHash(e.ss,r.ciphertext)}readMessageB(e,r){if(Kn(r.ne)&&(e.re=r.ne),this.mixHash(e.ss,e.re),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));let{plaintext:n,valid:i}=this.decryptAndHash(e.ss,r.ns);i&&Kn(n)&&(e.rs=n),this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));let{plaintext:s,valid:o}=this.decryptAndHash(e.ss,r.ciphertext);return{plaintext:s,valid:i&&o}}readMessageC(e,r){let{plaintext:n,valid:i}=this.decryptAndHash(e.ss,r.ns);if(i&&Kn(n)&&(e.rs=n),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));let{plaintext:s,valid:o}=this.decryptAndHash(e.ss,r.ciphertext),{cs1:a,cs2:c}=this.split(e.ss);return{h:e.ss.h,plaintext:s,valid:i&&o,cs1:a,cs2:c}}initSession(e,r,n){let i=this.createEmptyKey(),s=rt(32),o;return e?o=this.initializeInitiator(r,n,s,i):o=this.initializeResponder(r,n,s,i),{hs:o,i:e,mc:0}}sendMessage(e,r,n){let i;if(e.mc===0)i=this.writeMessageA(e.hs,r,n);else if(e.mc===1)i=this.writeMessageB(e.hs,r);else if(e.mc===2){let{h:s,messageBuffer:o,cs1:a,cs2:c}=this.writeMessageC(e.hs,r);i=o,e.h=s,e.cs1=a,e.cs2=c}else if(e.mc>2)if(e.i){if(!e.cs1)throw new Error("CS1 (cipher state) is not defined");i=this.writeMessageRegular(e.cs1,r)}else{if(!e.cs2)throw new Error("CS2 (cipher state) is not defined");i=this.writeMessageRegular(e.cs2,r)}else throw new Error("Session invalid.");return e.mc++,i}recvMessage(e,r){let n=rt(0),i=!1;if(e.mc===0)({plaintext:n,valid:i}=this.readMessageA(e.hs,r));else if(e.mc===1)({plaintext:n,valid:i}=this.readMessageB(e.hs,r));else if(e.mc===2){let{h:s,plaintext:o,valid:a,cs1:c,cs2:f}=this.readMessageC(e.hs,r);n=o,i=a,e.h=s,e.cs1=c,e.cs2=f}return e.mc++,{plaintext:n,valid:i}}};var $i=class{isInitiator;session;remotePeer;remoteExtensions={webtransportCerthashes:[]};payload;connection;xx;staticKeypair;prologue;constructor(e,r,n,i,s,o,a,c){this.isInitiator=e,this.payload=r,this.prologue=n,this.staticKeypair=s,this.connection=o,a&&(this.remotePeer=a),this.xx=c??new Gi(i),this.session=this.xx.initSession(this.isInitiator,this.prologue,this.staticKeypair)}async propose(){if(su(this.session.hs.s),this.isInitiator){Pt.trace("Stage 0 - Initiator starting to send first message.");let e=this.xx.sendMessage(this.session,rt(0));await this.connection.write(c0(e)),Pt.trace("Stage 0 - Initiator finished sending first message."),ea(this.session.hs.e)}else{Pt.trace("Stage 0 - Responder waiting to receive first message...");let e=h0((await this.connection.read()).subarray()),{valid:r}=this.xx.recvMessage(this.session,e);if(!r)throw new or("xx handshake stage 0 validation fail");Pt.trace("Stage 0 - Responder received first message."),ra(this.session.hs.re)}}async exchange(){if(this.isInitiator){Pt.trace("Stage 1 - Initiator waiting to receive first message from responder...");let e=l0((await this.connection.read()).subarray()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new or("xx handshake stage 1 validation fail");Pt.trace("Stage 1 - Initiator received the message."),ra(this.session.hs.re),ou(this.session.hs.rs),Pt.trace("Initiator going to check remote's signature...");try{let i=jo(r);this.remotePeer=this.remotePeer||await Jo(i),await ta(this.session.hs.rs,i,this.remotePeer),this.setRemoteNoiseExtension(i.extensions)}catch(i){let s=i;throw new pn(`Error occurred while verifying signed payload: ${s.message}`)}Pt.trace("All good with the signature!")}else{Pt.trace("Stage 1 - Responder sending out first message with signed payload and static key.");let e=this.xx.sendMessage(this.session,this.payload);await this.connection.write(f0(e)),Pt.trace("Stage 1 - Responder sent the second handshake message with signed payload."),ea(this.session.hs.e)}}async finish(){if(this.isInitiator){Pt.trace("Stage 2 - Initiator sending third handshake message.");let e=this.xx.sendMessage(this.session,this.payload);await this.connection.write(u0(e)),Pt.trace("Stage 2 - Initiator sent message with signed payload.")}else{Pt.trace("Stage 2 - Responder waiting for third handshake message...");let e=d0((await this.connection.read()).subarray()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new or("xx handshake stage 2 validation fail");Pt.trace("Stage 2 - Responder received the message, finished handshake.");try{let i=jo(r);this.remotePeer=this.remotePeer||await Jo(i),await ta(this.session.hs.rs,i,this.remotePeer),this.setRemoteNoiseExtension(i.extensions)}catch(i){let s=i;throw new pn(`Error occurred while verifying signed payload: ${s.message}`)}}au(this.session)}encrypt(e,r){let n=this.getCS(r);return this.xx.encryptWithAd(n,rt(0),e)}decrypt(e,r,n){let i=this.getCS(r,!1);return this.xx.decryptWithAd(i,rt(0),e,n)}getRemoteStaticKey(){return this.session.hs.rs}getCS(e,r=!0){if(!e.cs1||!e.cs2)throw new or("Handshake not completed properly, cipher state does not exist.");return this.isInitiator?r?e.cs1:e.cs2:r?e.cs2:e.cs1}setRemoteNoiseExtension(e){e&&(this.remoteExtensions=e)}};function cu(t){return{xxHandshakeSuccesses:t.registerCounter("libp2p_noise_xxhandshake_successes_total",{help:"Total count of noise xxHandshakes successes_"}),xxHandshakeErrors:t.registerCounter("libp2p_noise_xxhandshake_error_total",{help:"Total count of noise xxHandshakes errors"}),encryptedPackets:t.registerCounter("libp2p_noise_encrypted_packets_total",{help:"Total count of noise encrypted packets successfully"}),decryptedPackets:t.registerCounter("libp2p_noise_decrypted_packets_total",{help:"Total count of noise decrypted packets"}),decryptErrors:t.registerCounter("libp2p_noise_decrypt_errors_total",{help:"Total count of noise decrypt errors"})}}var Wi=class{protocol="/noise";crypto;prologue;staticKeys;extensions;metrics;constructor(e={}){let{staticNoiseKey:r,extensions:n,crypto:i,prologueBytes:s,metrics:o}=e;this.crypto=i??a0,this.extensions=n,this.metrics=o?cu(o):void 0,r?this.staticKeys=this.crypto.generateX25519KeyPairFromSeed(r):this.staticKeys=this.crypto.generateX25519KeyPair(),this.prologue=s??rt(0)}async secureOutbound(e,r,n){let i=ns(r,{lengthEncoder:Dr,lengthDecoder:ln,maxDataLength:65535}),s=await this.performHandshake({connection:i,isInitiator:!0,localPeer:e,remotePeer:n}),o=await this.createSecureConnection(i,s);return r.source=o.source,r.sink=o.sink,{conn:r,remoteExtensions:s.remoteExtensions,remotePeer:s.remotePeer}}async secureInbound(e,r,n){let i=ns(r,{lengthEncoder:Dr,lengthDecoder:ln,maxDataLength:65535}),s=await this.performHandshake({connection:i,isInitiator:!1,localPeer:e,remotePeer:n}),o=await this.createSecureConnection(i,s);return r.source=o.source,r.sink=o.sink,{conn:r,remotePeer:s.remotePeer,remoteExtensions:s.remoteExtensions}}async performHandshake(e){let r=await Qf(e.localPeer,this.staticKeys.publicKey,this.extensions);return this.performXXHandshake(e,r)}async performXXHandshake(e,r){let{isInitiator:n,remotePeer:i,connection:s}=e,o=new $i(n,r,this.prologue,this.crypto,this.staticKeys,s,i);try{await o.propose(),await o.exchange(),await o.finish(),this.metrics?.xxHandshakeSuccesses.increment()}catch(a){if(this.metrics?.xxHandshakeErrors.increment(),a instanceof Error)throw a.message=`Error occurred during XX handshake: ${a.message}`,a}return o}async createSecureConnection(e,r){let[n,i]=Ea(),s=e.unwrap();return await Ba(n,g0(r,this.metrics),s,o=>sn(o,{lengthDecoder:ln}),x0(r,this.metrics),n),i}};function F1(t={}){return()=>new Wi(t)}return Eu(V1);})(); +`+a+e.substr(o+1),s=i-o-1,o=-1,++i}else(e[i]===" "||e[i]===" "||e[i]===",")&&(o=i);return e}function Sl(t){return t.replace(/^\s+/,"")}});var Q0=ht((C2,X0)=>{var ye=lt();cr();Bt();var W0=X0.exports=ye.sha256=ye.sha256||{};ye.md.sha256=ye.md.algorithms.sha256=W0;W0.create=function(){Y0||Bl();var t=null,e=ye.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),$0(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=ye.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(Ws.substr(0,n.blockLength-o));for(var a,c,f=n.fullMessageLength[0]*8,u=0;u>>0,f+=c,i.putInt32(f>>>0),f=a>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};$0(h,r,i);var l=ye.util.createBuffer();return l.putInt32(h.h0),l.putInt32(h.h1),l.putInt32(h.h2),l.putInt32(h.h3),l.putInt32(h.h4),l.putInt32(h.h5),l.putInt32(h.h6),l.putInt32(h.h7),l},n};var Ws=null,Y0=!1,Z0=null;function Bl(){Ws="\x80",Ws+=ye.util.fillString("\0",64),Z0=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Y0=!0}function $0(t,e,r){for(var n,i,s,o,a,c,f,u,h,l,g,d,p,y,x,v=r.length();v>=64;){for(f=0;f<16;++f)e[f]=r.getInt32();for(;f<64;++f)n=e[f-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=e[f-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[f]=n+e[f-7]+i+e[f-16]|0;for(u=t.h0,h=t.h1,l=t.h2,g=t.h3,d=t.h4,p=t.h5,y=t.h6,x=t.h7,f=0;f<64;++f)o=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),a=y^d&(p^y),s=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),c=u&h|l&(u^h),n=x+o+a+Z0[f]+e[f],i=s+c,x=y,y=p,p=d,d=g+n>>>0,g=l,l=h,h=u,u=n+i>>>0;t.h0=t.h0+u|0,t.h1=t.h1+h|0,t.h2=t.h2+l|0,t.h3=t.h3+g|0,t.h4=t.h4+d|0,t.h5=t.h5+p|0,t.h6=t.h6+y|0,t.h7=t.h7+x|0,v-=64}}});var j0=ht((I2,J0)=>{var ge=lt();Bt();var Ai=null;ge.util.isNodejs&&!ge.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Ai=Ei());var Al=J0.exports=ge.prng=ge.prng||{};Al.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();e.pools=n,e.pool=0,e.generate=function(f,u){if(!u)return e.generateSync(f);var h=e.plugin.cipher,l=e.plugin.increment,g=e.plugin.formatKey,d=e.plugin.formatSeed,p=ge.util.createBuffer();e.key=null,y();function y(x){if(x)return u(x);if(p.length()>=f)return u(null,p.getBytes(f));if(e.generated>1048575&&(e.key=null),e.key===null)return ge.util.nextTick(function(){s(y)});var v=h(e.key,e.seed);e.generated+=v.length,p.putBytes(v),e.key=g(h(e.key,l(e.seed))),e.seed=d(h(e.key,e.seed)),ge.util.setImmediate(y)}},e.generateSync=function(f){var u=e.plugin.cipher,h=e.plugin.increment,l=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var d=ge.util.createBuffer();d.length()1048575&&(e.key=null),e.key===null&&o();var p=u(e.key,e.seed);e.generated+=p.length,d.putBytes(p),e.key=l(u(e.key,h(e.seed))),e.seed=g(u(e.key,e.seed))}return d.getBytes(f)};function s(f){if(e.pools[0].messageLength>=32)return a(),f();var u=32-e.pools[0].messageLength<<5;e.seedFile(u,function(h,l){if(h)return f(h);e.collect(l),a(),f()})}function o(){if(e.pools[0].messageLength>=32)return a();var f=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(f)),a()}function a(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var f=e.plugin.md.create();f.update(e.keyBytes);for(var u=1,h=0;h<32;++h)e.reseeds%u===0&&(f.update(e.pools[h].digest().getBytes()),e.pools[h].start()),u=u<<1;e.keyBytes=f.digest().getBytes(),f.start(),f.update(e.keyBytes);var l=f.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(l),e.generated=0}function c(f){var u=null,h=ge.util.globalScope,l=h.crypto||h.msCrypto;l&&l.getRandomValues&&(u=function(S){return l.getRandomValues(S)});var g=ge.util.createBuffer();if(u)for(;g.length()>16),v+=(x&32767)<<16,v+=x>>15,v=(v&2147483647)+(v>>31),A=v&4294967295;for(var y=0;y<3;++y)m=A>>>(y<<3),m^=Math.floor(Math.random()*256),g.putByte(m&255)}return g.getBytes(f)}return Ai?(e.seedFile=function(f,u){Ai.randomBytes(f,function(h,l){if(h)return u(h);u(null,l.toString())})},e.seedFileSync=function(f){return Ai.randomBytes(f).toString()}):(e.seedFile=function(f,u){try{u(null,c(f))}catch(h){u(h)}},e.seedFileSync=c),e.collect=function(f){for(var u=f.length,h=0;h>l&255);e.collect(h)},e.registerWorker=function(f){if(f===self)e.seedFile=function(h,l){function g(d){var p=d.data;p.forge&&p.forge.prng&&(self.removeEventListener("message",g),l(p.forge.prng.err,p.forge.prng.bytes))}self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:h}}})};else{var u=function(h){var l=h.data;l.forge&&l.forge.prng&&e.seedFile(l.forge.prng.needed,function(g,d){f.postMessage({forge:{prng:{err:g,bytes:d}}})})};f.addEventListener("message",u)}},e}});var bn=ht((T2,Ys)=>{var kt=lt();$s();Q0();j0();Bt();(function(){if(kt.random&&kt.random.getBytes){Ys.exports=kt.random;return}(function(t){var e={},r=new Array(4),n=kt.util.createBuffer();e.formatKey=function(h){var l=kt.util.createBuffer(h);return h=new Array(4),h[0]=l.getInt32(),h[1]=l.getInt32(),h[2]=l.getInt32(),h[3]=l.getInt32(),kt.aes._expandKey(h,!1)},e.formatSeed=function(h){var l=kt.util.createBuffer(h);return h=new Array(4),h[0]=l.getInt32(),h[1]=l.getInt32(),h[2]=l.getInt32(),h[3]=l.getInt32(),h},e.cipher=function(h,l){return kt.aes._updateBlock(h,l,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=kt.md.sha256;function i(){var h=kt.prng.create(e);return h.getBytes=function(l,g){return h.generate(l,g)},h.getBytesSync=function(l){return h.generate(l)},h}var s=i(),o=null,a=kt.util.globalScope,c=a.crypto||a.msCrypto;if(c&&c.getRandomValues&&(o=function(h){return c.getRandomValues(h)}),kt.options.usePureJavaScript||!kt.util.isNodejs&&!o){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var f="";for(var u in navigator)try{typeof navigator[u]=="string"&&(f+=navigator[u])}catch{}s.collect(f),f=null}t&&(t().mousemove(function(h){s.collectInt(h.clientX,16),s.collectInt(h.clientY,16)}),t().keypress(function(h){s.collectInt(h.charCode,8)}))}if(!kt.random)kt.random=s;else for(var u in s)kt.random[u]=s[u];kt.random.createInstance=i,Ys.exports=kt.random})(typeof jQuery<"u"?jQuery:null)})()});var nc=ht((_2,rc)=>{var Yt=lt();Bt();var Zs=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],tc=[1,2,3,5],Cl=function(t,e){return t<>16-e},Il=function(t,e){return(t&65535)>>e|t<<16-e&65535};rc.exports=Yt.rc2=Yt.rc2||{};Yt.rc2.expandKey=function(t,e){typeof t=="string"&&(t=Yt.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),i=e,s=Math.ceil(i/8),o=255>>(i&7),a;for(a=n;a<128;a++)r.putByte(Zs[r.at(a-1)+r.at(a-n)&255]);for(r.setAt(128-s,Zs[r.at(128-s)&o]),a=127-s;a>=0;a--)r.setAt(a,Zs[r.at(a+1)^r.at(a+s)]);return r};var ec=function(t,e,r){var n=!1,i=null,s=null,o=null,a,c,f,u,h=[];for(t=Yt.rc2.expandKey(t,e),f=0;f<64;f++)h.push(t.getInt16Le());r?(a=function(d){for(f=0;f<4;f++)d[f]+=h[u]+(d[(f+3)%4]&d[(f+2)%4])+(~d[(f+3)%4]&d[(f+1)%4]),d[f]=Cl(d[f],tc[f]),u++},c=function(d){for(f=0;f<4;f++)d[f]+=h[d[(f+3)%4]&63]}):(a=function(d){for(f=3;f>=0;f--)d[f]=Il(d[f],tc[f]),d[f]-=h[u]+(d[(f+3)%4]&d[(f+2)%4])+(~d[(f+3)%4]&d[(f+1)%4]),u--},c=function(d){for(f=3;f>=0;f--)d[f]-=h[d[(f+3)%4]&63]});var l=function(d){var p=[];for(f=0;f<4;f++){var y=i.getInt16Le();o!==null&&(r?y^=o.getInt16Le():o.putInt16Le(y)),p.push(y&65535)}u=r?0:63;for(var x=0;x=8;)l([[5,a],[1,c],[6,a],[1,c],[5,a]])},finish:function(d){var p=!0;if(r)if(d)p=d(8,i,!r);else{var y=i.length()===8?8:8-i.length();i.fillWithByte(y,y)}if(p&&(n=!0,g.update()),!r&&(p=i.length()===0,p))if(d)p=d(8,s,!r);else{var x=s.length(),v=s.at(x-1);v>x?p=!1:s.truncate(v)}return p}},g};Yt.rc2.startEncrypting=function(t,e,r){var n=Yt.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};Yt.rc2.createEncryptionCipher=function(t,e){return ec(t,e,!0)};Yt.rc2.startDecrypting=function(t,e,r){var n=Yt.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};Yt.rc2.createDecryptionCipher=function(t,e){return ec(t,e,!1)}});var Ti=ht((L2,hc)=>{var Xs=lt();hc.exports=Xs.jsbn=Xs.jsbn||{};var De,Tl=0xdeadbeefcafe,ic=(Tl&16777215)==15715070;function D(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}Xs.jsbn.BigInteger=D;function ot(){return new D(null)}function _l(t,e,r,n,i,s){for(;--s>=0;){var o=e*this.data[t++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=o&67108863}return i}function Ll(t,e,r,n,i,s){for(var o=e&32767,a=e>>15;--s>=0;){var c=this.data[t]&32767,f=this.data[t++]>>15,u=a*c+f*o;c=o*c+((u&32767)<<15)+r.data[n]+(i&1073741823),i=(c>>>30)+(u>>>15)+a*f+(i>>>30),r.data[n++]=c&1073741823}return i}function sc(t,e,r,n,i,s){for(var o=e&16383,a=e>>14;--s>=0;){var c=this.data[t]&16383,f=this.data[t++]>>14,u=a*c+f*o;c=o*c+((u&16383)<<14)+r.data[n]+i,i=(c>>28)+(u>>14)+a*f,r.data[n++]=c&268435455}return i}typeof navigator>"u"?(D.prototype.am=sc,De=28):ic&&navigator.appName=="Microsoft Internet Explorer"?(D.prototype.am=Ll,De=30):ic&&navigator.appName!="Netscape"?(D.prototype.am=_l,De=26):(D.prototype.am=sc,De=28);D.prototype.DB=De;D.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function Dl(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}function Ye(t){var e=ot();return e.fromInt(t),e}function kl(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,i=!1,s=0;--n>=0;){var o=r==8?t[n]&255:ac(t,n);if(o<0){t.charAt(n)=="-"&&(i=!0);continue}i=!1,s==0?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB)}r==8&&t[0]&128&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}function Ul(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(a>a)>0&&(i=!0,s=oc(n));o>=0;)a>(a+=this.DB-e)):(n=this.data[o]>>(a-=e)&r,a<=0&&(a+=this.DB,--o)),n>0&&(i=!0),i&&(s+=oc(n));return i?s:"0"}function Kl(){var t=ot();return D.ZERO.subTo(this,t),t}function Ol(){return this.s<0?this.negate():this}function Ml(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}function Ii(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function Fl(){return this.t<=0?0:this.DB*(this.t-1)+Ii(this.data[this.t-1]^this.s&this.DM)}function Vl(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}function Hl(t,e){for(var r=t;r=0;--a)e.data[a+s+1]=this.data[a]>>n|o,o=(this.data[a]&i)<=0;--a)e.data[a]=0;e.data[s]=o,e.t=this.t+s+1,e.s=this.s,e.clamp()}function zl(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,i=this.DB-n,s=(1<>n;for(var o=r+1;o>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}function $l(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}function Yl(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,u=s.data[f-1];if(u!=0){var h=u*(1<1?s.data[f-2]>>this.F2:0),l=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(x,r)),D.ONE.dlShiftTo(f,x),x.subTo(s,s);s.t=0;){var v=r.data[--p]==u?this.DM:Math.floor(r.data[p]*l+(r.data[p-1]+d)*g);if((r.data[p]+=s.am(0,v,r,y,0,f))0&&r.rShiftTo(c,r),o<0&&D.ZERO.subTo(r,r)}}}function Zl(t){var e=ot();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(D.ZERO)>0&&t.subTo(e,e),e}function fr(t){this.m=t}function Xl(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function Ql(t){return t}function Jl(t){t.divRemTo(this.m,null,t)}function jl(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function td(t,e){t.squareTo(e),this.reduce(e)}fr.prototype.convert=Xl;fr.prototype.revert=Ql;fr.prototype.reduce=Jl;fr.prototype.mulTo=jl;fr.prototype.sqrTo=td;function ed(){if(this.t<1)return 0;var t=this.data[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function ur(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}function nd(t){var e=ot();return t.copyTo(e),this.reduce(e),e}function id(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function sd(t,e){t.squareTo(e),this.reduce(e)}function od(t,e,r){t.multiplyTo(e,r),this.reduce(r)}ur.prototype.convert=rd;ur.prototype.revert=nd;ur.prototype.reduce=id;ur.prototype.mulTo=od;ur.prototype.sqrTo=sd;function ad(){return(this.t>0?this.data[0]&1:this.s)==0}function cd(t,e){if(t>4294967295||t<1)return D.ONE;var r=ot(),n=ot(),i=e.convert(this),s=Ii(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,i,r);else{var o=r;r=n,n=o}return e.revert(r)}function fd(t,e){var r;return t<256||e.isEven()?r=new fr(e):r=new ur(e),this.exp(t,r)}D.prototype.copyTo=Nl;D.prototype.fromInt=Dl;D.prototype.fromString=kl;D.prototype.clamp=Pl;D.prototype.dlShiftTo=Vl;D.prototype.drShiftTo=Hl;D.prototype.lShiftTo=ql;D.prototype.rShiftTo=zl;D.prototype.subTo=Gl;D.prototype.multiplyTo=$l;D.prototype.squareTo=Wl;D.prototype.divRemTo=Yl;D.prototype.invDigit=ed;D.prototype.isEven=ad;D.prototype.exp=cd;D.prototype.toString=Ul;D.prototype.negate=Kl;D.prototype.abs=Ol;D.prototype.compareTo=Ml;D.prototype.bitLength=Fl;D.prototype.mod=Zl;D.prototype.modPowInt=fd;D.ZERO=Ye(0);D.ONE=Ye(1);function ud(){var t=ot();return this.copyTo(t),t}function hd(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}function dd(){return this.t==0?this.s:this.data[0]<<16>>16}function pd(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function yd(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function gd(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=Ye(r),i=ot(),s=ot(),o="";for(this.divRemTo(n,i,s);i.signum()>0;)o=(r+s.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,s);return s.intValue().toString(t)+o}function xd(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,s=0,o=0,a=0;a=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(o,0)),i&&D.ZERO.subTo(this,this)}function md(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(D.ONE.shiftLeft(t-1),Js,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(D.ONE.shiftLeft(t-1),this);else{var n=new Array,i=t&7;n.length=(t>>3)+1,e.nextBytes(n),i>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function vd(t){return this.compareTo(t)==0}function wd(t){return this.compareTo(t)<0?this:t}function Ed(t){return this.compareTo(t)>0?this:t}function Sd(t,e,r){var n,i,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),t&255||(t>>=8,e+=8),t&15||(t>>=4,e+=4),t&3||(t>>=2,e+=2),t&1||++e,e}function Dd(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}function Hd(t){var e=ot();return this.addTo(t,e),e}function qd(t){var e=ot();return this.subTo(t,e),e}function zd(t){var e=ot();return this.multiplyTo(t,e),e}function Gd(t){var e=ot();return this.divRemTo(t,e,null),e}function $d(t){var e=ot();return this.divRemTo(t,null,e),e}function Wd(t){var e=ot(),r=ot();return this.divRemTo(t,e,r),new Array(e,r)}function Yd(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Zd(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}function vn(){}function uc(t){return t}function Xd(t,e,r){t.multiplyTo(e,r)}function Qd(t,e){t.squareTo(e)}vn.prototype.convert=uc;vn.prototype.revert=uc;vn.prototype.mulTo=Xd;vn.prototype.sqrTo=Qd;function Jd(t){return this.exp(t,new vn)}function jd(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=ot();return t.copyTo(e),this.reduce(e),e}function rp(t){return t}function np(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function ip(t,e){t.squareTo(e),this.reduce(e)}function sp(t,e,r){t.multiplyTo(e,r),this.reduce(r)}Kr.prototype.convert=ep;Kr.prototype.revert=rp;Kr.prototype.reduce=np;Kr.prototype.mulTo=sp;Kr.prototype.sqrTo=ip;function op(t,e){var r=t.bitLength(),n,i=Ye(1),s;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new fr(e):e.isEven()?s=new Kr(e):s=new ur(e);var o=new Array,a=3,c=n-1,f=(1<1){var u=ot();for(s.sqrTo(o[1],u);a<=f;)o[a]=ot(),s.mulTo(u,o[a-2],o[a]),a+=2}var h=t.t-1,l,g=!0,d=ot(),p;for(r=Ii(t.data[h])-1;h>=0;){for(r>=c?l=t.data[h]>>r-c&f:(l=(t.data[h]&(1<0&&(l|=t.data[h-1]>>this.DB+r-c)),a=n;!(l&1);)l>>=1,--a;if((r-=a)<0&&(r+=this.DB,--h),g)o[l].copyTo(i),g=!1;else{for(;a>1;)s.sqrTo(i,d),s.sqrTo(d,i),a-=2;a>0?s.sqrTo(i,d):(p=i,i=d,d=p),s.mulTo(d,o[l],i)}for(;h>=0&&!(t.data[h]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function cp(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}function fp(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return D.ZERO;for(var r=t.clone(),n=this.clone(),i=Ye(1),s=Ye(0),o=Ye(0),a=Ye(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!i.isEven()||!s.isEven())&&(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!o.isEven()||!a.isEven())&&(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),s.subTo(a,s)):(n.subTo(r,n),e&&o.subTo(i,o),a.subTo(s,a))}if(n.compareTo(D.ONE)!=0)return D.ZERO;if(a.compareTo(t)>=0)return a.subtract(t);if(a.signum()<0)a.addTo(t,a);else return a;return a.signum()<0?a.add(t):a}var he=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],up=(1<<26)/he[he.length-1];function hp(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=he[he.length-1]){for(e=0;e=0);var a=s.modPow(n,this);if(a.compareTo(D.ONE)!=0&&a.compareTo(e)!=0){for(var c=1;c++{var xe=lt();cr();Bt();var dc=yc.exports=xe.sha1=xe.sha1||{};xe.md.sha1=xe.md.algorithms.sha1=dc;dc.create=function(){pc||pp();var t=null,e=xe.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),lc(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=xe.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(js.substr(0,n.blockLength-o));for(var a,c,f=n.fullMessageLength[0]*8,u=0;u>>0,f+=c,i.putInt32(f>>>0),f=a>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};lc(h,r,i);var l=xe.util.createBuffer();return l.putInt32(h.h0),l.putInt32(h.h1),l.putInt32(h.h2),l.putInt32(h.h3),l.putInt32(h.h4),l},n};var js=null,pc=!1;function pp(){js="\x80",js+=xe.util.fillString("\0",64),pc=!0}function lc(t,e,r){for(var n,i,s,o,a,c,f,u,h=r.length();h>=64;){for(i=t.h0,s=t.h1,o=t.h2,a=t.h3,c=t.h4,u=0;u<16;++u)n=r.getInt32(),e[u]=n,f=a^s&(o^a),n=(i<<5|i>>>27)+f+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<20;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,f=a^s&(o^a),n=(i<<5|i>>>27)+f+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<32;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<40;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<60;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s&o|a&(s^o),n=(i<<5|i>>>27)+f+c+2400959708+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<80;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+3395469782+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+s|0,t.h2=t.h2+o|0,t.h3=t.h3+a|0,t.h4=t.h4+c|0,h-=64}}});var bc=ht((N2,mc)=>{var me=lt();Bt();bn();gc();var xc=mc.exports=me.pkcs1=me.pkcs1||{};xc.encode_rsa_oaep=function(t,e,r){var n,i,s,o;typeof r=="string"?(n=r,i=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),s?s.start():s=me.md.sha1.create(),o||(o=s);var a=Math.ceil(t.n.bitLength()/8),c=a-2*s.digestLength-2;if(e.length>c){var f=new Error("RSAES-OAEP input message length is too long.");throw f.length=e.length,f.maxLength=c,f}n||(n=""),s.update(n,"raw");for(var u=s.digest(),h="",l=c-e.length,g=0;g>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+o),n+=r.digest().getBytes()}return n.substring(0,e)}});var vc=ht((D2,to)=>{var Ze=lt();Bt();Ti();bn();(function(){if(Ze.prime){to.exports=Ze.prime;return}var t=to.exports=Ze.prime=Ze.prime||{},e=Ze.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var i=function(h,l){return h|l};t.generateProbablePrime=function(h,l,g){typeof l=="function"&&(g=l,l={}),l=l||{};var d=l.algorithm||"PRIMEINC";typeof d=="string"&&(d={name:d}),d.options=d.options||{};var p=l.prng||Ze.random,y={nextBytes:function(x){for(var v=p.getBytesSync(x.length),m=0;ml&&(h=f(l,g)),h.isProbablePrime(p))return x(null,h);h.dAddOffset(r[d++%8],0)}while(y<0||+new Date-v"u")return o(h,l,g,d);var p=f(h,l),y=g.workers,x=g.workLoad||100,v=x*30/8,m=g.workerScript||"forge/prime.worker.js";if(y===-1)return Ze.util.estimateCores(function(S,B){S&&(B=2),y=B-1,A()});A();function A(){y=Math.max(1,y);for(var S=[],B=0;Bh&&(p=f(h,l));var z=p.toString(16);M.target.postMessage({hex:z,workLoad:x}),p.dAddOffset(v,0)}}}}function f(h,l){var g=new e(h,l),d=h-1;return g.testBit(d)||g.bitwiseTo(e.ONE.shiftLeft(d),i,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}function u(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}})()});var Ri=ht((k2,Ic)=>{var $=lt();mn();Ti();yi();bc();vc();bn();Bt();typeof st>"u"&&(st=$.jsbn.BigInteger);var st,eo=$.util.isNodejs?Ei():null,E=$.asn1,ne=$.util;$.pki=$.pki||{};Ic.exports=$.pki.rsa=$.rsa=$.rsa||{};var Q=$.pki,yp=[6,4,2,4,2,4,6,2],gp={name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},xp={name:"RSAPrivateKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},mp={name:"RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},bp=$.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},vp={name:"DigestInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:E.Class.UNIVERSAL,type:E.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},wp=function(t){var e;if(t.algorithm in Q.oids)e=Q.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=E.oidToDer(e).getBytes(),i=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]),s=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]);s.value.push(E.create(E.Class.UNIVERSAL,E.Type.OID,!1,n)),s.value.push(E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,""));var o=E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(s),i.value.push(o),E.toDer(i).getBytes()},Ac=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(st.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(st.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new st($.util.bytesToHex($.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(st.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var i=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(s)<0;)i=i.add(e.p);var o=i.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return o=o.multiply(n.modInverse(e.n)).mod(e.n),o};Q.rsa.encrypt=function(t,e,r){var n=r,i,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=Cc(t,e,r)):(i=$.util.createBuffer(),i.putBytes(t));for(var o=new st(i.toHex(),16),a=Ac(o,e,n),c=a.toString(16),f=$.util.createBuffer(),u=s-Math.ceil(c.length/2);u>0;)f.putByte(0),--u;return f.putBytes($.util.hexToBytes(c)),f.getBytes()};Q.rsa.decrypt=function(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=i,s}var o=new st($.util.createBuffer(t).toHex(),16);if(o.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var a=Ac(o,e,r),c=a.toString(16),f=$.util.createBuffer(),u=i-Math.ceil(c.length/2);u>0;)f.putByte(0),--u;return f.putBytes($.util.hexToBytes(c)),n!==!1?Li(f.getBytes(),e,r):f.getBytes()};Q.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||$.random,i={nextBytes:function(a){for(var c=n.getBytesSync(a.length),f=0;f>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+s);return o};Q.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new st(null);r.fromInt(30);for(var n=0,i=function(h,l){return h|l},s=+new Date,o,a=0;t.keys===null&&(e<=0||ac?t.pqState=0:t.num.isProbablePrime(Sp(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(yp[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(st.ONE),t.q1=t.q.subtract(st.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(st.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var u=t.e.modInverse(t.phi);t.keys={privateKey:Q.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Q.rsa.setPublicKey(t.n,t.e)}}o=+new Date,a+=o-s,s=o}return t.keys!==null};Q.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!$.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(wc("generateKeyPair"))return eo.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(a,c,f){if(a)return n(a);n(null,{privateKey:Q.privateKeyFromPem(f),publicKey:Q.publicKeyFromPem(c)})});if(Ec("generateKey")&&Ec("exportKey"))return ne.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:Bc(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(a){return ne.globalScope.crypto.subtle.exportKey("pkcs8",a.privateKey)}).then(void 0,function(a){n(a)}).then(function(a){if(a){var c=Q.privateKeyFromAsn1(E.fromDer($.util.createBuffer(a)));n(null,{privateKey:c,publicKey:Q.setRsaPublicKey(c.n,c.e)})}});if(Sc("generateKey")&&Sc("exportKey")){var i=ne.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:Bc(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(a){var c=a.target.result,f=ne.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);f.oncomplete=function(u){var h=u.target.result,l=Q.privateKeyFromAsn1(E.fromDer($.util.createBuffer(h)));n(null,{privateKey:l,publicKey:Q.setRsaPublicKey(l.n,l.e)})},f.onerror=function(u){n(u)}},i.onerror=function(a){n(a)};return}}else if(wc("generateKeyPairSync")){var s=eo.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Q.privateKeyFromPem(s.privateKey),publicKey:Q.publicKeyFromPem(s.publicKey)}}}var o=Q.rsa.createKeyPairGenerationState(t,e,r);if(!n)return Q.rsa.stepKeyPairGenerationState(o,0),o.keys;Ep(o,r,n)};Q.setRsaPublicKey=Q.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,i,s){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(a,c,f){return Cc(a,c,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(a,c){return $.pkcs1.encode_rsa_oaep(c,a,s)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(a){return a}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(n,r,!0);return Q.rsa.encrypt(o,r,!0)},r.verify=function(n,i,s,o){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),s==="RSASSA-PKCS1-V1_5"?s={verify:function(c,f){f=Li(f,r,!0);var u=E.fromDer(f,{parseAllBytes:o._parseAllDigestBytes}),h={},l=[];if(!E.validate(u,vp,h,l)){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=l,g}var d=E.derToOid(h.algorithmIdentifier);if(!(d===$.oids.md2||d===$.oids.md5||d===$.oids.sha1||d===$.oids.sha224||d===$.oids.sha256||d===$.oids.sha384||d===$.oids.sha512||d===$.oids["sha512-224"]||d===$.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=d,g}if((d===$.oids.md2||d===$.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return c===h.digest}}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:function(c,f){return f=Li(f,r,!0),c===f}});var a=Q.rsa.decrypt(i,r,!0,!1);return s.verify(n,a,r.n.bitLength())},r};Q.setRsaPrivateKey=Q.rsa.setPrivateKey=function(t,e,r,n,i,s,o,a){var c={n:t,e,d:r,p:n,q:i,dP:s,dQ:o,qInv:a};return c.decrypt=function(f,u,h){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var l=Q.rsa.decrypt(f,c,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:Li};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(g,d){return $.pkcs1.decode_rsa_oaep(d,g,h)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(g){return g}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(l,c,!1)},c.sign=function(f,u){var h=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:wp},h=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return f}},h=1);var l=u.encode(f,c.n.bitLength());return Q.rsa.encrypt(l,c,h)},c};Q.wrapRsaPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Q.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,E.toDer(t).getBytes())])};Q.privateKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,gp,e,r)&&(t=E.fromDer($.util.createBuffer(e.privateKey))),e={},r=[],!E.validate(t,xp,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,s,o,a,c,f,u,h;return i=$.util.createBuffer(e.privateKeyModulus).toHex(),s=$.util.createBuffer(e.privateKeyPublicExponent).toHex(),o=$.util.createBuffer(e.privateKeyPrivateExponent).toHex(),a=$.util.createBuffer(e.privateKeyPrime1).toHex(),c=$.util.createBuffer(e.privateKeyPrime2).toHex(),f=$.util.createBuffer(e.privateKeyExponent1).toHex(),u=$.util.createBuffer(e.privateKeyExponent2).toHex(),h=$.util.createBuffer(e.privateKeyCoefficient).toHex(),Q.setRsaPrivateKey(new st(i,16),new st(s,16),new st(o,16),new st(a,16),new st(c,16),new st(f,16),new st(u,16),new st(h,16))};Q.privateKeyToAsn1=Q.privateKeyToRSAPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.e)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.d)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.p)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.q)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.dP)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.dQ)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.qInv))])};Q.publicKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,bp,e,r)){var n=E.derToOid(e.publicKeyOid);if(n!==Q.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}t=e.rsaPublicKey}if(r=[],!E.validate(t,mp,e,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var s=$.util.createBuffer(e.publicKeyModulus).toHex(),o=$.util.createBuffer(e.publicKeyExponent).toHex();return Q.setRsaPublicKey(new st(s,16),new st(o,16))};Q.publicKeyToAsn1=Q.publicKeyToSubjectPublicKeyInfo=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Q.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.BITSTRING,!1,[Q.publicKeyToRSAPublicKey(t)])])};Q.publicKeyToRSAPublicKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.e))])};function Cc(t,e,r){var n=$.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=i-11,s}n.putByte(0),n.putByte(r);var o=i-3-t.length,a;if(r===0||r===1){a=r===0?0:255;for(var c=0;c0;){for(var f=0,u=$.random.getBytes(o),c=0;c"u")throw new Error("Encryption block is invalid.");var c=0;if(a===0){c=i-3-n;for(var f=0;f1;){if(s.getByte()!==255){--s.read;break}++c}else if(a===2)for(c=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++c}var u=s.getByte();if(u!==0||c!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function Ep(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),i();function i(){s(t.pBits,function(a,c){if(a)return r(a);if(t.p=c,t.q!==null)return o(a,t.q);s(t.qBits,o)})}function s(a,c){$.prime.generateProbablePrime(a,n,c)}function o(a,c){if(a)return r(a);if(t.q=c,t.p.compareTo(t.q)<0){var f=t.p;t.p=t.q,t.q=f}if(t.p.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)!==0){t.p=null,i();return}if(t.q.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)!==0){t.q=null,s(t.qBits,o);return}if(t.p1=t.p.subtract(st.ONE),t.q1=t.q.subtract(st.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(st.ONE)!==0){t.p=t.q=null,i();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,o);return}var u=t.e.modInverse(t.phi);t.keys={privateKey:Q.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Q.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function be(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=$.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function Sp(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function wc(t){return $.util.isNodejs&&typeof eo[t]=="function"}function Ec(t){return typeof ne.globalScope<"u"&&typeof ne.globalScope.crypto=="object"&&typeof ne.globalScope.crypto.subtle=="object"&&typeof ne.globalScope.crypto.subtle[t]=="function"}function Sc(t){return typeof ne.globalScope<"u"&&typeof ne.globalScope.msCrypto=="object"&&typeof ne.globalScope.msCrypto.subtle=="object"&&typeof ne.globalScope.msCrypto.subtle[t]=="function"}function Bc(t){for(var e=$.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{var H=lt();$s();mn();K0();cr();yi();H0();G0();bn();nc();Ri();Bt();typeof Tc>"u"&&(Tc=H.jsbn.BigInteger);var Tc,I=H.asn1,tt=H.pki=H.pki||{};Nc.exports=tt.pbe=H.pbe=H.pbe||{};var hr=tt.oids,Bp={name:"EncryptedPrivateKeyInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Ap={name:"PBES2Algorithms",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},Cp={name:"pkcs-12PbeParams",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"iterations"}]};tt.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=H.random.getBytesSync(r.saltSize),i=r.count,s=I.integerToDer(i),o,a,c;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var f,u,h;switch(r.algorithm){case"aes128":o=16,f=16,u=hr["aes128-CBC"],h=H.aes.createEncryptionCipher;break;case"aes192":o=24,f=16,u=hr["aes192-CBC"],h=H.aes.createEncryptionCipher;break;case"aes256":o=32,f=16,u=hr["aes256-CBC"],h=H.aes.createEncryptionCipher;break;case"des":o=8,f=8,u=hr.desCBC,h=H.des.createEncryptionCipher;break;default:var l=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw l.algorithm=r.algorithm,l}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),d=Rc(g),p=H.pkcs5.pbkdf2(e,n,i,o,d),y=H.random.getBytesSync(f),x=h(p);x.start(y),x.update(I.toDer(t)),x.finish(),c=x.output.getBytes();var v=Ip(n,s,o,g);a=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr.pkcs5PBES2).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr.pkcs5PBKDF2).getBytes()),v]),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(u).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,y)])])])}else if(r.algorithm==="3des"){o=24;var m=new H.util.ByteBuffer(n),p=tt.pbe.generatePkcs12Key(e,m,1,i,o),y=tt.pbe.generatePkcs12Key(e,m,2,i,o),x=H.des.createEncryptionCipher(p);x.start(y),x.update(I.toDer(t)),x.finish(),c=x.output.getBytes(),a=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,n),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,s.getBytes())])])}else{var l=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw l.algorithm=r.algorithm,l}var A=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[a,I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,c)]);return A};tt.decryptPrivateKeyInfo=function(t,e){var r=null,n={},i=[];if(!I.validate(t,Bp,n,i)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=I.derToOid(n.encryptionOid),a=tt.pbe.getCipher(o,n.encryptionParams,e),c=H.util.createBuffer(n.encryptedData);return a.update(c),a.finish()&&(r=I.fromDer(a.output)),r};tt.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:I.toDer(t).getBytes()};return H.pem.encode(r,{maxline:e})};tt.encryptedPrivateKeyFromPem=function(t){var e=H.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return I.fromDer(e.body)};tt.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=tt.wrapRsaPrivateKey(tt.privateKeyToAsn1(t));return n=tt.encryptPrivateKeyInfo(n,e,r),tt.encryptedPrivateKeyToPem(n)}var i,s,o,a;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,s=H.random.getBytesSync(8),a=H.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,s=H.random.getBytesSync(8),a=H.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var f=H.pbe.opensslDeriveBytes(e,s.substr(0,8),o),u=a(f);u.start(s),u.update(I.toDer(tt.privateKeyToAsn1(t))),u.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:H.util.bytesToHex(s).toUpperCase()},body:u.output.getBytes()};return H.pem.encode(h)};tt.decryptRsaPrivateKey=function(t,e){var r=null,n=H.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,o;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,o=H.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,o=H.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,o=H.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,o=H.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,o=H.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,o=function(h){return H.rc2.createDecryptionCipher(h,40)};break;case"RC2-64-CBC":s=8,o=function(h){return H.rc2.createDecryptionCipher(h,64)};break;case"RC2-128-CBC":s=16,o=function(h){return H.rc2.createDecryptionCipher(h,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var a=H.util.hexToBytes(n.dekInfo.parameters),c=H.pbe.opensslDeriveBytes(e,a.substr(0,8),s),f=o(c);if(f.start(a),f.update(H.util.createBuffer(n.body)),f.finish())r=f.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=tt.decryptPrivateKeyInfo(I.fromDer(r),e):r=I.fromDer(r),r!==null&&(r=tt.privateKeyFromAsn1(r)),r};tt.pbe.generatePkcs12Key=function(t,e,r,n,i,s){var o,a;if(typeof s>"u"||s===null){if(!("sha1"in H.md))throw new Error('"sha1" hash algorithm unavailable.');s=H.md.sha1.create()}var c=s.digestLength,f=s.blockLength,u=new H.util.ByteBuffer,h=new H.util.ByteBuffer;if(t!=null){for(a=0;a=0;a--)q=q>>8,q+=_.at(a)+U.at(a),U.setAt(a,q&255);M.putBuffer(U)}m=M,u.putBuffer(B)}return u.truncate(u.length()-i),u};tt.pbe.getCipher=function(t,e,r){switch(t){case tt.oids.pkcs5PBES2:return tt.pbe.getCipherForPBES2(t,e,r);case tt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case tt.oids["pbewithSHAAnd40BitRC2-CBC"]:return tt.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};tt.pbe.getCipherForPBES2=function(t,e,r){var n={},i=[];if(!I.validate(e,Ap,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}if(t=I.derToOid(n.kdfOid),t!==tt.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=I.derToOid(n.encOid),t!==tt.oids["aes128-CBC"]&&t!==tt.oids["aes192-CBC"]&&t!==tt.oids["aes256-CBC"]&&t!==tt.oids["des-EDE3-CBC"]&&t!==tt.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var o=n.kdfSalt,a=H.util.createBuffer(n.kdfIterationCount);a=a.getInt(a.length()<<3);var c,f;switch(tt.oids[t]){case"aes128-CBC":c=16,f=H.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,f=H.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,f=H.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,f=H.des.createDecryptionCipher;break;case"desCBC":c=8,f=H.des.createDecryptionCipher;break}var u=Lc(n.prfOid),h=H.pkcs5.pbkdf2(r,o,a,c,u),l=n.encIv,g=f(h);return g.start(l),g};tt.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},i=[];if(!I.validate(e,Cp,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=H.util.createBuffer(n.salt),a=H.util.createBuffer(n.iterations);a=a.getInt(a.length()<<3);var c,f,u;switch(t){case tt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,f=8,u=H.des.startDecrypting;break;case tt.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,f=8,u=function(p,y){var x=H.rc2.createDecryptionCipher(p,40);return x.start(y,null),x};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=Lc(n.prfOid),l=tt.pbe.generatePkcs12Key(r,o,1,a,c,h);h.start();var g=tt.pbe.generatePkcs12Key(r,o,2,a,f,h);return u(l,g)};tt.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in H.md))throw new Error('"md5" hash algorithm unavailable.');n=H.md.md5.create()}e===null&&(e="");for(var i=[_c(n,t+e)],s=16,o=1;s{var mt=lt();cr();Bt();var _n=wf.exports=mt.sha512=mt.sha512||{};mt.md.sha512=mt.md.algorithms.sha512=_n;var bf=mt.sha384=mt.sha512.sha384=mt.sha512.sha384||{};bf.create=function(){return _n.create("SHA-384")};mt.md.sha384=mt.md.algorithms.sha384=bf;mt.sha512.sha256=mt.sha512.sha256||{create:function(){return _n.create("SHA-512/256")}};mt.md["sha512/256"]=mt.md.algorithms["sha512/256"]=mt.sha512.sha256;mt.sha512.sha224=mt.sha512.sha224||{create:function(){return _n.create("SHA-512/224")}};mt.md["sha512/224"]=mt.md.algorithms["sha512/224"]=mt.sha512.sha224;_n.create=function(t){if(vf||Yy(),typeof t>"u"&&(t="SHA-512"),!(t in br))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=br[t],r=null,n=mt.util.createBuffer(),i=new Array(80),s=0;s<80;++s)i[s]=new Array(2);var o=64;switch(t){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var a={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength128=[];for(var c=a.messageLengthSize/4,f=0;f>>0,u>>>0];for(var h=a.fullMessageLength.length-1;h>=0;--h)a.fullMessageLength[h]+=u[1],u[1]=u[0]+(a.fullMessageLength[h]/4294967296>>>0),a.fullMessageLength[h]=a.fullMessageLength[h]>>>0,u[0]=u[1]/4294967296>>>0;return n.putBytes(c),mf(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),a},a.digest=function(){var c=mt.util.createBuffer();c.putBytes(n.bytes());var f=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize,u=f&a.blockLength-1;c.putBytes(Fo.substr(0,a.blockLength-u));for(var h,l,g=a.fullMessageLength[0]*8,d=0;d>>0,g+=l,c.putInt32(g>>>0),g=h>>>0;c.putInt32(g);for(var p=new Array(r.length),d=0;d=128;){for(C=0;C<16;++C)e[C][0]=r.getInt32()>>>0,e[C][1]=r.getInt32()>>>0;for(;C<80;++C)L=e[C-2],N=L[0],T=L[1],n=((N>>>19|T<<13)^(T>>>29|N<<3)^N>>>6)>>>0,i=((N<<13|T>>>19)^(T<<3|N>>>29)^(N<<26|T>>>6))>>>0,P=e[C-15],N=P[0],T=P[1],s=((N>>>1|T<<31)^(N>>>8|T<<24)^N>>>7)>>>0,o=((N<<31|T>>>1)^(N<<24|T>>>8)^(N<<25|T>>>7))>>>0,w=e[C-7],K=e[C-16],T=i+w[1]+o+K[1],e[C][0]=n+w[0]+s+K[0]+(T/4294967296>>>0)>>>0,e[C][1]=T>>>0;for(p=t[0][0],y=t[0][1],x=t[1][0],v=t[1][1],m=t[2][0],A=t[2][1],S=t[3][0],B=t[3][1],R=t[4][0],_=t[4][1],O=t[5][0],M=t[5][1],U=t[6][0],q=t[6][1],z=t[7][0],Z=t[7][1],C=0;C<80;++C)f=((R>>>14|_<<18)^(R>>>18|_<<14)^(_>>>9|R<<23))>>>0,u=((R<<18|_>>>14)^(R<<14|_>>>18)^(_<<23|R>>>9))>>>0,h=(U^R&(O^U))>>>0,l=(q^_&(M^q))>>>0,a=((p>>>28|y<<4)^(y>>>2|p<<30)^(y>>>7|p<<25))>>>0,c=((p<<4|y>>>28)^(y<<30|p>>>2)^(y<<25|p>>>7))>>>0,g=(p&x|m&(p^x))>>>0,d=(y&v|A&(y^v))>>>0,T=Z+u+l+Vo[C][1]+e[C][1],n=z+f+h+Vo[C][0]+e[C][0]+(T/4294967296>>>0)>>>0,i=T>>>0,T=c+d,s=a+g+(T/4294967296>>>0)>>>0,o=T>>>0,z=U,Z=q,U=O,q=M,O=R,M=_,T=B+i,R=S+n+(T/4294967296>>>0)>>>0,_=T>>>0,S=m,B=A,m=x,A=v,x=p,v=y,T=i+o,p=n+s+(T/4294967296>>>0)>>>0,y=T>>>0;T=t[0][1]+y,t[0][0]=t[0][0]+p+(T/4294967296>>>0)>>>0,t[0][1]=T>>>0,T=t[1][1]+v,t[1][0]=t[1][0]+x+(T/4294967296>>>0)>>>0,t[1][1]=T>>>0,T=t[2][1]+A,t[2][0]=t[2][0]+m+(T/4294967296>>>0)>>>0,t[2][1]=T>>>0,T=t[3][1]+B,t[3][0]=t[3][0]+S+(T/4294967296>>>0)>>>0,t[3][1]=T>>>0,T=t[4][1]+_,t[4][0]=t[4][0]+R+(T/4294967296>>>0)>>>0,t[4][1]=T>>>0,T=t[5][1]+M,t[5][0]=t[5][0]+O+(T/4294967296>>>0)>>>0,t[5][1]=T>>>0,T=t[6][1]+q,t[6][0]=t[6][0]+U+(T/4294967296>>>0)>>>0,t[6][1]=T>>>0,T=t[7][1]+Z,t[7][0]=t[7][0]+z+(T/4294967296>>>0)>>>0,t[7][1]=T>>>0,V-=128}}});var tu=ht((Cw,jf)=>{var jr=1e3,tn=jr*60,en=tn*60,Sr=en*24,B1=Sr*7,A1=Sr*365.25;jf.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return C1(t);if(r==="number"&&isFinite(t))return e.long?T1(t):I1(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function C1(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*A1;case"weeks":case"week":case"w":return r*B1;case"days":case"day":case"d":return r*Sr;case"hours":case"hour":case"hrs":case"hr":case"h":return r*en;case"minutes":case"minute":case"mins":case"min":case"m":return r*tn;case"seconds":case"second":case"secs":case"sec":case"s":return r*jr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function I1(t){var e=Math.abs(t);return e>=Sr?Math.round(t/Sr)+"d":e>=en?Math.round(t/en)+"h":e>=tn?Math.round(t/tn)+"m":e>=jr?Math.round(t/jr)+"s":t+"ms"}function T1(t){var e=Math.abs(t);return e>=Sr?Vi(t,e,Sr,"day"):e>=en?Vi(t,e,en,"hour"):e>=tn?Vi(t,e,tn,"minute"):e>=jr?Vi(t,e,jr,"second"):t+" ms"}function Vi(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var ru=ht((Iw,eu)=>{function _1(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=tu(),r.destroy=f,Object.keys(t).forEach(u=>{r[u]=t[u]}),r.names=[],r.skips=[],r.formatters={};function e(u){let h=0;for(let l=0;l{if(B==="%%")return"%";A++;let _=r.formatters[R];if(typeof _=="function"){let O=y[A];B=_.call(x,O),y.splice(A,1),A--}return B}),r.formatArgs.call(x,y),(x.log||r.log).apply(x,y)}return p.namespace=u,p.useColors=r.useColors(),p.color=r.selectColor(u),p.extend=n,p.destroy=r.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>l!==null?l:(g!==r.namespaces&&(g=r.namespaces,d=r.enabled(u)),d),set:y=>{l=y}}),typeof r.init=="function"&&r.init(p),p}function n(u,h){let l=r(this.namespace+(typeof h>"u"?":":h)+u);return l.log=this.log,l}function i(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let h,l=(typeof u=="string"?u:"").split(/[\s,]+/),g=l.length;for(h=0;h"-"+h)].join(",");return r.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let h,l;for(h=0,l=r.skips.length;h{jt.formatArgs=R1;jt.save=N1;jt.load=D1;jt.useColors=L1;jt.storage=k1();jt.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();jt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function L1(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function R1(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Hi.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}jt.log=console.debug||console.log||(()=>{});function N1(t){try{t?jt.storage.setItem("debug",t):jt.storage.removeItem("debug")}catch{}}function D1(){let t;try{t=jt.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function k1(){try{return localStorage}catch{}}Hi.exports=ru()(jt);var{formatters:P1}=Hi.exports;P1.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var V1={};_t(V1,{noise:()=>F1,pureJsCrypto:()=>di});function Me(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function rt(t=0){return globalThis.Buffer?.alloc!=null?Me(globalThis.Buffer.alloc(t)):new Uint8Array(t)}function It(t=0){return globalThis.Buffer?.allocUnsafe!=null?Me(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}var Su=Math.pow(2,7),Bu=Math.pow(2,14),Au=Math.pow(2,21),Zi=Math.pow(2,28),Xi=Math.pow(2,35),Qi=Math.pow(2,42),Ji=Math.pow(2,49),ct=128,Ht=127;function Be(t){if(tNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Cu(t,e,r=0){switch(Be(t)){case 8:e[r++]=t&255|ct,t/=128;case 7:e[r++]=t&255|ct,t/=128;case 6:e[r++]=t&255|ct,t/=128;case 5:e[r++]=t&255|ct,t/=128;case 4:e[r++]=t&255|ct,t>>>=7;case 3:e[r++]=t&255|ct,t>>>=7;case 2:e[r++]=t&255|ct,t>>>=7;case 1:{e[r++]=t&255,t>>>=7;break}default:throw new Error("unreachable")}return e}function Iu(t,e,r=0){switch(Be(t)){case 8:e.set(r++,t&255|ct),t/=128;case 7:e.set(r++,t&255|ct),t/=128;case 6:e.set(r++,t&255|ct),t/=128;case 5:e.set(r++,t&255|ct),t/=128;case 4:e.set(r++,t&255|ct),t>>>=7;case 3:e.set(r++,t&255|ct),t>>>=7;case 2:e.set(r++,t&255|ct),t>>>=7;case 1:{e.set(r++,t&255),t>>>=7;break}default:throw new Error("unreachable")}return e}function Tu(t,e){let r=t[e],n=0;if(n+=r&Ht,ri+s.length,0));let r=It(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return Me(r)}function Lt(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let r=0;for(let n of e)if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.push(n);else if(Fn(n))r+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}prepend(...e){this.prependAll(e)}prependAll(e){let r=0;for(let n of e.reverse())if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.unshift(n);else if(Fn(n))r+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}get(e){let r=da(this.bufs,e);return r.buf[r.index]}set(e,r){let n=da(this.bufs,e);n.buf[n.index]=r}write(e,r=0){if(e instanceof Uint8Array)for(let n=0;n0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,r){let{bufs:n,length:i}=this._subList(e,r);return Gt(n,i)}subarray(e,r){let{bufs:n,length:i}=this._subList(e,r);return n.length===1?n[0]:Gt(n,i)}sublist(e,r){let{bufs:n,length:i}=this._subList(e,r),s=new t;return s.length=i,s.bufs=n,s}_subList(e,r){if(e=e??0,r=r??this.length,e<0&&(e=this.length+e),r<0&&(r=this.length+r),e<0||r>this.length)throw new RangeError("index is out of bounds");if(e===r)return{bufs:[],length:0};if(e===0&&r===this.length)return{bufs:[...this.bufs],length:this.length};let n=[],i=0;for(let s=0;s=c)continue;let f=e>=a&&ea&&r<=c;if(f&&u){if(e===a&&r===c){n.push(o);break}let h=e-a;n.push(o.subarray(h,h+(r-e)));break}if(f){if(e===0){n.push(o);continue}n.push(o.subarray(e-a));continue}if(u){if(r===c){n.push(o);break}n.push(o.subarray(0,r-a));break}n.push(o)}return{bufs:n,length:r-e}}indexOf(e,r=0){if(!Fn(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(r=Number(r??0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),e.length===0)return r>this.length?this.length:r;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let s=256,o=new Int32Array(s);for(let h=0;h=0;l--){let g=this.get(h+l);if(n[l]!==g){u=Math.max(1,l-a[g]);break}}if(u===0)return h}return-1}getInt8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt8(0)}setInt8(e,r){let n=It(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,r),this.write(n,e)}getInt16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,r)}setInt16(e,r,n){let i=rt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,r,n),this.write(i,e)}getInt32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,r)}setInt32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,r,n),this.write(i,e)}getBigInt64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,r)}setBigInt64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,r,n),this.write(i,e)}getUint8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint8(0)}setUint8(e,r){let n=It(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,r),this.write(n,e)}getUint16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,r)}setUint16(e,r,n){let i=rt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,r,n),this.write(i,e)}getUint32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,r)}setUint32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,r,n),this.write(i,e)}getBigUint64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,r)}setBigUint64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,r,n),this.write(i,e)}getFloat32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,r)}setFloat32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,r,n),this.write(i,e)}getFloat64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,r)}setFloat64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,r,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof t)||e.bufs.length!==this.bufs.length)return!1;for(let r=0;ri+s.byteLength,0)),n.length=r,n}};function Vn(t){return t[Symbol.asyncIterator]!=null}var Hn=t=>{let e=Be(t),r=It(e);return la(t,r),Hn.bytes=e,r};Hn.bytes=0;function nn(t,e){e=e??{};let r=e.lengthEncoder??Hn;function*n(i){let s=r(i.byteLength);s instanceof Uint8Array?yield s:yield*s,i instanceof Uint8Array?yield i:yield*i}return Vn(t)?async function*(){for await(let i of t)yield*n(i)}():function*(){for(let i of t)yield*n(i)}()}nn.single=(t,e)=>{e=e??{};let r=e.lengthEncoder??Hn;return new Rt(r(t.byteLength),t)};var Br=zt(xa(),1);var Ru=8,Nu=1024*1024*4,er;(function(t){t[t.LENGTH=0]="LENGTH",t[t.DATA=1]="DATA"})(er||(er={}));var ts=t=>{let e=Mn(t);return ts.bytes=Be(e),e};ts.bytes=0;function sn(t,e){let r=new Rt,n=er.LENGTH,i=-1,s=e?.lengthDecoder??ts,o=e?.maxLengthLength??Ru,a=e?.maxDataLength??Nu;function*c(){for(;r.byteLength>0;){if(n===er.LENGTH)try{if(i=s(r),i<0)throw(0,Br.default)(new Error("invalid message length"),"ERR_INVALID_MSG_LENGTH");if(i>a)throw(0,Br.default)(new Error("message length too long"),"ERR_MSG_DATA_TOO_LONG");let f=s.bytes;r.consume(f),e?.onLength!=null&&e.onLength(i),n=er.DATA}catch(f){if(f instanceof RangeError){if(r.byteLength>o)throw(0,Br.default)(new Error("message length length too long"),"ERR_MSG_LENGTH_TOO_LONG");break}throw f}if(n===er.DATA){if(r.byteLength0)throw(0,Br.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}():function*(){for(let f of t)r.append(f),yield*c();if(r.byteLength>0)throw(0,Br.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}()}sn.fromReader=(t,e)=>{let r=1,n=async function*(){for(;;)try{let{done:s,value:o}=await t.next(r);if(s===!0)return;o!=null&&(yield o)}catch(s){if(s.code==="ERR_UNDER_READ")return{done:!0,value:null};throw s}finally{r=1}}();return sn(n,{...e??{},onLength:s=>{r=s}})};function oe(){let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}var qn=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=r??"ABORT_ERR"}};async function ma(t,e,r){if(e==null)return t;if(e.aborted)return Promise.reject(new qn(r?.errorMessage,r?.errorCode));let n,i=new qn(r?.errorMessage,r?.errorCode);try{return await Promise.race([t,new Promise((s,o)=>{n=()=>{o(i)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var es=class{needNext;haveNext;ended;nextResult;constructor(){this.ended=!1,this.needNext=oe(),this.needNext.resolve(),this.haveNext=oe()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("Have next but next was undefined");let e=this.nextResult;return this.nextResult=void 0,this.needNext.resolve(),this.needNext=oe(),e}async throw(e){return this.ended=!0,e!=null&&this.haveNext.reject(e),{done:!0,value:void 0}}async return(){let e={done:!0,value:void 0};return await this._push(void 0),e}async push(e,r){await this._push(e,r)}async end(e,r){e!=null?await this.throw(e):await this._push(void 0,r)}async _push(e,r){if(e!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");this.nextResult!=null&&await this.needNext.promise,e!=null?this.nextResult={done:!1,value:e}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=oe(),await ma(this.needNext.promise,r?.signal,r)}};function ba(){return new es}var zn=class extends Error{code;constructor(e,r){super(e),this.code=r}},rs=class extends zn{type;constructor(e){super(e,"ABORT_ERR"),this.type="aborted"}};function va(t,e){let r=ba();t.sink(r).catch(async o=>{await r.end(o)}),t.sink=async o=>{for await(let a of o)await r.push(a);await r.end()};let n=t.source;t.source[Symbol.iterator]!=null?n=t.source[Symbol.iterator]():t.source[Symbol.asyncIterator]!=null&&(n=t.source[Symbol.asyncIterator]());let i=new Rt;return{read:async(o,a)=>{a?.signal?.throwIfAborted();let c,f=new Promise((u,h)=>{c=()=>{h(new rs("Read aborted"))},a?.signal?.addEventListener("abort",c)});try{if(o==null){let{done:h,value:l}=await Promise.race([n.next(),f]);return h===!0?new Rt:l}for(;i.byteLength{a?.signal?.throwIfAborted(),o instanceof Uint8Array?await r.push(o,a):await r.push(o.subarray(),a)},unwrap:()=>{if(i.byteLength>0){let o=t.source;t.source=async function*(){e?.yieldBytes===!1?yield i:yield*i,yield*o}()}return t}}}var Gn=class extends Error{code;constructor(e,r){super(e),this.code=r}},wa=t=>Mn(t);wa.bytes=0;function ns(t,e={}){let r=va(t,e);return e.maxDataLength!=null&&e.maxLengthLength==null&&(e.maxLengthLength=Be(e.maxDataLength)),{read:async i=>{let s=-1,o=new Rt,a=e?.lengthDecoder??wa;for(;;){o.append(await r.read(1,i));try{s=a(o)}catch(c){if(c instanceof RangeError)continue;throw c}if(e?.maxLengthLength!=null&&o.byteLength>e.maxLengthLength)throw new Gn("message length length too long","ERR_MSG_LENGTH_TOO_LONG");if(s>-1)break}if(e?.maxDataLength!=null&&s>e.maxDataLength)throw new Gn("message length too long","ERR_MSG_DATA_TOO_LONG");return r.read(s,i)},write:async(i,s)=>{await r.write(nn.single(i,e),s)},writeV:async(i,s)=>{let o=new Rt(...i.map(a=>nn.single(a,e)));await r.write(o,s)},unwrap:()=>r.unwrap()}}function is(){let t=oe(),e=!1;return{sink:async r=>{if(e)throw new Error("already piped");e=!0,t.resolve(r)},source:async function*(){yield*await t.promise}()}}function Ea(){let t=is(),e=is();return[{source:t.source,sink:e.sink},{source:e.source,sink:t.sink}]}var $n=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},Ar=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new $n(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let r=this.head;this.head=r.next=new $n(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var ss=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function Wn(t={}){return ku(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},t)}function ku(t,e){e=e??{};let r=e.onEnd,n=new Ar,i,s,o,a=oe(),c=async()=>{try{return n.isEmpty()?o?{done:!0}:await new Promise((y,x)=>{s=v=>{s=null,n.push(v);try{y(t(n))}catch(m){x(m)}return i}}):t(n)}finally{n.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=oe()})}},f=y=>s!=null?s(y):(n.push(y),i),u=y=>(n=new Ar,s!=null?s({error:y}):(n.push({error:y}),i)),h=y=>{if(o)return i;if(e?.objectMode!==!0&&y?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return f({done:!1,value:y})},l=y=>o?i:(o=!0,y!=null?u(y):f({done:!0})),g=()=>(n=new Ar,l(),{done:!0}),d=y=>(l(y),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:c,return:g,throw:d,push:h,end:l,get readableLength(){return n.size},onEmpty:async y=>{let x=y?.signal;if(x?.throwIfAborted(),n.isEmpty())return;let v,m;x!=null&&(v=new Promise((A,S)=>{m=()=>{S(new ss)},x.addEventListener("abort",m)}));try{await Promise.race([a.promise,v])}finally{m!=null&&x!=null&&x?.removeEventListener("abort",m)}}},r==null)return i;let p=i;return i={[Symbol.asyncIterator](){return this},next(){return p.next()},throw(y){return p.throw(y),r!=null&&(r(y),r=void 0),{done:!0}},return(){return p.return(),r!=null&&(r(),r=void 0),{done:!0}},push:h,end(y){return p.end(y),r!=null&&(r(y),r=void 0),i},get readableLength(){return p.readableLength},onEmpty:y=>p.onEmpty(y)},i}function Pu(t){return t[Symbol.asyncIterator]!=null}function Uu(...t){let e=[];for(let r of t)Pu(r)||e.push(r);return e.length===t.length?function*(){for(let r of e)yield*r}():async function*(){let r=Wn({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(t.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var Sa=Uu;function Ba(t,...e){if(t==null)throw new Error("Empty pipeline");if(os(t)){let n=t;t=()=>n.source}else if(Ca(t)||Aa(t)){let n=t;t=()=>n}let r=[t,...e];if(r.length>1&&os(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n{let e;for(;t.length>0;)e=t.shift()(e);return e},Aa=t=>t?.[Symbol.asyncIterator]!=null,Ca=t=>t?.[Symbol.iterator]!=null,os=t=>t==null?!1:t.sink!=null&&t.source!=null,Ou=t=>e=>{let r=t.sink(e);if(r?.then!=null){let n=Wn({objectMode:!0});r.then(()=>{n.end()},o=>{n.end(o)});let i,s=t.source;if(Aa(s))i=async function*(){yield*s,n.end()};else if(Ca(s))i=function*(){yield*s,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return Sa(n,i())}return t.source};var Ia=!!globalThis.process?.env?.DUMP_SESSION_KEYS;var Mu=t=>t instanceof Uint8Array;var Ae=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Ta=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Fu=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Fu)throw new Error("Non little-endian hardware is not supported");function Yn(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Zn(t){if(typeof t=="string")t=Yn(t);else if(Mu(t))t=t.slice();else throw new Error(`expected Uint8Array, got ${typeof t}`);return t}var Vu=t=>Object.prototype.toString.call(t)==="[object Object]"&&t.constructor===Object;function _a(t,e){if(e!==void 0&&(typeof e!="object"||!Vu(e)))throw new Error("options must be object or undefined");return Object.assign(t,e)}function rr(t,e){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");if(typeof e=="number"&&t.length!==e)throw new Error(`Uint8Array length ${e} expected`)}function La(t,e){if(t.length!==e.length)throw new Error("equalBytes: Different size of Uint8Arrays");let r=!0;for(let n=0;n(Object.assign(e,t),e);function cs(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,f=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+f,a,n)}function Xn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function fs(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function Cr(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function us(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ra(t,e){Cr(t);let r=e.outputLen;if(t.lengtht[e++]&255|(t[e++]&255)<<8,hs=class{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=Zn(e),rr(e,32);let r=Ot(e,0),n=Ot(e,2),i=Ot(e,4),s=Ot(e,6),o=Ot(e,8),a=Ot(e,10),c=Ot(e,12),f=Ot(e,14);this.r[0]=r&8191,this.r[1]=(r>>>13|n<<3)&8191,this.r[2]=(n>>>10|i<<6)&7939,this.r[3]=(i>>>7|s<<9)&8191,this.r[4]=(s>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|f<<8)&8191,this.r[9]=f>>>5&127;for(let u=0;u<8;u++)this.pad[u]=Ot(e,16+2*u)}process(e,r,n=!1){let i=n?0:2048,{h:s,r:o}=this,a=o[0],c=o[1],f=o[2],u=o[3],h=o[4],l=o[5],g=o[6],d=o[7],p=o[8],y=o[9],x=Ot(e,r+0),v=Ot(e,r+2),m=Ot(e,r+4),A=Ot(e,r+6),S=Ot(e,r+8),B=Ot(e,r+10),R=Ot(e,r+12),_=Ot(e,r+14),O=s[0]+(x&8191),M=s[1]+((x>>>13|v<<3)&8191),U=s[2]+((v>>>10|m<<6)&8191),q=s[3]+((m>>>7|A<<9)&8191),z=s[4]+((A>>>4|S<<12)&8191),Z=s[5]+(S>>>1&8191),C=s[6]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c+L*a,w+=ut>>>13,ut&=8191,w=(w<<2)+w|0,w=w+P|0,P=w&8191,w=w>>>13,K+=w,s[0]=P,s[1]=K,s[2]=V,s[3]=W,s[4]=Y,s[5]=et,s[6]=X,s[7]=J,s[8]=dt,s[9]=ut}finalize(){let{h:e,pad:r}=this,n=new Uint16Array(10),i=e[1]>>>13;e[1]&=8191;for(let a=2;a<10;a++)e[a]+=i,i=e[a]>>>13,e[a]&=8191;e[0]+=i*5,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,n[0]=e[0]+5,i=n[0]>>>13,n[0]&=8191;for(let a=1;a<10;a++)n[a]=e[a]+i,i=n[a]>>>13,n[a]&=8191;n[9]-=8192;let s=(i^1)-1;for(let a=0;a<10;a++)n[a]&=s;s=~s;for(let a=0;a<10;a++)e[a]=e[a]&s|n[a];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let o=e[0]+r[0];e[0]=o&65535;for(let a=1;a<8;a++)o=(e[a]+r[a]|0)+(o>>>16)|0,e[a]=o&65535}update(e){us(this);let{buffer:r,blockLen:n}=this;e=Zn(e);let i=e.length;for(let s=0;s>>0,e[s++]=n[o]>>>8;return e}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}};function Hu(t){let e=(n,i)=>t(i).update(Zn(n)).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}var Na=Hu(t=>new hs(t));var qu=Yn("expand 16-byte k"),zu=Yn("expand 32-byte k"),Gu=Ae(qu),$u=Ae(zu);function G(t,e){return t<>>32-e}function ls(t){return t.byteOffset%4===0}var Qn=64,Wu=16,ka=2**32-1,Da=new Uint32Array;function Yu(t,e,r,n,i,s,o,a){let c=i.length,f=new Uint8Array(Qn),u=Ae(f),h=ls(i)&&ls(s),l=h?Ae(i):Da,g=h?Ae(s):Da;for(let d=0;d=ka)throw new Error("arx: counter overflow");let p=Math.min(Qn,c-d);if(h&&p===Qn){let y=d/4;if(d%4!==0)throw new Error("arx: invalid block position");for(let x=0,v;x{Cr(a),Cr(c),Cr(f);let l=f.length;if(u||(u=new Uint8Array(l)),Cr(u),Xn(h),h<0||h>=ka)throw new Error("arx: counter overflow");if(u.length0;)g.pop().fill(0);return u}}function Ka(t,e,r,n,i,s=20){let o=t[0],a=t[1],c=t[2],f=t[3],u=e[0],h=e[1],l=e[2],g=e[3],d=e[4],p=e[5],y=e[6],x=e[7],v=i,m=r[0],A=r[1],S=r[2],B=o,R=a,_=c,O=f,M=u,U=h,q=l,z=g,Z=d,C=p,N=y,T=x,L=v,w=m,P=A,K=S;for(let W=0;W{t.update(e);let r=e.length%16;r&&t.update(Ju.subarray(r))},ju=new Uint8Array(32);function Ua(t,e,r,n,i){let s=t(e,r,ju),o=Na.create(s);i&&Pa(o,i),Pa(o,n);let a=new Uint8Array(16),c=Ta(a);cs(c,0,BigInt(i?i.length:0),!0),cs(c,8,BigInt(n.length),!0),o.update(a);let f=o.digest();return s.fill(0),f}var Oa=t=>(e,r,n)=>(rr(e,32),rr(r),{encrypt:(s,o)=>{let a=s.length,c=a+16;o?rr(o,c):o=new Uint8Array(c),t(e,r,s,o,1);let f=Ua(t,e,r,o.subarray(0,-16),n);return o.set(f,a),o},decrypt:(s,o)=>{let a=s.length,c=a-16;if(a<16)throw new Error("encrypted data must be at least 16 bytes");o?rr(o,c):o=new Uint8Array(c);let f=s.subarray(0,-16),u=s.subarray(-16),h=Ua(t,e,r,f,n);if(!La(u,h))throw new Error("invalid tag");return t(e,r,f,o,1),o}}),ps=as({blockSize:64,nonceLength:12,tagLength:16},Oa(Xu)),Zg=as({blockSize:64,nonceLength:24,tagLength:16},Oa(Qu));function Jn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function ys(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function on(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Jn(t.outputLen),Jn(t.blockLen)}function Ir(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ma(t,e){ys(t);let r=e.outputLen;if(t.lengtht instanceof Uint8Array;var ti=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ae=(t,e)=>t<<32-e|t>>>e,th=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!th)throw new Error("Non little-endian hardware is not supported");function gs(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Fe(t){if(typeof t=="string"&&(t=gs(t)),!Fa(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function ei(...t){let e=new Uint8Array(t.reduce((n,i)=>n+i.length,0)),r=0;return t.forEach(n=>{if(!Fa(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}var Tr=class{clone(){return this._cloneInto()}},tx={}.toString;function ri(t){let e=n=>t().update(Fe(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function nr(t=32){if(jn&&typeof jn.getRandomValues=="function")return jn.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function eh(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,f=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+f,a,n)}var _r=class extends Tr{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ti(this.buffer)}update(e){Ir(this);let{view:r,buffer:n,blockLen:i}=this;e=Fe(e);let s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let h=o;hu.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h>xs&ni)}:{h:Number(t>>xs&ni)|0,l:Number(t&ni)|0}}function rh(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),ih=(t,e,r)=>t>>>r,sh=(t,e,r)=>t<<32-r|e>>>r,oh=(t,e,r)=>t>>>r|e<<32-r,ah=(t,e,r)=>t<<32-r|e>>>r,ch=(t,e,r)=>t<<64-r|e>>>r-32,fh=(t,e,r)=>t>>>r-32|e<<64-r,uh=(t,e)=>e,hh=(t,e)=>t,lh=(t,e,r)=>t<>>32-r,dh=(t,e,r)=>e<>>32-r,ph=(t,e,r)=>e<>>64-r,yh=(t,e,r)=>t<>>64-r;function gh(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var xh=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),mh=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,bh=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),vh=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,wh=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Eh=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0;var Sh={fromBig:Va,split:rh,toBig:nh,shrSH:ih,shrSL:sh,rotrSH:oh,rotrSL:ah,rotrBH:ch,rotrBL:fh,rotr32H:uh,rotr32L:hh,rotlSH:lh,rotlSL:dh,rotlBH:ph,rotlBL:yh,add:gh,add3L:xh,add3H:mh,add4L:bh,add4H:vh,add5H:Eh,add5L:wh},j=Sh;var[Bh,Ah]=j.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Ve=new Uint32Array(80),He=new Uint32Array(80),ms=class extends _r{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:f,El:u,Fh:h,Fl:l,Gh:g,Gl:d,Hh:p,Hl:y}=this;return[e,r,n,i,s,o,a,c,f,u,h,l,g,d,p,y]}set(e,r,n,i,s,o,a,c,f,u,h,l,g,d,p,y){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=f|0,this.El=u|0,this.Fh=h|0,this.Fl=l|0,this.Gh=g|0,this.Gl=d|0,this.Hh=p|0,this.Hl=y|0}process(e,r){for(let m=0;m<16;m++,r+=4)Ve[m]=e.getUint32(r),He[m]=e.getUint32(r+=4);for(let m=16;m<80;m++){let A=Ve[m-15]|0,S=He[m-15]|0,B=j.rotrSH(A,S,1)^j.rotrSH(A,S,8)^j.shrSH(A,S,7),R=j.rotrSL(A,S,1)^j.rotrSL(A,S,8)^j.shrSL(A,S,7),_=Ve[m-2]|0,O=He[m-2]|0,M=j.rotrSH(_,O,19)^j.rotrBH(_,O,61)^j.shrSH(_,O,6),U=j.rotrSL(_,O,19)^j.rotrBL(_,O,61)^j.shrSL(_,O,6),q=j.add4L(R,U,He[m-7],He[m-16]),z=j.add4H(q,B,M,Ve[m-7],Ve[m-16]);Ve[m]=z|0,He[m]=q|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:f,Dl:u,Eh:h,El:l,Fh:g,Fl:d,Gh:p,Gl:y,Hh:x,Hl:v}=this;for(let m=0;m<80;m++){let A=j.rotrSH(h,l,14)^j.rotrSH(h,l,18)^j.rotrBH(h,l,41),S=j.rotrSL(h,l,14)^j.rotrSL(h,l,18)^j.rotrBL(h,l,41),B=h&g^~h&p,R=l&d^~l&y,_=j.add5L(v,S,R,Ah[m],He[m]),O=j.add5H(_,x,A,B,Bh[m],Ve[m]),M=_|0,U=j.rotrSH(n,i,28)^j.rotrBH(n,i,34)^j.rotrBH(n,i,39),q=j.rotrSL(n,i,28)^j.rotrBL(n,i,34)^j.rotrBL(n,i,39),z=n&s^n&a^s&a,Z=i&o^i&c^o&c;x=p|0,v=y|0,p=g|0,y=d|0,g=h|0,d=l|0,{h,l}=j.add(f|0,u|0,O|0,M|0),f=a|0,u=c|0,a=s|0,c=o|0,s=n|0,o=i|0;let C=j.add3L(M,q,Z);n=j.add3H(C,O,U,z),i=C|0}({h:n,l:i}=j.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=j.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=j.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:f,l:u}=j.add(this.Dh|0,this.Dl|0,f|0,u|0),{h,l}=j.add(this.Eh|0,this.El|0,h|0,l|0),{h:g,l:d}=j.add(this.Fh|0,this.Fl|0,g|0,d|0),{h:p,l:y}=j.add(this.Gh|0,this.Gl|0,p|0,y|0),{h:x,l:v}=j.add(this.Hh|0,this.Hl|0,x|0,v|0),this.set(n,i,s,o,a,c,f,u,h,l,g,d,p,y,x,v)}roundClean(){Ve.fill(0),He.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var bs=ri(()=>new ms);var oi={};_t(oi,{bitGet:()=>Nh,bitLen:()=>Rh,bitMask:()=>an,bitSet:()=>Dh,bytesToHex:()=>Ce,bytesToNumberBE:()=>Ie,bytesToNumberLE:()=>ce,concatBytes:()=>_e,createHmacDrbg:()=>Es,ensureBytes:()=>yt,equalBytes:()=>_h,hexToBytes:()=>ir,hexToNumber:()=>ws,numberToBytesBE:()=>qe,numberToBytesLE:()=>Te,numberToHexUnpadded:()=>za,numberToVarBytesBE:()=>Th,utf8ToBytes:()=>Lh,validateObject:()=>ee});var qa=BigInt(0),ii=BigInt(1),Ch=BigInt(2),si=t=>t instanceof Uint8Array,Ih=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Ce(t){if(!si(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0)),r=0;return t.forEach(n=>{if(!si(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function _h(t,e){if(t.length!==e.length)return!1;for(let r=0;rqa;t>>=ii,e+=1);return e}function Nh(t,e){return t>>BigInt(e)&ii}var Dh=(t,e,r)=>t|(r?ii:qa)<(Ch<new Uint8Array(t),Ha=t=>Uint8Array.from(t);function Es(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=vs(t),i=vs(t),s=0,o=()=>{n.fill(1),i.fill(0),s=0},a=(...h)=>r(i,n,...h),c=(h=vs())=>{i=a(Ha([0]),h),n=a(),h.length!==0&&(i=a(Ha([1]),h),n=a())},f=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let h=0,l=[];for(;h{o(),c(h);let g;for(;!(g=l(f()));)c();return o(),g}}var kh={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function ee(t,e,r={}){let n=(i,s,o)=>{let a=kh[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);let c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(let[i,s]of Object.entries(e))n(i,s,!1);for(let[i,s]of Object.entries(r))n(i,s,!0);return t}var Tt=BigInt(0),bt=BigInt(1),sr=BigInt(2),Ph=BigInt(3),Ss=BigInt(4),Ga=BigInt(5),$a=BigInt(8),Uh=BigInt(9),Kh=BigInt(16);function at(t,e){let r=t%e;return r>=Tt?r:e+r}function Bs(t,e,r){if(r<=Tt||e 0");if(r===bt)return Tt;let n=bt;for(;e>Tt;)e&bt&&(n=n*t%r),t=t*t%r,e>>=bt;return n}function gt(t,e,r){let n=t;for(;e-- >Tt;)n*=n,n%=r;return n}function ai(t,e){if(t===Tt||e<=Tt)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=at(t,e),n=e,i=Tt,s=bt,o=bt,a=Tt;for(;r!==Tt;){let f=n/r,u=n%r,h=i-o*f,l=s-a*f;n=r,r=u,i=o,s=a,o=h,a=l}if(n!==bt)throw new Error("invert: does not exist");return at(i,e)}function Oh(t){let e=(t-bt)/sr,r,n,i;for(r=t-bt,n=0;r%sr===Tt;r/=sr,n++);for(i=sr;i(at(t,e)&bt)===bt,Fh=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function As(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Fh.reduce((n,i)=>(n[i]="function",n),e);return ee(t,r)}function Vh(t,e,r){if(r 0");if(r===Tt)return t.ONE;if(r===bt)return e;let n=t.ONE,i=e;for(;r>Tt;)r&bt&&(n=t.mul(n,i)),i=t.sqr(i),r>>=bt;return n}function Hh(t,e){let r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function Cs(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function ci(t,e,r=!1,n={}){if(t<=Tt)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:s}=Cs(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=Mh(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:an(i),ZERO:Tt,ONE:bt,create:c=>at(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Tt<=c&&cc===Tt,isOdd:c=>(c&bt)===bt,neg:c=>at(-c,t),eql:(c,f)=>c===f,sqr:c=>at(c*c,t),add:(c,f)=>at(c+f,t),sub:(c,f)=>at(c-f,t),mul:(c,f)=>at(c*f,t),pow:(c,f)=>Vh(a,c,f),div:(c,f)=>at(c*ai(f,t),t),sqrN:c=>c*c,addN:(c,f)=>c+f,subN:(c,f)=>c-f,mulN:(c,f)=>c*f,inv:c=>ai(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>Hh(a,c),cmov:(c,f,u)=>u?f:c,toBytes:c=>r?Te(c,s):qe(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?ce(c):Ie(c)}});return Object.freeze(a)}function Ya(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}function Za(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function Is(t){let e=Za(t);return e+Math.ceil(e/2)}function Xa(t,e,r=!1){let n=t.length,i=Za(e),s=Is(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let o=r?Ie(t):ce(t),a=at(o,e-bt)+bt;return r?Te(a,i):qe(a,i)}var zh=BigInt(0),Ts=BigInt(1);function fi(t,e){let r=(i,s)=>{let o=s.negate();return i?o:s},n=i=>{let s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>zh;)s&Ts&&(o=o.add(a)),a=a.double(),s>>=Ts;return o},precomputeWindow(i,s){let{windows:o,windowSize:a}=n(s),c=[],f=i,u=f;for(let h=0;h>=g,y>c&&(y-=l,o+=Ts);let x=p,v=p+Math.abs(y)-1,m=d%2!==0,A=y<0;y===0?u=u.add(r(m,s[x])):f=f.add(r(A,s[v]))}return{p:f,f:u}},wNAFCached(i,s,o,a){let c=i._WINDOW_SIZE||1,f=s.get(i);return f||(f=this.precomputeWindow(i,c),c!==1&&s.set(i,a(f))),this.wNAF(c,f,o)}}}function cn(t){return As(t.Fp),ee(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Cs(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var fe=BigInt(0),Qt=BigInt(1),ui=BigInt(2),Gh=BigInt(8),$h={zip215:!0};function Wh(t){let e=cn(t);return ee(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function hi(t){let e=Wh(t),{Fp:r,n,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,f=ui<{try{return{isValid:!0,value:r.sqrt(L*r.inv(w))}}catch{return{isValid:!1,value:fe}}}),l=e.adjustScalarBytes||(L=>L),g=e.domain||((L,w,P)=>{if(w.length||P)throw new Error("Contexts/pre-hash are not supported");return L}),d=L=>typeof L=="bigint"&&fed(L)&&d(w)&&LL===fe||p(L,f);function x(L,w){if(p(L,w))return L;throw new Error(`Expected valid scalar < ${w}, got ${typeof L} ${L}`)}function v(L){return L===fe?L:x(L,n)}let m=new Map;function A(L){if(!(L instanceof S))throw new Error("ExtendedPoint expected")}class S{constructor(w,P,K,V){if(this.ex=w,this.ey=P,this.ez=K,this.et=V,!y(w))throw new Error("x required");if(!y(P))throw new Error("y required");if(!y(K))throw new Error("z required");if(!y(V))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(w){if(w instanceof S)throw new Error("extended point not allowed");let{x:P,y:K}=w||{};if(!y(P)||!y(K))throw new Error("invalid affine point");return new S(P,K,Qt,u(P*K))}static normalizeZ(w){let P=r.invertBatch(w.map(K=>K.ez));return w.map((K,V)=>K.toAffine(P[V])).map(S.fromAffine)}_setWindowSize(w){this._WINDOW_SIZE=w,m.delete(this)}assertValidity(){let{a:w,d:P}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:K,ey:V,ez:W,et:Y}=this,et=u(K*K),X=u(V*V),J=u(W*W),dt=u(J*J),ut=u(et*w),Ut=u(J*u(ut+X)),Kt=u(dt+u(P*u(et*X)));if(Ut!==Kt)throw new Error("bad point: equation left != right (1)");let Ct=u(K*V),Vt=u(W*Y);if(Ct!==Vt)throw new Error("bad point: equation left != right (2)")}equals(w){A(w);let{ex:P,ey:K,ez:V}=this,{ex:W,ey:Y,ez:et}=w,X=u(P*et),J=u(W*V),dt=u(K*et),ut=u(Y*V);return X===J&&dt===ut}is0(){return this.equals(S.ZERO)}negate(){return new S(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:w}=e,{ex:P,ey:K,ez:V}=this,W=u(P*P),Y=u(K*K),et=u(ui*u(V*V)),X=u(w*W),J=P+K,dt=u(u(J*J)-W-Y),ut=X+Y,Ut=ut-et,Kt=X-Y,Ct=u(dt*Ut),Vt=u(ut*Kt),Se=u(dt*Kt),tr=u(Ut*ut);return new S(Ct,Vt,tr,Se)}add(w){A(w);let{a:P,d:K}=e,{ex:V,ey:W,ez:Y,et}=this,{ex:X,ey:J,ez:dt,et:ut}=w;if(P===BigInt(-1)){let ia=u((W-V)*(J+X)),sa=u((W+V)*(J-X)),Yi=u(sa-ia);if(Yi===fe)return this.double();let oa=u(Y*ui*ut),aa=u(et*ui*dt),ca=aa+oa,fa=sa+ia,ua=aa-oa,du=u(ca*Yi),pu=u(fa*ua),yu=u(ca*ua),gu=u(Yi*fa);return new S(du,pu,gu,yu)}let Ut=u(V*X),Kt=u(W*J),Ct=u(et*K*ut),Vt=u(Y*dt),Se=u((V+W)*(X+J)-Ut-Kt),tr=Vt-Ct,rn=Vt+Ct,na=u(Kt-P*Ut),fu=u(Se*tr),uu=u(rn*na),hu=u(Se*na),lu=u(tr*rn);return new S(fu,uu,lu,hu)}subtract(w){return this.add(w.negate())}wNAF(w){return _.wNAFCached(this,m,w,S.normalizeZ)}multiply(w){let{p:P,f:K}=this.wNAF(x(w,n));return S.normalizeZ([P,K])[0]}multiplyUnsafe(w){let P=v(w);return P===fe?R:this.equals(R)||P===Qt?this:this.equals(B)?this.wNAF(P).p:_.unsafeLadder(this,P)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return _.unsafeLadder(this,n).is0()}toAffine(w){let{ex:P,ey:K,ez:V}=this,W=this.is0();w==null&&(w=W?Gh:r.inv(V));let Y=u(P*w),et=u(K*w),X=u(V*w);if(W)return{x:fe,y:Qt};if(X!==Qt)throw new Error("invZ was invalid");return{x:Y,y:et}}clearCofactor(){let{h:w}=e;return w===Qt?this:this.multiplyUnsafe(w)}static fromHex(w,P=!1){let{d:K,a:V}=e,W=r.BYTES;w=yt("pointHex",w,W);let Y=w.slice(),et=w[W-1];Y[W-1]=et&-129;let X=ce(Y);X===fe||(P?x(X,f):x(X,r.ORDER));let J=u(X*X),dt=u(J-Qt),ut=u(K*J-V),{isValid:Ut,value:Kt}=h(dt,ut);if(!Ut)throw new Error("Point.fromHex: invalid y coordinate");let Ct=(Kt&Qt)===Qt,Vt=(et&128)!==0;if(!P&&Kt===fe&&Vt)throw new Error("Point.fromHex: x=0 and x_0=1");return Vt!==Ct&&(Kt=u(-Kt)),S.fromAffine({x:Kt,y:X})}static fromPrivateKey(w){return U(w).point}toRawBytes(){let{x:w,y:P}=this.toAffine(),K=Te(P,r.BYTES);return K[K.length-1]|=w&Qt?128:0,K}toHex(){return Ce(this.toRawBytes())}}S.BASE=new S(e.Gx,e.Gy,Qt,u(e.Gx*e.Gy)),S.ZERO=new S(fe,Qt,Qt,fe);let{BASE:B,ZERO:R}=S,_=fi(S,a*8);function O(L){return at(L,n)}function M(L){return O(ce(L))}function U(L){let w=a;L=yt("private key",L,w);let P=yt("hashed private key",s(L),2*w),K=l(P.slice(0,w)),V=P.slice(w,2*w),W=M(K),Y=B.multiply(W),et=Y.toRawBytes();return{head:K,prefix:V,scalar:W,point:Y,pointBytes:et}}function q(L){return U(L).pointBytes}function z(L=new Uint8Array,...w){let P=_e(...w);return M(s(g(P,yt("context",L),!!i)))}function Z(L,w,P={}){L=yt("message",L),i&&(L=i(L));let{prefix:K,scalar:V,pointBytes:W}=U(w),Y=z(P.context,K,L),et=B.multiply(Y).toRawBytes(),X=z(P.context,et,W,L),J=O(Y+X*V);v(J);let dt=_e(et,Te(J,r.BYTES));return yt("result",dt,a*2)}let C=$h;function N(L,w,P,K=C){let{context:V,zip215:W}=K,Y=r.BYTES;L=yt("signature",L,2*Y),w=yt("message",w),i&&(w=i(w));let et=ce(L.slice(Y,2*Y)),X,J,dt;try{X=S.fromHex(P,W),J=S.fromHex(L.slice(0,Y),W),dt=B.multiplyUnsafe(et)}catch{return!1}if(!W&&X.isSmallOrder())return!1;let ut=z(V,J.toRawBytes(),X.toRawBytes(),w);return J.add(X.multiplyUnsafe(ut)).subtract(dt).clearCofactor().equals(S.ZERO)}return B._setWindowSize(8),{CURVE:e,getPublicKey:q,sign:Z,verify:N,ExtendedPoint:S,utils:{getExtendedPublicKey:U,randomPrivateKey:()=>o(r.BYTES),precompute(L=8,w=S.BASE){return w._setWindowSize(L),w.multiply(BigInt(3)),w}}}}var fn=BigInt(0),_s=BigInt(1);function Yh(t){return ee(t,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...t})}function Qa(t){let e=Yh(t),{P:r}=e,n=m=>at(m,r),i=e.montgomeryBits,s=Math.ceil(i/8),o=e.nByteLength,a=e.adjustScalarBytes||(m=>m),c=e.powPminus2||(m=>Bs(m,r-BigInt(2),r));function f(m,A,S){let B=n(m*(A-S));return A=n(A-B),S=n(S+B),[A,S]}function u(m){if(typeof m=="bigint"&&fn<=m&&m=fn;C--){let N=B>>C&_s;q^=N,z=f(q,_,M),_=z[0],M=z[1],z=f(q,O,U),O=z[0],U=z[1],q=N;let T=_+O,L=n(T*T),w=_-O,P=n(w*w),K=L-P,V=M+U,W=M-U,Y=n(W*T),et=n(V*w),X=Y+et,J=Y-et;M=n(X*X),U=n(R*n(J*J)),_=n(L*P),O=n(K*(L+n(h*K)))}z=f(q,_,M),_=z[0],M=z[1],z=f(q,O,U),O=z[0],U=z[1];let Z=c(O);return n(_*Z)}function g(m){return Te(n(m),s)}function d(m){let A=yt("u coordinate",m,s);return o===s&&(A[o-1]&=127),ce(A)}function p(m){let A=yt("scalar",m);if(A.length!==s&&A.length!==o)throw new Error(`Expected ${s} or ${o} bytes, got ${A.length}`);return ce(a(A))}function y(m,A){let S=d(A),B=p(m),R=l(S,B);if(R===fn)throw new Error("Invalid private or public key received");return g(R)}let x=g(e.Gu);function v(m){return y(m,x)}return{scalarMult:y,scalarMultBase:v,getSharedSecret:(m,A)=>y(m,A),getPublicKey:m=>v(m),utils:{randomPrivateKey:()=>e.randomBytes(e.nByteLength)},GuBytes:x}}var un=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Ja=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),Cx=BigInt(0),Zh=BigInt(1),Ls=BigInt(2),Xh=BigInt(5),ja=BigInt(10),Qh=BigInt(20),Jh=BigInt(40),t0=BigInt(80);function e0(t){let e=un,n=t*t%e*t%e,i=gt(n,Ls,e)*n%e,s=gt(i,Zh,e)*t%e,o=gt(s,Xh,e)*s%e,a=gt(o,ja,e)*o%e,c=gt(a,Qh,e)*a%e,f=gt(c,Jh,e)*c%e,u=gt(f,t0,e)*f%e,h=gt(u,t0,e)*f%e,l=gt(h,ja,e)*o%e;return{pow_p_5_8:gt(l,Ls,e)*t%e,b2:n}}function r0(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function jh(t,e){let r=un,n=at(e*e*e,r),i=at(n*n*e,r),s=e0(t*i).pow_p_5_8,o=at(t*n*s,r),a=at(e*o*o,r),c=o,f=at(o*Ja,r),u=a===t,h=a===at(-t,r),l=a===at(-t*Ja,r);return u&&(o=c),(h||l)&&(o=f),Wa(o,r)&&(o=at(-o,r)),{isValid:u||h,value:o}}var Le=ci(un,void 0,!0),Rs={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Le,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:bs,randomBytes:nr,adjustScalarBytes:r0,uvRatio:jh},Lr=hi(Rs);function n0(t,e,r){if(e.length>255)throw new Error("Context is too big");return ei(gs("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,e.length]),e,t)}var Ix=hi({...Rs,domain:n0}),Tx=hi({...Rs,domain:n0,prehash:bs}),hn=Qa({P:un,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:t=>{let e=un,{pow_p_5_8:r,b2:n}=e0(t);return at(gt(r,BigInt(3),e)*n,e)},adjustScalarBytes:r0,randomBytes:nr});var tl=(Le.ORDER+BigInt(3))/BigInt(8),_x=Le.pow(Ls,tl),Lx=Le.sqrt(Le.neg(Le.ONE)),Rx=(Le.ORDER-BigInt(5))/BigInt(8),Nx=BigInt(486662);var Dx=Ya(Le,Le.neg(BigInt(486664)));var kx=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Px=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Ux=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Kx=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var Ox=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var li=class extends Tr{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,on(e);let n=Fe(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew li(t,e).update(r).digest();Rr.create=(t,e)=>new li(t,e);function s0(t,e,r){return on(t),r===void 0&&(r=new Uint8Array(t.outputLen)),Rr(t,Fe(r),Fe(e))}var Ns=new Uint8Array([0]),i0=new Uint8Array;function o0(t,e,r,n=32){if(on(t),Jn(n),n>255*t.outputLen)throw new Error("Length should be <= 255*HashLen");let i=Math.ceil(n/t.outputLen);r===void 0&&(r=i0);let s=new Uint8Array(i*t.outputLen),o=Rr.create(t,e),a=o._cloneInto(),c=new Uint8Array(o.outputLen);for(let f=0;ft&e^~t&r,rl=(t,e,r)=>t&e^t&r^e&r,nl=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ze=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ge=new Uint32Array(64),Ds=class extends _r{constructor(){super(64,32,8,!1),this.A=ze[0]|0,this.B=ze[1]|0,this.C=ze[2]|0,this.D=ze[3]|0,this.E=ze[4]|0,this.F=ze[5]|0,this.G=ze[6]|0,this.H=ze[7]|0}get(){let{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let h=0;h<16;h++,r+=4)Ge[h]=e.getUint32(r,!1);for(let h=16;h<64;h++){let l=Ge[h-15],g=Ge[h-2],d=ae(l,7)^ae(l,18)^l>>>3,p=ae(g,17)^ae(g,19)^g>>>10;Ge[h]=p+Ge[h-7]+d+Ge[h-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:f,H:u}=this;for(let h=0;h<64;h++){let l=ae(a,6)^ae(a,11)^ae(a,25),g=u+l+el(a,c,f)+nl[h]+Ge[h]|0,p=(ae(n,2)^ae(n,13)^ae(n,22))+rl(n,i,s)|0;u=f,f=c,c=a,a=o+g|0,o=s,s=i,i=n,n=g+p|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,f=f+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,f,u)}roundClean(){Ge.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Nr=ri(()=>new Ds);var di={hashSHA256(t){return Nr(t)},getHKDF(t,e){let r=s0(Nr,e,t),i=o0(Nr,r,void 0,96),s=i.subarray(0,32),o=i.subarray(32,64),a=i.subarray(64,96);return[s,o,a]},generateX25519KeyPair(){let t=hn.utils.randomPrivateKey();return{publicKey:hn.getPublicKey(t),privateKey:t}},generateX25519KeyPairFromSeed(t){return{publicKey:hn.getPublicKey(t),privateKey:t}},generateX25519SharedKey(t,e){return hn.getSharedSecret(t,e)},chaCha20Poly1305Encrypt(t,e,r,n){return ps(n,e,r).encrypt(t)},chaCha20Poly1305Decrypt(t,e,r,n,i){return ps(n,e,r).decrypt(t,i)}};var a0=di;var Dr=t=>{let e=It(2);return new DataView(e.buffer,e.byteOffset,e.byteLength).setUint16(0,t,!1),e};Dr.bytes=2;var ln=t=>{if(t.length<2)throw RangeError("Could not decode int16BE");return t instanceof Uint8Array?new DataView(t.buffer,t.byteOffset,t.byteLength).getUint16(0,!1):t.getUint16(0)};ln.bytes=2;function c0(t){return new Rt(t.ne,t.ciphertext)}function f0(t){return new Rt(t.ne,t.ns,t.ciphertext)}function u0(t){return new Rt(t.ns,t.ciphertext)}function h0(t){if(t.length<32)throw new Error("Cannot decode stage 0 MessageBuffer: length less than 32 bytes.");return{ne:t.subarray(0,32),ciphertext:t.subarray(32,t.length),ns:rt(0)}}function l0(t){if(t.length<80)throw new Error("Cannot decode stage 1 MessageBuffer: length less than 80 bytes.");return{ne:t.subarray(0,32),ns:t.subarray(32,80),ciphertext:t.subarray(80,t.length)}}function d0(t){if(t.length<48)throw new Error("Cannot decode stage 2 MessageBuffer: length less than 48 bytes.");return{ne:rt(0),ns:t.subarray(0,48),ciphertext:t.subarray(48,t.length)}}var y0=16;function g0(t,e){return async function*(r){for await(let n of r)for(let i=0;in.length&&(s=n.length);let o;i===0&&s===n.byteLength&&n instanceof Uint8Array?o=t.encrypt(n,t.session):o=t.encrypt(n.subarray(i,s),t.session),e?.encryptedPackets.increment(),yield new Rt(Dr(o.byteLength),o)}}}function x0(t,e){return async function*(r){for await(let n of r)for(let i=0;in.length&&(s=n.length),s-y0Dp});function Tp(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,A=new Uint8Array(m);x!==v;){for(var S=d[x],B=0,R=m-1;(S!==0||B>>0,A[R]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");y=B,x++}for(var _=m-y;_!==m&&A[_]===0;)_++;for(var O=c.repeat(p);_>>0,m=new Uint8Array(v);d[p];){var A=r[d.charCodeAt(p)];if(A===255)return;for(var S=0,B=v-1;(A!==0||S>>0,m[B]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");x=S,p++}if(d[p]!==" "){for(var R=v-x;R!==v&&m[R]===0;)R++;for(var _=new Uint8Array(y+(v-R)),O=y;R!==v;)_[O++]=m[R++];return _}}}function g(d){var p=l(d);if(p)return p;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:l,decode:g}}var _p=Tp,Lp=_p,kc=Lp;var K2=new Uint8Array(0);var Pc=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var Uc=t=>new TextEncoder().encode(t),Kc=t=>new TextDecoder().decode(t);var ro=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},no=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Mc(this,e)}},io=class{constructor(e){this.decoders=e}or(e){return Mc(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Mc=(t,e)=>new io({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),so=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ro(e,r,n),this.decoder=new no(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Or=({name:t,prefix:e,encode:r,decode:n})=>new so(t,e,r,n),Xe=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=kc(r,e);return Or({prefix:t,name:e,encode:n,decode:s=>ke(i(s))})},Rp=(t,e,r,n)=>{let i={};for(let u=0;u=8&&(a-=8,o[f++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},Np=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<Or({prefix:e,name:t,encode(i){return Np(i,n,r)},decode(i){return Rp(i,n,r,t)}});var Dp=Xe({prefix:"9",name:"base10",alphabet:"0123456789"});var ao={};_t(ao,{base16:()=>kp,base16upper:()=>Pp});var kp=St({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Pp=St({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var co={};_t(co,{base2:()=>Up});var Up=St({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var fo={};_t(fo,{base256emoji:()=>Vp});var Fc=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Kp=Fc.reduce((t,e,r)=>(t[r]=e,t),[]),Op=Fc.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Mp(t){return t.reduce((e,r)=>(e+=Kp[r],e),"")}function Fp(t){let e=[];for(let r of t){let n=Op[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var Vp=Or({prefix:"\u{1F680}",name:"base256emoji",encode:Mp,decode:Fp});var uo={};_t(uo,{base32:()=>Qe,base32hex:()=>Gp,base32hexpad:()=>Wp,base32hexpadupper:()=>Yp,base32hexupper:()=>$p,base32pad:()=>qp,base32padupper:()=>zp,base32upper:()=>Hp,base32z:()=>Zp});var Qe=St({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Hp=St({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),qp=St({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),zp=St({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Gp=St({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),$p=St({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Wp=St({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Yp=St({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Zp=St({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ho={};_t(ho,{base36:()=>Xp,base36upper:()=>Qp});var Xp=Xe({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Qp=Xe({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var lo={};_t(lo,{base58btc:()=>Mt,base58flickr:()=>Jp});var Mt=Xe({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Jp=Xe({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var po={};_t(po,{base64:()=>Mr,base64pad:()=>jp,base64url:()=>ty,base64urlpad:()=>ey});var Mr=St({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),jp=St({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ty=St({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ey=St({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var yo={};_t(yo,{base8:()=>ry});var ry=St({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var go={};_t(go,{identity:()=>ny});var ny=Or({prefix:"\0",name:"identity",encode:t=>Kc(t),decode:t=>Uc(t)});var J2=new TextEncoder,j2=new TextDecoder;var mo={};_t(mo,{identity:()=>Je});var oy=qc,Vc=128,ay=127,cy=~ay,fy=Math.pow(2,31);function qc(t,e,r){e=e||[],r=r||0;for(var n=r;t>=fy;)e[r++]=t&255|Vc,t/=128;for(;t&cy;)e[r++]=t&255|Vc,t>>>=7;return e[r]=t|0,qc.bytes=r-n+1,e}var uy=xo,hy=128,Hc=127;function xo(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw xo.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&Hc)<=hy);return xo.bytes=s-n,r}var ly=Math.pow(2,7),dy=Math.pow(2,14),py=Math.pow(2,21),yy=Math.pow(2,28),gy=Math.pow(2,35),xy=Math.pow(2,42),my=Math.pow(2,49),by=Math.pow(2,56),vy=Math.pow(2,63),wy=function(t){return t[wn.decode(t,e),wn.decode.bytes],Fr=(t,e,r=0)=>(wn.encode(t,e,r),e),Vr=t=>wn.encodingLength(t);var ve=(t,e)=>{let r=e.byteLength,n=Vr(t),i=n+Vr(r),s=new Uint8Array(i+r);return Fr(t,s,0),Fr(r,s,n),s.set(e,i),new Hr(t,r,e,s)},Sn=t=>{let e=ke(t),[r,n]=En(e),[i,s]=En(e.subarray(n)),o=e.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new Hr(r,i,o,e)},zc=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&Pc(t.bytes,r.bytes)}},Hr=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var Gc=0,By="identity",$c=ke,Ay=t=>ve(Gc,$c(t)),Je={code:Gc,name:By,encode:$c,digest:Ay};var wo={};_t(wo,{sha256:()=>Ft,sha512:()=>Cy});var vo=({name:t,code:e,encode:r})=>new bo(t,e,r),bo=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?ve(this.code,r):r.then(n=>ve(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Yc=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Ft=vo({name:"sha2-256",code:18,encode:Yc("SHA-256")}),Cy=vo({name:"sha2-512",code:19,encode:Yc("SHA-512")});var Zc=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return Ty(r,Eo(t),e||Mt.encoder);default:return _y(r,Eo(t),e||Qe.encoder)}};var Xc=new WeakMap,Eo=t=>{let e=Xc.get(t);if(e==null){let r=new Map;return Xc.set(t,r),r}return e},lr=class t{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==Bn)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Ly)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=ve(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&zc(e.multihash,n.multihash)}toString(e){return Zc(this,e)}toJSON(){return{"/":Zc(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new t(n,i,s,o||Qc(n,i,s.bytes))}else if(r[Ry]===!0){let{version:n,multihash:i,code:s}=r,o=Sn(i);return t.create(n,s,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==Bn)throw new Error(`Version 0 CID must use dag-pb (code: ${Bn}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=Qc(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,Bn,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=ke(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new Hr(r.multihashCode,r.digestSize,s,i);return[r.version===0?t.createV0(o):t.createV1(r.codec,o),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,l]=En(e.subarray(r));return r+=l,h},i=n(),s=Bn;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),c=n(),f=r+c,u=f-o;return{version:i,codec:s,multihashCode:a,digestSize:c,multihashSize:u,size:f}}static parse(e,r){let[n,i]=Iy(e,r),s=t.decode(i);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Eo(s).set(n,e),s}},Iy=(t,e)=>{switch(t[0]){case"Q":{let r=e||Mt;return[Mt.prefix,r.decode(`${Mt.prefix}${t}`)]}case Mt.prefix:{let r=e||Mt;return[Mt.prefix,r.decode(t)]}case Qe.prefix:{let r=e||Qe;return[Qe.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},Ty=(t,e,r)=>{let{prefix:n}=r;if(n!==Mt.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let s=r.encode(t).slice(1);return e.set(n,s),s}else return i},_y=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let s=r.encode(t);return e.set(n,s),s}else return i},Bn=112,Ly=18,Qc=(t,e,r)=>{let n=Vr(t),i=n+Vr(e),s=new Uint8Array(i+r.byteLength);return Fr(t,s,0),Fr(e,s,n),s.set(r,i),s},Ry=Symbol.for("@ipld/js-cid/CID");var zr={...go,...co,...yo,...oo,...ao,...uo,...ho,...lo,...po,...fo},ym={...wo,...mo};function jc(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var Jc=jc("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),So=jc("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);let e=It(t.length);for(let r=0;rmr,Ed25519PublicKey:()=>Tn,generateKeyPair:()=>zy,generateKeyPairFromSeed:()=>yf,unmarshalEd25519PrivateKey:()=>Hy,unmarshalEd25519PublicKey:()=>qy});var Gr=32,Pe=64,ki=32;async function tf(){let t=Lr.utils.randomPrivateKey(),e=Lr.getPublicKey(t);return{privateKey:sf(t,e),publicKey:e}}async function ef(t){if(t.length!==ki)throw new TypeError('"seed" must be 32 bytes in length.');if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');let e=t,r=Lr.getPublicKey(e);return{privateKey:sf(e,r),publicKey:r}}async function rf(t,e){let r=t.subarray(0,ki);return Lr.sign(e,r)}async function nf(t,e,r){return Lr.verify(e,r,t)}function sf(t,e){let r=new Uint8Array(Pe);for(let n=0;n>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return dr;if(ePy)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,i=e-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>hf&&(i=0n,++n>hf&&(n=0n))),new t(Number(i),Number(n))}static fromNumber(e){if(e===0)return dr;let r=e<0;r&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new t(n,i)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):dr}},dr=new Xt(0,0);dr.toBigInt=function(){return 0n};dr.zzEncode=dr.zzDecode=function(){return this};dr.length=function(){return 1};var hf=4294967296n;function lf(t){let e=0,r=0;for(let n=0;n191&&a<224?s[o++]=(a&31)<<6|t[e++]&63:a>239&&a<365?(a=((a&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,s[o++]=55296+(a>>10),s[o++]=56320+(a&1023)):s[o++]=(a&15)<<12|(t[e++]&63)<<6|t[e++]&63,o>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,s)),o=0);return i!=null?(o>0&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))}function To(t,e,r){let n=r,i,s;for(let o=0;o>6|192,e[r++]=i&63|128):(i&64512)===55296&&((s=t.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(s&1023),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128);return r-n}function le(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Pi(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var _o=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,le(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw le(this,4);return Pi(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw le(this,4);return Pi(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw le(this,4);let e=cf(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw le(this,4);let e=uf(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw le(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return df(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw le(this,e);this.pos+=e}else do if(this.pos>=this.len)throw le(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Xt(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw le(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw le(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw le(this,8);let e=Pi(this.buf,this.pos+=4),r=Pi(this.buf,this.pos+=4);return new Xt(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Lo(t){return new _o(t instanceof Uint8Array?t:t.subarray())}function pr(t,e){let r=Lo(t);return e.decode(r)}function Ro(t){let e=t??8192,r=e>>>1,n,i=e;return function(o){if(o<1||o>r)return It(o);i+o>e&&(n=It(e),i=0);let a=n.subarray(i,i+=o);return i&7&&(i=(i|7)+1),a}}var yr=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function No(){}var ko=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},Uy=Ro();function Ky(t){return globalThis.Buffer!=null?It(t):Uy(t)}var In=class{len;head;tail;states;constructor(){this.len=0,this.head=new yr(No,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new yr(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new Po((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(An,10,Xt.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=Xt.fromBigInt(e);return this._push(An,r.length(),r)}uint64Number(e){let r=Xt.fromNumber(e);return this._push(An,r.length(),r)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=Xt.fromBigInt(e).zzEncode();return this._push(An,r.length(),r)}sint64Number(e){let r=Xt.fromNumber(e).zzEncode();return this._push(An,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(Do,1,e?1:0)}fixed32(e){return this._push(Cn,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=Xt.fromBigInt(e);return this._push(Cn,4,r.lo)._push(Cn,4,r.hi)}fixed64Number(e){let r=Xt.fromNumber(e);return this._push(Cn,4,r.lo)._push(Cn,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(af,4,e)}double(e){return this._push(ff,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(Do,1,0):this.uint32(r)._push(My,r,e)}string(e){let r=lf(e);return r!==0?this.uint32(r)._push(To,r,e):this._push(Do,1,0)}fork(){return this.states=new ko(this),this.head=this.tail=new yr(No,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new yr(No,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=Ky(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function Do(t,e,r){e[r]=t&255}function Oy(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var Po=class extends yr{next;constructor(e,r){super(Oy,e,r),this.next=void 0}};function An(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function Cn(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function My(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(In.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(Fy,e,t),this},In.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(Vy,e,t),this});function Fy(t,e,r){e.set(t,r)}function Vy(t,e,r){t.length<40?To(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(At(t),r)}function Uo(){return new In}function gr(t,e){let r=Uo();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var Wr;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(Wr||(Wr={}));function Ui(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function Ko(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(s,o){let a=e(s);o.int32(a)},n=function(s){let o=s.int32();return e(o)};return Ui("enum",Wr.VARINT,r,n)}function xr(t,e){return Ui("message",Wr.LENGTH_DELIMITED,t,e)}var wt;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.Secp256k1="Secp256k1"})(wt||(wt={}));var Oo;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.Secp256k1=2]="Secp256k1"})(Oo||(Oo={}));(function(t){t.codec=()=>Ko(Oo)})(wt||(wt={}));var we;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),wt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=wt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(we||(we={}));var Ee;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),wt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=wt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Ee||(Ee={}));var Tn=class{_key;constructor(e){this._key=Yr(e,Gr)}async verify(e,r){return nf(this._key,r,e)}marshal(){return this._key}get bytes(){return we.encode({Type:wt.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},mr=class{_key;_publicKey;constructor(e,r){this._key=Yr(e,Pe),this._publicKey=Yr(r,Gr)}async sign(e){return rf(this._key,e)}get public(){return new Tn(this._publicKey)}marshal(){return this._key}get bytes(){return Ee.encode({Type:wt.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=Je.digest(this.public.bytes);return Mt.encode(e.bytes).substring(1)}async export(e,r="libp2p-key"){if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function Hy(t){if(t.length>Pe){t=Yr(t,Pe+Gr);let n=t.subarray(0,Pe),i=t.subarray(Pe,t.length);return new mr(n,i)}t=Yr(t,Pe);let e=t.subarray(0,Pe),r=t.subarray(Gr);return new mr(e,r)}function qy(t){return t=Yr(t,Gr),new Tn(t)}async function zy(){let{privateKey:t,publicKey:e}=await tf();return new mr(t,e)}async function yf(t){let{privateKey:e,publicKey:r}=await ef(t);return new mr(e,r)}function Yr(t,e){if(t=Uint8Array.from(t??[]),t.length!==e)throw new it(`Key must be a Uint8Array of length ${e}, got ${t.length}`,"ERR_INVALID_KEY_TYPE");return t}function Et(t,e="utf8"){let r=Di[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var pb=zt(Bt(),1),yb=zt(Ti(),1),gf=zt(lt(),1);function de(t,e){let r=Uint8Array.from(t.abs().toByteArray());if(r=r[0]===0?r.subarray(1):r,e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Gt([new Uint8Array(e-r.length),r])}return Et(r,"base64url")}function Jt(t){let e=xf(t);return new gf.default.jsbn.BigInteger(Et(e,"base16"),16)}function xf(t,e){let r=At(t,"base64urlpad");if(e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Gt([new Uint8Array(e-r.length),r])}return r}var Gy={"P-256":256,"P-384":384,"P-521":521},$y=Object.keys(Gy),Cb=$y.join(" / ");var zo={};_t(zo,{MAX_KEY_SIZE:()=>Nn,RsaPrivateKey:()=>Zr,RsaPublicKey:()=>Rn,fromJwk:()=>n1,generateKeyPair:()=>i1,unmarshalRsaPrivateKey:()=>e1,unmarshalRsaPublicKey:()=>r1});var Ln=zt(lt(),1);var uv=zt(Ef(),1);function Oi(t){if(isNaN(t)||t<=0)throw new it("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return nr(t)}var $b=zt(Ri(),1),Ho=zt(lt(),1);function Sf(t,e){return e.map(r=>Jt(t[r]))}function Bf(t){return Ho.default.pki.setRsaPrivateKey(...Sf(t,["n","e","d","p","q","dp","dq","qi"]))}function Af(t){return Ho.default.pki.setRsaPublicKey(...Sf(t,["n","e"]))}var vr={};_t(vr,{jwkToPkcs1:()=>Xy,jwkToPkix:()=>Jy,pkcs1ToJwk:()=>Zy,pkixToJwk:()=>Qy});var Zb=zt(mn(),1),Xb=zt(Ri(),1);var Ue=zt(lt(),1);function Zy(t){let e=Ue.default.asn1.fromDer(Et(t,"ascii")),r=Ue.default.pki.privateKeyFromAsn1(e);return{kty:"RSA",n:de(r.n),e:de(r.e),d:de(r.d),p:de(r.p),q:de(r.q),dp:de(r.dP),dq:de(r.dQ),qi:de(r.qInv),alg:"RS256"}}function Xy(t){if(t.n==null||t.e==null||t.d==null||t.p==null||t.q==null||t.dp==null||t.dq==null||t.qi==null)throw new it("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ue.default.pki.privateKeyToAsn1({n:Jt(t.n),e:Jt(t.e),d:Jt(t.d),p:Jt(t.p),q:Jt(t.q),dP:Jt(t.dp),dQ:Jt(t.dq),qInv:Jt(t.qi)});return At(Ue.default.asn1.toDer(e).getBytes(),"ascii")}function Qy(t){let e=Ue.default.asn1.fromDer(Et(t,"ascii")),r=Ue.default.pki.publicKeyFromAsn1(e);return{kty:"RSA",n:de(r.n),e:de(r.e)}}function Jy(t){if(t.n==null||t.e==null)throw new it("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ue.default.pki.publicKeyToAsn1({n:Jt(t.n),e:Jt(t.e)});return At(Ue.default.asn1.toDer(e).getBytes(),"ascii")}async function Cf(t){let e=await Zt.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await _f(e);return{privateKey:r[0],publicKey:r[1]}}async function qo(t){let r=[await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await jy(t)],n=await _f({privateKey:r[0],publicKey:r[1]});return{privateKey:n[0],publicKey:n[1]}}async function If(t,e){let r=await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),n=await Zt.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(e));return new Uint8Array(n,0,n.byteLength)}async function Tf(t,e,r){let n=await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return Zt.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},n,e,r)}async function _f(t){if(t.privateKey==null||t.publicKey==null)throw new it("Private and public key are required","ERR_INVALID_PARAMETERS");return Promise.all([Zt.get().subtle.exportKey("jwk",t.privateKey),Zt.get().subtle.exportKey("jwk",t.publicKey)])}async function jy(t){return Zt.get().subtle.importKey("jwk",{kty:t.kty,n:t.n,e:t.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}function Lf(t,e,r,n){let i=e?Af(t):Bf(t),s=Et(Uint8Array.from(r),"ascii"),o=n(s,i);return At(o,"ascii")}function Rf(t,e){return Lf(t,!0,e,(r,n)=>n.encrypt(r))}function Nf(t,e){return Lf(t,!1,e,(r,n)=>n.decrypt(r))}function Mi(t){if(t.kty!=="RSA")throw new it("invalid key type","ERR_INVALID_KEY_TYPE");if(t.n==null)throw new it("invalid key modulus","ERR_INVALID_KEY_MODULUS");return At(t.n,"base64url").length*8}var Nn=8192,Rn=class{_key;constructor(e){this._key=e}async verify(e,r){return Tf(this._key,r,e)}marshal(){return vr.jwkToPkix(this._key)}get bytes(){return we.encode({Type:wt.RSA,Data:this.marshal()}).subarray()}encrypt(e){return Rf(this._key,e)}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},Zr=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r}genSecret(){return Oi(16)}async sign(e){return If(this._key,e)}get public(){if(this._publicKey==null)throw new it("public key not provided","ERR_PUBKEY_NOT_PROVIDED");return new Rn(this._publicKey)}decrypt(e){return Nf(this._key,e)}marshal(){return vr.jwkToPkcs1(this._key)}get bytes(){return Ee.encode({Type:wt.RSA,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=await this.public.hash();return Et(e,"base58btc")}async export(e,r="pkcs-8"){if(r==="pkcs-8"){let n=new Ln.default.util.ByteBuffer(this.marshal()),i=Ln.default.asn1.fromDer(n),s=Ln.default.pki.privateKeyFromAsn1(i),o={algorithm:"aes256",count:1e4,saltSize:128/8,prfAlgorithm:"sha512"};return Ln.default.pki.encryptRsaPrivateKey(s,e,o)}else{if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}}};async function e1(t){let e=vr.pkcs1ToJwk(t);if(Mi(e)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let r=await qo(e);return new Zr(r.privateKey,r.publicKey)}function r1(t){let e=vr.pkixToJwk(t);if(Mi(e)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");return new Rn(e)}async function n1(t){if(Mi(t)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await qo(t);return new Zr(e.privateKey,e.publicKey)}async function i1(t){if(t>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await Cf(t);return new Zr(e.privateKey,e.publicKey)}var Yo={};_t(Yo,{Secp256k1PrivateKey:()=>kn,Secp256k1PublicKey:()=>Dn,generateKeyPair:()=>g1,unmarshalSecp256k1PrivateKey:()=>p1,unmarshalSecp256k1PublicKey:()=>y1});function s1(t){let e=cn(t);ee(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:o1,hexToBytes:a1}=oi,wr={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){let{Err:e}=wr;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:o1(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=wr,r=typeof t=="string"?a1(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:s}=wr._parseInt(r.subarray(2)),{d:o,l:a}=wr._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){let e=f=>Number.parseInt(f[0],16)&8?"00"+f:f,r=f=>{let u=f.toString(16);return u.length&1?`0${u}`:u},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},Ke=BigInt(0),ie=BigInt(1),gv=BigInt(2),Df=BigInt(3),xv=BigInt(4);function c1(t){let e=s1(t),{Fp:r}=e,n=e.toBytes||((d,p,y)=>{let x=p.toAffine();return _e(Uint8Array.from([4]),r.toBytes(x.x),r.toBytes(x.y))}),i=e.fromBytes||(d=>{let p=d.subarray(1),y=r.fromBytes(p.subarray(0,r.BYTES)),x=r.fromBytes(p.subarray(r.BYTES,2*r.BYTES));return{x:y,y:x}});function s(d){let{a:p,b:y}=e,x=r.sqr(d),v=r.mul(x,d);return r.add(r.add(v,r.mul(d,p)),y)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(d){return typeof d=="bigint"&&Ker.eql(m,r.ZERO);return v(y)&&v(x)?h.ZERO:new h(y,x,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){let y=r.invertBatch(p.map(x=>x.pz));return p.map((x,v)=>x.toAffine(y[v])).map(h.fromAffine)}static fromHex(p){let y=h.fromAffine(i(yt("pointHex",p)));return y.assertValidity(),y}static fromPrivateKey(p){return h.BASE.multiply(c(p))}_setWindowSize(p){this._WINDOW_SIZE=p,f.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:p,y}=this.toAffine();if(!r.isValid(p)||!r.isValid(y))throw new Error("bad point: x or y not FE");let x=r.sqr(y),v=s(p);if(!r.eql(x,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:p}=this.toAffine();if(r.isOdd)return!r.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){u(p);let{px:y,py:x,pz:v}=this,{px:m,py:A,pz:S}=p,B=r.eql(r.mul(y,S),r.mul(m,v)),R=r.eql(r.mul(x,S),r.mul(A,v));return B&&R}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){let{a:p,b:y}=e,x=r.mul(y,Df),{px:v,py:m,pz:A}=this,S=r.ZERO,B=r.ZERO,R=r.ZERO,_=r.mul(v,v),O=r.mul(m,m),M=r.mul(A,A),U=r.mul(v,m);return U=r.add(U,U),R=r.mul(v,A),R=r.add(R,R),S=r.mul(p,R),B=r.mul(x,M),B=r.add(S,B),S=r.sub(O,B),B=r.add(O,B),B=r.mul(S,B),S=r.mul(U,S),R=r.mul(x,R),M=r.mul(p,M),U=r.sub(_,M),U=r.mul(p,U),U=r.add(U,R),R=r.add(_,_),_=r.add(R,_),_=r.add(_,M),_=r.mul(_,U),B=r.add(B,_),M=r.mul(m,A),M=r.add(M,M),_=r.mul(M,U),S=r.sub(S,_),R=r.mul(M,O),R=r.add(R,R),R=r.add(R,R),new h(S,B,R)}add(p){u(p);let{px:y,py:x,pz:v}=this,{px:m,py:A,pz:S}=p,B=r.ZERO,R=r.ZERO,_=r.ZERO,O=e.a,M=r.mul(e.b,Df),U=r.mul(y,m),q=r.mul(x,A),z=r.mul(v,S),Z=r.add(y,x),C=r.add(m,A);Z=r.mul(Z,C),C=r.add(U,q),Z=r.sub(Z,C),C=r.add(y,v);let N=r.add(m,S);return C=r.mul(C,N),N=r.add(U,z),C=r.sub(C,N),N=r.add(x,v),B=r.add(A,S),N=r.mul(N,B),B=r.add(q,z),N=r.sub(N,B),_=r.mul(O,C),B=r.mul(M,z),_=r.add(B,_),B=r.sub(q,_),_=r.add(q,_),R=r.mul(B,_),q=r.add(U,U),q=r.add(q,U),z=r.mul(O,z),C=r.mul(M,C),q=r.add(q,z),z=r.sub(U,z),z=r.mul(O,z),C=r.add(C,z),U=r.mul(q,C),R=r.add(R,U),U=r.mul(N,C),B=r.mul(Z,B),B=r.sub(B,U),U=r.mul(Z,q),_=r.mul(N,_),_=r.add(_,U),new h(B,R,_)}subtract(p){return this.add(p.negate())}is0(){return this.equals(h.ZERO)}wNAF(p){return g.wNAFCached(this,f,p,y=>{let x=r.invertBatch(y.map(v=>v.pz));return y.map((v,m)=>v.toAffine(x[m])).map(h.fromAffine)})}multiplyUnsafe(p){let y=h.ZERO;if(p===Ke)return y;if(a(p),p===ie)return this;let{endo:x}=e;if(!x)return g.unsafeLadder(this,p);let{k1neg:v,k1:m,k2neg:A,k2:S}=x.splitScalar(p),B=y,R=y,_=this;for(;m>Ke||S>Ke;)m&ie&&(B=B.add(_)),S&ie&&(R=R.add(_)),_=_.double(),m>>=ie,S>>=ie;return v&&(B=B.negate()),A&&(R=R.negate()),R=new h(r.mul(R.px,x.beta),R.py,R.pz),B.add(R)}multiply(p){a(p);let y=p,x,v,{endo:m}=e;if(m){let{k1neg:A,k1:S,k2neg:B,k2:R}=m.splitScalar(y),{p:_,f:O}=this.wNAF(S),{p:M,f:U}=this.wNAF(R);_=g.constTimeNegate(A,_),M=g.constTimeNegate(B,M),M=new h(r.mul(M.px,m.beta),M.py,M.pz),x=_.add(M),v=O.add(U)}else{let{p:A,f:S}=this.wNAF(y);x=A,v=S}return h.normalizeZ([x,v])[0]}multiplyAndAddUnsafe(p,y,x){let v=h.BASE,m=(S,B)=>B===Ke||B===ie||!S.equals(v)?S.multiplyUnsafe(B):S.multiply(B),A=m(this,y).add(m(p,x));return A.is0()?void 0:A}toAffine(p){let{px:y,py:x,pz:v}=this,m=this.is0();p==null&&(p=m?r.ONE:r.inv(v));let A=r.mul(y,p),S=r.mul(x,p),B=r.mul(v,p);if(m)return{x:r.ZERO,y:r.ZERO};if(!r.eql(B,r.ONE))throw new Error("invZ was invalid");return{x:A,y:S}}isTorsionFree(){let{h:p,isTorsionFree:y}=e;if(p===ie)return!0;if(y)return y(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:p,clearCofactor:y}=e;return p===ie?this:y?y(h,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),n(h,this,p)}toHex(p=!0){return Ce(this.toRawBytes(p))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);let l=e.nBitLength,g=fi(h,e.endo?Math.ceil(l/2):l);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function f1(t){let e=cn(t);return ee(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function kf(t){let e=f1(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(C){return KeCe(qe(C,e.nByteLength));function d(C){let N=n>>ie;return C>N}function p(C){return d(C)?a(-C):C}let y=(C,N,T)=>Ie(C.slice(N,T));class x{constructor(N,T,L){this.r=N,this.s=T,this.recovery=L,this.assertValidity()}static fromCompact(N){let T=e.nByteLength;return N=yt("compactSignature",N,T*2),new x(y(N,0,T),y(N,T,2*T))}static fromDER(N){let{r:T,s:L}=wr.toSig(yt("DER",N));return new x(T,L)}assertValidity(){if(!l(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!l(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(N){return new x(this.r,this.s,N)}recoverPublicKey(N){let{r:T,s:L,recovery:w}=this,P=R(yt("msgHash",N));if(w==null||![0,1,2,3].includes(w))throw new Error("recovery id invalid");let K=w===2||w===3?T+e.n:T;if(K>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let V=w&1?"03":"02",W=f.fromHex(V+g(K)),Y=c(K),et=a(-P*Y),X=a(L*Y),J=f.BASE.multiplyAndAddUnsafe(W,et,X);if(!J)throw new Error("point at infinify");return J.assertValidity(),J}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return ir(this.toDERHex())}toDERHex(){return wr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ir(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}let v={isValidPrivateKey(C){try{return u(C),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let C=Is(e.n);return Xa(e.randomBytes(C),e.n)},precompute(C=8,N=f.BASE){return N._setWindowSize(C),N.multiply(BigInt(3)),N}};function m(C,N=!0){return f.fromPrivateKey(C).toRawBytes(N)}function A(C){let N=C instanceof Uint8Array,T=typeof C=="string",L=(N||T)&&C.length;return N?L===i||L===s:T?L===2*i||L===2*s:C instanceof f}function S(C,N,T=!0){if(A(C))throw new Error("first arg must be private key");if(!A(N))throw new Error("second arg must be public key");return f.fromHex(N).multiply(u(C)).toRawBytes(T)}let B=e.bits2int||function(C){let N=Ie(C),T=C.length*8-e.nBitLength;return T>0?N>>BigInt(T):N},R=e.bits2int_modN||function(C){return a(B(C))},_=an(e.nBitLength);function O(C){if(typeof C!="bigint")throw new Error("bigint expected");if(!(Ke<=C&&C<_))throw new Error(`bigint expected < 2^${e.nBitLength}`);return qe(C,e.nByteLength)}function M(C,N,T=U){if(["recovered","canonical"].some(ut=>ut in T))throw new Error("sign() legacy options not supported");let{hash:L,randomBytes:w}=e,{lowS:P,prehash:K,extraEntropy:V}=T;P==null&&(P=!0),C=yt("msgHash",C),K&&(C=yt("prehashed msgHash",L(C)));let W=R(C),Y=u(N),et=[O(Y),O(W)];if(V!=null){let ut=V===!0?w(r.BYTES):V;et.push(yt("extraEntropy",ut))}let X=_e(...et),J=W;function dt(ut){let Ut=B(ut);if(!l(Ut))return;let Kt=c(Ut),Ct=f.BASE.multiply(Ut).toAffine(),Vt=a(Ct.x);if(Vt===Ke)return;let Se=a(Kt*a(J+Vt*Y));if(Se===Ke)return;let tr=(Ct.x===Vt?0:2)|Number(Ct.y&ie),rn=Se;return P&&d(Se)&&(rn=p(Se),tr^=1),new x(Vt,rn,tr)}return{seed:X,k2sig:dt}}let U={lowS:e.lowS,prehash:!1},q={lowS:e.lowS,prehash:!1};function z(C,N,T=U){let{seed:L,k2sig:w}=M(C,N,T),P=e;return Es(P.hash.outputLen,P.nByteLength,P.hmac)(L,w)}f.BASE._setWindowSize(8);function Z(C,N,T,L=q){let w=C;if(N=yt("msgHash",N),T=yt("publicKey",T),"strict"in L)throw new Error("options.strict was renamed to lowS");let{lowS:P,prehash:K}=L,V,W;try{if(typeof w=="string"||w instanceof Uint8Array)try{V=x.fromDER(w)}catch(Ct){if(!(Ct instanceof wr.Err))throw Ct;V=x.fromCompact(w)}else if(typeof w=="object"&&typeof w.r=="bigint"&&typeof w.s=="bigint"){let{r:Ct,s:Vt}=w;V=new x(Ct,Vt)}else throw new Error("PARSE");W=f.fromHex(T)}catch(Ct){if(Ct.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(P&&V.hasHighS())return!1;K&&(N=e.hash(N));let{r:Y,s:et}=V,X=R(N),J=c(et),dt=a(X*J),ut=a(Y*J),Ut=f.BASE.multiplyAndAddUnsafe(W,dt,ut)?.toAffine();return Ut?a(Ut.x)===Y:!1}return{CURVE:e,getPublicKey:m,getSharedSecret:S,sign:z,verify:Z,ProjectivePoint:f,Signature:x,utils:v}}function u1(t){return{hash:t,hmac:(e,...r)=>Rr(t,e,ei(...r)),randomBytes:nr}}function Pf(t,e){let r=n=>kf({...t,...u1(n)});return Object.freeze({...r(e),create:r})}var Of=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Uf=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h1=BigInt(1),Go=BigInt(2),Kf=(t,e)=>(t+e/Go)/e;function l1(t){let e=Of,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),f=t*t*t%e,u=f*f*t%e,h=gt(u,r,e)*u%e,l=gt(h,r,e)*u%e,g=gt(l,Go,e)*f%e,d=gt(g,i,e)*g%e,p=gt(d,s,e)*d%e,y=gt(p,a,e)*p%e,x=gt(y,c,e)*y%e,v=gt(x,a,e)*p%e,m=gt(v,r,e)*u%e,A=gt(m,o,e)*d%e,S=gt(A,n,e)*f%e,B=gt(S,Go,e);if(!$o.eql($o.sqr(B),t))throw new Error("Cannot find square root");return B}var $o=ci(Of,void 0,void 0,{sqrt:l1}),Oe=Pf({a:BigInt(0),b:BigInt(7),Fp:$o,n:Uf,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=Uf,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-h1*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=Kf(s*t,e),c=Kf(-n*t,e),f=at(t-a*r-c*i,e),u=at(-a*n-c*s,e),h=f>o,l=u>o;if(h&&(f=e-f),l&&(u=e-u),f>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:f,k2neg:l,k2:u}}}},Nr),Cv=BigInt(0);var Iv=Oe.ProjectivePoint;function Mf(){return Oe.utils.randomPrivateKey()}async function Ff(t,e){let{digest:r}=await Ft.digest(e);try{return Oe.sign(r,t).toDERRawBytes()}catch(n){throw new it(String(n),"ERR_INVALID_INPUT")}}async function Vf(t,e,r){try{let{digest:n}=await Ft.digest(r);return Oe.verify(e,n,t)}catch(n){throw new it(String(n),"ERR_INVALID_INPUT")}}function Hf(t){return Oe.ProjectivePoint.fromHex(t).toRawBytes(!0)}function qf(t){try{Oe.getPublicKey(t,!0)}catch(e){throw new it(String(e),"ERR_INVALID_PRIVATE_KEY")}}function Wo(t){try{Oe.ProjectivePoint.fromHex(t)}catch(e){throw new it(String(e),"ERR_INVALID_PUBLIC_KEY")}}function zf(t){try{return Oe.getPublicKey(t,!0)}catch(e){throw new it(String(e),"ERR_INVALID_PRIVATE_KEY")}}var Dn=class{_key;constructor(e){Wo(e),this._key=e}async verify(e,r){return Vf(this._key,r,e)}marshal(){return Hf(this._key)}get bytes(){return we.encode({Type:wt.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},kn=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r??zf(e),qf(this._key),Wo(this._publicKey)}async sign(e){return Ff(this._key,e)}get public(){return new Dn(this._publicKey)}marshal(){return this._key}get bytes(){return Ee.encode({Type:wt.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=await this.public.hash();return Et(e,"base58btc")}async export(e,r="libp2p-key"){if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function p1(t){return new kn(t)}function y1(t){return new Dn(t)}async function g1(){let t=Mf();return new kn(t)}var Er={rsa:zo,ed25519:Mo,secp256k1:Yo};function Gf(t){let e=Object.keys(Er).join(" / ");return new it(`invalid or unsupported key type ${t}. Must be ${e}`,"ERR_UNSUPPORTED_KEY_TYPE")}function $f(t){let e=we.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case wt.RSA:return Er.rsa.unmarshalRsaPublicKey(r);case wt.Ed25519:return Er.ed25519.unmarshalEd25519PublicKey(r);case wt.Secp256k1:return Er.secp256k1.unmarshalSecp256k1PublicKey(r);default:throw Gf(e.Type??"unknown")}}async function Wf(t){let e=Ee.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case wt.RSA:return Er.rsa.unmarshalRsaPrivateKey(r);case wt.Ed25519:return Er.ed25519.unmarshalEd25519PrivateKey(r);case wt.Secp256k1:return Er.secp256k1.unmarshalSecp256k1PrivateKey(r);default:throw Gf(e.Type??"RSA")}}var Yf=Symbol.for("@libp2p/peer-id");var m1=Symbol.for("nodejs.util.inspect.custom"),Zf=Object.values(zr).map(t=>t.decoder).reduce((t,e)=>t.or(e),zr.identity.decoder),Xf=114,Zo=36,Xo=37,Pn=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[Yf]=!0;toString(){return this.string==null&&(this.string=Mt.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return lr.createV1(Xf,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return Lt(this.multihash.bytes,e);if(typeof e=="string")return b1(e).equals(this);if(e?.multihash?.bytes!=null)return Lt(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[m1](){return`PeerId(${this.toString()})`}},Xr=class extends Pn{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},Qr=class extends Pn{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},Jr=class extends Pn{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function b1(t,e){if(e=e??Zf,t.charAt(0)==="1"||t.charAt(0)==="Q"){let r=Sn(Mt.decode(`z${t}`));return t.startsWith("12D")?new Qr({multihash:r}):t.startsWith("16U")?new Jr({multihash:r}):new Xr({multihash:r})}return v1(Zf.decode(t))}function v1(t){try{let e=Sn(t);if(e.code===Je.code){if(e.digest.length===Zo)return new Qr({multihash:e});if(e.digest.length===Xo)return new Jr({multihash:e})}if(e.code===Ft.code)return new Xr({multihash:e})}catch{return w1(lr.decode(t))}throw new Error("Supplied PeerID CID is invalid")}function w1(t){if(t==null||t.multihash==null||t.version==null||t.version===1&&t.code!==Xf)throw new Error("Supplied PeerID CID is invalid");let e=t.multihash;if(e.code===Ft.code)return new Xr({multihash:t.multihash});if(e.code===Je.code){if(e.digest.length===Zo)return new Qr({multihash:t.multihash});if(e.digest.length===Xo)return new Jr({multihash:t.multihash})}throw new Error("Supplied PeerID CID is invalid")}async function Qo(t,e){return t.length===Zo?new Qr({multihash:ve(Je.code,t),privateKey:e}):t.length===Xo?new Jr({multihash:ve(Je.code,t),privateKey:e}):new Xr({multihash:await Ft.digest(t),publicKey:t,privateKey:e})}var Fi;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{if(i.lengthDelimited!==!1&&n.fork(),r.webtransportCerthashes!=null)for(let s of r.webtransportCerthashes)n.uint32(10),n.bytes(s);i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={webtransportCerthashes:[]},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:{i.webtransportCerthashes.push(r.bytes());break}default:{r.skipType(o&7);break}}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Fi||(Fi={}));var Un;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.identityKey!=null&&r.identityKey.byteLength>0&&(n.uint32(10),n.bytes(r.identityKey)),r.identitySig!=null&&r.identitySig.byteLength>0&&(n.uint32(18),n.bytes(r.identitySig)),r.extensions!=null&&(n.uint32(34),Fi.codec().encode(r.extensions,n)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={identityKey:rt(0),identitySig:rt(0)},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:{i.identityKey=r.bytes();break}case 2:{i.identitySig=r.bytes();break}case 4:{i.extensions=Fi.codec().decode(r,r.uint32());break}default:{r.skipType(o&7);break}}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Un||(Un={}));async function Qf(t,e,r){let n=await S1(t,Jf(e));if(t.publicKey==null)throw new Error("PublicKey was missing from local PeerId");return E1(t.publicKey,n,r)}function E1(t,e,r){return Un.encode({identityKey:t,identitySig:e,extensions:r??{webtransportCerthashes:[]}}).subarray()}async function S1(t,e){if(t.privateKey==null)throw new Error("PrivateKey was missing from PeerId");return(await Wf(t.privateKey)).sign(e)}async function Jo(t){return Qo(t.identityKey)}function jo(t){return Un.decode(t)}function Jf(t){let e=At("noise-libp2p-static-key:");return Gt([e,t],e.length+t.length)}async function ta(t,e,r){let n=await Qo(e.identityKey);if(!n.equals(r))throw new Error(`Payload identity key ${n.toString()} does not match expected remote peer ${r.toString()}`);let i=Jf(t);if(n.publicKey==null)throw new Error("PublicKey was missing from PeerId");if(e.identitySig==null)throw new Error("Signature was missing from message");if(!await $f(n.publicKey).verify(i,e.identitySig))throw new Error("Static key doesn't match to peer that signed payload!");return n}function Kn(t){return!(!(t instanceof Uint8Array)||t.length!==32)}var te=zt(nu(),1);te.default.formatters.b=t=>t==null?"undefined":Mt.baseEncode(t);te.default.formatters.t=t=>t==null?"undefined":Qe.baseEncode(t);te.default.formatters.m=t=>t==null?"undefined":Mr.baseEncode(t);te.default.formatters.p=t=>t==null?"undefined":t.toString();te.default.formatters.c=t=>t==null?"undefined":t.toString();te.default.formatters.k=t=>t==null?"undefined":t.toString();te.default.formatters.a=t=>t==null?"undefined":t.toString();function U1(t){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=t,e.destroy=()=>!0,e.extend=()=>e,e}function iu(t){let e=U1(`${t}:trace`);return te.default.enabled(`${t}:trace`)&&te.default.names.map(r=>r.toString()).find(r=>r.includes(":trace"))!=null&&(e=(0,te.default)(`${t}:trace`)),Object.assign((0,te.default)(t),{error:(0,te.default)(`${t}:error`),trace:e})}var Pt=iu("libp2p:noise");var se;Ia?se=Pt:se=Object.assign(()=>{},{enabled:!1,trace:()=>{},error:()=>{}});function su(t){se(`LOCAL_STATIC_PUBLIC_KEY ${Et(t.publicKey,"hex")}`),se(`LOCAL_STATIC_PRIVATE_KEY ${Et(t.privateKey,"hex")}`)}function ea(t){t?(se(`LOCAL_PUBLIC_EPHEMERAL_KEY ${Et(t.publicKey,"hex")}`),se(`LOCAL_PRIVATE_EPHEMERAL_KEY ${Et(t.privateKey,"hex")}`)):se("Missing local ephemeral keys.")}function ou(t){se(`REMOTE_STATIC_PUBLIC_KEY ${Et(t,"hex")}`)}function ra(t){se(`REMOTE_EPHEMERAL_PUBLIC_KEY ${Et(t,"hex")}`)}function au(t){t.cs1&&t.cs2?(se(`CIPHER_STATE_1 ${t.cs1.n.getUint64()} ${Et(t.cs1.k,"hex")}`),se(`CIPHER_STATE_2 ${t.cs2.n.getUint64()} ${Et(t.cs2.k,"hex")}`)):se("Missing cipher state.")}var K1=0,O1=4294967295,M1="Cipherstate has reached maximum n, a new handshake must be performed",qi=class{n;bytes;view;constructor(e=K1){this.n=e,this.bytes=rt(12),this.view=new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength),this.view.setUint32(4,e,!0)}increment(){this.n++,this.view.setUint32(4,this.n,!0)}getBytes(){return this.bytes}getUint64(){return this.n}assertValue(){if(this.n>O1)throw new Error(M1)}};var zi=class{crypto;constructor(e){this.crypto=e}encryptWithAd(e,r,n){let i=this.encrypt(e.k,e.n,r,n);return e.n.increment(),i}decryptWithAd(e,r,n,i){let{plaintext:s,valid:o}=this.decrypt(e.k,e.n,r,n,i);return o&&e.n.increment(),{plaintext:s,valid:o}}hasKey(e){return!this.isEmptyKey(e.k)}createEmptyKey(){return rt(32)}isEmptyKey(e){let r=this.createEmptyKey();return Lt(r,e)}encrypt(e,r,n,i){return r.assertValue(),this.crypto.chaCha20Poly1305Encrypt(i,r.getBytes(),n,e)}encryptAndHash(e,r){let n;return this.hasKey(e.cs)?n=this.encryptWithAd(e.cs,e.h,r):n=r,this.mixHash(e,n),n}decrypt(e,r,n,i,s){r.assertValue();let o=this.crypto.chaCha20Poly1305Decrypt(i,r.getBytes(),n,e,s);return o?{plaintext:o,valid:!0}:{plaintext:rt(0),valid:!1}}decryptAndHash(e,r){let n,i=!0;return this.hasKey(e.cs)?{plaintext:n,valid:i}=this.decryptWithAd(e.cs,e.h,r):n=r,this.mixHash(e,r),{plaintext:n,valid:i}}dh(e,r){try{let n=this.crypto.generateX25519SharedKey(e,r);return n.length===32?n:n.subarray(0,32)}catch(n){let i=n;return Pt.error(i),rt(32)}}mixHash(e,r){e.h=this.getHash(e.h,r)}getHash(e,r){return this.crypto.hashSHA256(Gt([e,r],e.length+r.length))}mixKey(e,r){let[n,i]=this.crypto.getHKDF(e.ck,r);e.cs=this.initializeKey(i),e.ck=n}initializeKey(e){return{k:e,n:new qi}}initializeSymmetric(e){let r=At(e,"utf-8"),n=this.hashProtocolName(r),i=n,s=this.createEmptyKey();return{cs:this.initializeKey(s),ck:i,h:n}}hashProtocolName(e){if(e.length<=32){let r=rt(32);return r.set(e),r}else return this.getHash(e,rt(0))}split(e){let[r,n]=this.crypto.getHKDF(e.ck,rt(0)),i=this.initializeKey(r),s=this.initializeKey(n);return{cs1:i,cs2:s}}writeMessageRegular(e,r){let n=this.encryptWithAd(e,rt(0),r),i=this.createEmptyKey(),s=rt(0);return{ne:i,ns:s,ciphertext:n}}readMessageRegular(e,r){return this.decryptWithAd(e,rt(0),r.ciphertext)}};var Gi=class extends zi{initializeInitiator(e,r,n,i){let s="Noise_XX_25519_ChaChaPoly_SHA256",o=this.initializeSymmetric(s);this.mixHash(o,e);let a=rt(32);return{ss:o,s:r,rs:n,psk:i,re:a}}initializeResponder(e,r,n,i){let s="Noise_XX_25519_ChaChaPoly_SHA256",o=this.initializeSymmetric(s);this.mixHash(o,e);let a=rt(32);return{ss:o,s:r,rs:n,psk:i,re:a}}writeMessageA(e,r,n){let i=rt(0);n!==void 0?e.e=n:e.e=this.crypto.generateX25519KeyPair();let s=e.e.publicKey;this.mixHash(e.ss,s);let o=this.encryptAndHash(e.ss,r);return{ne:s,ns:i,ciphertext:o}}writeMessageB(e,r){e.e=this.crypto.generateX25519KeyPair();let n=e.e.publicKey;this.mixHash(e.ss,n),this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));let i=e.s.publicKey,s=this.encryptAndHash(e.ss,i);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));let o=this.encryptAndHash(e.ss,r);return{ne:n,ns:s,ciphertext:o}}writeMessageC(e,r){let n=e.s.publicKey,i=this.encryptAndHash(e.ss,n);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));let s=this.encryptAndHash(e.ss,r),a={ne:this.createEmptyKey(),ns:i,ciphertext:s},{cs1:c,cs2:f}=this.split(e.ss);return{h:e.ss.h,messageBuffer:a,cs1:c,cs2:f}}readMessageA(e,r){return Kn(r.ne)&&(e.re=r.ne),this.mixHash(e.ss,e.re),this.decryptAndHash(e.ss,r.ciphertext)}readMessageB(e,r){if(Kn(r.ne)&&(e.re=r.ne),this.mixHash(e.ss,e.re),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));let{plaintext:n,valid:i}=this.decryptAndHash(e.ss,r.ns);i&&Kn(n)&&(e.rs=n),this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));let{plaintext:s,valid:o}=this.decryptAndHash(e.ss,r.ciphertext);return{plaintext:s,valid:i&&o}}readMessageC(e,r){let{plaintext:n,valid:i}=this.decryptAndHash(e.ss,r.ns);if(i&&Kn(n)&&(e.rs=n),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));let{plaintext:s,valid:o}=this.decryptAndHash(e.ss,r.ciphertext),{cs1:a,cs2:c}=this.split(e.ss);return{h:e.ss.h,plaintext:s,valid:i&&o,cs1:a,cs2:c}}initSession(e,r,n){let i=this.createEmptyKey(),s=rt(32),o;return e?o=this.initializeInitiator(r,n,s,i):o=this.initializeResponder(r,n,s,i),{hs:o,i:e,mc:0}}sendMessage(e,r,n){let i;if(e.mc===0)i=this.writeMessageA(e.hs,r,n);else if(e.mc===1)i=this.writeMessageB(e.hs,r);else if(e.mc===2){let{h:s,messageBuffer:o,cs1:a,cs2:c}=this.writeMessageC(e.hs,r);i=o,e.h=s,e.cs1=a,e.cs2=c}else if(e.mc>2)if(e.i){if(!e.cs1)throw new Error("CS1 (cipher state) is not defined");i=this.writeMessageRegular(e.cs1,r)}else{if(!e.cs2)throw new Error("CS2 (cipher state) is not defined");i=this.writeMessageRegular(e.cs2,r)}else throw new Error("Session invalid.");return e.mc++,i}recvMessage(e,r){let n=rt(0),i=!1;if(e.mc===0)({plaintext:n,valid:i}=this.readMessageA(e.hs,r));else if(e.mc===1)({plaintext:n,valid:i}=this.readMessageB(e.hs,r));else if(e.mc===2){let{h:s,plaintext:o,valid:a,cs1:c,cs2:f}=this.readMessageC(e.hs,r);n=o,i=a,e.h=s,e.cs1=c,e.cs2=f}return e.mc++,{plaintext:n,valid:i}}};var $i=class{isInitiator;session;remotePeer;remoteExtensions={webtransportCerthashes:[]};payload;connection;xx;staticKeypair;prologue;constructor(e,r,n,i,s,o,a,c){this.isInitiator=e,this.payload=r,this.prologue=n,this.staticKeypair=s,this.connection=o,a&&(this.remotePeer=a),this.xx=c??new Gi(i),this.session=this.xx.initSession(this.isInitiator,this.prologue,this.staticKeypair)}async propose(){if(su(this.session.hs.s),this.isInitiator){Pt.trace("Stage 0 - Initiator starting to send first message.");let e=this.xx.sendMessage(this.session,rt(0));await this.connection.write(c0(e)),Pt.trace("Stage 0 - Initiator finished sending first message."),ea(this.session.hs.e)}else{Pt.trace("Stage 0 - Responder waiting to receive first message...");let e=h0((await this.connection.read()).subarray()),{valid:r}=this.xx.recvMessage(this.session,e);if(!r)throw new or("xx handshake stage 0 validation fail");Pt.trace("Stage 0 - Responder received first message."),ra(this.session.hs.re)}}async exchange(){if(this.isInitiator){Pt.trace("Stage 1 - Initiator waiting to receive first message from responder...");let e=l0((await this.connection.read()).subarray()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new or("xx handshake stage 1 validation fail");Pt.trace("Stage 1 - Initiator received the message."),ra(this.session.hs.re),ou(this.session.hs.rs),Pt.trace("Initiator going to check remote's signature...");try{let i=jo(r);this.remotePeer=this.remotePeer||await Jo(i),await ta(this.session.hs.rs,i,this.remotePeer),this.setRemoteNoiseExtension(i.extensions)}catch(i){let s=i;throw new pn(`Error occurred while verifying signed payload: ${s.message}`)}Pt.trace("All good with the signature!")}else{Pt.trace("Stage 1 - Responder sending out first message with signed payload and static key.");let e=this.xx.sendMessage(this.session,this.payload);await this.connection.write(f0(e)),Pt.trace("Stage 1 - Responder sent the second handshake message with signed payload."),ea(this.session.hs.e)}}async finish(){if(this.isInitiator){Pt.trace("Stage 2 - Initiator sending third handshake message.");let e=this.xx.sendMessage(this.session,this.payload);await this.connection.write(u0(e)),Pt.trace("Stage 2 - Initiator sent message with signed payload.")}else{Pt.trace("Stage 2 - Responder waiting for third handshake message...");let e=d0((await this.connection.read()).subarray()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new or("xx handshake stage 2 validation fail");Pt.trace("Stage 2 - Responder received the message, finished handshake.");try{let i=jo(r);this.remotePeer=this.remotePeer||await Jo(i),await ta(this.session.hs.rs,i,this.remotePeer),this.setRemoteNoiseExtension(i.extensions)}catch(i){let s=i;throw new pn(`Error occurred while verifying signed payload: ${s.message}`)}}au(this.session)}encrypt(e,r){let n=this.getCS(r);return this.xx.encryptWithAd(n,rt(0),e)}decrypt(e,r,n){let i=this.getCS(r,!1);return this.xx.decryptWithAd(i,rt(0),e,n)}getRemoteStaticKey(){return this.session.hs.rs}getCS(e,r=!0){if(!e.cs1||!e.cs2)throw new or("Handshake not completed properly, cipher state does not exist.");return this.isInitiator?r?e.cs1:e.cs2:r?e.cs2:e.cs1}setRemoteNoiseExtension(e){e&&(this.remoteExtensions=e)}};function cu(t){return{xxHandshakeSuccesses:t.registerCounter("libp2p_noise_xxhandshake_successes_total",{help:"Total count of noise xxHandshakes successes_"}),xxHandshakeErrors:t.registerCounter("libp2p_noise_xxhandshake_error_total",{help:"Total count of noise xxHandshakes errors"}),encryptedPackets:t.registerCounter("libp2p_noise_encrypted_packets_total",{help:"Total count of noise encrypted packets successfully"}),decryptedPackets:t.registerCounter("libp2p_noise_decrypted_packets_total",{help:"Total count of noise decrypted packets"}),decryptErrors:t.registerCounter("libp2p_noise_decrypt_errors_total",{help:"Total count of noise decrypt errors"})}}var Wi=class{protocol="/noise";crypto;prologue;staticKeys;extensions;metrics;constructor(e={}){let{staticNoiseKey:r,extensions:n,crypto:i,prologueBytes:s,metrics:o}=e;this.crypto=i??a0,this.extensions=n,this.metrics=o?cu(o):void 0,r?this.staticKeys=this.crypto.generateX25519KeyPairFromSeed(r):this.staticKeys=this.crypto.generateX25519KeyPair(),this.prologue=s??rt(0)}async secureOutbound(e,r,n){let i=ns(r,{lengthEncoder:Dr,lengthDecoder:ln,maxDataLength:65535}),s=await this.performHandshake({connection:i,isInitiator:!0,localPeer:e,remotePeer:n}),o=await this.createSecureConnection(i,s);return r.source=o.source,r.sink=o.sink,{conn:r,remoteExtensions:s.remoteExtensions,remotePeer:s.remotePeer}}async secureInbound(e,r,n){let i=ns(r,{lengthEncoder:Dr,lengthDecoder:ln,maxDataLength:65535}),s=await this.performHandshake({connection:i,isInitiator:!1,localPeer:e,remotePeer:n}),o=await this.createSecureConnection(i,s);return r.source=o.source,r.sink=o.sink,{conn:r,remotePeer:s.remotePeer,remoteExtensions:s.remoteExtensions}}async performHandshake(e){let r=await Qf(e.localPeer,this.staticKeys.publicKey,this.extensions);return this.performXXHandshake(e,r)}async performXXHandshake(e,r){let{isInitiator:n,remotePeer:i,connection:s}=e,o=new $i(n,r,this.prologue,this.crypto,this.staticKeys,s,i);try{await o.propose(),await o.exchange(),await o.finish(),this.metrics?.xxHandshakeSuccesses.increment()}catch(a){if(this.metrics?.xxHandshakeErrors.increment(),a instanceof Error)throw a.message=`Error occurred during XX handshake: ${a.message}`,a}return o}async createSecureConnection(e,r){let[n,i]=Ea(),s=e.unwrap();return await Ba(n,g0(r,this.metrics),s,o=>sn(o,{lengthDecoder:ln}),x0(r,this.metrics),n),i}};function F1(t={}){return()=>new Wi(t)}return Eu(V1);})(); /*! Bundled license information: @noble/ciphers/esm/utils.js: diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.d.ts.map index 76ac88dcd..2796c50d5 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.d.ts.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../../src/crypto/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAG/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAKhD,wBAAgB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,CAgBvI;AAGD,wBAAgB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC,CA4BtJ"} \ No newline at end of file +{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../../src/crypto/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAG/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAKhD,wBAAgB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,CAuBvI;AAGD,wBAAgB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC,CA6BtJ"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.js index 5a6723913..d01611c66 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.js +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.js @@ -11,7 +11,13 @@ export function encryptStream(handshake, metrics) { if (end > chunk.length) { end = chunk.length; } - const data = handshake.encrypt(chunk.subarray(i, end), handshake.session); + let data; + if (i === 0 && end === chunk.byteLength && chunk instanceof Uint8Array) { + data = handshake.encrypt(chunk, handshake.session); + } + else { + data = handshake.encrypt(chunk.subarray(i, end), handshake.session); + } metrics?.encryptedPackets.increment(); yield new Uint8ArrayList(uint16BEEncode(data.byteLength), data); } diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.js.map index 302b7fff6..1bfa7aa17 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.js.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.js.map @@ -1 +1 @@ -{"version":3,"file":"streaming.js","sourceRoot":"","sources":["../../../src/crypto/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,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,KAAK,CAAC,MAAM,CAAA;iBACnB;gBAED,IAAI,GAAG,GAAG,iBAAiB,GAAG,CAAC,EAAE;oBAC/B,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;iBACjC;gBAED,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;gBACxC,mEAAmE;gBACnE,6EAA6E;gBAC7E,iFAAiF;gBACjF,6JAA6J;gBAC7J,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,iBAAiB,CAAC,CAAA;gBACtD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;gBAC5F,IAAI,CAAC,KAAK,EAAE;oBACV,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,CAAA;oBAClC,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;iBACtD;gBACD,OAAO,EAAE,gBAAgB,CAAC,SAAS,EAAE,CAAA;gBACrC,MAAM,SAAS,CAAA;aAChB;SACF;IACH,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/tsconfig.tsbuildinfo index def3f48e9..0fb65f133 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/tsconfig.tsbuildinfo +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/constants.ts","../src/@types/basic.ts","../node_modules/protons-runtime/dist/src/codec.d.ts","../node_modules/uint8arraylist/dist/src/index.d.ts","../node_modules/protons-runtime/dist/src/decode.d.ts","../node_modules/protons-runtime/dist/src/encode.d.ts","../node_modules/protons-runtime/dist/src/codecs/enum.d.ts","../node_modules/protons-runtime/dist/src/codecs/message.d.ts","../node_modules/protons-runtime/dist/src/utils/reader.d.ts","../node_modules/protons-runtime/dist/src/utils/writer.d.ts","../node_modules/protons-runtime/dist/src/index.d.ts","../node_modules/uint8arrays/dist/src/alloc.d.ts","../src/proto/payload.ts","../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface/dist/src/peer-id/index.d.ts","../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-info/index.d.ts","../node_modules/@libp2p/interface/dist/src/content-routing/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/buffer/index.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@libp2p/interface/dist/src/events.d.ts","../node_modules/@libp2p/interface/dist/src/metrics/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-routing/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-store/index.d.ts","../node_modules/@libp2p/interface/dist/src/startable.d.ts","../node_modules/@libp2p/interface/dist/src/stream-handler/index.d.ts","../node_modules/@libp2p/interface/dist/src/topology/index.d.ts","../node_modules/it-stream-types/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/index.d.ts","../node_modules/@libp2p/interface/dist/src/transport/index.d.ts","../node_modules/@libp2p/interface/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-encrypter/index.d.ts","../src/@types/libp2p.ts","../src/nonce.ts","../src/@types/handshake.ts","../src/crypto.ts","../node_modules/it-length-prefixed/dist/src/encode.d.ts","../node_modules/it-reader/dist/src/index.d.ts","../node_modules/it-length-prefixed/dist/src/decode.d.ts","../node_modules/it-length-prefixed/dist/src/index.d.ts","../src/encoder.ts","../node_modules/@libp2p/interface/dist/src/errors.d.ts","../node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../node_modules/multiformats/dist/types/src/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../node_modules/multiformats/dist/types/src/varint.d.ts","../node_modules/multiformats/dist/types/src/bytes.d.ts","../node_modules/multiformats/dist/types/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ed25519-class.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/interface.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ecdh.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ephemeral-keys.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/key-stretcher.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/keys.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/rsa-class.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/secp256k1-class.d.ts","../node_modules/@libp2p/interface/dist/src/keys/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/index.d.ts","../node_modules/@libp2p/peer-id/dist/src/index.d.ts","../node_modules/uint8arrays/dist/src/concat.d.ts","../node_modules/multiformats/dist/types/src/codecs/raw.d.ts","../node_modules/multiformats/dist/types/src/codecs/json.d.ts","../node_modules/multiformats/dist/types/src/bases/base.d.ts","../node_modules/multiformats/dist/types/src/basics.d.ts","../node_modules/uint8arrays/dist/src/util/bases.d.ts","../node_modules/uint8arrays/dist/src/from-string.d.ts","../src/utils.ts","../node_modules/uint8arrays/dist/src/compare.d.ts","../node_modules/uint8arrays/dist/src/equals.d.ts","../node_modules/uint8arrays/dist/src/to-string.d.ts","../node_modules/uint8arrays/dist/src/xor.d.ts","../node_modules/uint8arrays/dist/src/index.d.ts","../node_modules/@libp2p/logger/dist/src/index.d.ts","../src/logger.ts","../src/handshakes/abstract-handshake.ts","../src/handshakes/xx.ts","../src/@types/handshake-interface.ts","../node_modules/it-byte-stream/dist/src/index.d.ts","../node_modules/it-length-prefixed-stream/dist/src/index.d.ts","../src/handshake-xx.ts","../node_modules/it-pair/dist/src/duplex.d.ts","../node_modules/it-pipe/dist/src/index.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/types.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/wasm.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/chacha20poly1305.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/poly1305.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/chacha20.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/index.d.ts","../node_modules/@chainsafe/as-sha256/lib/hashobject.d.ts","../node_modules/@chainsafe/as-sha256/lib/wasm.d.ts","../node_modules/@chainsafe/as-sha256/lib/sha256.d.ts","../node_modules/@chainsafe/as-sha256/lib/index.d.ts","../node_modules/wherearewe/dist/src/index.d.ts","../node_modules/@noble/ciphers/utils.d.ts","../node_modules/@noble/ciphers/chacha.d.ts","../node_modules/@noble/curves/abstract/utils.d.ts","../node_modules/@noble/curves/abstract/modular.d.ts","../node_modules/@noble/curves/abstract/curve.d.ts","../node_modules/@noble/curves/abstract/edwards.d.ts","../node_modules/@noble/curves/abstract/hash-to-curve.d.ts","../node_modules/@noble/curves/abstract/montgomery.d.ts","../node_modules/@noble/curves/ed25519.d.ts","../node_modules/@noble/hashes/utils.d.ts","../node_modules/@noble/hashes/hkdf.d.ts","../node_modules/@noble/hashes/_sha2.d.ts","../node_modules/@noble/hashes/sha256.d.ts","../src/crypto/js.ts","../src/crypto/index.ts","../src/metrics.ts","../src/crypto/streaming.ts","../src/noise.ts","../src/index.ts","../src/crypto/index.browser.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/index.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/connection-encryption/index.d.ts","../test/compliance.spec.ts","../node_modules/@types/chai/index.d.ts","../node_modules/@types/chai-as-promised/index.d.ts","../node_modules/chai-parentheses/index.d.ts","../node_modules/@types/chai-subset/index.d.ts","../node_modules/chai-bites/index.d.ts","../node_modules/@types/chai-string/index.d.ts","../node_modules/aegir/dist/utils/chai.d.ts","../node_modules/@types/sinonjs__fake-timers/index.d.ts","../node_modules/@types/sinon/index.d.ts","../node_modules/@libp2p/peer-id-factory/dist/src/index.d.ts","../test/fixtures/peer.ts","../test/index.spec.ts","../node_modules/it-pushable/dist/src/index.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/config.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/frame.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/stream.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/muxer.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/index.d.ts","../node_modules/@libp2p/daemon-protocol/dist/src/index.d.ts","../node_modules/@libp2p/daemon-protocol/dist/src/stream-handler.d.ts","../node_modules/@libp2p/daemon-client/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/pubsub/index.d.ts","../node_modules/protobufjs/index.d.ts","../node_modules/protobufjs/minimal.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/decoderpc.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message-cache.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/metrics.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/set.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-stats.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/compute-score.d.ts","../node_modules/denque/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/message-deliveries.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/tracer.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/config.d.ts","../node_modules/@libp2p/peer-collections/dist/src/map.d.ts","../node_modules/@libp2p/peer-collections/dist/src/set.d.ts","../node_modules/@libp2p/peer-collections/dist/src/list.d.ts","../node_modules/@libp2p/peer-collections/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/connection-manager/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/registrar/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/key.d.ts","../node_modules/interface-store/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/providers.d.ts","../node_modules/@libp2p/interface-internal/dist/src/address-manager/index.d.ts","../node_modules/progress-events/dist/src/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/record/record.d.ts","../node_modules/@libp2p/kad-dht/dist/src/record/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/index.d.ts","../node_modules/@libp2p/daemon-server/dist/src/index.d.ts","../node_modules/@libp2p/interop/dist/src/connect.d.ts","../node_modules/@libp2p/interop/dist/src/dht/index.d.ts","../node_modules/@libp2p/interop/dist/src/pubsub/index.d.ts","../node_modules/@libp2p/interop/dist/src/relay/index.d.ts","../node_modules/@libp2p/interop/dist/src/streams/index.d.ts","../node_modules/@libp2p/interop/dist/src/index.d.ts","../node_modules/@libp2p/tcp/dist/src/listener.d.ts","../node_modules/@libp2p/tcp/dist/src/index.d.ts","../node_modules/execa/index.d.ts","../node_modules/go-libp2p/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/transport-manager/index.d.ts","../node_modules/libp2p/dist/src/address-manager/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-gater/index.d.ts","../node_modules/libp2p/dist/src/components.d.ts","../node_modules/libp2p/dist/src/connection-manager/auto-dial.d.ts","../node_modules/libp2p/dist/src/connection-manager/connection-pruner.d.ts","../node_modules/eventemitter3/index.d.ts","../node_modules/p-queue/dist/queue.d.ts","../node_modules/p-queue/dist/options.d.ts","../node_modules/p-queue/dist/priority-queue.d.ts","../node_modules/p-queue/dist/index.d.ts","../node_modules/libp2p/dist/src/connection-manager/dial-queue.d.ts","../node_modules/libp2p/dist/src/connection-manager/index.d.ts","../node_modules/libp2p/dist/src/transport-manager.d.ts","../node_modules/@libp2p/interface/dist/src/peer-discovery/index.d.ts","../node_modules/@libp2p/keychain/dist/src/index.d.ts","../node_modules/@libp2p/peer-store/dist/src/index.d.ts","../node_modules/libp2p/dist/src/index.d.ts","../node_modules/p-defer/index.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface-peer-id/dist/src/index.d.ts","../test/interop.ts","../node_modules/iso-random-stream/dist/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/aes/index.d.ts","../node_modules/@libp2p/crypto/dist/src/hmac/index.d.ts","../node_modules/@libp2p/crypto/dist/src/pbkdf2.d.ts","../node_modules/@libp2p/crypto/dist/src/random-bytes.d.ts","../node_modules/@libp2p/crypto/dist/src/index.d.ts","../test/utils.ts","../test/noise.spec.ts","../test/xx-handshake.spec.ts","../test/handshakes/xx.spec.ts","../node_modules/keyv/src/index.d.ts","../node_modules/@types/http-cache-semantics/index.d.ts","../node_modules/@types/responselike/index.d.ts","../node_modules/@types/cacheable-request/index.d.ts","../node_modules/@types/ms/index.d.ts","../node_modules/@types/debug/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/keyv/index.d.ts","../node_modules/@types/linkify-it/index.d.ts","../node_modules/@types/mdurl/encode.d.ts","../node_modules/@types/mdurl/decode.d.ts","../node_modules/@types/mdurl/parse.d.ts","../node_modules/@types/mdurl/format.d.ts","../node_modules/@types/mdurl/index.d.ts","../node_modules/@types/markdown-it/lib/common/utils.d.ts","../node_modules/@types/markdown-it/lib/token.d.ts","../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../node_modules/@types/markdown-it/lib/ruler.d.ts","../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../node_modules/@types/markdown-it/lib/parser_block.d.ts","../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../node_modules/@types/markdown-it/lib/parser_core.d.ts","../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../node_modules/@types/markdown-it/lib/renderer.d.ts","../node_modules/@types/markdown-it/lib/index.d.ts","../node_modules/@types/markdown-it/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/mdast/index.d.ts","../node_modules/@types/minimatch/index.d.ts","../node_modules/@types/minimist/index.d.ts","../node_modules/@types/mocha/index.d.ts","../node_modules/@types/normalize-package-data/index.d.ts","../node_modules/@types/parse-json/index.d.ts","../node_modules/@types/retry/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts","../node_modules/@types/strip-bom/index.d.ts","../node_modules/@types/strip-json-comments/index.d.ts","../node_modules/@types/ungap__structured-clone/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts","../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"1bc2fdadc59c4529e51cd693e1bb45c0f9d6c4cf079b008fa3a17da4cd08af44","signature":"a5b2968580425f209992ad1d8a62ab079d84643e00e0f0b11f65fe6423a643f5"},{"version":"a00b40912153391370bfc844161907779723e82cd2d671b3bebea763212f048e","signature":"35095a100857bdbca3c31ddd6e1eb18259140dee0092d97e631889daf084eaec"},"fd617cc8eec6f43227ab572160bac9d23c723073e83a9b100bd15c758eff34c2","176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d","ec3786b43d68955ecdb12ce679d3bc61b6b25c4d0ac5bcdaf50fa4a746189b98","3155e98b0df0c1523715e8a1c75c8a67c401aeb58d6eccf8bd89d5d775b8c1cf","fa82b7b22d9df87323e31e9e2ad75911028f3e544647fd212424b3c4452fee3f","90aa0b916eef195a17c3dbd621746f82ac7969ecc3dbf27c81ee4c68c5af7f25","9ceec2a882368c0160a8a3879aa0efce0fb985751fc23ff6191006030969cfa4","cad5d6451789234434c28dd2d6a8267b0d64c479b1ad267321faa31ba90d570b","e0e8254f7a1a21b5768beb4dbc9d4574ce67aefa59d88251d16b17c658f2a69e","c33b700f5d0797c331e08b29f8440204e19cf035555ea9111321f881f1b4702a",{"version":"b2d663f1f5da5b395c5dc6ba6dbc633d61580235f82faaca06bf420fcdae46cf","signature":"6744c64cda78d6af7280d69c20ead828fa4296efe0b582548cb10ab66914993d"},"f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","4369b27ca2716a04200930b5f24fa87a6ed62d8c70f80a83270956b6b23c32ae","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"8d6138a264ddc6f94f16e99d4e117a2d6eb31b217891cf091b6437a2f114d561","affectsGlobalScope":true},"a882b74c4ba115c6e86371f3592a3accb2c50874b6fcd92a4f83d17a4d6993af","4a8722c7d7a4dac1616db1f41ad0113998ccbbbcd37af43def3fbe6b41208c83","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"0b3868d3f87c95ea73bdfab380e536843ec3573aa76233b97aac40518494ea24","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","30c2ec6abf6aaa60eb4f32fb1235531506b7961c6d1bdc7430711aec8fd85295","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"d48009cbe8a30a504031cc82e1286f78fed33b7a42abf7602c23b5547b382563","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"24ba151e213906027e2b1f5223d33575a3612b0234a0e2b56119520bbe0e594b","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","28c1fc8505da2181ee74c9fe902fac964159cfae266c4413905d50eaecea8a19","84b8cc86ad19115f2637401cdd220460a25542df478c966a5ffc5eeaf3825299",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc","010d5afec4b47ea596f6c59a25ce628fa4e31ea15fd51e73d44ca2d72a780be8","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","f5337c3ea7b8702ffe2718f56a24325a67d517c0d552ef71b8d578d9f33a99d3",{"version":"1cd9488f96f8d5657d4109a6ae188f65846e905c5b236fdf379c16362e7a60a7","signature":"612bf9cb0b0a7ce6eab9fa9c09da1b1e4e5ec8f6b94f282035bfc89f68d4f3c6"},{"version":"2dec630463aaa98bfbc039a798f1757b9d53fd8ebd1722817b05b4534133d8cb","signature":"1cc2659564153cef042b6a377a36a04d861398d678e7032ec42698d8c80ec77f"},{"version":"ad1764b2c66d631e98be0b8255b410a319857ece25c6e8ae9627a535a0241c6b","signature":"1f66808998faa0d77e425d4c5ae8f481c3234d4b8c1deff001e1af71b4b041f3"},{"version":"c99a598040f64ddf29965a42c440a61492300923e58015c9dbad51a95f245b53","signature":"2f37bd92ed3c6cbac299dbfd79abe367c5e5d72e098abdb8d3e3900badd53e88"},"f30cfcfff28ee8f87563225b47239bb07b9b11edd09dda0ea6499b18cca1a30e","0edb8a97ead1fefd337458449050857e80740e31a3f76cffa656262f4e651a50","db8e4b47dd8c22634e3a326e5a5f60aa71a8ad4a0458fc0aadb6951f1c7cdc54","5b7a6d3f5c1b1d94d6cbc6c1e113588e20ae61d583d0d0cb5ec3fd92926d3749",{"version":"57b66a49fde8cfb80495147e1e115f4d09e7d089a97bca210d7b737a9a3dfd40","signature":"7c86832b33e8881089597745da92dc33a29681874849008a13069039bd613ea6"},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","b9998d79c6cb4e43e9d812fec5ccafbedee623c589904e3e3f0439ef861e25dd","7a6f74294b8fb90f5e3832be21e25898dd81b2a1adc36dda6929813ba4135311","d25e693302c8e284b417884b40dbadffe693b0daff8999a000995114dbf74c49","a1d4ac1b15cd62c7346d976e3a01e6cbcd4f166ea6b7866907d25c5acc832d77","5d40e6a7071d0d1e6e558e17214ff786ecb3ea73e31b25a88c2cbe2435fa1252","c45242078469b9680653d6a0667b23b1b767ec908825a14bfa8bb1dde2e30dae","5dcd218cfe8eb7fd6a1e5668c1a98734ddefe888d17129f8844552dddda2a74d","0564c90e8c2577950a446d6197a3ab7ec433ad5ac98435378e8855427f4cbf24","e1712267198fc3dd7903d0b945d5049fd56d68cadaf986c0adc40235fee43488","df21f5c49d638cbd6bd322eeb5b16d8352ba14ccb88cc9b23a7d8d5c2eaaf659","f6d13788d90394a540d136fb8ba9a0a647d8baa2e51d2ae155d039b031f4717f","6af9cf238459fe6d7e2d61cd50a157a6f540905c9793718e0e6e5993ab0cd650","88de5467cd5e4c2c1384629806d56ac1215657bddf39ef9f60a0e05beee2b131","ff5820394809bfc32a7e4586ff11b3c07327a0f4c756709aef92f1cd73d6da48","bfe2af20f3ff0579331661ef4c5d2597e0c31a7a0d760e41eaff0502bf064c4d","f52a0e53f79d7fd1c1c55a3cbda59499d4cce75f3188969024cdc286b29ad3ea","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f",{"version":"9b48eef82666050e509dece807d29b825fde4909ac48c7f1cab67390973a03ec","signature":"220216e61adba5829f622fe331a5a99d4aeedcda11c983149ceff8a063d2585f"},"0eff9792dd66a9aef708b34dd51d2e46158ae518db6ab14f54c5a99e8551abe7","66336b5a5d5e897e932cbf1e306ff8ac8a9929971409a8049c8c8a249cd8b57c","a878d4c7237a7af50e96534295fcf723134d70cbb1e9bfd8365266b912aee6ec","1185e162cb22a9bc3e94b2ae2ba35ed943ee69beae5364b38680f7d8587e7d35","23b0b3d88c166dad8d63750b716b921c51053ad54b14a4e7e32fd526033566db","fbacab2238e299ccf6596c3bd404c7dcad2c5a88ecd254a8a38cf2d184a67c75",{"version":"177dfa229223890f5e22db17d46280f2d4a16ca4c9ab73e4bbff4a1fd12300b4","signature":"e8f2522c8a4cf550c9fcc6154869253bd9ece549be7b5aeaaa7b20f73fb5cd83"},{"version":"e82bddfda890f3c83d1ece8c1df0ce57769a2a82b0ff81aff1409b329a460fc2","signature":"3f39c6ba0e49842fc434134519c30a89d3ec16da9701cf4d1113abf2f2ccfa17"},{"version":"a9ed6ff8aa6f2ea797e06d0f8bb03a4f43ab73a8adf133166140ca1ea208b520","signature":"b73dc3c92a3cdfe4144eafad3b73c13787c5cffe4ec5b35cd0467e9a3ede9ec1"},{"version":"b55e067a9546ac1c237571f938f04ae6593e138a2c1a645ed9171dbc36ee764e","signature":"f30884bec83e02740b8a410ecba62ba558f571a554e1b377ac4b83dff125b57e"},"4de66b5983d6286bfe3606cf155a5b21043111389d0b4c7b23d3f4282099f7d4","3968eed4d327e075c2386fad0b39b5ad2fe1892f6409a3bb46660c46f58300a6",{"version":"36be103794251feb6152dd2c8ec5d0e5f841a189c920881bccfe27f7459f54ed","signature":"0cae8a9a58a4d4836626ea63c8e3e699e7bcdab24c31ef39009abaf97c704b1c"},"b1129d7c114eba7c7b155dc809d6371ef86a0738f7ca93b3efef9b796d6168d9","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6","ffff3307a2c3797cdc04d7493e94245c13a646194c87f5bf5d2432995b834cc3","a87bc62d9a6be405f53f883a422efd557775224cd2b6688440cd333aaac27169","3d08777d7a3f5c1899a21dc2bd9f0ca80cfe0badba576cae22f5b47b7f81b3eb","bbbfe3163d9421b837e4e203c24243344be38e4359b6fc15426943454d8949b6","8cf4dc652e929c4de69ce5079b98a0683757b2dde66a7cee93edcb5aa08d5c48","f74d877f1fc949fb61197bf32a41829a83ee6aea528787dc2788378baaaa0ecf","a62a02c433e6fee26404825310ad462433320ef2e9f80fa7b9156135fd975f8f","22f15ae5c80b3e795da92636aa03d8f981811d067d82bff01ca54093c0535ec0","b56d4bc83ec01834829979ad57de59b4947cd62f71b102ab0040b6960d5bdc81","a10213415bf98670b026b77a90c7933594f0b5c34bde5b74e80134fdf0331bba","00cd454fa42dca69cdea08d4cb9698e679ba9a31762c23d905e45ba92269ac3a","58765e8e715155b2940e868ab1534b1bfac7087f6b42f7810ef94cc077d62981","f1c4e4db3e1dd83c3749f174e662de845e1217017ead0c15074e3ba00db67b6e","5aaea3d4b3af0c8339006c30af04eafdeb21b0a1bba2f1d32540ade412ee80a7","eb72bbe04857681ebd08a48d3b0869969c335445c31de53a85f76b4a42b97c92","c8cc38cbba80bfd5719c1b9d7efcd76fc90d4497e8a9aa715db426993274f0ae","49b6ff487f2d72569e361f077397214fea20839712527f5fb9ed8bb877dd7db8","d3043c37eeeb10d8a5c0c2a3b9d72e23a5fed2e9a367c5b4154bc8d9283601f3","58ff317d61b47e8fc6688bd50e6770311691202553f119d1e1d79b64d864e200","cde49e6e1ab8a2b4202958e3267e898489b737198a0599c7d251f94d9dea658b","3c3ca314a2b01902ef19b499be6e052925a849f14e2d9185afb323df3d3a72b6","b4b4af7820e7888cf67beeb95d0d6144b3d854370a7b78a598e80dc268e74249","1e7146a407bf85762b80681cd4aa3b544000e30c9b24d04685dfa69f82a48fd9","a3c42863fed9b49c35144d60aa0b2865b5fede65ea0050a28f45381af6dae035",{"version":"d898e165d52d3df19f98e46a53df138c8e28b1ec7224e75140d419f7bc60c7f0","signature":"8db42cde9161c917ae86f075cb21c16d1fab5965db0c4f4b372b4e7a0276f82e"},{"version":"f2f278cd3ffe7eb472b5daaec63622a32623cdf0d71395dfe60895363af42dc7","signature":"a03bc49af672574771ede656f9c35be60c2ba44f45655aed449e7f9e5efae6aa"},{"version":"19e0cd3c787b3570a7e8c20aa0718062bfb65e97391bd700bf37612569f3fc68","signature":"39c164f8cfdeb33577063044cf89c43c19bb4f79fae41960e0a17c6de26272c5"},{"version":"d416db55d180900dcf6c3eb98c776c85f3b4f9c4a0907cb8ffdb505500136f18","signature":"7115ea7b230353fe5e5d9436fe7f5b8863dea85c1b7c030c58a75bdb9e844b91"},{"version":"699246380aaa11f56f67ba8a5583f035e79f3de9d5837fe1979c579bafc32156","signature":"4110b29391d0835f9b88a4c69cb7e1cdddbac43ca9ee86393ebc15567c271b4d"},{"version":"aaa8702650fe4efdb8e82d41231add24a0b809b17f55d52009dc469c8ee0b011","signature":"f2dc190b33c1e842552ab4117c29cc960edd8ce2327a22254ec47cbcbdbb91f7"},{"version":"96db0fd5e766faa06d7b4f3ccc7e3b7df29a4c1aa4f116eaec55e5936e321325","signature":"0017550b13ae859f43d4b435fdab5e5035b0d6f7b7959458f30f67e859882d4d"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","e9fd0c57db08c441b0f044449b651e5d9910fa6c7871dbcb4d266b9cd357e2ed",{"version":"bf471b46fd0e07028f318e408bc578f4a3e125333bb545445175e6ba50791ffe","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2","81c6dd936bf342efbb1b1a5440a4300db5d39d70a6ad49ebc91ca7033ae9ce79",{"version":"13acb84a8fa8264d596433ae541c83b13d226a9592e6a26b165002c38132b97a","signature":"e307a4efa11c7f907b4e98ebb9496837e1901f13a19d8b0ed8c51205b09d528f"},{"version":"303ae53a3993e592fa9602ec5c83bac6d5c074f6e73fca8b2007f6db3ecf25f8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","c8031a5db82b240f801a5684ab693e95e1e06dc76958894fe42d35acbd446f28","1633b84fd3346ad6500a88e7a119ac778bb6f6b2746a3b7b8164c5ef2721822f","37fa00014a0f86b91526c4fde9b31af33d3e3bd5892c0519aa0d96d7935de484","5c9d5e0cd18c905ee6f6bc6f85b02c4d5b6f64ad08e1181f63785fae04823db3","5abd603c11eeb815a1746ff003233ae03c8f4f34fcf7835742c30fff038d4100","df54eaa5ea53c6bb3a9548bc5d2f6fb22583ea3e8b936a4e8ec5acfd90422ff3","be8d072f400254824429edab10acbe595299b702c97b99cc47f8e8018b7102ff","1a319786bea64c944ba8dd33331090034468efbab9c2fb96552850033d62d8d8","33174450482b921bbf093e3d52f501f7f93b5fd612311aa86e7339f2800162aa","03e385ae2125c9aa9dead008b42a0ab20d0812c26c19ee210d84c2666113f867","688c9dfd2b7114f5f01022abb5b179659f990d5af5924f185c2644ca99fe7b77","932cade1c5802123b5831f332ad8a6297f0f7d14d0ee04f5a774408f393e2200","925a8770415572378b7b62dcd714e744b7ffed86de59bdbe1d25c68d9d1f7f51","38fc2c990835686053591402bd73803ef28e117fa49427763e62636fd16c76ad","85489033e86eba49bfef2ad7330f8bb57cf7ef6aeb341c00ae1a3e5b19a02f4f","d4936633d5453e441ad5ab182efad46a0e1285fe5f9f5c2948cad3e71b7c2c23","a1b60bd2328318dcbec30bdf529dad31a13315ff2df60c8bd71630c58a575b06","e7ad5aa8eb177708949df3abbfe5ccbe7b75c920fb3bdd89426c38c61f239da6","8cc6a35806cd10d448b0f2ab01fe0b6194ca57fdaced2d71781b68e83c55bd88","8f364fec0ef20506aa9cf00b5cd8b620c1c0389687b11a3a32b0b5d4716ad894","5d11703e2c5d4dbe00bbe79f3bc864d178cf8d6ebccc2d1448ea29e93654f029","f4e82c91aac3b61f3ad04f11a44c5b79f724ff8a09281d0afa24a6624633ff25","ed849d616865076f44a41c87f27698f7cdf230290c44bafc71d7c2bc6919b202","7b8b9017156ef8bf3bbe42785fac8956e5c9869f4a494536d7f548a7c1c7d98a","eb2f08ae9c540a5fb60a5edddc0860ca3dad54ec842301ca73441d9e54534af0","763bb8df872cbb8783e29e19bd7a1dea0f88f7fd7398343af38be8509a65df82","687ce021a76c91c0e0b08fa5b828de2916e1b1aa9a23394e8ebc4dd96b8ee776","c286b410193495d067668bcdbd13ea3f3a39001edff02edee248babf2652e563","ba1405da509cc84896a588978efc45400d4f9844ee738d750b59868b1ad1618a","83a1426ac1a9cf144141dfe10d71a68629623a7c28245c9ca0e0352bead501fd","2726c0a6a4a87fad11e6846e6b0b40b8924fbe66340adc512093c4273bc53e4e","c888daaa99fdf6c5712d98605fdcf21cbbaab756a629661a44cac44ede464d37","e044f60686dc70015a3b7e7c64ad0ac5ec5ec101a0aede0782ec077e136b6a65","a232f867897bbecfebf68df575a417af1afd9b5dd3d83fb4d59e0a133a0de93d","228dbc8825b7a45af7d416dee95c0a2162d7cf73ffddfd52357b7e548882bdaa","602baeb62ccf84672ba7afacb5a21b675171282397513cac8f06d3a8634f840c","8970ab047d89c71edf9973609dd62f61bb366abeabbff36a1200103b6c1c605b","36d756189d9295e3a964e5cd45cb8ac965d5d2ada53ed848e08608426c146d69","8bdb5c16e8b9ba625ec08d8189879a6fb47b2c3c458a5d43ebd53a8763b5712e","93597e08900c3ac5ec730c16c4fbe425f7342e1f0420967b2afd90d67a2abee1","af89ab13b40dd28cd91818fc6329914d2b9663591831f032ff0f0cb4a028d4a5","6e6733927ade923e34b243d6fbec1465cfc8ed6edf62c6e09ed00c529f0d93de","83b3a9e85f7967509436fcdfa9be9bd543fb54003a9233c5c0af087e4a2c11c8","dc92d6eccf12395aa1d47afb765d5e4a1cd2639a385db0e3e88e9937ad2b63a3","ffb6e0556a4b5323c8bdf12727d000e8a3633f0552fffc4b779ae88546be2770","1242141c87ba3396bead6f379f6d6778bd38d02017f243aa448d1454a5fdc90e","17a4105ddae0308e19ee8532bdeb76278efa9dc644366060ca644541d3fd831c","913ffa031f7455c53e99c75ae130a046612d2ee0e716ed92707e996cbd3952ea","44e897d02326bf4d8169ea9638fe0a4c53b8f85cc48ae2fcbbb67b2f72c1d805","288fb1b9df77067c3c2675bde87d23d4a3f01bb6f929f854f11bdb68662968ff","b43b5156bc2831b46f6226777e292ff1646b3651ce190708b6228a078d42da4a","c3e77c4aa1097a38dcf4a20a093ce65033a16f3a48dab0ae3c5f6661bc39b11c","93acb99d30b8a22b443bfefb333d15d6310af7bd76a832f9559f7af9535ed2ae","3053e413471eef0274bc90318db14072e6164fbcc77765ab9557a769370382b2","32cbe201bfe8ed7f4c323fb8a3fcfdfb451f22e84d3c49da33ceda2fbf9230be","50d536e2e8bdbb4234b6ade05992aa4227fbf0401aba24922734c3ddb4a3ff11","4e152867a5b1bea2dc6a2921c0196f877630fc144369f8c7b9a69905caa62741","445c1751941d390dedf7667ab0fef01d468089576c07eba15810bf69485e4589","7f2cc72a16a663ab9f8d99bd5658e583251ce0c003bf80a948973e15a7ef9596","6af42c3c33c7123e7b056a6fd272d470914f382fad5e99689fa4991ff610e757","60f7cf25a65631bcfc27276a9b7b584ad13c2a37f871376d5d02e2133bc5fef9","e1c0439c8c796ddfdd08206dfd2cf7a7defec9d83f7b1e873d908489bda18af4","27679e96d1bd38c5938178aaf4abe8627493090b63d6bae2ce8436e6a87ebe4d","a77fbecee25688f568e18b43f8f54195d6c278a2a9a687ada5ab3d2f726524eb","e29f2b3a93ca3392fe29fa8e7b93985e854b44fe28e2b5c113f08296095bd6b7","d27956c8b392088a06d882e1edb58aab4d5cf5ab1229b73f99329ab21f352147","d643518d0b08b3d8d6e7f1fa884bca57ef95caaa1c312abbd9e1d4ed0d51c370","8c15566043b036c0720caf51ca343754e84e34fbaaf4a58d8080cf4ab2d93734","d8c8d41b25ef1827daaff9d84db43593995ce075551e7f4d8f10e316261e86f0","22fcf82dcbb4743dc846e838434ad1c2843cd18476e534dd3b37f85ece99ac73","40924f439552f559ffa4e41d300a411646ac9f3b53e578a012f7c439d36c6a30","7a34c06f5ed61c8108b2b82b7834655f1933d6ead3c9f6ff9d12efee4cb4bcaf","ee24d63f039e5745a279243916c7bb2c3d405bc0158912c0f37471381b467087","459c0ca522af7a412ef771447fe2c558c9a4640cffa4f53bacac05d0378a3ae7","acd5d501223e3a7cdd229b501fce5fb071937b72bd05fa33e543eb21c8ee0aba","f196d5ed4194259ffb797a34001a5edb7a165cd110dc3e4d8f03f11e3531fe9b","683889752b7c95fffd073b82ea76d36b3fe548ef3bb9887eb903676eabd676ff","a439ff9443c77478bb024ea2d96fbc088bccc915adf6bb8aeb9ab21fd737a071","b40afc6ff175241970202125bc1b5996cf5783b2f755977691f8c6522ace9f14","8bfc11f55ca063b10f0335922693ca70885d8f59b20607dd501250d1b1e960db","a884051a029dc34c400dc1dbad39a878935d37ebbea62d357d17b25f0076b578",{"version":"1b1ca1d97df4268847d5c387b1a89c01ec2fdc2062def1216442c8f040dcb660","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"6e0011406961ab3d469f2a7c3fddc41a5c9fb6d9452c47b5389124da846ab07a","df1bbd333631040027035b56cb31093015e59ce977a590500ed09feab109939b","a4f27ea63e3ff26a94b6681967a5276a2df9ddb80ae990df1ad03c0fffb34eca","18418f70457cee30da01c21bc26869ceb1ae65564784136f7fe2f7f2ff8f740f","3d2ec84143e6462a786b5d9ecf06f4f6f67a59a1f16c5a3a5e41721ba8478b7f","892f412f701d356f85cd3cb7d48b87ffecc0d4f85a2005c1d53e5e08414df8b1",{"version":"14261c0d2da587df791a696c8272003a3c5c1d7dd3a91f459092a8ab99759ca3","signature":"23d9dffba690dd7b1cc3986e0d592011a8660f0cb7632037b83b157b659c1510"},{"version":"1bcee41416ce15644b7e0eb66c2bb9df82007068fc83675d48927495cde7bd57","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"28ff2e0cd9350ef52ad5d6a77ddf2650d0505bd3d8cb1db66e1e5abf798d0c92","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"86b69f4f564965d8fd203354ebfcc235e37958a8195b600161deb5b9982a4dde","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a","4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","852bcf5d92d819abdf34ba0759c311b61d5dac7b9963a6c3cc4f23b025dee8f3","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[61,62,73,[185,188],193,220,[227,230],233,[260,266],269,280,281,364,[371,374]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[164,236],[164,236,237],[164,237,238,239,240],[164,237],[164],[164,242,244],[164,243],[79,164,172,175,226,292,295,296,297,298,300,308,309,310,311,316,317],[164,295,297],[164,294,295],[164,293],[164,292,295,297,299],[164,301,303],[164,299,301,307],[164,305],[164,297,300,301,302,303,304,306],[164,297],[64,164,183],[164,297,300],[79,82,164,210,292,295],[164,226],[164,180,284,287],[64,164,179,180,182,282,283,284,286],[64,164,182,283,284,285],[164,211,366,367,368,369],[164,203],[164,201],[164,204],[164,202,205,206,207,208,209,210],[64,71,164],[64,78,79,82,83,164,179,289,290],[64,164,179],[82,164,182,183,289,318,327],[164,184,267],[82,164],[79,82,164,182,183,315],[164,178,183],[82,164,181,183],[164,358,362],[164,361,362],[164,361],[164,358,359,360],[64,79,164,179,183],[79,82,164,183],[64,79,82,164,179,182],[78,83,164,182],[134,164,171],[79,82,83,84,164,172,173,174,175,176,177,178,181,183],[164,183],[83,164,172],[76,78,164],[79,82,164],[79,83,164,182],[64,79,164,172,183,282],[64,164,179,182,183],[79,164,183],[82,164,172,180,182,183],[164,334],[164,291,329,330,331,332,333],[78,79,83,164,172,173,175,182,316,317,321,322,323,324,326],[79,164,176,201,321],[64,164,325],[79,164,210,321],[79,164],[164,312,313,314],[79,164,210],[74,76,78,79,164],[79,82,164,172,175,182,321],[82,164,173,181,335],[82,164,172,173,181,183,336],[80,81,164],[164,247],[164,250],[164,249,250,251],[164,249,251,252,253,254],[164,256],[164,256,258],[134,137,163,164,171,375,376,377],[164,270],[164,379],[164,405],[164,390],[164,394,395,396],[164,393],[164,395],[164,385,391,392,397,400,402,403,404],[164,392,398,399,405],[164,398,401],[164,392,393,398,405],[164,392,405],[164,407],[164,386,387,388,389],[85,164],[121,164],[122,127,155,164],[123,134,135,142,152,163,164],[123,124,134,142,164],[125,164],[126,127,135,143,164],[127,152,160,164],[128,130,134,142,164],[129,164],[130,131,164],[134,164],[132,134,164],[121,134,164],[134,135,136,152,163,164],[134,135,136,149,152,155,164],[119,164,168],[130,134,137,142,152,163,164],[134,135,137,138,142,152,160,163,164],[137,139,152,160,163,164],[85,86,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170],[134,140,164],[141,163,164,168],[130,134,142,152,164],[143,164],[144,164],[121,145,164],[146,162,164,168],[147,164],[148,164],[134,149,150,164],[149,151,164,166],[122,134,152,153,154,155,164],[122,152,154,164],[152,153,164],[155,164],[156,164],[121,152,164],[134,158,159,164],[158,159,164],[127,142,152,160,164],[161,164],[142,162,164],[122,137,148,163,164],[127,164],[152,164,165],[141,164,166],[164,167],[122,127,134,136,145,152,163,164,166,168],[152,164,169],[137,152,164,171],[164,415,454],[164,415,439,454],[164,454],[164,415],[164,415,440,454],[164,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453],[164,440,454],[164,277],[164,458],[134,152,164,171],[164,270,271,272,273,274,275],[164,270,271],[122,123,152,164],[164,319,320],[164,223],[64,164,179,192,231],[64,164,179,190,192],[64,164,179,192],[64,164,189,191],[164,179],[79,82,164,172,175,182,339],[79,84,164,172,173,174,175,176,181,182,183,316,317,321,323,339,341],[164,172,175,176,182,316],[82,164,172,175,182,316],[79,82,164,173,175,182,183,315,339,341,349],[79,82,164,172,173,175,176,182,183,315,316,339,341,343,344,350],[79,84,164,173,174,180,181,182,183,184,321,340,341,342,351,352,353,354,355],[82,164,172,173,176,181,182,183,323,339],[74,164],[164,201,214,215,216],[77,78,164],[77,164],[75,164],[164,195],[76,164],[76,164,197],[78,164,196,197,198,199,200],[74,75,76,77,164,195],[74,75,76,164],[164,345,346,347,348],[164,346],[164,346,347],[71,164],[63,164],[63,71,164],[63,64,164],[63,65,66,67,68,69,70,164],[164,218],[164,213,218,219,221,222,223,224],[164,201,217],[96,100,163,164],[96,152,163,164],[91,164],[93,96,160,163,164],[142,160,164],[164,171],[91,164,171],[93,96,142,163,164],[88,89,92,95,122,134,152,163,164],[88,94,164],[92,96,122,155,163,164,171],[122,164,171],[112,122,164,171],[90,91,164,171],[96,164],[90,91,92,93,94,95,96,97,98,100,101,102,103,104,105,106,107,108,109,110,111,113,114,115,116,117,118,164],[96,103,104,164],[94,96,104,105,164],[95,164],[88,91,96,164],[96,100,104,105,164],[100,164],[94,96,99,163,164],[88,93,94,96,100,103,164],[122,152,164],[91,96,112,122,164,168,171],[62,73,79,164,187],[62,164,185,186],[62,73,164,184],[62,164,185,187],[164,260],[127,164,185,188,241,245,246,260],[62,164,185,187,188,248,255,257,259],[61,64,164,179,193,230,262],[62,64,72,164,187,192],[62,72,73,79,164,185,187,188,193,194,220,227,229,230,232],[62,72,164,186,187,188,213,222,225,227],[62,72,164,185,187,220,228],[73,164,184,188,260,264],[61,164,185,187,223,226],[164,173],[61,62,64,72,73,79,164,173,179,183,184,185,188,192,193,220,230,232,233,234,235,261,262,263],[62,72,164],[64,71,72,164],[62,73,79,164,211,212,213,219],[164,264,268],[79,164,279],[122,164,185,187,220,222,223,229,260,276,371],[64,164,173,219,232,234,264,265,276,278,280],[82,135,164,211,212,226,265,288,291,328,334,336,337,338,356,357,363],[61,64,79,122,164,193,219,220,222,223,229,231,232,233,234,260,264,276,278,280,365,371],[79,164,185,210,370],[79,122,164,220,222,232,233,234,261,276,280],[62,73,79,187],[62,185,186],[62,73,184],[62,185,187],[265],[188],[64,179,230,262],[62,64,187,192],[62,73,79,185,187,188,229,230,232],[62,186,187,188],[62,185,187,228],[73,184,188,260,264],[185,187,226],[173],[62,64,73,79,173,179,183,184,185,188],[62],[64,71],[62,73,79],[79],[79,185,210]],"referencedMap":[[240,1],[238,2],[241,3],[239,4],[236,5],[237,5],[242,5],[245,6],[244,7],[243,5],[311,5],[318,8],[298,9],[296,10],[295,11],[300,12],[304,13],[308,14],[306,15],[301,5],[299,5],[307,16],[303,17],[309,18],[310,19],[297,20],[302,5],[283,21],[284,5],[288,22],[287,23],[286,24],[366,5],[367,5],[370,25],[204,26],[202,27],[205,28],[211,29],[203,5],[206,26],[207,30],[208,27],[209,27],[368,5],[369,5],[291,31],[289,30],[290,32],[328,33],[268,34],[267,5],[323,35],[316,36],[317,37],[339,38],[363,39],[359,5],[360,40],[362,41],[358,5],[361,42],[184,43],[341,44],[183,45],[84,46],[194,5],[172,47],[182,48],[210,5],[173,49],[353,50],[79,51],[83,52],[174,53],[175,52],[292,54],[176,5],[177,49],[180,55],[285,5],[178,56],[181,57],[329,58],[330,58],[334,59],[331,58],[332,58],[333,58],[327,60],[322,61],[326,62],[325,30],[354,63],[226,64],[315,65],[314,64],[312,64],[313,64],[279,66],[212,67],[355,68],[336,69],[335,70],[81,35],[82,71],[80,35],[248,72],[247,5],[251,73],[252,74],[253,74],[250,5],[254,5],[249,5],[255,75],[258,76],[257,76],[259,77],[256,5],[378,78],[271,79],[275,79],[273,79],[270,5],[380,80],[376,5],[381,5],[382,5],[383,5],[384,47],[385,5],[406,81],[391,82],[397,83],[395,5],[394,84],[396,85],[405,86],[400,87],[402,88],[403,89],[404,90],[398,5],[399,90],[401,90],[393,90],[392,5],[408,91],[387,5],[386,5],[389,82],[390,92],[388,82],[409,5],[410,5],[411,5],[379,5],[85,93],[86,93],[121,94],[122,95],[123,96],[124,97],[125,98],[126,99],[127,100],[128,101],[129,102],[130,103],[131,103],[133,104],[132,105],[134,106],[135,107],[136,108],[120,109],[170,5],[137,110],[138,111],[139,112],[171,113],[140,114],[141,115],[142,116],[143,117],[144,118],[145,119],[146,120],[147,121],[148,122],[149,123],[150,123],[151,124],[152,125],[154,126],[153,127],[155,128],[156,129],[157,130],[158,131],[159,132],[160,133],[161,134],[162,135],[163,136],[164,137],[165,138],[166,139],[167,140],[168,141],[169,142],[412,5],[413,5],[377,143],[414,5],[439,144],[440,145],[415,146],[418,146],[437,144],[438,144],[428,144],[427,147],[425,144],[420,144],[433,144],[431,144],[435,144],[419,144],[432,144],[436,144],[421,144],[422,144],[434,144],[416,144],[423,144],[424,144],[426,144],[430,144],[441,148],[429,144],[417,144],[454,149],[453,5],[448,148],[450,150],[449,148],[442,148],[443,148],[445,148],[447,148],[451,150],[452,150],[444,150],[446,150],[278,151],[277,5],[455,5],[456,5],[457,5],[407,5],[458,5],[459,152],[460,153],[276,154],[87,5],[274,79],[272,155],[305,5],[345,5],[337,156],[338,5],[321,157],[319,158],[320,5],[365,5],[231,32],[232,159],[191,160],[189,161],[192,162],[234,163],[235,163],[282,5],[190,32],[179,5],[375,104],[340,164],[342,165],[343,166],[344,167],[350,168],[351,169],[356,170],[352,171],[216,172],[74,5],[217,173],[75,174],[200,5],[78,175],[195,176],[215,177],[214,177],[197,178],[198,179],[76,5],[201,180],[196,181],[77,182],[199,5],[357,5],[349,183],[347,184],[348,185],[346,5],[324,5],[293,5],[294,11],[63,186],[67,187],[68,188],[65,189],[66,187],[71,190],[69,30],[70,186],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[64,5],[72,5],[221,5],[213,5],[222,5],[219,191],[225,192],[223,191],[218,193],[224,5],[103,194],[110,195],[102,194],[117,196],[94,197],[93,198],[116,199],[111,200],[114,201],[96,202],[95,203],[91,204],[90,205],[113,206],[92,207],[97,208],[98,5],[101,208],[88,5],[119,209],[118,208],[105,210],[106,211],[108,212],[104,213],[107,214],[112,199],[99,215],[100,216],[109,217],[89,218],[115,219],[246,5],[62,5],[230,220],[187,221],[185,222],[61,5],[188,223],[266,224],[261,225],[260,226],[263,227],[193,228],[233,229],[228,230],[229,231],[265,232],[227,233],[262,234],[264,235],[186,236],[73,237],[220,238],[269,239],[280,240],[374,241],[281,242],[364,243],[372,244],[371,245],[373,246]],"exportedModulesMap":[[240,1],[238,2],[241,3],[239,4],[236,5],[237,5],[242,5],[245,6],[244,7],[243,5],[311,5],[318,8],[298,9],[296,10],[295,11],[300,12],[304,13],[308,14],[306,15],[301,5],[299,5],[307,16],[303,17],[309,18],[310,19],[297,20],[302,5],[283,21],[284,5],[288,22],[287,23],[286,24],[366,5],[367,5],[370,25],[204,26],[202,27],[205,28],[211,29],[203,5],[206,26],[207,30],[208,27],[209,27],[368,5],[369,5],[291,31],[289,30],[290,32],[328,33],[268,34],[267,5],[323,35],[316,36],[317,37],[339,38],[363,39],[359,5],[360,40],[362,41],[358,5],[361,42],[184,43],[341,44],[183,45],[84,46],[194,5],[172,47],[182,48],[210,5],[173,49],[353,50],[79,51],[83,52],[174,53],[175,52],[292,54],[176,5],[177,49],[180,55],[285,5],[178,56],[181,57],[329,58],[330,58],[334,59],[331,58],[332,58],[333,58],[327,60],[322,61],[326,62],[325,30],[354,63],[226,64],[315,65],[314,64],[312,64],[313,64],[279,66],[212,67],[355,68],[336,69],[335,70],[81,35],[82,71],[80,35],[248,72],[247,5],[251,73],[252,74],[253,74],[250,5],[254,5],[249,5],[255,75],[258,76],[257,76],[259,77],[256,5],[378,78],[271,79],[275,79],[273,79],[270,5],[380,80],[376,5],[381,5],[382,5],[383,5],[384,47],[385,5],[406,81],[391,82],[397,83],[395,5],[394,84],[396,85],[405,86],[400,87],[402,88],[403,89],[404,90],[398,5],[399,90],[401,90],[393,90],[392,5],[408,91],[387,5],[386,5],[389,82],[390,92],[388,82],[409,5],[410,5],[411,5],[379,5],[85,93],[86,93],[121,94],[122,95],[123,96],[124,97],[125,98],[126,99],[127,100],[128,101],[129,102],[130,103],[131,103],[133,104],[132,105],[134,106],[135,107],[136,108],[120,109],[170,5],[137,110],[138,111],[139,112],[171,113],[140,114],[141,115],[142,116],[143,117],[144,118],[145,119],[146,120],[147,121],[148,122],[149,123],[150,123],[151,124],[152,125],[154,126],[153,127],[155,128],[156,129],[157,130],[158,131],[159,132],[160,133],[161,134],[162,135],[163,136],[164,137],[165,138],[166,139],[167,140],[168,141],[169,142],[412,5],[413,5],[377,143],[414,5],[439,144],[440,145],[415,146],[418,146],[437,144],[438,144],[428,144],[427,147],[425,144],[420,144],[433,144],[431,144],[435,144],[419,144],[432,144],[436,144],[421,144],[422,144],[434,144],[416,144],[423,144],[424,144],[426,144],[430,144],[441,148],[429,144],[417,144],[454,149],[453,5],[448,148],[450,150],[449,148],[442,148],[443,148],[445,148],[447,148],[451,150],[452,150],[444,150],[446,150],[278,151],[277,5],[455,5],[456,5],[457,5],[407,5],[458,5],[459,152],[460,153],[276,154],[87,5],[274,79],[272,155],[305,5],[345,5],[337,156],[338,5],[321,157],[319,158],[320,5],[365,5],[231,32],[232,159],[191,160],[189,161],[192,162],[234,163],[235,163],[282,5],[190,32],[179,5],[375,104],[340,164],[342,165],[343,166],[344,167],[350,168],[351,169],[356,170],[352,171],[216,172],[74,5],[217,173],[75,174],[200,5],[78,175],[195,176],[215,177],[214,177],[197,178],[198,179],[76,5],[201,180],[196,181],[77,182],[199,5],[357,5],[349,183],[347,184],[348,185],[346,5],[324,5],[293,5],[294,11],[63,186],[67,187],[68,188],[65,189],[66,187],[71,190],[69,30],[70,186],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[64,5],[72,5],[221,5],[213,5],[222,5],[219,191],[225,192],[223,191],[218,193],[224,5],[103,194],[110,195],[102,194],[117,196],[94,197],[93,198],[116,199],[111,200],[114,201],[96,202],[95,203],[91,204],[90,205],[113,206],[92,207],[97,208],[98,5],[101,208],[88,5],[119,209],[118,208],[105,210],[106,211],[108,212],[104,213],[107,214],[112,199],[99,215],[100,216],[109,217],[89,218],[115,219],[246,5],[230,247],[187,248],[185,249],[188,250],[266,251],[261,252],[260,252],[263,253],[193,254],[233,255],[228,256],[229,257],[265,258],[227,259],[262,260],[264,261],[186,262],[73,263],[220,264],[280,265],[371,266]],"semanticDiagnosticsPerFile":[240,238,241,239,236,237,242,245,244,243,311,318,298,296,295,300,304,308,306,301,299,307,303,309,310,297,302,283,284,288,287,286,366,367,370,204,202,205,211,203,206,207,208,209,368,369,291,289,290,328,268,267,323,316,317,339,363,359,360,362,358,361,184,341,183,84,194,172,182,210,173,353,79,83,174,175,292,176,177,180,285,178,181,329,330,334,331,332,333,327,322,326,325,354,226,315,314,312,313,279,212,355,336,335,81,82,80,248,247,251,252,253,250,254,249,255,258,257,259,256,378,271,275,273,270,380,376,381,382,383,384,385,406,391,397,395,394,396,405,400,402,403,404,398,399,401,393,392,408,387,386,389,390,388,409,410,411,379,85,86,121,122,123,124,125,126,127,128,129,130,131,133,132,134,135,136,120,170,137,138,139,171,140,141,142,143,144,145,146,147,148,149,150,151,152,154,153,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,412,413,377,414,439,440,415,418,437,438,428,427,425,420,433,431,435,419,432,436,421,422,434,416,423,424,426,430,441,429,417,454,453,448,450,449,442,443,445,447,451,452,444,446,278,277,455,456,457,407,458,459,460,276,87,274,272,305,345,337,338,321,319,320,365,231,232,191,189,192,234,235,282,190,179,375,340,342,343,344,350,351,356,352,216,74,217,75,200,78,195,215,214,197,198,76,201,196,77,199,357,349,347,348,346,324,293,294,63,67,68,65,66,71,69,70,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,64,72,221,213,222,219,225,223,218,224,103,110,102,117,94,93,116,111,114,96,95,91,90,113,92,97,98,101,88,119,118,105,106,108,104,107,112,99,100,109,89,115,246,62,230,187,185,61,188,266,261,260,263,193,233,228,229,265,227,262,264,186,73,220,269,280,374,281,364,372,371,373],"latestChangedDtsFile":"./test/handshakes/xx.spec.d.ts"},"version":"5.2.2"} \ No newline at end of file +{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/constants.ts","../src/@types/basic.ts","../node_modules/protons-runtime/dist/src/codec.d.ts","../node_modules/uint8arraylist/dist/src/index.d.ts","../node_modules/protons-runtime/dist/src/decode.d.ts","../node_modules/protons-runtime/dist/src/encode.d.ts","../node_modules/protons-runtime/dist/src/codecs/enum.d.ts","../node_modules/protons-runtime/dist/src/codecs/message.d.ts","../node_modules/protons-runtime/dist/src/utils/reader.d.ts","../node_modules/protons-runtime/dist/src/utils/writer.d.ts","../node_modules/protons-runtime/dist/src/index.d.ts","../node_modules/uint8arrays/dist/src/alloc.d.ts","../src/proto/payload.ts","../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface/dist/src/peer-id/index.d.ts","../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-info/index.d.ts","../node_modules/@libp2p/interface/dist/src/content-routing/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/buffer/index.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@libp2p/interface/dist/src/events.d.ts","../node_modules/@libp2p/interface/dist/src/metrics/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-routing/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-store/index.d.ts","../node_modules/@libp2p/interface/dist/src/startable.d.ts","../node_modules/@libp2p/interface/dist/src/stream-handler/index.d.ts","../node_modules/@libp2p/interface/dist/src/topology/index.d.ts","../node_modules/it-stream-types/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/index.d.ts","../node_modules/@libp2p/interface/dist/src/transport/index.d.ts","../node_modules/@libp2p/interface/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-encrypter/index.d.ts","../src/@types/libp2p.ts","../src/nonce.ts","../src/@types/handshake.ts","../src/crypto.ts","../node_modules/it-length-prefixed/dist/src/encode.d.ts","../node_modules/it-reader/dist/src/index.d.ts","../node_modules/it-length-prefixed/dist/src/decode.d.ts","../node_modules/it-length-prefixed/dist/src/index.d.ts","../src/encoder.ts","../node_modules/@libp2p/interface/dist/src/errors.d.ts","../node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../node_modules/multiformats/dist/types/src/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../node_modules/multiformats/dist/types/src/varint.d.ts","../node_modules/multiformats/dist/types/src/bytes.d.ts","../node_modules/multiformats/dist/types/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ed25519-class.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/interface.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ecdh.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ephemeral-keys.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/key-stretcher.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/keys.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/rsa-class.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/secp256k1-class.d.ts","../node_modules/@libp2p/interface/dist/src/keys/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/index.d.ts","../node_modules/@libp2p/peer-id/dist/src/index.d.ts","../node_modules/uint8arrays/dist/src/concat.d.ts","../node_modules/multiformats/dist/types/src/codecs/raw.d.ts","../node_modules/multiformats/dist/types/src/codecs/json.d.ts","../node_modules/multiformats/dist/types/src/bases/base.d.ts","../node_modules/multiformats/dist/types/src/basics.d.ts","../node_modules/uint8arrays/dist/src/util/bases.d.ts","../node_modules/uint8arrays/dist/src/from-string.d.ts","../src/utils.ts","../node_modules/uint8arrays/dist/src/compare.d.ts","../node_modules/uint8arrays/dist/src/equals.d.ts","../node_modules/uint8arrays/dist/src/to-string.d.ts","../node_modules/uint8arrays/dist/src/xor.d.ts","../node_modules/uint8arrays/dist/src/index.d.ts","../node_modules/@libp2p/logger/dist/src/index.d.ts","../src/logger.ts","../src/handshakes/abstract-handshake.ts","../src/handshakes/xx.ts","../src/@types/handshake-interface.ts","../node_modules/it-byte-stream/dist/src/index.d.ts","../node_modules/it-length-prefixed-stream/dist/src/index.d.ts","../src/handshake-xx.ts","../node_modules/it-pair/dist/src/duplex.d.ts","../node_modules/it-pipe/dist/src/index.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/types.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/wasm.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/chacha20poly1305.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/poly1305.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/chacha20.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/index.d.ts","../node_modules/@chainsafe/as-sha256/lib/hashobject.d.ts","../node_modules/@chainsafe/as-sha256/lib/wasm.d.ts","../node_modules/@chainsafe/as-sha256/lib/sha256.d.ts","../node_modules/@chainsafe/as-sha256/lib/index.d.ts","../node_modules/wherearewe/dist/src/index.d.ts","../node_modules/@noble/ciphers/utils.d.ts","../node_modules/@noble/ciphers/chacha.d.ts","../node_modules/@noble/curves/abstract/utils.d.ts","../node_modules/@noble/curves/abstract/modular.d.ts","../node_modules/@noble/curves/abstract/curve.d.ts","../node_modules/@noble/curves/abstract/edwards.d.ts","../node_modules/@noble/curves/abstract/hash-to-curve.d.ts","../node_modules/@noble/curves/abstract/montgomery.d.ts","../node_modules/@noble/curves/ed25519.d.ts","../node_modules/@noble/hashes/utils.d.ts","../node_modules/@noble/hashes/hkdf.d.ts","../node_modules/@noble/hashes/_sha2.d.ts","../node_modules/@noble/hashes/sha256.d.ts","../src/crypto/js.ts","../src/crypto/index.ts","../src/metrics.ts","../src/crypto/streaming.ts","../src/noise.ts","../src/index.ts","../src/crypto/index.browser.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/index.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/connection-encryption/index.d.ts","../test/compliance.spec.ts","../node_modules/@types/chai/index.d.ts","../node_modules/@types/chai-as-promised/index.d.ts","../node_modules/chai-parentheses/index.d.ts","../node_modules/@types/chai-subset/index.d.ts","../node_modules/chai-bites/index.d.ts","../node_modules/@types/chai-string/index.d.ts","../node_modules/aegir/dist/utils/chai.d.ts","../node_modules/@types/sinonjs__fake-timers/index.d.ts","../node_modules/@types/sinon/index.d.ts","../node_modules/@libp2p/peer-id-factory/dist/src/index.d.ts","../test/fixtures/peer.ts","../test/index.spec.ts","../node_modules/it-pushable/dist/src/index.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/config.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/frame.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/stream.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/muxer.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/index.d.ts","../node_modules/@libp2p/daemon-protocol/dist/src/index.d.ts","../node_modules/@libp2p/daemon-protocol/dist/src/stream-handler.d.ts","../node_modules/@libp2p/daemon-client/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/pubsub/index.d.ts","../node_modules/protobufjs/index.d.ts","../node_modules/protobufjs/minimal.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/decoderpc.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message-cache.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/metrics.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/set.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-stats.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/compute-score.d.ts","../node_modules/denque/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/message-deliveries.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/tracer.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/config.d.ts","../node_modules/@libp2p/peer-collections/dist/src/map.d.ts","../node_modules/@libp2p/peer-collections/dist/src/set.d.ts","../node_modules/@libp2p/peer-collections/dist/src/list.d.ts","../node_modules/@libp2p/peer-collections/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/connection-manager/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/registrar/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/key.d.ts","../node_modules/interface-store/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/providers.d.ts","../node_modules/@libp2p/interface-internal/dist/src/address-manager/index.d.ts","../node_modules/progress-events/dist/src/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/record/record.d.ts","../node_modules/@libp2p/kad-dht/dist/src/record/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/index.d.ts","../node_modules/@libp2p/daemon-server/dist/src/index.d.ts","../node_modules/@libp2p/interop/dist/src/connect.d.ts","../node_modules/@libp2p/interop/dist/src/dht/index.d.ts","../node_modules/@libp2p/interop/dist/src/pubsub/index.d.ts","../node_modules/@libp2p/interop/dist/src/relay/index.d.ts","../node_modules/@libp2p/interop/dist/src/streams/index.d.ts","../node_modules/@libp2p/interop/dist/src/index.d.ts","../node_modules/@libp2p/tcp/dist/src/listener.d.ts","../node_modules/@libp2p/tcp/dist/src/index.d.ts","../node_modules/execa/index.d.ts","../node_modules/go-libp2p/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/transport-manager/index.d.ts","../node_modules/libp2p/dist/src/address-manager/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-gater/index.d.ts","../node_modules/libp2p/dist/src/components.d.ts","../node_modules/libp2p/dist/src/connection-manager/auto-dial.d.ts","../node_modules/libp2p/dist/src/connection-manager/connection-pruner.d.ts","../node_modules/eventemitter3/index.d.ts","../node_modules/p-queue/dist/queue.d.ts","../node_modules/p-queue/dist/options.d.ts","../node_modules/p-queue/dist/priority-queue.d.ts","../node_modules/p-queue/dist/index.d.ts","../node_modules/libp2p/dist/src/connection-manager/dial-queue.d.ts","../node_modules/libp2p/dist/src/connection-manager/index.d.ts","../node_modules/libp2p/dist/src/transport-manager.d.ts","../node_modules/@libp2p/interface/dist/src/peer-discovery/index.d.ts","../node_modules/@libp2p/keychain/dist/src/index.d.ts","../node_modules/@libp2p/peer-store/dist/src/index.d.ts","../node_modules/libp2p/dist/src/index.d.ts","../node_modules/p-defer/index.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface-peer-id/dist/src/index.d.ts","../test/interop.ts","../node_modules/iso-random-stream/dist/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/aes/index.d.ts","../node_modules/@libp2p/crypto/dist/src/hmac/index.d.ts","../node_modules/@libp2p/crypto/dist/src/pbkdf2.d.ts","../node_modules/@libp2p/crypto/dist/src/random-bytes.d.ts","../node_modules/@libp2p/crypto/dist/src/index.d.ts","../test/utils.ts","../test/noise.spec.ts","../test/xx-handshake.spec.ts","../test/handshakes/xx.spec.ts","../node_modules/keyv/src/index.d.ts","../node_modules/@types/http-cache-semantics/index.d.ts","../node_modules/@types/responselike/index.d.ts","../node_modules/@types/cacheable-request/index.d.ts","../node_modules/@types/ms/index.d.ts","../node_modules/@types/debug/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/keyv/index.d.ts","../node_modules/@types/linkify-it/index.d.ts","../node_modules/@types/mdurl/encode.d.ts","../node_modules/@types/mdurl/decode.d.ts","../node_modules/@types/mdurl/parse.d.ts","../node_modules/@types/mdurl/format.d.ts","../node_modules/@types/mdurl/index.d.ts","../node_modules/@types/markdown-it/lib/common/utils.d.ts","../node_modules/@types/markdown-it/lib/token.d.ts","../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../node_modules/@types/markdown-it/lib/ruler.d.ts","../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../node_modules/@types/markdown-it/lib/parser_block.d.ts","../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../node_modules/@types/markdown-it/lib/parser_core.d.ts","../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../node_modules/@types/markdown-it/lib/renderer.d.ts","../node_modules/@types/markdown-it/lib/index.d.ts","../node_modules/@types/markdown-it/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/mdast/index.d.ts","../node_modules/@types/minimatch/index.d.ts","../node_modules/@types/minimist/index.d.ts","../node_modules/@types/mocha/index.d.ts","../node_modules/@types/normalize-package-data/index.d.ts","../node_modules/@types/parse-json/index.d.ts","../node_modules/@types/retry/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts","../node_modules/@types/strip-bom/index.d.ts","../node_modules/@types/strip-json-comments/index.d.ts","../node_modules/@types/ungap__structured-clone/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts","../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"1bc2fdadc59c4529e51cd693e1bb45c0f9d6c4cf079b008fa3a17da4cd08af44","signature":"a5b2968580425f209992ad1d8a62ab079d84643e00e0f0b11f65fe6423a643f5"},{"version":"a00b40912153391370bfc844161907779723e82cd2d671b3bebea763212f048e","signature":"35095a100857bdbca3c31ddd6e1eb18259140dee0092d97e631889daf084eaec"},"fd617cc8eec6f43227ab572160bac9d23c723073e83a9b100bd15c758eff34c2","176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d","ec3786b43d68955ecdb12ce679d3bc61b6b25c4d0ac5bcdaf50fa4a746189b98","3155e98b0df0c1523715e8a1c75c8a67c401aeb58d6eccf8bd89d5d775b8c1cf","fa82b7b22d9df87323e31e9e2ad75911028f3e544647fd212424b3c4452fee3f","90aa0b916eef195a17c3dbd621746f82ac7969ecc3dbf27c81ee4c68c5af7f25","9ceec2a882368c0160a8a3879aa0efce0fb985751fc23ff6191006030969cfa4","cad5d6451789234434c28dd2d6a8267b0d64c479b1ad267321faa31ba90d570b","e0e8254f7a1a21b5768beb4dbc9d4574ce67aefa59d88251d16b17c658f2a69e","c33b700f5d0797c331e08b29f8440204e19cf035555ea9111321f881f1b4702a",{"version":"b2d663f1f5da5b395c5dc6ba6dbc633d61580235f82faaca06bf420fcdae46cf","signature":"6744c64cda78d6af7280d69c20ead828fa4296efe0b582548cb10ab66914993d"},"f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","285e512c7a0db217a0599e18c462d565fa35be4a5153dd7b80bee88c83e83ddf","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"7ae9dc7dbb58cd843065639707815df85c044babaa0947116f97bdb824d07204","affectsGlobalScope":true},"7aae1df2053572c2cfc2089a77847aadbb38eedbaa837a846c6a49fb37c6e5bd","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"dea4c00820d4fac5e530d4842aed2fb20d6744d75a674b95502cbd433f88bcb0","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"b7eadc0b0cba14ab854122810f330314132c5cfdb7800fceb82d521997a1f5b0","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"2225100373ca3d63bcc7f206e1177152d2e2161285a0bd83c8374db1503a0d1f","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","4a34b074b11c3597fb2ff890bc8f1484375b3b80793ab01f974534808d5777c7",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc","1bf687d978bdd6d5aff10b9eb0ff0695179f8594d4446946fd0182d6d25fa433","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","f5337c3ea7b8702ffe2718f56a24325a67d517c0d552ef71b8d578d9f33a99d3",{"version":"1cd9488f96f8d5657d4109a6ae188f65846e905c5b236fdf379c16362e7a60a7","signature":"612bf9cb0b0a7ce6eab9fa9c09da1b1e4e5ec8f6b94f282035bfc89f68d4f3c6"},{"version":"2dec630463aaa98bfbc039a798f1757b9d53fd8ebd1722817b05b4534133d8cb","signature":"1cc2659564153cef042b6a377a36a04d861398d678e7032ec42698d8c80ec77f"},{"version":"ad1764b2c66d631e98be0b8255b410a319857ece25c6e8ae9627a535a0241c6b","signature":"1f66808998faa0d77e425d4c5ae8f481c3234d4b8c1deff001e1af71b4b041f3"},{"version":"c99a598040f64ddf29965a42c440a61492300923e58015c9dbad51a95f245b53","signature":"2f37bd92ed3c6cbac299dbfd79abe367c5e5d72e098abdb8d3e3900badd53e88"},"f30cfcfff28ee8f87563225b47239bb07b9b11edd09dda0ea6499b18cca1a30e","0edb8a97ead1fefd337458449050857e80740e31a3f76cffa656262f4e651a50","db8e4b47dd8c22634e3a326e5a5f60aa71a8ad4a0458fc0aadb6951f1c7cdc54","5b7a6d3f5c1b1d94d6cbc6c1e113588e20ae61d583d0d0cb5ec3fd92926d3749",{"version":"57b66a49fde8cfb80495147e1e115f4d09e7d089a97bca210d7b737a9a3dfd40","signature":"7c86832b33e8881089597745da92dc33a29681874849008a13069039bd613ea6"},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","b9998d79c6cb4e43e9d812fec5ccafbedee623c589904e3e3f0439ef861e25dd","7a6f74294b8fb90f5e3832be21e25898dd81b2a1adc36dda6929813ba4135311","d25e693302c8e284b417884b40dbadffe693b0daff8999a000995114dbf74c49","a1d4ac1b15cd62c7346d976e3a01e6cbcd4f166ea6b7866907d25c5acc832d77","5d40e6a7071d0d1e6e558e17214ff786ecb3ea73e31b25a88c2cbe2435fa1252","c45242078469b9680653d6a0667b23b1b767ec908825a14bfa8bb1dde2e30dae","5dcd218cfe8eb7fd6a1e5668c1a98734ddefe888d17129f8844552dddda2a74d","0564c90e8c2577950a446d6197a3ab7ec433ad5ac98435378e8855427f4cbf24","e1712267198fc3dd7903d0b945d5049fd56d68cadaf986c0adc40235fee43488","df21f5c49d638cbd6bd322eeb5b16d8352ba14ccb88cc9b23a7d8d5c2eaaf659","f6d13788d90394a540d136fb8ba9a0a647d8baa2e51d2ae155d039b031f4717f","6af9cf238459fe6d7e2d61cd50a157a6f540905c9793718e0e6e5993ab0cd650","88de5467cd5e4c2c1384629806d56ac1215657bddf39ef9f60a0e05beee2b131","ff5820394809bfc32a7e4586ff11b3c07327a0f4c756709aef92f1cd73d6da48","bfe2af20f3ff0579331661ef4c5d2597e0c31a7a0d760e41eaff0502bf064c4d","f52a0e53f79d7fd1c1c55a3cbda59499d4cce75f3188969024cdc286b29ad3ea","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f",{"version":"9b48eef82666050e509dece807d29b825fde4909ac48c7f1cab67390973a03ec","signature":"220216e61adba5829f622fe331a5a99d4aeedcda11c983149ceff8a063d2585f"},"0eff9792dd66a9aef708b34dd51d2e46158ae518db6ab14f54c5a99e8551abe7","66336b5a5d5e897e932cbf1e306ff8ac8a9929971409a8049c8c8a249cd8b57c","a878d4c7237a7af50e96534295fcf723134d70cbb1e9bfd8365266b912aee6ec","1185e162cb22a9bc3e94b2ae2ba35ed943ee69beae5364b38680f7d8587e7d35","23b0b3d88c166dad8d63750b716b921c51053ad54b14a4e7e32fd526033566db","fbacab2238e299ccf6596c3bd404c7dcad2c5a88ecd254a8a38cf2d184a67c75",{"version":"177dfa229223890f5e22db17d46280f2d4a16ca4c9ab73e4bbff4a1fd12300b4","signature":"e8f2522c8a4cf550c9fcc6154869253bd9ece549be7b5aeaaa7b20f73fb5cd83"},{"version":"e82bddfda890f3c83d1ece8c1df0ce57769a2a82b0ff81aff1409b329a460fc2","signature":"3f39c6ba0e49842fc434134519c30a89d3ec16da9701cf4d1113abf2f2ccfa17"},{"version":"a9ed6ff8aa6f2ea797e06d0f8bb03a4f43ab73a8adf133166140ca1ea208b520","signature":"b73dc3c92a3cdfe4144eafad3b73c13787c5cffe4ec5b35cd0467e9a3ede9ec1"},{"version":"b55e067a9546ac1c237571f938f04ae6593e138a2c1a645ed9171dbc36ee764e","signature":"f30884bec83e02740b8a410ecba62ba558f571a554e1b377ac4b83dff125b57e"},"4de66b5983d6286bfe3606cf155a5b21043111389d0b4c7b23d3f4282099f7d4","3968eed4d327e075c2386fad0b39b5ad2fe1892f6409a3bb46660c46f58300a6",{"version":"36be103794251feb6152dd2c8ec5d0e5f841a189c920881bccfe27f7459f54ed","signature":"0cae8a9a58a4d4836626ea63c8e3e699e7bcdab24c31ef39009abaf97c704b1c"},"b1129d7c114eba7c7b155dc809d6371ef86a0738f7ca93b3efef9b796d6168d9","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6","ffff3307a2c3797cdc04d7493e94245c13a646194c87f5bf5d2432995b834cc3","a87bc62d9a6be405f53f883a422efd557775224cd2b6688440cd333aaac27169","3d08777d7a3f5c1899a21dc2bd9f0ca80cfe0badba576cae22f5b47b7f81b3eb","bbbfe3163d9421b837e4e203c24243344be38e4359b6fc15426943454d8949b6","8cf4dc652e929c4de69ce5079b98a0683757b2dde66a7cee93edcb5aa08d5c48","f74d877f1fc949fb61197bf32a41829a83ee6aea528787dc2788378baaaa0ecf","a62a02c433e6fee26404825310ad462433320ef2e9f80fa7b9156135fd975f8f","22f15ae5c80b3e795da92636aa03d8f981811d067d82bff01ca54093c0535ec0","b56d4bc83ec01834829979ad57de59b4947cd62f71b102ab0040b6960d5bdc81","a10213415bf98670b026b77a90c7933594f0b5c34bde5b74e80134fdf0331bba","00cd454fa42dca69cdea08d4cb9698e679ba9a31762c23d905e45ba92269ac3a","58765e8e715155b2940e868ab1534b1bfac7087f6b42f7810ef94cc077d62981","f1c4e4db3e1dd83c3749f174e662de845e1217017ead0c15074e3ba00db67b6e","5aaea3d4b3af0c8339006c30af04eafdeb21b0a1bba2f1d32540ade412ee80a7","eb72bbe04857681ebd08a48d3b0869969c335445c31de53a85f76b4a42b97c92","c8cc38cbba80bfd5719c1b9d7efcd76fc90d4497e8a9aa715db426993274f0ae","49b6ff487f2d72569e361f077397214fea20839712527f5fb9ed8bb877dd7db8","d3043c37eeeb10d8a5c0c2a3b9d72e23a5fed2e9a367c5b4154bc8d9283601f3","58ff317d61b47e8fc6688bd50e6770311691202553f119d1e1d79b64d864e200","cde49e6e1ab8a2b4202958e3267e898489b737198a0599c7d251f94d9dea658b","3c3ca314a2b01902ef19b499be6e052925a849f14e2d9185afb323df3d3a72b6","b4b4af7820e7888cf67beeb95d0d6144b3d854370a7b78a598e80dc268e74249","1e7146a407bf85762b80681cd4aa3b544000e30c9b24d04685dfa69f82a48fd9","a3c42863fed9b49c35144d60aa0b2865b5fede65ea0050a28f45381af6dae035",{"version":"d898e165d52d3df19f98e46a53df138c8e28b1ec7224e75140d419f7bc60c7f0","signature":"8db42cde9161c917ae86f075cb21c16d1fab5965db0c4f4b372b4e7a0276f82e"},{"version":"f2f278cd3ffe7eb472b5daaec63622a32623cdf0d71395dfe60895363af42dc7","signature":"a03bc49af672574771ede656f9c35be60c2ba44f45655aed449e7f9e5efae6aa"},{"version":"19e0cd3c787b3570a7e8c20aa0718062bfb65e97391bd700bf37612569f3fc68","signature":"39c164f8cfdeb33577063044cf89c43c19bb4f79fae41960e0a17c6de26272c5"},{"version":"0708b60644e1bccec13c7ddbcceca6749b587ffea525ac42c9395af5c90146bd","signature":"7115ea7b230353fe5e5d9436fe7f5b8863dea85c1b7c030c58a75bdb9e844b91"},{"version":"699246380aaa11f56f67ba8a5583f035e79f3de9d5837fe1979c579bafc32156","signature":"4110b29391d0835f9b88a4c69cb7e1cdddbac43ca9ee86393ebc15567c271b4d"},{"version":"aaa8702650fe4efdb8e82d41231add24a0b809b17f55d52009dc469c8ee0b011","signature":"f2dc190b33c1e842552ab4117c29cc960edd8ce2327a22254ec47cbcbdbb91f7"},{"version":"96db0fd5e766faa06d7b4f3ccc7e3b7df29a4c1aa4f116eaec55e5936e321325","signature":"0017550b13ae859f43d4b435fdab5e5035b0d6f7b7959458f30f67e859882d4d"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","e9fd0c57db08c441b0f044449b651e5d9910fa6c7871dbcb4d266b9cd357e2ed",{"version":"bf471b46fd0e07028f318e408bc578f4a3e125333bb545445175e6ba50791ffe","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2","81c6dd936bf342efbb1b1a5440a4300db5d39d70a6ad49ebc91ca7033ae9ce79",{"version":"13acb84a8fa8264d596433ae541c83b13d226a9592e6a26b165002c38132b97a","signature":"e307a4efa11c7f907b4e98ebb9496837e1901f13a19d8b0ed8c51205b09d528f"},{"version":"303ae53a3993e592fa9602ec5c83bac6d5c074f6e73fca8b2007f6db3ecf25f8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","c8031a5db82b240f801a5684ab693e95e1e06dc76958894fe42d35acbd446f28","1633b84fd3346ad6500a88e7a119ac778bb6f6b2746a3b7b8164c5ef2721822f","37fa00014a0f86b91526c4fde9b31af33d3e3bd5892c0519aa0d96d7935de484","5c9d5e0cd18c905ee6f6bc6f85b02c4d5b6f64ad08e1181f63785fae04823db3","5abd603c11eeb815a1746ff003233ae03c8f4f34fcf7835742c30fff038d4100","df54eaa5ea53c6bb3a9548bc5d2f6fb22583ea3e8b936a4e8ec5acfd90422ff3","be8d072f400254824429edab10acbe595299b702c97b99cc47f8e8018b7102ff","1a319786bea64c944ba8dd33331090034468efbab9c2fb96552850033d62d8d8","33174450482b921bbf093e3d52f501f7f93b5fd612311aa86e7339f2800162aa","03e385ae2125c9aa9dead008b42a0ab20d0812c26c19ee210d84c2666113f867","688c9dfd2b7114f5f01022abb5b179659f990d5af5924f185c2644ca99fe7b77","932cade1c5802123b5831f332ad8a6297f0f7d14d0ee04f5a774408f393e2200","925a8770415572378b7b62dcd714e744b7ffed86de59bdbe1d25c68d9d1f7f51","38fc2c990835686053591402bd73803ef28e117fa49427763e62636fd16c76ad","85489033e86eba49bfef2ad7330f8bb57cf7ef6aeb341c00ae1a3e5b19a02f4f","d4936633d5453e441ad5ab182efad46a0e1285fe5f9f5c2948cad3e71b7c2c23","a1b60bd2328318dcbec30bdf529dad31a13315ff2df60c8bd71630c58a575b06","e7ad5aa8eb177708949df3abbfe5ccbe7b75c920fb3bdd89426c38c61f239da6","8cc6a35806cd10d448b0f2ab01fe0b6194ca57fdaced2d71781b68e83c55bd88","8f364fec0ef20506aa9cf00b5cd8b620c1c0389687b11a3a32b0b5d4716ad894","5d11703e2c5d4dbe00bbe79f3bc864d178cf8d6ebccc2d1448ea29e93654f029","f4e82c91aac3b61f3ad04f11a44c5b79f724ff8a09281d0afa24a6624633ff25","ed849d616865076f44a41c87f27698f7cdf230290c44bafc71d7c2bc6919b202","7b8b9017156ef8bf3bbe42785fac8956e5c9869f4a494536d7f548a7c1c7d98a","eb2f08ae9c540a5fb60a5edddc0860ca3dad54ec842301ca73441d9e54534af0","763bb8df872cbb8783e29e19bd7a1dea0f88f7fd7398343af38be8509a65df82","687ce021a76c91c0e0b08fa5b828de2916e1b1aa9a23394e8ebc4dd96b8ee776","c286b410193495d067668bcdbd13ea3f3a39001edff02edee248babf2652e563","ba1405da509cc84896a588978efc45400d4f9844ee738d750b59868b1ad1618a","83a1426ac1a9cf144141dfe10d71a68629623a7c28245c9ca0e0352bead501fd","2726c0a6a4a87fad11e6846e6b0b40b8924fbe66340adc512093c4273bc53e4e","c888daaa99fdf6c5712d98605fdcf21cbbaab756a629661a44cac44ede464d37","e044f60686dc70015a3b7e7c64ad0ac5ec5ec101a0aede0782ec077e136b6a65","a232f867897bbecfebf68df575a417af1afd9b5dd3d83fb4d59e0a133a0de93d","228dbc8825b7a45af7d416dee95c0a2162d7cf73ffddfd52357b7e548882bdaa","602baeb62ccf84672ba7afacb5a21b675171282397513cac8f06d3a8634f840c","8970ab047d89c71edf9973609dd62f61bb366abeabbff36a1200103b6c1c605b","36d756189d9295e3a964e5cd45cb8ac965d5d2ada53ed848e08608426c146d69","8bdb5c16e8b9ba625ec08d8189879a6fb47b2c3c458a5d43ebd53a8763b5712e","93597e08900c3ac5ec730c16c4fbe425f7342e1f0420967b2afd90d67a2abee1","af89ab13b40dd28cd91818fc6329914d2b9663591831f032ff0f0cb4a028d4a5","6e6733927ade923e34b243d6fbec1465cfc8ed6edf62c6e09ed00c529f0d93de","83b3a9e85f7967509436fcdfa9be9bd543fb54003a9233c5c0af087e4a2c11c8","dc92d6eccf12395aa1d47afb765d5e4a1cd2639a385db0e3e88e9937ad2b63a3","ffb6e0556a4b5323c8bdf12727d000e8a3633f0552fffc4b779ae88546be2770","1242141c87ba3396bead6f379f6d6778bd38d02017f243aa448d1454a5fdc90e","17a4105ddae0308e19ee8532bdeb76278efa9dc644366060ca644541d3fd831c","913ffa031f7455c53e99c75ae130a046612d2ee0e716ed92707e996cbd3952ea","44e897d02326bf4d8169ea9638fe0a4c53b8f85cc48ae2fcbbb67b2f72c1d805","288fb1b9df77067c3c2675bde87d23d4a3f01bb6f929f854f11bdb68662968ff","b43b5156bc2831b46f6226777e292ff1646b3651ce190708b6228a078d42da4a","c3e77c4aa1097a38dcf4a20a093ce65033a16f3a48dab0ae3c5f6661bc39b11c","93acb99d30b8a22b443bfefb333d15d6310af7bd76a832f9559f7af9535ed2ae","3053e413471eef0274bc90318db14072e6164fbcc77765ab9557a769370382b2","32cbe201bfe8ed7f4c323fb8a3fcfdfb451f22e84d3c49da33ceda2fbf9230be","50d536e2e8bdbb4234b6ade05992aa4227fbf0401aba24922734c3ddb4a3ff11","4e152867a5b1bea2dc6a2921c0196f877630fc144369f8c7b9a69905caa62741","445c1751941d390dedf7667ab0fef01d468089576c07eba15810bf69485e4589","7f2cc72a16a663ab9f8d99bd5658e583251ce0c003bf80a948973e15a7ef9596","6af42c3c33c7123e7b056a6fd272d470914f382fad5e99689fa4991ff610e757","60f7cf25a65631bcfc27276a9b7b584ad13c2a37f871376d5d02e2133bc5fef9","e1c0439c8c796ddfdd08206dfd2cf7a7defec9d83f7b1e873d908489bda18af4","27679e96d1bd38c5938178aaf4abe8627493090b63d6bae2ce8436e6a87ebe4d","a77fbecee25688f568e18b43f8f54195d6c278a2a9a687ada5ab3d2f726524eb","e29f2b3a93ca3392fe29fa8e7b93985e854b44fe28e2b5c113f08296095bd6b7","d27956c8b392088a06d882e1edb58aab4d5cf5ab1229b73f99329ab21f352147","d643518d0b08b3d8d6e7f1fa884bca57ef95caaa1c312abbd9e1d4ed0d51c370","8c15566043b036c0720caf51ca343754e84e34fbaaf4a58d8080cf4ab2d93734","d8c8d41b25ef1827daaff9d84db43593995ce075551e7f4d8f10e316261e86f0","22fcf82dcbb4743dc846e838434ad1c2843cd18476e534dd3b37f85ece99ac73","40924f439552f559ffa4e41d300a411646ac9f3b53e578a012f7c439d36c6a30","7a34c06f5ed61c8108b2b82b7834655f1933d6ead3c9f6ff9d12efee4cb4bcaf","ee24d63f039e5745a279243916c7bb2c3d405bc0158912c0f37471381b467087","459c0ca522af7a412ef771447fe2c558c9a4640cffa4f53bacac05d0378a3ae7","acd5d501223e3a7cdd229b501fce5fb071937b72bd05fa33e543eb21c8ee0aba","f196d5ed4194259ffb797a34001a5edb7a165cd110dc3e4d8f03f11e3531fe9b","683889752b7c95fffd073b82ea76d36b3fe548ef3bb9887eb903676eabd676ff","a439ff9443c77478bb024ea2d96fbc088bccc915adf6bb8aeb9ab21fd737a071","b40afc6ff175241970202125bc1b5996cf5783b2f755977691f8c6522ace9f14","8bfc11f55ca063b10f0335922693ca70885d8f59b20607dd501250d1b1e960db","a884051a029dc34c400dc1dbad39a878935d37ebbea62d357d17b25f0076b578",{"version":"1b1ca1d97df4268847d5c387b1a89c01ec2fdc2062def1216442c8f040dcb660","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"6e0011406961ab3d469f2a7c3fddc41a5c9fb6d9452c47b5389124da846ab07a","df1bbd333631040027035b56cb31093015e59ce977a590500ed09feab109939b","a4f27ea63e3ff26a94b6681967a5276a2df9ddb80ae990df1ad03c0fffb34eca","18418f70457cee30da01c21bc26869ceb1ae65564784136f7fe2f7f2ff8f740f","3d2ec84143e6462a786b5d9ecf06f4f6f67a59a1f16c5a3a5e41721ba8478b7f","892f412f701d356f85cd3cb7d48b87ffecc0d4f85a2005c1d53e5e08414df8b1",{"version":"14261c0d2da587df791a696c8272003a3c5c1d7dd3a91f459092a8ab99759ca3","signature":"23d9dffba690dd7b1cc3986e0d592011a8660f0cb7632037b83b157b659c1510"},{"version":"1bcee41416ce15644b7e0eb66c2bb9df82007068fc83675d48927495cde7bd57","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"28ff2e0cd9350ef52ad5d6a77ddf2650d0505bd3d8cb1db66e1e5abf798d0c92","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"86b69f4f564965d8fd203354ebfcc235e37958a8195b600161deb5b9982a4dde","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a","4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","852bcf5d92d819abdf34ba0759c311b61d5dac7b9963a6c3cc4f23b025dee8f3","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[61,62,73,[185,188],193,220,[227,230],233,[260,266],269,280,281,364,[371,374]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[164,236],[164,236,237],[164,237,238,239,240],[164,237],[164],[164,242,244],[164,243],[79,164,172,175,226,292,295,296,297,298,300,308,309,310,311,316,317],[164,295,297],[164,294,295],[164,293],[164,292,295,297,299],[164,301,303],[164,299,301,307],[164,305],[164,297,300,301,302,303,304,306],[164,297],[64,164,183],[164,297,300],[79,82,164,210,292,295],[164,226],[164,180,284,287],[64,164,179,180,182,282,283,284,286],[64,164,182,283,284,285],[164,211,366,367,368,369],[164,203],[164,201],[164,204],[164,202,205,206,207,208,209,210],[64,71,164],[64,78,79,82,83,164,179,289,290],[64,164,179],[82,164,182,183,289,318,327],[164,184,267],[82,164],[79,82,164,182,183,315],[164,178,183],[82,164,181,183],[164,358,362],[164,361,362],[164,361],[164,358,359,360],[64,79,164,179,183],[79,82,164,183],[64,79,82,164,179,182],[78,83,164,182],[134,164,171],[79,82,83,84,164,172,173,174,175,176,177,178,181,183],[164,183],[83,164,172],[76,78,164],[79,82,164],[79,83,164,182],[64,79,164,172,183,282],[64,164,179,182,183],[79,164,183],[82,164,172,180,182,183],[164,334],[164,291,329,330,331,332,333],[78,79,83,164,172,173,175,182,316,317,321,322,323,324,326],[79,164,176,201,321],[64,164,325],[79,164,210,321],[79,164],[164,312,313,314],[79,164,210],[74,76,78,79,164],[79,82,164,172,175,182,321],[82,164,173,181,335],[82,164,172,173,181,183,336],[80,81,164],[164,247],[164,250],[164,249,250,251],[164,249,251,252,253,254],[164,256],[164,256,258],[134,137,163,164,171,375,376,377],[164,270],[164,379],[164,405],[164,390],[164,394,395,396],[164,393],[164,395],[164,385,391,392,397,400,402,403,404],[164,392,398,399,405],[164,398,401],[164,392,393,398,405],[164,392,405],[164,407],[164,386,387,388,389],[85,164],[121,164],[122,127,155,164],[123,134,135,142,152,163,164],[123,124,134,142,164],[125,164],[126,127,135,143,164],[127,152,160,164],[128,130,134,142,164],[129,164],[130,131,164],[134,164],[132,134,164],[121,134,164],[134,135,136,152,163,164],[134,135,136,149,152,155,164],[119,164,168],[130,134,137,142,152,163,164],[134,135,137,138,142,152,160,163,164],[137,139,152,160,163,164],[85,86,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170],[134,140,164],[141,163,164,168],[130,134,142,152,164],[143,164],[144,164],[121,145,164],[146,162,164,168],[147,164],[148,164],[134,149,150,164],[149,151,164,166],[122,134,152,153,154,155,164],[122,152,154,164],[152,153,164],[155,164],[156,164],[121,152,164],[134,158,159,164],[158,159,164],[127,142,152,160,164],[161,164],[142,162,164],[122,137,148,163,164],[127,164],[152,164,165],[141,164,166],[164,167],[122,127,134,136,145,152,163,164,166,168],[152,164,169],[137,152,164,171],[164,415,454],[164,415,439,454],[164,454],[164,415],[164,415,440,454],[164,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453],[164,440,454],[164,277],[164,458],[134,152,164,171],[164,270,271,272,273,274,275],[164,270,271],[122,123,152,164],[164,319,320],[164,223],[64,164,179,192,231],[64,164,179,190,192],[64,164,179,192],[64,164,189,191],[164,179],[79,82,164,172,175,182,339],[79,84,164,172,173,174,175,176,181,182,183,316,317,321,323,339,341],[164,172,175,176,182,316],[82,164,172,175,182,316],[79,82,164,173,175,182,183,315,339,341,349],[79,82,164,172,173,175,176,182,183,315,316,339,341,343,344,350],[79,84,164,173,174,180,181,182,183,184,321,340,341,342,351,352,353,354,355],[82,164,172,173,176,181,182,183,323,339],[74,164],[164,201,214,215,216],[77,78,164],[77,164],[75,164],[164,195],[76,164],[76,164,197],[78,164,196,197,198,199,200],[74,75,76,77,164,195],[74,75,76,164],[164,345,346,347,348],[164,346],[164,346,347],[71,164],[63,164],[63,71,164],[63,64,164],[63,65,66,67,68,69,70,164],[164,218],[164,213,218,219,221,222,223,224],[164,201,217],[96,100,163,164],[96,152,163,164],[91,164],[93,96,160,163,164],[142,160,164],[164,171],[91,164,171],[93,96,142,163,164],[88,89,92,95,122,134,152,163,164],[88,94,164],[92,96,122,155,163,164,171],[122,164,171],[112,122,164,171],[90,91,164,171],[96,164],[90,91,92,93,94,95,96,97,98,100,101,102,103,104,105,106,107,108,109,110,111,113,114,115,116,117,118,164],[96,103,104,164],[94,96,104,105,164],[95,164],[88,91,96,164],[96,100,104,105,164],[100,164],[94,96,99,163,164],[88,93,94,96,100,103,164],[122,152,164],[91,96,112,122,164,168,171],[62,73,79,164,187],[62,164,185,186],[62,73,164,184],[62,164,185,187],[164,260],[127,164,185,188,241,245,246,260],[62,164,185,187,188,248,255,257,259],[61,64,164,179,193,230,262],[62,64,72,164,187,192],[62,72,73,79,164,185,187,188,193,194,220,227,229,230,232],[62,72,164,186,187,188,213,222,225,227],[62,72,164,185,187,220,228],[73,164,184,188,260,264],[61,164,185,187,223,226],[164,173],[61,62,64,72,73,79,164,173,179,183,184,185,188,192,193,220,230,232,233,234,235,261,262,263],[62,72,164],[64,71,72,164],[62,73,79,164,211,212,213,219],[164,264,268],[79,164,279],[122,164,185,187,220,222,223,229,260,276,371],[64,164,173,219,232,234,264,265,276,278,280],[82,135,164,211,212,226,265,288,291,328,334,336,337,338,356,357,363],[61,64,79,122,164,193,219,220,222,223,229,231,232,233,234,260,264,276,278,280,365,371],[79,164,185,210,370],[79,122,164,220,222,232,233,234,261,276,280],[62,73,79,187],[62,185,186],[62,73,184],[62,185,187],[265],[188],[64,179,230,262],[62,64,187,192],[62,73,79,185,187,188,229,230,232],[62,186,187,188],[62,185,187,228],[73,184,188,260,264],[185,187,226],[173],[62,64,73,79,173,179,183,184,185,188],[62],[64,71],[62,73,79],[79],[79,185,210]],"referencedMap":[[240,1],[238,2],[241,3],[239,4],[236,5],[237,5],[242,5],[245,6],[244,7],[243,5],[311,5],[318,8],[298,9],[296,10],[295,11],[300,12],[304,13],[308,14],[306,15],[301,5],[299,5],[307,16],[303,17],[309,18],[310,19],[297,20],[302,5],[283,21],[284,5],[288,22],[287,23],[286,24],[366,5],[367,5],[370,25],[204,26],[202,27],[205,28],[211,29],[203,5],[206,26],[207,30],[208,27],[209,27],[368,5],[369,5],[291,31],[289,30],[290,32],[328,33],[268,34],[267,5],[323,35],[316,36],[317,37],[339,38],[363,39],[359,5],[360,40],[362,41],[358,5],[361,42],[184,43],[341,44],[183,45],[84,46],[194,5],[172,47],[182,48],[210,5],[173,49],[353,50],[79,51],[83,52],[174,53],[175,52],[292,54],[176,5],[177,49],[180,55],[285,5],[178,56],[181,57],[329,58],[330,58],[334,59],[331,58],[332,58],[333,58],[327,60],[322,61],[326,62],[325,30],[354,63],[226,64],[315,65],[314,64],[312,64],[313,64],[279,66],[212,67],[355,68],[336,69],[335,70],[81,35],[82,71],[80,35],[248,72],[247,5],[251,73],[252,74],[253,74],[250,5],[254,5],[249,5],[255,75],[258,76],[257,76],[259,77],[256,5],[378,78],[271,79],[275,79],[273,79],[270,5],[380,80],[376,5],[381,5],[382,5],[383,5],[384,47],[385,5],[406,81],[391,82],[397,83],[395,5],[394,84],[396,85],[405,86],[400,87],[402,88],[403,89],[404,90],[398,5],[399,90],[401,90],[393,90],[392,5],[408,91],[387,5],[386,5],[389,82],[390,92],[388,82],[409,5],[410,5],[411,5],[379,5],[85,93],[86,93],[121,94],[122,95],[123,96],[124,97],[125,98],[126,99],[127,100],[128,101],[129,102],[130,103],[131,103],[133,104],[132,105],[134,106],[135,107],[136,108],[120,109],[170,5],[137,110],[138,111],[139,112],[171,113],[140,114],[141,115],[142,116],[143,117],[144,118],[145,119],[146,120],[147,121],[148,122],[149,123],[150,123],[151,124],[152,125],[154,126],[153,127],[155,128],[156,129],[157,130],[158,131],[159,132],[160,133],[161,134],[162,135],[163,136],[164,137],[165,138],[166,139],[167,140],[168,141],[169,142],[412,5],[413,5],[377,143],[414,5],[439,144],[440,145],[415,146],[418,146],[437,144],[438,144],[428,144],[427,147],[425,144],[420,144],[433,144],[431,144],[435,144],[419,144],[432,144],[436,144],[421,144],[422,144],[434,144],[416,144],[423,144],[424,144],[426,144],[430,144],[441,148],[429,144],[417,144],[454,149],[453,5],[448,148],[450,150],[449,148],[442,148],[443,148],[445,148],[447,148],[451,150],[452,150],[444,150],[446,150],[278,151],[277,5],[455,5],[456,5],[457,5],[407,5],[458,5],[459,152],[460,153],[276,154],[87,5],[274,79],[272,155],[305,5],[345,5],[337,156],[338,5],[321,157],[319,158],[320,5],[365,5],[231,32],[232,159],[191,160],[189,161],[192,162],[234,163],[235,163],[282,5],[190,32],[179,5],[375,104],[340,164],[342,165],[343,166],[344,167],[350,168],[351,169],[356,170],[352,171],[216,172],[74,5],[217,173],[75,174],[200,5],[78,175],[195,176],[215,177],[214,177],[197,178],[198,179],[76,5],[201,180],[196,181],[77,182],[199,5],[357,5],[349,183],[347,184],[348,185],[346,5],[324,5],[293,5],[294,11],[63,186],[67,187],[68,188],[65,189],[66,187],[71,190],[69,30],[70,186],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[64,5],[72,5],[221,5],[213,5],[222,5],[219,191],[225,192],[223,191],[218,193],[224,5],[103,194],[110,195],[102,194],[117,196],[94,197],[93,198],[116,199],[111,200],[114,201],[96,202],[95,203],[91,204],[90,205],[113,206],[92,207],[97,208],[98,5],[101,208],[88,5],[119,209],[118,208],[105,210],[106,211],[108,212],[104,213],[107,214],[112,199],[99,215],[100,216],[109,217],[89,218],[115,219],[246,5],[62,5],[230,220],[187,221],[185,222],[61,5],[188,223],[266,224],[261,225],[260,226],[263,227],[193,228],[233,229],[228,230],[229,231],[265,232],[227,233],[262,234],[264,235],[186,236],[73,237],[220,238],[269,239],[280,240],[374,241],[281,242],[364,243],[372,244],[371,245],[373,246]],"exportedModulesMap":[[240,1],[238,2],[241,3],[239,4],[236,5],[237,5],[242,5],[245,6],[244,7],[243,5],[311,5],[318,8],[298,9],[296,10],[295,11],[300,12],[304,13],[308,14],[306,15],[301,5],[299,5],[307,16],[303,17],[309,18],[310,19],[297,20],[302,5],[283,21],[284,5],[288,22],[287,23],[286,24],[366,5],[367,5],[370,25],[204,26],[202,27],[205,28],[211,29],[203,5],[206,26],[207,30],[208,27],[209,27],[368,5],[369,5],[291,31],[289,30],[290,32],[328,33],[268,34],[267,5],[323,35],[316,36],[317,37],[339,38],[363,39],[359,5],[360,40],[362,41],[358,5],[361,42],[184,43],[341,44],[183,45],[84,46],[194,5],[172,47],[182,48],[210,5],[173,49],[353,50],[79,51],[83,52],[174,53],[175,52],[292,54],[176,5],[177,49],[180,55],[285,5],[178,56],[181,57],[329,58],[330,58],[334,59],[331,58],[332,58],[333,58],[327,60],[322,61],[326,62],[325,30],[354,63],[226,64],[315,65],[314,64],[312,64],[313,64],[279,66],[212,67],[355,68],[336,69],[335,70],[81,35],[82,71],[80,35],[248,72],[247,5],[251,73],[252,74],[253,74],[250,5],[254,5],[249,5],[255,75],[258,76],[257,76],[259,77],[256,5],[378,78],[271,79],[275,79],[273,79],[270,5],[380,80],[376,5],[381,5],[382,5],[383,5],[384,47],[385,5],[406,81],[391,82],[397,83],[395,5],[394,84],[396,85],[405,86],[400,87],[402,88],[403,89],[404,90],[398,5],[399,90],[401,90],[393,90],[392,5],[408,91],[387,5],[386,5],[389,82],[390,92],[388,82],[409,5],[410,5],[411,5],[379,5],[85,93],[86,93],[121,94],[122,95],[123,96],[124,97],[125,98],[126,99],[127,100],[128,101],[129,102],[130,103],[131,103],[133,104],[132,105],[134,106],[135,107],[136,108],[120,109],[170,5],[137,110],[138,111],[139,112],[171,113],[140,114],[141,115],[142,116],[143,117],[144,118],[145,119],[146,120],[147,121],[148,122],[149,123],[150,123],[151,124],[152,125],[154,126],[153,127],[155,128],[156,129],[157,130],[158,131],[159,132],[160,133],[161,134],[162,135],[163,136],[164,137],[165,138],[166,139],[167,140],[168,141],[169,142],[412,5],[413,5],[377,143],[414,5],[439,144],[440,145],[415,146],[418,146],[437,144],[438,144],[428,144],[427,147],[425,144],[420,144],[433,144],[431,144],[435,144],[419,144],[432,144],[436,144],[421,144],[422,144],[434,144],[416,144],[423,144],[424,144],[426,144],[430,144],[441,148],[429,144],[417,144],[454,149],[453,5],[448,148],[450,150],[449,148],[442,148],[443,148],[445,148],[447,148],[451,150],[452,150],[444,150],[446,150],[278,151],[277,5],[455,5],[456,5],[457,5],[407,5],[458,5],[459,152],[460,153],[276,154],[87,5],[274,79],[272,155],[305,5],[345,5],[337,156],[338,5],[321,157],[319,158],[320,5],[365,5],[231,32],[232,159],[191,160],[189,161],[192,162],[234,163],[235,163],[282,5],[190,32],[179,5],[375,104],[340,164],[342,165],[343,166],[344,167],[350,168],[351,169],[356,170],[352,171],[216,172],[74,5],[217,173],[75,174],[200,5],[78,175],[195,176],[215,177],[214,177],[197,178],[198,179],[76,5],[201,180],[196,181],[77,182],[199,5],[357,5],[349,183],[347,184],[348,185],[346,5],[324,5],[293,5],[294,11],[63,186],[67,187],[68,188],[65,189],[66,187],[71,190],[69,30],[70,186],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[64,5],[72,5],[221,5],[213,5],[222,5],[219,191],[225,192],[223,191],[218,193],[224,5],[103,194],[110,195],[102,194],[117,196],[94,197],[93,198],[116,199],[111,200],[114,201],[96,202],[95,203],[91,204],[90,205],[113,206],[92,207],[97,208],[98,5],[101,208],[88,5],[119,209],[118,208],[105,210],[106,211],[108,212],[104,213],[107,214],[112,199],[99,215],[100,216],[109,217],[89,218],[115,219],[246,5],[230,247],[187,248],[185,249],[188,250],[266,251],[261,252],[260,252],[263,253],[193,254],[233,255],[228,256],[229,257],[265,258],[227,259],[262,260],[264,261],[186,262],[73,263],[220,264],[280,265],[371,266]],"semanticDiagnosticsPerFile":[240,238,241,239,236,237,242,245,244,243,311,318,298,296,295,300,304,308,306,301,299,307,303,309,310,297,302,283,284,288,287,286,366,367,370,204,202,205,211,203,206,207,208,209,368,369,291,289,290,328,268,267,323,316,317,339,363,359,360,362,358,361,184,341,183,84,194,172,182,210,173,353,79,83,174,175,292,176,177,180,285,178,181,329,330,334,331,332,333,327,322,326,325,354,226,315,314,312,313,279,212,355,336,335,81,82,80,248,247,251,252,253,250,254,249,255,258,257,259,256,378,271,275,273,270,380,376,381,382,383,384,385,406,391,397,395,394,396,405,400,402,403,404,398,399,401,393,392,408,387,386,389,390,388,409,410,411,379,85,86,121,122,123,124,125,126,127,128,129,130,131,133,132,134,135,136,120,170,137,138,139,171,140,141,142,143,144,145,146,147,148,149,150,151,152,154,153,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,412,413,377,414,439,440,415,418,437,438,428,427,425,420,433,431,435,419,432,436,421,422,434,416,423,424,426,430,441,429,417,454,453,448,450,449,442,443,445,447,451,452,444,446,278,277,455,456,457,407,458,459,460,276,87,274,272,305,345,337,338,321,319,320,365,231,232,191,189,192,234,235,282,190,179,375,340,342,343,344,350,351,356,352,216,74,217,75,200,78,195,215,214,197,198,76,201,196,77,199,357,349,347,348,346,324,293,294,63,67,68,65,66,71,69,70,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,64,72,221,213,222,219,225,223,218,224,103,110,102,117,94,93,116,111,114,96,95,91,90,113,92,97,98,101,88,119,118,105,106,108,104,107,112,99,100,109,89,115,246,62,230,187,185,61,188,266,261,260,263,193,233,228,229,265,227,262,264,186,73,220,269,280,374,281,364,372,371,373],"latestChangedDtsFile":"./test/handshakes/xx.spec.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto/streaming.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto/streaming.ts index c3bebff18..b4ae0cc75 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto/streaming.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto/streaming.ts @@ -17,7 +17,14 @@ export function encryptStream (handshake: IHandshake, metrics?: MetricsRegistry) end = chunk.length } - const data = handshake.encrypt(chunk.subarray(i, end), handshake.session) + let data: Uint8Array + + if (i === 0 && end === chunk.byteLength && chunk instanceof Uint8Array) { + data = handshake.encrypt(chunk, handshake.session) + } else { + data = handshake.encrypt(chunk.subarray(i, end), handshake.session) + } + metrics?.encryptedPackets.increment() yield new Uint8ArrayList(uint16BEEncode(data.byteLength), data) @@ -39,6 +46,7 @@ export function decryptStream (handshake: IHandshake, metrics?: MetricsRegistry) if (end - CHACHA_TAG_LENGTH < i) { throw new Error('Invalid chunk') } + const encrypted = chunk.subarray(i, end) // memory allocation is not cheap so reuse the encrypted Uint8Array // see https://github.com/ChainSafe/js-libp2p-noise/pull/242#issue-1422126164 diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/tcp/dist/src/socket-to-conn.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/tcp/dist/src/socket-to-conn.js index 895d2cc0e..805eb8374 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/tcp/dist/src/socket-to-conn.js +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/tcp/dist/src/socket-to-conn.js @@ -75,7 +75,6 @@ export const toMultiaddrConnection = (socket, options) => { yield buf; } else { - // is it faster to yield all the buffers or just one big buffer? yield buf.subarray(); } } diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/Makefile b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/Makefile deleted file mode 100644 index a1e077cdc..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -DOCKER_IMAGE := node:20-alpine -DOCKER_RUN := docker run --rm -v "$(shell pwd)":/usr/src/myapp -w /usr/src/myapp $(DOCKER_IMAGE) - -all: perf - -perf: - $(DOCKER_RUN) npm ci - -clean: - rm -rf node_modules - -.PHONY: all clean perf diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/index.js deleted file mode 100644 index 8b4462ee6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/index.js +++ /dev/null @@ -1,109 +0,0 @@ -import { noise } from './noise/dist/src/index.js' -import { yamux } from './yamux/dist/src/index.js' -import { tcp } from './tcp/dist/src/index.js' -import { multiaddr } from '@multiformats/multiaddr' -import { createLibp2p } from './libp2p/dist/src/index.js' -import { perf } from '@libp2p/perf' -import { parseArgs } from 'node:util' - -const argv = parseArgs({ - options: { - 'run-server': { - type: 'string', - default: 'false' - }, - 'server-address': { - type: 'string', - default: '127.0.0.1:8000' - }, - transport: { - type: 'string', - default: 'tcp' - }, - 'upload-bytes': { - type: 'string', - default: '0' - }, - 'download-bytes': { - type: 'string', - default: '10000000000' - } - } -}) - -/** - * @param {boolean} runServer - * @param {string} serverIpAddress - * @param {string} transport - * @param {number} uploadBytes - * @param {number} downloadBytes - */ -export async function main (runServer, serverIpAddress, transport, uploadBytes, downloadBytes) { - const { host, port } = splitHostPort(serverIpAddress) - - const config = { - transports: [ - tcp() - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - noise() - ], - connectionManager: { - minConnections: 0 - }, - services: { - perf: perf() - } - } - - if (runServer) { - Object.assign(config, { - addresses: { - listen: [ - // #TODO: right now we only support tcp - `/ip4/${host}/tcp/${port}` - ] - } - }) - } - - const node = await createLibp2p(config) - - await node.start() - - if (!runServer) { - for await (const output of node.services.perf.measurePerformance(multiaddr(`/ip4/${host}/tcp/${port}`), uploadBytes, downloadBytes)) { - // eslint-disable-next-line no-console - console.log(JSON.stringify(output)) - } - - await node.stop() - } -} - -/** - * @param {string} address - * @returns { host: string, port?: string } - */ -function splitHostPort (address) { - try { - const parts = address.split(':') - const host = parts[0] - const port = parts[1] - return { - host, - port - } - } catch (error) { - throw Error('Invalid server address') - } -} - -main(argv.values['run-server'] === 'true', argv.values['server-address'], argv.values.transport, Number(argv.values['upload-bytes']), Number(argv.values['download-bytes'])).catch((err) => { - // eslint-disable-next-line no-console - console.error(err) - process.exit(1) -}) diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/index.min.js deleted file mode 100644 index 506967c5c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/index.min.js +++ /dev/null @@ -1,91 +0,0 @@ -(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2P = factory()}(typeof self !== 'undefined' ? self : this, function () { -"use strict";var Libp2P=(()=>{var eg=Object.create;var is=Object.defineProperty;var tg=Object.getOwnPropertyDescriptor;var rg=Object.getOwnPropertyNames;var ng=Object.getPrototypeOf,ig=Object.prototype.hasOwnProperty;var V=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ke=(t,e)=>{for(var r in e)is(t,r,{get:e[r],enumerable:!0})},Zl=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of rg(e))!ig.call(t,i)&&i!==r&&is(t,i,{get:()=>e[i],enumerable:!(n=tg(e,i))||n.enumerable});return t};var ve=(t,e,r)=>(r=t!=null?eg(ng(t)):{},Zl(e||!t||!t.__esModule?is(r,"default",{value:t,enumerable:!0}):r,t)),sg=t=>Zl(is({},"__esModule",{value:!0}),t);var de=V((Rv,jl)=>{jl.exports={options:{usePureJavaScript:!1}}});var tf=V((Cv,ef)=>{var da={};ef.exports=da;var Jl={};da.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=og(t,e);else{var i=0,s=e.length,o=e.charAt(0),a=[0];for(i=0;i0;)a.push(u%s),u=u/s|0}for(i=0;t[i]===0&&i=0;--i)n+=e[a[i]]}if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join(`\r -`)}return n};da.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=Jl[e];if(!r){r=Jl[e]=[];for(var n=0;n>=8;for(;u>0;)o.push(u&255),u>>=8}for(var l=0;t[l]===s&&l0;)s.push(a%n),a=a/n|0}var c="";for(r=0;t.at(r)===0&&r=0;--r)c+=e[s[r]];return c}});var Ne=V((Tv,of)=>{var rf=de(),nf=tf(),w=of.exports=rf.util=rf.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){w.nextTick=process.nextTick,typeof setImmediate=="function"?w.setImmediate=setImmediate:w.setImmediate=w.nextTick;return}if(typeof setImmediate=="function"){w.setImmediate=function(){return setImmediate.apply(void 0,arguments)},w.nextTick=function(a){return setImmediate(a)};return}if(w.setImmediate=function(a){setTimeout(a,0)},typeof window<"u"&&typeof window.postMessage=="function"){let a=function(c){if(c.source===window&&c.data===t){c.stopPropagation();var u=e.slice();e.length=0,u.forEach(function(l){l()})}};var o=a,t="forge.setImmediate",e=[];w.setImmediate=function(c){e.push(c),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",a,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,i=document.createElement("div"),e=[];new MutationObserver(function(){var c=e.slice();e.length=0,c.forEach(function(u){u()})}).observe(i,{attributes:!0});var s=w.setImmediate;w.setImmediate=function(c){Date.now()-r>15?(r=Date.now(),s(c)):(e.push(c),e.length===1&&i.setAttribute("a",n=!n))}}w.nextTick=w.setImmediate})();w.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;w.globalScope=function(){return w.isNodejs?globalThis:typeof self>"u"?window:self}();w.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};w.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};w.isArrayBufferView=function(t){return t&&w.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function hi(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}w.ByteBuffer=pa;function pa(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(w.isArrayBuffer(t)||w.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;rag&&(this.data.substr(0,1),this._constructedStringLength=0)};w.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};w.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};w.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};w.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};w.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};w.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(w.encodeUtf8(t))};w.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};w.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};w.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};w.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};w.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};w.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};w.ByteStringBuffer.prototype.putInt=function(t,e){hi(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};w.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};w.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};w.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};w.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};w.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};w.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};w.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};w.ByteStringBuffer.prototype.copy=function(){var t=w.createBuffer(this.data);return t.read=this.read,t};w.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};w.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};w.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};w.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};w.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};w.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};w.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};w.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};w.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};w.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};w.DataBuffer.prototype.putInt=function(t,e){hi(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};w.DataBuffer.prototype.putSignedInt=function(t,e){return hi(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};w.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};w.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};w.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};w.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};w.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};w.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};w.DataBuffer.prototype.copy=function(){return new w.DataBuffer(this)};w.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};w.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};w.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};w.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};w.xorBytes=function(t,e,r){for(var n="",i="",s="",o=0,a=0;r>0;--r,++o)i=t.charCodeAt(o)^e.charCodeAt(o),a>=10&&(n+=s,s="",a=0),s+=String.fromCharCode(i),++a;return n+=s,n};w.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var gr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",yr=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],sf="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";w.encode64=function(t,e){for(var r="",n="",i,s,o,a=0;a>2),r+=gr.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=gr.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":gr.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};w.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,i,s,o=0;o>4),i!==64&&(e+=String.fromCharCode((n&15)<<4|i>>2),s!==64&&(e+=String.fromCharCode((i&3)<<6|s)));return e};w.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};w.decodeUtf8=function(t){return decodeURIComponent(escape(t))};w.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:nf.encode,decode:nf.decode}};w.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};w.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s>2),r+=gr.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=gr.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":gr.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};w.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,s,o,a,c=0,u=r;c>4,o!==64&&(n[u++]=(s&15)<<4|o>>2,a!==64&&(n[u++]=(o&3)<<6|a));return e?u-r:n.subarray(0,u)};w.binary.base58.encode=function(t,e){return w.binary.baseN.encode(t,sf,e)};w.binary.base58.decode=function(t,e){return w.binary.baseN.decode(t,sf,e)};w.text={utf8:{},utf16:{}};w.text.utf8.encode=function(t,e,r){t=w.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s"u"&&(r=["web","flash"]);var i,s=!1,o=null;for(var a in r){i=r[a];try{if(i==="flash"||i==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),s=i==="flash"}(i==="web"||i==="both")&&(e[0]=localStorage,n=t.apply(this,e),s=!0)}catch(c){o=c}if(s)break}if(!s)throw o;return n};w.setItem=function(t,e,r,n,i){ss(ug,arguments,i)};w.getItem=function(t,e,r,n){return ss(lg,arguments,n)};w.removeItem=function(t,e,r,n){ss(fg,arguments,n)};w.clearItems=function(t,e,r){ss(hg,arguments,r)};w.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};w.format=function(t){for(var e=/%./g,r,n,i=0,s=[],o=0;r=e.exec(t);){n=t.substring(o,e.lastIndex-2),n.length>0&&s.push(n),o=e.lastIndex;var a=r[0][1];switch(a){case"s":case"o":i");break;case"%":s.push("%");break;default:s.push("<%"+a+"?>")}}return s.push(t.substring(o)),s.join("")};w.formatNumber=function(t,e,r,n){var i=t,s=isNaN(e=Math.abs(e))?2:e,o=r===void 0?",":r,a=n===void 0?".":n,c=i<0?"-":"",u=parseInt(i=Math.abs(+i||0).toFixed(s),10)+"",l=u.length>3?u.length%3:0;return c+(l?u.substr(0,l)+a:"")+u.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+a)+(s?o+Math.abs(i-u).toFixed(s).slice(2):"")};w.formatSize=function(t){return t>=1073741824?t=w.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=w.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=w.formatNumber(t/1024,0)+" KiB":t=w.formatNumber(t,0)+" bytes",t};w.bytesFromIP=function(t){return t.indexOf(".")!==-1?w.bytesFromIPv4(t):t.indexOf(":")!==-1?w.bytesFromIPv6(t):null};w.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=w.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1))}e.push(s)}if(r.length>0){var c=r[n];c.end-c.start>0&&(e.splice(c.start,c.end-c.start+1,""),c.start===0&&e.unshift(""),c.end===7&&e.push(""))}return e.join(":")};w.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in w&&!t.update)return e(null,w.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return w.cores=navigator.hardwareConcurrency,e(null,w.cores);if(typeof Worker>"u")return w.cores=1,e(null,w.cores);if(typeof Blob>"u")return w.cores=2,e(null,w.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(o){for(var a=Date.now(),c=a+4;Date.now()p.st&&l.stl.st&&p.st{var di=de();di.pki=di.pki||{};var ya=af.exports=di.pki.oids=di.oids=di.oids||{};function B(t,e){ya[t]=e,ya[e]=t}function ae(t,e){ya[t]=e}B("1.2.840.113549.1.1.1","rsaEncryption");B("1.2.840.113549.1.1.4","md5WithRSAEncryption");B("1.2.840.113549.1.1.5","sha1WithRSAEncryption");B("1.2.840.113549.1.1.7","RSAES-OAEP");B("1.2.840.113549.1.1.8","mgf1");B("1.2.840.113549.1.1.9","pSpecified");B("1.2.840.113549.1.1.10","RSASSA-PSS");B("1.2.840.113549.1.1.11","sha256WithRSAEncryption");B("1.2.840.113549.1.1.12","sha384WithRSAEncryption");B("1.2.840.113549.1.1.13","sha512WithRSAEncryption");B("1.3.101.112","EdDSA25519");B("1.2.840.10040.4.3","dsa-with-sha1");B("1.3.14.3.2.7","desCBC");B("1.3.14.3.2.26","sha1");B("1.3.14.3.2.29","sha1WithRSASignature");B("2.16.840.1.101.3.4.2.1","sha256");B("2.16.840.1.101.3.4.2.2","sha384");B("2.16.840.1.101.3.4.2.3","sha512");B("2.16.840.1.101.3.4.2.4","sha224");B("2.16.840.1.101.3.4.2.5","sha512-224");B("2.16.840.1.101.3.4.2.6","sha512-256");B("1.2.840.113549.2.2","md2");B("1.2.840.113549.2.5","md5");B("1.2.840.113549.1.7.1","data");B("1.2.840.113549.1.7.2","signedData");B("1.2.840.113549.1.7.3","envelopedData");B("1.2.840.113549.1.7.4","signedAndEnvelopedData");B("1.2.840.113549.1.7.5","digestedData");B("1.2.840.113549.1.7.6","encryptedData");B("1.2.840.113549.1.9.1","emailAddress");B("1.2.840.113549.1.9.2","unstructuredName");B("1.2.840.113549.1.9.3","contentType");B("1.2.840.113549.1.9.4","messageDigest");B("1.2.840.113549.1.9.5","signingTime");B("1.2.840.113549.1.9.6","counterSignature");B("1.2.840.113549.1.9.7","challengePassword");B("1.2.840.113549.1.9.8","unstructuredAddress");B("1.2.840.113549.1.9.14","extensionRequest");B("1.2.840.113549.1.9.20","friendlyName");B("1.2.840.113549.1.9.21","localKeyId");B("1.2.840.113549.1.9.22.1","x509Certificate");B("1.2.840.113549.1.12.10.1.1","keyBag");B("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");B("1.2.840.113549.1.12.10.1.3","certBag");B("1.2.840.113549.1.12.10.1.4","crlBag");B("1.2.840.113549.1.12.10.1.5","secretBag");B("1.2.840.113549.1.12.10.1.6","safeContentsBag");B("1.2.840.113549.1.5.13","pkcs5PBES2");B("1.2.840.113549.1.5.12","pkcs5PBKDF2");B("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");B("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");B("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");B("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");B("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");B("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");B("1.2.840.113549.2.7","hmacWithSHA1");B("1.2.840.113549.2.8","hmacWithSHA224");B("1.2.840.113549.2.9","hmacWithSHA256");B("1.2.840.113549.2.10","hmacWithSHA384");B("1.2.840.113549.2.11","hmacWithSHA512");B("1.2.840.113549.3.7","des-EDE3-CBC");B("2.16.840.1.101.3.4.1.2","aes128-CBC");B("2.16.840.1.101.3.4.1.22","aes192-CBC");B("2.16.840.1.101.3.4.1.42","aes256-CBC");B("2.5.4.3","commonName");B("2.5.4.4","surname");B("2.5.4.5","serialNumber");B("2.5.4.6","countryName");B("2.5.4.7","localityName");B("2.5.4.8","stateOrProvinceName");B("2.5.4.9","streetAddress");B("2.5.4.10","organizationName");B("2.5.4.11","organizationalUnitName");B("2.5.4.12","title");B("2.5.4.13","description");B("2.5.4.15","businessCategory");B("2.5.4.17","postalCode");B("2.5.4.42","givenName");B("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");B("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");B("2.16.840.1.113730.1.1","nsCertType");B("2.16.840.1.113730.1.13","nsComment");ae("2.5.29.1","authorityKeyIdentifier");ae("2.5.29.2","keyAttributes");ae("2.5.29.3","certificatePolicies");ae("2.5.29.4","keyUsageRestriction");ae("2.5.29.5","policyMapping");ae("2.5.29.6","subtreesConstraint");ae("2.5.29.7","subjectAltName");ae("2.5.29.8","issuerAltName");ae("2.5.29.9","subjectDirectoryAttributes");ae("2.5.29.10","basicConstraints");ae("2.5.29.11","nameConstraints");ae("2.5.29.12","policyConstraints");ae("2.5.29.13","basicConstraints");B("2.5.29.14","subjectKeyIdentifier");B("2.5.29.15","keyUsage");ae("2.5.29.16","privateKeyUsagePeriod");B("2.5.29.17","subjectAltName");B("2.5.29.18","issuerAltName");B("2.5.29.19","basicConstraints");ae("2.5.29.20","cRLNumber");ae("2.5.29.21","cRLReason");ae("2.5.29.22","expirationDate");ae("2.5.29.23","instructionCode");ae("2.5.29.24","invalidityDate");ae("2.5.29.25","cRLDistributionPoints");ae("2.5.29.26","issuingDistributionPoint");ae("2.5.29.27","deltaCRLIndicator");ae("2.5.29.28","issuingDistributionPoint");ae("2.5.29.29","certificateIssuer");ae("2.5.29.30","nameConstraints");B("2.5.29.31","cRLDistributionPoints");B("2.5.29.32","certificatePolicies");ae("2.5.29.33","policyMappings");ae("2.5.29.34","policyConstraints");B("2.5.29.35","authorityKeyIdentifier");ae("2.5.29.36","policyConstraints");B("2.5.29.37","extKeyUsage");ae("2.5.29.46","freshestCRL");ae("2.5.29.54","inhibitAnyPolicy");B("1.3.6.1.4.1.11129.2.4.2","timestampList");B("1.3.6.1.5.5.7.1.1","authorityInfoAccess");B("1.3.6.1.5.5.7.3.1","serverAuth");B("1.3.6.1.5.5.7.3.2","clientAuth");B("1.3.6.1.5.5.7.3.3","codeSigning");B("1.3.6.1.5.5.7.3.4","emailProtection");B("1.3.6.1.5.5.7.3.8","timeStamping")});var mi=V((Lv,uf)=>{var ge=de();Ne();os();var O=uf.exports=ge.asn1=ge.asn1||{};O.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};O.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};O.create=function(t,e,r,n,i){if(ge.util.isArray(n)){for(var s=[],o=0;oe){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}var dg=function(t,e){var r=t.getByte();if(e--,r!==128){var n,i=r&128;if(!i)n=r;else{var s=r&127;pi(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}};O.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof t=="string"&&(t=ge.util.createBuffer(t));var r=t.length(),n=as(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=r,i.remaining=t.length(),i}return n};function as(t,e,r,n){var i;pi(t,e,2);var s=t.getByte();e--;var o=s&192,a=s&31;i=t.length();var c=dg(t,e);if(e-=i-t.length(),c!==void 0&&c>e){if(n.strict){var u=new Error("Too few bytes to read ASN.1 value.");throw u.available=t.length(),u.remaining=e,u.requested=c,u}c=e}var l,f,h=(s&32)===32;if(h)if(l=[],c===void 0)for(;;){if(pi(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}i=t.length(),l.push(as(t,e,r+1,n)),e-=i-t.length()}else for(;c>0;)i=t.length(),l.push(as(t,c,r+1,n)),e-=i-t.length(),c-=i-t.length();if(l===void 0&&o===O.Class.UNIVERSAL&&a===O.Type.BITSTRING&&(f=t.bytes(c)),l===void 0&&n.decodeBitStrings&&o===O.Class.UNIVERSAL&&a===O.Type.BITSTRING&&c>1){var p=t.read,d=e,m=0;if(a===O.Type.BITSTRING&&(pi(t,e,1),m=t.getByte(),e--),m===0)try{i=t.length();var g={strict:!0,decodeBitStrings:!0},y=as(t,e,r+1,g),x=i-t.length();e-=x,a==O.Type.BITSTRING&&x++;var b=y.tagClass;x===c&&(b===O.Class.UNIVERSAL||b===O.Class.CONTEXT_SPECIFIC)&&(l=[y])}catch{}l===void 0&&(t.read=p,e=d)}if(l===void 0){if(c===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=e}if(a===O.Type.BMPSTRING)for(l="";c>0;c-=2)pi(t,e,2),l+=String.fromCharCode(t.getInt16()),e-=2;else l=t.getBytes(c),e-=c}var I=f===void 0?null:{bitStringContents:f};return O.create(o,a,h,l,I)}O.toDer=function(t){var e=ge.util.createBuffer(),r=t.tagClass|t.type,n=ge.util.createBuffer(),i=!1;if("bitStringContents"in t&&(i=!0,t.original&&(i=O.equals(t,t.original))),i)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var s=0;s1&&(t.value.charCodeAt(0)===0&&!(t.value.charCodeAt(1)&128)||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var o=n.length(),a="";do a+=String.fromCharCode(o&255),o=o>>>8;while(o>0);e.putByte(a.length|128);for(var s=a.length-1;s>=0;--s)e.putByte(a.charCodeAt(s))}return e.putBuffer(n),e};O.oidToDer=function(t){var e=t.split("."),r=ge.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,i,s,o,a=2;a>>7,n||(o|=128),i.push(o),n=!1;while(s>0);for(var c=i.length-1;c>=0;--c)r.putByte(i[c])}return r};O.derToOid=function(t){var e;typeof t=="string"&&(t=ge.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;)r=t.getByte(),n=n<<7,r&128?n+=r&127:(e+="."+(n+r),n=0);return e};O.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),s=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=0;if(t.length>11){var c=t.charAt(10),u=10;c!=="+"&&c!=="-"&&(a=parseInt(t.substr(10,2),10),u+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,0),u&&(c=t.charAt(u),c==="+"||c==="-")){var l=parseInt(t.substr(u+1,2),10),f=parseInt(t.substr(u+4,2),10),h=l*60+f;h*=6e4,c==="+"?e.setTime(+e-h):e.setTime(+e+h)}return e};O.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),o=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),c=0,u=0,l=!1;t.charAt(t.length-1)==="Z"&&(l=!0);var f=t.length-5,h=t.charAt(f);if(h==="+"||h==="-"){var p=parseInt(t.substr(f+1,2),10),d=parseInt(t.substr(f+4,2),10);u=p*60+d,u*=6e4,h==="+"&&(u*=-1),l=!0}return t.charAt(14)==="."&&(c=parseFloat(t.substr(14),10)*1e3),l?(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,c),e.setTime(+e+u)):(e.setFullYear(r,n,i),e.setHours(s,o,a,c)),e};O.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};O.derToInteger=function(t){typeof t=="string"&&(t=ge.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};O.validate=function(t,e,r,n){var i=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(i=!0,e.value&&ge.util.isArray(e.value))for(var s=0,o=0;i&&o0&&(n+=` -`);for(var i="",s=0;s1?n+="0x"+ge.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var u=t.value.charCodeAt(0);u==1?n+=" (1 unused bit shown)":u>1&&(n+=" ("+u+" unused bits shown)")}}else if(t.type===O.Type.OCTETSTRING)cf.test(t.value)||(n+="("+t.value+") "),n+="0x"+ge.util.bytesToHex(t.value);else if(t.type===O.Type.UTF8)try{n+=ge.util.decodeUtf8(t.value)}catch(l){if(l.message==="URI malformed")n+="0x"+ge.util.bytesToHex(t.value)+" (malformed UTF8)";else throw l}else t.type===O.Type.PRINTABLESTRING||t.type===O.Type.IA5String?n+=t.value:cf.test(t.value)?n+="0x"+ge.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var ba=V((Pv,lf)=>{var qe=de();Ne();lf.exports=qe.cipher=qe.cipher||{};qe.cipher.algorithms=qe.cipher.algorithms||{};qe.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=qe.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new qe.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};qe.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=qe.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new qe.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};qe.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),qe.cipher.algorithms[t]=e};qe.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in qe.cipher.algorithms?qe.cipher.algorithms[t]:null};var xa=qe.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};xa.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=qe.util.createBuffer(),this.output=t.output||qe.util.createBuffer(),this.mode.start(e)};xa.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};xa.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var Ea=V((Dv,ff)=>{var Ve=de();Ne();Ve.cipher=Ve.cipher||{};var J=ff.exports=Ve.cipher.modes=Ve.cipher.modes||{};J.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};J.ecb.prototype.start=function(t){};J.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};J.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};J.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=cs(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};J.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};J.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Ve.util.createBuffer(),this._partialBytes=0};J.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=cs(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};J.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};J.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};J.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Ve.util.createBuffer(),this._partialBytes=0};J.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=cs(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};J.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};J.ofb.prototype.decrypt=J.ofb.prototype.encrypt;J.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Ve.util.createBuffer(),this._partialBytes=0};J.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=cs(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};J.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}us(this._inBlock)};J.ctr.prototype.decrypt=J.ctr.prototype.encrypt;J.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Ve.util.createBuffer(),this._partialBytes=0,this._R=3774873600};J.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=Ve.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=Ve.util.createBuffer(t.additionalData):r=Ve.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=Ve.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(wa(n*8)))}this._inBlock=this._j0.slice(0),us(this._inBlock),this._partialBytes=0,r=Ve.util.createBuffer(r),this._aDataLength=wa(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};J.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),us(this._inBlock)};J.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),us(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};J.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=t[n]>>>(7-r%8)*4&15,s=this._m[r][i];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};J.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};J.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,s=new Array(i),o=0;o>>1,i=new Array(r);i[n]=t.slice(0);for(var s=n>>>1;s>0;)this.pow(i[2*s],i[s]=[]),s>>=1;for(s=2;s4){var r=t;t=Ve.util.createBuffer();for(var n=0;n{var me=de();ba();Ea();Ne();mf.exports=me.aes=me.aes||{};me.aes.startEncrypting=function(t,e,r,n){var i=ls({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i};me.aes.createEncryptionCipher=function(t,e){return ls({key:t,output:null,decrypt:!1,mode:e})};me.aes.startDecrypting=function(t,e,r,n){var i=ls({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i};me.aes.createDecryptionCipher=function(t,e){return ls({key:t,output:null,decrypt:!0,mode:e})};me.aes.Algorithm=function(t,e){Sa||df();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(n,i){return _a(r._w,n,i,!1)},decrypt:function(n,i){return _a(r._w,n,i,!0)}}}),r._init=!1};me.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=me.util.createBuffer(e);else if(me.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=me.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^a&255^99,ot[r]=a,va[a]=r,c=t[a],i=t[r],s=t[i],o=t[s],u=c<<24^a<<16^a<<8^(a^c),l=(i^s^o)<<24^(r^o)<<16^(r^s^o)<<8^(r^i^o);for(var f=0;f<4;++f)Vr[f][r]=u,Tt[f][a]=l,u=u<<24|u>>>8,l=l<<24|l>>>8;r===0?r=n=1:(r=i^t[t[t[i^o]]],n^=t[t[n]])}}function pf(t,e){for(var r=t.slice(0),n,i=1,s=r.length,o=s+6+1,a=_n*o,c=s;c>>16&255]<<24^ot[n>>>8&255]<<16^ot[n&255]<<8^ot[n>>>24]^hf[i]<<24,i++):s>6&&c%s===4&&(n=ot[n>>>24]<<24^ot[n>>>16&255]<<16^ot[n>>>8&255]<<8^ot[n&255]),r[c]=r[c-s]^n;if(e){var u,l=Tt[0],f=Tt[1],h=Tt[2],p=Tt[3],d=r.slice(0);a=r.length;for(var c=0,m=a-_n;c>>24]]^f[ot[u>>>16&255]]^h[ot[u>>>8&255]]^p[ot[u&255]];r=d}return r}function _a(t,e,r,n){var i=t.length/4-1,s,o,a,c,u;n?(s=Tt[0],o=Tt[1],a=Tt[2],c=Tt[3],u=va):(s=Vr[0],o=Vr[1],a=Vr[2],c=Vr[3],u=ot);var l,f,h,p,d,m,g;l=e[0]^t[0],f=e[n?3:1]^t[1],h=e[2]^t[2],p=e[n?1:3]^t[3];for(var y=3,x=1;x>>24]^o[f>>>16&255]^a[h>>>8&255]^c[p&255]^t[++y],m=s[f>>>24]^o[h>>>16&255]^a[p>>>8&255]^c[l&255]^t[++y],g=s[h>>>24]^o[p>>>16&255]^a[l>>>8&255]^c[f&255]^t[++y],p=s[p>>>24]^o[l>>>16&255]^a[f>>>8&255]^c[h&255]^t[++y],l=d,f=m,h=g;r[0]=u[l>>>24]<<24^u[f>>>16&255]<<16^u[h>>>8&255]<<8^u[p&255]^t[++y],r[n?3:1]=u[f>>>24]<<24^u[h>>>16&255]<<16^u[p>>>8&255]<<8^u[l&255]^t[++y],r[2]=u[h>>>24]<<24^u[p>>>16&255]<<16^u[l>>>8&255]<<8^u[f&255]^t[++y],r[n?1:3]=u[p>>>24]<<24^u[l>>>16&255]<<16^u[f>>>8&255]<<8^u[h&255]^t[++y]}function ls(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=me.cipher.createDecipher(r,t.key):n=me.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof me.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var xf=V((kv,yf)=>{var xe=de();ba();Ea();Ne();yf.exports=xe.des=xe.des||{};xe.des.startEncrypting=function(t,e,r,n){var i=fs({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};xe.des.createEncryptionCipher=function(t,e){return fs({key:t,output:null,decrypt:!1,mode:e})};xe.des.startDecrypting=function(t,e,r,n){var i=fs({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};xe.des.createDecryptionCipher=function(t,e){return fs({key:t,output:null,decrypt:!0,mode:e})};xe.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(n,i){return gf(r._keys,n,i,!1)},decrypt:function(n,i){return gf(r._keys,n,i,!0)}}}),r._init=!1};xe.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=xe.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=vg(e),this._init=!0}};Kt("DES-ECB",xe.cipher.modes.ecb);Kt("DES-CBC",xe.cipher.modes.cbc);Kt("DES-CFB",xe.cipher.modes.cfb);Kt("DES-OFB",xe.cipher.modes.ofb);Kt("DES-CTR",xe.cipher.modes.ctr);Kt("3DES-ECB",xe.cipher.modes.ecb);Kt("3DES-CBC",xe.cipher.modes.cbc);Kt("3DES-CFB",xe.cipher.modes.cfb);Kt("3DES-OFB",xe.cipher.modes.ofb);Kt("3DES-CTR",xe.cipher.modes.ctr);function Kt(t,e){var r=function(){return new xe.des.Algorithm(t,e)};xe.cipher.registerAlgorithm(t,r)}var pg=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],mg=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],gg=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],yg=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],xg=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],bg=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],wg=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],Eg=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function vg(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],a=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],l=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],d=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],m=t.length()>8?3:1,g=[],y=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],x=0,b,I=0;I>>4^_)&252645135,_^=b,v^=b<<4,b=(_>>>-16^v)&65535,v^=b,_^=b<<-16,b=(v>>>2^_)&858993459,_^=b,v^=b<<2,b=(_>>>-16^v)&65535,v^=b,_^=b<<-16,b=(v>>>1^_)&1431655765,_^=b,v^=b<<1,b=(_>>>8^v)&16711935,v^=b,_^=b<<8,b=(v>>>1^_)&1431655765,_^=b,v^=b<<1,b=v<<8|_>>>20&240,v=_<<24|_<<8&16711680|_>>>8&65280|_>>>24&240,_=b;for(var P=0;P>>26,_=_<<2|_>>>26):(v=v<<1|v>>>27,_=_<<1|_>>>27),v&=-15,_&=-15;var D=e[v>>>28]|r[v>>>24&15]|n[v>>>20&15]|i[v>>>16&15]|s[v>>>12&15]|o[v>>>8&15]|a[v>>>4&15],G=c[_>>>28]|u[_>>>24&15]|l[_>>>20&15]|f[_>>>16&15]|h[_>>>12&15]|p[_>>>8&15]|d[_>>>4&15];b=(G>>>16^D)&65535,g[x++]=D^b,g[x++]=G^b<<16}}return g}function gf(t,e,r,n){var i=t.length===32?3:9,s;i===3?s=n?[30,-2,-2]:[0,32,2]:s=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,a=e[0],c=e[1];o=(a>>>4^c)&252645135,c^=o,a^=o<<4,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,a=a<<1|a>>>31,c=c<<1|c>>>31;for(var u=0;u>>4|c<<28)^t[h+1];o=a,a=c,c=o^(mg[p>>>24&63]|yg[p>>>16&63]|bg[p>>>8&63]|Eg[p&63]|pg[d>>>24&63]|gg[d>>>16&63]|xg[d>>>8&63]|wg[d&63])}o=a,a=c,c=o}a=a>>>1|a<<31,c=c>>>1|c<<31,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(a>>>4^c)&252645135,c^=o,a^=o<<4,r[0]=a,r[1]=c}function fs(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=xe.cipher.createDecipher(r,t.key):n=xe.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof xe.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var $r=V((Ov,bf)=>{var hs=de();bf.exports=hs.md=hs.md||{};hs.md.algorithms=hs.md.algorithms||{}});var Ef=V((Mv,wf)=>{var er=de();$r();Ne();var _g=wf.exports=er.hmac=er.hmac||{};_g.create=function(){var t=null,e=null,r=null,n=null,i={};return i.start=function(s,o){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in er.md.algorithms)e=er.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else e=s;if(o===null)o=t;else{if(typeof o=="string")o=er.util.createBuffer(o);else if(er.util.isArray(o)){var a=o;o=er.util.createBuffer();for(var c=0;ce.blockLength&&(e.start(),e.update(o.bytes()),o=e.digest()),r=er.util.createBuffer(),n=er.util.createBuffer(),u=o.length();for(var c=0;c{});var _f=V((Kv,vf)=>{var at=de();Ef();$r();Ne();var Sg=at.pkcs5=at.pkcs5||{},tr;at.util.isNodejs&&!at.options.usePureJavaScript&&(tr=gi());vf.exports=at.pbkdf2=Sg.pbkdf2=function(t,e,r,n,i,s){if(typeof i=="function"&&(s=i,i=null),at.util.isNodejs&&!at.options.usePureJavaScript&&tr.pbkdf2&&(i===null||typeof i!="object")&&(tr.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?tr.pbkdf2Sync.length===4?tr.pbkdf2(t,e,r,n,function(b,I){if(b)return s(b);s(null,I.toString("binary"))}):tr.pbkdf2(t,e,r,n,i,function(b,I){if(b)return s(b);s(null,I.toString("binary"))}):tr.pbkdf2Sync.length===4?tr.pbkdf2Sync(t,e,r,n).toString("binary"):tr.pbkdf2Sync(t,e,r,n,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in at.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=at.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var a=new Error("Derived key is too long.");if(s)return s(a);throw a}var c=Math.ceil(n/o),u=n-(c-1)*o,l=at.hmac.create();l.start(i,t);var f="",h,p,d;if(!s){for(var m=1;m<=c;++m){l.start(null,null),l.update(e),l.update(at.util.int32ToBytes(m)),h=d=l.digest().getBytes();for(var g=2;g<=r;++g)l.start(null,null),l.update(d),p=l.digest().getBytes(),h=at.util.xorBytes(h,p,o),d=p;f+=mc)return s(null,f);l.start(null,null),l.update(e),l.update(at.util.int32ToBytes(m)),h=d=l.digest().getBytes(),g=2,x()}function x(){if(g<=r)return l.start(null,null),l.update(d),p=l.digest().getBytes(),h=at.util.xorBytes(h,p,o),d=p,++g,at.util.setImmediate(x);f+=m{var ps=de();Ne();var Sf=Af.exports=ps.pem=ps.pem||{};Sf.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r -`,n;if(t.procType&&(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=ds(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=ds(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=ds(n)),t.headers)for(var i=0;i65&&o!==-1){var a=e[o];a===","?(++o,e=e.substr(0,o)+`\r - `+e.substr(o)):e=e.substr(0,o)+`\r -`+a+e.substr(o+1),s=i-o-1,o=-1,++i}else(e[i]===" "||e[i]===" "||e[i]===",")&&(o=i);return e}function Ag(t){return t.replace(/^\s+/,"")}});var Pf=V((Vv,Lf)=>{var qt=de();$r();Ne();var Cf=Lf.exports=qt.sha256=qt.sha256||{};qt.md.sha256=qt.md.algorithms.sha256=Cf;Cf.create=function(){Tf||Ig();var t=null,e=qt.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),Rf(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=qt.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(Ia.substr(0,n.blockLength-o));for(var a,c,u=n.fullMessageLength[0]*8,l=0;l>>0,u+=c,i.putInt32(u>>>0),u=a>>>0;i.putInt32(u);var f={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};Rf(f,r,i);var h=qt.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h.putInt32(f.h5),h.putInt32(f.h6),h.putInt32(f.h7),h},n};var Ia=null,Tf=!1,Bf=null;function Ig(){Ia="\x80",Ia+=qt.util.fillString("\0",64),Bf=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Tf=!0}function Rf(t,e,r){for(var n,i,s,o,a,c,u,l,f,h,p,d,m,g,y,x=r.length();x>=64;){for(u=0;u<16;++u)e[u]=r.getInt32();for(;u<64;++u)n=e[u-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=e[u-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[u]=n+e[u-7]+i+e[u-16]|0;for(l=t.h0,f=t.h1,h=t.h2,p=t.h3,d=t.h4,m=t.h5,g=t.h6,y=t.h7,u=0;u<64;++u)o=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),a=g^d&(m^g),s=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),c=l&f|h&(l^f),n=y+o+a+Bf[u]+e[u],i=s+c,y=g,g=m,m=d,d=p+n>>>0,p=h,h=f,f=l,l=n+i>>>0;t.h0=t.h0+l|0,t.h1=t.h1+f|0,t.h2=t.h2+h|0,t.h3=t.h3+p|0,t.h4=t.h4+d|0,t.h5=t.h5+m|0,t.h6=t.h6+g|0,t.h7=t.h7+y|0,x-=64}}});var Nf=V(($v,Df)=>{var Vt=de();Ne();var ms=null;Vt.util.isNodejs&&!Vt.options.usePureJavaScript&&!process.versions["node-webkit"]&&(ms=gi());var Rg=Df.exports=Vt.prng=Vt.prng||{};Rg.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();e.pools=n,e.pool=0,e.generate=function(u,l){if(!l)return e.generateSync(u);var f=e.plugin.cipher,h=e.plugin.increment,p=e.plugin.formatKey,d=e.plugin.formatSeed,m=Vt.util.createBuffer();e.key=null,g();function g(y){if(y)return l(y);if(m.length()>=u)return l(null,m.getBytes(u));if(e.generated>1048575&&(e.key=null),e.key===null)return Vt.util.nextTick(function(){s(g)});var x=f(e.key,e.seed);e.generated+=x.length,m.putBytes(x),e.key=p(f(e.key,h(e.seed))),e.seed=d(f(e.key,e.seed)),Vt.util.setImmediate(g)}},e.generateSync=function(u){var l=e.plugin.cipher,f=e.plugin.increment,h=e.plugin.formatKey,p=e.plugin.formatSeed;e.key=null;for(var d=Vt.util.createBuffer();d.length()1048575&&(e.key=null),e.key===null&&o();var m=l(e.key,e.seed);e.generated+=m.length,d.putBytes(m),e.key=h(l(e.key,f(e.seed))),e.seed=p(l(e.key,e.seed))}return d.getBytes(u)};function s(u){if(e.pools[0].messageLength>=32)return a(),u();var l=32-e.pools[0].messageLength<<5;e.seedFile(l,function(f,h){if(f)return u(f);e.collect(h),a(),u()})}function o(){if(e.pools[0].messageLength>=32)return a();var u=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(u)),a()}function a(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var u=e.plugin.md.create();u.update(e.keyBytes);for(var l=1,f=0;f<32;++f)e.reseeds%l===0&&(u.update(e.pools[f].digest().getBytes()),e.pools[f].start()),l=l<<1;e.keyBytes=u.digest().getBytes(),u.start(),u.update(e.keyBytes);var h=u.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(h),e.generated=0}function c(u){var l=null,f=Vt.util.globalScope,h=f.crypto||f.msCrypto;h&&h.getRandomValues&&(l=function(v){return h.getRandomValues(v)});var p=Vt.util.createBuffer();if(l)for(;p.length()>16),x+=(y&32767)<<16,x+=y>>15,x=(x&2147483647)+(x>>31),I=x&4294967295;for(var g=0;g<3;++g)b=I>>>(g<<3),b^=Math.floor(Math.random()*256),p.putByte(b&255)}return p.getBytes(u)}return ms?(e.seedFile=function(u,l){ms.randomBytes(u,function(f,h){if(f)return l(f);l(null,h.toString())})},e.seedFileSync=function(u){return ms.randomBytes(u).toString()}):(e.seedFile=function(u,l){try{l(null,c(u))}catch(f){l(f)}},e.seedFileSync=c),e.collect=function(u){for(var l=u.length,f=0;f>h&255);e.collect(f)},e.registerWorker=function(u){if(u===self)e.seedFile=function(f,h){function p(d){var m=d.data;m.forge&&m.forge.prng&&(self.removeEventListener("message",p),h(m.forge.prng.err,m.forge.prng.bytes))}self.addEventListener("message",p),self.postMessage({forge:{prng:{needed:f}}})};else{var l=function(f){var h=f.data;h.forge&&h.forge.prng&&e.seedFile(h.forge.prng.needed,function(p,d){u.postMessage({forge:{prng:{err:p,bytes:d}}})})};u.addEventListener("message",l)}},e}});var yi=V((zv,Ra)=>{var $e=de();Aa();Pf();Nf();Ne();(function(){if($e.random&&$e.random.getBytes){Ra.exports=$e.random;return}(function(t){var e={},r=new Array(4),n=$e.util.createBuffer();e.formatKey=function(f){var h=$e.util.createBuffer(f);return f=new Array(4),f[0]=h.getInt32(),f[1]=h.getInt32(),f[2]=h.getInt32(),f[3]=h.getInt32(),$e.aes._expandKey(f,!1)},e.formatSeed=function(f){var h=$e.util.createBuffer(f);return f=new Array(4),f[0]=h.getInt32(),f[1]=h.getInt32(),f[2]=h.getInt32(),f[3]=h.getInt32(),f},e.cipher=function(f,h){return $e.aes._updateBlock(f,h,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(f){return++f[3],f},e.md=$e.md.sha256;function i(){var f=$e.prng.create(e);return f.getBytes=function(h,p){return f.generate(h,p)},f.getBytesSync=function(h){return f.generate(h)},f}var s=i(),o=null,a=$e.util.globalScope,c=a.crypto||a.msCrypto;if(c&&c.getRandomValues&&(o=function(f){return c.getRandomValues(f)}),$e.options.usePureJavaScript||!$e.util.isNodejs&&!o){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var u="";for(var l in navigator)try{typeof navigator[l]=="string"&&(u+=navigator[l])}catch{}s.collect(u),u=null}t&&(t().mousemove(function(f){s.collectInt(f.clientX,16),s.collectInt(f.clientY,16)}),t().keypress(function(f){s.collectInt(f.charCode,8)}))}if(!$e.random)$e.random=s;else for(var l in s)$e.random[l]=s[l];$e.random.createInstance=i,Ra.exports=$e.random})(typeof jQuery<"u"?jQuery:null)})()});var Uf=V((Hv,Mf)=>{var lt=de();Ne();var Ca=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],kf=[1,2,3,5],Cg=function(t,e){return t<>16-e},Tg=function(t,e){return(t&65535)>>e|t<<16-e&65535};Mf.exports=lt.rc2=lt.rc2||{};lt.rc2.expandKey=function(t,e){typeof t=="string"&&(t=lt.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),i=e,s=Math.ceil(i/8),o=255>>(i&7),a;for(a=n;a<128;a++)r.putByte(Ca[r.at(a-1)+r.at(a-n)&255]);for(r.setAt(128-s,Ca[r.at(128-s)&o]),a=127-s;a>=0;a--)r.setAt(a,Ca[r.at(a+1)^r.at(a+s)]);return r};var Of=function(t,e,r){var n=!1,i=null,s=null,o=null,a,c,u,l,f=[];for(t=lt.rc2.expandKey(t,e),u=0;u<64;u++)f.push(t.getInt16Le());r?(a=function(d){for(u=0;u<4;u++)d[u]+=f[l]+(d[(u+3)%4]&d[(u+2)%4])+(~d[(u+3)%4]&d[(u+1)%4]),d[u]=Cg(d[u],kf[u]),l++},c=function(d){for(u=0;u<4;u++)d[u]+=f[d[(u+3)%4]&63]}):(a=function(d){for(u=3;u>=0;u--)d[u]=Tg(d[u],kf[u]),d[u]-=f[l]+(d[(u+3)%4]&d[(u+2)%4])+(~d[(u+3)%4]&d[(u+1)%4]),l--},c=function(d){for(u=3;u>=0;u--)d[u]-=f[d[(u+3)%4]&63]});var h=function(d){var m=[];for(u=0;u<4;u++){var g=i.getInt16Le();o!==null&&(r?g^=o.getInt16Le():o.putInt16Le(g)),m.push(g&65535)}l=r?0:63;for(var y=0;y=8;)h([[5,a],[1,c],[6,a],[1,c],[5,a]])},finish:function(d){var m=!0;if(r)if(d)m=d(8,i,!r);else{var g=i.length()===8?8:8-i.length();i.fillWithByte(g,g)}if(m&&(n=!0,p.update()),!r&&(m=i.length()===0,m))if(d)m=d(8,s,!r);else{var y=s.length(),x=s.at(y-1);x>y?m=!1:s.truncate(x)}return m}},p};lt.rc2.startEncrypting=function(t,e,r){var n=lt.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};lt.rc2.createEncryptionCipher=function(t,e){return Of(t,e,!0)};lt.rc2.startDecrypting=function(t,e,r){var n=lt.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};lt.rc2.createDecryptionCipher=function(t,e){return Of(t,e,!1)}});var xs=V((Gv,Gf)=>{var Ta=de();Gf.exports=Ta.jsbn=Ta.jsbn||{};var rr,Bg=0xdeadbeefcafe,Ff=(Bg&16777215)==15715070;function C(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}Ta.jsbn.BigInteger=C;function ie(){return new C(null)}function Lg(t,e,r,n,i,s){for(;--s>=0;){var o=e*this.data[t++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=o&67108863}return i}function Pg(t,e,r,n,i,s){for(var o=e&32767,a=e>>15;--s>=0;){var c=this.data[t]&32767,u=this.data[t++]>>15,l=a*c+u*o;c=o*c+((l&32767)<<15)+r.data[n]+(i&1073741823),i=(c>>>30)+(l>>>15)+a*u+(i>>>30),r.data[n++]=c&1073741823}return i}function Kf(t,e,r,n,i,s){for(var o=e&16383,a=e>>14;--s>=0;){var c=this.data[t]&16383,u=this.data[t++]>>14,l=a*c+u*o;c=o*c+((l&16383)<<14)+r.data[n]+i,i=(c>>28)+(l>>14)+a*u,r.data[n++]=c&268435455}return i}typeof navigator>"u"?(C.prototype.am=Kf,rr=28):Ff&&navigator.appName=="Microsoft Internet Explorer"?(C.prototype.am=Pg,rr=30):Ff&&navigator.appName!="Netscape"?(C.prototype.am=Lg,rr=26):(C.prototype.am=Kf,rr=28);C.prototype.DB=rr;C.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function kg(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}function xr(t){var e=ie();return e.fromInt(t),e}function Og(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,i=!1,s=0;--n>=0;){var o=r==8?t[n]&255:Vf(t,n);if(o<0){t.charAt(n)=="-"&&(i=!0);continue}i=!1,s==0?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB)}r==8&&t[0]&128&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}function Ug(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(a>a)>0&&(i=!0,s=qf(n));o>=0;)a>(a+=this.DB-e)):(n=this.data[o]>>(a-=e)&r,a<=0&&(a+=this.DB,--o)),n>0&&(i=!0),i&&(s+=qf(n));return i?s:"0"}function Fg(){var t=ie();return C.ZERO.subTo(this,t),t}function Kg(){return this.s<0?this.negate():this}function qg(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}function ys(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function Vg(){return this.t<=0?0:this.DB*(this.t-1)+ys(this.data[this.t-1]^this.s&this.DM)}function $g(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}function zg(t,e){for(var r=t;r=0;--a)e.data[a+s+1]=this.data[a]>>n|o,o=(this.data[a]&i)<=0;--a)e.data[a]=0;e.data[s]=o,e.t=this.t+s+1,e.s=this.s,e.clamp()}function Gg(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,i=this.DB-n,s=(1<>n;for(var o=r+1;o>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}function Yg(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}function Xg(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var u=s.t,l=s.data[u-1];if(l!=0){var f=l*(1<1?s.data[u-2]>>this.F2:0),h=this.FV/f,p=(1<=0&&(r.data[r.t++]=1,r.subTo(y,r)),C.ONE.dlShiftTo(u,y),y.subTo(s,s);s.t=0;){var x=r.data[--m]==l?this.DM:Math.floor(r.data[m]*h+(r.data[m-1]+d)*p);if((r.data[m]+=s.am(0,x,r,g,0,u))0&&r.rShiftTo(c,r),o<0&&C.ZERO.subTo(r,r)}}}function Zg(t){var e=ie();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(C.ZERO)>0&&t.subTo(e,e),e}function zr(t){this.m=t}function jg(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function Jg(t){return t}function ey(t){t.divRemTo(this.m,null,t)}function ty(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function ry(t,e){t.squareTo(e),this.reduce(e)}zr.prototype.convert=jg;zr.prototype.revert=Jg;zr.prototype.reduce=ey;zr.prototype.mulTo=ty;zr.prototype.sqrTo=ry;function ny(){if(this.t<1)return 0;var t=this.data[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function Hr(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}function sy(t){var e=ie();return t.copyTo(e),this.reduce(e),e}function oy(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function ay(t,e){t.squareTo(e),this.reduce(e)}function cy(t,e,r){t.multiplyTo(e,r),this.reduce(r)}Hr.prototype.convert=iy;Hr.prototype.revert=sy;Hr.prototype.reduce=oy;Hr.prototype.mulTo=cy;Hr.prototype.sqrTo=ay;function uy(){return(this.t>0?this.data[0]&1:this.s)==0}function ly(t,e){if(t>4294967295||t<1)return C.ONE;var r=ie(),n=ie(),i=e.convert(this),s=ys(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,i,r);else{var o=r;r=n,n=o}return e.revert(r)}function fy(t,e){var r;return t<256||e.isEven()?r=new zr(e):r=new Hr(e),this.exp(t,r)}C.prototype.copyTo=Ng;C.prototype.fromInt=kg;C.prototype.fromString=Og;C.prototype.clamp=Mg;C.prototype.dlShiftTo=$g;C.prototype.drShiftTo=zg;C.prototype.lShiftTo=Hg;C.prototype.rShiftTo=Gg;C.prototype.subTo=Wg;C.prototype.multiplyTo=Yg;C.prototype.squareTo=Qg;C.prototype.divRemTo=Xg;C.prototype.invDigit=ny;C.prototype.isEven=uy;C.prototype.exp=ly;C.prototype.toString=Ug;C.prototype.negate=Fg;C.prototype.abs=Kg;C.prototype.compareTo=qg;C.prototype.bitLength=Vg;C.prototype.mod=Zg;C.prototype.modPowInt=fy;C.ZERO=xr(0);C.ONE=xr(1);function hy(){var t=ie();return this.copyTo(t),t}function dy(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}function my(){return this.t==0?this.s:this.data[0]<<16>>16}function gy(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function yy(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function xy(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=xr(r),i=ie(),s=ie(),o="";for(this.divRemTo(n,i,s);i.signum()>0;)o=(r+s.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,s);return s.intValue().toString(t)+o}function by(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,s=0,o=0,a=0;a=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(o,0)),i&&C.ZERO.subTo(this,this)}function wy(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(C.ONE.shiftLeft(t-1),La,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(C.ONE.shiftLeft(t-1),this);else{var n=new Array,i=t&7;n.length=(t>>3)+1,e.nextBytes(n),i>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function vy(t){return this.compareTo(t)==0}function _y(t){return this.compareTo(t)<0?this:t}function Sy(t){return this.compareTo(t)>0?this:t}function Ay(t,e,r){var n,i,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),t&255||(t>>=8,e+=8),t&15||(t>>=4,e+=4),t&3||(t>>=2,e+=2),t&1||++e,e}function ky(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}function zy(t){var e=ie();return this.addTo(t,e),e}function Hy(t){var e=ie();return this.subTo(t,e),e}function Gy(t){var e=ie();return this.multiplyTo(t,e),e}function Wy(t){var e=ie();return this.divRemTo(t,e,null),e}function Yy(t){var e=ie();return this.divRemTo(t,null,e),e}function Qy(t){var e=ie(),r=ie();return this.divRemTo(t,e,r),new Array(e,r)}function Xy(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Zy(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}function xi(){}function Hf(t){return t}function jy(t,e,r){t.multiplyTo(e,r)}function Jy(t,e){t.squareTo(e)}xi.prototype.convert=Hf;xi.prototype.revert=Hf;xi.prototype.mulTo=jy;xi.prototype.sqrTo=Jy;function e1(t){return this.exp(t,new xi)}function t1(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=ie();return t.copyTo(e),this.reduce(e),e}function i1(t){return t}function s1(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function o1(t,e){t.squareTo(e),this.reduce(e)}function a1(t,e,r){t.multiplyTo(e,r),this.reduce(r)}In.prototype.convert=n1;In.prototype.revert=i1;In.prototype.reduce=s1;In.prototype.mulTo=a1;In.prototype.sqrTo=o1;function c1(t,e){var r=t.bitLength(),n,i=xr(1),s;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new zr(e):e.isEven()?s=new In(e):s=new Hr(e);var o=new Array,a=3,c=n-1,u=(1<1){var l=ie();for(s.sqrTo(o[1],l);a<=u;)o[a]=ie(),s.mulTo(l,o[a-2],o[a]),a+=2}var f=t.t-1,h,p=!0,d=ie(),m;for(r=ys(t.data[f])-1;f>=0;){for(r>=c?h=t.data[f]>>r-c&u:(h=(t.data[f]&(1<0&&(h|=t.data[f-1]>>this.DB+r-c)),a=n;!(h&1);)h>>=1,--a;if((r-=a)<0&&(r+=this.DB,--f),p)o[h].copyTo(i),p=!1;else{for(;a>1;)s.sqrTo(i,d),s.sqrTo(d,i),a-=2;a>0?s.sqrTo(i,d):(m=i,i=d,d=m),s.mulTo(d,o[h],i)}for(;f>=0&&!(t.data[f]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function l1(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}function f1(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return C.ZERO;for(var r=t.clone(),n=this.clone(),i=xr(1),s=xr(0),o=xr(0),a=xr(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!i.isEven()||!s.isEven())&&(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!o.isEven()||!a.isEven())&&(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),s.subTo(a,s)):(n.subTo(r,n),e&&o.subTo(i,o),a.subTo(s,a))}if(n.compareTo(C.ONE)!=0)return C.ZERO;if(a.compareTo(t)>=0)return a.subtract(t);if(a.signum()<0)a.addTo(t,a);else return a;return a.signum()<0?a.add(t):a}var Bt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],h1=(1<<26)/Bt[Bt.length-1];function d1(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=Bt[Bt.length-1]){for(e=0;e=0);var a=s.modPow(n,this);if(a.compareTo(C.ONE)!=0&&a.compareTo(e)!=0){for(var c=1;c++{var $t=de();$r();Ne();var Yf=Xf.exports=$t.sha1=$t.sha1||{};$t.md.sha1=$t.md.algorithms.sha1=Yf;Yf.create=function(){Qf||g1();var t=null,e=$t.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),Wf(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=$t.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(Pa.substr(0,n.blockLength-o));for(var a,c,u=n.fullMessageLength[0]*8,l=0;l>>0,u+=c,i.putInt32(u>>>0),u=a>>>0;i.putInt32(u);var f={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};Wf(f,r,i);var h=$t.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h},n};var Pa=null,Qf=!1;function g1(){Pa="\x80",Pa+=$t.util.fillString("\0",64),Qf=!0}function Wf(t,e,r){for(var n,i,s,o,a,c,u,l,f=r.length();f>=64;){for(i=t.h0,s=t.h1,o=t.h2,a=t.h3,c=t.h4,l=0;l<16;++l)n=r.getInt32(),e[l]=n,u=a^s&(o^a),n=(i<<5|i>>>27)+u+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<20;++l)n=e[l-3]^e[l-8]^e[l-14]^e[l-16],n=n<<1|n>>>31,e[l]=n,u=a^s&(o^a),n=(i<<5|i>>>27)+u+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<32;++l)n=e[l-3]^e[l-8]^e[l-14]^e[l-16],n=n<<1|n>>>31,e[l]=n,u=s^o^a,n=(i<<5|i>>>27)+u+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<40;++l)n=e[l-6]^e[l-16]^e[l-28]^e[l-32],n=n<<2|n>>>30,e[l]=n,u=s^o^a,n=(i<<5|i>>>27)+u+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<60;++l)n=e[l-6]^e[l-16]^e[l-28]^e[l-32],n=n<<2|n>>>30,e[l]=n,u=s&o|a&(s^o),n=(i<<5|i>>>27)+u+c+2400959708+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<80;++l)n=e[l-6]^e[l-16]^e[l-28]^e[l-32],n=n<<2|n>>>30,e[l]=n,u=s^o^a,n=(i<<5|i>>>27)+u+c+3395469782+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+s|0,t.h2=t.h2+o|0,t.h3=t.h3+a|0,t.h4=t.h4+c|0,f-=64}}});var e0=V((Yv,Jf)=>{var zt=de();Ne();yi();Zf();var jf=Jf.exports=zt.pkcs1=zt.pkcs1||{};jf.encode_rsa_oaep=function(t,e,r){var n,i,s,o;typeof r=="string"?(n=r,i=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),s?s.start():s=zt.md.sha1.create(),o||(o=s);var a=Math.ceil(t.n.bitLength()/8),c=a-2*s.digestLength-2;if(e.length>c){var u=new Error("RSAES-OAEP input message length is too long.");throw u.length=e.length,u.maxLength=c,u}n||(n=""),s.update(n,"raw");for(var l=s.digest(),f="",h=c-e.length,p=0;p>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+o),n+=r.digest().getBytes()}return n.substring(0,e)}});var t0=V((Qv,Da)=>{var br=de();Ne();xs();yi();(function(){if(br.prime){Da.exports=br.prime;return}var t=Da.exports=br.prime=br.prime||{},e=br.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var i=function(f,h){return f|h};t.generateProbablePrime=function(f,h,p){typeof h=="function"&&(p=h,h={}),h=h||{};var d=h.algorithm||"PRIMEINC";typeof d=="string"&&(d={name:d}),d.options=d.options||{};var m=h.prng||br.random,g={nextBytes:function(y){for(var x=m.getBytesSync(y.length),b=0;bh&&(f=u(h,p)),f.isProbablePrime(m))return y(null,f);f.dAddOffset(r[d++%8],0)}while(g<0||+new Date-x"u")return o(f,h,p,d);var m=u(f,h),g=p.workers,y=p.workLoad||100,x=y*30/8,b=p.workerScript||"forge/prime.worker.js";if(g===-1)return br.util.estimateCores(function(v,_){v&&(_=2),g=_-1,I()});I();function I(){g=Math.max(1,g);for(var v=[],_=0;_f&&(m=u(f,h));var he=m.toString(16);W.target.postMessage({hex:he,workLoad:y}),m.dAddOffset(x,0)}}}}function u(f,h){var p=new e(f,h),d=f-1;return p.testBit(d)||p.bitwiseTo(e.ONE.shiftLeft(d),i,p),p.dAddOffset(31-p.mod(n).byteValue(),0),p}function l(f){return f<=100?27:f<=150?18:f<=200?15:f<=250?12:f<=300?9:f<=350?8:f<=400?7:f<=500?6:f<=600?5:f<=800?4:f<=1250?3:2}})()});var Es=V((Xv,c0)=>{var $=de();mi();xs();os();e0();t0();yi();Ne();typeof ne>"u"&&(ne=$.jsbn.BigInteger);var ne,Na=$.util.isNodejs?gi():null,E=$.asn1,At=$.util;$.pki=$.pki||{};c0.exports=$.pki.rsa=$.rsa=$.rsa||{};var Y=$.pki,y1=[6,4,2,4,2,4,6,2],x1={name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},b1={name:"RSAPrivateKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},w1={name:"RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},E1=$.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},v1={name:"DigestInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:E.Class.UNIVERSAL,type:E.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},_1=function(t){var e;if(t.algorithm in Y.oids)e=Y.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=E.oidToDer(e).getBytes(),i=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]),s=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]);s.value.push(E.create(E.Class.UNIVERSAL,E.Type.OID,!1,n)),s.value.push(E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,""));var o=E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(s),i.value.push(o),E.toDer(i).getBytes()},o0=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(ne.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(ne.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new ne($.util.bytesToHex($.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(ne.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var i=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(s)<0;)i=i.add(e.p);var o=i.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return o=o.multiply(n.modInverse(e.n)).mod(e.n),o};Y.rsa.encrypt=function(t,e,r){var n=r,i,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=a0(t,e,r)):(i=$.util.createBuffer(),i.putBytes(t));for(var o=new ne(i.toHex(),16),a=o0(o,e,n),c=a.toString(16),u=$.util.createBuffer(),l=s-Math.ceil(c.length/2);l>0;)u.putByte(0),--l;return u.putBytes($.util.hexToBytes(c)),u.getBytes()};Y.rsa.decrypt=function(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=i,s}var o=new ne($.util.createBuffer(t).toHex(),16);if(o.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var a=o0(o,e,r),c=a.toString(16),u=$.util.createBuffer(),l=i-Math.ceil(c.length/2);l>0;)u.putByte(0),--l;return u.putBytes($.util.hexToBytes(c)),n!==!1?ws(u.getBytes(),e,r):u.getBytes()};Y.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||$.random,i={nextBytes:function(a){for(var c=n.getBytesSync(a.length),u=0;u>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+s);return o};Y.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new ne(null);r.fromInt(30);for(var n=0,i=function(f,h){return f|h},s=+new Date,o,a=0;t.keys===null&&(e<=0||ac?t.pqState=0:t.num.isProbablePrime(A1(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(y1[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(ne.ONE).gcd(t.e).compareTo(ne.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(ne.ONE),t.q1=t.q.subtract(ne.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(ne.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var l=t.e.modInverse(t.phi);t.keys={privateKey:Y.rsa.setPrivateKey(t.n,t.e,l,t.p,t.q,l.mod(t.p1),l.mod(t.q1),t.q.modInverse(t.p)),publicKey:Y.rsa.setPublicKey(t.n,t.e)}}o=+new Date,a+=o-s,s=o}return t.keys!==null};Y.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!$.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(r0("generateKeyPair"))return Na.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(a,c,u){if(a)return n(a);n(null,{privateKey:Y.privateKeyFromPem(u),publicKey:Y.publicKeyFromPem(c)})});if(n0("generateKey")&&n0("exportKey"))return At.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:s0(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(a){return At.globalScope.crypto.subtle.exportKey("pkcs8",a.privateKey)}).then(void 0,function(a){n(a)}).then(function(a){if(a){var c=Y.privateKeyFromAsn1(E.fromDer($.util.createBuffer(a)));n(null,{privateKey:c,publicKey:Y.setRsaPublicKey(c.n,c.e)})}});if(i0("generateKey")&&i0("exportKey")){var i=At.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:s0(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(a){var c=a.target.result,u=At.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);u.oncomplete=function(l){var f=l.target.result,h=Y.privateKeyFromAsn1(E.fromDer($.util.createBuffer(f)));n(null,{privateKey:h,publicKey:Y.setRsaPublicKey(h.n,h.e)})},u.onerror=function(l){n(l)}},i.onerror=function(a){n(a)};return}}else if(r0("generateKeyPairSync")){var s=Na.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Y.privateKeyFromPem(s.privateKey),publicKey:Y.publicKeyFromPem(s.publicKey)}}}var o=Y.rsa.createKeyPairGenerationState(t,e,r);if(!n)return Y.rsa.stepKeyPairGenerationState(o,0),o.keys;S1(o,r,n)};Y.setRsaPublicKey=Y.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,i,s){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(a,c,u){return a0(a,c,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(a,c){return $.pkcs1.encode_rsa_oaep(c,a,s)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(a){return a}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(n,r,!0);return Y.rsa.encrypt(o,r,!0)},r.verify=function(n,i,s,o){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),s==="RSASSA-PKCS1-V1_5"?s={verify:function(c,u){u=ws(u,r,!0);var l=E.fromDer(u,{parseAllBytes:o._parseAllDigestBytes}),f={},h=[];if(!E.validate(l,v1,f,h)){var p=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw p.errors=h,p}var d=E.derToOid(f.algorithmIdentifier);if(!(d===$.oids.md2||d===$.oids.md5||d===$.oids.sha1||d===$.oids.sha224||d===$.oids.sha256||d===$.oids.sha384||d===$.oids.sha512||d===$.oids["sha512-224"]||d===$.oids["sha512-256"])){var p=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw p.oid=d,p}if((d===$.oids.md2||d===$.oids.md5)&&!("parameters"in f))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return c===f.digest}}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:function(c,u){return u=ws(u,r,!0),c===u}});var a=Y.rsa.decrypt(i,r,!0,!1);return s.verify(n,a,r.n.bitLength())},r};Y.setRsaPrivateKey=Y.rsa.setPrivateKey=function(t,e,r,n,i,s,o,a){var c={n:t,e,d:r,p:n,q:i,dP:s,dQ:o,qInv:a};return c.decrypt=function(u,l,f){typeof l=="string"?l=l.toUpperCase():l===void 0&&(l="RSAES-PKCS1-V1_5");var h=Y.rsa.decrypt(u,c,!1,!1);if(l==="RSAES-PKCS1-V1_5")l={decode:ws};else if(l==="RSA-OAEP"||l==="RSAES-OAEP")l={decode:function(p,d){return $.pkcs1.decode_rsa_oaep(d,p,f)}};else if(["RAW","NONE","NULL",null].indexOf(l)!==-1)l={decode:function(p){return p}};else throw new Error('Unsupported encryption scheme: "'+l+'".');return l.decode(h,c,!1)},c.sign=function(u,l){var f=!1;typeof l=="string"&&(l=l.toUpperCase()),l===void 0||l==="RSASSA-PKCS1-V1_5"?(l={encode:_1},f=1):(l==="NONE"||l==="NULL"||l===null)&&(l={encode:function(){return u}},f=1);var h=l.encode(u,c.n.bitLength());return Y.rsa.encrypt(h,c,f)},c};Y.wrapRsaPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Y.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,E.toDer(t).getBytes())])};Y.privateKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,x1,e,r)&&(t=E.fromDer($.util.createBuffer(e.privateKey))),e={},r=[],!E.validate(t,b1,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,s,o,a,c,u,l,f;return i=$.util.createBuffer(e.privateKeyModulus).toHex(),s=$.util.createBuffer(e.privateKeyPublicExponent).toHex(),o=$.util.createBuffer(e.privateKeyPrivateExponent).toHex(),a=$.util.createBuffer(e.privateKeyPrime1).toHex(),c=$.util.createBuffer(e.privateKeyPrime2).toHex(),u=$.util.createBuffer(e.privateKeyExponent1).toHex(),l=$.util.createBuffer(e.privateKeyExponent2).toHex(),f=$.util.createBuffer(e.privateKeyCoefficient).toHex(),Y.setRsaPrivateKey(new ne(i,16),new ne(s,16),new ne(o,16),new ne(a,16),new ne(c,16),new ne(u,16),new ne(l,16),new ne(f,16))};Y.privateKeyToAsn1=Y.privateKeyToRSAPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.e)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.d)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.p)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.q)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.dP)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.dQ)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.qInv))])};Y.publicKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,E1,e,r)){var n=E.derToOid(e.publicKeyOid);if(n!==Y.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}t=e.rsaPublicKey}if(r=[],!E.validate(t,w1,e,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var s=$.util.createBuffer(e.publicKeyModulus).toHex(),o=$.util.createBuffer(e.publicKeyExponent).toHex();return Y.setRsaPublicKey(new ne(s,16),new ne(o,16))};Y.publicKeyToAsn1=Y.publicKeyToSubjectPublicKeyInfo=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Y.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.BITSTRING,!1,[Y.publicKeyToRSAPublicKey(t)])])};Y.publicKeyToRSAPublicKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.e))])};function a0(t,e,r){var n=$.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=i-11,s}n.putByte(0),n.putByte(r);var o=i-3-t.length,a;if(r===0||r===1){a=r===0?0:255;for(var c=0;c0;){for(var u=0,l=$.random.getBytes(o),c=0;c"u")throw new Error("Encryption block is invalid.");var c=0;if(a===0){c=i-3-n;for(var u=0;u1;){if(s.getByte()!==255){--s.read;break}++c}else if(a===2)for(c=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++c}var l=s.getByte();if(l!==0||c!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function S1(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),i();function i(){s(t.pBits,function(a,c){if(a)return r(a);if(t.p=c,t.q!==null)return o(a,t.q);s(t.qBits,o)})}function s(a,c){$.prime.generateProbablePrime(a,n,c)}function o(a,c){if(a)return r(a);if(t.q=c,t.p.compareTo(t.q)<0){var u=t.p;t.p=t.q,t.q=u}if(t.p.subtract(ne.ONE).gcd(t.e).compareTo(ne.ONE)!==0){t.p=null,i();return}if(t.q.subtract(ne.ONE).gcd(t.e).compareTo(ne.ONE)!==0){t.q=null,s(t.qBits,o);return}if(t.p1=t.p.subtract(ne.ONE),t.q1=t.q.subtract(ne.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(ne.ONE)!==0){t.p=t.q=null,i();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,o);return}var l=t.e.modInverse(t.phi);t.keys={privateKey:Y.rsa.setPrivateKey(t.n,t.e,l,t.p,t.q,l.mod(t.p1),l.mod(t.q1),t.q.modInverse(t.p)),publicKey:Y.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function Ht(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=$.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function A1(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function r0(t){return $.util.isNodejs&&typeof Na[t]=="function"}function n0(t){return typeof At.globalScope<"u"&&typeof At.globalScope.crypto=="object"&&typeof At.globalScope.crypto.subtle=="object"&&typeof At.globalScope.crypto.subtle[t]=="function"}function i0(t){return typeof At.globalScope<"u"&&typeof At.globalScope.msCrypto=="object"&&typeof At.globalScope.msCrypto.subtle=="object"&&typeof At.globalScope.msCrypto.subtle[t]=="function"}function s0(t){for(var e=$.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{var M=de();Aa();mi();xf();$r();os();_f();If();yi();Uf();Es();Ne();typeof u0>"u"&&(u0=M.jsbn.BigInteger);var u0,A=M.asn1,X=M.pki=M.pki||{};d0.exports=X.pbe=M.pbe=M.pbe||{};var Gr=X.oids,I1={name:"EncryptedPrivateKeyInfo",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},R1={name:"PBES2Algorithms",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},C1={name:"pkcs-12PbeParams",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,capture:"iterations"}]};X.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=M.random.getBytesSync(r.saltSize),i=r.count,s=A.integerToDer(i),o,a,c;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var u,l,f;switch(r.algorithm){case"aes128":o=16,u=16,l=Gr["aes128-CBC"],f=M.aes.createEncryptionCipher;break;case"aes192":o=24,u=16,l=Gr["aes192-CBC"],f=M.aes.createEncryptionCipher;break;case"aes256":o=32,u=16,l=Gr["aes256-CBC"],f=M.aes.createEncryptionCipher;break;case"des":o=8,u=8,l=Gr.desCBC,f=M.des.createEncryptionCipher;break;default:var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=r.algorithm,h}var p="hmacWith"+r.prfAlgorithm.toUpperCase(),d=h0(p),m=M.pkcs5.pbkdf2(e,n,i,o,d),g=M.random.getBytesSync(u),y=f(m);y.start(g),y.update(A.toDer(t)),y.finish(),c=y.output.getBytes();var x=T1(n,s,o,p);a=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(Gr.pkcs5PBES2).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(Gr.pkcs5PBKDF2).getBytes()),x]),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(l).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,g)])])])}else if(r.algorithm==="3des"){o=24;var b=new M.util.ByteBuffer(n),m=X.pbe.generatePkcs12Key(e,b,1,i,o),g=X.pbe.generatePkcs12Key(e,b,2,i,o),y=M.des.createEncryptionCipher(m);y.start(g),y.update(A.toDer(t)),y.finish(),c=y.output.getBytes(),a=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(Gr["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,n),A.create(A.Class.UNIVERSAL,A.Type.INTEGER,!1,s.getBytes())])])}else{var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=r.algorithm,h}var I=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[a,A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,c)]);return I};X.decryptPrivateKeyInfo=function(t,e){var r=null,n={},i=[];if(!A.validate(t,I1,n,i)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=A.derToOid(n.encryptionOid),a=X.pbe.getCipher(o,n.encryptionParams,e),c=M.util.createBuffer(n.encryptedData);return a.update(c),a.finish()&&(r=A.fromDer(a.output)),r};X.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:A.toDer(t).getBytes()};return M.pem.encode(r,{maxline:e})};X.encryptedPrivateKeyFromPem=function(t){var e=M.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return A.fromDer(e.body)};X.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=X.wrapRsaPrivateKey(X.privateKeyToAsn1(t));return n=X.encryptPrivateKeyInfo(n,e,r),X.encryptedPrivateKeyToPem(n)}var i,s,o,a;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,s=M.random.getBytesSync(16),a=M.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,s=M.random.getBytesSync(16),a=M.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,s=M.random.getBytesSync(16),a=M.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,s=M.random.getBytesSync(8),a=M.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,s=M.random.getBytesSync(8),a=M.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var u=M.pbe.opensslDeriveBytes(e,s.substr(0,8),o),l=a(u);l.start(s),l.update(A.toDer(X.privateKeyToAsn1(t))),l.finish();var f={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:M.util.bytesToHex(s).toUpperCase()},body:l.output.getBytes()};return M.pem.encode(f)};X.decryptRsaPrivateKey=function(t,e){var r=null,n=M.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,o;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,o=M.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,o=M.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,o=M.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,o=M.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,o=M.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,o=function(f){return M.rc2.createDecryptionCipher(f,40)};break;case"RC2-64-CBC":s=8,o=function(f){return M.rc2.createDecryptionCipher(f,64)};break;case"RC2-128-CBC":s=16,o=function(f){return M.rc2.createDecryptionCipher(f,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var a=M.util.hexToBytes(n.dekInfo.parameters),c=M.pbe.opensslDeriveBytes(e,a.substr(0,8),s),u=o(c);if(u.start(a),u.update(M.util.createBuffer(n.body)),u.finish())r=u.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=X.decryptPrivateKeyInfo(A.fromDer(r),e):r=A.fromDer(r),r!==null&&(r=X.privateKeyFromAsn1(r)),r};X.pbe.generatePkcs12Key=function(t,e,r,n,i,s){var o,a;if(typeof s>"u"||s===null){if(!("sha1"in M.md))throw new Error('"sha1" hash algorithm unavailable.');s=M.md.sha1.create()}var c=s.digestLength,u=s.blockLength,l=new M.util.ByteBuffer,f=new M.util.ByteBuffer;if(t!=null){for(a=0;a=0;a--)ee=ee>>8,ee+=D.at(a)+z.at(a),z.setAt(a,ee&255);W.putBuffer(z)}b=W,l.putBuffer(_)}return l.truncate(l.length()-i),l};X.pbe.getCipher=function(t,e,r){switch(t){case X.oids.pkcs5PBES2:return X.pbe.getCipherForPBES2(t,e,r);case X.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case X.oids["pbewithSHAAnd40BitRC2-CBC"]:return X.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};X.pbe.getCipherForPBES2=function(t,e,r){var n={},i=[];if(!A.validate(e,R1,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}if(t=A.derToOid(n.kdfOid),t!==X.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=A.derToOid(n.encOid),t!==X.oids["aes128-CBC"]&&t!==X.oids["aes192-CBC"]&&t!==X.oids["aes256-CBC"]&&t!==X.oids["des-EDE3-CBC"]&&t!==X.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var o=n.kdfSalt,a=M.util.createBuffer(n.kdfIterationCount);a=a.getInt(a.length()<<3);var c,u;switch(X.oids[t]){case"aes128-CBC":c=16,u=M.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,u=M.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,u=M.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,u=M.des.createDecryptionCipher;break;case"desCBC":c=8,u=M.des.createDecryptionCipher;break}var l=f0(n.prfOid),f=M.pkcs5.pbkdf2(r,o,a,c,l),h=n.encIv,p=u(f);return p.start(h),p};X.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},i=[];if(!A.validate(e,C1,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=M.util.createBuffer(n.salt),a=M.util.createBuffer(n.iterations);a=a.getInt(a.length()<<3);var c,u,l;switch(t){case X.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,u=8,l=M.des.startDecrypting;break;case X.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,u=8,l=function(m,g){var y=M.rc2.createDecryptionCipher(m,40);return y.start(g,null),y};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var f=f0(n.prfOid),h=X.pbe.generatePkcs12Key(r,o,1,a,c,f);f.start();var p=X.pbe.generatePkcs12Key(r,o,2,a,u,f);return l(h,p)};X.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in M.md))throw new Error('"md5" hash algorithm unavailable.');n=M.md.md5.create()}e===null&&(e="");for(var i=[l0(n,t+e)],s=16,o=1;s{var ye=de();$r();Ne();var Ti=wh.exports=ye.sha512=ye.sha512||{};ye.md.sha512=ye.md.algorithms.sha512=Ti;var xh=ye.sha384=ye.sha512.sha384=ye.sha512.sha384||{};xh.create=function(){return Ti.create("SHA-384")};ye.md.sha384=ye.md.algorithms.sha384=xh;ye.sha512.sha256=ye.sha512.sha256||{create:function(){return Ti.create("SHA-512/256")}};ye.md["sha512/256"]=ye.md.algorithms["sha512/256"]=ye.sha512.sha256;ye.sha512.sha224=ye.sha512.sha224||{create:function(){return Ti.create("SHA-512/224")}};ye.md["sha512/224"]=ye.md.algorithms["sha512/224"]=ye.sha512.sha224;Ti.create=function(t){if(bh||j2(),typeof t>"u"&&(t="SHA-512"),!(t in rn))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=rn[t],r=null,n=ye.util.createBuffer(),i=new Array(80),s=0;s<80;++s)i[s]=new Array(2);var o=64;switch(t){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var a={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength128=[];for(var c=a.messageLengthSize/4,u=0;u>>0,l>>>0];for(var f=a.fullMessageLength.length-1;f>=0;--f)a.fullMessageLength[f]+=l[1],l[1]=l[0]+(a.fullMessageLength[f]/4294967296>>>0),a.fullMessageLength[f]=a.fullMessageLength[f]>>>0,l[0]=l[1]/4294967296>>>0;return n.putBytes(c),yh(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),a},a.digest=function(){var c=ye.util.createBuffer();c.putBytes(n.bytes());var u=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize,l=u&a.blockLength-1;c.putBytes(kc.substr(0,a.blockLength-l));for(var f,h,p=a.fullMessageLength[0]*8,d=0;d>>0,p+=h,c.putInt32(p>>>0),p=f>>>0;c.putInt32(p);for(var m=new Array(r.length),d=0;d=128;){for(T=0;T<16;++T)e[T][0]=r.getInt32()>>>0,e[T][1]=r.getInt32()>>>0;for(;T<80;++T)N=e[T-2],k=N[0],L=N[1],n=((k>>>19|L<<13)^(L>>>29|k<<3)^k>>>6)>>>0,i=((k<<13|L>>>19)^(L<<3|k>>>29)^(k<<26|L>>>6))>>>0,U=e[T-15],k=U[0],L=U[1],s=((k>>>1|L<<31)^(k>>>8|L<<24)^k>>>7)>>>0,o=((k<<31|L>>>1)^(k<<24|L>>>8)^(k<<25|L>>>7))>>>0,R=e[T-7],q=e[T-16],L=i+R[1]+o+q[1],e[T][0]=n+R[0]+s+q[0]+(L/4294967296>>>0)>>>0,e[T][1]=L>>>0;for(m=t[0][0],g=t[0][1],y=t[1][0],x=t[1][1],b=t[2][0],I=t[2][1],v=t[3][0],_=t[3][1],P=t[4][0],D=t[4][1],G=t[5][0],W=t[5][1],z=t[6][0],ee=t[6][1],he=t[7][0],He=t[7][1],T=0;T<80;++T)u=((P>>>14|D<<18)^(P>>>18|D<<14)^(D>>>9|P<<23))>>>0,l=((P<<18|D>>>14)^(P<<14|D>>>18)^(D<<23|P>>>9))>>>0,f=(z^P&(G^z))>>>0,h=(ee^D&(W^ee))>>>0,a=((m>>>28|g<<4)^(g>>>2|m<<30)^(g>>>7|m<<25))>>>0,c=((m<<4|g>>>28)^(g<<30|m>>>2)^(g<<25|m>>>7))>>>0,p=(m&y|b&(m^y))>>>0,d=(g&x|I&(g^x))>>>0,L=He+l+h+Oc[T][1]+e[T][1],n=he+u+f+Oc[T][0]+e[T][0]+(L/4294967296>>>0)>>>0,i=L>>>0,L=c+d,s=a+p+(L/4294967296>>>0)>>>0,o=L>>>0,he=z,He=ee,z=G,ee=W,G=P,W=D,L=_+i,P=v+n+(L/4294967296>>>0)>>>0,D=L>>>0,v=b,_=I,b=y,I=x,y=m,x=g,L=i+o,m=n+s+(L/4294967296>>>0)>>>0,g=L>>>0;L=t[0][1]+g,t[0][0]=t[0][0]+m+(L/4294967296>>>0)>>>0,t[0][1]=L>>>0,L=t[1][1]+x,t[1][0]=t[1][0]+y+(L/4294967296>>>0)>>>0,t[1][1]=L>>>0,L=t[2][1]+I,t[2][0]=t[2][0]+b+(L/4294967296>>>0)>>>0,t[2][1]=L>>>0,L=t[3][1]+_,t[3][0]=t[3][0]+v+(L/4294967296>>>0)>>>0,t[3][1]=L>>>0,L=t[4][1]+D,t[4][0]=t[4][0]+P+(L/4294967296>>>0)>>>0,t[4][1]=L>>>0,L=t[5][1]+W,t[5][0]=t[5][0]+G+(L/4294967296>>>0)>>>0,t[5][1]=L>>>0,L=t[6][1]+ee,t[6][0]=t[6][0]+z+(L/4294967296>>>0)>>>0,t[6][1]=L>>>0,L=t[7][1]+He,t[7][0]=t[7][0]+he+(L/4294967296>>>0)>>>0,t[7][1]=L>>>0,H-=128}}});var eu=V((g4,Yh)=>{var $n=1e3,zn=$n*60,Hn=zn*60,on=Hn*24,Ab=on*7,Ib=on*365.25;Yh.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Rb(t);if(r==="number"&&isFinite(t))return e.long?Tb(t):Cb(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Rb(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Ib;case"weeks":case"week":case"w":return r*Ab;case"days":case"day":case"d":return r*on;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Hn;case"minutes":case"minute":case"mins":case"min":case"m":return r*zn;case"seconds":case"second":case"secs":case"sec":case"s":return r*$n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Cb(t){var e=Math.abs(t);return e>=on?Math.round(t/on)+"d":e>=Hn?Math.round(t/Hn)+"h":e>=zn?Math.round(t/zn)+"m":e>=$n?Math.round(t/$n)+"s":t+"ms"}function Tb(t){var e=Math.abs(t);return e>=on?Hs(t,e,on,"day"):e>=Hn?Hs(t,e,Hn,"hour"):e>=zn?Hs(t,e,zn,"minute"):e>=$n?Hs(t,e,$n,"second"):t+" ms"}function Hs(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var Xh=V((y4,Qh)=>{function Bb(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=eu(),r.destroy=u,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h{if(_==="%%")return"%";I++;let D=r.formatters[P];if(typeof D=="function"){let G=g[I];_=D.call(y,G),g.splice(I,1),I--}return _}),r.formatArgs.call(y,g),(y.log||r.log).apply(y,g)}return m.namespace=l,m.useColors=r.useColors(),m.color=r.selectColor(l),m.extend=n,m.destroy=r.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(p!==r.namespaces&&(p=r.namespaces,d=r.enabled(l)),d),set:g=>{h=g}}),typeof r.init=="function"&&r.init(m),m}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),p=h.length;for(f=0;f"-"+f)].join(",");return r.enable(""),l}function o(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f{xt.formatArgs=Pb;xt.save=Db;xt.load=Nb;xt.useColors=Lb;xt.storage=kb();xt.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();xt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Lb(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Pb(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Gs.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}xt.log=console.debug||console.log||(()=>{});function Db(t){try{t?xt.storage.setItem("debug",t):xt.storage.removeItem("debug")}catch{}}function Nb(){let t;try{t=xt.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function kb(){try{return localStorage}catch{}}Gs.exports=Xh()(xt);var{formatters:Ob}=Gs.exports;Ob.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var vd=V((J8,_u)=>{"use strict";var yw=Object.prototype.hasOwnProperty,ct="~";function qi(){}Object.create&&(qi.prototype=Object.create(null),new qi().__proto__||(ct=!1));function xw(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function Ed(t,e,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var s=new xw(r,n||t,i),o=ct?ct+e:e;return t._events[o]?t._events[o].fn?t._events[o]=[t._events[o],s]:t._events[o].push(s):(t._events[o]=s,t._eventsCount++),t}function no(t,e){--t._eventsCount===0?t._events=new qi:delete t._events[e]}function st(){this._events=new qi,this._eventsCount=0}st.prototype.eventNames=function(){var e=[],r,n;if(this._eventsCount===0)return e;for(n in r=this._events)yw.call(r,n)&&e.push(ct?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};st.prototype.listeners=function(e){var r=ct?ct+e:e,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i{"use strict";function Vd(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function kw(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return Vd(t,r)}catch{r.message=t.message,r.stack=t.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(t)),Vd(new i,r)}}$d.exports=kw});var Qd=V(Yi=>{(function(){var t,e,r,n,i,s,o,a;a=function(c){var u,l,f,h;return u=(c&255<<24)>>>24,l=(c&255<<16)>>>16,f=(c&65280)>>>8,h=c&255,[u,l,f,h].join(".")},o=function(c){var u,l,f,h,p,d;for(u=[],f=h=0;h<=3&&c.length!==0;f=++h){if(f>0){if(c[0]!==".")throw new Error("Invalid IP");c=c.substring(1)}d=e(c),p=d[0],l=d[1],c=c.substring(l),u.push(p)}if(c.length!==0)throw new Error("Invalid IP");switch(u.length){case 1:if(u[0]>4294967295)throw new Error("Invalid IP");return u[0]>>>0;case 2:if(u[0]>255||u[1]>16777215)throw new Error("Invalid IP");return(u[0]<<24|u[1])>>>0;case 3:if(u[0]>255||u[1]>255||u[2]>65535)throw new Error("Invalid IP");return(u[0]<<24|u[1]<<16|u[2])>>>0;case 4:if(u[0]>255||u[1]>255||u[2]>255||u[3]>255)throw new Error("Invalid IP");return(u[0]<<24|u[1]<<16|u[2]<<8|u[3])>>>0;default:throw new Error("Invalid IP")}},r=function(c){return c.charCodeAt(0)},n=r("0"),s=r("a"),i=r("A"),e=function(c){var u,l,f,h,p;for(h=0,u=10,l="9",f=0,c.length>1&&c[f]==="0"&&(c[f+1]==="x"||c[f+1]==="X"?(f+=2,u=16):"0"<=c[f+1]&&c[f+1]<="9"&&(f++,u=8,l="7")),p=f;f>>0;else if(u===16)if("a"<=c[f]&&c[f]<="f")h=h*u+(10+r(c[f])-s)>>>0;else if("A"<=c[f]&&c[f]<="F")h=h*u+(10+r(c[f])-i)>>>0;else break;else break;if(h>4294967295)throw new Error("too large");f++}if(f===p)throw new Error("empty octet");return[h,f]},t=function(){function c(u,l){var f,h,p,d;if(typeof u!="string")throw new Error("Missing `net' parameter");if(l||(d=u.split("/",2),u=d[0],l=d[1]),l||(l=32),typeof l=="string"&&l.indexOf(".")>-1){try{this.maskLong=o(l)}catch(m){throw f=m,new Error("Invalid mask: "+l)}for(h=p=32;p>=0;h=--p)if(this.maskLong===4294967295<<32-h>>>0){this.bitmask=h;break}}else if(l||l===0)this.bitmask=parseInt(l,10),this.maskLong=0,this.bitmask>0&&(this.maskLong=4294967295<<32-this.bitmask>>>0);else throw new Error("Invalid mask: empty");try{this.netLong=(o(u)&this.maskLong)>>>0}catch(m){throw f=m,new Error("Invalid net address: "+u)}if(!(this.bitmask<=32))throw new Error("Invalid mask for ip4: "+l);this.size=Math.pow(2,32-this.bitmask),this.base=a(this.netLong),this.mask=a(this.maskLong),this.hostmask=a(~this.maskLong),this.first=this.bitmask<=30?a(this.netLong+1):this.base,this.last=this.bitmask<=30?a(this.netLong+this.size-2):a(this.netLong+this.size-1),this.broadcast=this.bitmask<=30?a(this.netLong+this.size-1):void 0}return c.prototype.contains=function(u){return typeof u=="string"&&(u.indexOf("/")>0||u.split(".").length!==4)&&(u=new c(u)),u instanceof c?this.contains(u.base)&&this.contains(u.broadcast||u.last):(o(u)&this.maskLong)>>>0===(this.netLong&this.maskLong)>>>0},c.prototype.next=function(u){return u==null&&(u=1),new c(a(this.netLong+this.size*u),this.mask)},c.prototype.forEach=function(u){var l,f,h;for(h=o(this.first),f=o(this.last),l=0;h<=f;)u(a(h),h,l),l++,h++},c.prototype.toString=function(){return this.base+"/"+this.bitmask},c}(),Yi.ip2long=o,Yi.long2ip=a,Yi.Netmask=t}).call(Yi)});var Jd=V((jd,Ro)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",o="(?:[0-9a-f]+::?)+",a={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${o})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${o})|(?:::)(?:${o})?)${e}\\.${e}\\.${e}\\.${e}(${s})?$`,"i")};function c(p,d){if(p.indexOf("::")!==p.lastIndexOf("::"))return null;let m=0,g=-1,y=(p.match(a.zoneIndex)||[])[0],x,b;for(y&&(y=y.substring(1),p=p.replace(/%.+$/,""));(g=p.indexOf(":",g+1))>=0;)m++;if(p.substr(0,2)==="::"&&m--,p.substr(-2,2)==="::"&&m--,m>d)return null;for(b=d-m,x=":";b--;)x+="0:";return p=p.replace("::",x),p[0]===":"&&(p=p.slice(1)),p[p.length-1]===":"&&(p=p.slice(0,-1)),d=function(){let I=p.split(":"),v=[];for(let _=0;_0;){if(x=m-g,x<0&&(x=0),p[y]>>x!==d[y]>>x)return!1;g-=m,y+=1}return!0}function l(p){if(i.test(p))return parseInt(p,16);if(p[0]==="0"&&!isNaN(parseInt(p[1],10))){if(n.test(p))return parseInt(p,8);throw new Error(`ipaddr: cannot parse ${p} as octal`)}return parseInt(p,10)}function f(p,d){for(;p.length=0;y-=1)if(x=this.octets[y],x in g){if(b=g[x],m&&b!==0)return null;b!==8&&(m=!0),d+=b}else return null;return 32-d},p.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){return this.octets.slice(0)},p.prototype.toIPv4MappedAddress=function(){return h.IPv6.parse(`::ffff:${this.toString()}`)},p.prototype.toNormalizedString=function(){return this.toString()},p.prototype.toString=function(){return this.octets.join(".")},p}(),h.IPv4.broadcastAddressFromCIDR=function(p){try{let d=this.parseCIDR(p),m=d[0].toByteArray(),g=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),y=[],x=0;for(;x<4;)y.push(parseInt(m[x],10)|parseInt(g[x],10)^255),x++;return new this(y)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.isIPv4=function(p){return this.parser(p)!==null},h.IPv4.isValid=function(p){try{return new this(this.parser(p)),!0}catch{return!1}},h.IPv4.isValidFourPartDecimal=function(p){return!!(h.IPv4.isValid(p)&&p.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},h.IPv4.networkAddressFromCIDR=function(p){let d,m,g,y,x;try{for(d=this.parseCIDR(p),g=d[0].toByteArray(),x=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),y=[],m=0;m<4;)y.push(parseInt(g[m],10)&parseInt(x[m],10)),m++;return new this(y)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.parse=function(p){let d=this.parser(p);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},h.IPv4.parseCIDR=function(p){let d;if(d=p.match(/^(.+)\/(\d+)$/)){let m=parseInt(d[2]);if(m>=0&&m<=32){let g=[this.parse(d[1]),m];return Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},h.IPv4.parser=function(p){let d,m,g;if(d=p.match(r.fourOctet))return function(){let y=d.slice(1,6),x=[];for(let b=0;b4294967295||g<0)throw new Error("ipaddr: address outside defined range");return function(){let y=[],x;for(x=0;x<=24;x+=8)y.push(g>>x&255);return y}().reverse()}else return(d=p.match(r.twoOctet))?function(){let y=d.slice(1,4),x=[];if(g=l(y[1]),g>16777215||g<0)throw new Error("ipaddr: address outside defined range");return x.push(l(y[0])),x.push(g>>16&255),x.push(g>>8&255),x.push(g&255),x}():(d=p.match(r.threeOctet))?function(){let y=d.slice(1,5),x=[];if(g=l(y[2]),g>65535||g<0)throw new Error("ipaddr: address outside defined range");return x.push(l(y[0])),x.push(l(y[1])),x.push(g>>8&255),x.push(g&255),x}():null},h.IPv4.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],m=0,g=Math.floor(p/8);for(;m=0;b-=1)if(y=this.parts[b],y in g){if(x=g[y],m&&x!==0)return null;x!==16&&(m=!0),d+=x}else return null;return 128-d},p.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){let d,m=[],g=this.parts;for(let y=0;y>8),m.push(d&255);return m},p.prototype.toFixedLengthString=function(){let d=function(){let g=[];for(let y=0;y>8,m&255,g>>8,g&255])},p.prototype.toNormalizedString=function(){let d=function(){let g=[];for(let y=0;yy&&(g=x.index,y=x[0].length);return y<0?m:`${m.substring(0,g)}::${m.substring(g+y)}`},p.prototype.toString=function(){return this.toRFC5952String()},p}(),h.IPv6.broadcastAddressFromCIDR=function(p){try{let d=this.parseCIDR(p),m=d[0].toByteArray(),g=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),y=[],x=0;for(;x<16;)y.push(parseInt(m[x],10)|parseInt(g[x],10)^255),x++;return new this(y)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},h.IPv6.isIPv6=function(p){return this.parser(p)!==null},h.IPv6.isValid=function(p){if(typeof p=="string"&&p.indexOf(":")===-1)return!1;try{let d=this.parser(p);return new this(d.parts,d.zoneId),!0}catch{return!1}},h.IPv6.networkAddressFromCIDR=function(p){let d,m,g,y,x;try{for(d=this.parseCIDR(p),g=d[0].toByteArray(),x=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),y=[],m=0;m<16;)y.push(parseInt(g[m],10)&parseInt(x[m],10)),m++;return new this(y)}catch(b){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${b})`)}},h.IPv6.parse=function(p){let d=this.parser(p);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},h.IPv6.parseCIDR=function(p){let d,m,g;if((m=p.match(/^(.+)\/(\d+)$/))&&(d=parseInt(m[2]),d>=0&&d<=128))return g=[this.parse(m[1]),d],Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},h.IPv6.parser=function(p){let d,m,g,y,x,b;if(g=p.match(a.deprecatedTransitional))return this.parser(`::ffff:${g[1]}`);if(a.native.test(p))return c(p,8);if((g=p.match(a.transitional))&&(b=g[6]||"",d=c(g[1].slice(0,-1)+b,6),d.parts)){for(x=[parseInt(g[2]),parseInt(g[3]),parseInt(g[4]),parseInt(g[5])],m=0;m128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m=0,g=Math.floor(p/8);for(;m{"use strict";mp.exports=pp;var rE=eu(),Fr=pp.prototype,nE=new Date%1e9;function iE(){return(Math.random()*1e9>>>0)+nE++}function pp(t){t=t||{},this.id=t.id||iE(),this.max=t.max||1/0,this.items=t.items||[],this._lookup={},this.size=this.items.length,this.lastModified=new Date(t.lastModified||new Date);for(var e,r,n=this.items.length;n--;)e=this.items[n],r=new Date(e.expires)-new Date,this._lookup[e.key]=e,r>0?this.expire(e.key,r):r<=0&&this.delete(e.key)}Fr.has=function(t){return t in this._lookup};Fr.get=function(t){if(!this.has(t))return null;var e=this._lookup[t];return e.refresh&&this.expire(t,e.refresh),this.items.splice(this.items.indexOf(e),1),this.items.push(e),e.value};Fr.meta=function(t){if(!this.has(t))return null;var e=this._lookup[t];return"meta"in e?e.meta:null};Fr.set=function(t,e,r){var n=this._lookup[t],i=this._lookup[t]={key:t,value:e};return this.lastModified=new Date,n?(clearTimeout(n.timeout),this.items.splice(this.items.indexOf(n),1,i)):(this.size>=this.max&&this.delete(this.items[0].key),this.items.push(i),this.size++),r&&("ttl"in r&&this.expire(t,r.ttl),"meta"in r&&(i.meta=r.meta),r.refresh&&(i.refresh=r.ttl)),this};Fr.delete=function(t){var e=this._lookup[t];return e?(this.lastModified=new Date,this.items.splice(this.items.indexOf(e),1),clearTimeout(e.timeout),delete this._lookup[t],this.size--,this):!1};Fr.expire=function(t,e){var r=e||0,n=this._lookup[t];if(!n)return this;if(typeof r=="string"&&(r=rE(e)),typeof r!="number")throw new TypeError("Expiration time must be a string or number.");return clearTimeout(n.timeout),n.timeout=setTimeout(this.delete.bind(this,n.key),r),n.expires=Number(new Date)+r,this};Fr.clear=function(){for(var t=this.items.length;t--;)this.delete(this.items[t].key);return this};Fr.toJSON=function(){for(var t=new Array(this.items.length),e,r=t.length;r--;)e=this.items[r],t[r]={key:e.key,meta:e.meta,value:e.value,expires:e.expires,refresh:e.refresh};return{id:this.id,max:isFinite(this.max)?this.max:void 0,lastModified:this.lastModified,items:t}}});var Ep=V((I3,wp)=>{"use strict";wp.exports=t=>{if(Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}});var Rp=V((Ap,Ip)=>{"use strict";var ko=Ep(),{hasOwnProperty:_p}=Object.prototype,{propertyIsEnumerable:aE}=Object,ni=(t,e,r)=>Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0}),cE=Ap,vp={concatArrays:!1,ignoreUndefined:!1},Oo=t=>{let e=[];for(let r in t)_p.call(t,r)&&e.push(r);if(Object.getOwnPropertySymbols){let r=Object.getOwnPropertySymbols(t);for(let n of r)aE.call(t,n)&&e.push(n)}return e};function ii(t){return Array.isArray(t)?uE(t):ko(t)?lE(t):t}function uE(t){let e=t.slice(0,0);return Oo(t).forEach(r=>{ni(e,r,ii(t[r]))}),e}function lE(t){let e=Object.getPrototypeOf(t)===null?Object.create(null):{};return Oo(t).forEach(r=>{ni(e,r,ii(t[r]))}),e}var Sp=(t,e,r,n)=>(r.forEach(i=>{typeof e[i]>"u"&&n.ignoreUndefined||(i in t&&t[i]!==Object.getPrototypeOf(t)?ni(t,i,ul(t[i],e[i],n)):ni(t,i,ii(e[i])))}),t),fE=(t,e,r)=>{let n=t.slice(0,0),i=0;return[t,e].forEach(s=>{let o=[];for(let a=0;a!o.includes(a)),r)}),n};function ul(t,e,r){return r.concatArrays&&Array.isArray(t)&&Array.isArray(e)?fE(t,e,r):!ko(e)||!ko(t)?ii(e):Sp(t,e,Oo(e),r)}Ip.exports=function(...t){let e=ul(ii(vp),this!==cE&&this||{},vp),r={_:{}};for(let n of t)if(n!==void 0){if(!ko(n))throw new TypeError("`"+n+"` is not an Option Object");r=ul(r,{_:n},e)}return r._}});var ji=V((U3,Lp)=>{Lp.exports=class{constructor(e={}){this.points=e.points,this.duration=e.duration,this.blockDuration=e.blockDuration,this.execEvenly=e.execEvenly,this.execEvenlyMinDelayMs=e.execEvenlyMinDelayMs,this.keyPrefix=e.keyPrefix}get points(){return this._points}set points(e){this._points=e>=0?e:4}get duration(){return this._duration}set duration(e){this._duration=typeof e>"u"?1:e}get msDuration(){return this.duration*1e3}get blockDuration(){return this._blockDuration}set blockDuration(e){this._blockDuration=typeof e>"u"?0:e}get msBlockDuration(){return this.blockDuration*1e3}get execEvenly(){return this._execEvenly}set execEvenly(e){this._execEvenly=typeof e>"u"?!1:!!e}get execEvenlyMinDelayMs(){return this._execEvenlyMinDelayMs}set execEvenlyMinDelayMs(e){this._execEvenlyMinDelayMs=typeof e>"u"?Math.ceil(this.msDuration/this.points):e}get keyPrefix(){return this._keyPrefix}set keyPrefix(e){if(typeof e>"u"&&(e="rlflx"),typeof e!="string")throw new Error("keyPrefix must be string");this._keyPrefix=e}_getKeySecDuration(e={}){return e&&e.customDuration>=0?e.customDuration:this.duration}getKey(e){return this.keyPrefix.length>0?`${this.keyPrefix}:${e}`:e}parseKey(e){return e.substring(this.keyPrefix.length)}consume(){throw new Error("You have to implement the method 'consume'!")}penalty(){throw new Error("You have to implement the method 'penalty'!")}reward(){throw new Error("You have to implement the method 'reward'!")}get(){throw new Error("You have to implement the method 'get'!")}set(){throw new Error("You have to implement the method 'set'!")}block(){throw new Error("You have to implement the method 'block'!")}delete(){throw new Error("You have to implement the method 'delete'!")}}});var Dp=V((K3,Pp)=>{Pp.exports=class{constructor(){this._keys={},this._addedKeysAmount=0}collectExpired(){let e=Date.now();Object.keys(this._keys).forEach(r=>{this._keys[r]<=e&&delete this._keys[r]}),this._addedKeysAmount=Object.keys(this._keys).length}add(e,r){this.addMs(e,r*1e3)}addMs(e,r){this._keys[e]=Date.now()+r,this._addedKeysAmount++,this._addedKeysAmount>999&&this.collectExpired()}msBeforeExpire(e){let r=this._keys[e];if(r&&r>=Date.now()){this.collectExpired();let n=Date.now();return r>=n?r-n:0}return 0}delete(e){e?delete this._keys[e]:Object.keys(this._keys).forEach(r=>{delete this._keys[r]})}}});var kp=V((q3,Np)=>{var dE=Dp();Np.exports=dE});var _t=V(($3,Op)=>{Op.exports=class{constructor(e,r,n,i){this.remainingPoints=typeof e>"u"?0:e,this.msBeforeNext=typeof r>"u"?0:r,this.consumedPoints=typeof n>"u"?0:n,this.isFirstInDuration=typeof i>"u"?!1:i}get msBeforeNext(){return this._msBeforeNext}set msBeforeNext(e){return this._msBeforeNext=e,this}get remainingPoints(){return this._remainingPoints}set remainingPoints(e){return this._remainingPoints=e,this}get consumedPoints(){return this._consumedPoints}set consumedPoints(e){return this._consumedPoints=e,this}get isFirstInDuration(){return this._isFirstInDuration}set isFirstInDuration(e){this._isFirstInDuration=!!e}_getDecoratedProperties(){return{remainingPoints:this.remainingPoints,msBeforeNext:this.msBeforeNext,consumedPoints:this.consumedPoints,isFirstInDuration:this.isFirstInDuration}}[Symbol.for("nodejs.util.inspect.custom")](){return this._getDecoratedProperties()}toString(){return JSON.stringify(this._getDecoratedProperties())}toJSON(){return this._getDecoratedProperties()}}});var si=V((H3,Up)=>{var ll=ji(),pE=kp(),Mp=_t();Up.exports=class extends ll{constructor(e={}){super(e),this.inMemoryBlockOnConsumed=e.inMemoryBlockOnConsumed,this.inMemoryBlockDuration=e.inMemoryBlockDuration,this.insuranceLimiter=e.insuranceLimiter,this._inMemoryBlockedKeys=new pE}get client(){return this._client}set client(e){if(typeof e>"u")throw new Error("storeClient is not set");this._client=e}_afterConsume(e,r,n,i,s,o={}){let a=this._getRateLimiterRes(n,i,s);if(this.inMemoryBlockOnConsumed>0&&!(this.inMemoryBlockDuration>0)&&a.consumedPoints>=this.inMemoryBlockOnConsumed)return this._inMemoryBlockedKeys.addMs(n,a.msBeforeNext),a.consumedPoints>this.points?r(a):e(a);if(a.consumedPoints>this.points){let c=Promise.resolve();this.blockDuration>0&&a.consumedPoints<=this.points+i&&(a.msBeforeNext=this.msBlockDuration,c=this._block(n,a.consumedPoints,this.msBlockDuration,o)),this.inMemoryBlockOnConsumed>0&&a.consumedPoints>=this.inMemoryBlockOnConsumed&&(this._inMemoryBlockedKeys.add(n,this.inMemoryBlockDuration),a.msBeforeNext=this.msInMemoryBlockDuration),c.then(()=>{r(a)}).catch(u=>{r(u)})}else if(this.execEvenly&&a.msBeforeNext>0&&!a.isFirstInDuration){let c=Math.ceil(a.msBeforeNext/(a.remainingPoints+2));c{n(c)}).catch(c=>{i(c)}):i(e)}getInMemoryBlockMsBeforeExpire(e){return this.inMemoryBlockOnConsumed>0?this._inMemoryBlockedKeys.msBeforeExpire(e):0}get inMemoryBlockOnConsumed(){return this._inMemoryBlockOnConsumed}set inMemoryBlockOnConsumed(e){if(this._inMemoryBlockOnConsumed=e?parseInt(e):0,this.inMemoryBlockOnConsumed>0&&this.points>this.inMemoryBlockOnConsumed)throw new Error('inMemoryBlockOnConsumed option must be greater or equal "points" option')}get inMemoryBlockDuration(){return this._inMemoryBlockDuration}set inMemoryBlockDuration(e){if(this._inMemoryBlockDuration=e?parseInt(e):0,this.inMemoryBlockDuration>0&&this.inMemoryBlockOnConsumed===0)throw new Error("inMemoryBlockOnConsumed option must be set up")}get msInMemoryBlockDuration(){return this._inMemoryBlockDuration*1e3}get insuranceLimiter(){return this._insuranceLimiter}set insuranceLimiter(e){if(typeof e<"u"&&!(e instanceof ll))throw new Error("insuranceLimiter must be instance of RateLimiterAbstract");this._insuranceLimiter=e,this._insuranceLimiter&&(this._insuranceLimiter.blockDuration=this.blockDuration,this._insuranceLimiter.execEvenly=this.execEvenly)}block(e,r,n={}){let i=r*1e3;return this._block(this.getKey(e),this.points+1,i,n)}set(e,r,n,i={}){let s=(n>=0?n:this.duration)*1e3;return this._block(this.getKey(e),r,s,i)}consume(e,r=1,n={}){return new Promise((i,s)=>{let o=this.getKey(e),a=this.getInMemoryBlockMsBeforeExpire(o);if(a>0)return s(new Mp(0,a));this._upsert(o,r,this._getKeySecDuration(n)*1e3,!1,n).then(c=>{this._afterConsume(i,s,o,r,c)}).catch(c=>{this._handleError(c,"consume",i,s,e,r,n)})})}penalty(e,r=1,n={}){let i=this.getKey(e);return new Promise((s,o)=>{this._upsert(i,r,this._getKeySecDuration(n)*1e3,!1,n).then(a=>{s(this._getRateLimiterRes(i,r,a))}).catch(a=>{this._handleError(a,"penalty",s,o,e,r,n)})})}reward(e,r=1,n={}){let i=this.getKey(e);return new Promise((s,o)=>{this._upsert(i,-r,this._getKeySecDuration(n)*1e3,!1,n).then(a=>{s(this._getRateLimiterRes(i,-r,a))}).catch(a=>{this._handleError(a,"reward",s,o,e,r,n)})})}get(e,r={}){let n=this.getKey(e);return new Promise((i,s)=>{this._get(n,r).then(o=>{i(o===null||typeof o>"u"?null:this._getRateLimiterRes(n,0,o))}).catch(o=>{this._handleError(o,"get",i,s,e,r)})})}delete(e,r={}){let n=this.getKey(e);return new Promise((i,s)=>{this._delete(n,r).then(o=>{this._inMemoryBlockedKeys.delete(n),i(o)}).catch(o=>{this._handleError(o,"delete",i,s,e,r)})})}deleteInMemoryBlockedAll(){this._inMemoryBlockedKeys.delete()}_getRateLimiterRes(e,r,n){throw new Error("You have to implement the method '_getRateLimiterRes'!")}_block(e,r,n,i={}){return new Promise((s,o)=>{this._upsert(e,r,n,!0,i).then(()=>{s(new Mp(0,n>0?n:-1,r))}).catch(a=>{this._handleError(a,"block",s,o,this.parseKey(e),n/1e3,i)})})}_get(e,r={}){throw new Error("You have to implement the method '_get'!")}_delete(e,r={}){throw new Error("You have to implement the method '_delete'!")}_upsert(e,r,n,i=!1,s={}){throw new Error("You have to implement the method '_upsert'!")}}});var Kp=V((G3,Fp)=>{var mE=si(),gE=_t(),fl="redis.call('set', KEYS[1], 0, 'EX', ARGV[2], 'NX') local consumed = redis.call('incrby', KEYS[1], ARGV[1]) local ttl = redis.call('pttl', KEYS[1]) if ttl == -1 then redis.call('expire', KEYS[1], ARGV[2]) ttl = 1000 * ARGV[2] end return {consumed, ttl} ",hl=class extends mE{constructor(e){super(e),this.client=e.storeClient,this._rejectIfRedisNotReady=!!e.rejectIfRedisNotReady,this.useRedisPackage=e.useRedisPackage||this.client.constructor.name==="Commander"||!1,this.useRedis3AndLowerPackage=e.useRedis3AndLowerPackage,typeof this.client.defineCommand=="function"&&this.client.defineCommand("rlflxIncr",{numberOfKeys:1,lua:fl})}_isRedisReady(){return this._rejectIfRedisNotReady?!(this.client.status&&this.client.status!=="ready"||typeof this.client.isReady=="function"&&!this.client.isReady()):!0}_getRateLimiterRes(e,r,n){let[i,s]=n;Array.isArray(i)&&([,i]=i,[,s]=s);let o=new gE;return o.consumedPoints=parseInt(i),o.isFirstInDuration=o.consumedPoints===r,o.remainingPoints=Math.max(this.points-o.consumedPoints,0),o.msBeforeNext=s,o}async _upsert(e,r,n,i=!1){if(!this._isRedisReady())throw new Error("Redis connection is not ready");let s=Math.floor(n/1e3),o=this.client.multi();return i?(s>0?!this.useRedisPackage&&!this.useRedis3AndLowerPackage?o.set(e,r,"EX",s):o.set(e,r,{EX:s}):o.set(e,r),!this.useRedisPackage&&!this.useRedis3AndLowerPackage?o.pttl(e).exec(!0):o.pTTL(e).exec(!0)):s>0?!this.useRedisPackage&&!this.useRedis3AndLowerPackage?this.client.rlflxIncr([e].concat([String(r),String(s)])):this.useRedis3AndLowerPackage?new Promise((a,c)=>{let u=function(l,f){return l?c(l):a(f)};typeof this.client.rlflxIncr=="function"?this.client.rlflxIncr(e,r,s,u):this.client.eval(fl,1,e,r,s,u)}):this.client.eval(fl,{keys:[e],arguments:[String(r),String(s)]}):!this.useRedisPackage&&!this.useRedis3AndLowerPackage?o.incrby(e,r).pttl(e).exec(!0):o.incrBy(e,r).pTTL(e).exec(!0)}async _get(e){if(!this._isRedisReady())throw new Error("Redis connection is not ready");return!this.useRedisPackage&&!this.useRedis3AndLowerPackage?this.client.multi().get(e).pttl(e).exec().then(r=>{let[[,n]]=r;return n===null?null:r}):this.client.multi().get(e).pTTL(e).exec(!0).then(r=>{let[n]=r;return n===null?null:r})}_delete(e){return this.client.del(e).then(r=>r>0)}};Fp.exports=hl});var $p=V((W3,Vp)=>{var yE=si(),xE=_t();function qp(t){try{let e=t.client?t.client:t,{version:r}=e.topology.s.options.metadata.driver,n=r.split(".").map(i=>parseInt(i));return{major:n[0],feature:n[1],patch:n[2]}}catch{return{major:0,feature:0,patch:0}}}var dl=class t extends yE{constructor(e){super(e),this.dbName=e.dbName,this.tableName=e.tableName,this.indexKeyPrefix=e.indexKeyPrefix,e.mongo?this.client=e.mongo:this.client=e.storeClient,typeof this.client.then=="function"?this.client.then(r=>{this.client=r,this._initCollection(),this._driverVersion=qp(this.client)}):(this._initCollection(),this._driverVersion=qp(this.client))}get dbName(){return this._dbName}set dbName(e){this._dbName=typeof e>"u"?t.getDbName():e}static getDbName(){return"node-rate-limiter-flexible"}get tableName(){return this._tableName}set tableName(e){this._tableName=typeof e>"u"?this.keyPrefix:e}get client(){return this._client}set client(e){if(typeof e>"u")throw new Error("mongo is not set");this._client=e}get indexKeyPrefix(){return this._indexKeyPrefix}set indexKeyPrefix(e){this._indexKeyPrefix=e||{}}_initCollection(){let r=(typeof this.client.db=="function"?this.client.db(this.dbName):this.client).collection(this.tableName);r.createIndex({expire:-1},{expireAfterSeconds:0}),r.createIndex(Object.assign({},this.indexKeyPrefix,{key:1}),{unique:!0}),this._collection=r}_getRateLimiterRes(e,r,n){let i=new xE,s;return typeof n.value>"u"?s=n:s=n.value,i.isFirstInDuration=s.points===r,i.consumedPoints=s.points,i.remainingPoints=Math.max(this.points-i.consumedPoints,0),i.msBeforeNext=s.expire!==null?Math.max(new Date(s.expire).getTime()-Date.now(),0):-1,i}_upsert(e,r,n,i=!1,s={}){if(!this._collection)return Promise.reject(Error("Mongo connection is not established"));let o=s.attrs||{},a,c;i?(a={key:e},a=Object.assign(a,o),c={$set:{key:e,points:r,expire:n>0?new Date(Date.now()+n):null}},c.$set=Object.assign(c.$set,o)):(a={$or:[{expire:{$gt:new Date}},{expire:{$eq:null}}],key:e},a=Object.assign(a,o),c={$setOnInsert:{key:e,expire:n>0?new Date(Date.now()+n):null},$inc:{points:r}},c.$setOnInsert=Object.assign(c.$setOnInsert,o));let u={upsert:!0};return this._driverVersion.major>=4||this._driverVersion.major===3&&this._driverVersion.feature>=7||this._driverVersion.feature>=6&&this._driverVersion.patch>=7?u.returnDocument="after":u.returnOriginal=!1,new Promise((l,f)=>{this._collection.findOneAndUpdate(a,c,u).then(h=>{l(h)}).catch(h=>{if(h&&h.code===11e3){let p=Object.assign({$or:[{expire:{$lte:new Date}},{expire:{$eq:null}}],key:e},o),d={$set:Object.assign({key:e,points:r,expire:n>0?new Date(Date.now()+n):null},o)};this._collection.findOneAndUpdate(p,d,u).then(m=>{l(m)}).catch(m=>{m&&m.code===11e3?this._upsert(e,r,n,i).then(g=>l(g)).catch(g=>f(g)):f(m)})}else f(h)})})}_get(e,r={}){if(!this._collection)return Promise.reject(Error("Mongo connection is not established"));let n=r.attrs||{},i=Object.assign({key:e,$or:[{expire:{$gt:new Date}},{expire:{$eq:null}}]},n);return this._collection.findOne(i)}_delete(e,r={}){if(!this._collection)return Promise.reject(Error("Mongo connection is not established"));let n=r.attrs||{},i=Object.assign({key:e},n);return this._collection.deleteOne(i).then(s=>s.deletedCount>0)}};Vp.exports=dl});var Hp=V((Y3,zp)=>{var bE=si(),wE=_t(),pl=class extends bE{constructor(e,r=null){super(e),this.client=e.storeClient,this.clientType=e.storeType,this.dbName=e.dbName,this.tableName=e.tableName,this.clearExpiredByTimeout=e.clearExpiredByTimeout,this.tableCreated=e.tableCreated,this.tableCreated?(this.clearExpiredByTimeout&&this._clearExpiredHourAgo(),typeof r=="function"&&r()):this._createDbAndTable().then(()=>{this.tableCreated=!0,this.clearExpiredByTimeout&&this._clearExpiredHourAgo(),typeof r=="function"&&r()}).catch(n=>{if(typeof r=="function")r(n);else throw n})}clearExpired(e){return new Promise(r=>{this._getConnection().then(n=>{n.query("DELETE FROM ??.?? WHERE expire < ?",[this.dbName,this.tableName,e],()=>{this._releaseConnection(n),r()})}).catch(()=>{r()})})}_clearExpiredHourAgo(){this._clearExpiredTimeoutId&&clearTimeout(this._clearExpiredTimeoutId),this._clearExpiredTimeoutId=setTimeout(()=>{this.clearExpired(Date.now()-36e5).then(()=>{this._clearExpiredHourAgo()})},3e5),this._clearExpiredTimeoutId.unref()}_getConnection(){switch(this.clientType){case"pool":return new Promise((e,r)=>{this.client.getConnection((n,i)=>{if(n)return r(n);e(i)})});case"sequelize":return this.client.connectionManager.getConnection();case"knex":return this.client.client.acquireConnection();default:return Promise.resolve(this.client)}}_releaseConnection(e){switch(this.clientType){case"pool":return e.release();case"sequelize":return this.client.connectionManager.releaseConnection(e);case"knex":return this.client.client.releaseConnection(e);default:return!0}}_createDbAndTable(){return new Promise((e,r)=>{this._getConnection().then(n=>{n.query(`CREATE DATABASE IF NOT EXISTS \`${this.dbName}\`;`,i=>{if(i)return this._releaseConnection(n),r(i);n.query(this._getCreateTableStmt(),s=>{if(s)return this._releaseConnection(n),r(s);this._releaseConnection(n),e()})})}).catch(n=>{r(n)})})}_getCreateTableStmt(){return`CREATE TABLE IF NOT EXISTS \`${this.dbName}\`.\`${this.tableName}\` (\`key\` VARCHAR(255) CHARACTER SET utf8 NOT NULL,\`points\` INT(9) NOT NULL default 0,\`expire\` BIGINT UNSIGNED,PRIMARY KEY (\`key\`)) ENGINE = INNODB;`}get clientType(){return this._clientType}set clientType(e){if(typeof e>"u")if(this.client.constructor.name==="Connection")e="connection";else if(this.client.constructor.name==="Pool")e="pool";else if(this.client.constructor.name==="Sequelize")e="sequelize";else throw new Error("storeType is not defined");this._clientType=e.toLowerCase()}get dbName(){return this._dbName}set dbName(e){this._dbName=typeof e>"u"?"rtlmtrflx":e}get tableName(){return this._tableName}set tableName(e){this._tableName=typeof e>"u"?this.keyPrefix:e}get tableCreated(){return this._tableCreated}set tableCreated(e){this._tableCreated=typeof e>"u"?!1:!!e}get clearExpiredByTimeout(){return this._clearExpiredByTimeout}set clearExpiredByTimeout(e){this._clearExpiredByTimeout=typeof e>"u"?!0:!!e}_getRateLimiterRes(e,r,n){let i=new wE,[s]=n;return i.isFirstInDuration=r===s.points,i.consumedPoints=i.isFirstInDuration?r:s.points,i.remainingPoints=Math.max(this.points-i.consumedPoints,0),i.msBeforeNext=s.expire?Math.max(s.expire-Date.now(),0):-1,i}_upsertTransaction(e,r,n,i,s){return new Promise((o,a)=>{e.query("BEGIN",c=>{if(c)return e.rollback(),a(c);let u=Date.now(),l=i>0?u+i:null,f,h;s?(f=`INSERT INTO ??.?? VALUES (?, ?, ?) - ON DUPLICATE KEY UPDATE - points = ?, - expire = ?;`,h=[this.dbName,this.tableName,r,n,l,n,l]):(f=`INSERT INTO ??.?? VALUES (?, ?, ?) - ON DUPLICATE KEY UPDATE - points = IF(expire <= ?, ?, points + (?)), - expire = IF(expire <= ?, ?, expire);`,h=[this.dbName,this.tableName,r,n,l,u,n,n,u,l]),e.query(f,h,p=>{if(p)return e.rollback(),a(p);e.query("SELECT points, expire FROM ??.?? WHERE `key` = ?;",[this.dbName,this.tableName,r],(d,m)=>{if(d)return e.rollback(),a(d);e.query("COMMIT",g=>{if(g)return e.rollback(),a(g);o(m)})})})})})}_upsert(e,r,n,i=!1){return this.tableCreated?new Promise((s,o)=>{this._getConnection().then(a=>{this._upsertTransaction(a,e,r,n,i).then(c=>{s(c),this._releaseConnection(a)}).catch(c=>{o(c),this._releaseConnection(a)})}).catch(a=>{o(a)})}):Promise.reject(Error("Table is not created yet"))}_get(e){return this.tableCreated?new Promise((r,n)=>{this._getConnection().then(i=>{i.query("SELECT points, expire FROM ??.?? WHERE `key` = ? AND (`expire` > ? OR `expire` IS NULL)",[this.dbName,this.tableName,e,Date.now()],(s,o)=>{s?n(s):o.length===0?r(null):r(o),this._releaseConnection(i)})}).catch(i=>{n(i)})}):Promise.reject(Error("Table is not created yet"))}_delete(e){return this.tableCreated?new Promise((r,n)=>{this._getConnection().then(i=>{i.query("DELETE FROM ??.?? WHERE `key` = ?",[this.dbName,this.tableName,e],(s,o)=>{s?n(s):r(o.affectedRows>0),this._releaseConnection(i)})}).catch(i=>{n(i)})}):Promise.reject(Error("Table is not created yet"))}};zp.exports=pl});var Wp=V((Q3,Gp)=>{var EE=si(),vE=_t(),ml=class extends EE{constructor(e,r=null){super(e),this.client=e.storeClient,this.clientType=e.storeType,this.tableName=e.tableName,this.schemaName=e.schemaName,this.clearExpiredByTimeout=e.clearExpiredByTimeout,this.tableCreated=e.tableCreated,this.tableCreated?(this.clearExpiredByTimeout&&this._clearExpiredHourAgo(),typeof r=="function"&&r()):this._createTable().then(()=>{this.tableCreated=!0,this.clearExpiredByTimeout&&this._clearExpiredHourAgo(),typeof r=="function"&&r()}).catch(n=>{if(typeof r=="function")r(n);else throw n})}_getTableIdentifier(){return this.schemaName?`"${this.schemaName}"."${this.tableName}"`:`"${this.tableName}"`}clearExpired(e){return new Promise(r=>{let n={name:"rlflx-clear-expired",text:`DELETE FROM ${this._getTableIdentifier()} WHERE expire < $1`,values:[e]};this._query(n).then(()=>{r()}).catch(()=>{r()})})}_clearExpiredHourAgo(){this._clearExpiredTimeoutId&&clearTimeout(this._clearExpiredTimeoutId),this._clearExpiredTimeoutId=setTimeout(()=>{this.clearExpired(Date.now()-36e5).then(()=>{this._clearExpiredHourAgo()})},3e5),this._clearExpiredTimeoutId.unref()}_getConnection(){switch(this.clientType){case"pool":return Promise.resolve(this.client);case"sequelize":return this.client.connectionManager.getConnection();case"knex":return this.client.client.acquireConnection();case"typeorm":return Promise.resolve(this.client.driver.master);default:return Promise.resolve(this.client)}}_releaseConnection(e){switch(this.clientType){case"pool":return!0;case"sequelize":return this.client.connectionManager.releaseConnection(e);case"knex":return this.client.client.releaseConnection(e);case"typeorm":return!0;default:return!0}}_createTable(){return new Promise((e,r)=>{this._query({text:this._getCreateTableStmt()}).then(()=>{e()}).catch(n=>{n.code==="23505"?e():r(n)})})}_getCreateTableStmt(){return`CREATE TABLE IF NOT EXISTS ${this._getTableIdentifier()} ( - key varchar(255) PRIMARY KEY, - points integer NOT NULL DEFAULT 0, - expire bigint - );`}get clientType(){return this._clientType}set clientType(e){let r=this.client.constructor.name;if(typeof e>"u")if(r==="Client")e="client";else if(r==="Pool"||r==="BoundPool")e="pool";else if(r==="Sequelize")e="sequelize";else throw new Error("storeType is not defined");this._clientType=e.toLowerCase()}get tableName(){return this._tableName}set tableName(e){this._tableName=typeof e>"u"?this.keyPrefix:e}get schemaName(){return this._schemaName}set schemaName(e){this._schemaName=e}get tableCreated(){return this._tableCreated}set tableCreated(e){this._tableCreated=typeof e>"u"?!1:!!e}get clearExpiredByTimeout(){return this._clearExpiredByTimeout}set clearExpiredByTimeout(e){this._clearExpiredByTimeout=typeof e>"u"?!0:!!e}_getRateLimiterRes(e,r,n){let i=new vE,s=n.rows[0];return i.isFirstInDuration=r===s.points,i.consumedPoints=i.isFirstInDuration?r:s.points,i.remainingPoints=Math.max(this.points-i.consumedPoints,0),i.msBeforeNext=s.expire?Math.max(s.expire-Date.now(),0):-1,i}_query(e){let n={name:`${this.tableName.toLowerCase()}:${e.name}`,text:e.text,values:e.values};return new Promise((i,s)=>{this._getConnection().then(o=>{o.query(n).then(a=>{i(a),this._releaseConnection(o)}).catch(a=>{s(a),this._releaseConnection(o)})}).catch(o=>{s(o)})})}_upsert(e,r,n,i=!1){if(!this.tableCreated)return Promise.reject(Error("Table is not created yet"));let s=n>0?Date.now()+n:null,o=i?" $3 ":` CASE - WHEN ${this._getTableIdentifier()}.expire <= $4 THEN $3 - ELSE ${this._getTableIdentifier()}.expire - END `;return this._query({name:i?"rlflx-upsert-force":"rlflx-upsert",text:` - INSERT INTO ${this._getTableIdentifier()} VALUES ($1, $2, $3) - ON CONFLICT(key) DO UPDATE SET - points = CASE - WHEN (${this._getTableIdentifier()}.expire <= $4 OR 1=${i?1:0}) THEN $2 - ELSE ${this._getTableIdentifier()}.points + ($2) - END, - expire = ${o} - RETURNING points, expire;`,values:[e,r,s,Date.now()]})}_get(e){return this.tableCreated?new Promise((r,n)=>{this._query({name:"rlflx-get",text:` - SELECT points, expire FROM ${this._getTableIdentifier()} WHERE key = $1 AND (expire > $2 OR expire IS NULL);`,values:[e,Date.now()]}).then(i=>{i.rowCount===0&&(i=null),r(i)}).catch(i=>{n(i)})}):Promise.reject(Error("Table is not created yet"))}_delete(e){return this.tableCreated?this._query({name:"rlflx-delete",text:`DELETE FROM ${this._getTableIdentifier()} WHERE key = $1`,values:[e]}).then(r=>r.rowCount>0):Promise.reject(Error("Table is not created yet"))}};Gp.exports=ml});var Yp=V(()=>{});var Xp=V((J3,Qp)=>{Qp.exports=class{constructor(e,r,n=null){this.value=e,this.expiresAt=r,this.timeoutId=n}get value(){return this._value}set value(e){this._value=parseInt(e)}get expiresAt(){return this._expiresAt}set expiresAt(e){!(e instanceof Date)&&Number.isInteger(e)&&(e=new Date(e)),this._expiresAt=e}get timeoutId(){return this._timeoutId}set timeoutId(e){this._timeoutId=e}}});var jp=V((tB,Zp)=>{var _E=Xp(),gl=_t();Zp.exports=class{constructor(){this._storage={}}incrby(e,r,n){if(this._storage[e]){let i=this._storage[e].expiresAt?this._storage[e].expiresAt.getTime()-new Date().getTime():-1;return i!==0?(this._storage[e].value=this._storage[e].value+r,new gl(0,i,this._storage[e].value,!1)):this.set(e,r,n)}return this.set(e,r,n)}set(e,r,n){let i=n*1e3;return this._storage[e]&&this._storage[e].timeoutId&&clearTimeout(this._storage[e].timeoutId),this._storage[e]=new _E(r,i>0?new Date(Date.now()+i):null),i>0&&(this._storage[e].timeoutId=setTimeout(()=>{delete this._storage[e]},i),this._storage[e].timeoutId.unref&&this._storage[e].timeoutId.unref()),new gl(0,i===0?-1:i,this._storage[e].value,!0)}get(e){if(this._storage[e]){let r=this._storage[e].expiresAt?this._storage[e].expiresAt.getTime()-new Date().getTime():-1;return new gl(0,r,this._storage[e].value,!1)}return null}delete(e){return this._storage[e]?(this._storage[e].timeoutId&&clearTimeout(this._storage[e].timeoutId),delete this._storage[e],!0):!1}}});var xl=V((rB,em)=>{var SE=ji(),AE=jp(),Jp=_t(),yl=class extends SE{constructor(e={}){super(e),this._memoryStorage=new AE}consume(e,r=1,n={}){return new Promise((i,s)=>{let o=this.getKey(e),a=this._getKeySecDuration(n),c=this._memoryStorage.incrby(o,r,a);if(c.remainingPoints=Math.max(this.points-c.consumedPoints,0),c.consumedPoints>this.points)this.blockDuration>0&&c.consumedPoints<=this.points+r&&(c=this._memoryStorage.set(o,c.consumedPoints,this.blockDuration)),s(c);else if(this.execEvenly&&c.msBeforeNext>0&&!c.isFirstInDuration){let u=Math.ceil(c.msBeforeNext/(c.remainingPoints+2));u{let o=this._getKeySecDuration(n),a=this._memoryStorage.incrby(i,r,o);a.remainingPoints=Math.max(this.points-a.consumedPoints,0),s(a)})}reward(e,r=1,n={}){let i=this.getKey(e);return new Promise(s=>{let o=this._getKeySecDuration(n),a=this._memoryStorage.incrby(i,-r,o);a.remainingPoints=Math.max(this.points-a.consumedPoints,0),s(a)})}block(e,r){let n=r*1e3,i=this.points+1;return this._memoryStorage.set(this.getKey(e),i,r),Promise.resolve(new Jp(0,n===0?-1:n,i))}set(e,r,n){let i=(n>=0?n:this.duration)*1e3;return this._memoryStorage.set(this.getKey(e),r,n),Promise.resolve(new Jp(0,i===0?-1:i,r))}get(e){let r=this._memoryStorage.get(this.getKey(e));return r!==null&&(r.remainingPoints=Math.max(this.points-r.consumedPoints,0)),Promise.resolve(r)}delete(e){return Promise.resolve(this._memoryStorage.delete(this.getKey(e)))}};em.exports=yl});var am=V((nB,om)=>{var tm=Yp(),IE=gi(),RE=ji(),nm=xl(),CE=_t(),Ct="rate_limiter_flexible",ci=null,rm=function(t,e,r,n){let i;n===null||n===!0||n===!1?i=n:i={remainingPoints:n.remainingPoints,msBeforeNext:n.msBeforeNext,consumedPoints:n.consumedPoints,isFirstInDuration:n.isFirstInDuration},t.send({channel:Ct,keyPrefix:e.keyPrefix,promiseId:e.promiseId,type:r,data:i})},im=function(t){setTimeout(()=>{this._initiated?process.send(t):typeof this._promises[t.promiseId]<"u"&&im.call(this,t)},30)},oi=function(t,e,r,n,i){let s={channel:Ct,keyPrefix:this.keyPrefix,func:t,promiseId:e,data:{key:r,arg:n,opts:i}};this._initiated?process.send(s):im.call(this,s)},sm=function(t,e){if(!e||e.channel!==Ct||typeof this._rateLimiters[e.keyPrefix]>"u")return!1;let r;switch(e.func){case"consume":r=this._rateLimiters[e.keyPrefix].consume(e.data.key,e.data.arg,e.data.opts);break;case"penalty":r=this._rateLimiters[e.keyPrefix].penalty(e.data.key,e.data.arg,e.data.opts);break;case"reward":r=this._rateLimiters[e.keyPrefix].reward(e.data.key,e.data.arg,e.data.opts);break;case"block":r=this._rateLimiters[e.keyPrefix].block(e.data.key,e.data.arg,e.data.opts);break;case"get":r=this._rateLimiters[e.keyPrefix].get(e.data.key,e.data.opts);break;case"delete":r=this._rateLimiters[e.keyPrefix].delete(e.data.key,e.data.opts);break;default:return!1}r&&r.then(n=>{rm(t,e,"resolve",n)}).catch(n=>{rm(t,e,"reject",n)})},TE=function(t){if(!t||t.channel!==Ct||t.keyPrefix!==this.keyPrefix)return!1;if(this._promises[t.promiseId]){clearTimeout(this._promises[t.promiseId].timeoutId);let e;switch(t.data===null||t.data===!0||t.data===!1?e=t.data:e=new CE(t.data.remainingPoints,t.data.msBeforeNext,t.data.consumedPoints,t.data.isFirstInDuration),t.type){case"resolve":this._promises[t.promiseId].resolve(e);break;case"reject":this._promises[t.promiseId].reject(e);break;default:throw new Error(`RateLimiterCluster: no such message type '${t.type}'`)}delete this._promises[t.promiseId]}},BE=function(){return{points:this.points,duration:this.duration,blockDuration:this.blockDuration,execEvenly:this.execEvenly,execEvenlyMinDelayMs:this.execEvenlyMinDelayMs,keyPrefix:this.keyPrefix}},ai=function(t,e){let r=process.hrtime(),n=r[0].toString()+r[1].toString();return typeof this._promises[n]<"u"&&(n+=IE.randomBytes(12).toString("base64")),this._promises[n]={resolve:t,reject:e,timeoutId:setTimeout(()=>{delete this._promises[n],e(new Error("RateLimiterCluster timeout: no answer from master in time"))},this.timeoutMs)},n},bl=class{constructor(){if(ci)return ci;this._rateLimiters={},tm.setMaxListeners(0),tm.on("message",(e,r)=>{r&&r.channel===Ct&&r.type==="init"?(typeof this._rateLimiters[r.opts.keyPrefix]>"u"&&(this._rateLimiters[r.opts.keyPrefix]=new nm(r.opts)),e.send({channel:Ct,type:"init",keyPrefix:r.opts.keyPrefix})):sm.call(this,e,r)}),ci=this}},wl=class{constructor(e){if(ci)return ci;this._rateLimiters={},e.launchBus((r,n)=>{n.on("process:msg",i=>{let s=i.raw;if(s&&s.channel===Ct&&s.type==="init")typeof this._rateLimiters[s.opts.keyPrefix]>"u"&&(this._rateLimiters[s.opts.keyPrefix]=new nm(s.opts)),e.sendDataToProcessId(i.process.pm_id,{data:{},topic:Ct,channel:Ct,type:"init",keyPrefix:s.opts.keyPrefix},(o,a)=>{o&&console.log(o,a)});else{let o={send:a=>{let c=a;c.topic=Ct,typeof c.data>"u"&&(c.data={}),e.sendDataToProcessId(i.process.pm_id,c,(u,l)=>{u&&console.log(u,l)})}};sm.call(this,o,s)}})}),ci=this}},El=class extends RE{get timeoutMs(){return this._timeoutMs}set timeoutMs(e){this._timeoutMs=typeof e>"u"?5e3:Math.abs(parseInt(e))}constructor(e={}){super(e),process.setMaxListeners(0),this.timeoutMs=e.timeoutMs,this._initiated=!1,process.on("message",r=>{r&&r.channel===Ct&&r.type==="init"&&r.keyPrefix===this.keyPrefix?this._initiated=!0:TE.call(this,r)}),process.send({channel:Ct,type:"init",opts:BE.call(this)}),this._promises={}}consume(e,r=1,n={}){return new Promise((i,s)=>{let o=ai.call(this,i,s);oi.call(this,"consume",o,e,r,n)})}penalty(e,r=1,n={}){return new Promise((i,s)=>{let o=ai.call(this,i,s);oi.call(this,"penalty",o,e,r,n)})}reward(e,r=1,n={}){return new Promise((i,s)=>{let o=ai.call(this,i,s);oi.call(this,"reward",o,e,r,n)})}block(e,r,n={}){return new Promise((i,s)=>{let o=ai.call(this,i,s);oi.call(this,"block",o,e,r,n)})}get(e,r={}){return new Promise((n,i)=>{let s=ai.call(this,n,i);oi.call(this,"get",s,e,r)})}delete(e,r={}){return new Promise((n,i)=>{let s=ai.call(this,n,i);oi.call(this,"delete",s,e,r)})}};om.exports={RateLimiterClusterMaster:bl,RateLimiterClusterMasterPM2:wl,RateLimiterCluster:El}});var um=V((iB,cm)=>{var LE=si(),PE=_t(),vl=class extends LE{constructor(e){super(e),this.client=e.storeClient}_getRateLimiterRes(e,r,n){let i=new PE;return i.consumedPoints=parseInt(n.consumedPoints),i.isFirstInDuration=n.consumedPoints===r,i.remainingPoints=Math.max(this.points-i.consumedPoints,0),i.msBeforeNext=n.msBeforeNext,i}_upsert(e,r,n,i=!1,s={}){return new Promise((o,a)=>{let c=Date.now(),u=Math.floor(n/1e3);i?this.client.set(e,r,u,l=>{l?a(l):this.client.set(`${e}_expire`,u>0?c+u*1e3:-1,u,()=>{let f={consumedPoints:r,msBeforeNext:u>0?u*1e3:-1};o(f)})}):this.client.incr(e,r,(l,f)=>{l||f===!1?this.client.add(e,r,u,(h,p)=>{if(h||!p)if(typeof s.attemptNumber>"u"||s.attemptNumber<3){let d=Object.assign({},s);d.attemptNumber=d.attemptNumber?d.attemptNumber+1:1,this._upsert(e,r,n,i,d).then(m=>o(m)).catch(m=>a(m))}else a(new Error("Can not add key"));else this.client.add(`${e}_expire`,u>0?c+u*1e3:-1,u,()=>{let d={consumedPoints:r,msBeforeNext:u>0?u*1e3:-1};o(d)})}):this.client.get(`${e}_expire`,(h,p)=>{if(h)a(h);else{let d=p===!1?0:p,m={consumedPoints:f,msBeforeNext:d>=0?Math.max(d-c,0):-1};o(m)}})})})}_get(e){return new Promise((r,n)=>{let i=Date.now();this.client.get(e,(s,o)=>{o?this.client.get(`${e}_expire`,(a,c)=>{if(a)n(a);else{let u=c===!1?0:c,l={consumedPoints:o,msBeforeNext:u>=0?Math.max(u-i,0):-1};r(l)}}):r(null)})})}_delete(e){return new Promise((r,n)=>{this.client.del(e,(i,s)=>{i?n(i):s===!1?r(s):this.client.del(`${e}_expire`,o=>{o?n(o):r(s)})})})}};cm.exports=vl});var hm=V((oB,fm)=>{var lm=_t();fm.exports=class{constructor(e={}){this.limiter=e.limiter,this.blackList=e.blackList,this.whiteList=e.whiteList,this.isBlackListed=e.isBlackListed,this.isWhiteListed=e.isWhiteListed,this.runActionAnyway=e.runActionAnyway}get limiter(){return this._limiter}set limiter(e){if(typeof e>"u")throw new Error("limiter is not set");this._limiter=e}get runActionAnyway(){return this._runActionAnyway}set runActionAnyway(e){this._runActionAnyway=typeof e>"u"?!1:e}get blackList(){return this._blackList}set blackList(e){this._blackList=Array.isArray(e)?e:[]}get isBlackListed(){return this._isBlackListed}set isBlackListed(e){if(typeof e>"u"&&(e=()=>!1),typeof e!="function")throw new Error("isBlackListed must be function");this._isBlackListed=e}get whiteList(){return this._whiteList}set whiteList(e){this._whiteList=Array.isArray(e)?e:[]}get isWhiteListed(){return this._isWhiteListed}set isWhiteListed(e){if(typeof e>"u"&&(e=()=>!1),typeof e!="function")throw new Error("isWhiteListed must be function");this._isWhiteListed=e}isBlackListedSomewhere(e){return this.blackList.indexOf(e)>=0||this.isBlackListed(e)}isWhiteListedSomewhere(e){return this.whiteList.indexOf(e)>=0||this.isWhiteListed(e)}getBlackRes(){return new lm(0,Number.MAX_SAFE_INTEGER,0,!1)}getWhiteRes(){return new lm(Number.MAX_SAFE_INTEGER,0,0,!1)}rejectBlack(){return Promise.reject(this.getBlackRes())}resolveBlack(){return Promise.resolve(this.getBlackRes())}resolveWhite(){return Promise.resolve(this.getWhiteRes())}consume(e,r=1){let n;return this.isWhiteListedSomewhere(e)?n=this.resolveWhite():this.isBlackListedSomewhere(e)&&(n=this.rejectBlack()),typeof n>"u"?this.limiter.consume(e,r):(this.runActionAnyway&&this.limiter.consume(e,r).catch(()=>{}),n)}block(e,r){let n;return this.isWhiteListedSomewhere(e)?n=this.resolveWhite():this.isBlackListedSomewhere(e)&&(n=this.resolveBlack()),typeof n>"u"?this.limiter.block(e,r):(this.runActionAnyway&&this.limiter.block(e,r).catch(()=>{}),n)}penalty(e,r){let n;return this.isWhiteListedSomewhere(e)?n=this.resolveWhite():this.isBlackListedSomewhere(e)&&(n=this.resolveBlack()),typeof n>"u"?this.limiter.penalty(e,r):(this.runActionAnyway&&this.limiter.penalty(e,r).catch(()=>{}),n)}reward(e,r){let n;return this.isWhiteListedSomewhere(e)?n=this.resolveWhite():this.isBlackListedSomewhere(e)&&(n=this.resolveBlack()),typeof n>"u"?this.limiter.reward(e,r):(this.runActionAnyway&&this.limiter.reward(e,r).catch(()=>{}),n)}get(e){let r;return this.isWhiteListedSomewhere(e)?r=this.resolveWhite():this.isBlackListedSomewhere(e)&&(r=this.resolveBlack()),typeof r>"u"||this.runActionAnyway?this.limiter.get(e):r}delete(e){return this.limiter.delete(e)}}});var pm=V((cB,dm)=>{var DE=ji();dm.exports=class{constructor(...e){if(e.length<1)throw new Error("RateLimiterUnion: at least one limiter have to be passed");e.forEach(r=>{if(!(r instanceof DE))throw new Error("RateLimiterUnion: all limiters have to be instance of RateLimiterAbstract")}),this._limiters=e}consume(e,r=1){return new Promise((n,i)=>{let s=[];this._limiters.forEach(o=>{s.push(o.consume(e,r).catch(a=>({rejected:!0,rej:a})))}),Promise.all(s).then(o=>{let a={},c=!1;o.forEach(u=>{u.rejected===!0&&(c=!0)});for(let u=0;u{mm.exports=class extends Error{constructor(e,r){super(),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="CustomError",this.message=e,r&&(this.extra=r)}}});var wm=V((hB,bm)=>{var ym=gm(),xm=4294967295,_l="limiter";bm.exports=class{constructor(e,r={maxQueueSize:xm}){this._queueLimiters={KEY_DEFAULT:new Uo(e,r)},this._limiterFlexible=e,this._maxQueueSize=r.maxQueueSize}getTokensRemaining(e=_l){return this._queueLimiters[e]?this._queueLimiters[e].getTokensRemaining():Promise.resolve(this._limiterFlexible.points)}removeTokens(e,r=_l){return this._queueLimiters[r]||(this._queueLimiters[r]=new Uo(this._limiterFlexible,{key:r,maxQueueSize:this._maxQueueSize})),this._queueLimiters[r].removeTokens(e)}};var Uo=class{constructor(e,r={maxQueueSize:xm,key:_l}){this._key=r.key,this._waitTimeout=null,this._queue=[],this._limiterFlexible=e,this._maxQueueSize=r.maxQueueSize}getTokensRemaining(){return this._limiterFlexible.get(this._key).then(e=>e!==null?e.remainingPoints:this._limiterFlexible.points)}removeTokens(e){let r=this;return new Promise((n,i)=>{if(e>r._limiterFlexible.points){i(new ym(`Requested tokens ${e} exceeds maximum ${r._limiterFlexible.points} tokens per interval`));return}r._queue.length>0?r._queueRequest.call(r,n,i,e):r._limiterFlexible.consume(r._key,e).then(s=>{n(s.remainingPoints)}).catch(s=>{s instanceof Error?i(s):(r._queueRequest.call(r,n,i,e),r._waitTimeout===null&&(r._waitTimeout=setTimeout(r._processFIFO.bind(r),s.msBeforeNext)))})})}_queueRequest(e,r,n){let i=this;i._queue.length{r.resolve(n.remainingPoints),e._processFIFO.call(e)}).catch(n=>{n instanceof Error?(r.reject(n),e._processFIFO.call(e)):(e._queue.unshift(r),e._waitTimeout===null&&(e._waitTimeout=setTimeout(e._processFIFO.bind(e),n.msBeforeNext)))})}}});var vm=V((pB,Em)=>{var Sl=_t();Em.exports=class{constructor(e,r){this._rateLimiter=e,this._burstLimiter=r}_combineRes(e,r){return e?new Sl(e.remainingPoints,Math.min(e.msBeforeNext,r?r.msBeforeNext:0),e.consumedPoints,e.isFirstInDuration):null}consume(e,r=1,n={}){return this._rateLimiter.consume(e,r,n).catch(i=>i instanceof Sl?this._burstLimiter.consume(e,r,n).then(s=>Promise.resolve(this._combineRes(i,s))).catch(s=>s instanceof Sl?Promise.reject(this._combineRes(i,s)):Promise.reject(s)):Promise.reject(i))}get(e){return Promise.all([this._rateLimiter.get(e),this._burstLimiter.get(e)]).then(([r,n])=>this._combineRes(r,n))}get points(){return this._rateLimiter.points}}});var Sm=V((mB,_m)=>{var NE=Kp(),kE=$p(),OE=Hp(),ME=Wp(),{RateLimiterClusterMaster:UE,RateLimiterClusterMasterPM2:FE,RateLimiterCluster:KE}=am(),qE=xl(),VE=um(),$E=hm(),zE=pm(),HE=wm(),GE=vm(),WE=_t();_m.exports={RateLimiterRedis:NE,RateLimiterMongo:kE,RateLimiterMySQL:OE,RateLimiterPostgres:ME,RateLimiterMemory:qE,RateLimiterMemcache:VE,RateLimiterClusterMaster:UE,RateLimiterClusterMasterPM2:FE,RateLimiterCluster:KE,RLWrapperBlackAndWhite:$E,RateLimiterUnion:zE,RateLimiterQueue:HE,BurstyRateLimiter:GE,RateLimiterRes:WE}});var Av={};Ke(Av,{createLibp2p:()=>Sv});var t4=ve(mi(),1),r4=ve(p0(),1);var Rn=class t extends Error{code;type;constructor(e="The operation was aborted"){super(e),this.code=t.code,this.type=t.type}static code="ABORT_ERR";static type="aborted"},S=class extends Error{code;props;constructor(e,r,n){super(e),this.code=r,this.name=n?.name??"CodeError",this.props=n??{}}};var vs="ERR_TIMEOUT",m0="ERR_INVALID_PARAMETERS";var Sb=ve(de(),1);function Wr(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}var Fa={};Ke(Fa,{base10:()=>k1});function B1(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,I=new Uint8Array(b);y!==x;){for(var v=d[y],_=0,P=b-1;(v!==0||_>>0,I[P]=v%a>>>0,v=v/a>>>0;if(v!==0)throw new Error("Non-zero carry");g=_,y++}for(var D=b-g;D!==b&&I[D]===0;)D++;for(var G=c.repeat(m);D>>0,b=new Uint8Array(x);d[m];){var I=r[d.charCodeAt(m)];if(I===255)return;for(var v=0,_=x-1;(I!==0||v>>0,b[_]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");y=v,m++}if(d[m]!==" "){for(var P=x-y;P!==x&&b[P]===0;)P++;for(var D=new Uint8Array(g+(x-P)),G=g;P!==x;)D[G++]=b[P++];return D}}}function p(d){var m=h(d);if(m)return m;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:h,decode:p}}var L1=B1,P1=L1,g0=P1;var t_=new Uint8Array(0);var y0=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var x0=t=>new TextEncoder().encode(t),b0=t=>new TextDecoder().decode(t);var ka=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Oa=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return E0(this,e)}},Ma=class{constructor(e){this.decoders=e}or(e){return E0(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},E0=(t,e)=>new Ma({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),Ua=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ka(e,r,n),this.decoder=new Oa(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Cn=({name:t,prefix:e,encode:r,decode:n})=>new Ua(t,e,r,n),wr=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=g0(r,e);return Cn({prefix:t,name:e,encode:n,decode:s=>nr(i(s))})},D1=(t,e,r,n)=>{let i={};for(let l=0;l=8&&(a-=8,o[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},N1=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<Cn({prefix:e,name:t,encode(i){return N1(i,n,r)},decode(i){return D1(i,n,r,t)}});var k1=wr({prefix:"9",name:"base10",alphabet:"0123456789"});var Ka={};Ke(Ka,{base16:()=>O1,base16upper:()=>M1});var O1=Re({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),M1=Re({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var qa={};Ke(qa,{base2:()=>U1});var U1=Re({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Va={};Ke(Va,{base256emoji:()=>$1});var v0=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),F1=v0.reduce((t,e,r)=>(t[r]=e,t),[]),K1=v0.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function q1(t){return t.reduce((e,r)=>(e+=F1[r],e),"")}function V1(t){let e=[];for(let r of t){let n=K1[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var $1=Cn({prefix:"\u{1F680}",name:"base256emoji",encode:q1,decode:V1});var $a={};Ke($a,{base32:()=>pt,base32hex:()=>W1,base32hexpad:()=>Q1,base32hexpadupper:()=>X1,base32hexupper:()=>Y1,base32pad:()=>H1,base32padupper:()=>G1,base32upper:()=>z1,base32z:()=>Z1});var pt=Re({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),z1=Re({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),H1=Re({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),G1=Re({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),W1=Re({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Y1=Re({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Q1=Re({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),X1=Re({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Z1=Re({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var za={};Ke(za,{base36:()=>j1,base36upper:()=>J1});var j1=wr({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),J1=wr({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Ha={};Ke(Ha,{base58btc:()=>_e,base58flickr:()=>ex});var _e=wr({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ex=wr({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Wa={};Ke(Wa,{base64:()=>Tn,base64pad:()=>tx,base64url:()=>Ga,base64urlpad:()=>rx});var Tn=Re({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),tx=Re({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ga=Re({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),rx=Re({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Ya={};Ke(Ya,{base8:()=>nx});var nx=Re({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Qa={};Ke(Qa,{identity:()=>ix});var ix=Cn({prefix:"\0",name:"identity",encode:t=>b0(t),decode:t=>x0(t)});var g_=new TextEncoder,y_=new TextDecoder;var Za={};Ke(Za,{identity:()=>Er});var ax=A0,_0=128,cx=127,ux=~cx,lx=Math.pow(2,31);function A0(t,e,r){e=e||[],r=r||0;for(var n=r;t>=lx;)e[r++]=t&255|_0,t/=128;for(;t&ux;)e[r++]=t&255|_0,t>>>=7;return e[r]=t|0,A0.bytes=r-n+1,e}var fx=Xa,hx=128,S0=127;function Xa(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw Xa.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&S0)<=hx);return Xa.bytes=s-n,r}var dx=Math.pow(2,7),px=Math.pow(2,14),mx=Math.pow(2,21),gx=Math.pow(2,28),yx=Math.pow(2,35),xx=Math.pow(2,42),bx=Math.pow(2,49),wx=Math.pow(2,56),Ex=Math.pow(2,63),vx=function(t){return t[bi.decode(t,e),bi.decode.bytes],Bn=(t,e,r=0)=>(bi.encode(t,e,r),e),Ln=t=>bi.encodingLength(t);var Gt=(t,e)=>{let r=e.byteLength,n=Ln(t),i=n+Ln(r),s=new Uint8Array(i+r);return Bn(t,s,0),Bn(r,s,n),s.set(e,i),new Pn(t,r,e,s)},Yr=t=>{let e=nr(t),[r,n]=wi(e),[i,s]=wi(e.subarray(n)),o=e.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new Pn(r,i,o,e)},I0=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&y0(t.bytes,r.bytes)}},Pn=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var R0=0,Ax="identity",C0=nr,Ix=t=>Gt(R0,C0(t)),Er={code:R0,name:Ax,encode:C0,digest:Ix};var ec={};Ke(ec,{sha256:()=>Ye,sha512:()=>Rx});var Ja=({name:t,code:e,encode:r})=>new ja(t,e,r),ja=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?Gt(this.code,r):r.then(n=>Gt(this.code,n))}else throw Error("Unknown type, must be binary type")}};var B0=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Ye=Ja({name:"sha2-256",code:18,encode:B0("SHA-256")}),Rx=Ja({name:"sha2-512",code:19,encode:B0("SHA-512")});var L0=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return Tx(r,tc(t),e||_e.encoder);default:return Bx(r,tc(t),e||pt.encoder)}};var P0=new WeakMap,tc=t=>{let e=P0.get(t);if(e==null){let r=new Map;return P0.set(t,r),r}return e},Lt=class t{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==Ei)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Lx)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=Gt(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&I0(e.multihash,n.multihash)}toString(e){return L0(this,e)}toJSON(){return{"/":L0(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new t(n,i,s,o||D0(n,i,s.bytes))}else if(r[Px]===!0){let{version:n,multihash:i,code:s}=r,o=Yr(i);return t.create(n,s,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==Ei)throw new Error(`Version 0 CID must use dag-pb (code: ${Ei}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=D0(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,Ei,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=nr(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new Pn(r.multihashCode,r.digestSize,s,i);return[r.version===0?t.createV0(o):t.createV1(r.codec,o),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[f,h]=wi(e.subarray(r));return r+=h,f},i=n(),s=Ei;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),c=n(),u=r+c,l=u-o;return{version:i,codec:s,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,r){let[n,i]=Cx(e,r),s=t.decode(i);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return tc(s).set(n,e),s}},Cx=(t,e)=>{switch(t[0]){case"Q":{let r=e||_e;return[_e.prefix,r.decode(`${_e.prefix}${t}`)]}case _e.prefix:{let r=e||_e;return[_e.prefix,r.decode(t)]}case pt.prefix:{let r=e||pt;return[pt.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},Tx=(t,e,r)=>{let{prefix:n}=r;if(n!==_e.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let s=r.encode(t).slice(1);return e.set(n,s),s}else return i},Bx=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let s=r.encode(t);return e.set(n,s),s}else return i},Ei=112,Lx=18,D0=(t,e,r)=>{let n=Ln(t),i=n+Ln(e),s=new Uint8Array(i+r.byteLength);return Bn(t,s,0),Bn(e,s,n),s.set(r,i),s},Px=Symbol.for("@ipld/js-cid/CID");var vr={...Qa,...qa,...Ya,...Fa,...Ka,...$a,...za,...Ha,...Wa,...Va},D_={...ec,...Za};function ir(t=0){return globalThis.Buffer?.alloc!=null?Wr(globalThis.Buffer.alloc(t)):new Uint8Array(t)}function tt(t=0){return globalThis.Buffer?.allocUnsafe!=null?Wr(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function k0(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var N0=k0("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),rc=k0("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);let e=tt(t.length);for(let r=0;rtn,Ed25519PublicKey:()=>Ci,generateKeyPair:()=>Y2,generateKeyPairFromSeed:()=>ph,unmarshalEd25519PrivateKey:()=>G2,unmarshalEd25519PublicKey:()=>W2});function Se(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function M0(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");O0(t.outputLen),O0(t.blockLen)}function Dn(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function U0(t,e){nc(t);let r=e.outputLen;if(t.lengtht instanceof Uint8Array;var Is=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Pt=(t,e)=>t<<32-e|t>>>e,Nx=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Nx)throw new Error("Non little-endian hardware is not supported");function ic(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function vi(t){if(typeof t=="string"&&(t=ic(t)),!F0(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function Rs(...t){let e=new Uint8Array(t.reduce((n,i)=>n+i.length,0)),r=0;return t.forEach(n=>{if(!F0(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}var Nn=class{clone(){return this._cloneInto()}},W_={}.toString;function Cs(t){let e=n=>t().update(vi(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function kn(t=32){if(As&&typeof As.getRandomValues=="function")return As.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function kx(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,u=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+u,a,n)}var On=class extends Nn{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Is(this.buffer)}update(e){Dn(this);let{view:r,buffer:n,blockLen:i}=this;e=vi(e);let s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let f=o;fl.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f>sc&Ts)}:{h:Number(t>>sc&Ts)|0,l:Number(t&Ts)|0}}function Ox(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),Ux=(t,e,r)=>t>>>r,Fx=(t,e,r)=>t<<32-r|e>>>r,Kx=(t,e,r)=>t>>>r|e<<32-r,qx=(t,e,r)=>t<<32-r|e>>>r,Vx=(t,e,r)=>t<<64-r|e>>>r-32,$x=(t,e,r)=>t>>>r-32|e<<64-r,zx=(t,e)=>e,Hx=(t,e)=>t,Gx=(t,e,r)=>t<>>32-r,Wx=(t,e,r)=>e<>>32-r,Yx=(t,e,r)=>e<>>64-r,Qx=(t,e,r)=>t<>>64-r;function Xx(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var Zx=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),jx=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,Jx=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),e2=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,t2=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),r2=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0;var n2={fromBig:K0,split:Ox,toBig:Mx,shrSH:Ux,shrSL:Fx,rotrSH:Kx,rotrSL:qx,rotrBH:Vx,rotrBL:$x,rotr32H:zx,rotr32L:Hx,rotlSH:Gx,rotlSL:Wx,rotlBH:Yx,rotlBL:Qx,add:Xx,add3L:Zx,add3H:jx,add4L:Jx,add4H:e2,add5H:r2,add5L:t2},Z=n2;var[i2,s2]=Z.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),_r=new Uint32Array(80),Sr=new Uint32Array(80),oc=class extends On{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:u,El:l,Fh:f,Fl:h,Gh:p,Gl:d,Hh:m,Hl:g}=this;return[e,r,n,i,s,o,a,c,u,l,f,h,p,d,m,g]}set(e,r,n,i,s,o,a,c,u,l,f,h,p,d,m,g){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=l|0,this.Fh=f|0,this.Fl=h|0,this.Gh=p|0,this.Gl=d|0,this.Hh=m|0,this.Hl=g|0}process(e,r){for(let b=0;b<16;b++,r+=4)_r[b]=e.getUint32(r),Sr[b]=e.getUint32(r+=4);for(let b=16;b<80;b++){let I=_r[b-15]|0,v=Sr[b-15]|0,_=Z.rotrSH(I,v,1)^Z.rotrSH(I,v,8)^Z.shrSH(I,v,7),P=Z.rotrSL(I,v,1)^Z.rotrSL(I,v,8)^Z.shrSL(I,v,7),D=_r[b-2]|0,G=Sr[b-2]|0,W=Z.rotrSH(D,G,19)^Z.rotrBH(D,G,61)^Z.shrSH(D,G,6),z=Z.rotrSL(D,G,19)^Z.rotrBL(D,G,61)^Z.shrSL(D,G,6),ee=Z.add4L(P,z,Sr[b-7],Sr[b-16]),he=Z.add4H(ee,_,W,_r[b-7],_r[b-16]);_r[b]=he|0,Sr[b]=ee|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:u,Dl:l,Eh:f,El:h,Fh:p,Fl:d,Gh:m,Gl:g,Hh:y,Hl:x}=this;for(let b=0;b<80;b++){let I=Z.rotrSH(f,h,14)^Z.rotrSH(f,h,18)^Z.rotrBH(f,h,41),v=Z.rotrSL(f,h,14)^Z.rotrSL(f,h,18)^Z.rotrBL(f,h,41),_=f&p^~f&m,P=h&d^~h&g,D=Z.add5L(x,v,P,s2[b],Sr[b]),G=Z.add5H(D,y,I,_,i2[b],_r[b]),W=D|0,z=Z.rotrSH(n,i,28)^Z.rotrBH(n,i,34)^Z.rotrBH(n,i,39),ee=Z.rotrSL(n,i,28)^Z.rotrBL(n,i,34)^Z.rotrBL(n,i,39),he=n&s^n&a^s&a,He=i&o^i&c^o&c;y=m|0,x=g|0,m=p|0,g=d|0,p=f|0,d=h|0,{h:f,l:h}=Z.add(u|0,l|0,G|0,W|0),u=a|0,l=c|0,a=s|0,c=o|0,s=n|0,o=i|0;let T=Z.add3L(W,ee,He);n=Z.add3H(T,G,z,he),i=T|0}({h:n,l:i}=Z.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=Z.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=Z.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l}=Z.add(this.Dh|0,this.Dl|0,u|0,l|0),{h:f,l:h}=Z.add(this.Eh|0,this.El|0,f|0,h|0),{h:p,l:d}=Z.add(this.Fh|0,this.Fl|0,p|0,d|0),{h:m,l:g}=Z.add(this.Gh|0,this.Gl|0,m|0,g|0),{h:y,l:x}=Z.add(this.Hh|0,this.Hl|0,y|0,x|0),this.set(n,i,s,o,a,c,u,l,f,h,p,d,m,g,y,x)}roundClean(){_r.fill(0),Sr.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var ac=Cs(()=>new oc);var Ps={};Ke(Ps,{bitGet:()=>h2,bitLen:()=>f2,bitMask:()=>_i,bitSet:()=>d2,bytesToHex:()=>sr,bytesToNumberBE:()=>or,bytesToNumberLE:()=>Ar,concatBytes:()=>ar,createHmacDrbg:()=>lc,ensureBytes:()=>Ce,equalBytes:()=>u2,hexToBytes:()=>Xr,hexToNumber:()=>uc,numberToBytesBE:()=>Ir,numberToBytesLE:()=>Zr,numberToHexUnpadded:()=>$0,numberToVarBytesBE:()=>c2,utf8ToBytes:()=>l2,validateObject:()=>Wt});var V0=BigInt(0),Bs=BigInt(1),o2=BigInt(2),Ls=t=>t instanceof Uint8Array,a2=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function sr(t){if(!Ls(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0)),r=0;return t.forEach(n=>{if(!Ls(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function u2(t,e){if(t.length!==e.length)return!1;for(let r=0;rV0;t>>=Bs,e+=1);return e}function h2(t,e){return t>>BigInt(e)&Bs}var d2=(t,e,r)=>t|(r?Bs:V0)<(o2<new Uint8Array(t),q0=t=>Uint8Array.from(t);function lc(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=cc(t),i=cc(t),s=0,o=()=>{n.fill(1),i.fill(0),s=0},a=(...f)=>r(i,n,...f),c=(f=cc())=>{i=a(q0([0]),f),n=a(),f.length!==0&&(i=a(q0([1]),f),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0,h=[];for(;f{o(),c(f);let p;for(;!(p=h(u()));)c();return o(),p}}var p2={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Wt(t,e,r={}){let n=(i,s,o)=>{let a=p2[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);let c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(let[i,s]of Object.entries(e))n(i,s,!1);for(let[i,s]of Object.entries(r))n(i,s,!0);return t}var Me=BigInt(0),be=BigInt(1),jr=BigInt(2),m2=BigInt(3),fc=BigInt(4),z0=BigInt(5),H0=BigInt(8),g2=BigInt(9),y2=BigInt(16);function pe(t,e){let r=t%e;return r>=Me?r:e+r}function x2(t,e,r){if(r<=Me||e 0");if(r===be)return Me;let n=be;for(;e>Me;)e&be&&(n=n*t%r),t=t*t%r,e>>=be;return n}function we(t,e,r){let n=t;for(;e-- >Me;)n*=n,n%=r;return n}function Ds(t,e){if(t===Me||e<=Me)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=pe(t,e),n=e,i=Me,s=be,o=be,a=Me;for(;r!==Me;){let u=n/r,l=n%r,f=i-o*u,h=s-a*u;n=r,r=l,i=o,s=a,o=f,a=h}if(n!==be)throw new Error("invert: does not exist");return pe(i,e)}function b2(t){let e=(t-be)/jr,r,n,i;for(r=t-be,n=0;r%jr===Me;r/=jr,n++);for(i=jr;i(pe(t,e)&be)===be,E2=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function hc(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=E2.reduce((n,i)=>(n[i]="function",n),e);return Wt(t,r)}function v2(t,e,r){if(r 0");if(r===Me)return t.ONE;if(r===be)return e;let n=t.ONE,i=e;for(;r>Me;)r&be&&(n=t.mul(n,i)),i=t.sqr(i),r>>=be;return n}function _2(t,e){let r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function dc(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Ns(t,e,r=!1,n={}){if(t<=Me)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:s}=dc(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=w2(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:_i(i),ZERO:Me,ONE:be,create:c=>pe(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Me<=c&&cc===Me,isOdd:c=>(c&be)===be,neg:c=>pe(-c,t),eql:(c,u)=>c===u,sqr:c=>pe(c*c,t),add:(c,u)=>pe(c+u,t),sub:(c,u)=>pe(c-u,t),mul:(c,u)=>pe(c*u,t),pow:(c,u)=>v2(a,c,u),div:(c,u)=>pe(c*Ds(u,t),t),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>Ds(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>_2(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>r?Zr(c,s):Ir(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?Ar(c):or(c)}});return Object.freeze(a)}function W0(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}function Y0(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function pc(t){let e=Y0(t);return e+Math.ceil(e/2)}function Q0(t,e,r=!1){let n=t.length,i=Y0(e),s=pc(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let o=r?or(t):Ar(t),a=pe(o,e-be)+be;return r?Zr(a,i):Ir(a,i)}var A2=BigInt(0),mc=BigInt(1);function ks(t,e){let r=(i,s)=>{let o=s.negate();return i?o:s},n=i=>{let s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>A2;)s&mc&&(o=o.add(a)),a=a.double(),s>>=mc;return o},precomputeWindow(i,s){let{windows:o,windowSize:a}=n(s),c=[],u=i,l=u;for(let f=0;f>=p,g>c&&(g-=h,o+=mc);let y=m,x=m+Math.abs(g)-1,b=d%2!==0,I=g<0;g===0?l=l.add(r(b,s[y])):u=u.add(r(I,s[x]))}return{p:u,f:l}},wNAFCached(i,s,o,a){let c=i._WINDOW_SIZE||1,u=s.get(i);return u||(u=this.precomputeWindow(i,c),c!==1&&s.set(i,a(u))),this.wNAF(c,u,o)}}}function Si(t){return hc(t.Fp),Wt(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...dc(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var Dt=BigInt(0),mt=BigInt(1),Os=BigInt(2),I2=BigInt(8),R2={zip215:!0};function C2(t){let e=Si(t);return Wt(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Ms(t){let e=C2(t),{Fp:r,n,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,u=Os<{try{return{isValid:!0,value:r.sqrt(N*r.inv(R))}}catch{return{isValid:!1,value:Dt}}}),h=e.adjustScalarBytes||(N=>N),p=e.domain||((N,R,U)=>{if(R.length||U)throw new Error("Contexts/pre-hash are not supported");return N}),d=N=>typeof N=="bigint"&&Dtd(N)&&d(R)&&NN===Dt||m(N,u);function y(N,R){if(m(N,R))return N;throw new Error(`Expected valid scalar < ${R}, got ${typeof N} ${N}`)}function x(N){return N===Dt?N:y(N,n)}let b=new Map;function I(N){if(!(N instanceof v))throw new Error("ExtendedPoint expected")}class v{constructor(R,U,q,H){if(this.ex=R,this.ey=U,this.ez=q,this.et=H,!g(R))throw new Error("x required");if(!g(U))throw new Error("y required");if(!g(q))throw new Error("z required");if(!g(H))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(R){if(R instanceof v)throw new Error("extended point not allowed");let{x:U,y:q}=R||{};if(!g(U)||!g(q))throw new Error("invalid affine point");return new v(U,q,mt,l(U*q))}static normalizeZ(R){let U=r.invertBatch(R.map(q=>q.ez));return R.map((q,H)=>q.toAffine(U[H])).map(v.fromAffine)}_setWindowSize(R){this._WINDOW_SIZE=R,b.delete(this)}assertValidity(){let{a:R,d:U}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:q,ey:H,ez:j,et:te}=this,le=l(q*q),re=l(H*H),oe=l(j*j),De=l(oe*oe),Ie=l(le*R),Ge=l(oe*l(Ie+re)),We=l(De+l(U*l(le*re)));if(Ge!==We)throw new Error("bad point: equation left != right (1)");let Oe=l(q*H),et=l(j*te);if(Oe!==et)throw new Error("bad point: equation left != right (2)")}equals(R){I(R);let{ex:U,ey:q,ez:H}=this,{ex:j,ey:te,ez:le}=R,re=l(U*le),oe=l(j*H),De=l(q*le),Ie=l(te*H);return re===oe&&De===Ie}is0(){return this.equals(v.ZERO)}negate(){return new v(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){let{a:R}=e,{ex:U,ey:q,ez:H}=this,j=l(U*U),te=l(q*q),le=l(Os*l(H*H)),re=l(R*j),oe=U+q,De=l(l(oe*oe)-j-te),Ie=re+te,Ge=Ie-le,We=re-te,Oe=l(De*Ge),et=l(Ie*We),Jt=l(De*We),qr=l(Ge*Ie);return new v(Oe,et,qr,Jt)}add(R){I(R);let{a:U,d:q}=e,{ex:H,ey:j,ez:te,et:le}=this,{ex:re,ey:oe,ez:De,et:Ie}=R;if(U===BigInt(-1)){let zl=l((j-H)*(oe+re)),Hl=l((j+H)*(oe-re)),ha=l(Hl-zl);if(ha===Dt)return this.double();let Gl=l(te*Os*Ie),Wl=l(le*Os*De),Yl=Wl+Gl,Ql=Hl+zl,Xl=Wl-Gl,Xm=l(Yl*ha),Zm=l(Ql*Xl),jm=l(Yl*Xl),Jm=l(ha*Ql);return new v(Xm,Zm,Jm,jm)}let Ge=l(H*re),We=l(j*oe),Oe=l(le*q*Ie),et=l(te*De),Jt=l((H+j)*(re+oe)-Ge-We),qr=et-Oe,fi=et+Oe,$l=l(We-U*Ge),Gm=l(Jt*qr),Wm=l(fi*$l),Ym=l(Jt*$l),Qm=l(qr*fi);return new v(Gm,Wm,Qm,Ym)}subtract(R){return this.add(R.negate())}wNAF(R){return D.wNAFCached(this,b,R,v.normalizeZ)}multiply(R){let{p:U,f:q}=this.wNAF(y(R,n));return v.normalizeZ([U,q])[0]}multiplyUnsafe(R){let U=x(R);return U===Dt?P:this.equals(P)||U===mt?this:this.equals(_)?this.wNAF(U).p:D.unsafeLadder(this,U)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return D.unsafeLadder(this,n).is0()}toAffine(R){let{ex:U,ey:q,ez:H}=this,j=this.is0();R==null&&(R=j?I2:r.inv(H));let te=l(U*R),le=l(q*R),re=l(H*R);if(j)return{x:Dt,y:mt};if(re!==mt)throw new Error("invZ was invalid");return{x:te,y:le}}clearCofactor(){let{h:R}=e;return R===mt?this:this.multiplyUnsafe(R)}static fromHex(R,U=!1){let{d:q,a:H}=e,j=r.BYTES;R=Ce("pointHex",R,j);let te=R.slice(),le=R[j-1];te[j-1]=le&-129;let re=Ar(te);re===Dt||(U?y(re,u):y(re,r.ORDER));let oe=l(re*re),De=l(oe-mt),Ie=l(q*oe-H),{isValid:Ge,value:We}=f(De,Ie);if(!Ge)throw new Error("Point.fromHex: invalid y coordinate");let Oe=(We&mt)===mt,et=(le&128)!==0;if(!U&&We===Dt&&et)throw new Error("Point.fromHex: x=0 and x_0=1");return et!==Oe&&(We=l(-We)),v.fromAffine({x:We,y:re})}static fromPrivateKey(R){return z(R).point}toRawBytes(){let{x:R,y:U}=this.toAffine(),q=Zr(U,r.BYTES);return q[q.length-1]|=R&mt?128:0,q}toHex(){return sr(this.toRawBytes())}}v.BASE=new v(e.Gx,e.Gy,mt,l(e.Gx*e.Gy)),v.ZERO=new v(Dt,mt,mt,Dt);let{BASE:_,ZERO:P}=v,D=ks(v,a*8);function G(N){return pe(N,n)}function W(N){return G(Ar(N))}function z(N){let R=a;N=Ce("private key",N,R);let U=Ce("hashed private key",s(N),2*R),q=h(U.slice(0,R)),H=U.slice(R,2*R),j=W(q),te=_.multiply(j),le=te.toRawBytes();return{head:q,prefix:H,scalar:j,point:te,pointBytes:le}}function ee(N){return z(N).pointBytes}function he(N=new Uint8Array,...R){let U=ar(...R);return W(s(p(U,Ce("context",N),!!i)))}function He(N,R,U={}){N=Ce("message",N),i&&(N=i(N));let{prefix:q,scalar:H,pointBytes:j}=z(R),te=he(U.context,q,N),le=_.multiply(te).toRawBytes(),re=he(U.context,le,j,N),oe=G(te+re*H);x(oe);let De=ar(le,Zr(oe,r.BYTES));return Ce("result",De,a*2)}let T=R2;function k(N,R,U,q=T){let{context:H,zip215:j}=q,te=r.BYTES;N=Ce("signature",N,2*te),R=Ce("message",R),i&&(R=i(R));let le=Ar(N.slice(te,2*te)),re,oe,De;try{re=v.fromHex(U,j),oe=v.fromHex(N.slice(0,te),j),De=_.multiplyUnsafe(le)}catch{return!1}if(!j&&re.isSmallOrder())return!1;let Ie=he(H,oe.toRawBytes(),re.toRawBytes(),R);return oe.add(re.multiplyUnsafe(Ie)).subtract(De).clearCofactor().equals(v.ZERO)}return _._setWindowSize(8),{CURVE:e,getPublicKey:ee,sign:He,verify:k,ExtendedPoint:v,utils:{getExtendedPublicKey:z,randomPrivateKey:()=>o(r.BYTES),precompute(N=8,R=v.BASE){return R._setWindowSize(N),R.multiply(BigInt(3)),R}}}}var yc=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),X0=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),mS=BigInt(0),T2=BigInt(1),gc=BigInt(2),B2=BigInt(5),Z0=BigInt(10),L2=BigInt(20),P2=BigInt(40),j0=BigInt(80);function D2(t){let e=yc,n=t*t%e*t%e,i=we(n,gc,e)*n%e,s=we(i,T2,e)*t%e,o=we(s,B2,e)*s%e,a=we(o,Z0,e)*o%e,c=we(a,L2,e)*a%e,u=we(c,P2,e)*c%e,l=we(u,j0,e)*u%e,f=we(l,j0,e)*u%e,h=we(f,Z0,e)*o%e;return{pow_p_5_8:we(h,gc,e)*t%e,b2:n}}function N2(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function k2(t,e){let r=yc,n=pe(e*e*e,r),i=pe(n*n*e,r),s=D2(t*i).pow_p_5_8,o=pe(t*n*s,r),a=pe(e*o*o,r),c=o,u=pe(o*X0,r),l=a===t,f=a===pe(-t,r),h=a===pe(-t*X0,r);return l&&(o=c),(f||h)&&(o=u),G0(o,r)&&(o=pe(-o,r)),{isValid:l||f,value:o}}var cr=Ns(yc,void 0,!0),xc={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:cr,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:ac,randomBytes:kn,adjustScalarBytes:N2,uvRatio:k2},Mn=Ms(xc);function J0(t,e,r){if(e.length>255)throw new Error("Context is too big");return Rs(ic("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,e.length]),e,t)}var gS=Ms({...xc,domain:J0}),yS=Ms({...xc,domain:J0,prehash:ac});var O2=(cr.ORDER+BigInt(3))/BigInt(8),xS=cr.pow(gc,O2),bS=cr.sqrt(cr.neg(cr.ONE)),wS=(cr.ORDER-BigInt(5))/BigInt(8),ES=BigInt(486662);var vS=W0(cr,cr.neg(BigInt(486664)));var _S=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),SS=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),AS=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),IS=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var RS=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Un=32,ur=64,Us=32;async function eh(){let t=Mn.utils.randomPrivateKey(),e=Mn.getPublicKey(t);return{privateKey:ih(t,e),publicKey:e}}async function th(t){if(t.length!==Us)throw new TypeError('"seed" must be 32 bytes in length.');if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');let e=t,r=Mn.getPublicKey(e);return{privateKey:ih(e,r),publicKey:r}}async function rh(t,e){let r=t.subarray(0,Us);return Mn.sign(e,r)}async function nh(t,e,r){return Mn.verify(e,r,t)}function ih(t,e){let r=new Uint8Array(ur);for(let n=0;ni+s.length,0));let r=tt(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return Wr(r)}var ft={get(t=globalThis){let e=t.crypto;if(e==null||e.subtle==null)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p/blob/main/packages/crypto/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return e}};var bc={alg:"A128GCM",ext:!0,k:"scm9jmO_4BJAgdwWGVulLg",key_ops:["encrypt","decrypt"],kty:"oct"};function wc(t){let e=t?.algorithm??"AES-GCM",r=t?.keyLength??16,n=t?.nonceLength??12,i=t?.digest??"SHA-256",s=t?.saltLength??16,o=t?.iterations??32767,a=ft.get();r*=8;async function c(f,h){let p=a.getRandomValues(new Uint8Array(s)),d=a.getRandomValues(new Uint8Array(n)),m={name:e,iv:d};typeof h=="string"&&(h=Q(h));let g;if(h.length===0){g=await a.subtle.importKey("jwk",bc,{name:"AES-GCM"},!0,["encrypt"]);try{let x={name:"PBKDF2",salt:p,iterations:o,hash:{name:i}},b=await a.subtle.importKey("raw",h,{name:"PBKDF2"},!1,["deriveKey"]);g=await a.subtle.deriveKey(x,b,{name:e,length:r},!0,["encrypt"])}catch{g=await a.subtle.importKey("jwk",bc,{name:"AES-GCM"},!0,["encrypt"])}}else{let x={name:"PBKDF2",salt:p,iterations:o,hash:{name:i}},b=await a.subtle.importKey("raw",h,{name:"PBKDF2"},!1,["deriveKey"]);g=await a.subtle.deriveKey(x,b,{name:e,length:r},!0,["encrypt"])}let y=await a.subtle.encrypt(m,g,f);return Te([p,m.iv,new Uint8Array(y)])}async function u(f,h){let p=f.subarray(0,s),d=f.subarray(s,s+n),m=f.subarray(s+n),g={name:e,iv:d};typeof h=="string"&&(h=Q(h));let y;if(h.length===0)try{let b={name:"PBKDF2",salt:p,iterations:o,hash:{name:i}},I=await a.subtle.importKey("raw",h,{name:"PBKDF2"},!1,["deriveKey"]);y=await a.subtle.deriveKey(b,I,{name:e,length:r},!0,["decrypt"])}catch{y=await a.subtle.importKey("jwk",bc,{name:"AES-GCM"},!0,["decrypt"])}else{let b={name:"PBKDF2",salt:p,iterations:o,hash:{name:i}},I=await a.subtle.importKey("raw",h,{name:"PBKDF2"},!1,["deriveKey"]);y=await a.subtle.deriveKey(b,I,{name:e,length:r},!0,["decrypt"])}let x=await a.subtle.decrypt(g,y,m);return new Uint8Array(x)}return{encrypt:c,decrypt:u}}async function Fn(t,e){let n=await wc().encrypt(t,e);return Tn.encode(n)}var Ec=new Float32Array([-0]),Rr=new Uint8Array(Ec.buffer);function oh(t,e,r){Ec[0]=t,e[r]=Rr[0],e[r+1]=Rr[1],e[r+2]=Rr[2],e[r+3]=Rr[3]}function ah(t,e){return Rr[0]=t[e],Rr[1]=t[e+1],Rr[2]=t[e+2],Rr[3]=t[e+3],Ec[0]}var vc=new Float64Array([-0]),rt=new Uint8Array(vc.buffer);function ch(t,e,r){vc[0]=t,e[r]=rt[0],e[r+1]=rt[1],e[r+2]=rt[2],e[r+3]=rt[3],e[r+4]=rt[4],e[r+5]=rt[5],e[r+6]=rt[6],e[r+7]=rt[7]}function uh(t,e){return rt[0]=t[e],rt[1]=t[e+1],rt[2]=t[e+2],rt[3]=t[e+3],rt[4]=t[e+4],rt[5]=t[e+5],rt[6]=t[e+6],rt[7]=t[e+7],vc[0]}var U2=BigInt(Number.MAX_SAFE_INTEGER),F2=BigInt(Number.MIN_SAFE_INTEGER),ht=class t{lo;hi;constructor(e,r){this.lo=e|0,this.hi=r|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return Jr;if(eF2)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,i=e-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>lh&&(i=0n,++n>lh&&(n=0n))),new t(Number(i),Number(n))}static fromNumber(e){if(e===0)return Jr;let r=e<0;r&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new t(n,i)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):Jr}},Jr=new ht(0,0);Jr.toBigInt=function(){return 0n};Jr.zzEncode=Jr.zzDecode=function(){return this};Jr.length=function(){return 1};var lh=4294967296n;function fh(t){let e=0,r=0;for(let n=0;n191&&a<224?s[o++]=(a&31)<<6|t[e++]&63:a>239&&a<365?(a=((a&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,s[o++]=55296+(a>>10),s[o++]=56320+(a&1023)):s[o++]=(a&15)<<12|(t[e++]&63)<<6|t[e++]&63,o>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,s)),o=0);return i!=null?(o>0&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))}function _c(t,e,r){let n=r,i,s;for(let o=0;o>6|192,e[r++]=i&63|128):(i&64512)===55296&&((s=t.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(s&1023),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128);return r-n}function Nt(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Fs(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var Sc=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,Nt(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw Nt(this,4);return Fs(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw Nt(this,4);return Fs(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw Nt(this,4);let e=ah(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw Nt(this,4);let e=uh(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw Nt(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return hh(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw Nt(this,e);this.pos+=e}else do if(this.pos>=this.len)throw Nt(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new ht(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw Nt(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw Nt(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw Nt(this,8);let e=Fs(this.buf,this.pos+=4),r=Fs(this.buf,this.pos+=4);return new ht(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Ac(t){return new Sc(t instanceof Uint8Array?t:t.subarray())}function Qe(t,e){let r=Ac(t);return e.decode(r)}function Ic(t){let e=t??8192,r=e>>>1,n,i=e;return function(o){if(o<1||o>r)return tt(o);i+o>e&&(n=tt(e),i=0);let a=n.subarray(i,i+=o);return i&7&&(i=(i|7)+1),a}}var en=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function Rc(){}var Tc=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},K2=Ic();function q2(t){return globalThis.Buffer!=null?tt(t):K2(t)}var Ri=class{len;head;tail;states;constructor(){this.len=0,this.head=new en(Rc,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new en(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new Bc((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(Ai,10,ht.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=ht.fromBigInt(e);return this._push(Ai,r.length(),r)}uint64Number(e){let r=ht.fromNumber(e);return this._push(Ai,r.length(),r)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=ht.fromBigInt(e).zzEncode();return this._push(Ai,r.length(),r)}sint64Number(e){let r=ht.fromNumber(e).zzEncode();return this._push(Ai,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(Cc,1,e?1:0)}fixed32(e){return this._push(Ii,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=ht.fromBigInt(e);return this._push(Ii,4,r.lo)._push(Ii,4,r.hi)}fixed64Number(e){let r=ht.fromNumber(e);return this._push(Ii,4,r.lo)._push(Ii,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(oh,4,e)}double(e){return this._push(ch,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(Cc,1,0):this.uint32(r)._push($2,r,e)}string(e){let r=fh(e);return r!==0?this.uint32(r)._push(_c,r,e):this._push(Cc,1,0)}fork(){return this.states=new Tc(this),this.head=this.tail=new en(Rc,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new en(Rc,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=q2(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function Cc(t,e,r){e[r]=t&255}function V2(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var Bc=class extends en{next;constructor(e,r){super(V2,e,r),this.next=void 0}};function Ai(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function Ii(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function $2(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(Ri.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(z2,e,t),this},Ri.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(H2,e,t),this});function z2(t,e,r){e.set(t,r)}function H2(t,e,r){t.length<40?_c(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(Q(t),r)}function Lc(){return new Ri}function Xe(t,e){let r=Lc();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var Kn;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(Kn||(Kn={}));function Ks(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function Pc(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(s,o){let a=e(s);o.int32(a)},n=function(s){let o=s.int32();return e(o)};return Ks("enum",Kn.VARINT,r,n)}function Ze(t,e){return Ks("message",Kn.LENGTH_DELIMITED,t,e)}var Ee;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.Secp256k1="Secp256k1"})(Ee||(Ee={}));var Dc;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.Secp256k1=2]="Secp256k1"})(Dc||(Dc={}));(function(t){t.codec=()=>Pc(Dc)})(Ee||(Ee={}));var Yt;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),Ee.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=Ee.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(Yt||(Yt={}));var Qt;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),Ee.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=Ee.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(Qt||(Qt={}));var Ci=class{_key;constructor(e){this._key=qn(e,Un)}async verify(e,r){return nh(this._key,r,e)}marshal(){return this._key}get bytes(){return Yt.encode({Type:Ee.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}},tn=class{_key;_publicKey;constructor(e,r){this._key=qn(e,ur),this._publicKey=qn(r,Un)}async sign(e){return rh(this._key,e)}get public(){return new Ci(this._publicKey)}marshal(){return this._key}get bytes(){return Qt.encode({Type:Ee.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}async id(){let e=Er.digest(this.public.bytes);return _e.encode(e.bytes).substring(1)}async export(e,r="libp2p-key"){if(r==="libp2p-key")return Fn(this.bytes,e);throw new S(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function G2(t){if(t.length>ur){t=qn(t,ur+Un);let n=t.subarray(0,ur),i=t.subarray(ur,t.length);return new tn(n,i)}t=qn(t,ur);let e=t.subarray(0,ur),r=t.subarray(Un);return new tn(e,r)}function W2(t){return t=qn(t,Un),new Ci(t)}async function Y2(){let{privateKey:t,publicKey:e}=await eh();return new tn(t,e)}async function ph(t){let{privateKey:e,publicKey:r}=await th(t);return new tn(e,r)}function qn(t,e){if(t=Uint8Array.from(t??[]),t.length!==e)throw new S(`Key must be a Uint8Array of length ${e}, got ${t.length}`,"ERR_INVALID_KEY_TYPE");return t}function se(t,e="utf8"){let r=Ss[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var _A=ve(Ne(),1),SA=ve(xs(),1),mh=ve(de(),1);function kt(t,e){let r=Uint8Array.from(t.abs().toByteArray());if(r=r[0]===0?r.subarray(1):r,e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Te([new Uint8Array(e-r.length),r])}return se(r,"base64url")}function gt(t){let e=gh(t);return new mh.default.jsbn.BigInteger(se(e,"base16"),16)}function gh(t,e){let r=Q(t,"base64urlpad");if(e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Te([new Uint8Array(e-r.length),r])}return r}var Q2={"P-256":256,"P-384":384,"P-521":521},X2=Object.keys(Q2),kA=X2.join(" / ");var Fc={};Ke(Fc,{MAX_KEY_SIZE:()=>Pi,RsaPrivateKey:()=>Vn,RsaPublicKey:()=>Li,fromJwk:()=>ab,generateKeyPair:()=>cb,unmarshalRsaPrivateKey:()=>sb,unmarshalRsaPublicKey:()=>ob});var Bi=ve(de(),1);var bI=ve(Eh(),1);function Vs(t){if(isNaN(t)||t<=0)throw new S("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return kn(t)}var tI=ve(Es(),1),Mc=ve(de(),1);function vh(t,e){return e.map(r=>gt(t[r]))}function _h(t){return Mc.default.pki.setRsaPrivateKey(...vh(t,["n","e","d","p","q","dp","dq","qi"]))}function Sh(t){return Mc.default.pki.setRsaPublicKey(...vh(t,["n","e"]))}var nn={};Ke(nn,{jwkToPkcs1:()=>eb,jwkToPkix:()=>rb,pkcs1ToJwk:()=>J2,pkixToJwk:()=>tb});var iI=ve(mi(),1),sI=ve(Es(),1);var lr=ve(de(),1);function J2(t){let e=lr.default.asn1.fromDer(se(t,"ascii")),r=lr.default.pki.privateKeyFromAsn1(e);return{kty:"RSA",n:kt(r.n),e:kt(r.e),d:kt(r.d),p:kt(r.p),q:kt(r.q),dp:kt(r.dP),dq:kt(r.dQ),qi:kt(r.qInv),alg:"RS256"}}function eb(t){if(t.n==null||t.e==null||t.d==null||t.p==null||t.q==null||t.dp==null||t.dq==null||t.qi==null)throw new S("JWK was missing components","ERR_INVALID_PARAMETERS");let e=lr.default.pki.privateKeyToAsn1({n:gt(t.n),e:gt(t.e),d:gt(t.d),p:gt(t.p),q:gt(t.q),dP:gt(t.dp),dQ:gt(t.dq),qInv:gt(t.qi)});return Q(lr.default.asn1.toDer(e).getBytes(),"ascii")}function tb(t){let e=lr.default.asn1.fromDer(se(t,"ascii")),r=lr.default.pki.publicKeyFromAsn1(e);return{kty:"RSA",n:kt(r.n),e:kt(r.e)}}function rb(t){if(t.n==null||t.e==null)throw new S("JWK was missing components","ERR_INVALID_PARAMETERS");let e=lr.default.pki.publicKeyToAsn1({n:gt(t.n),e:gt(t.e)});return Q(lr.default.asn1.toDer(e).getBytes(),"ascii")}async function Ah(t){let e=await ft.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await Ch(e);return{privateKey:r[0],publicKey:r[1]}}async function Uc(t){let r=[await ft.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await nb(t)],n=await Ch({privateKey:r[0],publicKey:r[1]});return{privateKey:n[0],publicKey:n[1]}}async function Ih(t,e){let r=await ft.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),n=await ft.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(e));return new Uint8Array(n,0,n.byteLength)}async function Rh(t,e,r){let n=await ft.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return ft.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},n,e,r)}async function Ch(t){if(t.privateKey==null||t.publicKey==null)throw new S("Private and public key are required","ERR_INVALID_PARAMETERS");return Promise.all([ft.get().subtle.exportKey("jwk",t.privateKey),ft.get().subtle.exportKey("jwk",t.publicKey)])}async function nb(t){return ft.get().subtle.importKey("jwk",{kty:t.kty,n:t.n,e:t.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}function Th(t,e,r,n){let i=e?Sh(t):_h(t),s=se(Uint8Array.from(r),"ascii"),o=n(s,i);return Q(o,"ascii")}function Bh(t,e){return Th(t,!0,e,(r,n)=>n.encrypt(r))}function Lh(t,e){return Th(t,!1,e,(r,n)=>n.decrypt(r))}function $s(t){if(t.kty!=="RSA")throw new S("invalid key type","ERR_INVALID_KEY_TYPE");if(t.n==null)throw new S("invalid key modulus","ERR_INVALID_KEY_MODULUS");return Q(t.n,"base64url").length*8}var Pi=8192,Li=class{_key;constructor(e){this._key=e}async verify(e,r){return Rh(this._key,r,e)}marshal(){return nn.jwkToPkix(this._key)}get bytes(){return Yt.encode({Type:Ee.RSA,Data:this.marshal()}).subarray()}encrypt(e){return Bh(this._key,e)}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}},Vn=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r}genSecret(){return Vs(16)}async sign(e){return Ih(this._key,e)}get public(){if(this._publicKey==null)throw new S("public key not provided","ERR_PUBKEY_NOT_PROVIDED");return new Li(this._publicKey)}decrypt(e){return Lh(this._key,e)}marshal(){return nn.jwkToPkcs1(this._key)}get bytes(){return Qt.encode({Type:Ee.RSA,Data:this.marshal()}).subarray()}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}async id(){let e=await this.public.hash();return se(e,"base58btc")}async export(e,r="pkcs-8"){if(r==="pkcs-8"){let n=new Bi.default.util.ByteBuffer(this.marshal()),i=Bi.default.asn1.fromDer(n),s=Bi.default.pki.privateKeyFromAsn1(i),o={algorithm:"aes256",count:1e4,saltSize:128/8,prfAlgorithm:"sha512"};return Bi.default.pki.encryptRsaPrivateKey(s,e,o)}else{if(r==="libp2p-key")return Fn(this.bytes,e);throw new S(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}}};async function sb(t){let e=nn.pkcs1ToJwk(t);if($s(e)>Pi)throw new S("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let r=await Uc(e);return new Vn(r.privateKey,r.publicKey)}function ob(t){let e=nn.pkixToJwk(t);if($s(e)>Pi)throw new S("key size is too large","ERR_KEY_SIZE_TOO_LARGE");return new Li(e)}async function ab(t){if($s(t)>Pi)throw new S("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await Uc(t);return new Vn(e.privateKey,e.publicKey)}async function cb(t){if(t>Pi)throw new S("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await Ah(t);return new Vn(e.privateKey,e.publicKey)}var Hc={};Ke(Hc,{Secp256k1PrivateKey:()=>Ni,Secp256k1PublicKey:()=>Di,generateKeyPair:()=>_b,unmarshalSecp256k1PrivateKey:()=>Eb,unmarshalSecp256k1PublicKey:()=>vb});var ub=(t,e,r)=>t&e^~t&r,lb=(t,e,r)=>t&e^t&r^e&r,fb=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Cr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Tr=new Uint32Array(64),Kc=class extends On{constructor(){super(64,32,8,!1),this.A=Cr[0]|0,this.B=Cr[1]|0,this.C=Cr[2]|0,this.D=Cr[3]|0,this.E=Cr[4]|0,this.F=Cr[5]|0,this.G=Cr[6]|0,this.H=Cr[7]|0}get(){let{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let f=0;f<16;f++,r+=4)Tr[f]=e.getUint32(r,!1);for(let f=16;f<64;f++){let h=Tr[f-15],p=Tr[f-2],d=Pt(h,7)^Pt(h,18)^h>>>3,m=Pt(p,17)^Pt(p,19)^p>>>10;Tr[f]=m+Tr[f-7]+d+Tr[f-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:u,H:l}=this;for(let f=0;f<64;f++){let h=Pt(a,6)^Pt(a,11)^Pt(a,25),p=l+h+ub(a,c,u)+fb[f]+Tr[f]|0,m=(Pt(n,2)^Pt(n,13)^Pt(n,22))+lb(n,i,s)|0;l=u,u=c,c=a,a=o+p|0,o=s,s=i,i=n,n=p+m|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,i,s,o,a,c,u,l)}roundClean(){Tr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Ph=Cs(()=>new Kc);function hb(t){let e=Si(t);Wt(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:db,hexToBytes:pb}=Ps,sn={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){let{Err:e}=sn;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:db(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=sn,r=typeof t=="string"?pb(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:s}=sn._parseInt(r.subarray(2)),{d:o,l:a}=sn._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){let e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,r=u=>{let l=u.toString(16);return l.length&1?`0${l}`:l},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},fr=BigInt(0),It=BigInt(1),CI=BigInt(2),Dh=BigInt(3),TI=BigInt(4);function mb(t){let e=hb(t),{Fp:r}=e,n=e.toBytes||((d,m,g)=>{let y=m.toAffine();return ar(Uint8Array.from([4]),r.toBytes(y.x),r.toBytes(y.y))}),i=e.fromBytes||(d=>{let m=d.subarray(1),g=r.fromBytes(m.subarray(0,r.BYTES)),y=r.fromBytes(m.subarray(r.BYTES,2*r.BYTES));return{x:g,y}});function s(d){let{a:m,b:g}=e,y=r.sqr(d),x=r.mul(y,d);return r.add(r.add(x,r.mul(d,m)),g)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(d){return typeof d=="bigint"&&frr.eql(b,r.ZERO);return x(g)&&x(y)?f.ZERO:new f(g,y,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){let g=r.invertBatch(m.map(y=>y.pz));return m.map((y,x)=>y.toAffine(g[x])).map(f.fromAffine)}static fromHex(m){let g=f.fromAffine(i(Ce("pointHex",m)));return g.assertValidity(),g}static fromPrivateKey(m){return f.BASE.multiply(c(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:m,y:g}=this.toAffine();if(!r.isValid(m)||!r.isValid(g))throw new Error("bad point: x or y not FE");let y=r.sqr(g),x=s(m);if(!r.eql(y,x))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:m}=this.toAffine();if(r.isOdd)return!r.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){l(m);let{px:g,py:y,pz:x}=this,{px:b,py:I,pz:v}=m,_=r.eql(r.mul(g,v),r.mul(b,x)),P=r.eql(r.mul(y,v),r.mul(I,x));return _&&P}negate(){return new f(this.px,r.neg(this.py),this.pz)}double(){let{a:m,b:g}=e,y=r.mul(g,Dh),{px:x,py:b,pz:I}=this,v=r.ZERO,_=r.ZERO,P=r.ZERO,D=r.mul(x,x),G=r.mul(b,b),W=r.mul(I,I),z=r.mul(x,b);return z=r.add(z,z),P=r.mul(x,I),P=r.add(P,P),v=r.mul(m,P),_=r.mul(y,W),_=r.add(v,_),v=r.sub(G,_),_=r.add(G,_),_=r.mul(v,_),v=r.mul(z,v),P=r.mul(y,P),W=r.mul(m,W),z=r.sub(D,W),z=r.mul(m,z),z=r.add(z,P),P=r.add(D,D),D=r.add(P,D),D=r.add(D,W),D=r.mul(D,z),_=r.add(_,D),W=r.mul(b,I),W=r.add(W,W),D=r.mul(W,z),v=r.sub(v,D),P=r.mul(W,G),P=r.add(P,P),P=r.add(P,P),new f(v,_,P)}add(m){l(m);let{px:g,py:y,pz:x}=this,{px:b,py:I,pz:v}=m,_=r.ZERO,P=r.ZERO,D=r.ZERO,G=e.a,W=r.mul(e.b,Dh),z=r.mul(g,b),ee=r.mul(y,I),he=r.mul(x,v),He=r.add(g,y),T=r.add(b,I);He=r.mul(He,T),T=r.add(z,ee),He=r.sub(He,T),T=r.add(g,x);let k=r.add(b,v);return T=r.mul(T,k),k=r.add(z,he),T=r.sub(T,k),k=r.add(y,x),_=r.add(I,v),k=r.mul(k,_),_=r.add(ee,he),k=r.sub(k,_),D=r.mul(G,T),_=r.mul(W,he),D=r.add(_,D),_=r.sub(ee,D),D=r.add(ee,D),P=r.mul(_,D),ee=r.add(z,z),ee=r.add(ee,z),he=r.mul(G,he),T=r.mul(W,T),ee=r.add(ee,he),he=r.sub(z,he),he=r.mul(G,he),T=r.add(T,he),z=r.mul(ee,T),P=r.add(P,z),z=r.mul(k,T),_=r.mul(He,_),_=r.sub(_,z),z=r.mul(He,ee),D=r.mul(k,D),D=r.add(D,z),new f(_,P,D)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return p.wNAFCached(this,u,m,g=>{let y=r.invertBatch(g.map(x=>x.pz));return g.map((x,b)=>x.toAffine(y[b])).map(f.fromAffine)})}multiplyUnsafe(m){let g=f.ZERO;if(m===fr)return g;if(a(m),m===It)return this;let{endo:y}=e;if(!y)return p.unsafeLadder(this,m);let{k1neg:x,k1:b,k2neg:I,k2:v}=y.splitScalar(m),_=g,P=g,D=this;for(;b>fr||v>fr;)b&It&&(_=_.add(D)),v&It&&(P=P.add(D)),D=D.double(),b>>=It,v>>=It;return x&&(_=_.negate()),I&&(P=P.negate()),P=new f(r.mul(P.px,y.beta),P.py,P.pz),_.add(P)}multiply(m){a(m);let g=m,y,x,{endo:b}=e;if(b){let{k1neg:I,k1:v,k2neg:_,k2:P}=b.splitScalar(g),{p:D,f:G}=this.wNAF(v),{p:W,f:z}=this.wNAF(P);D=p.constTimeNegate(I,D),W=p.constTimeNegate(_,W),W=new f(r.mul(W.px,b.beta),W.py,W.pz),y=D.add(W),x=G.add(z)}else{let{p:I,f:v}=this.wNAF(g);y=I,x=v}return f.normalizeZ([y,x])[0]}multiplyAndAddUnsafe(m,g,y){let x=f.BASE,b=(v,_)=>_===fr||_===It||!v.equals(x)?v.multiplyUnsafe(_):v.multiply(_),I=b(this,g).add(b(m,y));return I.is0()?void 0:I}toAffine(m){let{px:g,py:y,pz:x}=this,b=this.is0();m==null&&(m=b?r.ONE:r.inv(x));let I=r.mul(g,m),v=r.mul(y,m),_=r.mul(x,m);if(b)return{x:r.ZERO,y:r.ZERO};if(!r.eql(_,r.ONE))throw new Error("invZ was invalid");return{x:I,y:v}}isTorsionFree(){let{h:m,isTorsionFree:g}=e;if(m===It)return!0;if(g)return g(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:m,clearCofactor:g}=e;return m===It?this:g?g(f,this):this.multiplyUnsafe(e.h)}toRawBytes(m=!0){return this.assertValidity(),n(f,this,m)}toHex(m=!0){return sr(this.toRawBytes(m))}}f.BASE=new f(e.Gx,e.Gy,r.ONE),f.ZERO=new f(r.ZERO,r.ONE,r.ZERO);let h=e.nBitLength,p=ks(f,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function gb(t){let e=Si(t);return Wt(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Nh(t){let e=gb(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(T){return frsr(Ir(T,e.nByteLength));function d(T){let k=n>>It;return T>k}function m(T){return d(T)?a(-T):T}let g=(T,k,L)=>or(T.slice(k,L));class y{constructor(k,L,N){this.r=k,this.s=L,this.recovery=N,this.assertValidity()}static fromCompact(k){let L=e.nByteLength;return k=Ce("compactSignature",k,L*2),new y(g(k,0,L),g(k,L,2*L))}static fromDER(k){let{r:L,s:N}=sn.toSig(Ce("DER",k));return new y(L,N)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(k){return new y(this.r,this.s,k)}recoverPublicKey(k){let{r:L,s:N,recovery:R}=this,U=P(Ce("msgHash",k));if(R==null||![0,1,2,3].includes(R))throw new Error("recovery id invalid");let q=R===2||R===3?L+e.n:L;if(q>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let H=R&1?"03":"02",j=u.fromHex(H+p(q)),te=c(q),le=a(-U*te),re=a(N*te),oe=u.BASE.multiplyAndAddUnsafe(j,le,re);if(!oe)throw new Error("point at infinify");return oe.assertValidity(),oe}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Xr(this.toDERHex())}toDERHex(){return sn.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Xr(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}let x={isValidPrivateKey(T){try{return l(T),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{let T=pc(e.n);return Q0(e.randomBytes(T),e.n)},precompute(T=8,k=u.BASE){return k._setWindowSize(T),k.multiply(BigInt(3)),k}};function b(T,k=!0){return u.fromPrivateKey(T).toRawBytes(k)}function I(T){let k=T instanceof Uint8Array,L=typeof T=="string",N=(k||L)&&T.length;return k?N===i||N===s:L?N===2*i||N===2*s:T instanceof u}function v(T,k,L=!0){if(I(T))throw new Error("first arg must be private key");if(!I(k))throw new Error("second arg must be public key");return u.fromHex(k).multiply(l(T)).toRawBytes(L)}let _=e.bits2int||function(T){let k=or(T),L=T.length*8-e.nBitLength;return L>0?k>>BigInt(L):k},P=e.bits2int_modN||function(T){return a(_(T))},D=_i(e.nBitLength);function G(T){if(typeof T!="bigint")throw new Error("bigint expected");if(!(fr<=T&&TIe in L))throw new Error("sign() legacy options not supported");let{hash:N,randomBytes:R}=e,{lowS:U,prehash:q,extraEntropy:H}=L;U==null&&(U=!0),T=Ce("msgHash",T),q&&(T=Ce("prehashed msgHash",N(T)));let j=P(T),te=l(k),le=[G(te),G(j)];if(H!=null){let Ie=H===!0?R(r.BYTES):H;le.push(Ce("extraEntropy",Ie))}let re=ar(...le),oe=j;function De(Ie){let Ge=_(Ie);if(!h(Ge))return;let We=c(Ge),Oe=u.BASE.multiply(Ge).toAffine(),et=a(Oe.x);if(et===fr)return;let Jt=a(We*a(oe+et*te));if(Jt===fr)return;let qr=(Oe.x===et?0:2)|Number(Oe.y&It),fi=Jt;return U&&d(Jt)&&(fi=m(Jt),qr^=1),new y(et,fi,qr)}return{seed:re,k2sig:De}}let z={lowS:e.lowS,prehash:!1},ee={lowS:e.lowS,prehash:!1};function he(T,k,L=z){let{seed:N,k2sig:R}=W(T,k,L),U=e;return lc(U.hash.outputLen,U.nByteLength,U.hmac)(N,R)}u.BASE._setWindowSize(8);function He(T,k,L,N=ee){let R=T;if(k=Ce("msgHash",k),L=Ce("publicKey",L),"strict"in N)throw new Error("options.strict was renamed to lowS");let{lowS:U,prehash:q}=N,H,j;try{if(typeof R=="string"||R instanceof Uint8Array)try{H=y.fromDER(R)}catch(Oe){if(!(Oe instanceof sn.Err))throw Oe;H=y.fromCompact(R)}else if(typeof R=="object"&&typeof R.r=="bigint"&&typeof R.s=="bigint"){let{r:Oe,s:et}=R;H=new y(Oe,et)}else throw new Error("PARSE");j=u.fromHex(L)}catch(Oe){if(Oe.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(U&&H.hasHighS())return!1;q&&(k=e.hash(k));let{r:te,s:le}=H,re=P(k),oe=c(le),De=a(re*oe),Ie=a(te*oe),Ge=u.BASE.multiplyAndAddUnsafe(j,De,Ie)?.toAffine();return Ge?a(Ge.x)===te:!1}return{CURVE:e,getPublicKey:b,getSharedSecret:v,sign:he,verify:He,ProjectivePoint:u,Signature:y,utils:x}}var zs=class extends Nn{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,M0(e);let n=vi(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew zs(t,e).update(r).digest();qc.create=(t,e)=>new zs(t,e);function yb(t){return{hash:t,hmac:(e,...r)=>qc(t,e,Rs(...r)),randomBytes:kn}}function kh(t,e){let r=n=>Nh({...t,...yb(n)});return Object.freeze({...r(e),create:r})}var Uh=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Oh=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),xb=BigInt(1),Vc=BigInt(2),Mh=(t,e)=>(t+e/Vc)/e;function bb(t){let e=Uh,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=t*t*t%e,l=u*u*t%e,f=we(l,r,e)*l%e,h=we(f,r,e)*l%e,p=we(h,Vc,e)*u%e,d=we(p,i,e)*p%e,m=we(d,s,e)*d%e,g=we(m,a,e)*m%e,y=we(g,c,e)*g%e,x=we(y,a,e)*m%e,b=we(x,r,e)*l%e,I=we(b,o,e)*d%e,v=we(I,n,e)*u%e,_=we(v,Vc,e);if(!$c.eql($c.sqr(_),t))throw new Error("Cannot find square root");return _}var $c=Ns(Uh,void 0,void 0,{sqrt:bb}),hr=kh({a:BigInt(0),b:BigInt(7),Fp:$c,n:Oh,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=Oh,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-xb*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=Mh(s*t,e),c=Mh(-n*t,e),u=pe(t-a*r-c*i,e),l=pe(-a*n-c*s,e),f=u>o,h=l>o;if(f&&(u=e-u),h&&(l=e-l),u>o||l>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:u,k2neg:h,k2:l}}}},Ph),qI=BigInt(0);var VI=hr.ProjectivePoint;function Fh(){return hr.utils.randomPrivateKey()}async function Kh(t,e){let{digest:r}=await Ye.digest(e);try{return hr.sign(r,t).toDERRawBytes()}catch(n){throw new S(String(n),"ERR_INVALID_INPUT")}}async function qh(t,e,r){try{let{digest:n}=await Ye.digest(r);return hr.verify(e,n,t)}catch(n){throw new S(String(n),"ERR_INVALID_INPUT")}}function Vh(t){return hr.ProjectivePoint.fromHex(t).toRawBytes(!0)}function $h(t){try{hr.getPublicKey(t,!0)}catch(e){throw new S(String(e),"ERR_INVALID_PRIVATE_KEY")}}function zc(t){try{hr.ProjectivePoint.fromHex(t)}catch(e){throw new S(String(e),"ERR_INVALID_PUBLIC_KEY")}}function zh(t){try{return hr.getPublicKey(t,!0)}catch(e){throw new S(String(e),"ERR_INVALID_PRIVATE_KEY")}}var Di=class{_key;constructor(e){zc(e),this._key=e}async verify(e,r){return qh(this._key,r,e)}marshal(){return Vh(this._key)}get bytes(){return Yt.encode({Type:Ee.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}},Ni=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r??zh(e),$h(this._key),zc(this._publicKey)}async sign(e){return Kh(this._key,e)}get public(){return new Di(this._publicKey)}marshal(){return this._key}get bytes(){return Qt.encode({Type:Ee.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}async id(){let e=await this.public.hash();return se(e,"base58btc")}async export(e,r="libp2p-key"){if(r==="libp2p-key")return Fn(this.bytes,e);throw new S(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function Eb(t){return new Ni(t)}function vb(t){return new Di(t)}async function _b(){let t=Fh();return new Ni(t)}var Br={rsa:Fc,ed25519:Nc,secp256k1:Hc};function Gc(t){let e=Object.keys(Br).join(" / ");return new S(`invalid or unsupported key type ${t}. Must be ${e}`,"ERR_UNSUPPORTED_KEY_TYPE")}function Wc(t){if(t=t.toLowerCase(),t==="rsa"||t==="ed25519"||t==="secp256k1")return Br[t];throw Gc(t)}async function Hh(t,e){return Wc(t).generateKeyPair(e??2048)}function ki(t){let e=Yt.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case Ee.RSA:return Br.rsa.unmarshalRsaPublicKey(r);case Ee.Ed25519:return Br.ed25519.unmarshalEd25519PublicKey(r);case Ee.Secp256k1:return Br.secp256k1.unmarshalSecp256k1PublicKey(r);default:throw Gc(e.Type??"unknown")}}function Gh(t,e){return e=(e??"rsa").toLowerCase(),Wc(e),t.bytes}async function Yc(t){let e=Qt.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case Ee.RSA:return Br.rsa.unmarshalRsaPrivateKey(r);case Ee.Ed25519:return Br.ed25519.unmarshalEd25519PrivateKey(r);case Ee.Secp256k1:return Br.secp256k1.unmarshalSecp256k1PrivateKey(r);default:throw Gc(e.Type??"RSA")}}function Wh(t,e){return e=(e??"rsa").toLowerCase(),Wc(e),t.bytes}var Qc=Symbol.for("@libp2p/content-routing");var Oi=class extends EventTarget{#e=new Map;listenerCount(e){let r=this.#e.get(e);return r==null?0:r.length}addEventListener(e,r,n){super.addEventListener(e,r,n);let i=this.#e.get(e);i==null&&(i=[],this.#e.set(e,i)),i.push({callback:r,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(e,r,n){super.removeEventListener(e.toString(),r??null,n);let i=this.#e.get(e);i!=null&&(i=i.filter(({callback:s})=>s!==r),this.#e.set(e,i))}dispatchEvent(e){let r=super.dispatchEvent(e),n=this.#e.get(e.type);return n==null||(n=n.filter(({once:i})=>!i),this.#e.set(e.type,n)),r}safeDispatchEvent(e,r){return this.dispatchEvent(new Zc(e,r))}},Xc=class extends Event{detail;constructor(e,r){super(e,r),this.detail=r?.detail}},Zc=globalThis.CustomEvent??Xc;var yt=(t,...e)=>{try{[...e]}catch{}};var jc=Symbol.for("@libp2p/peer-discovery");var Jc=Symbol.for("@libp2p/peer-routing");var bt=ve(tu(),1);bt.default.formatters.b=t=>t==null?"undefined":_e.baseEncode(t);bt.default.formatters.t=t=>t==null?"undefined":pt.baseEncode(t);bt.default.formatters.m=t=>t==null?"undefined":Tn.baseEncode(t);bt.default.formatters.p=t=>t==null?"undefined":t.toString();bt.default.formatters.c=t=>t==null?"undefined":t.toString();bt.default.formatters.k=t=>t==null?"undefined":t.toString();bt.default.formatters.a=t=>t==null?"undefined":t.toString();function Mb(t){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=t,e.destroy=()=>!0,e.extend=()=>e,e}function Ws(){return{forComponent(t){return Ub(t)}}}function Ub(t){let e=Mb(`${t}:trace`);return bt.default.enabled(`${t}:trace`)&&bt.default.names.map(r=>r.toString()).find(r=>r.includes(":trace"))!=null&&(e=(0,bt.default)(`${t}:trace`)),Object.assign((0,bt.default)(t),{error:(0,bt.default)(`${t}:error`),trace:e})}var ru=Symbol.for("@libp2p/peer-id");function Ys(t){return t!=null&&!!t[ru]}var Fb=Symbol.for("nodejs.util.inspect.custom"),Zh=Object.values(vr).map(t=>t.decoder).reduce((t,e)=>t.or(e),vr.identity.decoder),jh=114,nu=36,iu=37,Mi=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[ru]=!0;toString(){return this.string==null&&(this.string=_e.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return Lt.createV1(jh,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return Se(this.multihash.bytes,e);if(typeof e=="string")return ce(e).equals(this);if(e?.multihash?.bytes!=null)return Se(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[Fb](){return`PeerId(${this.toString()})`}},an=class extends Mi{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},cn=class extends Mi{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},un=class extends Mi{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function Jh(t){if(t.type==="RSA")return new an(t);if(t.type==="Ed25519")return new cn(t);if(t.type==="secp256k1")return new un(t);throw new S("Not a PeerId","ERR_INVALID_PARAMETERS")}function ce(t,e){if(e=e??Zh,t.charAt(0)==="1"||t.charAt(0)==="Q"){let r=Yr(_e.decode(`z${t}`));return t.startsWith("12D")?new cn({multihash:r}):t.startsWith("16U")?new un({multihash:r}):new an({multihash:r})}return Gn(Zh.decode(t))}function Gn(t){try{let e=Yr(t);if(e.code===Er.code){if(e.digest.length===nu)return new cn({multihash:e});if(e.digest.length===iu)return new un({multihash:e})}if(e.code===Ye.code)return new an({multihash:e})}catch{return Kb(Lt.decode(t))}throw new Error("Supplied PeerID CID is invalid")}function Kb(t){if(t==null||t.multihash==null||t.version==null||t.version===1&&t.code!==jh)throw new Error("Supplied PeerID CID is invalid");let e=t.multihash;if(e.code===Ye.code)return new an({multihash:t.multihash});if(e.code===Er.code){if(e.digest.length===nu)return new cn({multihash:t.multihash});if(e.digest.length===iu)return new un({multihash:t.multihash})}throw new Error("Supplied PeerID CID is invalid")}async function Qs(t,e){return t.length===nu?new cn({multihash:Gt(Er.code,t),privateKey:e}):t.length===iu?new un({multihash:Gt(Er.code,t),privateKey:e}):new an({multihash:await Ye.digest(t),publicKey:t,privateKey:e})}function dr(t,e){let r={[Symbol.iterator]:()=>r,next:()=>{let n=t.next(),i=n.value;return n.done===!0||i==null?{done:!0,value:void 0}:{done:!1,value:e(i)}}};return r}var wt=class{map;constructor(e){if(this.map=new Map,e!=null)for(let[r,n]of e.entries())this.map.set(r.toString(),n)}[Symbol.iterator](){return this.entries()}clear(){this.map.clear()}delete(e){this.map.delete(e.toString())}entries(){return dr(this.map.entries(),e=>[ce(e[0]),e[1]])}forEach(e){this.map.forEach((r,n)=>{e(r,ce(n),this)})}get(e){return this.map.get(e.toString())}has(e){return this.map.has(e.toString())}set(e,r){this.map.set(e.toString(),r)}keys(){return dr(this.map.keys(),e=>ce(e))}values(){return this.map.values()}get size(){return this.map.size}};var ln=class t{set;constructor(e){if(this.set=new Set,e!=null)for(let r of e)this.set.add(r.toString())}get size(){return this.set.size}[Symbol.iterator](){return this.values()}add(e){this.set.add(e.toString())}clear(){this.set.clear()}delete(e){this.set.delete(e.toString())}entries(){return dr(this.set.entries(),e=>{let r=ce(e[0]);return[r,r]})}forEach(e){this.set.forEach(r=>{let n=ce(r);e(n,n,this)})}has(e){return this.set.has(e.toString())}values(){return dr(this.set.values(),e=>ce(e))}intersection(e){let r=new t;for(let n of e)this.has(n)&&r.add(n);return r}difference(e){let r=new t;for(let n of this)e.has(n)||r.add(n);return r}union(e){let r=new t;for(let n of e)r.add(n);for(let n of this)r.add(n);return r}};var su=class t{list;constructor(e){if(this.list=[],e!=null)for(let r of e)this.list.push(r.toString())}[Symbol.iterator](){return dr(this.list.entries(),e=>ce(e[1]))}concat(e){let r=new t(this);for(let n of e)r.push(n);return r}entries(){return dr(this.list.entries(),e=>[e[0],ce(e[1])])}every(e){return this.list.every((r,n)=>e(ce(r),n,this))}filter(e){let r=new t;return this.list.forEach((n,i)=>{let s=ce(n);e(s,i,this)&&r.push(s)}),r}find(e){let r=this.list.find((n,i)=>e(ce(n),i,this));if(r!=null)return ce(r)}findIndex(e){return this.list.findIndex((r,n)=>e(ce(r),n,this))}forEach(e){this.list.forEach((r,n)=>{e(ce(r),n,this)})}includes(e){return this.list.includes(e.toString())}indexOf(e){return this.list.indexOf(e.toString())}pop(){let e=this.list.pop();if(e!=null)return ce(e)}push(...e){for(let r of e)this.list.push(r.toString())}shift(){let e=this.list.shift();if(e!=null)return ce(e)}unshift(...e){let r=this.list.length;for(let n=e.length-1;n>-1;n--)r=this.list.unshift(e[n].toString());return r}get length(){return this.list.length}};var ou;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.id!=null&&(n.uint32(10),n.bytes(r.id)),r.pubKey!=null&&(n.uint32(18),n.bytes(r.pubKey)),r.privKey!=null&&(n.uint32(26),n.bytes(r.privKey)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.id=r.bytes();break;case 2:i.pubKey=r.bytes();break;case 3:i.privKey=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(ou||(ou={}));var ed=async()=>{let t=await Hh("Ed25519"),e=await qb(t);if(e.type==="Ed25519")return e;throw new Error(`Generated unexpected PeerId type "${e.type}"`)};async function qb(t){return Qs(Gh(t.public),Wh(t))}var Vb=Math.pow(2,7),$b=Math.pow(2,14),zb=Math.pow(2,21),au=Math.pow(2,28),cu=Math.pow(2,35),uu=Math.pow(2,42),lu=Math.pow(2,49),ue=128,nt=127;function it(t){if(tNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Hb(t,e,r=0){switch(it(t)){case 8:e[r++]=t&255|ue,t/=128;case 7:e[r++]=t&255|ue,t/=128;case 6:e[r++]=t&255|ue,t/=128;case 5:e[r++]=t&255|ue,t/=128;case 4:e[r++]=t&255|ue,t>>>=7;case 3:e[r++]=t&255|ue,t>>>=7;case 2:e[r++]=t&255|ue,t>>>=7;case 1:{e[r++]=t&255,t>>>=7;break}default:throw new Error("unreachable")}return e}function Gb(t,e,r=0){switch(it(t)){case 8:e.set(r++,t&255|ue),t/=128;case 7:e.set(r++,t&255|ue),t/=128;case 6:e.set(r++,t&255|ue),t/=128;case 5:e.set(r++,t&255|ue),t/=128;case 4:e.set(r++,t&255|ue),t>>>=7;case 3:e.set(r++,t&255|ue),t>>>=7;case 2:e.set(r++,t&255|ue),t>>>=7;case 1:{e.set(r++,t&255),t>>>=7;break}default:throw new Error("unreachable")}return e}function Wb(t,e){let r=t[e],n=0;if(n+=r&nt,r0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let r=0;for(let n of e)if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.push(n);else if(Xs(n))r+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}prepend(...e){this.prependAll(e)}prependAll(e){let r=0;for(let n of e.reverse())if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.unshift(n);else if(Xs(n))r+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}get(e){let r=td(this.bufs,e);return r.buf[r.index]}set(e,r){let n=td(this.bufs,e);n.buf[n.index]=r}write(e,r=0){if(e instanceof Uint8Array)for(let n=0;n0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,r){let{bufs:n,length:i}=this._subList(e,r);return Te(n,i)}subarray(e,r){let{bufs:n,length:i}=this._subList(e,r);return n.length===1?n[0]:Te(n,i)}sublist(e,r){let{bufs:n,length:i}=this._subList(e,r),s=new t;return s.length=i,s.bufs=n,s}_subList(e,r){if(e=e??0,r=r??this.length,e<0&&(e=this.length+e),r<0&&(r=this.length+r),e<0||r>this.length)throw new RangeError("index is out of bounds");if(e===r)return{bufs:[],length:0};if(e===0&&r===this.length)return{bufs:[...this.bufs],length:this.length};let n=[],i=0;for(let s=0;s=c)continue;let u=e>=a&&ea&&r<=c;if(u&&l){if(e===a&&r===c){n.push(o);break}let f=e-a;n.push(o.subarray(f,f+(r-e)));break}if(u){if(e===0){n.push(o);continue}n.push(o.subarray(e-a));continue}if(l){if(r===c){n.push(o);break}n.push(o.subarray(0,r-a));break}n.push(o)}return{bufs:n,length:r-e}}indexOf(e,r=0){if(!Xs(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(r=Number(r??0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),e.length===0)return r>this.length?this.length:r;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let s=256,o=new Int32Array(s);for(let f=0;f=0;h--){let p=this.get(f+h);if(n[h]!==p){l=Math.max(1,h-a[p]);break}}if(l===0)return f}return-1}getInt8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt8(0)}setInt8(e,r){let n=tt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,r),this.write(n,e)}getInt16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,r)}setInt16(e,r,n){let i=ir(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,r,n),this.write(i,e)}getInt32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,r)}setInt32(e,r,n){let i=ir(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,r,n),this.write(i,e)}getBigInt64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,r)}setBigInt64(e,r,n){let i=ir(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,r,n),this.write(i,e)}getUint8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint8(0)}setUint8(e,r){let n=tt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,r),this.write(n,e)}getUint16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,r)}setUint16(e,r,n){let i=ir(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,r,n),this.write(i,e)}getUint32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,r)}setUint32(e,r,n){let i=ir(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,r,n),this.write(i,e)}getBigUint64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,r)}setBigUint64(e,r,n){let i=ir(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,r,n),this.write(i,e)}getFloat32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,r)}setFloat32(e,r,n){let i=ir(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,r,n),this.write(i,e)}getFloat64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,r)}setFloat64(e,r,n){let i=ir(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,r,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof t)||e.bufs.length!==this.bufs.length)return!1;for(let r=0;ri+s.byteLength,0)),n.length=r,n}};var nd={ERR_SIGNATURE_NOT_VALID:"ERR_SIGNATURE_NOT_VALID"};var Ui;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.publicKey!=null&&r.publicKey.byteLength>0&&(n.uint32(10),n.bytes(r.publicKey)),r.payloadType!=null&&r.payloadType.byteLength>0&&(n.uint32(18),n.bytes(r.payloadType)),r.payload!=null&&r.payload.byteLength>0&&(n.uint32(26),n.bytes(r.payload)),r.signature!=null&&r.signature.byteLength>0&&(n.uint32(42),n.bytes(r.signature)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={publicKey:new Uint8Array(0),payloadType:new Uint8Array(0),payload:new Uint8Array(0),signature:new Uint8Array(0)},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.publicKey=r.bytes();break;case 2:i.payloadType=r.bytes();break;case 3:i.payload=r.bytes();break;case 5:i.signature=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(Ui||(Ui={}));var Wn=class t{static createFromProtobuf=async e=>{let r=Ui.decode(e),n=await Qs(r.publicKey);return new t({peerId:n,payloadType:r.payloadType,payload:r.payload,signature:r.signature})};static seal=async(e,r)=>{if(r.privateKey==null)throw new Error("Missing private key");let n=e.domain,i=e.codec,s=e.marshal(),o=id(n,i,s),c=await(await Yc(r.privateKey)).sign(o.subarray());return new t({peerId:r,payloadType:i,payload:s,signature:c})};static openAndCertify=async(e,r)=>{let n=await t.createFromProtobuf(e);if(!await n.validate(r))throw new S("envelope signature is not valid for the given domain",nd.ERR_SIGNATURE_NOT_VALID);return n};peerId;payloadType;payload;signature;marshaled;constructor(e){let{peerId:r,payloadType:n,payload:i,signature:s}=e;this.peerId=r,this.payloadType=n,this.payload=i,this.signature=s}marshal(){if(this.peerId.publicKey==null)throw new Error("Missing public key");return this.marshaled==null&&(this.marshaled=Ui.encode({publicKey:this.peerId.publicKey,payloadType:this.payloadType,payload:this.payload.subarray(),signature:this.signature})),this.marshaled}equals(e){return Se(this.marshal(),e.marshal())}async validate(e){let r=id(e,this.payloadType,this.payload);if(this.peerId.publicKey==null)throw new Error("Missing public key");return ki(this.peerId.publicKey).verify(r.subarray(),this.signature)}},id=(t,e,r)=>{let n=Q(t),i=dt(n.byteLength),s=dt(e.length),o=dt(r.length);return new ze(i,n,s,e,o,r)};function sd(t,e){let r=(n,i)=>n.toString().localeCompare(i.toString());return t.length!==e.length?!1:(e.sort(r),t.sort(r).every((n,i)=>e[i].equals(n)))}var Zs=class{index=0;input="";new(e){return this.index=0,this.input=e,this}readAtomically(e){let r=this.index,n=e();return n===void 0&&(this.index=r),n}parseWith(e){let r=e();if(this.index===this.input.length)return r}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(e){return this.readAtomically(()=>{let r=this.readChar();if(r===e)return r})}readSeparator(e,r,n){return this.readAtomically(()=>{if(!(r>0&&this.readGivenChar(e)===void 0))return n()})}readNumber(e,r,n,i){return this.readAtomically(()=>{let s=0,o=0,a=this.peekChar();if(a===void 0)return;let c=a==="0",u=2**(8*i)-1;for(;;){let l=this.readAtomically(()=>{let f=this.readChar();if(f===void 0)return;let h=Number.parseInt(f,e);if(!Number.isNaN(h))return h});if(l===void 0)break;if(s*=e,s+=l,s>u||(o+=1,r!==void 0&&o>r))return}if(o!==0)return!n&&c&&o>1?void 0:s})}readIPv4Addr(){return this.readAtomically(()=>{let e=new Uint8Array(4);for(let r=0;rthis.readNumber(10,3,!1,1));if(n===void 0)return;e[r]=n}return e})}readIPv6Addr(){let e=r=>{for(let n=0;nthis.readIPv4Addr());if(o!==void 0)return r[i]=o[0],r[i+1]=o[1],r[i+2]=o[2],r[i+3]=o[3],[i+4,!0]}let s=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(s===void 0)return[i,!1];r[i]=s>>8,r[i+1]=s&255}return[r.length,!1]};return this.readAtomically(()=>{let r=new Uint8Array(16),[n,i]=e(r);if(n===16)return r;if(i||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let s=new Uint8Array(14),o=16-(n+2),[a]=e(s.subarray(0,o));return r.set(s.subarray(0,a),16-a),r})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var od=45,Qb=15,Yn=new Zs;function fu(t){if(!(t.length>Qb))return Yn.new(t).parseWith(()=>Yn.readIPv4Addr())}function hu(t){if(t.includes("%")&&(t=t.split("%")[0]),!(t.length>od))return Yn.new(t).parseWith(()=>Yn.readIPv6Addr())}function js(t){if(t.includes("%")&&(t=t.split("%")[0]),!(t.length>od))return Yn.new(t).parseWith(()=>Yn.readIPAddr())}var TR=parseInt("0xFFFF",16),BR=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function Js(t){return!!fu(t)}function eo(t){return!!hu(t)}function Qn(t){return!!js(t)}var ud=Js,ew=eo,du=function(t){let e=0;if(t=t.toString().trim(),ud(t)){let r=new Uint8Array(e+4);return t.split(/\./g).forEach(n=>{r[e++]=parseInt(n,10)&255}),r}if(ew(t)){let r=t.split(":",8),n;for(n=0;n0;n--)s.push("0");r.splice.apply(r,s)}let i=new Uint8Array(e+16);for(n=0;n>8&255,i[e++]=s&255}return i}throw new Error("invalid ip address")},ld=function(t,e=0,r){e=~~e,r=r??t.length-e;let n=new DataView(t.buffer);if(r===4){let i=[];for(let s=0;s{let e=nw(...t);pu[e.code]=e,Xn[e.name]=e});function nw(t,e,r,n,i){return{code:t,size:e,name:r,resolvable:!!n,path:!!i}}function fe(t){if(typeof t=="number"){if(pu[t]!=null)return pu[t];throw new Error(`no protocol with code: ${t}`)}else if(typeof t=="string"){if(Xn[t]!=null)return Xn[t];throw new Error(`no protocol with name: ${t}`)}throw new Error(`invalid protocol id type: ${typeof t}`)}var d8=fe("ip4"),p8=fe("ip6"),m8=fe("ipcidr");function gu(t,e){switch(fe(t).code){case 4:case 41:return sw(e);case 42:return dd(e);case 6:case 273:case 33:case 132:return md(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return dd(e);case 421:return uw(e);case 444:return pd(e);case 445:return pd(e);case 466:return cw(e);default:return se(e,"base16")}}function yu(t,e){switch(fe(t).code){case 4:return fd(e);case 41:return fd(e);case 42:return hd(e);case 6:case 273:case 33:case 132:return xu(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return hd(e);case 421:return ow(e);case 444:return lw(e);case 445:return fw(e);case 466:return aw(e);default:return Q(e,"base16")}}var mu=Object.values(vr).map(t=>t.decoder),iw=function(){let t=mu[0].or(mu[1]);return mu.slice(2).forEach(e=>t=t.or(e)),t}();function fd(t){if(!Qn(t))throw new Error("invalid ip address");return du(t)}function sw(t){let e=ld(t,0,t.length);if(e==null)throw new Error("ipBuff is required");if(!Qn(e))throw new Error("invalid ip address");return e}function xu(t){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,t),new Uint8Array(e)}function md(t){return new DataView(t.buffer).getUint16(t.byteOffset)}function hd(t){let e=Q(t),r=Uint8Array.from(dt(e.length));return Te([r,e],r.length+e.length)}function dd(t){let e=Ot(t);if(t=t.slice(it(e)),t.length!==e)throw new Error("inconsistent lengths");return se(t)}function ow(t){let e;t[0]==="Q"||t[0]==="1"?e=Yr(_e.decode(`z${t}`)).bytes:e=Lt.parse(t).multihash.bytes;let r=Uint8Array.from(dt(e.length));return Te([r,e],r.length+e.length)}function aw(t){let e=iw.decode(t),r=Uint8Array.from(dt(e.length));return Te([r,e],r.length+e.length)}function cw(t){let e=Ot(t),r=t.slice(it(e));if(r.length!==e)throw new Error("inconsistent lengths");return"u"+se(r,"base64url")}function uw(t){let e=Ot(t),r=t.slice(it(e));if(r.length!==e)throw new Error("inconsistent lengths");return se(r,"base58btc")}function lw(t){let e=t.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let r=pt.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=xu(n);return Te([r,i],r.length+i.length)}function fw(t){let e=t.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let r=pt.decode(`b${e[0]}`),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=xu(n);return Te([r,i],r.length+i.length)}function pd(t){let e=t.slice(0,t.length-2),r=t.slice(t.length-2),n=se(e,"base32"),i=md(r);return`${n}:${i}`}function gd(t){t=bu(t);let e=[],r=[],n=null,i=t.split("/").slice(1);if(i.length===1&&i[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let s=0;s=i.length)throw xd("invalid address: "+t);if(a.path===!0){n=bu(i.slice(s).join("/")),e.push([a.code,yu(a.code,n)]),r.push([a.code,n]);break}let c=yu(a.code,i[s]);e.push([a.code,c]),r.push([a.code,gu(a.code,c)])}return{string:yd(r),bytes:Eu(e),tuples:e,stringTuples:r,path:n}}function wu(t){let e=[],r=[],n=null,i=0;for(;it.length)throw xd("Invalid address Uint8Array: "+se(t,"base16"));e.push([s,u]);let l=gu(s,u);if(r.push([s,l]),a.path===!0){n=l;break}}return{bytes:Uint8Array.from(t),string:yd(r),tuples:e,stringTuples:r,path:n}}function yd(t){let e=[];return t.map(r=>{let n=fe(r[0]);return e.push(n.name),r.length>1&&r[1]!=null&&e.push(r[1]),null}),bu(e.join("/"))}function Eu(t){return Te(t.map(e=>{let r=fe(e[0]),n=Uint8Array.from(dt(r.code));return e.length>1&&e[1]!=null&&(n=Te([n,e[1]])),n}))}function hw(t,e){if(t.size>0)return t.size/8;if(t.size===0)return 0;{let r=Ot(e instanceof Uint8Array?e:Uint8Array.from(e));return r+it(r)}}function bu(t){return"/"+t.trim().split("/").filter(e=>e).join("/")}function xd(t){return new Error("Error parsing address: "+t)}var dw=Symbol.for("nodejs.util.inspect.custom"),vu=Symbol.for("@multiformats/js-multiaddr/multiaddr"),pw=[fe("dns").code,fe("dns4").code,fe("dns6").code,fe("dnsaddr").code],to=class t{bytes;#e;#t;#r;#n;[vu]=!0;constructor(e){e==null&&(e="");let r;if(e instanceof Uint8Array)r=wu(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);r=gd(e)}else if(Lr(e))r=wu(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=r.bytes,this.#e=r.string,this.#t=r.tuples,this.#r=r.stringTuples,this.#n=r.path}toString(){return this.#e}toJSON(){return this.toString()}toOptions(){let e,r,n,i,s="",o=fe("tcp"),a=fe("udp"),c=fe("ip4"),u=fe("ip6"),l=fe("dns6"),f=fe("ip6zone");for(let[p,d]of this.stringTuples())p===f.code&&(s=`%${d??""}`),pw.includes(p)&&(r=o.name,i=443,n=`${d??""}${s}`,e=p===l.code?6:4),(p===o.code||p===a.code)&&(r=fe(p).name,i=parseInt(d??"")),(p===c.code||p===u.code)&&(r=fe(p).name,n=`${d??""}${s}`,e=p===u.code?6:4);if(e==null||r==null||n==null||i==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:e,host:n,transport:r,port:i}}protos(){return this.#t.map(([e])=>Object.assign({},fe(e)))}protoCodes(){return this.#t.map(([e])=>e)}protoNames(){return this.#t.map(([e])=>fe(e).name)}tuples(){return this.#t}stringTuples(){return this.#r}encapsulate(e){return e=new t(e),new t(this.toString()+e.toString())}decapsulate(e){let r=e.toString(),n=this.toString(),i=n.lastIndexOf(r);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new t(n.slice(0,i))}decapsulateCode(e){let r=this.tuples();for(let n=r.length-1;n>=0;n--)if(r[n][0]===e)return new t(Eu(r.slice(0,n)));return this}getPeerId(){try{let e=[];this.stringTuples().forEach(([n,i])=>{n===Xn.p2p.code&&e.push([n,i]),n===Xn["p2p-circuit"].code&&(e=[])});let r=e.pop();if(r?.[1]!=null){let n=r[1];return n[0]==="Q"||n[0]==="1"?se(_e.decode(`z${n}`),"base58btc"):se(Lt.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#n}equals(e){return Se(this.bytes,e.bytes)}async resolve(e){let r=this.protos().find(s=>s.resolvable);if(r==null)return[this];let n=ro.get(r.name);if(n==null)throw new S(`no available resolver for ${r.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,e)).map(s=>new t(s))}nodeAddress(){let e=this.toOptions();if(e.transport!=="tcp"&&e.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${e.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:e.family,address:e.host,port:e.port}}isThinWaistAddress(e){let r=(e??this).protos();return!(r.length!==2||r[0].code!==4&&r[0].code!==41||r[1].code!==6&&r[1].code!==273)}[dw](){return`Multiaddr(${this.#e})`}};var ro=new Map;function Lr(t){return!!t?.[vu]}function Ue(t){return new to(t)}var bd="libp2p-peer-record",wd=Uint8Array.from([3,1]);var Fi;(function(t){let e;(function(n){let i;n.codec=()=>(i==null&&(i=Ze((s,o,a={})=>{a.lengthDelimited!==!1&&o.fork(),s.multiaddr!=null&&s.multiaddr.byteLength>0&&(o.uint32(10),o.bytes(s.multiaddr)),a.lengthDelimited!==!1&&o.ldelim()},(s,o)=>{let a={multiaddr:new Uint8Array(0)},c=o==null?s.len:s.pos+o;for(;s.pos>>3){case 1:a.multiaddr=s.bytes();break;default:s.skipType(u&7);break}}return a})),i),n.encode=s=>Xe(s,n.codec()),n.decode=s=>Qe(s,n.codec())})(e=t.AddressInfo||(t.AddressInfo={}));let r;t.codec=()=>(r==null&&(r=Ze((n,i,s={})=>{if(s.lengthDelimited!==!1&&i.fork(),n.peerId!=null&&n.peerId.byteLength>0&&(i.uint32(10),i.bytes(n.peerId)),n.seq!=null&&n.seq!==0n&&(i.uint32(16),i.uint64(n.seq)),n.addresses!=null)for(let o of n.addresses)i.uint32(26),t.AddressInfo.codec().encode(o,i);s.lengthDelimited!==!1&&i.ldelim()},(n,i)=>{let s={peerId:new Uint8Array(0),seq:0n,addresses:[]},o=i==null?n.len:n.pos+i;for(;n.pos>>3){case 1:s.peerId=n.bytes();break;case 2:s.seq=n.uint64();break;case 3:s.addresses.push(t.AddressInfo.codec().decode(n,n.uint32()));break;default:n.skipType(a&7);break}}return s})),r),t.encode=n=>Xe(n,t.codec()),t.decode=n=>Qe(n,t.codec())})(Fi||(Fi={}));var hn=class t{static createFromProtobuf=e=>{let r=Fi.decode(e),n=Gn(r.peerId),i=(r.addresses??[]).map(o=>Ue(o.multiaddr)),s=r.seq;return new t({peerId:n,multiaddrs:i,seqNumber:s})};static DOMAIN=bd;static CODEC=wd;peerId;multiaddrs;seqNumber;domain=t.DOMAIN;codec=t.CODEC;marshaled;constructor(e){let{peerId:r,multiaddrs:n,seqNumber:i}=e;this.peerId=r,this.multiaddrs=n??[],this.seqNumber=i??BigInt(Date.now())}marshal(){return this.marshaled==null&&(this.marshaled=Fi.encode({peerId:this.peerId.toBytes(),seq:BigInt(this.seqNumber),addresses:this.multiaddrs.map(e=>({multiaddr:e.bytes}))})),this.marshaled}equals(e){return!(!(e instanceof t)||!this.peerId.equals(e.peerId)||this.seqNumber!==e.seqNumber||!sd(this.multiaddrs,e.multiaddrs))}};function mw(t){return t[Symbol.asyncIterator]!=null}function gw(t){if(mw(t))return(async()=>{let r=[];for await(let n of t)r.push(n);return r})();let e=[];for(let r of t)e.push(r);return e}var Ki=gw;var Su=ve(vd(),1);var Vi=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Au=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},_d=t=>globalThis.DOMException===void 0?new Au(t):new DOMException(t),Sd=t=>{let e=t.reason===void 0?_d("This operation was aborted."):t.reason;return e instanceof Error?e:_d(e)};function Iu(t,e,r,n){let i,s=new Promise((o,a)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e===Number.POSITIVE_INFINITY){o(t);return}if(n={customTimers:{setTimeout,clearTimeout},...n},n.signal){let{signal:c}=n;c.aborted&&a(Sd(c)),c.addEventListener("abort",()=>{a(Sd(c))})}i=n.customTimers.setTimeout.call(void 0,()=>{if(typeof r=="function"){try{o(r())}catch(l){a(l)}return}let c=typeof r=="string"?r:`Promise timed out after ${e} milliseconds`,u=r instanceof Error?r:new Vi(c);typeof t.cancel=="function"&&t.cancel(),a(u)},e),(async()=>{try{o(await t)}catch(c){a(c)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()});return s.clear=()=>{clearTimeout(i),i=void 0},s}function Ru(t,e,r){let n=0,i=t.length;for(;i>0;){let s=Math.trunc(i/2),o=n+s;r(t[o],e)<=0?(n=++o,i-=s+1):i=s}return n}var dn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},pr,Cu=class{constructor(){pr.set(this,[])}enqueue(e,r){r={priority:0,...r};let n={priority:r.priority,run:e};if(this.size&&dn(this,pr,"f")[this.size-1].priority>=r.priority){dn(this,pr,"f").push(n);return}let i=Ru(dn(this,pr,"f"),n,(s,o)=>o.priority-s.priority);dn(this,pr,"f").splice(i,0,n)}dequeue(){let e=dn(this,pr,"f").shift();return e?.run}filter(e){return dn(this,pr,"f").filter(r=>r.priority===e.priority).map(r=>r.run)}get size(){return dn(this,pr,"f").length}};pr=new WeakMap;var Ad=Cu;var Ae=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},K=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Be,zi,Hi,Dr,uo,Gi,io,Mt,$i,Et,so,vt,Wi,Pr,oo,Id,Rd,Bd,Cd,Td,ao,Tu,Bu,lo,Ld,co,fo=class extends Error{},Lu=class extends Su.default{constructor(e){var r,n,i,s;if(super(),Be.add(this),zi.set(this,void 0),Hi.set(this,void 0),Dr.set(this,0),uo.set(this,void 0),Gi.set(this,void 0),io.set(this,0),Mt.set(this,void 0),$i.set(this,void 0),Et.set(this,void 0),so.set(this,void 0),vt.set(this,0),Wi.set(this,void 0),Pr.set(this,void 0),oo.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Ad,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(r=e.intervalCap)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(s=(i=e.interval)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""}\` (${typeof e.interval})`);Ae(this,zi,e.carryoverConcurrencyCount,"f"),Ae(this,Hi,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),Ae(this,uo,e.intervalCap,"f"),Ae(this,Gi,e.interval,"f"),Ae(this,Et,new e.queueClass,"f"),Ae(this,so,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,Ae(this,oo,e.throwOnTimeout===!0,"f"),Ae(this,Pr,e.autoStart===!1,"f")}get concurrency(){return K(this,Wi,"f")}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);Ae(this,Wi,e,"f"),K(this,Be,"m",lo).call(this)}async add(e,r={}){return r={timeout:this.timeout,throwOnTimeout:K(this,oo,"f"),...r},new Promise((n,i)=>{K(this,Et,"f").enqueue(async()=>{var s,o,a;Ae(this,vt,(o=K(this,vt,"f"),o++,o),"f"),Ae(this,Dr,(a=K(this,Dr,"f"),a++,a),"f");try{if(!((s=r.signal)===null||s===void 0)&&s.aborted)throw new fo("The task was aborted.");let c=e({signal:r.signal});r.timeout&&(c=Iu(Promise.resolve(c),r.timeout)),r.signal&&(c=Promise.race([c,K(this,Be,"m",Ld).call(this,r.signal)]));let u=await c;n(u),this.emit("completed",u)}catch(c){if(c instanceof Vi&&!r.throwOnTimeout){n();return}i(c),this.emit("error",c)}finally{K(this,Be,"m",Bd).call(this)}},r),this.emit("add"),K(this,Be,"m",ao).call(this)})}async addAll(e,r){return Promise.all(e.map(async n=>this.add(n,r)))}start(){return K(this,Pr,"f")?(Ae(this,Pr,!1,"f"),K(this,Be,"m",lo).call(this),this):this}pause(){Ae(this,Pr,!0,"f")}clear(){Ae(this,Et,new(K(this,so,"f")),"f")}async onEmpty(){K(this,Et,"f").size!==0&&await K(this,Be,"m",co).call(this,"empty")}async onSizeLessThan(e){K(this,Et,"f").sizeK(this,Et,"f").size{K(this,Be,"m",Cd).call(this)},r),"f"),!0}return!1},ao=function(){if(K(this,Et,"f").size===0)return K(this,Mt,"f")&&clearInterval(K(this,Mt,"f")),Ae(this,Mt,void 0,"f"),this.emit("empty"),K(this,vt,"f")===0&&this.emit("idle"),!1;if(!K(this,Pr,"f")){let e=!K(this,Be,"a",Td);if(K(this,Be,"a",Id)&&K(this,Be,"a",Rd)){let r=K(this,Et,"f").dequeue();return r?(this.emit("active"),r(),e&&K(this,Be,"m",Tu).call(this),!0):!1}}return!1},Tu=function(){K(this,Hi,"f")||K(this,Mt,"f")!==void 0||(Ae(this,Mt,setInterval(()=>{K(this,Be,"m",Bu).call(this)},K(this,Gi,"f")),"f"),Ae(this,io,Date.now()+K(this,Gi,"f"),"f"))},Bu=function(){K(this,Dr,"f")===0&&K(this,vt,"f")===0&&K(this,Mt,"f")&&(clearInterval(K(this,Mt,"f")),Ae(this,Mt,void 0,"f")),Ae(this,Dr,K(this,zi,"f")?K(this,vt,"f"):0,"f"),K(this,Be,"m",lo).call(this)},lo=function(){for(;K(this,Be,"m",ao).call(this););},Ld=async function(e){return new Promise((r,n)=>{e.addEventListener("abort",()=>{n(new fo("The task was aborted."))},{once:!0})})},co=async function(e,r){return new Promise(n=>{let i=()=>{r&&!r()||(this.off(e,i),n())};this.on(e,i)})};var Nr=Lu;var Pu=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Du=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Pd=t=>globalThis.DOMException===void 0?new Du(t):new DOMException(t),Dd=t=>{let e=t.reason===void 0?Pd("This operation was aborted."):t.reason;return e instanceof Error?e:Pd(e)};function Nu(t,e){let{milliseconds:r,fallback:n,message:i,customTimers:s={setTimeout,clearTimeout}}=e,o,c=new Promise((u,l)=>{if(typeof r!="number"||Math.sign(r)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``);if(e.signal){let{signal:h}=e;h.aborted&&l(Dd(h)),h.addEventListener("abort",()=>{l(Dd(h))})}if(r===Number.POSITIVE_INFINITY){t.then(u,l);return}let f=new Pu;o=s.setTimeout.call(void 0,()=>{if(n){try{u(n())}catch(h){l(h)}return}typeof t.cancel=="function"&&t.cancel(),i===!1?u():i instanceof Error?l(i):(f.message=i??`Promise timed out after ${r} milliseconds`,l(f))},r),(async()=>{try{u(await t)}catch(h){l(h)}})()}).finally(()=>{c.clear()});return c.clear=()=>{s.clearTimeout.call(void 0,o),o=void 0},c}var ho=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),"");var ku="lock:worker:request-read",Ou="lock:worker:release-read",Mu="lock:master:grant-read",Uu="lock:worker:request-write",Fu="lock:worker:release-write",Ku="lock:master:grant-write";var kr={},Zn=t=>{t.addEventListener("message",e=>{Zn.dispatchEvent("message",t,e)}),t.port!=null&&t.port.addEventListener("message",e=>{Zn.dispatchEvent("message",t,e)})};Zn.addEventListener=(t,e)=>{kr[t]==null&&(kr[t]=[]),kr[t].push(e)};Zn.removeEventListener=(t,e)=>{kr[t]!=null&&(kr[t]=kr[t].filter(r=>r===e))};Zn.dispatchEvent=function(t,e,r){kr[t]!=null&&kr[t].forEach(n=>n(e,r))};var qu=Zn;var Nd=(t,e,r,n,i)=>(s,o)=>{if(o.data.type!==r)return;let a={type:o.data.type,name:o.data.name,identifier:o.data.identifier};t.dispatchEvent(new MessageEvent(e,{data:{name:a.name,handler:async()=>(s.postMessage({type:i,name:a.name,identifier:a.identifier}),await new Promise(c=>{let u=l=>{if(l==null||l.data==null)return;let f={type:l.data.type,name:l.data.name,identifier:l.data.identifier};f.type===n&&f.identifier===a.identifier&&(s.removeEventListener("message",u),c())};s.addEventListener("message",u)}))}}))},kd=(t,e,r,n)=>async()=>{let i=ho();return globalThis.postMessage({type:e,identifier:i,name:t}),await new Promise(s=>{let o=a=>{if(a==null||a.data==null)return;let c={type:a.data.type,identifier:a.data.identifier};c.type===r&&c.identifier===i&&(globalThis.removeEventListener("message",o),s(()=>{globalThis.postMessage({type:n,identifier:i,name:t})}))};globalThis.addEventListener("message",o)})},bw={singleProcess:!1},Od=t=>{if(t=Object.assign({},bw,t),!!globalThis.document||t.singleProcess){let r=new EventTarget;return qu.addEventListener("message",Nd(r,"requestReadLock",ku,Ou,Mu)),qu.addEventListener("message",Nd(r,"requestWriteLock",Uu,Fu,Ku)),r}return{isWorker:!0,readLock:r=>kd(r,ku,Mu,Ou),writeLock:r=>kd(r,Uu,Ku,Fu)}};var pn={},Or;async function Vu(t,e){let r,n=new Promise(i=>{r=i});return t.add(async()=>await Nu((async()=>await new Promise(i=>{r(()=>{i()})}))(),{milliseconds:e.timeout})),await n}var ww=(t,e)=>{if(Or.isWorker===!0)return{readLock:Or.readLock(t,e),writeLock:Or.writeLock(t,e)};let r=new Nr({concurrency:1}),n;return{async readLock(){if(n!=null)return await Vu(n,e);n=new Nr({concurrency:e.concurrency,autoStart:!1});let i=n,s=Vu(n,e);return r.add(async()=>(i.start(),await i.onIdle().then(()=>{n===i&&(n=null)}))),await s},async writeLock(){return n=null,await Vu(r,e)}}},Ew={name:"lock",concurrency:1/0,timeout:846e5,singleProcess:!1};function $u(t){let e=Object.assign({},Ew,t);return Or==null&&(Or=Od(e),Or.isWorker!==!0&&(Or.addEventListener("requestReadLock",r=>{pn[r.data.name]!=null&&pn[r.data.name].readLock().then(async n=>await r.data.handler().finally(()=>n()))}),Or.addEventListener("requestWriteLock",async r=>{pn[r.data.name]!=null&&pn[r.data.name].writeLock().then(async n=>await r.data.handler().finally(()=>n()))}))),pn[e.name]==null&&(pn[e.name]=ww(e.name,e)),pn[e.name]}var je={ERR_INVALID_PARAMETERS:"ERR_INVALID_PARAMETERS"};var jn;(function(t){let e;(function(i){let s;i.codec=()=>(s==null&&(s=Ze((o,a,c={})=>{c.lengthDelimited!==!1&&a.fork(),o.key!=null&&o.key!==""&&(a.uint32(10),a.string(o.key)),o.value!=null&&o.value.byteLength>0&&(a.uint32(18),a.bytes(o.value)),c.lengthDelimited!==!1&&a.ldelim()},(o,a)=>{let c={key:"",value:new Uint8Array(0)},u=a==null?o.len:o.pos+a;for(;o.pos>>3){case 1:c.key=o.string();break;case 2:c.value=o.bytes();break;default:o.skipType(l&7);break}}return c})),s),i.encode=o=>Xe(o,i.codec()),i.decode=o=>Qe(o,i.codec())})(e=t.Peer$metadataEntry||(t.Peer$metadataEntry={}));let r;(function(i){let s;i.codec=()=>(s==null&&(s=Ze((o,a,c={})=>{c.lengthDelimited!==!1&&a.fork(),o.key!=null&&o.key!==""&&(a.uint32(10),a.string(o.key)),o.value!=null&&(a.uint32(18),mo.codec().encode(o.value,a)),c.lengthDelimited!==!1&&a.ldelim()},(o,a)=>{let c={key:""},u=a==null?o.len:o.pos+a;for(;o.pos>>3){case 1:c.key=o.string();break;case 2:c.value=mo.codec().decode(o,o.uint32());break;default:o.skipType(l&7);break}}return c})),s),i.encode=o=>Xe(o,i.codec()),i.decode=o=>Qe(o,i.codec())})(r=t.Peer$tagsEntry||(t.Peer$tagsEntry={}));let n;t.codec=()=>(n==null&&(n=Ze((i,s,o={})=>{if(o.lengthDelimited!==!1&&s.fork(),i.addresses!=null)for(let a of i.addresses)s.uint32(10),po.codec().encode(a,s);if(i.protocols!=null)for(let a of i.protocols)s.uint32(18),s.string(a);if(i.publicKey!=null&&(s.uint32(34),s.bytes(i.publicKey)),i.peerRecordEnvelope!=null&&(s.uint32(42),s.bytes(i.peerRecordEnvelope)),i.metadata!=null&&i.metadata.size!==0)for(let[a,c]of i.metadata.entries())s.uint32(50),t.Peer$metadataEntry.codec().encode({key:a,value:c},s);if(i.tags!=null&&i.tags.size!==0)for(let[a,c]of i.tags.entries())s.uint32(58),t.Peer$tagsEntry.codec().encode({key:a,value:c},s);o.lengthDelimited!==!1&&s.ldelim()},(i,s)=>{let o={addresses:[],protocols:[],metadata:new Map,tags:new Map},a=s==null?i.len:i.pos+s;for(;i.pos>>3){case 1:o.addresses.push(po.codec().decode(i,i.uint32()));break;case 2:o.protocols.push(i.string());break;case 4:o.publicKey=i.bytes();break;case 5:o.peerRecordEnvelope=i.bytes();break;case 6:{let u=t.Peer$metadataEntry.codec().decode(i,i.uint32());o.metadata.set(u.key,u.value);break}case 7:{let u=t.Peer$tagsEntry.codec().decode(i,i.uint32());o.tags.set(u.key,u.value);break}default:i.skipType(c&7);break}}return o})),n),t.encode=i=>Xe(i,t.codec()),t.decode=i=>Qe(i,t.codec())})(jn||(jn={}));var po;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.multiaddr!=null&&r.multiaddr.byteLength>0&&(n.uint32(10),n.bytes(r.multiaddr)),r.isCertified!=null&&(n.uint32(16),n.bool(r.isCertified)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={multiaddr:new Uint8Array(0)},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.multiaddr=r.bytes();break;case 2:i.isCertified=r.bool();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(po||(po={}));var mo;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.value!=null&&r.value!==0&&(n.uint32(8),n.uint32(r.value)),r.expiry!=null&&(n.uint32(16),n.uint64(r.expiry)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={value:0},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.value=r.uint32();break;case 2:i.expiry=r.uint64();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(mo||(mo={}));function Jn(t,e){let r=jn.decode(e);r.publicKey!=null&&t.publicKey==null&&(t=Jh({...t,publicKey:t.publicKey}));let n=new Map,i=BigInt(Date.now());for(let[s,o]of r.tags.entries())o.expiry!=null&&o.expiry({multiaddr:Ue(s),isCertified:o??!1})),metadata:r.metadata,peerRecordEnvelope:r.peerRecordEnvelope??void 0,tags:n}}var mr="/",Md=new TextEncoder().encode(mr),go=Md[0],mn=class t{_buf;constructor(e,r){if(typeof e=="string")this._buf=Q(e);else if(e instanceof Uint8Array)this._buf=e;else throw new Error("Invalid key, should be String of Uint8Array");if(r==null&&(r=!0),r&&this.clean(),this._buf.byteLength===0||this._buf[0]!==go)throw new Error("Invalid key")}toString(e="utf8"){return se(this._buf,e)}uint8Array(){return this._buf}get[Symbol.toStringTag](){return`Key(${this.toString()})`}static withNamespaces(e){return new t(e.join(mr))}static random(){return new t(ho().replace(/-/g,""))}static asKey(e){return e instanceof Uint8Array||typeof e=="string"?new t(e):typeof e.uint8Array=="function"?new t(e.uint8Array()):null}clean(){if((this._buf==null||this._buf.byteLength===0)&&(this._buf=Md),this._buf[0]!==go){let e=new Uint8Array(this._buf.byteLength+1);e.fill(go,0,1),e.set(this._buf,1),this._buf=e}for(;this._buf.byteLength>1&&this._buf[this._buf.byteLength-1]===go;)this._buf=this._buf.subarray(0,-1)}less(e){let r=this.list(),n=e.list();for(let i=0;io)return!1}return r.lengthr.namespaces()))])}};function vw(t){let e=t.split(":");return e.length<2?"":e.slice(0,-1).join(":")}function _w(t){let e=t.split(":");return e[e.length-1]}function Sw(t){return[].concat(...t)}var zu="/peers/";function ei(t){if(!Ys(t)||t.type==null)throw new S("Invalid PeerId",je.ERR_INVALID_PARAMETERS);let e=t.toCID().toString();return new mn(`${zu}${e}`)}async function Ud(t,e,r){let n=new Map;for(let i of r){if(i==null)continue;if(i.multiaddr instanceof Uint8Array&&(i.multiaddr=Ue(i.multiaddr)),!Lr(i.multiaddr))throw new S("Multiaddr was invalid",je.ERR_INVALID_PARAMETERS);if(!await e(t,i.multiaddr))continue;let s=i.isCertified??!1,o=i.multiaddr.toString(),a=n.get(o);a!=null?i.isCertified=a.isCertified||s:n.set(o,{multiaddr:i.multiaddr,isCertified:s})}return[...n.values()].sort((i,s)=>i.multiaddr.toString().localeCompare(s.multiaddr.toString())).map(({isCertified:i,multiaddr:s})=>({isCertified:i,multiaddr:s.bytes}))}async function xo(t,e,r,n){if(e==null)throw new S("Invalid PeerData",je.ERR_INVALID_PARAMETERS);if(e.publicKey!=null&&t.publicKey!=null&&!Se(e.publicKey,t.publicKey))throw new S("publicKey bytes do not match peer id publicKey bytes",je.ERR_INVALID_PARAMETERS);let i=n.existingPeer;if(i!=null&&!t.equals(i.id))throw new S("peer id did not match existing peer id",je.ERR_INVALID_PARAMETERS);let s=i?.addresses??[],o=new Set(i?.protocols??[]),a=i?.metadata??new Map,c=i?.tags??new Map,u=i?.peerRecordEnvelope;if(r==="patch"){if((e.multiaddrs!=null||e.addresses!=null)&&(s=[],e.multiaddrs!=null&&s.push(...e.multiaddrs.map(f=>({isCertified:!1,multiaddr:f}))),e.addresses!=null&&s.push(...e.addresses)),e.protocols!=null&&(o=new Set(e.protocols)),e.metadata!=null){let f=e.metadata instanceof Map?[...e.metadata.entries()]:Object.entries(e.metadata);a=yo(f,{validate:Fd})}if(e.tags!=null){let f=e.tags instanceof Map?[...e.tags.entries()]:Object.entries(e.tags);c=yo(f,{validate:Kd,map:qd})}e.peerRecordEnvelope!=null&&(u=e.peerRecordEnvelope)}if(r==="merge"){if(e.multiaddrs!=null&&s.push(...e.multiaddrs.map(f=>({isCertified:!1,multiaddr:f}))),e.addresses!=null&&s.push(...e.addresses),e.protocols!=null&&(o=new Set([...o,...e.protocols])),e.metadata!=null){let f=e.metadata instanceof Map?[...e.metadata.entries()]:Object.entries(e.metadata);for(let[h,p]of f)p==null?a.delete(h):a.set(h,p);a=yo([...a.entries()],{validate:Fd})}if(e.tags!=null){let f=e.tags instanceof Map?[...e.tags.entries()]:Object.entries(e.tags),h=new Map(c);for(let[p,d]of f)d==null?h.delete(p):h.set(p,d);c=yo([...h.entries()],{validate:Kd,map:qd})}e.peerRecordEnvelope!=null&&(u=e.peerRecordEnvelope)}let l={addresses:await Ud(t,n.addressFilter??(async()=>!0),s),protocols:[...o.values()].sort((f,h)=>f.localeCompare(h)),metadata:a,tags:c,publicKey:i?.id.publicKey??e.publicKey??t.publicKey,peerRecordEnvelope:u};return t.type!=="RSA"&&delete l.publicKey,l}function yo(t,e){let r=new Map;for(let[n,i]of t)i!=null&&e.validate(n,i);for(let[n,i]of t.sort(([s],[o])=>s.localeCompare(o)))i!=null&&r.set(n,e.map?.(n,i)??i);return r}function Fd(t,e){if(typeof t!="string")throw new S("Metadata key must be a string",je.ERR_INVALID_PARAMETERS);if(!(e instanceof Uint8Array))throw new S("Metadata value must be a Uint8Array",je.ERR_INVALID_PARAMETERS)}function Kd(t,e){if(typeof t!="string")throw new S("Tag name must be a string",je.ERR_INVALID_PARAMETERS);if(e.value!=null){if(parseInt(`${e.value}`,10)!==e.value)throw new S("Tag value must be an integer",je.ERR_INVALID_PARAMETERS);if(e.value<0||e.value>100)throw new S("Tag value must be between 0-100",je.ERR_INVALID_PARAMETERS)}if(e.ttl!=null){if(parseInt(`${e.ttl}`,10)!==e.ttl)throw new S("Tag ttl must be an integer",je.ERR_INVALID_PARAMETERS);if(e.ttl<0)throw new S("Tag ttl must be between greater than 0",je.ERR_INVALID_PARAMETERS)}}function qd(t,e){let r;return e.expiry!=null&&(r=e.expiry),e.ttl!=null&&(r=BigInt(Date.now()+Number(e.ttl))),{value:e.value??0,expiry:r}}function bo(t,e,r){let n=t.toString().split("/")[2],i=pt.decode(n),s=Gn(i),o=r.get(s);if(o!=null)return o;let a=Jn(s,e);return r.set(s,a),a}function Aw(t,e){return t==null?{}:{prefix:zu,filters:(t.filters??[]).map(r=>({key:n,value:i})=>r(bo(n,i,e))),orders:(t.orders??[]).map(r=>(n,i)=>r(bo(n.key,n.value,e),bo(i.key,i.value,e)))}}var wo=class{peerId;datastore;lock;addressFilter;constructor(e,r={}){this.peerId=e.peerId,this.datastore=e.datastore,this.addressFilter=r.addressFilter,this.lock=$u({name:"peer-store",singleProcess:!0})}async has(e){return this.datastore.has(ei(e))}async delete(e){if(this.peerId.equals(e))throw new S("Cannot delete self peer",je.ERR_INVALID_PARAMETERS);await this.datastore.delete(ei(e))}async load(e){let r=await this.datastore.get(ei(e));return Jn(e,r)}async save(e,r){let{existingBuf:n,existingPeer:i}=await this.#e(e),s=await xo(e,r,"patch",{addressFilter:this.addressFilter});return this.#t(e,s,n,i)}async patch(e,r){let{existingBuf:n,existingPeer:i}=await this.#e(e),s=await xo(e,r,"patch",{addressFilter:this.addressFilter,existingPeer:i});return this.#t(e,s,n,i)}async merge(e,r){let{existingBuf:n,existingPeer:i}=await this.#e(e),s=await xo(e,r,"merge",{addressFilter:this.addressFilter,existingPeer:i});return this.#t(e,s,n,i)}async*all(e){let r=new wt;for await(let{key:n,value:i}of this.datastore.query(Aw(e??{},r))){let s=bo(n,i,r);s.id.equals(this.peerId)||(yield s)}}async#e(e){try{let r=await this.datastore.get(ei(e)),n=Jn(e,r);return{existingBuf:r,existingPeer:n}}catch(r){if(r.code!=="ERR_NOT_FOUND")throw r}return{}}async#t(e,r,n,i){let s=jn.encode(r);return n!=null&&Se(s,n)?{peer:Jn(e,s),previous:i,updated:!1}:(await this.datastore.put(ei(e),s),{peer:Jn(e,s),previous:i,updated:!0})}};var Eo=class{store;events;peerId;log;constructor(e,r={}){this.log=e.logger.forComponent("libp2p:peer-store"),this.events=e.events,this.peerId=e.peerId,this.store=new wo(e,r)}async forEach(e,r){this.log.trace("forEach await read lock");let n=await this.store.lock.readLock();this.log.trace("forEach got read lock");try{for await(let i of this.store.all(r))e(i)}finally{this.log.trace("forEach release read lock"),n()}}async all(e){this.log.trace("all await read lock");let r=await this.store.lock.readLock();this.log.trace("all got read lock");try{return await Ki(this.store.all(e))}finally{this.log.trace("all release read lock"),r()}}async delete(e){this.log.trace("delete await write lock");let r=await this.store.lock.writeLock();this.log.trace("delete got write lock");try{await this.store.delete(e)}finally{this.log.trace("delete release write lock"),r()}}async has(e){this.log.trace("has await read lock");let r=await this.store.lock.readLock();this.log.trace("has got read lock");try{return await this.store.has(e)}finally{this.log.trace("has release read lock"),r()}}async get(e){this.log.trace("get await read lock");let r=await this.store.lock.readLock();this.log.trace("get got read lock");try{return await this.store.load(e)}finally{this.log.trace("get release read lock"),r()}}async save(e,r){this.log.trace("save await write lock");let n=await this.store.lock.writeLock();this.log.trace("save got write lock");try{let i=await this.store.save(e,r);return this.#e(e,i),i.peer}finally{this.log.trace("save release write lock"),n()}}async patch(e,r){this.log.trace("patch await write lock");let n=await this.store.lock.writeLock();this.log.trace("patch got write lock");try{let i=await this.store.patch(e,r);return this.#e(e,i),i.peer}finally{this.log.trace("patch release write lock"),n()}}async merge(e,r){this.log.trace("merge await write lock");let n=await this.store.lock.writeLock();this.log.trace("merge got write lock");try{let i=await this.store.merge(e,r);return this.#e(e,i),i.peer}finally{this.log.trace("merge release write lock"),n()}}async consumePeerRecord(e,r){let n=await Wn.openAndCertify(e,hn.DOMAIN);if(r?.equals(n.peerId)===!1)return this.log("envelope peer id was not the expected peer id - expected: %p received: %p",r,n.peerId),!1;let i=hn.createFromProtobuf(n.payload),s;try{s=await this.get(n.peerId)}catch(o){if(o.code!=="ERR_NOT_FOUND")throw o}if(s?.peerRecordEnvelope!=null){let o=await Wn.createFromProtobuf(s.peerRecordEnvelope),a=hn.createFromProtobuf(o.payload);if(a.seqNumber>=i.seqNumber)return this.log("sequence number was lower or equal to existing sequence number - stored: %d received: %d",a.seqNumber,i.seqNumber),!1}return await this.patch(i.peerId,{peerRecordEnvelope:e,addresses:i.multiaddrs.map(o=>({isCertified:!0,multiaddr:o}))}),!0}#e(e,r){r.updated&&(this.peerId.equals(e)?this.events.safeDispatchEvent("self:peer:update",{detail:r}):this.events.safeDispatchEvent("peer:update",{detail:r}))}};function Iw(t){return t[Symbol.asyncIterator]!=null}function Rw(t){if(Iw(t))return(async()=>{for await(let e of t);})();for(let e of t);}var Hu=Rw;function Cw(t){let[e,r]=t[Symbol.asyncIterator]!=null?[t[Symbol.asyncIterator](),Symbol.asyncIterator]:[t[Symbol.iterator](),Symbol.iterator],n=[];return{peek:()=>e.next(),push:i=>{n.push(i)},next:()=>n.length>0?{done:!1,value:n.shift()}:e.next(),[r](){return this}}}var vo=Cw;function Tw(t){return t[Symbol.asyncIterator]!=null}function Bw(t,e){if(Tw(t))return async function*(){for await(let a of t)await e(a)&&(yield a)}();let r=vo(t),{value:n,done:i}=r.next();if(i===!0)return function*(){}();let s=e(n);if(typeof s.then=="function")return async function*(){await s&&(yield n);for await(let a of r)await e(a)&&(yield a)}();let o=e;return function*(){s===!0&&(yield n);for(let a of r)o(a)&&(yield a)}()}var Ut=Bw;function Lw(t){return t[Symbol.asyncIterator]!=null}function Pw(t,e){return Lw(t)?async function*(){yield*(await Ki(t)).sort(e)}():function*(){yield*Ki(t).sort(e)}()}var Gu=Pw;function Dw(t){return t[Symbol.asyncIterator]!=null}function Nw(t,e){return Dw(t)?async function*(){let r=0;if(!(e<1)){for await(let n of t)if(yield n,r++,r===e)return}}():function*(){let r=0;if(!(e<1)){for(let n of t)if(yield n,r++,r===e)return}}()}var Wu=Nw;var _o=class{put(e,r,n){return Promise.reject(new Error(".put is not implemented"))}get(e,r){return Promise.reject(new Error(".get is not implemented"))}has(e,r){return Promise.reject(new Error(".has is not implemented"))}delete(e,r){return Promise.reject(new Error(".delete is not implemented"))}async*putMany(e,r={}){for await(let{key:n,value:i}of e)await this.put(n,i,r),yield n}async*getMany(e,r={}){for await(let n of e)yield{key:n,value:await this.get(n,r)}}async*deleteMany(e,r={}){for await(let n of e)await this.delete(n,r),yield n}batch(){let e=[],r=[];return{put(n,i){e.push({key:n,value:i})},delete(n){r.push(n)},commit:async n=>{await Hu(this.putMany(e,n)),e=[],await Hu(this.deleteMany(r,n)),r=[]}}}async*_all(e,r){throw new Error("._all is not implemented")}async*_allKeys(e,r){throw new Error("._allKeys is not implemented")}query(e,r){let n=this._all(e,r);if(e.prefix!=null){let i=e.prefix;n=Ut(n,s=>s.key.toString().startsWith(i))}if(Array.isArray(e.filters)&&(n=e.filters.reduce((i,s)=>Ut(i,s),n)),Array.isArray(e.orders)&&(n=e.orders.reduce((i,s)=>Gu(i,s),n)),e.offset!=null){let i=0,s=e.offset;n=Ut(n,()=>i++>=s)}return e.limit!=null&&(n=Wu(n,e.limit)),n}queryKeys(e,r){let n=this._allKeys(e,r);if(e.prefix!=null){let i=e.prefix;n=Ut(n,s=>s.toString().startsWith(i))}if(Array.isArray(e.filters)&&(n=e.filters.reduce((i,s)=>Ut(i,s),n)),Array.isArray(e.orders)&&(n=e.orders.reduce((i,s)=>Gu(i,s),n)),e.offset!=null){let i=e.offset,s=0;n=Ut(n,()=>s++>=i)}return e.limit!=null&&(n=Wu(n,e.limit)),n}};var zd=ve(Yu(),1);function Hd(t){return t=t??new Error("Not Found"),(0,zd.default)(t,"ERR_NOT_FOUND")}var So=class extends _o{data;constructor(){super(),this.data=new Map}put(e,r){return this.data.set(e.toString(),r),e}get(e){let r=this.data.get(e.toString());if(r==null)throw Hd();return r}has(e){return this.data.has(e.toString())}delete(e){this.data.delete(e.toString())}*_all(){for(let[e,r]of this.data.entries())yield{key:new mn(e),value:r}}*_allKeys(){for(let e of this.data.keys())yield new mn(e)}};function Gd(t,e){let r;return function(){let n=function(){r=void 0,t()};clearTimeout(r),r=setTimeout(n,e)}}var Mw=t=>t;function Qu(t,e){let r=t.getPeerId();return r!=null&&ce(r).equals(e)&&(t=t.decapsulate(Ue(`/p2p/${e.toString()}`))),t}var Ao=class{log;components;listen;announce;observed;announceFilter;constructor(e,r={}){let{listen:n=[],announce:i=[]}=r;this.components=e,this.log=e.logger.forComponent("libp2p:address-manager"),this.listen=n.map(s=>s.toString()),this.announce=new Set(i.map(s=>s.toString())),this.observed=new Map,this.announceFilter=r.announceFilter??Mw,this._updatePeerStoreAddresses=Gd(this._updatePeerStoreAddresses.bind(this),1e3),e.events.addEventListener("transport:listening",()=>{this._updatePeerStoreAddresses()}),e.events.addEventListener("transport:close",()=>{this._updatePeerStoreAddresses()})}_updatePeerStoreAddresses(){let e=this.getAnnounceAddrs().concat(this.components.transportManager.getAddrs()).concat([...this.observed.entries()].filter(([r,n])=>n.confident).map(([r])=>Ue(r))).map(r=>r.getPeerId()===this.components.peerId.toString()?r.decapsulate(`/p2p/${this.components.peerId.toString()}`):r);this.components.peerStore.patch(this.components.peerId,{multiaddrs:e}).catch(r=>{this.log.error("error updating addresses",r)})}getListenAddrs(){return Array.from(this.listen).map(e=>Ue(e))}getAnnounceAddrs(){return Array.from(this.announce).map(e=>Ue(e))}getObservedAddrs(){return Array.from(this.observed).map(([e])=>Ue(e))}addObservedAddr(e){e=Qu(e,this.components.peerId);let r=e.toString();this.observed.has(r)||this.observed.set(r,{confident:!1})}confirmObservedAddr(e){e=Qu(e,this.components.peerId);let r=e.toString(),i=(this.observed.get(r)??{confident:!1}).confident;this.observed.set(r,{confident:!0}),i||this._updatePeerStoreAddresses()}removeObservedAddr(e){e=Qu(e,this.components.peerId);let r=e.toString();this.observed.delete(r)}getAddresses(){let e=this.getAnnounceAddrs().map(n=>n.toString());e.length===0&&(e=this.components.transportManager.getAddrs().map(n=>n.toString())),e=e.concat(Array.from(this.observed).filter(([n,i])=>i.confident).map(([n])=>n));let r=new Set(e);return this.announceFilter(Array.from(r).map(n=>Ue(n))).map(n=>n.protos().pop()?.path===!0||n.getPeerId()===this.components.peerId.toString()?n:n.encapsulate(`/p2p/${this.components.peerId.toString()}`))}};function Wd(t){return t!=null&&typeof t.start=="function"&&typeof t.stop=="function"}var Xu=class{components={};_started=!1;constructor(e={}){this.components={};for(let[r,n]of Object.entries(e))this.components[r]=n;this.components.logger==null&&(this.components.logger=Ws())}isStarted(){return this._started}async _invokeStartableMethod(e){await Promise.all(Object.values(this.components).filter(r=>Wd(r)).map(async r=>{await r[e]?.()}))}async beforeStart(){await this._invokeStartableMethod("beforeStart")}async start(){await this._invokeStartableMethod("start"),this._started=!0}async afterStart(){await this._invokeStartableMethod("afterStart")}async beforeStop(){await this._invokeStartableMethod("beforeStop")}async stop(){await this._invokeStartableMethod("stop"),this._started=!1}async afterStop(){await this._invokeStartableMethod("afterStop")}},Uw=["metrics","connectionProtector"],Fw=["components","isStarted","beforeStart","start","afterStart","beforeStop","stop","afterStop","then","_invokeStartableMethod"];function Yd(t={}){let e=new Xu(t);return new Proxy(e,{get(n,i,s){if(typeof i=="string"&&!Fw.includes(i)){let o=e.components[i];if(o==null&&!Uw.includes(i))throw new S(`${i} not set`,"ERR_SERVICE_MISSING");return o}return Reflect.get(n,i,s)},set(n,i,s){return typeof i=="string"?e.components[i]=s:Reflect.set(n,i,s),!0}})}var tp=ve(Qd(),1);var Xd="[a-fA-F\\d:]",Mr=t=>t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=${Xd})|(?<=${Xd})(?=\\s|$))`:"",Ft="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",ke="[a-fA-F\\d]{1,4}",Io=` -(?: -(?:${ke}:){7}(?:${ke}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 -(?:${ke}:){6}(?:${Ft}|:${ke}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 -(?:${ke}:){5}(?::${Ft}|(?::${ke}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4 -(?:${ke}:){4}(?:(?::${ke}){0,1}:${Ft}|(?::${ke}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4 -(?:${ke}:){3}(?:(?::${ke}){0,2}:${Ft}|(?::${ke}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4 -(?:${ke}:){2}(?:(?::${ke}){0,3}:${Ft}|(?::${ke}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4 -(?:${ke}:){1}(?:(?::${ke}){0,4}:${Ft}|(?::${ke}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 -(?::(?:(?::${ke}){0,5}:${Ft}|(?::${ke}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 -)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1 -`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),Kw=new RegExp(`(?:^${Ft}$)|(?:^${Io}$)`),qw=new RegExp(`^${Ft}$`),Vw=new RegExp(`^${Io}$`),Zu=t=>t&&t.exact?Kw:new RegExp(`(?:${Mr(t)}${Ft}${Mr(t)})|(?:${Mr(t)}${Io}${Mr(t)})`,"g");Zu.v4=t=>t&&t.exact?qw:new RegExp(`${Mr(t)}${Ft}${Mr(t)}`,"g");Zu.v6=t=>t&&t.exact?Vw:new RegExp(`${Mr(t)}${Io}${Mr(t)}`,"g");var Zd=Zu;var rp=ve(Jd(),1),{isValid:$w,parse:zw}=rp.default,Hw=["0.0.0.0/8","10.0.0.0/8","100.64.0.0/10","127.0.0.0/8","169.254.0.0/16","172.16.0.0/12","192.0.0.0/24","192.0.0.0/29","192.0.0.8/32","192.0.0.9/32","192.0.0.10/32","192.0.0.170/32","192.0.0.171/32","192.0.2.0/24","192.31.196.0/24","192.52.193.0/24","192.88.99.0/24","192.168.0.0/16","192.175.48.0/24","198.18.0.0/15","198.51.100.0/24","203.0.113.0/24","240.0.0.0/4","255.255.255.255/32"],Gw=Hw.map(t=>new tp.Netmask(t));function Ww(t){for(let e of Gw)if(e.contains(t))return!0;return!1}function ep(t){return/^::$/.test(t)||/^::1$/.test(t)||/^::f{4}:([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(t)||/^::f{4}:0.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(t)||/^64:ff9b::([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(t)||/^100::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2001::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2001:2[0-9a-fA-F]:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2001:db8:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2002:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^f[c-d]([0-9a-fA-F]{2,2}):/i.test(t)||/^fe[8-9a-bA-B][0-9a-fA-F]:/i.test(t)||/^ff([0-9a-fA-F]{2,2}):/i.test(t)}var np=t=>{if($w(t)){let e=zw(t);if(e.kind()==="ipv4")return Ww(e.toNormalizedString());if(e.kind()==="ipv6")return ep(t)}else if(Qn(t)&&Zd.v6().test(t))return ep(t)};var Co=np;function ip(t={}){return{denyDialPeer:async()=>!1,denyDialMultiaddr:async e=>{let r=e.stringTuples();return r[0][0]===4||r[0][0]===41?!!Co(`${r[0][1]}`):!1},denyInboundConnection:async()=>!1,denyOutboundConnection:async()=>!1,denyInboundEncryptedConnection:async()=>!1,denyOutboundEncryptedConnection:async()=>!1,denyInboundUpgradedConnection:async()=>!1,denyOutboundUpgradedConnection:async()=>!1,filterMultiaddrForPeer:async()=>!0,...t}}var $T=Symbol.for("@libp2p/transport");var Ur;(function(t){t[t.FATAL_ALL=0]="FATAL_ALL",t[t.NO_FATAL=1]="NO_FATAL"})(Ur||(Ur={}));var Yw=t=>t.toString().split("/").slice(1),Qi=t=>({match:e=>e.length<1?!1:t(e[0])?e.slice(1):!1,pattern:"fn"}),Le=t=>({match:e=>Qi(r=>r===t).match(e),pattern:t}),Lo=()=>({match:t=>Qi(e=>typeof e=="string").match(t),pattern:"{string}"}),sp=()=>({match:t=>Qi(e=>!isNaN(parseInt(e))).match(t),pattern:"{number}"}),Rt=()=>({match:t=>{if(t.length<2||t[0]!=="p2p"&&t[0]!=="ipfs")return!1;if(t[1].startsWith("Q")||t[1].startsWith("1"))try{_e.decode(`z${t[1]}`)}catch{return!1}else return!1;return t.slice(2)},pattern:"/p2p/{peerid}"}),To=()=>({match:t=>{if(t.length<2||t[0]!=="certhash")return!1;try{Ga.decode(t[1])}catch{return!1}return t.slice(2)},pattern:"/certhash/{certhash}"}),Xt=t=>({match:e=>{let r=t.match(e);return r===!1?e:r},pattern:`optional(${t.pattern})`}),Zt=(...t)=>({match:e=>{let r;for(let n of t){let i=n.match(e);i!==!1&&(r==null||i.lengthe.pattern).join(", ")})`}),Pe=(...t)=>({match:e=>{for(let r of t){let n=r.match(e);if(n===!1)return!1;e=n}return e},pattern:`and(${t.map(e=>e.pattern).join(", ")})`});function Fe(...t){function e(i){let s=Yw(i);for(let o of t){let a=o.match(s);if(a===!1)return!1;s=a}return s}function r(i){return e(i)!==!1}function n(i){let s=e(i);return s===!1?!1:s.length===0}return{matches:r,exactMatch:n}}var Ju=Pe(Le("dns4"),Lo()),el=Pe(Le("dns6"),Lo()),tl=Pe(Le("dnsaddr"),Lo()),op=Pe(Le("dns"),Lo()),QT=Fe(Ju),XT=Fe(el),ZT=Fe(tl),jT=Fe(Zt(op,tl,Ju,el)),ap=Pe(Le("ip4"),Qi(Js)),cp=Pe(Le("ip6"),Qi(eo)),up=Zt(ap,cp),Xi=Zt(up,op,Ju,el,tl),JT=Fe(Xi),e3=Fe(ap),t3=Fe(cp),r3=Fe(up),Po=Pe(Xi,Le("tcp"),sp()),Zi=Pe(Xi,Le("udp"),sp()),Qw=Zt(Po,Zi),n3=Fe(Po),i3=Fe(Zi),rl=Pe(Zi,Le("quic")),Do=Pe(Zi,Le("quic-v1")),Xw=Zt(rl,Do),s3=Fe(rl),o3=Fe(Do),ju=Zt(Xi,Po,Zi,rl,Do),lp=Zt(Pe(ju,Le("ws"),Xt(Rt()))),a3=Fe(lp),fp=Zt(Pe(ju,Le("wss"),Xt(Rt())),Pe(ju,Le("tls"),Le("ws"),Xt(Rt()))),c3=Fe(fp),hp=Pe(Qw,Le("webrtc-direct"),To(),Xt(To()),Xt(Rt())),u3=Fe(hp),dp=Pe(Do,Le("webtransport"),To(),To(),Xt(Rt())),l3=Fe(dp),Bo=Zt(lp,fp,Pe(Po,Xt(Rt())),Pe(Xw,Xt(Rt())),Pe(Xi,Xt(Rt())),hp,dp,Rt()),f3=Fe(Bo),Zw=Pe(Bo,Le("p2p-circuit"),Rt()),nl=Fe(Zw),jw=Zt(Pe(Bo,Le("p2p-circuit"),Le("webrtc"),Rt()),Pe(Bo,Le("webrtc"),Xt(Rt())),Le("webrtc")),h3=Fe(jw);function il(t){try{let{address:e}=t.nodeAddress();return!!Co(e)}catch{return!0}}function Jw(t,e){let r=il(t.multiaddr),n=il(e.multiaddr);return r&&!n?1:!r&&n?-1:0}function eE(t,e){return t.isCertified&&!e.isCertified?-1:!t.isCertified&&e.isCertified?1:0}function tE(t,e){let r=nl.exactMatch(t.multiaddr),n=nl.exactMatch(e.multiaddr);return r&&!n?1:!r&&n?-1:0}function ti(t,e){let r=Jw(t,e);if(r!==0)return r;let n=tE(t,e);return n!==0?n:eE(t,e)}var ol=ve(tu(),1),al=ve(gp(),1);function No(t,e,r){return`${t}?name=${e}&type=${r}`}async function yp(t,e){return await(await fetch(t,{headers:new Headers({accept:"application/dns-json"}),signal:e})).json()}function gn(t,e){return`${e}_${t}`}var sl=Object.assign((0,ol.default)("dns-over-http-resolver"),{error:(0,ol.default)("dns-over-http-resolver:error")}),cl=class{_cache;_TXTcache;_servers;_request;_abortControllers;constructor(e={}){this._cache=new al.default({max:e?.maxCache??100}),this._TXTcache=new al.default({max:e?.maxCache??100}),this._servers=["https://cloudflare-dns.com/dns-query","https://dns.google/resolve"],this._request=e.request??yp,this._abortControllers=[]}cancel(){this._abortControllers.forEach(e=>{e.abort()})}getServers(){return this._servers}_getShuffledServers(){let e=[...this._servers];for(let r=e.length-1;r>0;r--){let n=Math.floor(Math.random()*r),i=e[r];e[r]=e[n],e[n]=i}return e}setServers(e){this._servers=e}async resolve(e,r="A"){switch(r){case"A":return this.resolve4(e);case"AAAA":return this.resolve6(e);case"TXT":return this.resolveTxt(e);default:throw new Error(`${r} is not supported`)}}async resolve4(e){let r="A",n=this._cache.get(gn(e,r));if(n!=null)return n;let i=!1;for(let s of this._getShuffledServers()){let o=new AbortController;this._abortControllers.push(o);try{let a=await this._request(No(s,e,r),o.signal),c=a.Answer.map(l=>l.data),u=Math.min(...a.Answer.map(l=>l.TTL));return this._cache.set(gn(e,r),c,{ttl:u}),c}catch{o.signal.aborted&&(i=!0),sl.error(`${s} could not resolve ${e} record ${r}`)}finally{this._abortControllers=this._abortControllers.filter(a=>a!==o)}}throw i?Object.assign(new Error("queryA ECANCELLED"),{code:"ECANCELLED"}):new Error(`Could not resolve ${e} record ${r}`)}async resolve6(e){let r="AAAA",n=this._cache.get(gn(e,r));if(n!=null)return n;let i=!1;for(let s of this._getShuffledServers()){let o=new AbortController;this._abortControllers.push(o);try{let a=await this._request(No(s,e,r),o.signal),c=a.Answer.map(l=>l.data),u=Math.min(...a.Answer.map(l=>l.TTL));return this._cache.set(gn(e,r),c,{ttl:u}),c}catch{o.signal.aborted&&(i=!0),sl.error(`${s} could not resolve ${e} record ${r}`)}finally{this._abortControllers=this._abortControllers.filter(a=>a!==o)}}throw i?Object.assign(new Error("queryAaaa ECANCELLED"),{code:"ECANCELLED"}):new Error(`Could not resolve ${e} record ${r}`)}async resolveTxt(e){let r="TXT",n=this._TXTcache.get(gn(e,r));if(n!=null)return n;let i=!1;for(let s of this._getShuffledServers()){let o=new AbortController;this._abortControllers.push(o);try{let a=await this._request(No(s,e,r),o.signal),c=a.Answer.map(l=>[l.data.replace(/['"]+/g,"")]),u=Math.min(...a.Answer.map(l=>l.TTL));return this._TXTcache.set(gn(e,r),c,{ttl:u}),c}catch{o.signal.aborted&&(i=!0),sl.error(`${s} could not resolve ${e} record ${r}`)}finally{this._abortControllers=this._abortControllers.filter(a=>a!==o)}}throw i?Object.assign(new Error("queryTxt ECANCELLED"),{code:"ECANCELLED"}):new Error(`Could not resolve ${e} record ${r}`)}clearCache(){this._cache.clear(),this._TXTcache.clear()}},xp=cl;var bp=xp;var{code:oE}=fe("dnsaddr");async function ri(t,e={}){let r=new bp;e.signal!=null&&e.signal.addEventListener("abort",()=>{r.cancel()});let n=t.getPeerId(),[,i]=t.stringTuples().find(([a])=>a===oE)??[];if(i==null)throw new Error("No hostname found in multiaddr");let o=(await r.resolveTxt(`_dnsaddr.${i}`)).flat().map(a=>a.split("=")[1]).filter(Boolean);return n!=null&&(o=o.filter(a=>a.includes(n))),o}var Cp=ve(Rp(),1),Mo=Cp.default;var jt;(function(t){t.NOT_STARTED_YET="The libp2p node is not started yet",t.DHT_DISABLED="DHT is not available",t.PUBSUB_DISABLED="PubSub is not available",t.CONN_ENCRYPTION_REQUIRED="At least one connection encryption module is required",t.ERR_TRANSPORTS_REQUIRED="At least one transport module is required",t.ERR_PROTECTOR_REQUIRED="Private network is enforced, but no protector was provided",t.NOT_FOUND="Not found"})(jt||(jt={}));var F;(function(t){t.DHT_DISABLED="ERR_DHT_DISABLED",t.ERR_PUBSUB_DISABLED="ERR_PUBSUB_DISABLED",t.PUBSUB_NOT_STARTED="ERR_PUBSUB_NOT_STARTED",t.DHT_NOT_STARTED="ERR_DHT_NOT_STARTED",t.CONN_ENCRYPTION_REQUIRED="ERR_CONN_ENCRYPTION_REQUIRED",t.ERR_TRANSPORTS_REQUIRED="ERR_TRANSPORTS_REQUIRED",t.ERR_PROTECTOR_REQUIRED="ERR_PROTECTOR_REQUIRED",t.ERR_PEER_DIAL_INTERCEPTED="ERR_PEER_DIAL_INTERCEPTED",t.ERR_CONNECTION_INTERCEPTED="ERR_CONNECTION_INTERCEPTED",t.ERR_INVALID_PROTOCOLS_FOR_STREAM="ERR_INVALID_PROTOCOLS_FOR_STREAM",t.ERR_CONNECTION_ENDED="ERR_CONNECTION_ENDED",t.ERR_CONNECTION_FAILED="ERR_CONNECTION_FAILED",t.ERR_NODE_NOT_STARTED="ERR_NODE_NOT_STARTED",t.ERR_ALREADY_ABORTED="ERR_ALREADY_ABORTED",t.ERR_TOO_MANY_ADDRESSES="ERR_TOO_MANY_ADDRESSES",t.ERR_NO_VALID_ADDRESSES="ERR_NO_VALID_ADDRESSES",t.ERR_RELAYED_DIAL="ERR_RELAYED_DIAL",t.ERR_DIALED_SELF="ERR_DIALED_SELF",t.ERR_DISCOVERED_SELF="ERR_DISCOVERED_SELF",t.ERR_DUPLICATE_TRANSPORT="ERR_DUPLICATE_TRANSPORT",t.ERR_ENCRYPTION_FAILED="ERR_ENCRYPTION_FAILED",t.ERR_HOP_REQUEST_FAILED="ERR_HOP_REQUEST_FAILED",t.ERR_INVALID_KEY="ERR_INVALID_KEY",t.ERR_INVALID_MESSAGE="ERR_INVALID_MESSAGE",t.ERR_INVALID_PARAMETERS="ERR_INVALID_PARAMETERS",t.ERR_INVALID_PEER="ERR_INVALID_PEER",t.ERR_MUXER_UNAVAILABLE="ERR_MUXER_UNAVAILABLE",t.ERR_NOT_FOUND="ERR_NOT_FOUND",t.ERR_TRANSPORT_UNAVAILABLE="ERR_TRANSPORT_UNAVAILABLE",t.ERR_TRANSPORT_DIAL_FAILED="ERR_TRANSPORT_DIAL_FAILED",t.ERR_UNSUPPORTED_PROTOCOL="ERR_UNSUPPORTED_PROTOCOL",t.ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED="ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED",t.ERR_INVALID_MULTIADDR="ERR_INVALID_MULTIADDR",t.ERR_SIGNATURE_NOT_VALID="ERR_SIGNATURE_NOT_VALID",t.ERR_FIND_SELF="ERR_FIND_SELF",t.ERR_NO_ROUTERS_AVAILABLE="ERR_NO_ROUTERS_AVAILABLE",t.ERR_CONNECTION_NOT_MULTIPLEXED="ERR_CONNECTION_NOT_MULTIPLEXED",t.ERR_NO_DIAL_TOKENS="ERR_NO_DIAL_TOKENS",t.ERR_INVALID_CMS="ERR_INVALID_CMS",t.ERR_MISSING_KEYS="ERR_MISSING_KEYS",t.ERR_NO_KEY="ERR_NO_KEY",t.ERR_INVALID_KEY_NAME="ERR_INVALID_KEY_NAME",t.ERR_INVALID_KEY_TYPE="ERR_INVALID_KEY_TYPE",t.ERR_KEY_ALREADY_EXISTS="ERR_KEY_ALREADY_EXISTS",t.ERR_INVALID_KEY_SIZE="ERR_INVALID_KEY_SIZE",t.ERR_KEY_NOT_FOUND="ERR_KEY_NOT_FOUND",t.ERR_OLD_KEY_NAME_INVALID="ERR_OLD_KEY_NAME_INVALID",t.ERR_NEW_KEY_NAME_INVALID="ERR_NEW_KEY_NAME_INVALID",t.ERR_PASSWORD_REQUIRED="ERR_PASSWORD_REQUIRED",t.ERR_PEM_REQUIRED="ERR_PEM_REQUIRED",t.ERR_CANNOT_READ_KEY="ERR_CANNOT_READ_KEY",t.ERR_MISSING_PRIVATE_KEY="ERR_MISSING_PRIVATE_KEY",t.ERR_MISSING_PUBLIC_KEY="ERR_MISSING_PUBLIC_KEY",t.ERR_INVALID_OLD_PASS_TYPE="ERR_INVALID_OLD_PASS_TYPE",t.ERR_INVALID_NEW_PASS_TYPE="ERR_INVALID_NEW_PASS_TYPE",t.ERR_INVALID_PASS_LENGTH="ERR_INVALID_PASS_LENGTH",t.ERR_NOT_IMPLEMENTED="ERR_NOT_IMPLEMENTED",t.ERR_WRONG_PING_ACK="ERR_WRONG_PING_ACK",t.ERR_INVALID_RECORD="ERR_INVALID_RECORD",t.ERR_ALREADY_SUCCEEDED="ERR_ALREADY_SUCCEEDED",t.ERR_NO_HANDLER_FOR_PROTOCOL="ERR_NO_HANDLER_FOR_PROTOCOL",t.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS="ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS",t.ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS="ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS",t.ERR_CONNECTION_DENIED="ERR_CONNECTION_DENIED",t.ERR_TRANSFER_LIMIT_EXCEEDED="ERR_TRANSFER_LIMIT_EXCEEDED"})(F||(F={}));var hE={addresses:{listen:[],announce:[],noAnnounce:[],announceFilter:t=>t},connectionManager:{resolvers:{dnsaddr:ri},addressSorter:ti},transportManager:{faultTolerance:Ur.FATAL_ALL}};function Tp(t){let e=Mo(hE,t);if(e.transports==null||e.transports.length<1)throw new S(jt.ERR_TRANSPORTS_REQUIRED,F.ERR_TRANSPORTS_REQUIRED);if(e.connectionProtector===null&&globalThis.process?.env?.LIBP2P_FORCE_PNET!=null)throw new S(jt.ERR_PROTECTOR_REQUIRED,F.ERR_PROTECTOR_REQUIRED);return e}var Bp="keep-alive";var Cm=ve(Sm(),1);function Fo(t){if(Ys(t))return{peerId:t,multiaddrs:[]};Array.isArray(t)||(t=[t]);let e;if(t.length>0){let r=t[0].getPeerId();e=r==null?void 0:ce(r),t.forEach(n=>{if(!Lr(n))throw new S("Invalid Multiaddr",F.ERR_INVALID_MULTIADDR);let i=n.getPeerId();if(i==null){if(e!=null)throw new S("Multiaddrs must all have the same peer id or have no peer id",F.ERR_INVALID_PARAMETERS)}else{let s=ce(i);if(e==null||!e.equals(s))throw new S("Multiaddrs must all have the same peer id or have no peer id",F.ERR_INVALID_PARAMETERS)}})}return{peerId:e,multiaddrs:t}}function YE(t,e,r){let n=0,i=t.length;for(;i>0;){let s=Math.trunc(i/2),o=n+s;r(t[o],e)<=0?(n=++o,i-=s+1):i=s}return n}var Al=class{#e=[];enqueue(e,r){let n=r?.peerId,i=r?.priority??0;if(n==null)throw new S("missing peer id",m0);let s={priority:i,peerId:n,run:e};if(this.size>0&&this.#e[this.size-1].priority>=i){this.#e.push(s);return}let o=YE(this.#e,s,(a,c)=>c.priority-a.priority);this.#e.splice(o,0,s)}dequeue(){return this.#e.shift()?.run}filter(e){if(e.peerId!=null){let r=e.peerId;return this.#e.filter(n=>r.equals(n.peerId)).map(n=>n.run)}return this.#e.filter(r=>r.priority===e.priority).map(r=>r.run)}get size(){return this.#e.length}},Ko=class extends Nr{constructor(e={}){super({...e,queueClass:Al})}hasJob(e){return this.sizeBy({peerId:e})>0}};var qo="last-dial-failure";var Vo=5,$o=100,zo=50,Am=1e3*60*7;var yn={minConnections:Vo,maxQueueLength:100,autoDialConcurrency:25,autoDialPriority:0,autoDialInterval:5e3,autoDialPeerRetryThreshold:Am,autoDialDiscoveredPeersDebounce:10},Ho=class{connectionManager;peerStore;queue;minConnections;autoDialPriority;autoDialIntervalMs;autoDialMaxQueueLength;autoDialPeerRetryThresholdMs;autoDialDiscoveredPeersDebounce;autoDialInterval;started;running;log;constructor(e,r){this.connectionManager=e.connectionManager,this.peerStore=e.peerStore,this.minConnections=r.minConnections??yn.minConnections,this.autoDialPriority=r.autoDialPriority??yn.autoDialPriority,this.autoDialIntervalMs=r.autoDialInterval??yn.autoDialInterval,this.autoDialMaxQueueLength=r.maxQueueLength??yn.maxQueueLength,this.autoDialPeerRetryThresholdMs=r.autoDialPeerRetryThreshold??yn.autoDialPeerRetryThreshold,this.autoDialDiscoveredPeersDebounce=r.autoDialDiscoveredPeersDebounce??yn.autoDialDiscoveredPeersDebounce,this.log=e.logger.forComponent("libp2p:connection-manager:auto-dial"),this.started=!1,this.running=!1,this.queue=new Ko({concurrency:r.autoDialConcurrency??yn.autoDialConcurrency}),this.queue.addListener("error",i=>{this.log.error("error during auto-dial",i)}),e.events.addEventListener("connection:close",()=>{this.autoDial().catch(i=>{this.log.error(i)})});let n;e.events.addEventListener("peer:discovery",()=>{clearTimeout(n),n=setTimeout(()=>{this.autoDial().catch(i=>{this.log.error(i)})},this.autoDialDiscoveredPeersDebounce)})}isStarted(){return this.started}start(){this.autoDialInterval=setTimeout(()=>{this.autoDial().catch(e=>{this.log.error("error while autodialing",e)})},this.autoDialIntervalMs),this.started=!0}afterStart(){this.autoDial().catch(e=>{this.log.error("error while autodialing",e)})}stop(){this.queue.clear(),clearTimeout(this.autoDialInterval),this.started=!1,this.running=!1}async autoDial(){if(!this.started)return;let e=this.connectionManager.getConnectionsMap(),r=e.size;if(r>=this.minConnections){this.minConnections>0&&this.log.trace("have enough connections %d/%d",r,this.minConnections);return}if(this.queue.size>this.autoDialMaxQueueLength){this.log("not enough connections %d/%d but auto dial queue is full",r,this.minConnections);return}if(this.running){this.log("not enough connections %d/%d - but skipping autodial as it is already running",r,this.minConnections);return}this.running=!0,this.log("not enough connections %d/%d - will dial peers to increase the number of connections",r,this.minConnections);let n=new ln(this.connectionManager.getDialQueue().map(u=>u.peerId).filter(Boolean)),i=await this.peerStore.all({filters:[u=>u.addresses.length===0?(this.log.trace("not autodialing %p because they have no addresses",u.id),!1):e.has(u.id)?(this.log.trace("not autodialing %p because they are already connected",u.id),!1):n.has(u.id)?(this.log.trace("not autodialing %p because they are already being dialed",u.id),!1):this.queue.hasJob(u.id)?(this.log.trace("not autodialing %p because they are already being autodialed",u.id),!1):!0]}),s=i.sort(()=>Math.random()>.5?1:-1),o=new wt;for(let u of s)o.has(u.id)||o.set(u.id,[...u.tags.values()].reduce((l,f)=>l+f.value,0));let c=s.sort((u,l)=>{let f=o.get(u.id)??0,h=o.get(l.id)??0;return f>h?-1:f{let l=u.metadata.get(qo);if(l==null)return!0;let f=parseInt(se(l));return isNaN(f)?!0:Date.now()-f>this.autoDialPeerRetryThresholdMs});this.log("selected %d/%d peers to dial",c.length,i.length);for(let u of c)this.queue.add(async()=>{let l=this.connectionManager.getConnectionsMap().size;if(l>=this.minConnections){this.log("got enough connections now %d/%d",l,this.minConnections),this.queue.clear();return}this.log("connecting to a peerStore stored peer %p",u.id),await this.connectionManager.openConnection(u.id,{priority:this.autoDialPriority})},{peerId:u.id}).catch(l=>{this.log.error("could not connect to peerStore stored peer",l)});this.running=!1,this.started&&(this.autoDialInterval=setTimeout(()=>{this.autoDial().catch(u=>{this.log.error("error while autodialing",u)})},this.autoDialIntervalMs))}};var Im={maxConnections:$o,allow:[]},Go=class{maxConnections;connectionManager;peerStore;allow;events;log;constructor(e,r={}){this.maxConnections=r.maxConnections??Im.maxConnections,this.allow=r.allow??Im.allow,this.connectionManager=e.connectionManager,this.peerStore=e.peerStore,this.events=e.events,this.log=e.logger.forComponent("libp2p:connection-manager:connection-pruner"),e.events.addEventListener("connection:open",()=>{this.maybePruneConnections().catch(n=>{this.log.error(n)})})}async maybePruneConnections(){let e=this.connectionManager.getConnections(),r=e.length,n=Math.max(r-this.maxConnections,0);if(this.log("checking max connections limit %d/%d",r,this.maxConnections),r<=this.maxConnections)return;this.log("max connections limit exceeded %d/%d, pruning %d connection(s)",r,this.maxConnections,n);let i=new wt;for(let a of e){let c=a.remotePeer;if(!i.has(c)){i.set(c,0);try{let u=await this.peerStore.get(c);i.set(c,[...u.tags.values()].reduce((l,f)=>l+f.value,0))}catch(u){u.code!=="ERR_NOT_FOUND"&&this.log.error("error loading peer tags",u)}}}let s=e.sort((a,c)=>{let u=i.get(a.remotePeer)??0,l=i.get(c.remotePeer)??0;if(u>l)return 1;if(uh?-1:0}),o=[];for(let a of s)if(this.log("too many connections open - closing a connection to %p",a.remotePeer),this.allow.some(u=>a.remoteAddr.toString().startsWith(u.toString()))||o.push(a),o.length===n)break;await Promise.all(o.map(async a=>{try{await a.close()}catch(c){this.log.error(c)}})),this.events.safeDispatchEvent("connection:prune",{detail:o})}};function Wo(t){let e=new globalThis.AbortController;function r(){e.abort();for(let s of t)s?.removeEventListener!=null&&s.removeEventListener("abort",r)}for(let s of t){if(s?.aborted===!0){r();break}s?.addEventListener!=null&&s.addEventListener("abort",r)}function n(){for(let s of t)s?.removeEventListener!=null&&s.removeEventListener("abort",r)}let i=e.signal;return i.clear=n,i}function ut(){let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}async function Tl(t,e){if(!t.protoNames().includes("dnsaddr"))return[t];let n=await ZE(t,e),o=(await Promise.all(n.map(async a=>Tl(a,e)))).flat().reduce((a,c)=>(a.find(u=>u.equals(c))==null&&a.push(c),a),[]);return e.log("resolved %s to",t,o.map(a=>a.toString())),o}async function ZE(t,e){try{return t=Ue(t.toString()),await t.resolve(e)}catch(r){return e.log.error(`multiaddr ${t.toString()} could not be resolved`,r),[]}}function Rm(...t){let e=[];for(let n of t)n!=null&&(yt(1/0,n),e.push(n));let r=Wo(e);return yt(1/0,r),r}var Yo={addressSorter:ti,maxParallelDials:zo,maxPeerAddrsToDial:25,dialTimeout:3e4,resolvers:{dnsaddr:ri}},Qo=class{pendingDials;queue;peerId;peerStore;connectionGater;transportManager;addressSorter;maxPeerAddrsToDial;dialTimeout;inProgressDialCount;pendingDialCount;shutDownController;connections;log;constructor(e,r={}){this.addressSorter=r.addressSorter??Yo.addressSorter,this.maxPeerAddrsToDial=r.maxPeerAddrsToDial??Yo.maxPeerAddrsToDial,this.dialTimeout=r.dialTimeout??Yo.dialTimeout,this.connections=r.connections??new wt,this.log=e.logger.forComponent("libp2p:connection-manager:dial-queue"),this.peerId=e.peerId,this.peerStore=e.peerStore,this.connectionGater=e.connectionGater,this.transportManager=e.transportManager,this.shutDownController=new AbortController,yt(1/0,this.shutDownController.signal),this.pendingDialCount=e.metrics?.registerMetric("libp2p_dial_queue_pending_dials"),this.inProgressDialCount=e.metrics?.registerMetric("libp2p_dial_queue_in_progress_dials"),this.pendingDials=[];for(let[n,i]of Object.entries(r.resolvers??{}))ro.set(n,i);this.queue=new Nr({concurrency:r.maxParallelDials??Yo.maxParallelDials}),this.queue.on("add",()=>{this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)}),this.queue.on("active",()=>{this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)}),this.queue.on("completed",()=>{this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)}),this.queue.on("error",n=>{this.log.error("error in dial queue",n),this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)}),this.queue.on("empty",()=>{this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)}),this.queue.on("idle",()=>{this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)})}stop(){this.shutDownController.abort()}async dial(e,r={}){let{peerId:n,multiaddrs:i}=Fo(e),s=i.map(h=>({multiaddr:h,isCertified:!1})),o=this.createDialAbortControllers(r.signal),a;try{a=await this.calculateMultiaddrs(n,s,{...r,signal:o})}catch(h){throw o.clear(),h}let c=Array.from(this.connections.values()).flat().find(h=>r.force===!0?!1:a.find(p=>p.multiaddr.equals(h.remoteAddr)));if(c!=null)return this.log("already connected to %a",c.remoteAddr),c;let u=this.pendingDials.find(h=>!!(h.peerId!=null&&n!=null&&h.peerId.equals(n)||a.map(({multiaddr:p})=>p.toString()).join()===h.multiaddrs.map(p=>p.toString()).join()));if(u!=null)return this.log("joining existing dial target for %p",n),o.clear(),u.promise;this.log("creating dial target for",a.map(({multiaddr:h})=>h.toString()));let l={id:jE(),status:"queued",peerId:n,multiaddrs:a.map(({multiaddr:h})=>h)};l.promise=this.performDial(l,{...r,signal:o}).finally(()=>{this.pendingDials=this.pendingDials.filter(h=>h.id!==l.id),o.clear()}).catch(async h=>{if(this.log.error("dial failed to %s",l.multiaddrs.map(p=>p.toString()).join(", "),h),n!=null)try{await this.peerStore.patch(n,{metadata:{[qo]:Q(Date.now().toString())}})}catch(p){this.log.error("could not update last dial failure key for %p",n,p)}throw o.aborted?new S(h.message,vs):h}),this.pendingDials.push(l);let f=await l.promise;return c=Array.from(this.connections.values()).flat().find(h=>r.force===!0?!1:h.id!==f.id&&h.remoteAddr.equals(f.remoteAddr)),c!=null?(this.log("already connected to %a",c.remoteAddr),await f.close(),c):(this.log("connection opened to %a",f.remoteAddr),f)}createDialAbortControllers(e){let r=Wo([AbortSignal.timeout(this.dialTimeout),this.shutDownController.signal,e]);try{yt?.(1/0,r)}catch{}return r}async calculateMultiaddrs(e,r=[],n={}){if(e!=null){if(this.peerId.equals(e))throw new S("Tried to dial self",F.ERR_DIALED_SELF);if(await this.connectionGater.denyDialPeer?.(e)===!0)throw new S("The dial request is blocked by gater.allowDialPeer",F.ERR_PEER_DIAL_INTERCEPTED);if(r.length===0){this.log("loading multiaddrs for %p",e);try{let l=await this.peerStore.get(e);r.push(...l.addresses),this.log("loaded multiaddrs for %p",e,r.map(({multiaddr:f})=>f.toString()))}catch(l){if(l.code!==F.ERR_NOT_FOUND)throw l}}}let i=(await Promise.all(r.map(async l=>{let f=await Tl(l.multiaddr,{...n,log:this.log});return f.length===1&&f[0].equals(l.multiaddr)?l:f.map(h=>({multiaddr:h,isCertified:!1}))}))).flat();if(e!=null){let l=`/p2p/${e.toString()}`;i=i.map(f=>f.multiaddr.protos().pop()?.path===!0?f:f.multiaddr.getPeerId()==null?{multiaddr:f.multiaddr.encapsulate(l),isCertified:f.isCertified}:f)}let s=i.filter(l=>{if(this.transportManager.transportForMultiaddr(l.multiaddr)==null)return!1;let f=l.multiaddr.getPeerId();return e!=null&&f!=null?e.equals(f):!0}),o=new Map;for(let l of s){let f=l.multiaddr.toString(),h=o.get(f);if(h!=null){h.isCertified=h.isCertified||l.isCertified||!1;continue}o.set(f,l)}let a=[...o.values()];if((a.length===0||a.length>this.maxPeerAddrsToDial)&&(this.log("addresses for %p before filtering",e??"unknown peer",i.map(({multiaddr:l})=>l.toString())),this.log("addresses for %p after filtering",e??"unknown peer",a.map(({multiaddr:l})=>l.toString()))),a.length===0)throw new S("The dial request has no valid addresses",F.ERR_NO_VALID_ADDRESSES);if(a.length>this.maxPeerAddrsToDial)throw new S("dial with more addresses than allowed",F.ERR_TOO_MANY_ADDRESSES);let c=[];for(let l of a)this.connectionGater.denyDialMultiaddr!=null&&await this.connectionGater.denyDialMultiaddr(l.multiaddr)||c.push(l);let u=c.sort(this.addressSorter);if(u.length===0)throw new S("The connection gater denied all addresses in the dial request",F.ERR_NO_VALID_ADDRESSES);return u}async performDial(e,r={}){let n=e.multiaddrs.map(()=>new AbortController);try{let i=new Nr({concurrency:1});i.on("error",o=>{this.log.error("error dialing %s %o",e.multiaddrs,o)});let s=await Promise.any(e.multiaddrs.map(async(o,a)=>{let c=n[a];if(c==null)throw new S("dialAction did not come with an AbortController",F.ERR_INVALID_PARAMETERS);let u=Rm(c.signal,r.signal);u.addEventListener("abort",()=>{this.log("dial to %a aborted",o)});let l=ut();return await i.add(async()=>{if(u.aborted){this.log("dial to %a was aborted before reaching the head of the peer dial queue",o),l.reject(new Rn);return}await this.queue.add(async()=>{try{if(u.aborted){this.log("dial to %a was aborted before reaching the head of the dial queue",o),l.reject(new Rn);return}e.status="active";let f=await this.transportManager.dial(o,{...r,signal:u});if(c.signal.aborted){this.log("multiple dials succeeded, closing superfluous connection"),f.close().catch(h=>{this.log.error("error closing superfluous connection",h)}),l.reject(new Rn);return}n[a]=void 0,n.forEach(h=>{h!==void 0&&h.abort()}),this.log("dial to %a succeeded",o),l.resolve(f)}catch(f){this.log.error("error during dial of %a",o,f),l.reject(f)}},{...r,signal:u}).catch(f=>{l.reject(f)})},{signal:u}).catch(f=>{l.reject(f)}).finally(()=>{u.clear()}),l.promise}));if(s==null)throw new S("successful dial led to empty object returned from peer dial queue",F.ERR_TRANSPORT_DIAL_FAILED);return e.status="success",s}catch(i){throw e.status="error",e.multiaddrs.length===1&&i.name==="AggregateError"?i.errors[0]:i}}};function jE(){return`${parseInt(String(Math.random()*1e9),10).toString()}${Date.now()}`}var tv=50,xn={minConnections:Vo,maxConnections:$o,inboundConnectionThreshold:5,maxIncomingPendingConnections:10,autoDialConcurrency:25,autoDialPriority:0,autoDialMaxQueueLength:100},Xo=class{started;connections;allow;deny;maxIncomingPendingConnections;incomingPendingConnections;maxConnections;dialQueue;autoDial;connectionPruner;inboundConnectionRateLimiter;peerStore;metrics;events;log;constructor(e,r={}){this.maxConnections=r.maxConnections??xn.maxConnections;let n=r.minConnections??xn.minConnections;if(this.maxConnectionsUe(i)),this.deny=(r.deny??[]).map(i=>Ue(i)),this.incomingPendingConnections=0,this.maxIncomingPendingConnections=r.maxIncomingPendingConnections??xn.maxIncomingPendingConnections,this.inboundConnectionRateLimiter=new Cm.RateLimiterMemory({points:r.inboundConnectionThreshold??xn.inboundConnectionThreshold,duration:1}),this.autoDial=new Ho({connectionManager:this,peerStore:e.peerStore,events:e.events,logger:e.logger},{minConnections:n,autoDialConcurrency:r.autoDialConcurrency??xn.autoDialConcurrency,autoDialPriority:r.autoDialPriority??xn.autoDialPriority,maxQueueLength:r.autoDialMaxQueueLength??xn.autoDialMaxQueueLength}),this.connectionPruner=new Go({connectionManager:this,peerStore:e.peerStore,events:e.events,logger:e.logger},{maxConnections:this.maxConnections,allow:this.allow}),this.dialQueue=new Qo({peerId:e.peerId,metrics:e.metrics,peerStore:e.peerStore,transportManager:e.transportManager,connectionGater:e.connectionGater,logger:e.logger},{addressSorter:r.addressSorter??ti,maxParallelDials:r.maxParallelDials??zo,maxPeerAddrsToDial:r.maxPeerAddrsToDial??25,dialTimeout:r.dialTimeout??3e4,resolvers:r.resolvers??{dnsaddr:ri},connections:this.connections})}isStarted(){return this.started}async start(){this.metrics?.registerMetricGroup("libp2p_connection_manager_connections",{calculate:()=>{let e={inbound:0,outbound:0};for(let r of this.connections.values())for(let n of r)n.direction==="inbound"?e.inbound++:e.outbound++;return e}}),this.metrics?.registerMetricGroup("libp2p_protocol_streams_total",{label:"protocol",calculate:()=>{let e={};for(let r of this.connections.values())for(let n of r)for(let i of n.streams){let s=`${i.direction} ${i.protocol??"unnegotiated"}`;e[s]=(e[s]??0)+1}return e}}),this.metrics?.registerMetricGroup("libp2p_connection_manager_protocol_streams_per_connection_90th_percentile",{label:"protocol",calculate:()=>{let e={};for(let n of this.connections.values())for(let i of n){let s={};for(let o of i.streams){let a=`${o.direction} ${o.protocol??"unnegotiated"}`;s[a]=(s[a]??0)+1}for(let[o,a]of Object.entries(s))e[o]=e[o]??[],e[o].push(a)}let r={};for(let[n,i]of Object.entries(e)){i=i.sort((o,a)=>o-a);let s=Math.floor(i.length*.9);r[n]=i[s]}return r}}),this.autoDial.start(),this.started=!0,this.log("started")}async afterStart(){Promise.resolve().then(async()=>{let e=await this.peerStore.all({filters:[r=>r.tags.has(Bp)]});await Promise.all(e.map(async r=>{await this.openConnection(r.id).catch(n=>{this.log.error(n)})}))}).catch(e=>{this.log.error(e)}),this.autoDial.afterStart()}async stop(){this.dialQueue.stop(),this.autoDial.stop();let e=[];for(let r of this.connections.values())for(let n of r)e.push((async()=>{try{await n.close()}catch(i){this.log.error(i)}})());this.log("closing %d connections",e.length),await Promise.all(e),this.connections.clear(),this.log("stopped")}onConnect(e){this._onConnect(e).catch(r=>{this.log.error(r)})}async _onConnect(e){let{detail:r}=e;if(!this.started){await r.close();return}let n=r.remotePeer,i=this.connections.get(n),s=!1;i!=null?i.push(r):(s=!0,this.connections.set(n,[r])),n.publicKey!=null&&n.type==="RSA"&&await this.peerStore.patch(n,{publicKey:n.publicKey}),s&&this.events.safeDispatchEvent("peer:connect",{detail:r.remotePeer})}onDisconnect(e){let{detail:r}=e;if(!this.started)return;let n=r.remotePeer,i=this.connections.get(n);i!=null&&i.length>1?(i=i.filter(s=>s.id!==r.id),this.connections.set(n,i)):i!=null&&(this.connections.delete(n),this.events.safeDispatchEvent("peer:disconnect",{detail:r.remotePeer}))}getConnections(e){if(e!=null)return this.connections.get(e)??[];let r=[];for(let n of this.connections.values())r=r.concat(n);return r}getConnectionsMap(){return this.connections}async openConnection(e,r={}){if(!this.isStarted())throw new S("Not started",F.ERR_NODE_NOT_STARTED);r.signal?.throwIfAborted();let{peerId:n}=Fo(e);if(n!=null&&r.force!==!0){this.log("dial %p",n);let a=this.getConnections(n).find(c=>!c.transient);if(a!=null)return this.log("had an existing non-transient connection to %p",n),a}let i=await this.dialQueue.dial(e,{...r,priority:r.priority??tv}),s=this.connections.get(i.remotePeer);s==null&&(s=[],this.connections.set(i.remotePeer,s));let o=!1;for(let a of s)a.id===i.id&&(o=!0);return o||s.push(i),i}async closeConnections(e,r={}){let n=this.connections.get(e)??[];await Promise.all(n.map(async i=>{try{await i.close(r)}catch(s){i.abort(s)}}))}async acceptIncomingConnection(e){if(this.deny.some(i=>e.remoteAddr.toString().startsWith(i.toString())))return this.log("connection from %a refused - connection remote address was in deny list",e.remoteAddr),!1;if(this.allow.some(i=>e.remoteAddr.toString().startsWith(i.toString())))return this.incomingPendingConnections++,!0;if(this.incomingPendingConnections===this.maxIncomingPendingConnections)return this.log("connection from %a refused - incomingPendingConnections exceeded by host",e.remoteAddr),!1;if(e.remoteAddr.isThinWaistAddress()){let i=e.remoteAddr.nodeAddress().address;try{await this.inboundConnectionRateLimiter.consume(i,1)}catch{return this.log("connection from %a refused - inboundConnectionThreshold exceeded by host %s",e.remoteAddr,i),!1}}return this.getConnections().length0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},ui=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new Zo(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let r=this.head;this.head=r.next=new Zo(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var Pl=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function jo(t={}){return rv(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},t)}function rv(t,e){e=e??{};let r=e.onEnd,n=new ui,i,s,o,a=ut(),c=async()=>{try{return n.isEmpty()?o?{done:!0}:await new Promise((g,y)=>{s=x=>{s=null,n.push(x);try{g(t(n))}catch(b){y(b)}return i}}):t(n)}finally{n.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=ut()})}},u=g=>s!=null?s(g):(n.push(g),i),l=g=>(n=new ui,s!=null?s({error:g}):(n.push({error:g}),i)),f=g=>{if(o)return i;if(e?.objectMode!==!0&&g?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return u({done:!1,value:g})},h=g=>o?i:(o=!0,g!=null?l(g):u({done:!0})),p=()=>(n=new ui,h(),{done:!0}),d=g=>(h(g),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:c,return:p,throw:d,push:f,end:h,get readableLength(){return n.size},onEmpty:async g=>{let y=g?.signal;if(y?.throwIfAborted(),n.isEmpty())return;let x,b;y!=null&&(x=new Promise((I,v)=>{b=()=>{v(new Pl)},y.addEventListener("abort",b)}));try{await Promise.race([a.promise,x])}finally{b!=null&&y!=null&&y?.removeEventListener("abort",b)}}},r==null)return i;let m=i;return i={[Symbol.asyncIterator](){return this},next(){return m.next()},throw(g){return m.throw(g),r!=null&&(r(g),r=void 0),{done:!0}},return(){return m.return(),r!=null&&(r(),r=void 0),{done:!0}},push:f,end(g){return m.end(g),r!=null&&(r(g),r=void 0),i},get readableLength(){return m.readableLength},onEmpty:g=>m.onEmpty(g)},i}function nv(t){return t[Symbol.asyncIterator]!=null}function iv(...t){let e=[];for(let r of t)nv(r)||e.push(r);return e.length===t.length?function*(){for(let r of e)yield*r}():async function*(){let r=jo({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(t.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var bn=iv;function Ji(t,...e){if(t==null)throw new Error("Empty pipeline");if(Dl(t)){let n=t;t=()=>n.source}else if(Bm(t)||Tm(t)){let n=t;t=()=>n}let r=[t,...e];if(r.length>1&&Dl(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n{let e;for(;t.length>0;)e=t.shift()(e);return e},Tm=t=>t?.[Symbol.asyncIterator]!=null,Bm=t=>t?.[Symbol.iterator]!=null,Dl=t=>t==null?!1:t.sink!=null&&t.source!=null,ov=t=>e=>{let r=t.sink(e);if(r?.then!=null){let n=jo({objectMode:!0});r.then(()=>{n.end()},o=>{n.end(o)});let i,s=t.source;if(Tm(s))i=async function*(){yield*s,n.end()};else if(Bm(s))i=function*(){yield*s,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return bn(n,i())}return t.source};function av(t){return t[Symbol.asyncIterator]!=null}function cv(t,e){if(av(t))return async function*(){for await(let a of t)yield e(a)}();let r=vo(t),{value:n,done:i}=r.next();if(i===!0)return function*(){}();let s=e(n);if(typeof s.then=="function")return async function*(){yield await s;for await(let a of r)yield e(a)}();let o=e;return function*(){yield s;for(let a of r)yield o(a)}()}var Lm=cv;async function*es(t,e){yield*Lm(t,async r=>(await e.merge(r.id,{multiaddrs:r.multiaddrs}),r))}function Jo(t){let e=new Set;return Ut(t,r=>e.has(r.id.toString())?!1:(e.add(r.id.toString()),!0))}async function*ea(t,e=1){let r=0;for await(let n of t)r++,yield n;if(rn.findProviders(e,r))),n=>es(n,this.components.peerStore),n=>Jo(n),n=>ea(n))}async provide(e,r={}){if(this.routers.length===0)throw new S("No content routers available",F.ERR_NO_ROUTERS_AVAILABLE);await Promise.all(this.routers.map(async n=>{await n.provide(e,r)}))}async put(e,r,n){if(!this.isStarted())throw new S(jt.NOT_STARTED_YET,F.DHT_NOT_STARTED);await Promise.all(this.routers.map(async i=>{await i.put(e,r,n)}))}async get(e,r){if(!this.isStarted())throw new S(jt.NOT_STARTED_YET,F.DHT_NOT_STARTED);return Promise.any(this.routers.map(async n=>n.get(e,r)))}};function uv(t){return t[Symbol.asyncIterator]!=null}function lv(t){if(uv(t))return(async()=>{for await(let e of t)return e})();for(let e of t)return e}var Pm=lv;var ra=class{log;peerId;peerStore;routers;constructor(e,r){this.log=e.logger.forComponent("libp2p:peer-routing"),this.peerId=e.peerId,this.peerStore=e.peerStore,this.routers=r.routers??[]}async findPeer(e,r){if(this.routers.length===0)throw new S("No peer routers available",F.ERR_NO_ROUTERS_AVAILABLE);if(e.toString()===this.peerId.toString())throw new S("Should not try to find self",F.ERR_FIND_SELF);let n=this,i=await Ji(bn(...this.routers.map(s=>async function*(){try{yield await s.findPeer(e,r)}catch(o){n.log.error(o)}}())),s=>Ut(s,Boolean),s=>es(s,this.peerStore),async s=>Pm(s));if(i!=null)return i;throw new S(jt.NOT_FOUND,F.ERR_NOT_FOUND)}async*getClosestPeers(e,r){if(this.routers.length===0)throw new S("No peer routers available",F.ERR_NO_ROUTERS_AVAILABLE);yield*Ji(bn(...this.routers.map(n=>n.getClosestPeers(e,r))),n=>es(n,this.peerStore),n=>Jo(n),n=>ea(n))}};var Nl=32,kl=64,na=class{log;topologies;handlers;components;constructor(e){this.log=e.logger.forComponent("libp2p:registrar"),this.topologies=new Map,this.handlers=new Map,this.components=e,this._onDisconnect=this._onDisconnect.bind(this),this._onPeerUpdate=this._onPeerUpdate.bind(this),this._onPeerIdentify=this._onPeerIdentify.bind(this),this.components.events.addEventListener("peer:disconnect",this._onDisconnect),this.components.events.addEventListener("peer:update",this._onPeerUpdate),this.components.events.addEventListener("peer:identify",this._onPeerIdentify)}getProtocols(){return Array.from(new Set([...this.handlers.keys()])).sort()}getHandler(e){let r=this.handlers.get(e);if(r==null)throw new S(`No handler registered for protocol ${e}`,F.ERR_NO_HANDLER_FOR_PROTOCOL);return r}getTopologies(e){let r=this.topologies.get(e);return r==null?[]:[...r.values()]}async handle(e,r,n){if(this.handlers.has(e))throw new S(`Handler already registered for protocol ${e}`,F.ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED);let i=Mo.bind({ignoreUndefined:!0})({maxInboundStreams:Nl,maxOutboundStreams:kl},n);this.handlers.set(e,{handler:r,options:i}),await this.components.peerStore.merge(this.components.peerId,{protocols:[e]})}async unhandle(e){(Array.isArray(e)?e:[e]).forEach(n=>{this.handlers.delete(n)}),await this.components.peerStore.patch(this.components.peerId,{protocols:this.getProtocols()})}async register(e,r){if(r==null)throw new S("invalid topology",F.ERR_INVALID_PARAMETERS);let n=`${(Math.random()*1e9).toString(36)}${Date.now()}`,i=this.topologies.get(e);return i==null&&(i=new Map,this.topologies.set(e,i)),i.set(n,r),n}unregister(e){for(let[r,n]of this.topologies.entries())n.has(e)&&(n.delete(e),n.size===0&&this.topologies.delete(r))}_onDisconnect(e){let r=e.detail;this.components.peerStore.get(r).then(n=>{for(let i of n.protocols){let s=this.topologies.get(i);if(s!=null)for(let o of s.values())o.onDisconnect?.(r)}}).catch(n=>{n.code!==F.ERR_NOT_FOUND&&this.log.error("could not inform topologies of disconnecting peer %p",r,n)})}_onPeerUpdate(e){let{peer:r,previous:n}=e.detail,i=(n?.protocols??[]).filter(s=>!r.protocols.includes(s));for(let s of i){let o=this.topologies.get(s);if(o!=null)for(let a of o.values())a.onDisconnect?.(r.id)}}_onPeerIdentify(e){let r=e.detail.protocols,n=e.detail.connection,i=e.detail.peerId;for(let s of r){let o=this.topologies.get(s);if(o!=null)for(let a of o.values())n.transient&&a.notifyOnTransient!==!0||a.onConnect?.(i,n)}}};var Ol=class extends Map{metric;constructor(e){super();let{name:r,metrics:n}=e;this.metric=n.registerMetric(r),this.updateComponentMetric()}set(e,r){return super.set(e,r),this.updateComponentMetric(),this}delete(e){let r=super.delete(e);return this.updateComponentMetric(),r}clear(){super.clear(),this.updateComponentMetric()}updateComponentMetric(){this.metric.update(this.size)}};function Dm(t){let{name:e,metrics:r}=t,n;return r!=null?n=new Ol({name:e,metrics:r}):n=new Map,n}var ia=class{log;components;transports;listeners;faultTolerance;started;constructor(e,r={}){this.log=e.logger.forComponent("libp2p:transports"),this.components=e,this.started=!1,this.transports=new Map,this.listeners=Dm({name:"libp2p_transport_manager_listeners",metrics:this.components.metrics}),this.faultTolerance=r.faultTolerance??Ur.FATAL_ALL}add(e){let r=e[Symbol.toStringTag];if(r==null)throw new S("Transport must have a valid tag",F.ERR_INVALID_KEY);if(this.transports.has(r))throw new S(`There is already a transport with the tag ${r}`,F.ERR_DUPLICATE_TRANSPORT);this.log("adding transport %s",r),this.transports.set(r,e),this.listeners.has(r)||this.listeners.set(r,[])}isStarted(){return this.started}start(){this.started=!0}async afterStart(){let e=this.components.addressManager.getListenAddrs();await this.listen(e)}async stop(){let e=[];for(let[r,n]of this.listeners)for(this.log("closing listeners for %s",r);n.length>0;){let i=n.pop();i!=null&&e.push(i.close())}await Promise.all(e),this.log("all listeners closed");for(let r of this.listeners.keys())this.listeners.set(r,[]);this.started=!1}async dial(e,r){let n=this.transportForMultiaddr(e);if(n==null)throw new S(`No transport available for address ${String(e)}`,F.ERR_TRANSPORT_UNAVAILABLE);try{return await n.dial(e,{...r,upgrader:this.components.upgrader})}catch(i){throw i.code==null&&(i.code=F.ERR_TRANSPORT_DIAL_FAILED),i}}getAddrs(){let e=[];for(let r of this.listeners.values())for(let n of r)e=[...e,...n.getAddrs()];return e}getTransports(){return Array.of(...this.transports.values())}getListeners(){return Array.of(...this.listeners.values()).flat()}transportForMultiaddr(e){for(let r of this.transports.values())if(r.filter([e]).length>0)return r}async listen(e){if(!this.isStarted())throw new S("Not started",F.ERR_NODE_NOT_STARTED);if(e==null||e.length===0){this.log("no addresses were provided for listening, this node is dial only");return}let r=[];for(let[n,i]of this.transports.entries()){let s=i.filter(e),o=[];for(let u of s){this.log("creating listener for %s on %a",n,u);let l=i.createListener({upgrader:this.components.upgrader}),f=this.listeners.get(n)??[];f==null&&(f=[],this.listeners.set(n,f)),f.push(l),l.addEventListener("listening",()=>{this.components.events.safeDispatchEvent("transport:listening",{detail:l})}),l.addEventListener("close",()=>{let h=f.findIndex(p=>p===l);f.splice(h,1),this.components.events.safeDispatchEvent("transport:close",{detail:l})}),o.push(l.listen(u))}if(o.length===0){r.push(n);continue}if((await Promise.allSettled(o)).find(u=>u.status==="fulfilled")==null&&this.faultTolerance!==Ur.NO_FATAL)throw new S(`Transport (${n}) could not listen on any available address`,F.ERR_NO_VALID_ADDRESSES)}if(r.length===this.transports.size){let n=`no valid addresses were provided for transports [${r.join(", ")}]`;if(this.faultTolerance===Ur.FATAL_ALL)throw new S(n,F.ERR_NO_VALID_ADDRESSES);this.log(`libp2p in dial mode only: ${n}`)}}async remove(e){let r=this.listeners.get(e)??[];this.log.trace("removing transport %s",e);let n=[];for(this.log.trace("closing listeners for %s",e);r.length>0;){let i=r.pop();i!=null&&n.push(i.close())}await Promise.all(n),this.transports.delete(e),this.listeners.delete(e)}async removeAll(){let e=[];for(let r of this.transports.keys())e.push(this.remove(r));await Promise.all(e)}};var Je="/multistream/1.0.0";var sa=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=r??"ABORT_ERR"}};async function Nm(t,e,r){if(e==null)return t;if(e.aborted)return Promise.reject(new sa(r?.errorMessage,r?.errorCode));let n,i=new sa(r?.errorMessage,r?.errorCode);try{return await Promise.race([t,new Promise((s,o)=>{n=()=>{o(i)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var Ml=class{needNext;haveNext;ended;nextResult;constructor(){this.ended=!1,this.needNext=ut(),this.needNext.resolve(),this.haveNext=ut()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("Have next but next was undefined");let e=this.nextResult;return this.nextResult=void 0,this.needNext.resolve(),this.needNext=ut(),e}async throw(e){return this.ended=!0,e!=null&&this.haveNext.reject(e),{done:!0,value:void 0}}async return(){let e={done:!0,value:void 0};return await this._push(void 0),e}async push(e,r){await this._push(e,r)}async end(e,r){e!=null?await this.throw(e):await this._push(void 0,r)}async _push(e,r){if(e!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");this.nextResult!=null&&await this.needNext.promise,e!=null?this.nextResult={done:!1,value:e}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=ut(),await Nm(this.needNext.promise,r?.signal,r)}};function km(){return new Ml}var oa=class extends Error{code;constructor(e,r){super(e),this.code=r}},Ul=class extends oa{type;constructor(e){super(e,"ABORT_ERR"),this.type="aborted"}};function Om(t,e){let r=km();t.sink(r).catch(async o=>{await r.end(o)}),t.sink=async o=>{for await(let a of o)await r.push(a);await r.end()};let n=t.source;t.source[Symbol.iterator]!=null?n=t.source[Symbol.iterator]():t.source[Symbol.asyncIterator]!=null&&(n=t.source[Symbol.asyncIterator]());let i=new ze;return{read:async(o,a)=>{a?.signal?.throwIfAborted();let c,u=new Promise((l,f)=>{c=()=>{f(new Ul("Read aborted"))},a?.signal?.addEventListener("abort",c)});try{if(o==null){let{done:f,value:h}=await Promise.race([n.next(),u]);return f===!0?new ze:h}for(;i.byteLength{a?.signal?.throwIfAborted(),o instanceof Uint8Array?await r.push(o,a):await r.push(o.subarray(),a)},unwrap:()=>{if(i.byteLength>0){let o=t.source;t.source=async function*(){e?.yieldBytes===!1?yield i:yield*i,yield*o}()}return t},unreadBytes:()=>i.byteLength}}function aa(t){return t[Symbol.asyncIterator]!=null}var ca=t=>{let e=it(t),r=tt(e);return dt(t,r),ca.bytes=e,r};ca.bytes=0;function wn(t,e){e=e??{};let r=e.lengthEncoder??ca;function*n(i){let s=r(i.byteLength);s instanceof Uint8Array?yield s:yield*s,i instanceof Uint8Array?yield i:yield*i}return aa(t)?async function*(){for await(let i of t)yield*n(i)}():function*(){for(let i of t)yield*n(i)}()}wn.single=(t,e)=>{e=e??{};let r=e.lengthEncoder??ca;return new ze(r(t.byteLength),t)};var li=ve(Yu(),1);var fv=8,hv=1024*1024*4,En;(function(t){t[t.LENGTH=0]="LENGTH",t[t.DATA=1]="DATA"})(En||(En={}));var Kl=t=>{let e=Ot(t);return Kl.bytes=it(e),e};Kl.bytes=0;function Fl(t,e){let r=new ze,n=En.LENGTH,i=-1,s=e?.lengthDecoder??Kl,o=e?.maxLengthLength??fv,a=e?.maxDataLength??hv;function*c(){for(;r.byteLength>0;){if(n===En.LENGTH)try{if(i=s(r),i<0)throw(0,li.default)(new Error("invalid message length"),"ERR_INVALID_MSG_LENGTH");if(i>a)throw(0,li.default)(new Error("message length too long"),"ERR_MSG_DATA_TOO_LONG");let u=s.bytes;r.consume(u),e?.onLength!=null&&e.onLength(i),n=En.DATA}catch(u){if(u instanceof RangeError){if(r.byteLength>o)throw(0,li.default)(new Error("message length length too long"),"ERR_MSG_LENGTH_TOO_LONG");break}throw u}if(n===En.DATA){if(r.byteLength0)throw(0,li.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}():function*(){for(let u of t)r.append(u),yield*c();if(r.byteLength>0)throw(0,li.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}()}Fl.fromReader=(t,e)=>{let r=1,n=async function*(){for(;;)try{let{done:s,value:o}=await t.next(r);if(s===!0)return;o!=null&&(yield o)}catch(s){if(s.code==="ERR_UNDER_READ")return{done:!0,value:null};throw s}finally{r=1}}();return Fl(n,{...e??{},onLength:s=>{r=s}})};var ua=class extends Error{code;constructor(e,r){super(e),this.code=r}},Mm=t=>Ot(t);Mm.bytes=0;function ts(t,e={}){let r=Om(t,e);return e.maxDataLength!=null&&e.maxLengthLength==null&&(e.maxLengthLength=it(e.maxDataLength)),{read:async i=>{let s=-1,o=new ze,a=e?.lengthDecoder??Mm;for(;;){o.append(await r.read(1,i));try{s=a(o)}catch(c){if(c instanceof RangeError)continue;throw c}if(e?.maxLengthLength!=null&&o.byteLength>e.maxLengthLength)throw new ua("message length length too long","ERR_MSG_LENGTH_TOO_LONG");if(s>-1)break}if(e?.maxDataLength!=null&&s>e.maxDataLength)throw new ua("message length too long","ERR_MSG_DATA_TOO_LONG");return r.read(s,i)},write:async(i,s)=>{await r.write(wn.single(i,e),s)},writeV:async(i,s)=>{let o=new ze(...i.map(a=>wn.single(a,e)));await r.write(o,s)},unwrap:()=>r.unwrap(),unreadBytes:()=>r.unreadBytes()}}var pv=Q(` -`);async function vn(t,e,r){await t.write(e,r)}async function Um(t,e,r){await t.writeV(e,r)}async function mv(t,e){let r=await t.read(e);if(r.byteLength===0||r.get(r.byteLength-1)!==pv[0])throw e?.log.error("Invalid mss message - missing newline",r),new S("missing newline","ERR_INVALID_MULTISTREAM_SELECT_MESSAGE");return r.sublist(0,-1)}async function Kr(t,e){let r=await mv(t,e);return se(r.subarray())}async function rs(t,e,r){if(e=Array.isArray(e)?[...e]:[e],e.length===1)return gv(t,e[0],r);let n=ts(t,{...r,maxDataLength:1024}),i=e.shift();if(i==null)throw new Error("At least one protocol must be specified");r?.log.trace('select: write ["%s", "%s"]',Je,i);let s=Q(`${Je} -`),o=Q(`${i} -`);await Um(n,[s,o],r),r?.log.trace("select: reading multistream-select header");let a=await Kr(n,r);if(r?.log.trace('select: read "%s"',a),a===Je&&(r?.log.trace("select: reading protocol response"),a=await Kr(n,r),r?.log.trace('select: read "%s"',a)),a===i)return{stream:n.unwrap(),protocol:i};for(let c of e){r?.log.trace('select: write "%s"',c),await vn(n,Q(`${c} -`),r),r?.log.trace("select: reading protocol response");let u=await Kr(n,r);if(r?.log.trace('select: read "%s" for "%s"',u,c),u===c)return{stream:n.unwrap(),protocol:c}}throw new S("protocol selection failed","ERR_UNSUPPORTED_PROTOCOL")}function gv(t,e,r){let n=t.sink.bind(t),i=t.source,s=!1,o=!1,a=ut(),c=!1,u=!1,l=ut(),f=!1,h=!1,p=ut(),d=ts({sink:n,source:i},{...r,maxDataLength:1024});t.sink=async x=>{let{sink:b}=d.unwrap();await b(async function*(){let I=!1;for await(let v of x){if(u&&await l.promise,c)yield v;else{u=!0,r?.log.trace('optimistic: write ["%s", "%s", data(%d)] in sink',Je,e,v.byteLength);let _=`${e} -`;yield new ze(Uint8Array.from([19]),Q(`${Je} -`),dt(_.length),Q(_),v).subarray(),r?.log.trace('optimistic: wrote ["%s", "%s", data(%d)] in sink',Je,e,v.byteLength),c=!0,u=!1,l.resolve()}I=!0}I||await m()}())};async function m(){if(o){r?.log.trace("optimistic: already negotiating %s stream",e),await a.promise;return}o=!0;try{c||(r?.log.trace("optimistic: doing send protocol for %s stream",e),await g()),f||(r?.log.trace("optimistic: doing read protocol for %s stream",e),await y())}finally{o=!1,s=!0,a.resolve()}}async function g(){if(u){await l.promise;return}u=!0;try{r?.log.trace('optimistic: write ["%s", "%s", data] in source',Je,e),await d.writeV([Q(`${Je} -`),Q(`${e} -`)]),r?.log.trace('optimistic: wrote ["%s", "%s", data] in source',Je,e)}finally{c=!0,u=!1,l.resolve()}}async function y(){if(h){await p.promise;return}h=!0;try{r?.log.trace("optimistic: reading multistream select header");let x=await Kr(d,r);if(r?.log.trace('optimistic: read multistream select header "%s"',x),x===Je&&(x=await Kr(d,r)),r?.log.trace('optimistic: read protocol "%s", expecting "%s"',x,e),x!==e)throw new S("protocol selection failed","ERR_UNSUPPORTED_PROTOCOL")}finally{f=!0,h=!1,p.resolve()}}if(t.source=async function*(){await m(),r?.log.trace('optimistic: reading data from "%s" stream',e),yield*d.unwrap().source}(),t.closeRead!=null){let x=t.closeRead.bind(t);t.closeRead=async b=>{s||await m().catch(I=>{r?.log.error("could not negotiate protocol before close read",I)}),await x(b)}}if(t.closeWrite!=null){let x=t.closeWrite.bind(t);t.closeWrite=async b=>{s||await m().catch(I=>{r?.log.error("could not negotiate protocol before close write",I)}),await x(b)}}if(t.close!=null){let x=t.close.bind(t);t.close=async b=>{s||(s=!0,o=!1,a.resolve()),await x(b)}}return{stream:t,protocol:e}}async function ns(t,e,r){e=Array.isArray(e)?e:[e],r.log.trace("handle: available protocols %s",e);let n=ts(t,{...r,maxDataLength:1024,maxLengthLength:2});for(;;){r?.log.trace("handle: reading incoming string");let i=await Kr(n,r);if(r.log.trace('handle: read "%s"',i),i===Je){r.log.trace('handle: respond with "%s" for "%s"',Je,i),await vn(n,Q(`${Je} -`),r),r.log.trace('handle: responded with "%s" for "%s"',Je,i);continue}if(e.includes(i))return r.log.trace('handle: respond with "%s" for "%s"',i,i),await vn(n,Q(`${i} -`),r),r.log.trace('handle: responded with "%s" for "%s"',i,i),{stream:n.unwrap(),protocol:i};if(i==="ls"){let s=new ze(...e.map(o=>wn.single(Q(`${o} -`))),Q(` -`));r.log.trace('handle: respond with "%s" for %s',e,i),await vn(n,s,r),r.log.trace('handle: responded with "%s" for %s',e,i);continue}r.log('handle: respond with "na" for "%s"',i),await vn(n,Q(`na -`),r),r.log('handle: responded with "na" for "%s"',i)}}var Km=Symbol.for("@libp2p/connection");var xv=500,ql=class{id;remoteAddr;remotePeer;direction;timeline;multiplexer;encryption;status;transient;log;tags;_newStream;_close;_abort;_getStreams;constructor(e){let{remoteAddr:r,remotePeer:n,newStream:i,close:s,abort:o,getStreams:a}=e;this.id=`${parseInt(String(Math.random()*1e9)).toString(36)}${Date.now()}`,this.remoteAddr=r,this.remotePeer=n,this.direction=e.direction,this.status="open",this.timeline=e.timeline,this.multiplexer=e.multiplexer,this.encryption=e.encryption,this.transient=e.transient??!1,this.log=e.logger.forComponent(`libp2p:connection:${this.direction}:${this.id}`),this.remoteAddr.getPeerId()==null&&(this.remoteAddr=this.remoteAddr.encapsulate(`/p2p/${this.remotePeer}`)),this._newStream=i,this._close=s,this._abort=o,this._getStreams=a,this.tags=[]}[Symbol.toStringTag]="Connection";[Km]=!0;get streams(){return this._getStreams()}async newStream(e,r){if(this.status==="closing")throw new S("the connection is being closed","ERR_CONNECTION_BEING_CLOSED");if(this.status==="closed")throw new S("the connection is closed","ERR_CONNECTION_CLOSED");if(Array.isArray(e)||(e=[e]),this.transient&&r?.runOnTransientConnection!==!0)throw new S("Cannot open protocol stream on transient connection","ERR_TRANSIENT_CONNECTION");let n=await this._newStream(e,r);return n.direction="outbound",n}async close(e={}){if(!(this.status==="closed"||this.status==="closing")){if(this.log("closing connection to %a",this.remoteAddr),this.status="closing",e.signal==null){let r=AbortSignal.timeout(xv);yt(1/0,r),e={...e,signal:r}}try{this.log.trace("closing all streams"),await Promise.all(this.streams.map(async r=>r.close(e))),this.log.trace("closing underlying transport"),await this._close(e),this.log.trace("updating timeline with close time"),this.status="closed",this.timeline.close=Date.now()}catch(r){this.log.error("error encountered during graceful close of connection to %a",this.remoteAddr,r),this.abort(r)}}}abort(e){this.log.error("aborting connection to %a due to error",this.remoteAddr,e),this.status="closing",this.streams.forEach(r=>{r.abort(e)}),this.log.error("all streams aborted",this.streams.length),this._abort(e),this.timeline.close=Date.now(),this.status="closed"}};function qm(t){return new ql(t)}var wv=3e4;function Ev(t,e){try{let{options:r}=e.getHandler(t);return r.maxInboundStreams}catch(r){if(r.code!==F.ERR_NO_HANDLER_FOR_PROTOCOL)throw r}return Nl}function vv(t,e,r={}){try{let{options:n}=e.getHandler(t);if(n.maxOutboundStreams!=null)return n.maxOutboundStreams}catch(n){if(n.code!==F.ERR_NO_HANDLER_FOR_PROTOCOL)throw n}return r.maxOutboundStreams??kl}function Vm(t,e,r){let n=0;return r.streams.forEach(i=>{i.direction===e&&i.protocol===t&&n++}),n}var fa=class{components;connectionEncryption;muxers;inboundUpgradeTimeout;events;log;constructor(e,r){this.components=e,this.connectionEncryption=new Map,this.log=e.logger.forComponent("libp2p:upgrader"),r.connectionEncryption.forEach(n=>{this.connectionEncryption.set(n.protocol,n)}),this.muxers=new Map,r.muxers.forEach(n=>{this.muxers.set(n.protocol,n)}),this.inboundUpgradeTimeout=r.inboundUpgradeTimeout??3e4,this.events=e.events}async shouldBlockConnection(e,r,n){let i=this.components.connectionGater[n];if(i!==void 0&&await i(e,r))throw new S(`The multiaddr connection is blocked by gater.${n}`,F.ERR_CONNECTION_INTERCEPTED)}async upgradeInbound(e,r){if(!await this.components.connectionManager.acceptIncomingConnection(e))throw new S("connection denied",F.ERR_CONNECTION_DENIED);let i,s,o,a,c,u=AbortSignal.timeout(this.inboundUpgradeTimeout),l=()=>{e.abort(new S("inbound upgrade timeout",vs))};u.addEventListener("abort",l,{once:!0}),yt(1/0,u);try{if(await this.components.connectionGater.denyInboundConnection?.(e)===!0)throw new S("The multiaddr connection is blocked by gater.acceptConnection",F.ERR_CONNECTION_INTERCEPTED);this.components.metrics?.trackMultiaddrConnection(e),this.log("starting the inbound connection upgrade");let f=e;if(r?.skipProtection!==!0){let h=this.components.connectionProtector;h!=null&&(this.log("protecting the inbound connection"),f=await h.protect(e))}try{if(i=f,r?.skipEncryption!==!0){({conn:i,remotePeer:s,protocol:c}=await this._encryptInbound(f));let h={...f,...i};await this.shouldBlockConnection(s,h,"denyInboundEncryptedConnection")}else{let h=e.remoteAddr.getPeerId();if(h==null)throw new S("inbound connection that skipped encryption must have a peer id",F.ERR_INVALID_MULTIADDR);let p=ce(h);c="native",s=p}if(o=i,r?.muxerFactory!=null)a=r.muxerFactory;else if(this.muxers.size>0){let h=await this._multiplexInbound({...f,...i},this.muxers);a=h.muxerFactory,o=h.stream}}catch(h){throw this.log.error("Failed to upgrade inbound connection",h),h}return await this.shouldBlockConnection(s,e,"denyInboundUpgradedConnection"),this.log("successfully upgraded inbound connection"),this._createConnection({cryptoProtocol:c,direction:"inbound",maConn:e,upgradedConn:o,muxerFactory:a,remotePeer:s,transient:r?.transient})}finally{u.removeEventListener("abort",l),this.components.connectionManager.afterUpgradeInbound()}}async upgradeOutbound(e,r){let n=e.remoteAddr.getPeerId(),i;n!=null&&(i=ce(n),await this.shouldBlockConnection(i,e,"denyOutboundConnection"));let s,o,a,c,u;this.components.metrics?.trackMultiaddrConnection(e),this.log("Starting the outbound connection upgrade");let l=e;if(r?.skipProtection!==!0){let f=this.components.connectionProtector;f!=null&&(l=await f.protect(e))}try{if(s=l,r?.skipEncryption!==!0){({conn:s,remotePeer:o,protocol:c}=await this._encryptOutbound(l,i));let f={...l,...s};await this.shouldBlockConnection(o,f,"denyOutboundEncryptedConnection")}else{if(i==null)throw new S("Encryption was skipped but no peer id was passed",F.ERR_INVALID_PEER);c="native",o=i}if(a=s,r?.muxerFactory!=null)u=r.muxerFactory;else if(this.muxers.size>0){let f=await this._multiplexOutbound({...l,...s},this.muxers);u=f.muxerFactory,a=f.stream}}catch(f){throw this.log.error("Failed to upgrade outbound connection",f),await e.close(f),f}return await this.shouldBlockConnection(o,e,"denyOutboundUpgradedConnection"),this.log("Successfully upgraded outbound connection"),this._createConnection({cryptoProtocol:c,direction:"outbound",maConn:e,upgradedConn:a,muxerFactory:u,remotePeer:o,transient:r?.transient})}_createConnection(e){let{cryptoProtocol:r,direction:n,maConn:i,upgradedConn:s,remotePeer:o,muxerFactory:a,transient:c}=e,u,l,f;a!=null&&(u=a.createStreamMuxer({direction:n,onIncomingStream:d=>{f!=null&&Promise.resolve().then(async()=>{let m=this.components.registrar.getProtocols(),{stream:g,protocol:y}=await ns(d,m,{log:d.log,yieldBytes:!1});if(f==null)return;f.log("incoming stream opened on %s",y);let x=Ev(y,this.components.registrar);if(Vm(y,"inbound",f)===x){let I=new S(`Too many inbound protocol streams for protocol "${y}" - limit ${x}`,F.ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS);throw d.abort(I),I}d.source=g.source,d.sink=g.sink,d.protocol=y,g.closeWrite!=null&&(d.closeWrite=g.closeWrite),g.closeRead!=null&&(d.closeRead=g.closeRead),g.close!=null&&(d.close=g.close),await this.components.peerStore.merge(o,{protocols:[y]}),this.components.metrics?.trackProtocolStream(d,f),this._onStream({connection:f,stream:d,protocol:y})}).catch(async m=>{this.log.error("error handling incoming stream id %s",d.id,m.message,m.code,m.stack),d.timeline.close==null&&await d.close()})}}),l=async(d,m={})=>{if(u==null)throw new S("Stream is not multiplexed",F.ERR_MUXER_UNAVAILABLE);f.log("starting new stream for protocols %s",d);let g=await u.newStream();f.log.trace("started new stream %s for protocols %s",g.id,d);try{if(m.signal==null){this.log("No abort signal was passed while trying to negotiate protocols %s falling back to default timeout",d);let v=AbortSignal.timeout(wv);yt(1/0,v),m={...m,signal:v}}g.log.trace("selecting protocol from protocols %s",d);let{stream:y,protocol:x}=await rs(g,d,{...m,log:g.log,yieldBytes:!0});g.log("selected protocol %s",x);let b=vv(x,this.components.registrar,m);if(Vm(x,"outbound",f)>=b){let v=new S(`Too many outbound protocol streams for protocol "${x}" - limit ${b}`,F.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS);throw g.abort(v),v}return await this.components.peerStore.merge(o,{protocols:[x]}),g.source=y.source,g.sink=y.sink,g.protocol=x,y.closeWrite!=null&&(g.closeWrite=y.closeWrite),y.closeRead!=null&&(g.closeRead=y.closeRead),y.close!=null&&(g.close=y.close),this.components.metrics?.trackProtocolStream(g,f),g}catch(y){throw f.log.error("could not create new stream for protocols %s",d,y),g.timeline.close==null&&g.abort(y),y.code!=null?y:new S(String(y),F.ERR_UNSUPPORTED_PROTOCOL)}},Promise.all([u.sink(s.source),s.sink(u.source)]).catch(d=>{this.log.error(d)}));let h=i.timeline;i.timeline=new Proxy(h,{set:(...d)=>(f!=null&&d[1]==="close"&&d[2]!=null&&h.close==null&&(async()=>{try{f.status==="open"&&await f.close()}catch(m){this.log.error(m)}finally{this.events.safeDispatchEvent("connection:close",{detail:f})}})().catch(m=>{this.log.error(m)}),Reflect.set(...d))}),i.timeline.upgraded=Date.now();let p=()=>{throw new S("connection is not multiplexed",F.ERR_CONNECTION_NOT_MULTIPLEXED)};return f=qm({remoteAddr:i.remoteAddr,remotePeer:o,status:"open",direction:n,timeline:i.timeline,multiplexer:u?.protocol,encryption:r,transient:c,logger:this.components.logger,newStream:l??p,getStreams:()=>u!=null?u.streams:[],close:async d=>{u!=null&&(this.log.trace("close muxer"),await u.close(d)),this.log.trace("close maconn"),await i.close(d),this.log.trace("closed maconn")},abort:d=>{i.abort(d),u?.abort(d)}}),this.events.safeDispatchEvent("connection:open",{detail:f}),f}_onStream(e){let{connection:r,stream:n,protocol:i}=e,{handler:s,options:o}=this.components.registrar.getHandler(i);if(r.transient&&o.runOnTransientConnection!==!0)throw new S("Cannot open protocol stream on transient connection","ERR_TRANSIENT_CONNECTION");s({connection:r,stream:n})}async _encryptInbound(e){let r=Array.from(this.connectionEncryption.keys());this.log("handling inbound crypto protocol selection",r);try{let{stream:n,protocol:i}=await ns(e,r,{log:e.log}),s=this.connectionEncryption.get(i);if(s==null)throw new Error(`no crypto module found for ${i}`);return this.log("encrypting inbound connection using",i),{...await s.secureInbound(this.components.peerId,n),protocol:i}}catch(n){throw new S(String(n),F.ERR_ENCRYPTION_FAILED)}}async _encryptOutbound(e,r){let n=Array.from(this.connectionEncryption.keys());this.log("selecting outbound crypto protocol",n);try{e.log.trace("selecting encrypter from %s",n);let{stream:i,protocol:s}=await rs(e,n,{log:e.log,yieldBytes:!0}),o=this.connectionEncryption.get(s);if(o==null)throw new Error(`no crypto module found for ${s}`);return e.log("encrypting outbound connection to %p using %p",r),{...await o.secureOutbound(this.components.peerId,i,r),protocol:s}}catch(i){throw new S(String(i),F.ERR_ENCRYPTION_FAILED)}}async _multiplexOutbound(e,r){let n=Array.from(r.keys());this.log("outbound selecting muxer %s",n);try{e.log.trace("selecting stream muxer from %s",n);let{stream:i,protocol:s}=await rs(e,n,{log:e.log,yieldBytes:!0});e.log("selected %s as muxer protocol",s);let o=r.get(s);return{stream:i,muxerFactory:o}}catch(i){throw e.log.error("error multiplexing outbound stream",i),new S(String(i),F.ERR_MUXER_UNAVAILABLE)}}async _multiplexInbound(e,r){let n=Array.from(r.keys());this.log("inbound handling muxers %s",n);try{let{stream:i,protocol:s}=await ns(e,n,{log:e.log}),o=r.get(s);return{stream:i,muxerFactory:o}}catch(i){throw this.log.error("error multiplexing inbound stream",i),new S(String(i),F.ERR_MUXER_UNAVAILABLE)}}};var $m="0.0.0",zm="libp2p";var Vl=class extends Oi{peerId;peerStore;contentRouting;peerRouting;metrics;services;logger;components;#e;log;constructor(e){super();let r=new Oi,n=r.dispatchEvent.bind(r);r.dispatchEvent=a=>{let c=n(a),u=this.dispatchEvent(new Zc(a.type,{detail:a.detail}));return c||u},yt(1/0,r),this.#e=!1,this.peerId=e.peerId,this.logger=e.logger??Ws(),this.log=this.logger.forComponent("libp2p"),this.services={};let i=this.components=Yd({peerId:e.peerId,nodeInfo:e.nodeInfo??{name:zm,version:$m},logger:this.logger,events:r,datastore:e.datastore??new So,connectionGater:ip(e.connectionGater)});this.peerStore=this.configureComponent("peerStore",new Eo(i,{addressFilter:this.components.connectionGater.filterMultiaddrForPeer,...e.peerStore})),e.metrics!=null&&(this.metrics=this.configureComponent("metrics",e.metrics(this.components))),i.events.addEventListener("peer:update",a=>{if(a.detail.previous==null){let c={id:a.detail.peer.id,multiaddrs:a.detail.peer.addresses.map(u=>u.multiaddr)};i.events.safeDispatchEvent("peer:discovery",{detail:c})}}),e.connectionProtector!=null&&this.configureComponent("connectionProtector",e.connectionProtector(i)),this.components.upgrader=new fa(this.components,{connectionEncryption:(e.connectionEncryption??[]).map((a,c)=>this.configureComponent(`connection-encryption-${c}`,a(this.components))),muxers:(e.streamMuxers??[]).map((a,c)=>this.configureComponent(`stream-muxers-${c}`,a(this.components))),inboundUpgradeTimeout:e.connectionManager.inboundUpgradeTimeout}),this.configureComponent("transportManager",new ia(this.components,e.transportManager)),this.configureComponent("connectionManager",new Xo(this.components,e.connectionManager)),this.configureComponent("registrar",new na(this.components)),this.configureComponent("addressManager",new Ao(this.components,e.addresses));let s=(e.peerRouters??[]).map((a,c)=>this.configureComponent(`peer-router-${c}`,a(this.components)));this.peerRouting=this.components.peerRouting=this.configureComponent("peerRouting",new ra(this.components,{routers:s}));let o=(e.contentRouters??[]).map((a,c)=>this.configureComponent(`content-router-${c}`,a(this.components)));if(this.contentRouting=this.components.contentRouting=this.configureComponent("contentRouting",new ta(this.components,{routers:o})),(e.peerDiscovery??[]).forEach((a,c)=>{this.configureComponent(`peer-discovery-${c}`,a(this.components)).addEventListener("peer",l=>{this.#t(l)})}),e.transports.forEach((a,c)=>{this.components.transportManager.add(this.configureComponent(`transport-${c}`,a(this.components)))}),e.services!=null)for(let a of Object.keys(e.services)){let c=e.services[a],u=c(this.components);if(u==null){this.log.error("service factory %s returned null or undefined instance",a);continue}this.services[a]=u,this.configureComponent(a,u),u[Qc]!=null&&(this.log("registering service %s for content routing",a),o.push(u[Qc])),u[Jc]!=null&&(this.log("registering service %s for peer routing",a),s.push(u[Jc])),u[jc]!=null&&(this.log("registering service %s for peer discovery",a),u[jc].addEventListener("peer",l=>{this.#t(l)}))}}configureComponent(e,r){return r==null&&this.log.error("component %s was null or undefined",e),this.components[e]=r,r}async start(){if(!this.#e){this.#e=!0,this.log("libp2p is starting");try{await this.components.beforeStart?.(),await this.components.start(),await this.components.afterStart?.(),this.safeDispatchEvent("start",{detail:this}),this.log("libp2p has started")}catch(e){throw this.log.error("An error occurred starting libp2p",e),await this.stop(),e}}}async stop(){this.#e&&(this.log("libp2p is stopping"),this.#e=!1,await this.components.beforeStop?.(),await this.components.stop(),await this.components.afterStop?.(),this.safeDispatchEvent("stop",{detail:this}),this.log("libp2p has stopped"))}isStarted(){return this.#e}getConnections(e){return this.components.connectionManager.getConnections(e)}getDialQueue(){return this.components.connectionManager.getDialQueue()}getPeers(){let e=new ln;for(let r of this.components.connectionManager.getConnections())e.add(r.remotePeer);return Array.from(e)}async dial(e,r={}){return this.components.connectionManager.openConnection(e,r)}async dialProtocol(e,r,n={}){if(r==null)throw new S("no protocols were provided to open a stream",F.ERR_INVALID_PROTOCOLS_FOR_STREAM);if(r=Array.isArray(r)?r:[r],r.length===0)throw new S("no protocols were provided to open a stream",F.ERR_INVALID_PROTOCOLS_FOR_STREAM);return(await this.dial(e,n)).newStream(r,n)}getMultiaddrs(){return this.components.addressManager.getAddresses()}getProtocols(){return this.components.registrar.getProtocols()}async hangUp(e,r={}){Lr(e)&&(e=ce(e.getPeerId()??"")),await this.components.connectionManager.closeConnections(e,r)}async getPublicKey(e,r={}){if(this.log("getPublicKey %p",e),e.publicKey!=null)return e.publicKey;let n=await this.peerStore.get(e);if(n.id.publicKey!=null)return n.id.publicKey;let i=Te([Q("/pk/"),e.multihash.digest]),s=await this.contentRouting.get(i,r);return ki(s),await this.peerStore.patch(e,{publicKey:s}),s}async handle(e,r,n){Array.isArray(e)||(e=[e]),await Promise.all(e.map(async i=>{await this.components.registrar.handle(i,r,n)}))}async unhandle(e){Array.isArray(e)||(e=[e]),await Promise.all(e.map(async r=>{await this.components.registrar.unhandle(r)}))}async register(e,r){return this.components.registrar.register(e,r)}unregister(e){this.components.registrar.unregister(e)}#t(e){let{detail:r}=e;if(r.id.toString()===this.peerId.toString()){this.log.error(new Error(F.ERR_DISCOVERED_SELF));return}this.components.peerStore.merge(r.id,{multiaddrs:r.multiaddrs}).catch(n=>{this.log.error(n)})}};async function Hm(t){return t.peerId??=await ed(),new Vl(Tp(t))}async function Sv(t){let e=await Hm(t);return t.start!==!1&&await e.start(),e}return sg(Av);})(); -/*! Bundled license information: - -@noble/hashes/esm/utils.js: - (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/modular.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/curve.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/edwards.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/ed25519.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/weierstrass.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/_shortw_utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/secp256k1.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) -*/ -return Libp2P})); diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/index.d.ts deleted file mode 100644 index 5820cf0a7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/index.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -import type { ComponentLogger, Libp2pEvents } from '@libp2p/interface'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { TransportManager } from '@libp2p/interface-internal/transport-manager'; -import type { Multiaddr } from '@multiformats/multiaddr'; -export interface AddressManagerInit { - /** - * Pass an function in this field to override the list of addresses - * that are announced to the network - */ - announceFilter?: AddressFilter; - /** - * list of multiaddrs string representation to listen - */ - listen?: string[]; - /** - * list of multiaddrs string representation to announce - */ - announce?: string[]; - /** - * list of multiaddrs string representation to never announce - */ - noAnnounce?: string[]; -} -export interface DefaultAddressManagerComponents { - peerId: PeerId; - transportManager: TransportManager; - peerStore: PeerStore; - events: TypedEventTarget; - logger: ComponentLogger; -} -/** - * A function that takes a list of multiaddrs and returns a list - * to announce - */ -export interface AddressFilter { - (addrs: Multiaddr[]): Multiaddr[]; -} -export declare class DefaultAddressManager { - private readonly log; - private readonly components; - private readonly listen; - private readonly announce; - private readonly observed; - private readonly announceFilter; - /** - * Responsible for managing the peer addresses. - * Peers can specify their listen and announce addresses. - * The listen addresses will be used by the libp2p transports to listen for new connections, - * while the announce addresses will be used for the peer addresses' to other peers in the network. - */ - constructor(components: DefaultAddressManagerComponents, init?: AddressManagerInit); - _updatePeerStoreAddresses(): void; - /** - * Get peer listen multiaddrs - */ - getListenAddrs(): Multiaddr[]; - /** - * Get peer announcing multiaddrs - */ - getAnnounceAddrs(): Multiaddr[]; - /** - * Get observed multiaddrs - */ - getObservedAddrs(): Multiaddr[]; - /** - * Add peer observed addresses - */ - addObservedAddr(addr: Multiaddr): void; - confirmObservedAddr(addr: Multiaddr): void; - removeObservedAddr(addr: Multiaddr): void; - getAddresses(): Multiaddr[]; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/index.d.ts.map deleted file mode 100644 index d1ca76ee1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/address-manager/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAU,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AACpF,OAAO,KAAK,EAAE,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;IAoB3C,kBAAkB,CAAE,IAAI,EAAE,SAAS,GAAG,IAAI;IAO1C,YAAY,IAAK,SAAS,EAAE;CAkC7B"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/index.js deleted file mode 100644 index a8eae24b0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/index.js +++ /dev/null @@ -1,152 +0,0 @@ -import { peerIdFromString } from '@libp2p/peer-id'; -import { multiaddr } from '@multiformats/multiaddr'; -import { debounce } from './utils.js'; -const defaultAddressFilter = (addrs) => addrs; -/** - * If the passed multiaddr contains the passed peer id, remove it - */ -function stripPeerId(ma, peerId) { - const observedPeerIdStr = ma.getPeerId(); - // strip our peer id if it has been passed - if (observedPeerIdStr != null) { - const observedPeerId = peerIdFromString(observedPeerIdStr); - // use same encoding for comparison - if (observedPeerId.equals(peerId)) { - ma = ma.decapsulate(multiaddr(`/p2p/${peerId.toString()}`)); - } - } - return ma; -} -export class DefaultAddressManager { - log; - components; - // this is an array to allow for duplicates, e.g. multiples of `/ip4/0.0.0.0/tcp/0` - listen; - announce; - observed; - announceFilter; - /** - * Responsible for managing the peer addresses. - * Peers can specify their listen and announce addresses. - * The listen addresses will be used by the libp2p transports to listen for new connections, - * while the announce addresses will be used for the peer addresses' to other peers in the network. - */ - constructor(components, init = {}) { - const { listen = [], announce = [] } = init; - this.components = components; - this.log = components.logger.forComponent('libp2p:address-manager'); - this.listen = listen.map(ma => ma.toString()); - this.announce = new Set(announce.map(ma => ma.toString())); - this.observed = new Map(); - this.announceFilter = init.announceFilter ?? defaultAddressFilter; - // this method gets called repeatedly on startup when transports start listening so - // debounce it so we don't cause multiple self:peer:update events to be emitted - this._updatePeerStoreAddresses = debounce(this._updatePeerStoreAddresses.bind(this), 1000); - // update our stored addresses when new transports listen - components.events.addEventListener('transport:listening', () => { - this._updatePeerStoreAddresses(); - }); - // update our stored addresses when existing transports stop listening - components.events.addEventListener('transport:close', () => { - this._updatePeerStoreAddresses(); - }); - } - _updatePeerStoreAddresses() { - // if announce addresses have been configured, ensure they make it into our peer - // record for things like identify - const addrs = this.getAnnounceAddrs() - .concat(this.components.transportManager.getAddrs()) - .concat([...this.observed.entries()] - .filter(([_, metadata]) => metadata.confident) - .map(([str]) => multiaddr(str))).map(ma => { - // strip our peer id if it is present - if (ma.getPeerId() === this.components.peerId.toString()) { - return ma.decapsulate(`/p2p/${this.components.peerId.toString()}`); - } - return ma; - }); - this.components.peerStore.patch(this.components.peerId, { - multiaddrs: addrs - }) - .catch(err => { this.log.error('error updating addresses', err); }); - } - /** - * Get peer listen multiaddrs - */ - getListenAddrs() { - return Array.from(this.listen).map((a) => multiaddr(a)); - } - /** - * Get peer announcing multiaddrs - */ - getAnnounceAddrs() { - return Array.from(this.announce).map((a) => multiaddr(a)); - } - /** - * Get observed multiaddrs - */ - getObservedAddrs() { - return Array.from(this.observed).map(([a]) => multiaddr(a)); - } - /** - * Add peer observed addresses - */ - addObservedAddr(addr) { - addr = stripPeerId(addr, this.components.peerId); - const addrString = addr.toString(); - // do not trigger the change:addresses event if we already know about this address - if (this.observed.has(addrString)) { - return; - } - this.observed.set(addrString, { - confident: false - }); - } - confirmObservedAddr(addr) { - addr = stripPeerId(addr, this.components.peerId); - const addrString = addr.toString(); - const metadata = this.observed.get(addrString) ?? { - confident: false - }; - const startingConfidence = metadata.confident; - this.observed.set(addrString, { - confident: true - }); - // only trigger the 'self:peer:update' event if our confidence in an address has changed - if (!startingConfidence) { - this._updatePeerStoreAddresses(); - } - } - removeObservedAddr(addr) { - addr = stripPeerId(addr, this.components.peerId); - const addrString = addr.toString(); - this.observed.delete(addrString); - } - getAddresses() { - let addrs = this.getAnnounceAddrs().map(ma => ma.toString()); - if (addrs.length === 0) { - // no configured announce addrs, add configured listen addresses - addrs = this.components.transportManager.getAddrs().map(ma => ma.toString()); - } - // add observed addresses we are confident in - addrs = addrs.concat(Array.from(this.observed) - .filter(([ma, metadata]) => metadata.confident) - .map(([ma]) => ma)); - // dedupe multiaddrs - const addrSet = new Set(addrs); - // Create advertising list - return this.announceFilter(Array.from(addrSet) - .map(str => multiaddr(str))) - .map(ma => { - // do not append our peer id to a path multiaddr as it will become invalid - if (ma.protos().pop()?.path === true) { - return ma; - } - if (ma.getPeerId() === this.components.peerId.toString()) { - return ma; - } - return ma.encapsulate(`/p2p/${this.components.peerId.toString()}`); - }); - } -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/index.js.map deleted file mode 100644 index cde528318..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/address-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AA+CrC,MAAM,oBAAoB,GAAG,CAAC,KAAkB,EAAe,EAAE,CAAC,KAAK,CAAA;AAMvE;;GAEG;AACH,SAAS,WAAW,CAAE,EAAa,EAAE,MAAc;IACjD,MAAM,iBAAiB,GAAG,EAAE,CAAC,SAAS,EAAE,CAAA;IAExC,0CAA0C;IAC1C,IAAI,iBAAiB,IAAI,IAAI,EAAE;QAC7B,MAAM,cAAc,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;QAE1D,mCAAmC;QACnC,IAAI,cAAc,CAAC,MAAM,CAAC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AO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;aAC3C,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;aAC3B,GAAG,CAAC,EAAE,CAAC,EAAE;YACR,0EAA0E;YAC1E,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,IAAI,KAAK,IAAI,EAAE;gBACpC,OAAO,EAAE,CAAA;aACV;YAED,IAAI,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE;gBACxD,OAAO,EAAE,CAAA;aACV;YAED,OAAO,EAAE,CAAC,WAAW,CAAC,QAAQ,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;QACpE,CAAC,CAAC,CAAA;IACN,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/utils.d.ts deleted file mode 100644 index 89fb3c330..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/utils.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function debounce(func: () => void, wait: number): () => void; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/utils.d.ts.map deleted file mode 100644 index d2b3e2d53..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/address-manager/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAE,IAAI,EAAE,MAAM,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,IAAI,CAYpE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/utils.js deleted file mode 100644 index a52ce5c66..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/utils.js +++ /dev/null @@ -1,12 +0,0 @@ -export function debounce(func, wait) { - let timeout; - return function () { - const later = function () { - timeout = undefined; - func(); - }; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - }; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/utils.js.map deleted file mode 100644 index 9bea1f23f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/address-manager/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/address-manager/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CAAE,IAAgB,EAAE,IAAY;IACtD,IAAI,OAAkD,CAAA;IAEtD,OAAO;QACL,MAAM,KAAK,GAAG;YACZ,OAAO,GAAG,SAAS,CAAA;YACnB,IAAI,EAAE,CAAA;QACR,CAAC,CAAA;QAED,YAAY,CAAC,OAAO,CAAC,CAAA;QACrB,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/components.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/components.d.ts deleted file mode 100644 index 725f12c52..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/components.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { type Startable } from '@libp2p/interface/startable'; -import type { Libp2pEvents, ComponentLogger, NodeInfo } from '@libp2p/interface'; -import type { ConnectionProtector } from '@libp2p/interface/connection'; -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -import type { ContentRouting } from '@libp2p/interface/content-routing'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerRouting } from '@libp2p/interface/peer-routing'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Upgrader } from '@libp2p/interface/transport'; -import type { AddressManager } from '@libp2p/interface-internal/address-manager'; -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'; -import type { Registrar } from '@libp2p/interface-internal/registrar'; -import type { TransportManager } from '@libp2p/interface-internal/transport-manager'; -import type { Datastore } from 'interface-datastore'; -export interface Components extends Record, Startable { - peerId: PeerId; - nodeInfo: NodeInfo; - logger: ComponentLogger; - events: TypedEventTarget; - addressManager: AddressManager; - peerStore: PeerStore; - upgrader: Upgrader; - registrar: Registrar; - connectionManager: ConnectionManager; - transportManager: TransportManager; - connectionGater: ConnectionGater; - contentRouting: ContentRouting; - peerRouting: PeerRouting; - datastore: Datastore; - connectionProtector?: ConnectionProtector; - metrics?: Metrics; -} -export interface ComponentsInit { - peerId?: PeerId; - nodeInfo?: NodeInfo; - logger?: ComponentLogger; - events?: TypedEventTarget; - addressManager?: AddressManager; - peerStore?: PeerStore; - upgrader?: Upgrader; - metrics?: Metrics; - registrar?: Registrar; - connectionManager?: ConnectionManager; - transportManager?: TransportManager; - connectionGater?: ConnectionGater; - contentRouting?: ContentRouting; - peerRouting?: PeerRouting; - datastore?: Datastore; - connectionProtector?: ConnectionProtector; -} -export declare function defaultComponents(init?: ComponentsInit): Components; -//# sourceMappingURL=components.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/components.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/components.d.ts.map deleted file mode 100644 index 9a716ba13..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/components.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/components.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAA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AAS,CAAA;IACrB,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;CAC1C;AA6ED,wBAAgB,iBAAiB,CAAE,IAAI,GAAE,cAAmB,GAAG,UAAU,CA+BxE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/components.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/components.js deleted file mode 100644 index ca141f10f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/components.js +++ /dev/null @@ -1,89 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { isStartable } from '@libp2p/interface/startable'; -import { defaultLogger } from '@libp2p/logger'; -class DefaultComponents { - components = {}; - _started = false; - constructor(init = {}) { - this.components = {}; - for (const [key, value] of Object.entries(init)) { - this.components[key] = value; - } - if (this.components.logger == null) { - this.components.logger = defaultLogger(); - } - } - isStarted() { - return this._started; - } - async _invokeStartableMethod(methodName) { - await Promise.all(Object.values(this.components) - .filter(obj => isStartable(obj)) - .map(async (startable) => { - await startable[methodName]?.(); - })); - } - async beforeStart() { - await this._invokeStartableMethod('beforeStart'); - } - async start() { - await this._invokeStartableMethod('start'); - this._started = true; - } - async afterStart() { - await this._invokeStartableMethod('afterStart'); - } - async beforeStop() { - await this._invokeStartableMethod('beforeStop'); - } - async stop() { - await this._invokeStartableMethod('stop'); - this._started = false; - } - async afterStop() { - await this._invokeStartableMethod('afterStop'); - } -} -const OPTIONAL_SERVICES = [ - 'metrics', - 'connectionProtector' -]; -const NON_SERVICE_PROPERTIES = [ - 'components', - 'isStarted', - 'beforeStart', - 'start', - 'afterStart', - 'beforeStop', - 'stop', - 'afterStop', - 'then', - '_invokeStartableMethod' -]; -export function defaultComponents(init = {}) { - const components = new DefaultComponents(init); - const proxy = new Proxy(components, { - get(target, prop, receiver) { - if (typeof prop === 'string' && !NON_SERVICE_PROPERTIES.includes(prop)) { - const service = components.components[prop]; - if (service == null && !OPTIONAL_SERVICES.includes(prop)) { - throw new CodeError(`${prop} not set`, 'ERR_SERVICE_MISSING'); - } - return service; - } - return Reflect.get(target, prop, receiver); - }, - set(target, prop, value) { - if (typeof prop === 'string') { - components.components[prop] = value; - } - else { - Reflect.set(target, prop, value); - } - return true; - } - }); - // @ts-expect-error component keys are proxied - return proxy; -} -//# sourceMappingURL=components.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/components.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/components.js.map deleted file mode 100644 index bcda671ae..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/components.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,WAAW,EAAkB,MAAM,6BAA6B,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAuD9C,MAAM,iBAAiB;IACd,UAAU,GAAwB,EAAE,CAAA;IACnC,QAAQ,GAAG,KAAK,CAAA;IAExB,YAAa,OAAuB,EAAE;QACpC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAA;QAEpB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC/C,IAAI,CAAC,U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ff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config.d.ts deleted file mode 100644 index ab4251ece..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Libp2pInit } from './index.js'; -import type { ServiceMap, RecursivePartial } from '@libp2p/interface'; -export declare function validateConfig>(opts: RecursivePartial>): Libp2pInit; -//# sourceMappingURL=config.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config.d.ts.map deleted file mode 100644 index 55a83bd41..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAqBrE,wBAAgB,cAAc,CAAE,CAAC,SAAS,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAG,IAAI,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAYrI"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config.js deleted file mode 100644 index e4c01621d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config.js +++ /dev/null @@ -1,34 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { FaultTolerance } from '@libp2p/interface/transport'; -import { defaultAddressSort } from '@libp2p/utils/address-sort'; -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers'; -import mergeOptions from 'merge-options'; -import { codes, messages } from './errors.js'; -const DefaultConfig = { - addresses: { - listen: [], - announce: [], - noAnnounce: [], - announceFilter: (multiaddrs) => multiaddrs - }, - connectionManager: { - resolvers: { - dnsaddr: dnsaddrResolver - }, - addressSorter: defaultAddressSort - }, - transportManager: { - faultTolerance: FaultTolerance.FATAL_ALL - } -}; -export function validateConfig(opts) { - const resultingOptions = mergeOptions(DefaultConfig, opts); - if (resultingOptions.transports == null || resultingOptions.transports.length < 1) { - throw new CodeError(messages.ERR_TRANSPORTS_REQUIRED, codes.ERR_TRANSPORTS_REQUIRED); - } - if (resultingOptions.connectionProtector === null && globalThis.process?.env?.LIBP2P_FORCE_PNET != null) { // eslint-disable-line no-undef - throw new CodeError(messages.ERR_PROTECTOR_REQUIRED, codes.ERR_PROTECTOR_REQUIRED); - } - return resultingOptions; -} -//# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config.js.map deleted file mode 100644 index e112d5382..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,YAAY,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAK7C,MAAM,aAAa,GAAwB;IACzC,SAAS,EAAE;QACT,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,cAAc,EAAE,CAAC,UAAuB,EAAE,EAAE,CAAC,UAAU;KACxD;IACD,iBAAiB,EAAE;QACjB,SAAS,EAAE;YACT,OAAO,EAAE,eAAe;SACzB;QACD,aAAa,EAAE,kBAAkB;KAClC;IACD,gBAAgB,EAAE;QAChB,cAAc,EAAE,cAAc,CAAC,SAAS;KACzC;CACF,CAAA;AAED,MAAM,UAAU,cAAc,CAAmD,IAAqC;IACpH,MAAM,gBAAgB,GAAkB,YAAY,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;IAEzE,IAAI,gBAAgB,CAAC,UAAU,IAAI,IAAI,IAAI,gBAAgB,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;QACjF,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,uBAAuB,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAA;KACrF;IAED,IAAI,gBAAgB,CAAC,mBAAmB,KAAK,IAAI,IAAI,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,iBAAiB,IAAI,IAAI,EAAE,EAAE,+BAA+B;QACxI,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAA;KACnF;IAED,OAAO,gBAAgB,CAAA;AACzB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.browser.d.ts deleted file mode 100644 index e9811302d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.browser.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -/** - * Returns a connection gater that disallows dialling private addresses by - * default. Browsers are severely limited in their resource usage so don't - * waste time trying to dial undiallable addresses. - */ -export declare function connectionGater(gater?: ConnectionGater): ConnectionGater; -//# sourceMappingURL=connection-gater.browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.browser.d.ts.map deleted file mode 100644 index 835c96980..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-gater.browser.d.ts","sourceRoot":"","sources":["../../../src/config/connection-gater.browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAGzE;;;;GAIG;AACH,wBAAgB,eAAe,CAAE,KAAK,GAAE,eAAoB,GAAG,eAAe,CAqB7E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.browser.js deleted file mode 100644 index 314f039c3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.browser.js +++ /dev/null @@ -1,27 +0,0 @@ -import isPrivate from 'private-ip'; -/** - * Returns a connection gater that disallows dialling private addresses by - * default. Browsers are severely limited in their resource usage so don't - * waste time trying to dial undiallable addresses. - */ -export function connectionGater(gater = {}) { - return { - denyDialPeer: async () => false, - denyDialMultiaddr: async (multiaddr) => { - const tuples = multiaddr.stringTuples(); - if (tuples[0][0] === 4 || tuples[0][0] === 41) { - return Boolean(isPrivate(`${tuples[0][1]}`)); - } - return false; - }, - denyInboundConnection: async () => false, - denyOutboundConnection: async () => false, - denyInboundEncryptedConnection: async () => false, - denyOutboundEncryptedConnection: async () => false, - denyInboundUpgradedConnection: async () => false, - denyOutboundUpgradedConnection: async () => false, - filterMultiaddrForPeer: async () => true, - ...gater - }; -} -//# sourceMappingURL=connection-gater.browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.browser.js.map deleted file mode 100644 index 6cc29ec56..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-gater.browser.js","sourceRoot":"","sources":["../../../src/config/connection-gater.browser.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAA;AAIlC;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAE,QAAyB,EAAE;IAC1D,OAAO;QACL,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAC/B,iBAAiB,EAAE,KAAK,EAAE,SAAoB,EAAE,EAAE;YAChD,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,EAAE,CAAA;YAEvC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC7C,OAAO,OAAO,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;aAC7C;YAED,OAAO,KAAK,CAAA;QACd,CAAC;QACD,qBAAqB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACxC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACzC,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,+BAA+B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAClD,6BAA6B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAChD,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI;QACxC,GAAG,KAAK;KACT,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.d.ts deleted file mode 100644 index e0c7d6071..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -/** - * Returns a default connection gater implementation that allows everything - */ -export declare function connectionGater(gater?: ConnectionGater): ConnectionGater; -//# sourceMappingURL=connection-gater.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.d.ts.map deleted file mode 100644 index 611e82ee3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-gater.d.ts","sourceRoot":"","sources":["../../../src/config/connection-gater.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAEzE;;GAEG;AACH,wBAAgB,eAAe,CAAE,KAAK,GAAE,eAAoB,GAAG,eAAe,CAa7E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.js deleted file mode 100644 index 8795542ce..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Returns a default connection gater implementation that allows everything - */ -export function connectionGater(gater = {}) { - return { - denyDialPeer: async () => false, - denyDialMultiaddr: async () => false, - denyInboundConnection: async () => false, - denyOutboundConnection: async () => false, - denyInboundEncryptedConnection: async () => false, - denyOutboundEncryptedConnection: async () => false, - denyInboundUpgradedConnection: async () => false, - denyOutboundUpgradedConnection: async () => false, - filterMultiaddrForPeer: async () => true, - ...gater - }; -} -//# sourceMappingURL=connection-gater.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.js.map deleted file mode 100644 index e94bddffb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/config/connection-gater.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-gater.js","sourceRoot":"","sources":["../../../src/config/connection-gater.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,eAAe,CAAE,QAAyB,EAAE;IAC1D,OAAO;QACL,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAC/B,iBAAiB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACpC,qBAAqB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACxC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACzC,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,+BAA+B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAClD,6BAA6B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAChD,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI;QACxC,GAAG,KAAK;KACT,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/auto-dial.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/auto-dial.d.ts deleted file mode 100644 index 65674c201..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/auto-dial.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { Libp2pEvents, ComponentLogger } from '@libp2p/interface'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Startable } from '@libp2p/interface/startable'; -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'; -interface AutoDialInit { - minConnections?: number; - maxQueueLength?: number; - autoDialConcurrency?: number; - autoDialPriority?: number; - autoDialInterval?: number; - autoDialPeerRetryThreshold?: number; - autoDialDiscoveredPeersDebounce?: number; -} -interface AutoDialComponents { - connectionManager: ConnectionManager; - peerStore: PeerStore; - events: TypedEventTarget; - logger: ComponentLogger; -} -export declare class AutoDial implements Startable { - private readonly connectionManager; - private readonly peerStore; - private readonly queue; - private readonly minConnections; - private readonly autoDialPriority; - private readonly autoDialIntervalMs; - private readonly autoDialMaxQueueLength; - private readonly autoDialPeerRetryThresholdMs; - private readonly autoDialDiscoveredPeersDebounce; - private autoDialInterval?; - private started; - private running; - private readonly log; - /** - * Proactively tries to connect to known peers stored in the PeerStore. - * It will keep the number of connections below the upper limit and sort - * the peers to connect based on whether we know their keys and protocols. - */ - constructor(components: AutoDialComponents, init: AutoDialInit); - isStarted(): boolean; - start(): void; - afterStart(): void; - stop(): void; - autoDial(): Promise; -} -export {}; -//# sourceMappingURL=auto-dial.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/auto-dial.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/auto-dial.d.ts.map deleted file mode 100644 index 1038109b7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/auto-dial.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auto-dial.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/auto-dial.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAU,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAA;AAEtF,UAAU,YAAY;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,0BAA0B,CAAC,EAAE,MAAM,CAAA;IACnC,+BAA+B,CAAC,EAAE,MAAM,CAAA;CACzC;AAED,UAAU,kBAAkB;IAC1B,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAA;IACtC,MAAM,EAAE,eAAe,CAAA;CACxB;AAYD,qBAAa,QAAS,YAAW,SAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IACrD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAQ;IACvC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAQ;IACzC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAQ;IAC3C,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAQ;IAC/C,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAQ;IACrD,OAAO,CAAC,QAAQ,CAAC,+BAA+B,CAAQ;IACxD,OAAO,CAAC,gBAAgB,CAAC,CAAgC;IACzD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAE5B;;;;OAIG;gBACU,UAAU,EAAE,kBAAkB,EAAE,IAAI,EAAE,YAAY;IA4C/D,SAAS,IAAK,OAAO;IAIrB,KAAK,IAAK,IAAI;IAUd,UAAU,IAAK,IAAI;IAOnB,IAAI,IAAK,IAAI;IAQP,QAAQ,IAAK,OAAO,CAAC,IAAI,CAAC;CA4JjC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/auto-dial.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/auto-dial.js deleted file mode 100644 index 801fc1e0c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/auto-dial.js +++ /dev/null @@ -1,224 +0,0 @@ -import { PeerMap, PeerSet } from '@libp2p/peer-collections'; -import { PeerJobQueue } from '@libp2p/utils/peer-job-queue'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { AUTO_DIAL_CONCURRENCY, AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE, AUTO_DIAL_INTERVAL, AUTO_DIAL_MAX_QUEUE_LENGTH, AUTO_DIAL_PEER_RETRY_THRESHOLD, AUTO_DIAL_PRIORITY, LAST_DIAL_FAILURE_KEY, MIN_CONNECTIONS } from './constants.js'; -const defaultOptions = { - minConnections: MIN_CONNECTIONS, - maxQueueLength: AUTO_DIAL_MAX_QUEUE_LENGTH, - autoDialConcurrency: AUTO_DIAL_CONCURRENCY, - autoDialPriority: AUTO_DIAL_PRIORITY, - autoDialInterval: AUTO_DIAL_INTERVAL, - autoDialPeerRetryThreshold: AUTO_DIAL_PEER_RETRY_THRESHOLD, - autoDialDiscoveredPeersDebounce: AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE -}; -export class AutoDial { - connectionManager; - peerStore; - queue; - minConnections; - autoDialPriority; - autoDialIntervalMs; - autoDialMaxQueueLength; - autoDialPeerRetryThresholdMs; - autoDialDiscoveredPeersDebounce; - autoDialInterval; - started; - running; - log; - /** - * Proactively tries to connect to known peers stored in the PeerStore. - * It will keep the number of connections below the upper limit and sort - * the peers to connect based on whether we know their keys and protocols. - */ - constructor(components, init) { - this.connectionManager = components.connectionManager; - this.peerStore = components.peerStore; - this.minConnections = init.minConnections ?? defaultOptions.minConnections; - this.autoDialPriority = init.autoDialPriority ?? defaultOptions.autoDialPriority; - this.autoDialIntervalMs = init.autoDialInterval ?? defaultOptions.autoDialInterval; - this.autoDialMaxQueueLength = init.maxQueueLength ?? defaultOptions.maxQueueLength; - this.autoDialPeerRetryThresholdMs = init.autoDialPeerRetryThreshold ?? defaultOptions.autoDialPeerRetryThreshold; - this.autoDialDiscoveredPeersDebounce = init.autoDialDiscoveredPeersDebounce ?? defaultOptions.autoDialDiscoveredPeersDebounce; - this.log = components.logger.forComponent('libp2p:connection-manager:auto-dial'); - this.started = false; - this.running = false; - this.queue = new PeerJobQueue({ - concurrency: init.autoDialConcurrency ?? defaultOptions.autoDialConcurrency - }); - this.queue.addListener('error', (err) => { - this.log.error('error during auto-dial', err); - }); - // check the min connection limit whenever a peer disconnects - components.events.addEventListener('connection:close', () => { - this.autoDial() - .catch(err => { - this.log.error(err); - }); - }); - // sometimes peers are discovered in quick succession so add a small - // debounce to ensure all eligible peers are autodialed - let debounce; - // when new peers are discovered, dial them if we don't have - // enough connections - components.events.addEventListener('peer:discovery', () => { - clearTimeout(debounce); - debounce = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error(err); - }); - }, this.autoDialDiscoveredPeersDebounce); - }); - } - isStarted() { - return this.started; - } - start() { - this.autoDialInterval = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err); - }); - }, this.autoDialIntervalMs); - this.started = true; - } - afterStart() { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err); - }); - } - stop() { - // clear the queue - this.queue.clear(); - clearTimeout(this.autoDialInterval); - this.started = false; - this.running = false; - } - async autoDial() { - if (!this.started) { - return; - } - const connections = this.connectionManager.getConnectionsMap(); - const numConnections = connections.size; - // Already has enough connections - if (numConnections >= this.minConnections) { - if (this.minConnections > 0) { - this.log.trace('have enough connections %d/%d', numConnections, this.minConnections); - } - return; - } - if (this.queue.size > this.autoDialMaxQueueLength) { - this.log('not enough connections %d/%d but auto dial queue is full', numConnections, this.minConnections); - return; - } - if (this.running) { - this.log('not enough connections %d/%d - but skipping autodial as it is already running', numConnections, this.minConnections); - return; - } - this.running = true; - this.log('not enough connections %d/%d - will dial peers to increase the number of connections', numConnections, this.minConnections); - const dialQueue = new PeerSet( - // @ts-expect-error boolean filter removes falsy peer IDs - this.connectionManager.getDialQueue() - .map(queue => queue.peerId) - .filter(Boolean)); - // Sort peers on whether we know protocols or public keys for them - const peers = await this.peerStore.all({ - filters: [ - // Remove some peers - (peer) => { - // Remove peers without addresses - if (peer.addresses.length === 0) { - this.log.trace('not autodialing %p because they have no addresses', peer.id); - return false; - } - // remove peers we are already connected to - if (connections.has(peer.id)) { - this.log.trace('not autodialing %p because they are already connected', peer.id); - return false; - } - // remove peers we are already dialling - if (dialQueue.has(peer.id)) { - this.log.trace('not autodialing %p because they are already being dialed', peer.id); - return false; - } - // remove peers already in the autodial queue - if (this.queue.hasJob(peer.id)) { - this.log.trace('not autodialing %p because they are already being autodialed', peer.id); - return false; - } - return true; - } - ] - }); - // shuffle the peers - this is so peers with the same tag values will be - // dialled in a different order each time - const shuffledPeers = peers.sort(() => Math.random() > 0.5 ? 1 : -1); - // Sort shuffled peers by tag value - const peerValues = new PeerMap(); - for (const peer of shuffledPeers) { - if (peerValues.has(peer.id)) { - continue; - } - // sum all tag values - peerValues.set(peer.id, [...peer.tags.values()].reduce((acc, curr) => { - return acc + curr.value; - }, 0)); - } - // sort by value, highest to lowest - const sortedPeers = shuffledPeers.sort((a, b) => { - const peerAValue = peerValues.get(a.id) ?? 0; - const peerBValue = peerValues.get(b.id) ?? 0; - if (peerAValue > peerBValue) { - return -1; - } - if (peerAValue < peerBValue) { - return 1; - } - return 0; - }); - const peersThatHaveNotFailed = sortedPeers.filter(peer => { - const lastDialFailure = peer.metadata.get(LAST_DIAL_FAILURE_KEY); - if (lastDialFailure == null) { - return true; - } - const lastDialFailureTimestamp = parseInt(uint8ArrayToString(lastDialFailure)); - if (isNaN(lastDialFailureTimestamp)) { - return true; - } - // only dial if the time since the last failure is above the retry threshold - return Date.now() - lastDialFailureTimestamp > this.autoDialPeerRetryThresholdMs; - }); - this.log('selected %d/%d peers to dial', peersThatHaveNotFailed.length, peers.length); - for (const peer of peersThatHaveNotFailed) { - this.queue.add(async () => { - const numConnections = this.connectionManager.getConnectionsMap().size; - // Check to see if we still need to auto dial - if (numConnections >= this.minConnections) { - this.log('got enough connections now %d/%d', numConnections, this.minConnections); - this.queue.clear(); - return; - } - this.log('connecting to a peerStore stored peer %p', peer.id); - await this.connectionManager.openConnection(peer.id, { - priority: this.autoDialPriority - }); - }, { - peerId: peer.id - }).catch(err => { - this.log.error('could not connect to peerStore stored peer', err); - }); - } - this.running = false; - if (this.started) { - this.autoDialInterval = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err); - }); - }, this.autoDialIntervalMs); - } - } -} -//# sourceMappingURL=auto-dial.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/auto-dial.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/auto-dial.js.map deleted file mode 100644 index ffc5b37a7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/auto-dial.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auto-dial.js","sourceRoot":"","sources":["../../../src/connection-manager/auto-dial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,qBAAqB,EAAE,mCAAmC,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAwBvO,MAAM,cAAc,GAAG;IACrB,cAAc,EAAE,eAAe;IAC/B,cAAc,EAAE,0BAA0B;IAC1C,mBAAmB,EAAE,qBAAqB;IAC1C,gBAAgB,EA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E,CAAC,CAAA;gBAC7D,MAAM,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE;oBACnD,QAAQ,EAAE,IAAI,CAAC,gBAAgB;iBAChC,CAAC,CAAA;YACJ,CAAC,EAAE;gBACD,MAAM,EAAE,IAAI,CAAC,EAAE;aAChB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;gBACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,4CAA4C,EAAE,GAAG,CAAC,CAAA;YACnE,CAAC,CAAC,CAAA;SACH;QAED,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QAEpB,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,GAAG,EAAE;gBACtC,IAAI,CAAC,QAAQ,EAAE;qBACZ,KAAK,CAAC,GAAG,CAAC,EAAE;oBACX,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAA;gBAChD,CAAC,CAAC,CAAA;YACN,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAA;SAC5B;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/connection-pruner.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/connection-pruner.d.ts deleted file mode 100644 index bb19797af..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/connection-pruner.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { Libp2pEvents, ComponentLogger } from '@libp2p/interface'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'; -import type { Multiaddr } from '@multiformats/multiaddr'; -interface ConnectionPrunerInit { - maxConnections?: number; - allow?: Multiaddr[]; -} -interface ConnectionPrunerComponents { - connectionManager: ConnectionManager; - peerStore: PeerStore; - events: TypedEventTarget; - logger: ComponentLogger; -} -/** - * If we go over the max connections limit, choose some connections to close - */ -export declare class ConnectionPruner { - private readonly maxConnections; - private readonly connectionManager; - private readonly peerStore; - private readonly allow; - private readonly events; - private readonly log; - constructor(components: ConnectionPrunerComponents, init?: ConnectionPrunerInit); - /** - * If we have more connections than our maximum, select some excess connections - * to prune based on peer value - */ - maybePruneConnections(): Promise; -} -export {}; -//# sourceMappingURL=connection-pruner.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/connection-pruner.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/connection-pruner.d.ts.map deleted file mode 100644 index 16cb1424a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/connection-pruner.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-pruner.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/connection-pruner.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAU,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAA;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,UAAU,oBAAoB;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;CACpB;AAED,UAAU,0BAA0B;IAClC,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAA;IACtC,MAAM,EAAE,eAAe,CAAA;CACxB;AAOD;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAQ;IACvC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IACrD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgC;IACvD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;gBAEf,UAAU,EAAE,0BAA0B,EAAE,IAAI,GAAE,oBAAyB;IAiBpF;;;OAGG;IACG,qBAAqB,IAAK,OAAO,CAAC,IAAI,CAAC;CAmG9C"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/connection-pruner.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/connection-pruner.js deleted file mode 100644 index 9993d96b0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/connection-pruner.js +++ /dev/null @@ -1,116 +0,0 @@ -import { PeerMap } from '@libp2p/peer-collections'; -import { MAX_CONNECTIONS } from './constants.js'; -const defaultOptions = { - maxConnections: MAX_CONNECTIONS, - allow: [] -}; -/** - * If we go over the max connections limit, choose some connections to close - */ -export class ConnectionPruner { - maxConnections; - connectionManager; - peerStore; - allow; - events; - log; - constructor(components, init = {}) { - this.maxConnections = init.maxConnections ?? defaultOptions.maxConnections; - this.allow = init.allow ?? defaultOptions.allow; - this.connectionManager = components.connectionManager; - this.peerStore = components.peerStore; - this.events = components.events; - this.log = components.logger.forComponent('libp2p:connection-manager:connection-pruner'); - // check the max connection limit whenever a peer connects - components.events.addEventListener('connection:open', () => { - this.maybePruneConnections() - .catch(err => { - this.log.error(err); - }); - }); - } - /** - * If we have more connections than our maximum, select some excess connections - * to prune based on peer value - */ - async maybePruneConnections() { - const connections = this.connectionManager.getConnections(); - const numConnections = connections.length; - const toPrune = Math.max(numConnections - this.maxConnections, 0); - this.log('checking max connections limit %d/%d', numConnections, this.maxConnections); - if (numConnections <= this.maxConnections) { - return; - } - this.log('max connections limit exceeded %d/%d, pruning %d connection(s)', numConnections, this.maxConnections, toPrune); - const peerValues = new PeerMap(); - // work out peer values - for (const connection of connections) { - const remotePeer = connection.remotePeer; - if (peerValues.has(remotePeer)) { - continue; - } - peerValues.set(remotePeer, 0); - try { - const peer = await this.peerStore.get(remotePeer); - // sum all tag values - peerValues.set(remotePeer, [...peer.tags.values()].reduce((acc, curr) => { - return acc + curr.value; - }, 0)); - } - catch (err) { - if (err.code !== 'ERR_NOT_FOUND') { - this.log.error('error loading peer tags', err); - } - } - } - // sort by value, lowest to highest - const sortedConnections = connections.sort((a, b) => { - const peerAValue = peerValues.get(a.remotePeer) ?? 0; - const peerBValue = peerValues.get(b.remotePeer) ?? 0; - if (peerAValue > peerBValue) { - return 1; - } - if (peerAValue < peerBValue) { - return -1; - } - // if the peers have an equal tag value then we want to close short-lived connections first - const connectionALifespan = a.timeline.open; - const connectionBLifespan = b.timeline.open; - if (connectionALifespan < connectionBLifespan) { - return 1; - } - if (connectionALifespan > connectionBLifespan) { - return -1; - } - return 0; - }); - // close some connections - const toClose = []; - for (const connection of sortedConnections) { - this.log('too many connections open - closing a connection to %p', connection.remotePeer); - // check allow list - const connectionInAllowList = this.allow.some((ma) => { - return connection.remoteAddr.toString().startsWith(ma.toString()); - }); - // Connections in the allow list should be excluded from pruning - if (!connectionInAllowList) { - toClose.push(connection); - } - if (toClose.length === toPrune) { - break; - } - } - // close connections - await Promise.all(toClose.map(async (connection) => { - try { - await connection.close(); - } - catch (err) { - this.log.error(err); - } - })); - // despatch prune event - this.events.safeDispatchEvent('connection:prune', { detail: toClose }); - } -} -//# sourceMappingURL=connection-pruner.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/connection-pruner.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/connection-pruner.js.map deleted file mode 100644 index baaa2d894..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/connection-pruner.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-pruner.js","sourceRoot":"","sources":["../../../src/connection-manager/connection-pruner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAmBhD,MAAM,cAAc,GAAG;IACrB,cAAc,EAAE,eAAe;IAC/B,KAAK,EAAE,EAAE;CACV,CAAA;AAED;;GAEG;AACH,MAAM,OAAO,gBAAgB;IACV,cAAc,CAAQ;IACtB,iBAAiB,CAAmB;IACpC,SAAS,CAAW;IACpB,KAAK,CAAa;IAClB,MAAM,CAAgC;IACtC,GAAG,CAAQ;IAE5B,YAAa,UAAsC,EAAE,OAA6B,EAAE;QAClF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,cAAc,CAAA;QAC1E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,cAAc,CAAC,KAAK,CAAA;QAC/C,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAA;QACrD,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAA;QACrC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAA;QAC/B,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,6CAA6C,CAAC,CAAA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C,IAAI,CAAC,GAAG,CAAC,wDAAwD,EAAE,UAAU,CAAC,UAAU,CAAC,CAAA;YACzF,mBAAmB;YACnB,MAAM,qBAAqB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE;gBACnD,OAAO,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;YACnE,CAAC,CAAC,CAAA;YAEF,gEAAgE;YAChE,IAAI,CAAC,qBAAqB,EAAE;gBAC1B,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;aACzB;YAED,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;gBAC9B,MAAK;aACN;SACF;QAED,oBAAoB;QACpB,MAAM,OAAO,CAAC,GAAG,CACf,OAAO,CAAC,GAAG,CAAC,KAAK,EAAC,UAAU,EAAC,EAAE;YAC7B,IAAI;gBACF,MAAM,UAAU,CAAC,KAAK,EAAE,CAAA;aACzB;YAAC,OAAO,GAAG,EAAE;gBACZ,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;aACpB;QACH,CAAC,CAAC,CACH,CAAA;QAED,uBAAuB;QACvB,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;IACxE,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.browser.d.ts deleted file mode 100644 index 925afbf76..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.browser.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export * from './constants.defaults.js'; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export declare const MIN_CONNECTIONS = 5; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export declare const MAX_CONNECTIONS = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export declare const MAX_PARALLEL_DIALS = 50; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export declare const AUTO_DIAL_PEER_RETRY_THRESHOLD: number; -//# sourceMappingURL=constants.browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.browser.d.ts.map deleted file mode 100644 index 090ece33c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.browser.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/constants.browser.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC;;GAEG;AACH,eAAO,MAAM,eAAe,IAAI,CAAA;AAEhC;;GAEG;AACH,eAAO,MAAM,eAAe,MAAM,CAAA;AAElC;;GAEG;AACH,eAAO,MAAM,kBAAkB,KAAK,CAAA;AAEpC;;GAEG;AACH,eAAO,MAAM,8BAA8B,QAAgB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.browser.js deleted file mode 100644 index 1d1ac1e69..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.browser.js +++ /dev/null @@ -1,18 +0,0 @@ -export * from './constants.defaults.js'; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export const MIN_CONNECTIONS = 5; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export const MAX_CONNECTIONS = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export const MAX_PARALLEL_DIALS = 50; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export const AUTO_DIAL_PEER_RETRY_THRESHOLD = 1000 * 60 * 7; -//# sourceMappingURL=constants.browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.browser.js.map deleted file mode 100644 index e5dde1817..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.browser.js","sourceRoot":"","sources":["../../../src/connection-manager/constants.browser.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAA;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAA;AAEpC;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,GAAG,EAAE,GAAG,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.d.ts deleted file mode 100644 index 7abb2020e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export * from './constants.defaults.js'; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export declare const MIN_CONNECTIONS = 50; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export declare const MAX_CONNECTIONS = 300; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export declare const MAX_PARALLEL_DIALS = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export declare const AUTO_DIAL_PEER_RETRY_THRESHOLD: number; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.d.ts.map deleted file mode 100644 index 6e0f71505..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/constants.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC;;GAEG;AACH,eAAO,MAAM,eAAe,KAAK,CAAA;AAEjC;;GAEG;AACH,eAAO,MAAM,eAAe,MAAM,CAAA;AAElC;;GAEG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAA;AAErC;;GAEG;AACH,eAAO,MAAM,8BAA8B,QAAY,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.defaults.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.defaults.d.ts deleted file mode 100644 index 24e4c5c07..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.defaults.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#dialTimeout - */ -export declare const DIAL_TIMEOUT = 30000; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundUpgradeTimeout - */ -export declare const INBOUND_UPGRADE_TIMEOUT = 30000; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxPeerAddrsToDial - */ -export declare const MAX_PEER_ADDRS_TO_DIAL = 25; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialInterval - */ -export declare const AUTO_DIAL_INTERVAL = 5000; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialConcurrency - */ -export declare const AUTO_DIAL_CONCURRENCY = 25; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialPriority - */ -export declare const AUTO_DIAL_PRIORITY = 0; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialMaxQueueLength - */ -export declare const AUTO_DIAL_MAX_QUEUE_LENGTH = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialDiscoveredPeersDebounce - */ -export declare const AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE = 10; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundConnectionThreshold - */ -export declare const INBOUND_CONNECTION_THRESHOLD = 5; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxIncomingPendingConnections - */ -export declare const MAX_INCOMING_PENDING_CONNECTIONS = 10; -/** - * Store as part of the peer store metadata for a given peer, the value for this - * key is a timestamp of the last time a dial attempted failed with the relevant - * peer stored as a string. - * - * Used to insure we do not endlessly try to auto dial peers we have recently - * failed to dial. - */ -export declare const LAST_DIAL_FAILURE_KEY = "last-dial-failure"; -//# sourceMappingURL=constants.defaults.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.defaults.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.defaults.d.ts.map deleted file mode 100644 index 67ae45655..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.defaults.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.defaults.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/constants.defaults.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,YAAY,QAAO,CAAA;AAEhC;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAAO,CAAA;AAE3C;;GAEG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAA;AAExC;;GAEG;AACH,eAAO,MAAM,kBAAkB,OAAO,CAAA;AAEtC;;GAEG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAA;AAEvC;;GAEG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAA;AAEnC;;GAEG;AACH,eAAO,MAAM,0BAA0B,MAAM,CAAA;AAE7C;;GAEG;AACH,eAAO,MAAM,mCAAmC,KAAK,CAAA;AAErD;;GAEG;AACH,eAAO,MAAM,4BAA4B,IAAI,CAAA;AAE7C;;GAEG;AACH,eAAO,MAAM,gCAAgC,KAAK,CAAA;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,sBAAsB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.defaults.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.defaults.js deleted file mode 100644 index 8175635a8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.defaults.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#dialTimeout - */ -export const DIAL_TIMEOUT = 30e3; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundUpgradeTimeout - */ -export const INBOUND_UPGRADE_TIMEOUT = 30e3; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxPeerAddrsToDial - */ -export const MAX_PEER_ADDRS_TO_DIAL = 25; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialInterval - */ -export const AUTO_DIAL_INTERVAL = 5000; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialConcurrency - */ -export const AUTO_DIAL_CONCURRENCY = 25; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialPriority - */ -export const AUTO_DIAL_PRIORITY = 0; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialMaxQueueLength - */ -export const AUTO_DIAL_MAX_QUEUE_LENGTH = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialDiscoveredPeersDebounce - */ -export const AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE = 10; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundConnectionThreshold - */ -export const INBOUND_CONNECTION_THRESHOLD = 5; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxIncomingPendingConnections - */ -export const MAX_INCOMING_PENDING_CONNECTIONS = 10; -/** - * Store as part of the peer store metadata for a given peer, the value for this - * key is a timestamp of the last time a dial attempted failed with the relevant - * peer stored as a string. - * - * Used to insure we do not endlessly try to auto dial peers we have recently - * failed to dial. - */ -export const LAST_DIAL_FAILURE_KEY = 'last-dial-failure'; -//# sourceMappingURL=constants.defaults.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.defaults.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.defaults.js.map deleted file mode 100644 index 39ecc9b1a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.defaults.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.defaults.js","sourceRoot":"","sources":["../../../src/connection-manager/constants.defaults.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAA;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAA;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAA;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAA;AAEtC;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAA;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAA;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAA;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,EAAE,CAAA;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAA;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,CAAA;AAElD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.js deleted file mode 100644 index df9b5d654..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.js +++ /dev/null @@ -1,18 +0,0 @@ -export * from './constants.defaults.js'; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export const MIN_CONNECTIONS = 50; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export const MAX_CONNECTIONS = 300; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export const MAX_PARALLEL_DIALS = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export const AUTO_DIAL_PEER_RETRY_THRESHOLD = 1000 * 60; -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.js.map deleted file mode 100644 index 4f42256bd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/connection-manager/constants.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAA;AAEjC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAErC;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,GAAG,EAAE,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/dial-queue.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/dial-queue.d.ts deleted file mode 100644 index e297eca62..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/dial-queue.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { PeerMap } from '@libp2p/peer-collections'; -import { type Multiaddr, type Resolver } from '@multiformats/multiaddr'; -import PQueue from 'p-queue'; -import type { AddressSorter, AbortOptions, PendingDial, ComponentLogger } from '@libp2p/interface'; -import type { Connection } from '@libp2p/interface/connection'; -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { TransportManager } from '@libp2p/interface-internal/transport-manager'; -export interface PendingDialTarget { - resolve(value: any): void; - reject(err: Error): void; -} -export interface DialOptions extends AbortOptions { - priority?: number; - force?: boolean; -} -interface PendingDialInternal extends PendingDial { - promise: Promise; -} -interface DialerInit { - addressSorter?: AddressSorter; - maxParallelDials?: number; - maxPeerAddrsToDial?: number; - dialTimeout?: number; - resolvers?: Record; - connections?: PeerMap; -} -interface DialQueueComponents { - peerId: PeerId; - metrics?: Metrics; - peerStore: PeerStore; - transportManager: TransportManager; - connectionGater: ConnectionGater; - logger: ComponentLogger; -} -export declare class DialQueue { - pendingDials: PendingDialInternal[]; - queue: PQueue; - private readonly peerId; - private readonly peerStore; - private readonly connectionGater; - private readonly transportManager; - private readonly addressSorter; - private readonly maxPeerAddrsToDial; - private readonly dialTimeout; - private readonly inProgressDialCount?; - private readonly pendingDialCount?; - private readonly shutDownController; - private readonly connections; - private readonly log; - constructor(components: DialQueueComponents, init?: DialerInit); - /** - * Clears any pending dials - */ - stop(): void; - /** - * Connects to a given peer, multiaddr or list of multiaddrs. - * - * If a peer is passed, all known multiaddrs will be tried. If a multiaddr or - * multiaddrs are passed only those will be dialled. - * - * Where a list of multiaddrs is passed, if any contain a peer id then all - * multiaddrs in the list must contain the same peer id. - * - * The dial to the first address that is successfully able to upgrade a connection - * will be used, all other dials will be aborted when that happens. - */ - dial(peerIdOrMultiaddr: PeerId | Multiaddr | Multiaddr[], options?: DialOptions): Promise; - private createDialAbortControllers; - private calculateMultiaddrs; - private performDial; -} -export {}; -//# sourceMappingURL=dial-queue.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/dial-queue.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/dial-queue.d.ts.map deleted file mode 100644 index 2b96b8863..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/dial-queue.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dial-queue.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/dial-queue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAElD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAa,MAAM,yBAAyB,CAAA;AAIlF,OAAO,MAAM,MAAM,SAAS,CAAA;AAW5B,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAU,MAAM,mBAAmB,CAAA;AAC1G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,KAAK,EAAU,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAW,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AAEpF,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,CAAA;IACzB,MAAM,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,UAAU,mBAAoB,SAAQ,WAAW;IAC/C,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;CAC7B;AAED,UAAU,UAAU;IAClB,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,gBAAgB,CAAC,EAAE,MAAM,C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AAG,SAAS,GAAG,SAAS,EAAE,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,UAAU,CAAC;IAuIhH,OAAO,CAAC,0BAA0B;YAkBpB,mBAAmB;YA0InB,WAAW;CAoH1B"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/dial-queue.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/dial-queue.js deleted file mode 100644 index 51fac6935..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/dial-queue.js +++ /dev/null @@ -1,454 +0,0 @@ -import { AbortError, CodeError } from '@libp2p/interface/errors'; -import { setMaxListeners } from '@libp2p/interface/events'; -import { PeerMap } from '@libp2p/peer-collections'; -import { defaultAddressSort } from '@libp2p/utils/address-sort'; -import { resolvers } from '@multiformats/multiaddr'; -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers'; -import { anySignal } from 'any-signal'; -import pDefer from 'p-defer'; -import PQueue from 'p-queue'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { codes } from '../errors.js'; -import { getPeerAddress } from '../get-peer.js'; -import { DIAL_TIMEOUT, MAX_PARALLEL_DIALS, MAX_PEER_ADDRS_TO_DIAL, LAST_DIAL_FAILURE_KEY } from './constants.js'; -import { combineSignals, resolveMultiaddrs } from './utils.js'; -const ERR_TIMEOUT = 'ERR_TIMEOUT'; -const defaultOptions = { - addressSorter: defaultAddressSort, - maxParallelDials: MAX_PARALLEL_DIALS, - maxPeerAddrsToDial: MAX_PEER_ADDRS_TO_DIAL, - dialTimeout: DIAL_TIMEOUT, - resolvers: { - dnsaddr: dnsaddrResolver - } -}; -export class DialQueue { - pendingDials; - queue; - peerId; - peerStore; - connectionGater; - transportManager; - addressSorter; - maxPeerAddrsToDial; - dialTimeout; - inProgressDialCount; - pendingDialCount; - shutDownController; - connections; - log; - constructor(components, init = {}) { - this.addressSorter = init.addressSorter ?? defaultOptions.addressSorter; - this.maxPeerAddrsToDial = init.maxPeerAddrsToDial ?? defaultOptions.maxPeerAddrsToDial; - this.dialTimeout = init.dialTimeout ?? defaultOptions.dialTimeout; - this.connections = init.connections ?? new PeerMap(); - this.log = components.logger.forComponent('libp2p:connection-manager:dial-queue'); - this.peerId = components.peerId; - this.peerStore = components.peerStore; - this.connectionGater = components.connectionGater; - this.transportManager = components.transportManager; - this.shutDownController = new AbortController(); - setMaxListeners(Infinity, this.shutDownController.signal); - this.pendingDialCount = components.metrics?.registerMetric('libp2p_dial_queue_pending_dials'); - this.inProgressDialCount = components.metrics?.registerMetric('libp2p_dial_queue_in_progress_dials'); - this.pendingDials = []; - for (const [key, value] of Object.entries(init.resolvers ?? {})) { - resolvers.set(key, value); - } - // controls dial concurrency - this.queue = new PQueue({ - concurrency: init.maxParallelDials ?? defaultOptions.maxParallelDials - }); - // a job was added to the queue - this.queue.on('add', () => { - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - // a queued job started - this.queue.on('active', () => { - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - // a started job completed without error - this.queue.on('completed', () => { - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - // a started job errored - this.queue.on('error', (err) => { - this.log.error('error in dial queue', err); - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - // all queued jobs have been started - this.queue.on('empty', () => { - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - // add started jobs have run and the queue is empty - this.queue.on('idle', () => { - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - } - /** - * Clears any pending dials - */ - stop() { - this.shutDownController.abort(); - } - /** - * Connects to a given peer, multiaddr or list of multiaddrs. - * - * If a peer is passed, all known multiaddrs will be tried. If a multiaddr or - * multiaddrs are passed only those will be dialled. - * - * Where a list of multiaddrs is passed, if any contain a peer id then all - * multiaddrs in the list must contain the same peer id. - * - * The dial to the first address that is successfully able to upgrade a connection - * will be used, all other dials will be aborted when that happens. - */ - async dial(peerIdOrMultiaddr, options = {}) { - const { peerId, multiaddrs } = getPeerAddress(peerIdOrMultiaddr); - const addrs = multiaddrs.map(multiaddr => ({ - multiaddr, - isCertified: false - })); - // create abort conditions - need to do this before `calculateMultiaddrs` as we may be about to - // resolve a dns addr which can time out - const signal = this.createDialAbortControllers(options.signal); - let addrsToDial; - try { - // load addresses from address book, resolve and dnsaddrs, filter undiallables, add peer IDs, etc - addrsToDial = await this.calculateMultiaddrs(peerId, addrs, { - ...options, - signal - }); - } - catch (err) { - signal.clear(); - throw err; - } - // make sure we don't have an existing connection to any of the addresses we - // are about to dial - let existingConnection = Array.from(this.connections.values()).flat().find(conn => { - if (options.force === true) { - return false; - } - return addrsToDial.find(addr => { - return addr.multiaddr.equals(conn.remoteAddr); - }); - }); - if (existingConnection != null) { - this.log('already connected to %a', existingConnection.remoteAddr); - return existingConnection; - } - // ready to dial, all async work finished - make sure we don't have any - // pending dials in progress for this peer or set of multiaddrs - const existingDial = this.pendingDials.find(dial => { - // is the dial for the same peer id? - if (dial.peerId != null && peerId != null && dial.peerId.equals(peerId)) { - return true; - } - // is the dial for the same set of multiaddrs? - if (addrsToDial.map(({ multiaddr }) => multiaddr.toString()).join() === dial.multiaddrs.map(multiaddr => multiaddr.toString()).join()) { - return true; - } - return false; - }); - if (existingDial != null) { - this.log('joining existing dial target for %p', peerId); - signal.clear(); - return existingDial.promise; - } - this.log('creating dial target for', addrsToDial.map(({ multiaddr }) => multiaddr.toString())); - // @ts-expect-error .promise property is set below - const pendingDial = { - id: randomId(), - status: 'queued', - peerId, - multiaddrs: addrsToDial.map(({ multiaddr }) => multiaddr) - }; - pendingDial.promise = this.performDial(pendingDial, { - ...options, - signal - }) - .finally(() => { - // remove our pending dial entry - this.pendingDials = this.pendingDials.filter(p => p.id !== pendingDial.id); - // clean up abort signals/controllers - signal.clear(); - }) - .catch(async (err) => { - this.log.error('dial failed to %s', pendingDial.multiaddrs.map(ma => ma.toString()).join(', '), err); - if (peerId != null) { - // record the last failed dial - try { - await this.peerStore.patch(peerId, { - metadata: { - [LAST_DIAL_FAILURE_KEY]: uint8ArrayFromString(Date.now().toString()) - } - }); - } - catch (err) { - this.log.error('could not update last dial failure key for %p', peerId, err); - } - } - // Error is a timeout - if (signal.aborted) { - const error = new CodeError(err.message, ERR_TIMEOUT); - throw error; - } - throw err; - }); - // let other dials join this one - this.pendingDials.push(pendingDial); - const connection = await pendingDial.promise; - // we may have been dialing a multiaddr without a peer id attached but by - // this point we have upgraded the connection so the remote peer information - // should be available - check again that we don't already have a connection - // to the remote multiaddr - existingConnection = Array.from(this.connections.values()).flat().find(conn => { - if (options.force === true) { - return false; - } - return conn.id !== connection.id && conn.remoteAddr.equals(connection.remoteAddr); - }); - if (existingConnection != null) { - this.log('already connected to %a', existingConnection.remoteAddr); - await connection.close(); - return existingConnection; - } - this.log('connection opened to %a', connection.remoteAddr); - return connection; - } - createDialAbortControllers(userSignal) { - // let any signal abort the dial - const signal = anySignal([AbortSignal.timeout(this.dialTimeout), - this.shutDownController.signal, - userSignal - ]); - try { - // This emitter gets listened to a lot - setMaxListeners?.(Infinity, signal); - } - catch { } - return signal; - } - // eslint-disable-next-line complexity - async calculateMultiaddrs(peerId, addrs = [], options = {}) { - // if a peer id or multiaddr(s) with a peer id, make sure it isn't our peer id and that we are allowed to dial it - if (peerId != null) { - if (this.peerId.equals(peerId)) { - throw new CodeError('Tried to dial self', codes.ERR_DIALED_SELF); - } - if ((await this.connectionGater.denyDialPeer?.(peerId)) === true) { - throw new CodeError('The dial request is blocked by gater.allowDialPeer', codes.ERR_PEER_DIAL_INTERCEPTED); - } - // if just a peer id was passed, load available multiaddrs for this peer from the address book - if (addrs.length === 0) { - this.log('loading multiaddrs for %p', peerId); - try { - const peer = await this.peerStore.get(peerId); - addrs.push(...peer.addresses); - this.log('loaded multiaddrs for %p', peerId, addrs.map(({ multiaddr }) => multiaddr.toString())); - } - catch (err) { - if (err.code !== codes.ERR_NOT_FOUND) { - throw err; - } - } - } - } - // resolve addresses - this can result in a one-to-many translation when dnsaddrs are resolved - let resolvedAddresses = (await Promise.all(addrs.map(async (addr) => { - const result = await resolveMultiaddrs(addr.multiaddr, { - ...options, - log: this.log - }); - if (result.length === 1 && result[0].equals(addr.multiaddr)) { - return addr; - } - return result.map(multiaddr => ({ - multiaddr, - isCertified: false - })); - }))) - .flat(); - // ensure the peer id is appended to the multiaddr - if (peerId != null) { - const peerIdMultiaddr = `/p2p/${peerId.toString()}`; - resolvedAddresses = resolvedAddresses.map(addr => { - const lastProto = addr.multiaddr.protos().pop(); - // do not append peer id to path multiaddrs - if (lastProto?.path === true) { - return addr; - } - // append peer id to multiaddr if it is not already present - if (addr.multiaddr.getPeerId() == null) { - return { - multiaddr: addr.multiaddr.encapsulate(peerIdMultiaddr), - isCertified: addr.isCertified - }; - } - return addr; - }); - } - const filteredAddrs = resolvedAddresses.filter(addr => { - // filter out any multiaddrs that we do not have transports for - if (this.transportManager.transportForMultiaddr(addr.multiaddr) == null) { - return false; - } - // if the resolved multiaddr has a PeerID but it's the wrong one, ignore it - // - this can happen with addresses like bootstrap.libp2p.io that resolve - // to multiple different peers - const addrPeerId = addr.multiaddr.getPeerId(); - if (peerId != null && addrPeerId != null) { - return peerId.equals(addrPeerId); - } - return true; - }); - // deduplicate addresses - const dedupedAddrs = new Map(); - for (const addr of filteredAddrs) { - const maStr = addr.multiaddr.toString(); - const existing = dedupedAddrs.get(maStr); - if (existing != null) { - existing.isCertified = existing.isCertified || addr.isCertified || false; - continue; - } - dedupedAddrs.set(maStr, addr); - } - const dedupedMultiaddrs = [...dedupedAddrs.values()]; - if (dedupedMultiaddrs.length === 0 || dedupedMultiaddrs.length > this.maxPeerAddrsToDial) { - this.log('addresses for %p before filtering', peerId ?? 'unknown peer', resolvedAddresses.map(({ multiaddr }) => multiaddr.toString())); - this.log('addresses for %p after filtering', peerId ?? 'unknown peer', dedupedMultiaddrs.map(({ multiaddr }) => multiaddr.toString())); - } - // make sure we actually have some addresses to dial - if (dedupedMultiaddrs.length === 0) { - throw new CodeError('The dial request has no valid addresses', codes.ERR_NO_VALID_ADDRESSES); - } - // make sure we don't have too many addresses to dial - if (dedupedMultiaddrs.length > this.maxPeerAddrsToDial) { - throw new CodeError('dial with more addresses than allowed', codes.ERR_TOO_MANY_ADDRESSES); - } - const gatedAdrs = []; - for (const addr of dedupedMultiaddrs) { - if (this.connectionGater.denyDialMultiaddr != null && await this.connectionGater.denyDialMultiaddr(addr.multiaddr)) { - continue; - } - gatedAdrs.push(addr); - } - const sortedGatedAddrs = gatedAdrs.sort(this.addressSorter); - // make sure we actually have some addresses to dial - if (sortedGatedAddrs.length === 0) { - throw new CodeError('The connection gater denied all addresses in the dial request', codes.ERR_NO_VALID_ADDRESSES); - } - return sortedGatedAddrs; - } - async performDial(pendingDial, options = {}) { - const dialAbortControllers = pendingDial.multiaddrs.map(() => new AbortController()); - try { - // internal peer dial queue - only one dial per peer at a time - const peerDialQueue = new PQueue({ concurrency: 1 }); - peerDialQueue.on('error', (err) => { - this.log.error('error dialing %s %o', pendingDial.multiaddrs, err); - }); - const conn = await Promise.any(pendingDial.multiaddrs.map(async (addr, i) => { - const controller = dialAbortControllers[i]; - if (controller == null) { - throw new CodeError('dialAction did not come with an AbortController', codes.ERR_INVALID_PARAMETERS); - } - // let any signal abort the dial - const signal = combineSignals(controller.signal, options.signal); - signal.addEventListener('abort', () => { - this.log('dial to %a aborted', addr); - }); - const deferred = pDefer(); - await peerDialQueue.add(async () => { - if (signal.aborted) { - this.log('dial to %a was aborted before reaching the head of the peer dial queue', addr); - deferred.reject(new AbortError()); - return; - } - // add the individual dial to the dial queue so we don't breach maxConcurrentDials - await this.queue.add(async () => { - try { - if (signal.aborted) { - this.log('dial to %a was aborted before reaching the head of the dial queue', addr); - deferred.reject(new AbortError()); - return; - } - // update dial status - pendingDial.status = 'active'; - const conn = await this.transportManager.dial(addr, { - ...options, - signal - }); - if (controller.signal.aborted) { - // another dial succeeded faster than this one - this.log('multiple dials succeeded, closing superfluous connection'); - conn.close().catch(err => { - this.log.error('error closing superfluous connection', err); - }); - deferred.reject(new AbortError()); - return; - } - // remove the successful AbortController so it is not aborted - dialAbortControllers[i] = undefined; - // immediately abort any other dials - dialAbortControllers.forEach(c => { - if (c !== undefined) { - c.abort(); - } - }); - this.log('dial to %a succeeded', addr); - // resolve the connection promise - deferred.resolve(conn); - } - catch (err) { - // something only went wrong if our signal was not aborted - this.log.error('error during dial of %a', addr, err); - deferred.reject(err); - } - }, { - ...options, - signal - }).catch(err => { - deferred.reject(err); - }); - }, { - signal - }).catch(err => { - deferred.reject(err); - }).finally(() => { - signal.clear(); - }); - return deferred.promise; - })); - // dial succeeded or failed - if (conn == null) { - throw new CodeError('successful dial led to empty object returned from peer dial queue', codes.ERR_TRANSPORT_DIAL_FAILED); - } - pendingDial.status = 'success'; - return conn; - } - catch (err) { - pendingDial.status = 'error'; - // if we only dialled one address, unwrap the AggregateError to provide more - // useful feedback to the user - if (pendingDial.multiaddrs.length === 1 && err.name === 'AggregateError') { - throw err.errors[0]; - } - throw err; - } - } -} -/** - * Returns a random string - */ -function randomId() { - return `${(parseInt(String(Math.random() * 1e9), 10)).toString()}${Date.now()}`; -} -//# sourceMappingURL=dial-queue.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/dial-queue.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/dial-queue.js.map deleted file mode 100644 index c63182258..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/dial-queue.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":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AA;gBAEF,OAAO,QAAQ,CAAC,OAAO,CAAA;YACzB,CAAC,CAAC,CAAC,CAAA;YAEH,2BAA2B;YAC3B,IAAI,IAAI,IAAI,IAAI,EAAE;gBAChB,MAAM,IAAI,SAAS,CAAC,mEAAmE,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAA;aAC1H;YAED,WAAW,CAAC,MAAM,GAAG,SAAS,CAAA;YAE9B,OAAO,IAAI,CAAA;SACZ;QAAC,OAAO,GAAQ,EAAE;YACjB,WAAW,CAAC,MAAM,GAAG,OAAO,CAAA;YAE5B,4EAA4E;YAC5E,8BAA8B;YAC9B,IAAI,WAAW,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,gBAAgB,EAAE;gBACxE,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;aACpB;YAED,MAAM,GAAG,CAAA;SACV;IACH,CAAC;CACF;AAED;;GAEG;AACH,SAAS,QAAQ;IACf,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAA;AACjF,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/index.d.ts deleted file mode 100644 index 7a34e63e8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/index.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { PeerMap } from '@libp2p/peer-collections'; -import { type Multiaddr, type Resolver } from '@multiformats/multiaddr'; -import { AutoDial } from './auto-dial.js'; -import { ConnectionPruner } from './connection-pruner.js'; -import { DialQueue } from './dial-queue.js'; -import type { PendingDial, AddressSorter, Libp2pEvents, AbortOptions, ComponentLogger } from '@libp2p/interface'; -import type { Connection, MultiaddrConnection } from '@libp2p/interface/connection'; -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Startable } from '@libp2p/interface/startable'; -import type { ConnectionManager, OpenConnectionOptions } from '@libp2p/interface-internal/connection-manager'; -import type { TransportManager } from '@libp2p/interface-internal/transport-manager'; -export interface ConnectionManagerInit { - /** - * The maximum number of connections libp2p is willing to have before it starts - * pruning connections to reduce resource usage. (default: 300, 100 in browsers) - */ - maxConnections?: number; - /** - * The minimum number of connections below which libp2p will start to dial peers - * from the peer book. Setting this to 0 effectively disables this behaviour. - * (default: 50, 5 in browsers) - */ - minConnections?: number; - /** - * How long to wait between attempting to keep our number of concurrent connections - * above minConnections (default: 5000) - */ - autoDialInterval?: number; - /** - * When dialling peers from the peer book to keep the number of open connections - * above `minConnections`, add dials for this many peers to the dial queue - * at once. (default: 25) - */ - autoDialConcurrency?: number; - /** - * To allow user dials to take priority over auto dials, use this value as the - * dial priority. (default: 0) - */ - autoDialPriority?: number; - /** - * Limit the maximum number of peers to dial when trying to keep the number of - * open connections above `minConnections`. (default: 100) - */ - autoDialMaxQueueLength?: number; - /** - * When we've failed to dial a peer, do not autodial them again within this - * number of ms. (default: 1 minute, 7 minutes in browsers) - */ - autoDialPeerRetryThreshold?: number; - /** - * Newly discovered peers may be auto-dialed to increase the number of open - * connections, but they can be discovered in quick succession so add a small - * delay before attempting to dial them in case more peers have been - * discovered. (default: 10ms) - */ - autoDialDiscoveredPeersDebounce?: number; - /** - * Sort the known addresses of a peer before trying to dial, By default public - * addresses will be dialled before private (e.g. loopback or LAN) addresses. - */ - addressSorter?: AddressSorter; - /** - * The maximum number of dials across all peers to execute in parallel. - * (default: 100, 50 in browsers) - */ - maxParallelDials?: number; - /** - * Maximum number of addresses allowed for a given peer - if a peer has more - * addresses than this then the dial will fail. (default: 25) - */ - maxPeerAddrsToDial?: number; - /** - * How long a dial attempt is allowed to take, including DNS resolution - * of the multiaddr, opening a socket and upgrading it to a Connection. - */ - dialTimeout?: number; - /** - * When a new inbound connection is opened, the upgrade process (e.g. protect, - * encrypt, multiplex etc) must complete within this number of ms. (default: 30s) - */ - inboundUpgradeTimeout?: number; - /** - * Multiaddr resolvers to use when dialling - */ - resolvers?: Record; - /** - * A list of multiaddrs that will always be allowed (except if they are in the - * deny list) to open connections to this node even if we've reached maxConnections - */ - allow?: string[]; - /** - * A list of multiaddrs that will never be allowed to open connections to - * this node under any circumstances - */ - deny?: string[]; - /** - * If more than this many connections are opened per second by a single - * host, reject subsequent connections. (default: 5) - */ - inboundConnectionThreshold?: number; - /** - * The maximum number of parallel incoming connections allowed that have yet to - * complete the connection upgrade - e.g. choosing connection encryption, muxer, etc. - * (default: 10) - */ - maxIncomingPendingConnections?: number; -} -export interface DefaultConnectionManagerComponents { - peerId: PeerId; - metrics?: Metrics; - peerStore: PeerStore; - transportManager: TransportManager; - connectionGater: ConnectionGater; - events: TypedEventTarget; - logger: ComponentLogger; -} -/** - * Responsible for managing known connections. - */ -export declare class DefaultConnectionManager implements ConnectionManager, Startable { - private started; - private readonly connections; - private readonly allow; - private readonly deny; - private readonly maxIncomingPendingConnections; - private incomingPendingConnections; - private readonly maxConnections; - readonly dialQueue: DialQueue; - readonly autoDial: AutoDial; - readonly connectionPruner: ConnectionPruner; - private readonly inboundConnectionRateLimiter; - private readonly peerStore; - private readonly metrics?; - private readonly events; - private readonly log; - constructor(components: DefaultConnectionManagerComponents, init?: ConnectionManagerInit); - isStarted(): boolean; - /** - * Starts the Connection Manager. If Metrics are not enabled on libp2p - * only event loop and connection limits will be monitored. - */ - start(): Promise; - afterStart(): Promise; - /** - * Stops the Connection Manager - */ - stop(): Promise; - onConnect(evt: CustomEvent): void; - /** - * Tracks the incoming connection and check the connection limit - */ - _onConnect(evt: CustomEvent): Promise; - /** - * Removes the connection from tracking - */ - onDisconnect(evt: CustomEvent): void; - getConnections(peerId?: PeerId): Connection[]; - getConnectionsMap(): PeerMap; - openConnection(peerIdOrMultiaddr: PeerId | Multiaddr | Multiaddr[], options?: OpenConnectionOptions): Promise; - closeConnections(peerId: PeerId, options?: AbortOptions): Promise; - acceptIncomingConnection(maConn: MultiaddrConnection): Promise; - afterUpgradeInbound(): void; - getDialQueue(): PendingDial[]; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/index.d.ts.map deleted file mode 100644 index 91d3a3a2b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAElD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAa,MAAM,yBAAyB,CAAA;AAKlF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAU,MAAM,mBAAmB,CAAA;AACxH,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACnF,OAAO,KAAK,EAAE,eAAe,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E,IAAI,GAAE,qBAA0B;IAgF7F,SAAS,IAAK,OAAO;IAIrB;;;OAGG;IACG,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;IAqFvB,UAAU,IAAK,OAAO,CAAC,IAAI,CAAC;IA0BlC;;OAEG;IACG,IAAI,IAAK,OAAO,CAAC,IAAI,CAAC;IAyB5B,SAAS,CAAE,GAAG,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,IAAI;IAM9C;;OAEG;IACG,UAAU,CAAE,GAAG,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAgC9D;;OAEG;IACH,YAAY,CAAE,GAAG,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,IAAI;IAoBjD,cAAc,CAAE,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,EAAE;IAc9C,iBAAiB,IAAK,OAAO,CAAC,UAAU,EAAE,CAAC;IAIrC,cAAc,CAAE,iBAAiB,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,EAAE,EAAE,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC,UAAU,CAAC;IAkD9H,gBAAgB,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAc5E,wBAAwB,CAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAiD9E,mBAAmB,IAAK,IAAI;IAI5B,YAAY,IAAK,WAAW,EAAE;CAG/B"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/index.js deleted file mode 100644 index 2f0b460f0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/index.js +++ /dev/null @@ -1,396 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { KEEP_ALIVE } from '@libp2p/interface/peer-store/tags'; -import { PeerMap } from '@libp2p/peer-collections'; -import { defaultAddressSort } from '@libp2p/utils/address-sort'; -import { multiaddr } from '@multiformats/multiaddr'; -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers'; -import { RateLimiterMemory } from 'rate-limiter-flexible'; -import { codes } from '../errors.js'; -import { getPeerAddress } from '../get-peer.js'; -import { AutoDial } from './auto-dial.js'; -import { ConnectionPruner } from './connection-pruner.js'; -import { AUTO_DIAL_CONCURRENCY, AUTO_DIAL_MAX_QUEUE_LENGTH, AUTO_DIAL_PRIORITY, DIAL_TIMEOUT, INBOUND_CONNECTION_THRESHOLD, MAX_CONNECTIONS, MAX_INCOMING_PENDING_CONNECTIONS, MAX_PARALLEL_DIALS, MAX_PEER_ADDRS_TO_DIAL, MIN_CONNECTIONS } from './constants.js'; -import { DialQueue } from './dial-queue.js'; -const DEFAULT_DIAL_PRIORITY = 50; -const defaultOptions = { - minConnections: MIN_CONNECTIONS, - maxConnections: MAX_CONNECTIONS, - inboundConnectionThreshold: INBOUND_CONNECTION_THRESHOLD, - maxIncomingPendingConnections: MAX_INCOMING_PENDING_CONNECTIONS, - autoDialConcurrency: AUTO_DIAL_CONCURRENCY, - autoDialPriority: AUTO_DIAL_PRIORITY, - autoDialMaxQueueLength: AUTO_DIAL_MAX_QUEUE_LENGTH -}; -/** - * Responsible for managing known connections. - */ -export class DefaultConnectionManager { - started; - connections; - allow; - deny; - maxIncomingPendingConnections; - incomingPendingConnections; - maxConnections; - dialQueue; - autoDial; - connectionPruner; - inboundConnectionRateLimiter; - peerStore; - metrics; - events; - log; - constructor(components, init = {}) { - this.maxConnections = init.maxConnections ?? defaultOptions.maxConnections; - const minConnections = init.minConnections ?? defaultOptions.minConnections; - if (this.maxConnections < minConnections) { - throw new CodeError('Connection Manager maxConnections must be greater than minConnections', codes.ERR_INVALID_PARAMETERS); - } - /** - * Map of connections per peer - */ - this.connections = new PeerMap(); - this.started = false; - this.peerStore = components.peerStore; - this.metrics = components.metrics; - this.events = components.events; - this.log = components.logger.forComponent('libp2p:connection-manager'); - this.onConnect = this.onConnect.bind(this); - this.onDisconnect = this.onDisconnect.bind(this); - this.events.addEventListener('connection:open', this.onConnect); - this.events.addEventListener('connection:close', this.onDisconnect); - // allow/deny lists - this.allow = (init.allow ?? []).map(ma => multiaddr(ma)); - this.deny = (init.deny ?? []).map(ma => multiaddr(ma)); - this.incomingPendingConnections = 0; - this.maxIncomingPendingConnections = init.maxIncomingPendingConnections ?? defaultOptions.maxIncomingPendingConnections; - // controls individual peers trying to dial us too quickly - this.inboundConnectionRateLimiter = new RateLimiterMemory({ - points: init.inboundConnectionThreshold ?? defaultOptions.inboundConnectionThreshold, - duration: 1 - }); - // controls what happens when we don't have enough connections - this.autoDial = new AutoDial({ - connectionManager: this, - peerStore: components.peerStore, - events: components.events, - logger: components.logger - }, { - minConnections, - autoDialConcurrency: init.autoDialConcurrency ?? defaultOptions.autoDialConcurrency, - autoDialPriority: init.autoDialPriority ?? defaultOptions.autoDialPriority, - maxQueueLength: init.autoDialMaxQueueLength ?? defaultOptions.autoDialMaxQueueLength - }); - // controls what happens when we have too many connections - this.connectionPruner = new ConnectionPruner({ - connectionManager: this, - peerStore: components.peerStore, - events: components.events, - logger: components.logger - }, { - maxConnections: this.maxConnections, - allow: this.allow - }); - this.dialQueue = new DialQueue({ - peerId: components.peerId, - metrics: components.metrics, - peerStore: components.peerStore, - transportManager: components.transportManager, - connectionGater: components.connectionGater, - logger: components.logger - }, { - addressSorter: init.addressSorter ?? defaultAddressSort, - maxParallelDials: init.maxParallelDials ?? MAX_PARALLEL_DIALS, - maxPeerAddrsToDial: init.maxPeerAddrsToDial ?? MAX_PEER_ADDRS_TO_DIAL, - dialTimeout: init.dialTimeout ?? DIAL_TIMEOUT, - resolvers: init.resolvers ?? { - dnsaddr: dnsaddrResolver - }, - connections: this.connections - }); - } - isStarted() { - return this.started; - } - /** - * Starts the Connection Manager. If Metrics are not enabled on libp2p - * only event loop and connection limits will be monitored. - */ - async start() { - // track inbound/outbound connections - this.metrics?.registerMetricGroup('libp2p_connection_manager_connections', { - calculate: () => { - const metric = { - inbound: 0, - outbound: 0 - }; - for (const conns of this.connections.values()) { - for (const conn of conns) { - if (conn.direction === 'inbound') { - metric.inbound++; - } - else { - metric.outbound++; - } - } - } - return metric; - } - }); - // track total number of streams per protocol - this.metrics?.registerMetricGroup('libp2p_protocol_streams_total', { - label: 'protocol', - calculate: () => { - const metric = {}; - for (const conns of this.connections.values()) { - for (const conn of conns) { - for (const stream of conn.streams) { - const key = `${stream.direction} ${stream.protocol ?? 'unnegotiated'}`; - metric[key] = (metric[key] ?? 0) + 1; - } - } - } - return metric; - } - }); - // track 90th percentile of streams per protocol - this.metrics?.registerMetricGroup('libp2p_connection_manager_protocol_streams_per_connection_90th_percentile', { - label: 'protocol', - calculate: () => { - const allStreams = {}; - for (const conns of this.connections.values()) { - for (const conn of conns) { - const streams = {}; - for (const stream of conn.streams) { - const key = `${stream.direction} ${stream.protocol ?? 'unnegotiated'}`; - streams[key] = (streams[key] ?? 0) + 1; - } - for (const [protocol, count] of Object.entries(streams)) { - allStreams[protocol] = allStreams[protocol] ?? []; - allStreams[protocol].push(count); - } - } - } - const metric = {}; - for (let [protocol, counts] of Object.entries(allStreams)) { - counts = counts.sort((a, b) => a - b); - const index = Math.floor(counts.length * 0.9); - metric[protocol] = counts[index]; - } - return metric; - } - }); - this.autoDial.start(); - this.started = true; - this.log('started'); - } - async afterStart() { - // re-connect to any peers with the KEEP_ALIVE tag - void Promise.resolve() - .then(async () => { - const keepAlivePeers = await this.peerStore.all({ - filters: [(peer) => { - return peer.tags.has(KEEP_ALIVE); - }] - }); - await Promise.all(keepAlivePeers.map(async (peer) => { - await this.openConnection(peer.id) - .catch(err => { - this.log.error(err); - }); - })); - }) - .catch(err => { - this.log.error(err); - }); - this.autoDial.afterStart(); - } - /** - * Stops the Connection Manager - */ - async stop() { - this.dialQueue.stop(); - this.autoDial.stop(); - // Close all connections we're tracking - const tasks = []; - for (const connectionList of this.connections.values()) { - for (const connection of connectionList) { - tasks.push((async () => { - try { - await connection.close(); - } - catch (err) { - this.log.error(err); - } - })()); - } - } - this.log('closing %d connections', tasks.length); - await Promise.all(tasks); - this.connections.clear(); - this.log('stopped'); - } - onConnect(evt) { - void this._onConnect(evt).catch(err => { - this.log.error(err); - }); - } - /** - * Tracks the incoming connection and check the connection limit - */ - async _onConnect(evt) { - const { detail: connection } = evt; - if (!this.started) { - // This can happen when we are in the process of shutting down the node - await connection.close(); - return; - } - const peerId = connection.remotePeer; - const storedConns = this.connections.get(peerId); - let isNewPeer = false; - if (storedConns != null) { - storedConns.push(connection); - } - else { - isNewPeer = true; - this.connections.set(peerId, [connection]); - } - // only need to store RSA public keys, all other types are embedded in the peer id - if (peerId.publicKey != null && peerId.type === 'RSA') { - await this.peerStore.patch(peerId, { - publicKey: peerId.publicKey - }); - } - if (isNewPeer) { - this.events.safeDispatchEvent('peer:connect', { detail: connection.remotePeer }); - } - } - /** - * Removes the connection from tracking - */ - onDisconnect(evt) { - const { detail: connection } = evt; - if (!this.started) { - // This can happen when we are in the process of shutting down the node - return; - } - const peerId = connection.remotePeer; - let storedConn = this.connections.get(peerId); - if (storedConn != null && storedConn.length > 1) { - storedConn = storedConn.filter((conn) => conn.id !== connection.id); - this.connections.set(peerId, storedConn); - } - else if (storedConn != null) { - this.connections.delete(peerId); - this.events.safeDispatchEvent('peer:disconnect', { detail: connection.remotePeer }); - } - } - getConnections(peerId) { - if (peerId != null) { - return this.connections.get(peerId) ?? []; - } - let conns = []; - for (const c of this.connections.values()) { - conns = conns.concat(c); - } - return conns; - } - getConnectionsMap() { - return this.connections; - } - async openConnection(peerIdOrMultiaddr, options = {}) { - if (!this.isStarted()) { - throw new CodeError('Not started', codes.ERR_NODE_NOT_STARTED); - } - options.signal?.throwIfAborted(); - const { peerId } = getPeerAddress(peerIdOrMultiaddr); - if (peerId != null && options.force !== true) { - this.log('dial %p', peerId); - const existingConnection = this.getConnections(peerId) - .find(conn => !conn.transient); - if (existingConnection != null) { - this.log('had an existing non-transient connection to %p', peerId); - return existingConnection; - } - } - const connection = await this.dialQueue.dial(peerIdOrMultiaddr, { - ...options, - priority: options.priority ?? DEFAULT_DIAL_PRIORITY - }); - let peerConnections = this.connections.get(connection.remotePeer); - if (peerConnections == null) { - peerConnections = []; - this.connections.set(connection.remotePeer, peerConnections); - } - // we get notified of connections via the Upgrader emitting "connection" - // events, double check we aren't already tracking this connection before - // storing it - let trackedConnection = false; - for (const conn of peerConnections) { - if (conn.id === connection.id) { - trackedConnection = true; - } - } - if (!trackedConnection) { - peerConnections.push(connection); - } - return connection; - } - async closeConnections(peerId, options = {}) { - const connections = this.connections.get(peerId) ?? []; - await Promise.all(connections.map(async (connection) => { - try { - await connection.close(options); - } - catch (err) { - connection.abort(err); - } - })); - } - async acceptIncomingConnection(maConn) { - // check deny list - const denyConnection = this.deny.some(ma => { - return maConn.remoteAddr.toString().startsWith(ma.toString()); - }); - if (denyConnection) { - this.log('connection from %a refused - connection remote address was in deny list', maConn.remoteAddr); - return false; - } - // check allow list - const allowConnection = this.allow.some(ma => { - return maConn.remoteAddr.toString().startsWith(ma.toString()); - }); - if (allowConnection) { - this.incomingPendingConnections++; - return true; - } - // check pending connections - if (this.incomingPendingConnections === this.maxIncomingPendingConnections) { - this.log('connection from %a refused - incomingPendingConnections exceeded by host', maConn.remoteAddr); - return false; - } - if (maConn.remoteAddr.isThinWaistAddress()) { - const host = maConn.remoteAddr.nodeAddress().address; - try { - await this.inboundConnectionRateLimiter.consume(host, 1); - } - catch { - this.log('connection from %a refused - inboundConnectionThreshold exceeded by host %s', maConn.remoteAddr, host); - return false; - } - } - if (this.getConnections().length < this.maxConnections) { - this.incomingPendingConnections++; - return true; - } - this.log('connection from %a refused - maxConnections exceeded', maConn.remoteAddr); - return false; - } - afterUpgradeInbound() { - this.incomingPendingConnections--; - } - getDialQueue() { - return this.dialQueue.pendingDials; - } -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/index.js.map deleted file mode 100644 index ab7037446..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connection-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAiC,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,YAAY,EAAE,4BAA4B,EAAE,eAAe,EAAE,gCAAgC,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAClQ,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAY3C,MAAM,qBAAqB,GAAG,EAAE,CAAA;AAoHhC,M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AM,GAAG,IAAI,CAAC,cAAc,EAAE;YACtD,IAAI,CAAC,0BAA0B,EAAE,CAAA;YAEjC,OAAO,IAAI,CAAA;SACZ;QAED,IAAI,CAAC,GAAG,CAAC,sDAAsD,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;QACnF,OAAO,KAAK,CAAA;IACd,CAAC;IAED,mBAAmB;QACjB,IAAI,CAAC,0BAA0B,EAAE,CAAA;IACnC,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAA;IACpC,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/utils.d.ts deleted file mode 100644 index cab51c8e6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/utils.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { type AbortOptions, type Multiaddr } from '@multiformats/multiaddr'; -import { type ClearableSignal } from 'any-signal'; -import type { LoggerOptions } from '@libp2p/interface'; -/** - * Resolve multiaddr recursively - */ -export declare function resolveMultiaddrs(ma: Multiaddr, options: AbortOptions & LoggerOptions): Promise; -export declare function combineSignals(...signals: Array): ClearableSignal; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/utils.d.ts.map deleted file mode 100644 index 8b759343d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAa,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACtF,OAAO,EAAE,KAAK,eAAe,EAAa,MAAM,YAAY,CAAA;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEtD;;GAEG;AACH,wBAAsB,iBAAiB,CAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,GAAG,aAAa,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CA0BnH;AAgBD,wBAAgB,cAAc,CAAE,GAAG,OAAO,EAAE,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC,GAAG,eAAe,CAgB3F"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/utils.js deleted file mode 100644 index 308b550e9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/utils.js +++ /dev/null @@ -1,56 +0,0 @@ -import { setMaxListeners } from '@libp2p/interface/events'; -import { multiaddr } from '@multiformats/multiaddr'; -import { anySignal } from 'any-signal'; -/** - * Resolve multiaddr recursively - */ -export async function resolveMultiaddrs(ma, options) { - // TODO: recursive logic should live in multiaddr once dns4/dns6 support is in place - // Now only supporting resolve for dnsaddr - const resolvableProto = ma.protoNames().includes('dnsaddr'); - // Multiaddr is not resolvable? End recursion! - if (!resolvableProto) { - return [ma]; - } - const resolvedMultiaddrs = await resolveRecord(ma, options); - const recursiveMultiaddrs = await Promise.all(resolvedMultiaddrs.map(async (nm) => { - return resolveMultiaddrs(nm, options); - })); - const addrs = recursiveMultiaddrs.flat(); - const output = addrs.reduce((array, newM) => { - if (array.find(m => m.equals(newM)) == null) { - array.push(newM); - } - return array; - }, ([])); - options.log('resolved %s to', ma, output.map(ma => ma.toString())); - return output; -} -/** - * Resolve a given multiaddr. If this fails, an empty array will be returned - */ -async function resolveRecord(ma, options) { - try { - ma = multiaddr(ma.toString()); // Use current multiaddr module - const multiaddrs = await ma.resolve(options); - return multiaddrs; - } - catch (err) { - options.log.error(`multiaddr ${ma.toString()} could not be resolved`, err); - return []; - } -} -export function combineSignals(...signals) { - const sigs = []; - for (const sig of signals) { - if (sig != null) { - setMaxListeners(Infinity, sig); - sigs.push(sig); - } - } - // let any signal abort the dial - const signal = anySignal(sigs); - setMaxListeners(Infinity, signal); - return signal; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/utils.js.map deleted file mode 100644 index 9bc4b57e7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection-manager/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/connection-manager/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAqB,SAAS,EAAkB,MAAM,yBAAyB,CAAA;AACtF,OAAO,EAAwB,SAAS,EAAE,MAAM,YAAY,CAAA;AAG5D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAE,EAAa,EAAE,OAAqC;IAC3F,oFAAoF;IACpF,0CAA0C;IAC1C,MAAM,eAAe,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;IAE3D,8CAA8C;IAC9C,IAAI,CAAC,eAAe,EAAE;QACpB,OAAO,CAAC,EAAE,CAAC,CAAA;KACZ;IAED,MAAM,kBAAkB,GAAG,MAAM,aAAa,CAAC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,MAAM,UAAU,cAAc,CAAE,GAAG,OAAuC;IACxE,MAAM,IAAI,GAAkB,EAAE,CAAA;IAE9B,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;QACzB,IAAI,GAAG,IAAI,IAAI,EAAE;YACf,eAAe,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;YAC9B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;SACf;KACF;IAED,gCAAgC;IAChC,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;IAE9B,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IAEjC,OAAO,MAAM,CAAA;AACf,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection/index.d.ts deleted file mode 100644 index a246a011a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection/index.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { symbol } from '@libp2p/interface/connection'; -import type { AbortOptions, Logger, ComponentLogger } from '@libp2p/interface'; -import type { Direction, Connection, Stream, ConnectionTimeline, ConnectionStatus, NewStreamOptions } from '@libp2p/interface/connection'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { Multiaddr } from '@multiformats/multiaddr'; -interface ConnectionInit { - remoteAddr: Multiaddr; - remotePeer: PeerId; - newStream(protocols: string[], options?: AbortOptions): Promise; - close(options?: AbortOptions): Promise; - abort(err: Error): void; - getStreams(): Stream[]; - status: ConnectionStatus; - direction: Direction; - timeline: ConnectionTimeline; - multiplexer?: string; - encryption?: string; - transient?: boolean; - logger: ComponentLogger; -} -/** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ -export declare class ConnectionImpl implements Connection { - /** - * Connection identifier. - */ - readonly id: string; - /** - * Observed multiaddr of the remote peer - */ - readonly remoteAddr: Multiaddr; - /** - * Remote peer id - */ - readonly remotePeer: PeerId; - direction: Direction; - timeline: ConnectionTimeline; - multiplexer?: string; - encryption?: string; - status: ConnectionStatus; - transient: boolean; - readonly log: Logger; - /** - * User provided tags - * - */ - tags: string[]; - /** - * Reference to the new stream function of the multiplexer - */ - private readonly _newStream; - /** - * Reference to the close function of the raw connection - */ - private readonly _close; - private readonly _abort; - /** - * Reference to the getStreams function of the muxer - */ - private readonly _getStreams; - /** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ - constructor(init: ConnectionInit); - readonly [Symbol.toStringTag] = "Connection"; - readonly [symbol] = true; - /** - * Get all the streams of the muxer - */ - get streams(): Stream[]; - /** - * Create a new stream from this connection - */ - newStream(protocols: string | string[], options?: NewStreamOptions): Promise; - /** - * Close the connection - */ - close(options?: AbortOptions): Promise; - abort(err: Error): void; -} -export declare function createConnection(init: ConnectionInit): Connection; -export {}; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection/index.d.ts.map deleted file mode 100644 index 65815a36d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAGrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MA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AAO,CAAC,QAAQ,CAAC,UAAU,CAAsE;IAEjG;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;IAElE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAE7C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAgB;IAE5C;;;OAGG;gBACU,IAAI,EAAE,cAAc;IAyBjC,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAe;IAE5C,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAO;IAExB;;OAEG;IACH,IAAI,OAAO,IAAK,MAAM,EAAE,CAEvB;IAED;;OAEG;IACG,SAAS,CAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;IAwB3F;;OAEG;IACG,KAAK,CAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IA0CvD,KAAK,CAAE,GAAG,EAAE,KAAK,GAAG,IAAI;CAczB;AAED,wBAAgB,gBAAgB,CAAE,IAAI,EAAE,cAAc,GAAG,UAAU,CAElE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection/index.js deleted file mode 100644 index b9439ae39..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection/index.js +++ /dev/null @@ -1,147 +0,0 @@ -import { symbol } from '@libp2p/interface/connection'; -import { CodeError } from '@libp2p/interface/errors'; -import { setMaxListeners } from '@libp2p/interface/events'; -const CLOSE_TIMEOUT = 500; -/** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ -export class ConnectionImpl { - /** - * Connection identifier. - */ - id; - /** - * Observed multiaddr of the remote peer - */ - remoteAddr; - /** - * Remote peer id - */ - remotePeer; - direction; - timeline; - multiplexer; - encryption; - status; - transient; - log; - /** - * User provided tags - * - */ - tags; - /** - * Reference to the new stream function of the multiplexer - */ - _newStream; - /** - * Reference to the close function of the raw connection - */ - _close; - _abort; - /** - * Reference to the getStreams function of the muxer - */ - _getStreams; - /** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ - constructor(init) { - const { remoteAddr, remotePeer, newStream, close, abort, getStreams } = init; - this.id = `${(parseInt(String(Math.random() * 1e9))).toString(36)}${Date.now()}`; - this.remoteAddr = remoteAddr; - this.remotePeer = remotePeer; - this.direction = init.direction; - this.status = 'open'; - this.timeline = init.timeline; - this.multiplexer = init.multiplexer; - this.encryption = init.encryption; - this.transient = init.transient ?? false; - this.log = init.logger.forComponent(`libp2p:connection:${this.direction}:${this.id}`); - if (this.remoteAddr.getPeerId() == null) { - this.remoteAddr = this.remoteAddr.encapsulate(`/p2p/${this.remotePeer}`); - } - this._newStream = newStream; - this._close = close; - this._abort = abort; - this._getStreams = getStreams; - this.tags = []; - } - [Symbol.toStringTag] = 'Connection'; - [symbol] = true; - /** - * Get all the streams of the muxer - */ - get streams() { - return this._getStreams(); - } - /** - * Create a new stream from this connection - */ - async newStream(protocols, options) { - if (this.status === 'closing') { - throw new CodeError('the connection is being closed', 'ERR_CONNECTION_BEING_CLOSED'); - } - if (this.status === 'closed') { - throw new CodeError('the connection is closed', 'ERR_CONNECTION_CLOSED'); - } - if (!Array.isArray(protocols)) { - protocols = [protocols]; - } - if (this.transient && options?.runOnTransientConnection !== true) { - throw new CodeError('Cannot open protocol stream on transient connection', 'ERR_TRANSIENT_CONNECTION'); - } - const stream = await this._newStream(protocols, options); - stream.direction = 'outbound'; - return stream; - } - /** - * Close the connection - */ - async close(options = {}) { - if (this.status === 'closed' || this.status === 'closing') { - return; - } - this.log('closing connection to %a', this.remoteAddr); - this.status = 'closing'; - if (options.signal == null) { - const signal = AbortSignal.timeout(CLOSE_TIMEOUT); - setMaxListeners(Infinity, signal); - options = { - ...options, - signal - }; - } - try { - this.log.trace('closing all streams'); - // close all streams gracefully - this can throw if we're not multiplexed - await Promise.all(this.streams.map(async (s) => s.close(options))); - this.log.trace('closing underlying transport'); - // close raw connection - await this._close(options); - this.log.trace('updating timeline with close time'); - this.status = 'closed'; - this.timeline.close = Date.now(); - } - catch (err) { - this.log.error('error encountered during graceful close of connection to %a', this.remoteAddr, err); - this.abort(err); - } - } - abort(err) { - this.log.error('aborting connection to %a due to error', this.remoteAddr, err); - this.status = 'closing'; - this.streams.forEach(s => { s.abort(err); }); - this.log.error('all streams aborted', this.streams.length); - // Abort raw connection - this._abort(err); - this.timeline.close = Date.now(); - this.status = 'closed'; - } -} -export function createConnection(init) { - return new ConnectionImpl(init); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection/index.js.map deleted file mode 100644 index 7479dd06e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/connection/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAM1D,MAAM,aAAa,GAAG,GAAG,CAAA;AAkBzB;;;GAGG;AACH,MAAM,OAAO,cAAc;IACzB;;OAEG;IACa,EAAE,CAAQ;IAE1B;;OAEG;IACa,UAAU,CAAW;IAErC;;OAEG;IACa,UAAU,CAAQ;IAE3B,SAAS,CAAW;IACpB,QAAQ,CAAoB;IAC5B,WAAW,CAAS;IAC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;QACf,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,wCAAwC,EAAE,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;QAE9E,IAAI,CAAC,MAAM,GAAG,SAAS,CAAA;QACvB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA,CAAC,CAAC,CAAC,CAAA;QAE3C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAE1D,uBAAuB;QACvB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAEhB,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAChC,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAA;IACxB,CAAC;CACF;AAED,MAAM,UAAU,gBAAgB,CAAE,IAAoB;IACpD,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/index.d.ts deleted file mode 100644 index 7a11cb38b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { AbortOptions } from '@libp2p/interface'; -import type { ContentRouting } from '@libp2p/interface/content-routing'; -import type { PeerInfo } from '@libp2p/interface/peer-info'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Startable } from '@libp2p/interface/startable'; -import type { CID } from 'multiformats/cid'; -export interface CompoundContentRoutingInit { - routers: ContentRouting[]; -} -export interface CompoundContentRoutingComponents { - peerStore: PeerStore; -} -export declare class CompoundContentRouting implements ContentRouting, Startable { - private readonly routers; - private started; - private readonly components; - constructor(components: CompoundContentRoutingComponents, init: CompoundContentRoutingInit); - isStarted(): boolean; - start(): Promise; - stop(): Promise; - /** - * Iterates over all content routers in parallel to find providers of the given key - */ - findProviders(key: CID, options?: AbortOptions): AsyncIterable; - /** - * Iterates over all content routers in parallel to notify it is - * a provider of the given key - */ - provide(key: CID, options?: AbortOptions): Promise; - /** - * Store the given key/value pair in the available content routings - */ - put(key: Uint8Array, value: Uint8Array, options?: AbortOptions): Promise; - /** - * Get the value to the given key. - * Times out after 1 minute by default. - */ - get(key: Uint8Array, options?: AbortOptions): Promise; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/index.d.ts.map deleted file mode 100644 index aa53ef816..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/content-routing/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAE3C,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,cAAc,EAAE,CAAA;CAC1B;AAED,MAAM,WAAW,gCAAgC;IAC/C,SAAS,EAAE,SAAS,CAAA;CACrB;AAED,qBAAa,sBAAuB,YAAW,cAAc,EAAE,SAAS;IACtE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkC;gBAEhD,UAAU,EAAE,gCAAgC,EAAE,IAAI,EAAE,0BAA0B;IAM3F,SAAS,IAAK,OAAO;IAIf,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;IAIvB,IAAI,IAAK,OAAO,CAAC,IAAI,CAAC;IAI5B;;OAEG;IACK,aAAa,CAAE,GAAG,EAAE,GAAG,EAAE,OAAO,GAAE,YAAiB,GAAG,aAAa,CAAC,QAAQ,CAAC;IAerF;;;OAGG;IACG,OAAO,CAAE,GAAG,EAAE,GAAG,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQnE;;OAEG;IACG,GAAG,CAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAUrF;;;OAGG;IACG,GAAG,CAAE,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC;CASzE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/index.js deleted file mode 100644 index 3eb6047c6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/index.js +++ /dev/null @@ -1,67 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import merge from 'it-merge'; -import { pipe } from 'it-pipe'; -import { codes, messages } from '../errors.js'; -import { storeAddresses, uniquePeers, requirePeers } from './utils.js'; -export class CompoundContentRouting { - routers; - started; - components; - constructor(components, init) { - this.routers = init.routers ?? []; - this.started = false; - this.components = components; - } - isStarted() { - return this.started; - } - async start() { - this.started = true; - } - async stop() { - this.started = false; - } - /** - * Iterates over all content routers in parallel to find providers of the given key - */ - async *findProviders(key, options = {}) { - if (this.routers.length === 0) { - throw new CodeError('No content routers available', codes.ERR_NO_ROUTERS_AVAILABLE); - } - yield* pipe(merge(...this.routers.map(router => router.findProviders(key, options))), (source) => storeAddresses(source, this.components.peerStore), (source) => uniquePeers(source), (source) => requirePeers(source)); - } - /** - * Iterates over all content routers in parallel to notify it is - * a provider of the given key - */ - async provide(key, options = {}) { - if (this.routers.length === 0) { - throw new CodeError('No content routers available', codes.ERR_NO_ROUTERS_AVAILABLE); - } - await Promise.all(this.routers.map(async (router) => { await router.provide(key, options); })); - } - /** - * Store the given key/value pair in the available content routings - */ - async put(key, value, options) { - if (!this.isStarted()) { - throw new CodeError(messages.NOT_STARTED_YET, codes.DHT_NOT_STARTED); - } - await Promise.all(this.routers.map(async (router) => { - await router.put(key, value, options); - })); - } - /** - * Get the value to the given key. - * Times out after 1 minute by default. - */ - async get(key, options) { - if (!this.isStarted()) { - throw new CodeError(messages.NOT_STARTED_YET, codes.DHT_NOT_STARTED); - } - return Promise.any(this.routers.map(async (router) => { - return router.get(key, options); - })); - } -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/index.js.map deleted file mode 100644 index 4511ae947..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content-routing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,M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O,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACnD,OAAO,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QACjC,CAAC,CAAC,CAAC,CAAA;IACL,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/utils.d.ts deleted file mode 100644 index 8cb474c72..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/utils.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { PeerInfo } from '@libp2p/interface/peer-info'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Source } from 'it-stream-types'; -/** - * Store the multiaddrs from every peer in the passed peer store - */ -export declare function storeAddresses(source: Source, peerStore: PeerStore): AsyncIterable; -/** - * Filter peers by unique peer id - */ -export declare function uniquePeers(source: Source): AsyncIterable; -/** - * Require at least `min` peers to be yielded from `source` - */ -export declare function requirePeers(source: Source, min?: number): AsyncIterable; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/utils.d.ts.map deleted file mode 100644 index 02132d58d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/content-routing/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C;;GAEG;AACH,wBAAwB,cAAc,CAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,GAAG,aAAa,CAAC,QAAQ,CAAC,CAS/G;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC,CAc9E;AAED;;GAEG;AACH,wBAAwB,YAAY,CAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,GAAE,MAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,CAYxG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/utils.js deleted file mode 100644 index 5cd467241..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/utils.js +++ /dev/null @@ -1,44 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import filter from 'it-filter'; -import map from 'it-map'; -/** - * Store the multiaddrs from every peer in the passed peer store - */ -export async function* storeAddresses(source, peerStore) { - yield* map(source, async (peer) => { - // ensure we have the addresses for a given peer - await peerStore.merge(peer.id, { - multiaddrs: peer.multiaddrs - }); - return peer; - }); -} -/** - * Filter peers by unique peer id - */ -export function uniquePeers(source) { - /** @type Set */ - const seen = new Set(); - return filter(source, (peer) => { - // dedupe by peer id - if (seen.has(peer.id.toString())) { - return false; - } - seen.add(peer.id.toString()); - return true; - }); -} -/** - * Require at least `min` peers to be yielded from `source` - */ -export async function* requirePeers(source, min = 1) { - let seen = 0; - for await (const peer of source) { - seen++; - yield peer; - } - if (seen < min) { - throw new CodeError(`more peers required, seen: ${seen} min: ${min}`, 'NOT_FOUND'); - } -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/utils.js.map deleted file mode 100644 index d89a727c2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/content-routing/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/content-routing/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,GAAG,MAAM,QAAQ,CAAA;AAKxB;;GAEG;AACH,MAAM,CAAC,KAAK,SAAU,CAAC,CAAC,cAAc,CAAE,MAAwB,EAAE,SAAoB;IACpF,KAAM,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACjC,gDAAgD;QAChD,MAAM,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE;YAC7B,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAE,MAAwB;IACnD,wBAAwB;IACxB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAE,CAAA;IAEtB,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QAC7B,oBAAoB;QACpB,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE;YAChC,OAAO,KAAK,CAAA;SACb;QAED,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;QAE5B,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,SAAU,CAAC,CAAC,YAAY,CAAE,MAAwB,EAAE,MAAc,CAAC;IAC7E,IAAI,IAAI,GAAG,CAAC,CAAA;IAEZ,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,MAAM,EAAE;QAC/B,IAAI,EAAE,CAAA;QAEN,MAAM,IAAI,CAAA;KACX;IAED,IAAI,IAAI,GAAG,GAAG,EAAE;QACd,MAAM,IAAI,SAAS,CAAC,8BAA8B,IAAI,UAAU,GAAG,EAAE,EAAE,WAAW,CAAC,CAAA;KACpF;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/errors.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/errors.d.ts deleted file mode 100644 index 49b621f5e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/errors.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -export declare enum messages { - NOT_STARTED_YET = "The libp2p node is not started yet", - DHT_DISABLED = "DHT is not available", - PUBSUB_DISABLED = "PubSub is not available", - CONN_ENCRYPTION_REQUIRED = "At least one connection encryption module is required", - ERR_TRANSPORTS_REQUIRED = "At least one transport module is required", - ERR_PROTECTOR_REQUIRED = "Private network is enforced, but no protector was provided", - NOT_FOUND = "Not found" -} -export declare enum codes { - DHT_DISABLED = "ERR_DHT_DISABLED", - ERR_PUBSUB_DISABLED = "ERR_PUBSUB_DISABLED", - PUBSUB_NOT_STARTED = "ERR_PUBSUB_NOT_STARTED", - DHT_NOT_STARTED = "ERR_DHT_NOT_STARTED", - CONN_ENCRYPTION_REQUIRED = "ERR_CONN_ENCRYPTION_REQUIRED", - ERR_TRANSPORTS_REQUIRED = "ERR_TRANSPORTS_REQUIRED", - ERR_PROTECTOR_REQUIRED = "ERR_PROTECTOR_REQUIRED", - ERR_PEER_DIAL_INTERCEPTED = "ERR_PEER_DIAL_INTERCEPTED", - ERR_CONNECTION_INTERCEPTED = "ERR_CONNECTION_INTERCEPTED", - ERR_INVALID_PROTOCOLS_FOR_STREAM = "ERR_INVALID_PROTOCOLS_FOR_STREAM", - ERR_CONNECTION_ENDED = "ERR_CONNECTION_ENDED", - ERR_CONNECTION_FAILED = "ERR_CONNECTION_FAILED", - ERR_NODE_NOT_STARTED = "ERR_NODE_NOT_STARTED", - ERR_ALREADY_ABORTED = "ERR_ALREADY_ABORTED", - ERR_TOO_MANY_ADDRESSES = "ERR_TOO_MANY_ADDRESSES", - ERR_NO_VALID_ADDRESSES = "ERR_NO_VALID_ADDRESSES", - ERR_RELAYED_DIAL = "ERR_RELAYED_DIAL", - ERR_DIALED_SELF = "ERR_DIALED_SELF", - ERR_DISCOVERED_SELF = "ERR_DISCOVERED_SELF", - ERR_DUPLICATE_TRANSPORT = "ERR_DUPLICATE_TRANSPORT", - ERR_ENCRYPTION_FAILED = "ERR_ENCRYPTION_FAILED", - ERR_HOP_REQUEST_FAILED = "ERR_HOP_REQUEST_FAILED", - ERR_INVALID_KEY = "ERR_INVALID_KEY", - ERR_INVALID_MESSAGE = "ERR_INVALID_MESSAGE", - ERR_INVALID_PARAMETERS = "ERR_INVALID_PARAMETERS", - ERR_INVALID_PEER = "ERR_INVALID_PEER", - ERR_MUXER_UNAVAILABLE = "ERR_MUXER_UNAVAILABLE", - ERR_NOT_FOUND = "ERR_NOT_FOUND", - ERR_TRANSPORT_UNAVAILABLE = "ERR_TRANSPORT_UNAVAILABLE", - ERR_TRANSPORT_DIAL_FAILED = "ERR_TRANSPORT_DIAL_FAILED", - ERR_UNSUPPORTED_PROTOCOL = "ERR_UNSUPPORTED_PROTOCOL", - ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED = "ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED", - ERR_INVALID_MULTIADDR = "ERR_INVALID_MULTIADDR", - ERR_SIGNATURE_NOT_VALID = "ERR_SIGNATURE_NOT_VALID", - ERR_FIND_SELF = "ERR_FIND_SELF", - ERR_NO_ROUTERS_AVAILABLE = "ERR_NO_ROUTERS_AVAILABLE", - ERR_CONNECTION_NOT_MULTIPLEXED = "ERR_CONNECTION_NOT_MULTIPLEXED", - ERR_NO_DIAL_TOKENS = "ERR_NO_DIAL_TOKENS", - ERR_INVALID_CMS = "ERR_INVALID_CMS", - ERR_MISSING_KEYS = "ERR_MISSING_KEYS", - ERR_NO_KEY = "ERR_NO_KEY", - ERR_INVALID_KEY_NAME = "ERR_INVALID_KEY_NAME", - ERR_INVALID_KEY_TYPE = "ERR_INVALID_KEY_TYPE", - ERR_KEY_ALREADY_EXISTS = "ERR_KEY_ALREADY_EXISTS", - ERR_INVALID_KEY_SIZE = "ERR_INVALID_KEY_SIZE", - ERR_KEY_NOT_FOUND = "ERR_KEY_NOT_FOUND", - ERR_OLD_KEY_NAME_INVALID = "ERR_OLD_KEY_NAME_INVALID", - ERR_NEW_KEY_NAME_INVALID = "ERR_NEW_KEY_NAME_INVALID", - ERR_PASSWORD_REQUIRED = "ERR_PASSWORD_REQUIRED", - ERR_PEM_REQUIRED = "ERR_PEM_REQUIRED", - ERR_CANNOT_READ_KEY = "ERR_CANNOT_READ_KEY", - ERR_MISSING_PRIVATE_KEY = "ERR_MISSING_PRIVATE_KEY", - ERR_MISSING_PUBLIC_KEY = "ERR_MISSING_PUBLIC_KEY", - ERR_INVALID_OLD_PASS_TYPE = "ERR_INVALID_OLD_PASS_TYPE", - ERR_INVALID_NEW_PASS_TYPE = "ERR_INVALID_NEW_PASS_TYPE", - ERR_INVALID_PASS_LENGTH = "ERR_INVALID_PASS_LENGTH", - ERR_NOT_IMPLEMENTED = "ERR_NOT_IMPLEMENTED", - ERR_WRONG_PING_ACK = "ERR_WRONG_PING_ACK", - ERR_INVALID_RECORD = "ERR_INVALID_RECORD", - ERR_ALREADY_SUCCEEDED = "ERR_ALREADY_SUCCEEDED", - ERR_NO_HANDLER_FOR_PROTOCOL = "ERR_NO_HANDLER_FOR_PROTOCOL", - ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS = "ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS", - ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS = "ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS", - ERR_CONNECTION_DENIED = "ERR_CONNECTION_DENIED", - ERR_TRANSFER_LIMIT_EXCEEDED = "ERR_TRANSFER_LIMIT_EXCEEDED" -} -//# sourceMappingURL=errors.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/errors.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/errors.d.ts.map deleted file mode 100644 index 542684ed3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/errors.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,eAAe,uCAAuC;IACtD,YAAY,yBAAyB;IACrC,eAAe,4BAA4B;IAC3C,wBAAwB,0DAA0D;IAClF,uBAAuB,8CAA8C;IACrE,sBAAsB,+DAA+D;IACrF,SAAS,cAAc;CACxB;AAED,oBAAY,KAAK;IACf,YAAY,qBAAqB;IACjC,mBAAmB,wBAAwB;IAC3C,kBAAkB,2BAA2B;IAC7C,eAAe,wBAAwB;IACvC,wBAAwB,iCAAiC;IACzD,uBAAuB,4BAA4B;IACnD,sBAAsB,2BAA2B;IACjD,yBAAyB,8BAA8B;IACvD,0BAA0B,+BAA+B;IACzD,gCAAgC,qCAAqC;IACrE,oBAAoB,yBAAyB;IAC7C,qBAAqB,0B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} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/errors.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/errors.js deleted file mode 100644 index b8b7f6f32..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/errors.js +++ /dev/null @@ -1,79 +0,0 @@ -export var messages; -(function (messages) { - messages["NOT_STARTED_YET"] = "The libp2p node is not started yet"; - messages["DHT_DISABLED"] = "DHT is not available"; - messages["PUBSUB_DISABLED"] = "PubSub is not available"; - messages["CONN_ENCRYPTION_REQUIRED"] = "At least one connection encryption module is required"; - messages["ERR_TRANSPORTS_REQUIRED"] = "At least one transport module is required"; - messages["ERR_PROTECTOR_REQUIRED"] = "Private network is enforced, but no protector was provided"; - messages["NOT_FOUND"] = "Not found"; -})(messages || (messages = {})); -export var codes; -(function (codes) { - codes["DHT_DISABLED"] = "ERR_DHT_DISABLED"; - codes["ERR_PUBSUB_DISABLED"] = "ERR_PUBSUB_DISABLED"; - codes["PUBSUB_NOT_STARTED"] = "ERR_PUBSUB_NOT_STARTED"; - codes["DHT_NOT_STARTED"] = "ERR_DHT_NOT_STARTED"; - codes["CONN_ENCRYPTION_REQUIRED"] = "ERR_CONN_ENCRYPTION_REQUIRED"; - codes["ERR_TRANSPORTS_REQUIRED"] = "ERR_TRANSPORTS_REQUIRED"; - codes["ERR_PROTECTOR_REQUIRED"] = "ERR_PROTECTOR_REQUIRED"; - codes["ERR_PEER_DIAL_INTERCEPTED"] = "ERR_PEER_DIAL_INTERCEPTED"; - codes["ERR_CONNECTION_INTERCEPTED"] = "ERR_CONNECTION_INTERCEPTED"; - codes["ERR_INVALID_PROTOCOLS_FOR_STREAM"] = "ERR_INVALID_PROTOCOLS_FOR_STREAM"; - codes["ERR_CONNECTION_ENDED"] = "ERR_CONNECTION_ENDED"; - codes["ERR_CONNECTION_FAILED"] = "ERR_CONNECTION_FAILED"; - codes["ERR_NODE_NOT_STARTED"] = "ERR_NODE_NOT_STARTED"; - codes["ERR_ALREADY_ABORTED"] = "ERR_ALREADY_ABORTED"; - codes["ERR_TOO_MANY_ADDRESSES"] = "ERR_TOO_MANY_ADDRESSES"; - codes["ERR_NO_VALID_ADDRESSES"] = "ERR_NO_VALID_ADDRESSES"; - codes["ERR_RELAYED_DIAL"] = "ERR_RELAYED_DIAL"; - codes["ERR_DIALED_SELF"] = "ERR_DIALED_SELF"; - codes["ERR_DISCOVERED_SELF"] = "ERR_DISCOVERED_SELF"; - codes["ERR_DUPLICATE_TRANSPORT"] = "ERR_DUPLICATE_TRANSPORT"; - codes["ERR_ENCRYPTION_FAILED"] = "ERR_ENCRYPTION_FAILED"; - codes["ERR_HOP_REQUEST_FAILED"] = "ERR_HOP_REQUEST_FAILED"; - codes["ERR_INVALID_KEY"] = "ERR_INVALID_KEY"; - codes["ERR_INVALID_MESSAGE"] = "ERR_INVALID_MESSAGE"; - codes["ERR_INVALID_PARAMETERS"] = "ERR_INVALID_PARAMETERS"; - codes["ERR_INVALID_PEER"] = "ERR_INVALID_PEER"; - codes["ERR_MUXER_UNAVAILABLE"] = "ERR_MUXER_UNAVAILABLE"; - codes["ERR_NOT_FOUND"] = "ERR_NOT_FOUND"; - codes["ERR_TRANSPORT_UNAVAILABLE"] = "ERR_TRANSPORT_UNAVAILABLE"; - codes["ERR_TRANSPORT_DIAL_FAILED"] = "ERR_TRANSPORT_DIAL_FAILED"; - codes["ERR_UNSUPPORTED_PROTOCOL"] = "ERR_UNSUPPORTED_PROTOCOL"; - codes["ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED"] = "ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED"; - codes["ERR_INVALID_MULTIADDR"] = "ERR_INVALID_MULTIADDR"; - codes["ERR_SIGNATURE_NOT_VALID"] = "ERR_SIGNATURE_NOT_VALID"; - codes["ERR_FIND_SELF"] = "ERR_FIND_SELF"; - codes["ERR_NO_ROUTERS_AVAILABLE"] = "ERR_NO_ROUTERS_AVAILABLE"; - codes["ERR_CONNECTION_NOT_MULTIPLEXED"] = "ERR_CONNECTION_NOT_MULTIPLEXED"; - codes["ERR_NO_DIAL_TOKENS"] = "ERR_NO_DIAL_TOKENS"; - codes["ERR_INVALID_CMS"] = "ERR_INVALID_CMS"; - codes["ERR_MISSING_KEYS"] = "ERR_MISSING_KEYS"; - codes["ERR_NO_KEY"] = "ERR_NO_KEY"; - codes["ERR_INVALID_KEY_NAME"] = "ERR_INVALID_KEY_NAME"; - codes["ERR_INVALID_KEY_TYPE"] = "ERR_INVALID_KEY_TYPE"; - codes["ERR_KEY_ALREADY_EXISTS"] = "ERR_KEY_ALREADY_EXISTS"; - codes["ERR_INVALID_KEY_SIZE"] = "ERR_INVALID_KEY_SIZE"; - codes["ERR_KEY_NOT_FOUND"] = "ERR_KEY_NOT_FOUND"; - codes["ERR_OLD_KEY_NAME_INVALID"] = "ERR_OLD_KEY_NAME_INVALID"; - codes["ERR_NEW_KEY_NAME_INVALID"] = "ERR_NEW_KEY_NAME_INVALID"; - codes["ERR_PASSWORD_REQUIRED"] = "ERR_PASSWORD_REQUIRED"; - codes["ERR_PEM_REQUIRED"] = "ERR_PEM_REQUIRED"; - codes["ERR_CANNOT_READ_KEY"] = "ERR_CANNOT_READ_KEY"; - codes["ERR_MISSING_PRIVATE_KEY"] = "ERR_MISSING_PRIVATE_KEY"; - codes["ERR_MISSING_PUBLIC_KEY"] = "ERR_MISSING_PUBLIC_KEY"; - codes["ERR_INVALID_OLD_PASS_TYPE"] = "ERR_INVALID_OLD_PASS_TYPE"; - codes["ERR_INVALID_NEW_PASS_TYPE"] = "ERR_INVALID_NEW_PASS_TYPE"; - codes["ERR_INVALID_PASS_LENGTH"] = "ERR_INVALID_PASS_LENGTH"; - codes["ERR_NOT_IMPLEMENTED"] = "ERR_NOT_IMPLEMENTED"; - codes["ERR_WRONG_PING_ACK"] = "ERR_WRONG_PING_ACK"; - codes["ERR_INVALID_RECORD"] = "ERR_INVALID_RECORD"; - codes["ERR_ALREADY_SUCCEEDED"] = "ERR_ALREADY_SUCCEEDED"; - codes["ERR_NO_HANDLER_FOR_PROTOCOL"] = "ERR_NO_HANDLER_FOR_PROTOCOL"; - codes["ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS"] = "ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS"; - codes["ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS"] = "ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS"; - codes["ERR_CONNECTION_DENIED"] = "ERR_CONNECTION_DENIED"; - codes["ERR_TRANSFER_LIMIT_EXCEEDED"] = "ERR_TRANSFER_LIMIT_EXCEEDED"; -})(codes || (codes = {})); -//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/errors.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/errors.js.map deleted file mode 100644 index 6d105551e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAQX;AARD,WAAY,QAAQ;IAClB,kEAAsD,CAAA;IACtD,iDAAqC,CAAA;IACrC,uDAA2C,CAAA;IAC3C,8FAAkF,CAAA;IAClF,iFAAqE,CAAA;IACrE,iGAAqF,CAAA;IACrF,mCAAuB,CAAA;AACzB,CAAC,EARW,QAAQ,KAAR,QAAQ,QAQnB;AAED,MAAM,CAAN,IAAY,KAkEX;AAlED,WAAY,KAAK;IACf,0CAAiC,CAAA;IACjC,oDAA2C,CAAA;IAC3C,sDAA6C,CAAA;IAC7C,gDAAuC,CAAA;IACvC,kEAAyD,CAAA;IACzD,4DAAmD,CA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AA;AAC7D,CAAC,EAlEW,KAAK,KAAL,KAAK,QAkEhB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/get-peer.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/get-peer.d.ts deleted file mode 100644 index 57a58c30b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/get-peer.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { Multiaddr } from '@multiformats/multiaddr'; -export interface PeerAddress { - peerId?: PeerId; - multiaddrs: Multiaddr[]; -} -/** - * Extracts a PeerId and/or multiaddr from the passed PeerId or Multiaddr or an array of Multiaddrs - */ -export declare function getPeerAddress(peer: PeerId | Multiaddr | Multiaddr[]): PeerAddress; -//# sourceMappingURL=get-peer.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/get-peer.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/get-peer.d.ts.map deleted file mode 100644 index 341aabd82..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/get-peer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-peer.d.ts","sourceRoot":"","sources":["../../src/get-peer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,SAAS,EAAE,CAAA;CACxB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,EAAE,GAAG,WAAW,CAyCnF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/get-peer.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/get-peer.js deleted file mode 100644 index 1852d9607..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/get-peer.js +++ /dev/null @@ -1,44 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { isPeerId } from '@libp2p/interface/peer-id'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { isMultiaddr } from '@multiformats/multiaddr'; -import { codes } from './errors.js'; -/** - * Extracts a PeerId and/or multiaddr from the passed PeerId or Multiaddr or an array of Multiaddrs - */ -export function getPeerAddress(peer) { - if (isPeerId(peer)) { - return { peerId: peer, multiaddrs: [] }; - } - if (!Array.isArray(peer)) { - peer = [peer]; - } - let peerId; - if (peer.length > 0) { - const peerIdStr = peer[0].getPeerId(); - peerId = peerIdStr == null ? undefined : peerIdFromString(peerIdStr); - // ensure PeerId is either not set or is consistent - peer.forEach(ma => { - if (!isMultiaddr(ma)) { - throw new CodeError('Invalid Multiaddr', codes.ERR_INVALID_MULTIADDR); - } - const maPeerIdStr = ma.getPeerId(); - if (maPeerIdStr == null) { - if (peerId != null) { - throw new CodeError('Multiaddrs must all have the same peer id or have no peer id', codes.ERR_INVALID_PARAMETERS); - } - } - else { - const maPeerId = peerIdFromString(maPeerIdStr); - if (peerId == null || !peerId.equals(maPeerId)) { - throw new CodeError('Multiaddrs must all have the same peer id or have no peer id', codes.ERR_INVALID_PARAMETERS); - } - } - }); - } - return { - peerId, - multiaddrs: peer - }; -} -//# sourceMappingURL=get-peer.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/get-peer.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/get-peer.js.map deleted file mode 100644 index d77085be5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/get-peer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-peer.js","sourceRoot":"","sources":["../../src/get-peer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AASnC;;GAEG;AACH,MAAM,UAAU,cAAc,CAAE,IAAsC;IACpE,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;QAClB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,CAAA;KACxC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACxB,IAAI,GAAG,CAAC,IAAI,CAAC,CAAA;KACd;IAED,IAAI,MAA0B,CAAA;IAE9B,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;QACnB,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAA;QACrC,MAAM,GAAG,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAA;QAEpE,mDAAmD;QACnD,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;YAChB,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;gBACpB,MAAM,IAAI,SAAS,CAAC,mBAAmB,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAA;aACtE;YAED,MAAM,WAAW,GAAG,EAAE,CAAC,SAAS,EAAE,CAAA;YAElC,IAAI,WAAW,IAAI,IAAI,EAAE;gBACvB,IAAI,MAAM,IAAI,IAAI,EAAE;oBAClB,MAAM,IAAI,SAAS,CAAC,8DAA8D,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAA;iBAClH;aACF;iBAAM;gBACL,MAAM,QAAQ,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAA;gBAE9C,IAAI,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;oBAC9C,MAAM,IAAI,SAAS,CAAC,8DAA8D,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAA;iBAClH;aACF;QACH,CAAC,CAAC,CAAA;KACH;IAED,OAAO;QACL,MAAM;QACN,UAAU,EAAE,IAAI;KACjB,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/index.d.ts deleted file mode 100644 index d542548df..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/index.d.ts +++ /dev/null @@ -1,151 +0,0 @@ -/** - * @packageDocumentation - * - * Use the `createLibp2p` function to create a libp2p node. - * - * @example - * - * ```typescript - * import { createLibp2p } from 'libp2p' - * - * const node = await createLibp2p({ - * // ...other options - * }) - * ``` - */ -import type { AddressManagerInit } from './address-manager/index.js'; -import type { Components } from './components.js'; -import type { ConnectionManagerInit } from './connection-manager/index.js'; -import type { TransportManagerInit } from './transport-manager.js'; -import type { Libp2p, ServiceMap, RecursivePartial, ComponentLogger, NodeInfo } from '@libp2p/interface'; -import type { ConnectionProtector } from '@libp2p/interface/connection'; -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter'; -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -import type { ContentRouting } from '@libp2p/interface/content-routing'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerDiscovery } from '@libp2p/interface/peer-discovery'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerRouting } from '@libp2p/interface/peer-routing'; -import type { StreamMuxerFactory } from '@libp2p/interface/stream-muxer'; -import type { Transport } from '@libp2p/interface/transport'; -import type { PersistentPeerStoreInit } from '@libp2p/peer-store'; -import type { Datastore } from 'interface-datastore'; -export type ServiceFactoryMap = Record> = { - [Property in keyof T]: (components: Components) => T[Property]; -}; -/** - * For Libp2p configurations and modules details read the [Configuration Document](./CONFIGURATION.md). - */ -export interface Libp2pInit; -}> { - /** - * peerId instance (it will be created if not provided) - */ - peerId: PeerId; - /** - * Metadata about the node - implementation name, version number, etc - */ - nodeInfo: NodeInfo; - /** - * Addresses for transport listening and to advertise to the network - */ - addresses: AddressManagerInit; - /** - * libp2p Connection Manager configuration - */ - connectionManager: ConnectionManagerInit; - /** - * A connection gater can deny new connections based on user criteria - */ - connectionGater: ConnectionGater; - /** - * libp2p transport manager configuration - */ - transportManager: TransportManagerInit; - /** - * An optional datastore to persist peer information, DHT records, etc. - * - * An in-memory datastore will be used if one is not provided. - */ - datastore: Datastore; - /** - * libp2p PeerStore configuration - */ - peerStore: PersistentPeerStoreInit; - /** - * An array that must include at least 1 compliant transport - */ - transports: Array<(components: Components) => Transport>; - streamMuxers?: Array<(components: Components) => StreamMuxerFactory>; - connectionEncryption?: Array<(components: Components) => ConnectionEncrypter>; - peerDiscovery?: Array<(components: Components) => PeerDiscovery>; - peerRouters?: Array<(components: Components) => PeerRouting>; - contentRouters?: Array<(components: Components) => ContentRouting>; - /** - * A Metrics implementation can be supplied to collect metrics on this node - */ - metrics?(components: Components): Metrics; - /** - * A ConnectionProtector can be used to create a secure overlay on top of the network using pre-shared keys - */ - connectionProtector?(components: Components): ConnectionProtector; - /** - * Arbitrary libp2p modules - */ - services: ServiceFactoryMap; - /** - * An optional logging implementation that can be used to write runtime logs. - * - * Set the `DEBUG` env var or the `debug` key on LocalStorage to see logs. - * - * @example - * - * Node.js: - * - * ```console - * $ DEBUG="*libp2p:*" node myscript.js - * ``` - * - * Browsers: - * - * ```javascript - * localStorage.setItem('debug', '*libp2p:*') - * ``` - */ - logger?: ComponentLogger; -} -export type { Libp2p }; -export type Libp2pOptions> = RecursivePartial> & { - start?: boolean; -}; -/** - * Returns a new instance of the Libp2p interface, generating a new PeerId - * if one is not passed as part of the options. - * - * The node will be started unless `start: false` is passed as an option. - * - * @example - * - * ```js - * import { createLibp2p } from 'libp2p' - * import { tcp } from '@libp2p/tcp' - * import { mplex } from '@libp2p/mplex' - * import { noise } from '@chainsafe/libp2p-noise' - * import { yamux } from '@chainsafe/libp2p-yamux' - * - * // specify options - * const options = { - * transports: [tcp()], - * streamMuxers: [yamux(), mplex()], - * connectionEncryption: [noise()] - * } - * - * // create libp2p - * const libp2p = await createLibp2p(options) - * ``` - */ -export declare function createLibp2p; -}>(options: Libp2pOptions): Promise>; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/index.d.ts.map deleted file mode 100644 index fabc757a4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA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AC,IAAI,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAEjI;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,YAAY,CAAE,CAAC,SAAS,UAAU,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,EAAG,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAQzI"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/index.js deleted file mode 100644 index afbc58dae..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/index.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @packageDocumentation - * - * Use the `createLibp2p` function to create a libp2p node. - * - * @example - * - * ```typescript - * import { createLibp2p } from 'libp2p' - * - * const node = await createLibp2p({ - * // ...other options - * }) - * ``` - */ -import { createLibp2pNode } from './libp2p.js'; -/** - * Returns a new instance of the Libp2p interface, generating a new PeerId - * if one is not passed as part of the options. - * - * The node will be started unless `start: false` is passed as an option. - * - * @example - * - * ```js - * import { createLibp2p } from 'libp2p' - * import { tcp } from '@libp2p/tcp' - * import { mplex } from '@libp2p/mplex' - * import { noise } from '@chainsafe/libp2p-noise' - * import { yamux } from '@chainsafe/libp2p-yamux' - * - * // specify options - * const options = { - * transports: [tcp()], - * streamMuxers: [yamux(), mplex()], - * connectionEncryption: [noise()] - * } - * - * // create libp2p - * const libp2p = await createLibp2p(options) - * ``` - */ -export async function createLibp2p(options) { - const node = await createLibp2pNode(options); - if (options.start !== false) { - await node.start(); - } - return node; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/index.js.map deleted file mode 100644 index 8ee9c1281..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAwH9C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAA0D,OAAyB;IACnH,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAE5C,IAAI,OAAO,CAAC,KAAK,KAAK,KAAK,EAAE;QAC3B,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;KACnB;IAED,OAAO,IAAI,CAAA;AACb,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/libp2p.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/libp2p.d.ts deleted file mode 100644 index cb492deed..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/libp2p.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { type ContentRouting } from '@libp2p/interface/content-routing'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { type PeerRouting } from '@libp2p/interface/peer-routing'; -import { type Multiaddr } from '@multiformats/multiaddr'; -import type { Components } from './components.js'; -import type { Libp2p, Libp2pInit, Libp2pOptions } from './index.js'; -import type { Libp2pEvents, PendingDial, ServiceMap, AbortOptions, ComponentLogger } from '@libp2p/interface'; -import type { Connection, NewStreamOptions, Stream } from '@libp2p/interface/connection'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Topology } from '@libp2p/interface/topology'; -import type { StreamHandler, StreamHandlerOptions } from '@libp2p/interface-internal/registrar'; -export declare class Libp2pNode> extends TypedEventEmitter implements Libp2p { - #private; - peerId: PeerId; - peerStore: PeerStore; - contentRouting: ContentRouting; - peerRouting: PeerRouting; - metrics?: Metrics; - services: T; - logger: ComponentLogger; - components: Components; - private readonly log; - constructor(init: Libp2pInit); - private configureComponent; - /** - * Starts the libp2p node and all its subsystems - */ - start(): Promise; - /** - * Stop the libp2p node by closing its listeners and open connections - */ - stop(): Promise; - isStarted(): boolean; - getConnections(peerId?: PeerId): Connection[]; - getDialQueue(): PendingDial[]; - getPeers(): PeerId[]; - dial(peer: PeerId | Multiaddr | Multiaddr[], options?: AbortOptions): Promise; - dialProtocol(peer: PeerId | Multiaddr | Multiaddr[], protocols: string | string[], options?: NewStreamOptions): Promise; - getMultiaddrs(): Multiaddr[]; - getProtocols(): string[]; - hangUp(peer: PeerId | Multiaddr, options?: AbortOptions): Promise; - /** - * Get the public key for the given peer id - */ - getPublicKey(peer: PeerId, options?: AbortOptions): Promise; - handle(protocols: string | string[], handler: StreamHandler, options?: StreamHandlerOptions): Promise; - unhandle(protocols: string[] | string): Promise; - register(protocol: string, topology: Topology): Promise; - unregister(id: string): void; -} -/** - * Returns a new Libp2pNode instance - this exposes more of the internals than the - * libp2p interface and is useful for testing and debugging. - */ -export declare function createLibp2pNode>(options: Libp2pOptions): Promise>; -//# sourceMappingURL=libp2p.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/libp2p.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/libp2p.d.ts.map deleted file mode 100644 index c2c806b62..000000000 --- a/perf/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AAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAY5G,QAAQ,CAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYtD,QAAQ,CAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAItE,UAAU,CAAE,EAAE,EAAE,MAAM,GAAG,IAAI;CAqB9B;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAE,CAAC,SAAS,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAG,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAI1I"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/libp2p.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/libp2p.js deleted file mode 100644 index 7f1e9bcf8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/libp2p.js +++ /dev/null @@ -1,310 +0,0 @@ -import { unmarshalPublicKey } from '@libp2p/crypto/keys'; -import { contentRouting } from '@libp2p/interface/content-routing'; -import { CodeError } from '@libp2p/interface/errors'; -import { TypedEventEmitter, CustomEvent, setMaxListeners } from '@libp2p/interface/events'; -import { peerDiscovery } from '@libp2p/interface/peer-discovery'; -import { peerRouting } from '@libp2p/interface/peer-routing'; -import { defaultLogger } from '@libp2p/logger'; -import { PeerSet } from '@libp2p/peer-collections'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { isMultiaddr } from '@multiformats/multiaddr'; -import { MemoryDatastore } from 'datastore-core/memory'; -import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { DefaultAddressManager } from './address-manager/index.js'; -import { defaultComponents } from './components.js'; -import { connectionGater } from './config/connection-gater.js'; -import { validateConfig } from './config.js'; -import { DefaultConnectionManager } from './connection-manager/index.js'; -import { CompoundContentRouting } from './content-routing/index.js'; -import { codes } from './errors.js'; -import { DefaultPeerRouting } from './peer-routing.js'; -import { DefaultRegistrar } from './registrar.js'; -import { DefaultTransportManager } from './transport-manager.js'; -import { DefaultUpgrader } from './upgrader.js'; -import * as pkg from './version.js'; -export class Libp2pNode extends TypedEventEmitter { - peerId; - peerStore; - contentRouting; - peerRouting; - metrics; - services; - logger; - components; - #started; - log; - constructor(init) { - super(); - // event bus - components can listen to this emitter to be notified of system events - // and also cause them to be emitted - const events = new TypedEventEmitter(); - const originalDispatch = events.dispatchEvent.bind(events); - events.dispatchEvent = (evt) => { - const internalResult = originalDispatch(evt); - const externalResult = this.dispatchEvent(new CustomEvent(evt.type, { detail: evt.detail })); - return internalResult || externalResult; - }; - // This emitter gets listened to a lot - setMaxListeners(Infinity, events); - this.#started = false; - this.peerId = init.peerId; - this.logger = init.logger ?? defaultLogger(); - this.log = this.logger.forComponent('libp2p'); - // @ts-expect-error {} may not be of type T - this.services = {}; - const components = this.components = defaultComponents({ - peerId: init.peerId, - nodeInfo: init.nodeInfo ?? { - name: pkg.name, - version: pkg.version - }, - logger: this.logger, - events, - datastore: init.datastore ?? new MemoryDatastore(), - connectionGater: connectionGater(init.connectionGater) - }); - this.peerStore = this.configureComponent('peerStore', new PersistentPeerStore(components, { - addressFilter: this.components.connectionGater.filterMultiaddrForPeer, - ...init.peerStore - })); - // Create Metrics - if (init.metrics != null) { - this.metrics = this.configureComponent('metrics', init.metrics(this.components)); - } - components.events.addEventListener('peer:update', evt => { - // if there was no peer previously in the peer store this is a new peer - if (evt.detail.previous == null) { - const peerInfo = { - id: evt.detail.peer.id, - multiaddrs: evt.detail.peer.addresses.map(a => a.multiaddr) - }; - components.events.safeDispatchEvent('peer:discovery', { detail: peerInfo }); - } - }); - // Set up connection protector if configured - if (init.connectionProtector != null) { - this.configureComponent('connectionProtector', init.connectionProtector(components)); - } - // Set up the Upgrader - this.components.upgrader = new DefaultUpgrader(this.components, { - connectionEncryption: (init.connectionEncryption ?? []).map((fn, index) => this.configureComponent(`connection-encryption-${index}`, fn(this.components))), - muxers: (init.streamMuxers ?? []).map((fn, index) => this.configureComponent(`stream-muxers-${index}`, fn(this.components))), - inboundUpgradeTimeout: init.connectionManager.inboundUpgradeTimeout - }); - // Setup the transport manager - this.configureComponent('transportManager', new DefaultTransportManager(this.components, init.transportManager)); - // Create the Connection Manager - this.configureComponent('connectionManager', new DefaultConnectionManager(this.components, init.connectionManager)); - // Create the Registrar - this.configureComponent('registrar', new DefaultRegistrar(this.components)); - // Addresses {listen, announce, noAnnounce} - this.configureComponent('addressManager', new DefaultAddressManager(this.components, init.addresses)); - // Peer routers - const peerRouters = (init.peerRouters ?? []).map((fn, index) => this.configureComponent(`peer-router-${index}`, fn(this.components))); - this.peerRouting = this.components.peerRouting = this.configureComponent('peerRouting', new DefaultPeerRouting(this.components, { - routers: peerRouters - })); - // Content routers - const contentRouters = (init.contentRouters ?? []).map((fn, index) => this.configureComponent(`content-router-${index}`, fn(this.components))); - this.contentRouting = this.components.contentRouting = this.configureComponent('contentRouting', new CompoundContentRouting(this.components, { - routers: contentRouters - })); - (init.peerDiscovery ?? []).forEach((fn, index) => { - const service = this.configureComponent(`peer-discovery-${index}`, fn(this.components)); - service.addEventListener('peer', (evt) => { - this.#onDiscoveryPeer(evt); - }); - }); - // Transport modules - init.transports.forEach((fn, index) => { - this.components.transportManager.add(this.configureComponent(`transport-${index}`, fn(this.components))); - }); - // User defined modules - if (init.services != null) { - for (const name of Object.keys(init.services)) { - const createService = init.services[name]; - const service = createService(this.components); - if (service == null) { - this.log.error('service factory %s returned null or undefined instance', name); - continue; - } - this.services[name] = service; - this.configureComponent(name, service); - if (service[contentRouting] != null) { - this.log('registering service %s for content routing', name); - contentRouters.push(service[contentRouting]); - } - if (service[peerRouting] != null) { - this.log('registering service %s for peer routing', name); - peerRouters.push(service[peerRouting]); - } - if (service[peerDiscovery] != null) { - this.log('registering service %s for peer discovery', name); - service[peerDiscovery].addEventListener('peer', (evt) => { - this.#onDiscoveryPeer(evt); - }); - } - } - } - } - configureComponent(name, component) { - if (component == null) { - this.log.error('component %s was null or undefined', name); - } - this.components[name] = component; - return component; - } - /** - * Starts the libp2p node and all its subsystems - */ - async start() { - if (this.#started) { - return; - } - this.#started = true; - this.log('libp2p is starting'); - try { - await this.components.beforeStart?.(); - await this.components.start(); - await this.components.afterStart?.(); - this.safeDispatchEvent('start', { detail: this }); - this.log('libp2p has started'); - } - catch (err) { - this.log.error('An error occurred starting libp2p', err); - await this.stop(); - throw err; - } - } - /** - * Stop the libp2p node by closing its listeners and open connections - */ - async stop() { - if (!this.#started) { - return; - } - this.log('libp2p is stopping'); - this.#started = false; - await this.components.beforeStop?.(); - await this.components.stop(); - await this.components.afterStop?.(); - this.safeDispatchEvent('stop', { detail: this }); - this.log('libp2p has stopped'); - } - isStarted() { - return this.#started; - } - getConnections(peerId) { - return this.components.connectionManager.getConnections(peerId); - } - getDialQueue() { - return this.components.connectionManager.getDialQueue(); - } - getPeers() { - const peerSet = new PeerSet(); - for (const conn of this.components.connectionManager.getConnections()) { - peerSet.add(conn.remotePeer); - } - return Array.from(peerSet); - } - async dial(peer, options = {}) { - return this.components.connectionManager.openConnection(peer, options); - } - async dialProtocol(peer, protocols, options = {}) { - if (protocols == null) { - throw new CodeError('no protocols were provided to open a stream', codes.ERR_INVALID_PROTOCOLS_FOR_STREAM); - } - protocols = Array.isArray(protocols) ? protocols : [protocols]; - if (protocols.length === 0) { - throw new CodeError('no protocols were provided to open a stream', codes.ERR_INVALID_PROTOCOLS_FOR_STREAM); - } - const connection = await this.dial(peer, options); - return connection.newStream(protocols, options); - } - getMultiaddrs() { - return this.components.addressManager.getAddresses(); - } - getProtocols() { - return this.components.registrar.getProtocols(); - } - async hangUp(peer, options = {}) { - if (isMultiaddr(peer)) { - peer = peerIdFromString(peer.getPeerId() ?? ''); - } - await this.components.connectionManager.closeConnections(peer, options); - } - /** - * Get the public key for the given peer id - */ - async getPublicKey(peer, options = {}) { - this.log('getPublicKey %p', peer); - if (peer.publicKey != null) { - return peer.publicKey; - } - const peerInfo = await this.peerStore.get(peer); - if (peerInfo.id.publicKey != null) { - return peerInfo.id.publicKey; - } - const peerKey = uint8ArrayConcat([ - uint8ArrayFromString('/pk/'), - peer.multihash.digest - ]); - // search any available content routing methods - const bytes = await this.contentRouting.get(peerKey, options); - // ensure the returned key is valid - unmarshalPublicKey(bytes); - await this.peerStore.patch(peer, { - publicKey: bytes - }); - return bytes; - } - async handle(protocols, handler, options) { - if (!Array.isArray(protocols)) { - protocols = [protocols]; - } - await Promise.all(protocols.map(async (protocol) => { - await this.components.registrar.handle(protocol, handler, options); - })); - } - async unhandle(protocols) { - if (!Array.isArray(protocols)) { - protocols = [protocols]; - } - await Promise.all(protocols.map(async (protocol) => { - await this.components.registrar.unhandle(protocol); - })); - } - async register(protocol, topology) { - return this.components.registrar.register(protocol, topology); - } - unregister(id) { - this.components.registrar.unregister(id); - } - /** - * Called whenever peer discovery services emit `peer` events and adds peers - * to the peer store. - */ - #onDiscoveryPeer(evt) { - const { detail: peer } = evt; - if (peer.id.toString() === this.peerId.toString()) { - this.log.error(new Error(codes.ERR_DISCOVERED_SELF)); - return; - } - void this.components.peerStore.merge(peer.id, { - multiaddrs: peer.multiaddrs - }) - .catch(err => { this.log.error(err); }); - } -} -/** - * Returns a new Libp2pNode instance - this exposes more of the internals than the - * libp2p interface and is useful for testing and debugging. - */ -export async function createLibp2pNode(options) { - options.peerId ??= await createEd25519PeerId(); - return new Libp2pNode(validateConfig(options)); -} -//# sourceMappingURL=libp2p.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/libp2p.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/libp2p.js.map deleted file mode 100644 index 2e6bdd3cc..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/libp2p.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"libp2p.js","sourceRoot":"","sources":["../../src/libp2p.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAuB,cAAc,EAAE,MAAM,mCAAmC,CAAA;AACvF,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,EAAoB,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAkB,MAAM,yBAAyB,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,M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G,GAAG,CAAA;QAE5B,IAAI,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE;YACjD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAA;YACpD,OAAM;SACP;QAED,KAAK,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE;YAC5C,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;aACC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA,CAAC,CAAC,CAAC,CAAA;IAC1C,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAmD,OAAyB;IAChH,OAAO,CAAC,MAAM,KAAK,MAAM,mBAAmB,EAAE,CAAA;IAE9C,OAAO,IAAI,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;AAChD,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/peer-routing.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/peer-routing.d.ts deleted file mode 100644 index c24dc1bb8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/peer-routing.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { AbortOptions } from '@libp2p/interface'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerInfo } from '@libp2p/interface/peer-info'; -import type { PeerRouting } from '@libp2p/interface/peer-routing'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { ComponentLogger } from '@libp2p/logger'; -export interface PeerRoutingInit { - routers?: PeerRouting[]; -} -export interface DefaultPeerRoutingComponents { - peerId: PeerId; - peerStore: PeerStore; - logger: ComponentLogger; -} -export declare class DefaultPeerRouting implements PeerRouting { - private readonly log; - private readonly peerId; - private readonly peerStore; - private readonly routers; - constructor(components: DefaultPeerRoutingComponents, init: PeerRoutingInit); - /** - * Iterates over all peer routers in parallel to find the given peer - */ - findPeer(id: PeerId, options?: AbortOptions): Promise; - /** - * Attempt to find the closest peers on the network to the given key - */ - getClosestPeers(key: Uint8Array, options?: AbortOptions): AsyncIterable; -} -//# sourceMappingURL=peer-routing.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/peer-routing.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/peer-routing.d.ts.map deleted file mode 100644 index 4f11ac2b3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/peer-routing.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-routing.d.ts","sourceRoot":"","sources":["../../src/peer-routing.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAU,MAAM,mBAAmB,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,WAAW,EAAE,CAAA;CACxB;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,eAAe,CAAA;CACxB;AAED,qBAAa,kBAAmB,YAAW,WAAW;IACpD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;gBAE1B,UAAU,EAAE,4BAA4B,EAAE,IAAI,EAAE,eAAe;IAO5E;;OAEG;IACG,QAAQ,CAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC;IAiCtE;;OAEG;IACK,eAAe,CAAE,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC;CAc3F"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/peer-routing.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/peer-routing.js deleted file mode 100644 index 658dc5529..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/peer-routing.js +++ /dev/null @@ -1,53 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import filter from 'it-filter'; -import first from 'it-first'; -import merge from 'it-merge'; -import { pipe } from 'it-pipe'; -import { storeAddresses, uniquePeers, requirePeers } from './content-routing/utils.js'; -import { codes, messages } from './errors.js'; -export class DefaultPeerRouting { - log; - peerId; - peerStore; - routers; - constructor(components, init) { - this.log = components.logger.forComponent('libp2p:peer-routing'); - this.peerId = components.peerId; - this.peerStore = components.peerStore; - this.routers = init.routers ?? []; - } - /** - * Iterates over all peer routers in parallel to find the given peer - */ - async findPeer(id, options) { - if (this.routers.length === 0) { - throw new CodeError('No peer routers available', codes.ERR_NO_ROUTERS_AVAILABLE); - } - if (id.toString() === this.peerId.toString()) { - throw new CodeError('Should not try to find self', codes.ERR_FIND_SELF); - } - const self = this; - const output = await pipe(merge(...this.routers.map(router => (async function* () { - try { - yield await router.findPeer(id, options); - } - catch (err) { - self.log.error(err); - } - })())), (source) => filter(source, Boolean), (source) => storeAddresses(source, this.peerStore), async (source) => first(source)); - if (output != null) { - return output; - } - throw new CodeError(messages.NOT_FOUND, codes.ERR_NOT_FOUND); - } - /** - * Attempt to find the closest peers on the network to the given key - */ - async *getClosestPeers(key, options) { - if (this.routers.length === 0) { - throw new CodeError('No peer routers available', codes.ERR_NO_ROUTERS_AVAILABLE); - } - yield* pipe(merge(...this.routers.map(router => router.getClosestPeers(key, options))), (source) => storeAddresses(source, this.peerStore), (source) => uniquePeers(source), (source) => requirePeers(source)); - } -} -//# sourceMappingURL=peer-routing.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/peer-routing.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/peer-routing.js.map deleted file mode 100644 index 8e8e8ba14..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/peer-routing.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-routing.js","sourceRoot":"","sources":["../../src/peer-routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EACL,cAAc,EACd,WAAW,EACX,YAAY,EACb,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAkB7C,MAAM,OAAO,kBAAkB;IACZ,GAAG,CAAQ;IACX,MAAM,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c,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EAClD,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAChC,CAAA;QAED,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,OAAO,MAAM,CAAA;SACd;QAED,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;IAC9D,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,CAAE,eAAe,CAAE,GAAe,EAAE,OAAsB;QAC9D,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;YAC7B,MAAM,IAAI,SAAS,CAAC,2BAA2B,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAA;SACjF;QAED,KAAM,CAAC,CAAC,IAAI,CACV,KAAK,CACH,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CACpE,EACD,CAAC,MAAM,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EAClD,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,EAC/B,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CACjC,CAAA;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/registrar.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/registrar.d.ts deleted file mode 100644 index 82e0d7d91..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/registrar.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { IdentifyResult, Libp2pEvents, PeerUpdate } from '@libp2p/interface'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Topology } from '@libp2p/interface/topology'; -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'; -import type { StreamHandlerOptions, StreamHandlerRecord, Registrar, StreamHandler } from '@libp2p/interface-internal/registrar'; -import type { ComponentLogger } from '@libp2p/logger'; -export declare const DEFAULT_MAX_INBOUND_STREAMS = 32; -export declare const DEFAULT_MAX_OUTBOUND_STREAMS = 64; -export interface RegistrarComponents { - peerId: PeerId; - connectionManager: ConnectionManager; - peerStore: PeerStore; - events: TypedEventTarget; - logger: ComponentLogger; -} -/** - * Responsible for notifying registered protocols of events in the network. - */ -export declare class DefaultRegistrar implements Registrar { - private readonly log; - private readonly topologies; - private readonly handlers; - private readonly components; - constructor(components: RegistrarComponents); - getProtocols(): string[]; - getHandler(protocol: string): StreamHandlerRecord; - getTopologies(protocol: string): Topology[]; - /** - * Registers the `handler` for each protocol - */ - handle(protocol: string, handler: StreamHandler, opts?: StreamHandlerOptions): Promise; - /** - * Removes the handler for each protocol. The protocol - * will no longer be supported on streams. - */ - unhandle(protocols: string | string[]): Promise; - /** - * Register handlers for a set of multicodecs given - */ - register(protocol: string, topology: Topology): Promise; - /** - * Unregister topology - */ - unregister(id: string): void; - /** - * Remove a disconnected peer from the record - */ - _onDisconnect(evt: CustomEvent): void; - /** - * When a peer is updated, if they have removed supported protocols notify any - * topologies interested in the removed protocols. - */ - _onPeerUpdate(evt: CustomEvent): void; - /** - * After identify has completed and we have received the list of supported - * protocols, notify any topologies interested in those protocols. - */ - _onPeerIdentify(evt: CustomEvent): void; -} -//# sourceMappingURL=registrar.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/registrar.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/registrar.d.ts.map deleted file mode 100644 index 3b9a68032..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/registrar.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registrar.d.ts","sourceRoot":"","sources":["../../src/registrar.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAU,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAA;AACtF,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAA;AAC/H,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD,eAAO,MAAM,2BAA2B,KAAK,CAAA;AAC7C,eAAO,MAAM,4BAA4B,KAAK,CAAA;AAE9C,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAA;IACtC,MAAM,EAAE,eAAe,CAAA;CACxB;AAED;;GAEG;AACH,qBAAa,gBAAiB,YAAW,SAAS;IAChD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoC;IAC/D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;IAC3D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAqB;gBAEnC,UAAU,EAAE,mBAAmB;IAe5C,YAAY,IAAK,MAAM,EAAE;IAMzB,UAAU,CAAE,QAAQ,EAAE,MAAM,GAAG,mBAAmB;IAUlD,aAAa,CAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE;IAY5C;;OAEG;IACG,MAAM,CAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBnG;;;OAGG;IACG,QAAQ,CAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAa5D;;OAEG;IACG,QAAQ,CAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAoBtE;;OAEG;IACH,UAAU,CAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAY7B;;OAEG;IACH,aAAa,CAAE,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI;IA4B9C;;;OAGG;IACH,aAAa,CAAE,GAAG,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,IAAI;IAkBlD;;;OAGG;IACH,eAAe,CAAE,GAAG,EAAE,WAAW,CAAC,cAAc,CAAC,GAAG,IAAI;CAsBzD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/registrar.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/registrar.js deleted file mode 100644 index 3b63bfb9c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/registrar.js +++ /dev/null @@ -1,178 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import merge from 'merge-options'; -import { codes } from './errors.js'; -export const DEFAULT_MAX_INBOUND_STREAMS = 32; -export const DEFAULT_MAX_OUTBOUND_STREAMS = 64; -/** - * Responsible for notifying registered protocols of events in the network. - */ -export class DefaultRegistrar { - log; - topologies; - handlers; - components; - constructor(components) { - this.log = components.logger.forComponent('libp2p:registrar'); - this.topologies = new Map(); - this.handlers = new Map(); - this.components = components; - this._onDisconnect = this._onDisconnect.bind(this); - this._onPeerUpdate = this._onPeerUpdate.bind(this); - this._onPeerIdentify = this._onPeerIdentify.bind(this); - this.components.events.addEventListener('peer:disconnect', this._onDisconnect); - this.components.events.addEventListener('peer:update', this._onPeerUpdate); - this.components.events.addEventListener('peer:identify', this._onPeerIdentify); - } - getProtocols() { - return Array.from(new Set([ - ...this.handlers.keys() - ])).sort(); - } - getHandler(protocol) { - const handler = this.handlers.get(protocol); - if (handler == null) { - throw new CodeError(`No handler registered for protocol ${protocol}`, codes.ERR_NO_HANDLER_FOR_PROTOCOL); - } - return handler; - } - getTopologies(protocol) { - const topologies = this.topologies.get(protocol); - if (topologies == null) { - return []; - } - return [ - ...topologies.values() - ]; - } - /** - * Registers the `handler` for each protocol - */ - async handle(protocol, handler, opts) { - if (this.handlers.has(protocol)) { - throw new CodeError(`Handler already registered for protocol ${protocol}`, codes.ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED); - } - const options = merge.bind({ ignoreUndefined: true })({ - maxInboundStreams: DEFAULT_MAX_INBOUND_STREAMS, - maxOutboundStreams: DEFAULT_MAX_OUTBOUND_STREAMS - }, opts); - this.handlers.set(protocol, { - handler, - options - }); - // Add new protocol to self protocols in the peer store - await this.components.peerStore.merge(this.components.peerId, { - protocols: [protocol] - }); - } - /** - * Removes the handler for each protocol. The protocol - * will no longer be supported on streams. - */ - async unhandle(protocols) { - const protocolList = Array.isArray(protocols) ? protocols : [protocols]; - protocolList.forEach(protocol => { - this.handlers.delete(protocol); - }); - // Update self protocols in the peer store - await this.components.peerStore.patch(this.components.peerId, { - protocols: this.getProtocols() - }); - } - /** - * Register handlers for a set of multicodecs given - */ - async register(protocol, topology) { - if (topology == null) { - throw new CodeError('invalid topology', codes.ERR_INVALID_PARAMETERS); - } - // Create topology - const id = `${(Math.random() * 1e9).toString(36)}${Date.now()}`; - let topologies = this.topologies.get(protocol); - if (topologies == null) { - topologies = new Map(); - this.topologies.set(protocol, topologies); - } - topologies.set(id, topology); - return id; - } - /** - * Unregister topology - */ - unregister(id) { - for (const [protocol, topologies] of this.topologies.entries()) { - if (topologies.has(id)) { - topologies.delete(id); - if (topologies.size === 0) { - this.topologies.delete(protocol); - } - } - } - } - /** - * Remove a disconnected peer from the record - */ - _onDisconnect(evt) { - const remotePeer = evt.detail; - void this.components.peerStore.get(remotePeer) - .then(peer => { - for (const protocol of peer.protocols) { - const topologies = this.topologies.get(protocol); - if (topologies == null) { - // no topologies are interested in this protocol - continue; - } - for (const topology of topologies.values()) { - topology.onDisconnect?.(remotePeer); - } - } - }) - .catch(err => { - if (err.code === codes.ERR_NOT_FOUND) { - // peer has not completed identify so they are not in the peer store - return; - } - this.log.error('could not inform topologies of disconnecting peer %p', remotePeer, err); - }); - } - /** - * When a peer is updated, if they have removed supported protocols notify any - * topologies interested in the removed protocols. - */ - _onPeerUpdate(evt) { - const { peer, previous } = evt.detail; - const removed = (previous?.protocols ?? []).filter(protocol => !peer.protocols.includes(protocol)); - for (const protocol of removed) { - const topologies = this.topologies.get(protocol); - if (topologies == null) { - // no topologies are interested in this protocol - continue; - } - for (const topology of topologies.values()) { - topology.onDisconnect?.(peer.id); - } - } - } - /** - * After identify has completed and we have received the list of supported - * protocols, notify any topologies interested in those protocols. - */ - _onPeerIdentify(evt) { - const protocols = evt.detail.protocols; - const connection = evt.detail.connection; - const peerId = evt.detail.peerId; - for (const protocol of protocols) { - const topologies = this.topologies.get(protocol); - if (topologies == null) { - // no topologies are interested in this protocol - continue; - } - for (const topology of topologies.values()) { - if (connection.transient && topology.notifyOnTransient !== true) { - continue; - } - topology.onConnect?.(peerId, connection); - } - } - } -} -//# sourceMappingURL=registrar.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/registrar.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/registrar.js.map deleted file mode 100644 index 77af8c611..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/registrar.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registrar.js","sourceRoot":"","sources":["../../src/registrar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,MAAM,eAAe,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAUnC,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAA;AAC7C,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAA;AAU9C;;GAEG;AACH,MAAM,OAAO,gBAAgB;IACV,GAAG,CAAQ;IACX,UAAU,CAAoC;IAC9C,QAAQ,CAAkC;IAC1C,UAAU,CAAqB;IAEhD,YAAa,UAA+B;QAC1C,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAA;QAC7D,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAA;QAC3B,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAA;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAEtD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,iBAAiB,EAAE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CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YAEhD,IAAI,UAAU,IAAI,IAAI,EAAE;gBACtB,gDAAgD;gBAChD,SAAQ;aACT;YAED,KAAK,MAAM,QAAQ,IAAI,UAAU,CAAC,MAAM,EAAE,EAAE;gBAC1C,IAAI,UAAU,CAAC,SAAS,IAAI,QAAQ,CAAC,iBAAiB,KAAK,IAAI,EAAE;oBAC/D,SAAQ;iBACT;gBAED,QAAQ,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;aACzC;SACF;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/transport-manager.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/transport-manager.d.ts deleted file mode 100644 index 3cd9dc77c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/transport-manager.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { FaultTolerance } from '@libp2p/interface/transport'; -import type { Libp2pEvents, AbortOptions, ComponentLogger } from '@libp2p/interface'; -import type { Connection } from '@libp2p/interface/connection'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { Startable } from '@libp2p/interface/startable'; -import type { Listener, Transport, Upgrader } from '@libp2p/interface/transport'; -import type { AddressManager } from '@libp2p/interface-internal/address-manager'; -import type { TransportManager } from '@libp2p/interface-internal/transport-manager'; -import type { Multiaddr } from '@multiformats/multiaddr'; -export interface TransportManagerInit { - faultTolerance?: FaultTolerance; -} -export interface DefaultTransportManagerComponents { - metrics?: Metrics; - addressManager: AddressManager; - upgrader: Upgrader; - events: TypedEventTarget; - logger: ComponentLogger; -} -export declare class DefaultTransportManager implements TransportManager, Startable { - private readonly log; - private readonly components; - private readonly transports; - private readonly listeners; - private readonly faultTolerance; - private started; - constructor(components: DefaultTransportManagerComponents, init?: TransportManagerInit); - /** - * Adds a `Transport` to the manager - */ - add(transport: Transport): void; - isStarted(): boolean; - start(): void; - afterStart(): Promise; - /** - * Stops all listeners - */ - stop(): Promise; - /** - * Dials the given Multiaddr over it's supported transport - */ - dial(ma: Multiaddr, options?: AbortOptions): Promise; - /** - * Returns all Multiaddr's the listeners are using - */ - getAddrs(): Multiaddr[]; - /** - * Returns all the transports instances - */ - getTransports(): Transport[]; - /** - * Returns all the listener instances - */ - getListeners(): Listener[]; - /** - * Finds a transport that matches the given Multiaddr - */ - transportForMultiaddr(ma: Multiaddr): Transport | undefined; - /** - * Starts listeners for each listen Multiaddr - */ - listen(addrs: Multiaddr[]): Promise; - /** - * Removes the given transport from the manager. - * If a transport has any running listeners, they will be closed. - */ - remove(key: string): Promise; - /** - * Removes all transports from the manager. - * If any listeners are running, they will be closed. - * - * @async - */ - removeAll(): Promise; -} -//# sourceMappingURL=transport-manager.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/transport-manager.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/transport-manager.d.ts.map deleted file mode 100644 index 889428202..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/transport-manager.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.d.ts","sourceRoot":"","sources":["../../src/transport-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAE5D,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAU,MAAM,mBAAmB,CAAA;AAC5F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,E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AAS,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC;IAqBvE;;OAEG;IACH,QAAQ,IAAK,SAAS,EAAE;IAUxB;;OAEG;IACH,aAAa,IAAK,SAAS,EAAE;IAI7B;;OAEG;IACH,YAAY,IAAK,QAAQ,EAAE;IAI3B;;OAEG;IACH,qBAAqB,CAAE,EAAE,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS;IAU5D;;OAEG;IACG,MAAM,CAAE,KAAK,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAiFhD;;;OAGG;IACG,MAAM,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBzC;;;;;OAKG;IACG,SAAS,IAAK,OAAO,CAAC,IAAI,CAAC;CAQlC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/transport-manager.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/transport-manager.js deleted file mode 100644 index df34f9baa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/transport-manager.js +++ /dev/null @@ -1,233 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { trackedMap } from '@libp2p/interface/metrics/tracked-map'; -import { FaultTolerance } from '@libp2p/interface/transport'; -import { codes } from './errors.js'; -export class DefaultTransportManager { - log; - components; - transports; - listeners; - faultTolerance; - started; - constructor(components, init = {}) { - this.log = components.logger.forComponent('libp2p:transports'); - this.components = components; - this.started = false; - this.transports = new Map(); - this.listeners = trackedMap({ - name: 'libp2p_transport_manager_listeners', - metrics: this.components.metrics - }); - this.faultTolerance = init.faultTolerance ?? FaultTolerance.FATAL_ALL; - } - /** - * Adds a `Transport` to the manager - */ - add(transport) { - const tag = transport[Symbol.toStringTag]; - if (tag == null) { - throw new CodeError('Transport must have a valid tag', codes.ERR_INVALID_KEY); - } - if (this.transports.has(tag)) { - throw new CodeError(`There is already a transport with the tag ${tag}`, codes.ERR_DUPLICATE_TRANSPORT); - } - this.log('adding transport %s', tag); - this.transports.set(tag, transport); - if (!this.listeners.has(tag)) { - this.listeners.set(tag, []); - } - } - isStarted() { - return this.started; - } - start() { - this.started = true; - } - async afterStart() { - // Listen on the provided transports for the provided addresses - const addrs = this.components.addressManager.getListenAddrs(); - await this.listen(addrs); - } - /** - * Stops all listeners - */ - async stop() { - const tasks = []; - for (const [key, listeners] of this.listeners) { - this.log('closing listeners for %s', key); - while (listeners.length > 0) { - const listener = listeners.pop(); - if (listener == null) { - continue; - } - tasks.push(listener.close()); - } - } - await Promise.all(tasks); - this.log('all listeners closed'); - for (const key of this.listeners.keys()) { - this.listeners.set(key, []); - } - this.started = false; - } - /** - * Dials the given Multiaddr over it's supported transport - */ - async dial(ma, options) { - const transport = this.transportForMultiaddr(ma); - if (transport == null) { - throw new CodeError(`No transport available for address ${String(ma)}`, codes.ERR_TRANSPORT_UNAVAILABLE); - } - try { - return await transport.dial(ma, { - ...options, - upgrader: this.components.upgrader - }); - } - catch (err) { - if (err.code == null) { - err.code = codes.ERR_TRANSPORT_DIAL_FAILED; - } - throw err; - } - } - /** - * Returns all Multiaddr's the listeners are using - */ - getAddrs() { - let addrs = []; - for (const listeners of this.listeners.values()) { - for (const listener of listeners) { - addrs = [...addrs, ...listener.getAddrs()]; - } - } - return addrs; - } - /** - * Returns all the transports instances - */ - getTransports() { - return Array.of(...this.transports.values()); - } - /** - * Returns all the listener instances - */ - getListeners() { - return Array.of(...this.listeners.values()).flat(); - } - /** - * Finds a transport that matches the given Multiaddr - */ - transportForMultiaddr(ma) { - for (const transport of this.transports.values()) { - const addrs = transport.filter([ma]); - if (addrs.length > 0) { - return transport; - } - } - } - /** - * Starts listeners for each listen Multiaddr - */ - async listen(addrs) { - if (!this.isStarted()) { - throw new CodeError('Not started', codes.ERR_NODE_NOT_STARTED); - } - if (addrs == null || addrs.length === 0) { - this.log('no addresses were provided for listening, this node is dial only'); - return; - } - const couldNotListen = []; - for (const [key, transport] of this.transports.entries()) { - const supportedAddrs = transport.filter(addrs); - const tasks = []; - // For each supported multiaddr, create a listener - for (const addr of supportedAddrs) { - this.log('creating listener for %s on %a', key, addr); - const listener = transport.createListener({ - upgrader: this.components.upgrader - }); - let listeners = this.listeners.get(key) ?? []; - if (listeners == null) { - listeners = []; - this.listeners.set(key, listeners); - } - listeners.push(listener); - // Track listen/close events - listener.addEventListener('listening', () => { - this.components.events.safeDispatchEvent('transport:listening', { - detail: listener - }); - }); - listener.addEventListener('close', () => { - const index = listeners.findIndex(l => l === listener); - // remove the listener - listeners.splice(index, 1); - this.components.events.safeDispatchEvent('transport:close', { - detail: listener - }); - }); - // We need to attempt to listen on everything - tasks.push(listener.listen(addr)); - } - // Keep track of transports we had no addresses for - if (tasks.length === 0) { - couldNotListen.push(key); - continue; - } - const results = await Promise.allSettled(tasks); - // If we are listening on at least 1 address, succeed. - // TODO: we should look at adding a retry (`p-retry`) here to better support - // listening on remote addresses as they may be offline. We could then potentially - // just wait for any (`p-any`) listener to succeed on each transport before returning - const isListening = results.find(r => r.status === 'fulfilled'); - if ((isListening == null) && this.faultTolerance !== FaultTolerance.NO_FATAL) { - throw new CodeError(`Transport (${key}) could not listen on any available address`, codes.ERR_NO_VALID_ADDRESSES); - } - } - // If no transports were able to listen, throw an error. This likely - // means we were given addresses we do not have transports for - if (couldNotListen.length === this.transports.size) { - const message = `no valid addresses were provided for transports [${couldNotListen.join(', ')}]`; - if (this.faultTolerance === FaultTolerance.FATAL_ALL) { - throw new CodeError(message, codes.ERR_NO_VALID_ADDRESSES); - } - this.log(`libp2p in dial mode only: ${message}`); - } - } - /** - * Removes the given transport from the manager. - * If a transport has any running listeners, they will be closed. - */ - async remove(key) { - const listeners = this.listeners.get(key) ?? []; - this.log.trace('removing transport %s', key); - // Close any running listeners - const tasks = []; - this.log.trace('closing listeners for %s', key); - while (listeners.length > 0) { - const listener = listeners.pop(); - if (listener == null) { - continue; - } - tasks.push(listener.close()); - } - await Promise.all(tasks); - this.transports.delete(key); - this.listeners.delete(key); - } - /** - * Removes all transports from the manager. - * If any listeners are running, they will be closed. - * - * @async - */ - async removeAll() { - const tasks = []; - for (const key of this.transports.keys()) { - tasks.push(this.remove(key)); - } - await Promise.all(tasks); - } -} -//# sourceMappingURL=transport-manager.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/transport-manager.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/transport-manager.js.map deleted file mode 100644 index eda3a9904..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/transport-manager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.js","sourceRoot":"","sources":["../../src/transport-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAuBnC,MAAM,OAAO,uBAAuB;IACjB,GAAG,CAAQ;IACX,UAAU,CAAmC;IAC7C,UAAU,CAAwB;IAClC,SAAS,CAAyB;IAClC,cAAc,CAAgB;IACvC,OAAO,CAAS;IAExB,YAAa,UAA6C,EAAE,OAA6B,EAAE;QACzF,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAA;QAC9D,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACpB,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAqB,CAAA;QAC9C,IAAI,CAAC,SAAS,GA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v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/upgrader.d.ts deleted file mode 100644 index 5e75c1f1b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/upgrader.d.ts +++ /dev/null @@ -1,103 +0,0 @@ -import type { Libp2pEvents, ComponentLogger } from '@libp2p/interface'; -import type { MultiaddrConnection, Connection, Stream, ConnectionProtector } from '@libp2p/interface/connection'; -import type { ConnectionEncrypter, SecuredConnection } from '@libp2p/interface/connection-encrypter'; -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { StreamMuxerFactory } from '@libp2p/interface/stream-muxer'; -import type { Upgrader, UpgraderOptions } from '@libp2p/interface/transport'; -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'; -import type { Registrar } from '@libp2p/interface-internal/registrar'; -interface CreateConnectionOptions { - cryptoProtocol: string; - direction: 'inbound' | 'outbound'; - maConn: MultiaddrConnection; - upgradedConn: MultiaddrConnection; - remotePeer: PeerId; - muxerFactory?: StreamMuxerFactory; - transient?: boolean; -} -interface OnStreamOptions { - connection: Connection; - stream: Stream; - protocol: string; -} -export interface CryptoResult extends SecuredConnection { - protocol: string; -} -export interface UpgraderInit { - connectionEncryption: ConnectionEncrypter[]; - muxers: StreamMuxerFactory[]; - /** - * An amount of ms by which an inbound connection upgrade - * must complete - */ - inboundUpgradeTimeout?: number; -} -export interface DefaultUpgraderComponents { - peerId: PeerId; - metrics?: Metrics; - connectionManager: ConnectionManager; - connectionGater: ConnectionGater; - connectionProtector?: ConnectionProtector; - registrar: Registrar; - peerStore: PeerStore; - events: TypedEventTarget; - logger: ComponentLogger; -} -type ConnectionDeniedType = keyof Pick; -export declare class DefaultUpgrader implements Upgrader { - private readonly components; - private readonly connectionEncryption; - private readonly muxers; - private readonly inboundUpgradeTimeout; - private readonly events; - private readonly log; - constructor(components: DefaultUpgraderComponents, init: UpgraderInit); - shouldBlockConnection(remotePeer: PeerId, maConn: MultiaddrConnection, connectionType: ConnectionDeniedType): Promise; - /** - * Upgrades an inbound connection - */ - upgradeInbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise; - /** - * Upgrades an outbound connection - */ - upgradeOutbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise; - /** - * A convenience method for generating a new `Connection` - */ - _createConnection(opts: CreateConnectionOptions): Connection; - /** - * Routes incoming streams to the correct handler - */ - _onStream(opts: OnStreamOptions): void; - /** - * Attempts to encrypt the incoming `connection` with the provided `cryptos` - */ - _encryptInbound(connection: MultiaddrConnection): Promise; - /** - * Attempts to encrypt the given `connection` with the provided connection encrypters. - * The first `ConnectionEncrypter` module to succeed will be used - */ - _encryptOutbound(connection: MultiaddrConnection, remotePeerId?: PeerId): Promise; - /** - * Selects one of the given muxers via multistream-select. That - * muxer will be used for all future streams on the connection. - */ - _multiplexOutbound(connection: MultiaddrConnection, muxers: Map): Promise<{ - stream: MultiaddrConnection; - muxerFactory?: StreamMuxerFactory; - }>; - /** - * Registers support for one of the given muxers via multistream-select. The - * selected muxer will be used for all future streams on the connection. - */ - _multiplexInbound(connection: MultiaddrConnection, muxers: Map): Promise<{ - stream: MultiaddrConnection; - muxerFactory?: StreamMuxerFactory; - }>; -} -export {}; -//# sourceMappingURL=upgrader.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/upgrader.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/upgrader.d.ts.map deleted file mode 100644 index f6e57a5ce..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/upgrader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"upgrader.d.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MAAM,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC;IA8G/F;;OAEG;IACG,eAAe,CAAE,MAAM,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC;IA2FhG;;OAEG;IACH,iBAAiB,CAAE,IAAI,EAAE,uBAAuB,GAAG,UAAU;IAqQ7D;;OAEG;IACH,SAAS,CAAE,IAAI,EAAE,eAAe,GAAG,IAAI;IAWvC;;OAEG;IACG,eAAe,CAAE,UAAU,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC;IAyB9E;;;OAGG;IACG,gBAAgB,CAAE,UAAU,EAAE,mBAAmB,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAgCtG;;;OAGG;IACG,kBAAkB,CAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,mBAAmB,CAAC;QAAC,YAAY,CAAC,EAAE,kBAAkB,CAAA;KAAE,CAAC;IAwBhL;;;OAGG;IACG,iBAAiB,CAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,mBAAmB,CAAC;QAAC,YAAY,CAAC,EAAE,kBAAkB,CAAA;KAAE,CAAC;CAehL"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/upgrader.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/upgrader.js deleted file mode 100644 index abbd57a49..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/upgrader.js +++ /dev/null @@ -1,567 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { setMaxListeners } from '@libp2p/interface/events'; -import * as mss from '@libp2p/multistream-select'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { createConnection } from './connection/index.js'; -import { INBOUND_UPGRADE_TIMEOUT } from './connection-manager/constants.js'; -import { codes } from './errors.js'; -import { DEFAULT_MAX_INBOUND_STREAMS, DEFAULT_MAX_OUTBOUND_STREAMS } from './registrar.js'; -const ERR_TIMEOUT = 'ERR_TIMEOUT'; -const DEFAULT_PROTOCOL_SELECT_TIMEOUT = 30000; -function findIncomingStreamLimit(protocol, registrar) { - try { - const { options } = registrar.getHandler(protocol); - return options.maxInboundStreams; - } - catch (err) { - if (err.code !== codes.ERR_NO_HANDLER_FOR_PROTOCOL) { - throw err; - } - } - return DEFAULT_MAX_INBOUND_STREAMS; -} -function findOutgoingStreamLimit(protocol, registrar, options = {}) { - try { - const { options } = registrar.getHandler(protocol); - if (options.maxOutboundStreams != null) { - return options.maxOutboundStreams; - } - } - catch (err) { - if (err.code !== codes.ERR_NO_HANDLER_FOR_PROTOCOL) { - throw err; - } - } - return options.maxOutboundStreams ?? DEFAULT_MAX_OUTBOUND_STREAMS; -} -function countStreams(protocol, direction, connection) { - let streamCount = 0; - connection.streams.forEach(stream => { - if (stream.direction === direction && stream.protocol === protocol) { - streamCount++; - } - }); - return streamCount; -} -export class DefaultUpgrader { - components; - connectionEncryption; - muxers; - inboundUpgradeTimeout; - events; - log; - constructor(components, init) { - this.components = components; - this.connectionEncryption = new Map(); - this.log = components.logger.forComponent('libp2p:upgrader'); - init.connectionEncryption.forEach(encrypter => { - this.connectionEncryption.set(encrypter.protocol, encrypter); - }); - this.muxers = new Map(); - init.muxers.forEach(muxer => { - this.muxers.set(muxer.protocol, muxer); - }); - this.inboundUpgradeTimeout = init.inboundUpgradeTimeout ?? INBOUND_UPGRADE_TIMEOUT; - this.events = components.events; - } - async shouldBlockConnection(remotePeer, maConn, connectionType) { - const connectionGater = this.components.connectionGater[connectionType]; - if (connectionGater !== undefined) { - if (await connectionGater(remotePeer, maConn)) { - throw new CodeError(`The multiaddr connection is blocked by gater.${connectionType}`, codes.ERR_CONNECTION_INTERCEPTED); - } - } - } - /** - * Upgrades an inbound connection - */ - async upgradeInbound(maConn, opts) { - const accept = await this.components.connectionManager.acceptIncomingConnection(maConn); - if (!accept) { - throw new CodeError('connection denied', codes.ERR_CONNECTION_DENIED); - } - let encryptedConn; - let remotePeer; - let upgradedConn; - let muxerFactory; - let cryptoProtocol; - const signal = AbortSignal.timeout(this.inboundUpgradeTimeout); - const onAbort = () => { - maConn.abort(new CodeError('inbound upgrade timeout', ERR_TIMEOUT)); - }; - signal.addEventListener('abort', onAbort, { once: true }); - setMaxListeners(Infinity, signal); - try { - if ((await this.components.connectionGater.denyInboundConnection?.(maConn)) === true) { - throw new CodeError('The multiaddr connection is blocked by gater.acceptConnection', codes.ERR_CONNECTION_INTERCEPTED); - } - this.components.metrics?.trackMultiaddrConnection(maConn); - this.log('starting the inbound connection upgrade'); - // Protect - let protectedConn = maConn; - if (opts?.skipProtection !== true) { - const protector = this.components.connectionProtector; - if (protector != null) { - this.log('protecting the inbound connection'); - protectedConn = await protector.protect(maConn); - } - } - try { - // Encrypt the connection - encryptedConn = protectedConn; - if (opts?.skipEncryption !== true) { - ({ - conn: encryptedConn, - remotePeer, - protocol: cryptoProtocol - } = await this._encryptInbound(protectedConn)); - const maConn = { - ...protectedConn, - ...encryptedConn - }; - await this.shouldBlockConnection(remotePeer, maConn, 'denyInboundEncryptedConnection'); - } - else { - const idStr = maConn.remoteAddr.getPeerId(); - if (idStr == null) { - throw new CodeError('inbound connection that skipped encryption must have a peer id', codes.ERR_INVALID_MULTIADDR); - } - const remotePeerId = peerIdFromString(idStr); - cryptoProtocol = 'native'; - remotePeer = remotePeerId; - } - upgradedConn = encryptedConn; - if (opts?.muxerFactory != null) { - muxerFactory = opts.muxerFactory; - } - else if (this.muxers.size > 0) { - // Multiplex the connection - const multiplexed = await this._multiplexInbound({ - ...protectedConn, - ...encryptedConn - }, this.muxers); - muxerFactory = multiplexed.muxerFactory; - upgradedConn = multiplexed.stream; - } - } - catch (err) { - this.log.error('Failed to upgrade inbound connection', err); - throw err; - } - await this.shouldBlockConnection(remotePeer, maConn, 'denyInboundUpgradedConnection'); - this.log('successfully upgraded inbound connection'); - return this._createConnection({ - cryptoProtocol, - direction: 'inbound', - maConn, - upgradedConn, - muxerFactory, - remotePeer, - transient: opts?.transient - }); - } - finally { - signal.removeEventListener('abort', onAbort); - this.components.connectionManager.afterUpgradeInbound(); - } - } - /** - * Upgrades an outbound connection - */ - async upgradeOutbound(maConn, opts) { - const idStr = maConn.remoteAddr.getPeerId(); - let remotePeerId; - if (idStr != null) { - remotePeerId = peerIdFromString(idStr); - await this.shouldBlockConnection(remotePeerId, maConn, 'denyOutboundConnection'); - } - let encryptedConn; - let remotePeer; - let upgradedConn; - let cryptoProtocol; - let muxerFactory; - this.components.metrics?.trackMultiaddrConnection(maConn); - this.log('Starting the outbound connection upgrade'); - // If the transport natively supports encryption, skip connection - // protector and encryption - // Protect - let protectedConn = maConn; - if (opts?.skipProtection !== true) { - const protector = this.components.connectionProtector; - if (protector != null) { - protectedConn = await protector.protect(maConn); - } - } - try { - // Encrypt the connection - encryptedConn = protectedConn; - if (opts?.skipEncryption !== true) { - ({ - conn: encryptedConn, - remotePeer, - protocol: cryptoProtocol - } = await this._encryptOutbound(protectedConn, remotePeerId)); - const maConn = { - ...protectedConn, - ...encryptedConn - }; - await this.shouldBlockConnection(remotePeer, maConn, 'denyOutboundEncryptedConnection'); - } - else { - if (remotePeerId == null) { - throw new CodeError('Encryption was skipped but no peer id was passed', codes.ERR_INVALID_PEER); - } - cryptoProtocol = 'native'; - remotePeer = remotePeerId; - } - upgradedConn = encryptedConn; - if (opts?.muxerFactory != null) { - muxerFactory = opts.muxerFactory; - } - else if (this.muxers.size > 0) { - // Multiplex the connection - const multiplexed = await this._multiplexOutbound({ - ...protectedConn, - ...encryptedConn - }, this.muxers); - muxerFactory = multiplexed.muxerFactory; - upgradedConn = multiplexed.stream; - } - } - catch (err) { - this.log.error('Failed to upgrade outbound connection', err); - await maConn.close(err); - throw err; - } - await this.shouldBlockConnection(remotePeer, maConn, 'denyOutboundUpgradedConnection'); - this.log('Successfully upgraded outbound connection'); - return this._createConnection({ - cryptoProtocol, - direction: 'outbound', - maConn, - upgradedConn, - muxerFactory, - remotePeer, - transient: opts?.transient - }); - } - /** - * A convenience method for generating a new `Connection` - */ - _createConnection(opts) { - const { cryptoProtocol, direction, maConn, upgradedConn, remotePeer, muxerFactory, transient } = opts; - let muxer; - let newStream; - let connection; // eslint-disable-line prefer-const - if (muxerFactory != null) { - // Create the muxer - muxer = muxerFactory.createStreamMuxer({ - direction, - // Run anytime a remote stream is created - onIncomingStream: muxedStream => { - if (connection == null) { - return; - } - void Promise.resolve() - .then(async () => { - const protocols = this.components.registrar.getProtocols(); - const { stream, protocol } = await mss.handle(muxedStream, protocols, { - log: muxedStream.log, - yieldBytes: false - }); - if (connection == null) { - return; - } - connection.log('incoming stream opened on %s', protocol); - const incomingLimit = findIncomingStreamLimit(protocol, this.components.registrar); - const streamCount = countStreams(protocol, 'inbound', connection); - if (streamCount === incomingLimit) { - const err = new CodeError(`Too many inbound protocol streams for protocol "${protocol}" - limit ${incomingLimit}`, codes.ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS); - muxedStream.abort(err); - throw err; - } - // after the handshake the returned stream can have early data so override - // the souce/sink - muxedStream.source = stream.source; - muxedStream.sink = stream.sink; - muxedStream.protocol = protocol; - // allow closing the write end of a not-yet-negotiated stream - if (stream.closeWrite != null) { - muxedStream.closeWrite = stream.closeWrite; - } - // allow closing the read end of a not-yet-negotiated stream - if (stream.closeRead != null) { - muxedStream.closeRead = stream.closeRead; - } - // make sure we don't try to negotiate a stream we are closing - if (stream.close != null) { - muxedStream.close = stream.close; - } - // If a protocol stream has been successfully negotiated and is to be passed to the application, - // the peerstore should ensure that the peer is registered with that protocol - await this.components.peerStore.merge(remotePeer, { - protocols: [protocol] - }); - this.components.metrics?.trackProtocolStream(muxedStream, connection); - this._onStream({ connection, stream: muxedStream, protocol }); - }) - .catch(async (err) => { - this.log.error('error handling incoming stream id %s', muxedStream.id, err.message, err.code, err.stack); - if (muxedStream.timeline.close == null) { - await muxedStream.close(); - } - }); - } - }); - newStream = async (protocols, options = {}) => { - if (muxer == null) { - throw new CodeError('Stream is not multiplexed', codes.ERR_MUXER_UNAVAILABLE); - } - connection.log('starting new stream for protocols %s', protocols); - const muxedStream = await muxer.newStream(); - connection.log.trace('started new stream %s for protocols %s', muxedStream.id, protocols); - try { - if (options.signal == null) { - this.log('No abort signal was passed while trying to negotiate protocols %s falling back to default timeout', protocols); - const signal = AbortSignal.timeout(DEFAULT_PROTOCOL_SELECT_TIMEOUT); - setMaxListeners(Infinity, signal); - options = { - ...options, - signal - }; - } - muxedStream.log.trace('selecting protocol from protocols %s', protocols); - const { stream, protocol } = await mss.select(muxedStream, protocols, { - ...options, - log: muxedStream.log, - yieldBytes: true - }); - muxedStream.log('selected protocol %s', protocol); - const outgoingLimit = findOutgoingStreamLimit(protocol, this.components.registrar, options); - const streamCount = countStreams(protocol, 'outbound', connection); - if (streamCount >= outgoingLimit) { - const err = new CodeError(`Too many outbound protocol streams for protocol "${protocol}" - limit ${outgoingLimit}`, codes.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS); - muxedStream.abort(err); - throw err; - } - // If a protocol stream has been successfully negotiated and is to be passed to the application, - // the peerstore should ensure that the peer is registered with that protocol - await this.components.peerStore.merge(remotePeer, { - protocols: [protocol] - }); - // after the handshake the returned stream can have early data so override - // the souce/sink - muxedStream.source = stream.source; - muxedStream.sink = stream.sink; - muxedStream.protocol = protocol; - // allow closing the write end of a not-yet-negotiated stream - if (stream.closeWrite != null) { - muxedStream.closeWrite = stream.closeWrite; - } - // allow closing the read end of a not-yet-negotiated stream - if (stream.closeRead != null) { - muxedStream.closeRead = stream.closeRead; - } - // make sure we don't try to negotiate a stream we are closing - if (stream.close != null) { - muxedStream.close = stream.close; - } - this.components.metrics?.trackProtocolStream(muxedStream, connection); - return muxedStream; - } - catch (err) { - connection.log.error('could not create new stream for protocols %s', protocols, err); - if (muxedStream.timeline.close == null) { - muxedStream.abort(err); - } - if (err.code != null) { - throw err; - } - throw new CodeError(String(err), codes.ERR_UNSUPPORTED_PROTOCOL); - } - }; - // Pipe all data through the muxer - void Promise.all([ - muxer.sink(upgradedConn.source), - upgradedConn.sink(muxer.source) - ]).catch(err => { - this.log.error(err); - }); - } - const _timeline = maConn.timeline; - maConn.timeline = new Proxy(_timeline, { - set: (...args) => { - if (connection != null && args[1] === 'close' && args[2] != null && _timeline.close == null) { - // Wait for close to finish before notifying of the closure - (async () => { - try { - if (connection.status === 'open') { - await connection.close(); - } - } - catch (err) { - this.log.error(err); - } - finally { - this.events.safeDispatchEvent('connection:close', { - detail: connection - }); - } - })().catch(err => { - this.log.error(err); - }); - } - return Reflect.set(...args); - } - }); - maConn.timeline.upgraded = Date.now(); - const errConnectionNotMultiplexed = () => { - throw new CodeError('connection is not multiplexed', codes.ERR_CONNECTION_NOT_MULTIPLEXED); - }; - // Create the connection - connection = createConnection({ - remoteAddr: maConn.remoteAddr, - remotePeer, - status: 'open', - direction, - timeline: maConn.timeline, - multiplexer: muxer?.protocol, - encryption: cryptoProtocol, - transient, - logger: this.components.logger, - newStream: newStream ?? errConnectionNotMultiplexed, - getStreams: () => { if (muxer != null) { - return muxer.streams; - } - else { - return []; - } }, - close: async (options) => { - // Ensure remaining streams are closed gracefully - if (muxer != null) { - this.log.trace('close muxer'); - await muxer.close(options); - } - this.log.trace('close maconn'); - // close the underlying transport - await maConn.close(options); - this.log.trace('closed maconn'); - }, - abort: (err) => { - maConn.abort(err); - // Ensure remaining streams are aborted - if (muxer != null) { - muxer.abort(err); - } - } - }); - this.events.safeDispatchEvent('connection:open', { - detail: connection - }); - return connection; - } - /** - * Routes incoming streams to the correct handler - */ - _onStream(opts) { - const { connection, stream, protocol } = opts; - const { handler, options } = this.components.registrar.getHandler(protocol); - if (connection.transient && options.runOnTransientConnection !== true) { - throw new CodeError('Cannot open protocol stream on transient connection', 'ERR_TRANSIENT_CONNECTION'); - } - handler({ connection, stream }); - } - /** - * Attempts to encrypt the incoming `connection` with the provided `cryptos` - */ - async _encryptInbound(connection) { - const protocols = Array.from(this.connectionEncryption.keys()); - this.log('handling inbound crypto protocol selection', protocols); - try { - const { stream, protocol } = await mss.handle(connection, protocols, { - log: connection.log - }); - const encrypter = this.connectionEncryption.get(protocol); - if (encrypter == null) { - throw new Error(`no crypto module found for ${protocol}`); - } - this.log('encrypting inbound connection using', protocol); - return { - ...await encrypter.secureInbound(this.components.peerId, stream), - protocol - }; - } - catch (err) { - throw new CodeError(String(err), codes.ERR_ENCRYPTION_FAILED); - } - } - /** - * Attempts to encrypt the given `connection` with the provided connection encrypters. - * The first `ConnectionEncrypter` module to succeed will be used - */ - async _encryptOutbound(connection, remotePeerId) { - const protocols = Array.from(this.connectionEncryption.keys()); - this.log('selecting outbound crypto protocol', protocols); - try { - connection.log.trace('selecting encrypter from %s', protocols); - const { stream, protocol } = await mss.select(connection, protocols, { - log: connection.log, - yieldBytes: true - }); - const encrypter = this.connectionEncryption.get(protocol); - if (encrypter == null) { - throw new Error(`no crypto module found for ${protocol}`); - } - connection.log('encrypting outbound connection to %p using %p', remotePeerId); - return { - ...await encrypter.secureOutbound(this.components.peerId, stream, remotePeerId), - protocol - }; - } - catch (err) { - throw new CodeError(String(err), codes.ERR_ENCRYPTION_FAILED); - } - } - /** - * Selects one of the given muxers via multistream-select. That - * muxer will be used for all future streams on the connection. - */ - async _multiplexOutbound(connection, muxers) { - const protocols = Array.from(muxers.keys()); - this.log('outbound selecting muxer %s', protocols); - try { - connection.log.trace('selecting stream muxer from %s', protocols); - const { stream, protocol } = await mss.select(connection, protocols, { - log: connection.log, - yieldBytes: true - }); - connection.log('selected %s as muxer protocol', protocol); - const muxerFactory = muxers.get(protocol); - return { stream, muxerFactory }; - } - catch (err) { - connection.log.error('error multiplexing outbound stream', err); - throw new CodeError(String(err), codes.ERR_MUXER_UNAVAILABLE); - } - } - /** - * Registers support for one of the given muxers via multistream-select. The - * selected muxer will be used for all future streams on the connection. - */ - async _multiplexInbound(connection, muxers) { - const protocols = Array.from(muxers.keys()); - this.log('inbound handling muxers %s', protocols); - try { - const { stream, protocol } = await mss.handle(connection, protocols, { - log: connection.log - }); - const muxerFactory = muxers.get(protocol); - return { stream, muxerFactory }; - } - catch (err) { - this.log.error('error multiplexing inbound stream', err); - throw new CodeError(String(err), codes.ERR_MUXER_UNAVAILABLE); - } - } -} -//# sourceMappingURL=upgrader.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/upgrader.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/upgrader.js.map deleted file mode 100644 index 5228dfbd9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/upgrader.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"upgrader.js","sourceRoot":"","sources":["../../src/upgrader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,GAAG,MAAM,4BAA4B,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAA;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAc1F,MAAM,+BAA+B,GAAG,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AG,CAAC,4BAA4B,EAAE,SAAS,CAAC,CAAA;QACjD,IAAI;YACF,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,EAAE;gBACnE,GAAG,EAAE,UAAU,CAAC,GAAG;aACpB,CAAC,CAAA;YACF,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YAEzC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAA;SAChC;QAAC,OAAO,GAAQ,EAAE;YACjB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,mCAAmC,EAAE,GAAG,CAAC,CAAA;YACxD,MAAM,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAA;SAC9D;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/version.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/version.d.ts deleted file mode 100644 index d5e48250d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/version.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const version = "0.0.0"; -export declare const name = "libp2p"; -//# sourceMappingURL=version.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/version.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/version.d.ts.map deleted file mode 100644 index 42cde27b6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/version.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAA;AAC9B,eAAO,MAAM,IAAI,WAAW,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/version.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/version.js deleted file mode 100644 index b68fea07c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/version.js +++ /dev/null @@ -1,3 +0,0 @@ -export const version = '0.0.0'; -export const name = 'libp2p'; -//# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/version.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/version.js.map deleted file mode 100644 index 7a06ad10a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/src/version.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAA;AAC9B,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/address-manager.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/address-manager.spec.d.ts deleted file mode 100644 index 985b1d198..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/address-manager.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=address-manager.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/address-manager.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/address-manager.spec.d.ts.map deleted file mode 100644 index ac1f6fc23..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/address-manager.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address-manager.spec.d.ts","sourceRoot":"","sources":["../../../test/addresses/address-manager.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/address-manager.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/address-manager.spec.js deleted file mode 100644 index 4b06d2ddd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/address-manager.spec.js +++ /dev/null @@ -1,193 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { defaultLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import delay from 'delay'; -import Sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { DefaultAddressManager } from '../../src/address-manager/index.js'; -const listenAddresses = ['/ip4/127.0.0.1/tcp/15006/ws', '/ip4/127.0.0.1/tcp/15008/ws']; -const announceAddreses = ['/dns4/peer.io']; -describe('Address Manager', () => { - let peerId; - let peerStore; - let events; - beforeEach(async () => { - peerId = await createEd25519PeerId(); - peerStore = stubInterface({ - patch: Sinon.stub().resolves({}) - }); - events = new TypedEventEmitter(); - }); - it('should not need any addresses', () => { - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface() - }); - expect(am.getListenAddrs()).to.be.empty(); - expect(am.getAnnounceAddrs()).to.be.empty(); - }); - it('should return listen multiaddrs on get', () => { - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface(), - listen: listenAddresses - }); - expect(am.getListenAddrs()).to.have.lengthOf(listenAddresses.length); - expect(am.getAnnounceAddrs()).to.be.empty(); - const listenMultiaddrs = am.getListenAddrs(); - expect(listenMultiaddrs.length).to.equal(2); - expect(listenMultiaddrs[0].equals(multiaddr(listenAddresses[0]))).to.equal(true); - expect(listenMultiaddrs[1].equals(multiaddr(listenAddresses[1]))).to.equal(true); - }); - it('should return announce multiaddrs on get', () => { - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface(), - listen: listenAddresses, - announce: announceAddreses - }); - expect(am.getListenAddrs()).to.have.lengthOf(listenAddresses.length); - expect(am.getAnnounceAddrs()).to.have.lengthOf(announceAddreses.length); - const announceMultiaddrs = am.getAnnounceAddrs(); - expect(announceMultiaddrs.length).to.equal(1); - expect(announceMultiaddrs[0].equals(multiaddr(announceAddreses[0]))).to.equal(true); - }); - it('should add observed addresses', () => { - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface() - }); - expect(am.getObservedAddrs()).to.be.empty(); - am.addObservedAddr(multiaddr('/ip4/123.123.123.123/tcp/39201')); - expect(am.getObservedAddrs()).to.have.lengthOf(1); - }); - it('should allow duplicate listen addresses', () => { - const ma = multiaddr('/ip4/0.0.0.0/tcp/0'); - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface(), - listen: [ - ma.toString(), - ma.toString() - ] - }); - expect(am.getListenAddrs()).to.deep.equal([ - ma, - ma - ]); - }); - it('should dedupe added observed addresses', () => { - const ma = multiaddr('/ip4/123.123.123.123/tcp/39201'); - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface() - }); - expect(am.getObservedAddrs()).to.be.empty(); - am.addObservedAddr(ma); - am.addObservedAddr(ma); - am.addObservedAddr(ma); - expect(am.getObservedAddrs()).to.have.lengthOf(1); - expect(am.getObservedAddrs().map(ma => ma.toString())).to.include(ma.toString()); - }); - it('should only set addresses once', async () => { - const ma = '/ip4/123.123.123.123/tcp/39201'; - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface({ - getAddrs: Sinon.stub().returns([]) - }), - peerStore, - events, - logger: defaultLogger() - }); - am.confirmObservedAddr(multiaddr(ma)); - am.confirmObservedAddr(multiaddr(ma)); - am.confirmObservedAddr(multiaddr(ma)); - am.confirmObservedAddr(multiaddr(`${ma.toString()}/p2p/${peerId.toString()}`)); - // wait for address manager _updatePeerStoreAddresses debounce - await delay(1500); - expect(peerStore.patch).to.have.property('callCount', 1); - }); - it('should strip our peer address from added observed addresses', () => { - const ma = multiaddr('/ip4/123.123.123.123/tcp/39201'); - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }); - expect(am.getObservedAddrs()).to.be.empty(); - am.addObservedAddr(ma); - am.addObservedAddr(multiaddr(`${ma.toString()}/p2p/${peerId.toString()}`)); - expect(am.getObservedAddrs()).to.have.lengthOf(1); - expect(am.getObservedAddrs().map(ma => ma.toString())).to.include(ma.toString()); - }); - it('should strip our peer address from added observed addresses in difference formats', () => { - const ma = multiaddr('/ip4/123.123.123.123/tcp/39201'); - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }); - expect(am.getObservedAddrs()).to.be.empty(); - am.addObservedAddr(ma); - am.addObservedAddr(multiaddr(`${ma.toString()}/p2p/${peerId.toString()}`)); - expect(am.getObservedAddrs()).to.have.lengthOf(1); - expect(am.getObservedAddrs().map(ma => ma.toString())).to.include(ma.toString()); - }); - it('should not add our peer id to path multiaddrs', () => { - const ma = '/unix/foo/bar/baz'; - const transportManager = stubInterface(); - const am = new DefaultAddressManager({ - peerId, - transportManager, - peerStore, - events, - logger: defaultLogger() - }, { - listen: [ma], - announce: [] - }); - transportManager.getAddrs.returns([multiaddr(ma)]); - const addrs = am.getAddresses(); - expect(addrs).to.have.lengthOf(1); - expect(addrs[0].toString()).to.not.include(`/p2p/${peerId.toString()}`); - }); -}); -//# sourceMappingURL=address-manager.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/address-manager.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/address-manager.spec.js.map deleted file mode 100644 index af28232b9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/address-manager.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address-manager.spec.js","sourceRoot":"","sources":["../../../test/addresses/address-manager.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,iBAAiB,EAAyB,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAwB,aAAa,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAsB,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAM9F,MAAM,eAAe,GAAG,CAAC,6BAA6B,EAAE,6BAA6B,CAAC,CAAA;AACtF,MAAM,gBAAgB,GAA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G,EAAE;QACvD,MAAM,EAAE,GAAG,mBAAmB,CAAA;QAC9B,MAAM,gBAAgB,GAAG,aAAa,EAAoB,CAAA;QAC1D,MAAM,EAAE,GAAG,IAAI,qBAAqB,CAAC;YACnC,MAAM;YACN,gBAAgB;YAChB,SAAS;YACT,MAAM;YACN,MAAM,EAAE,aAAa,EAAE;SACxB,EAAE;YACD,MAAM,EAAE,CAAC,EAAE,CAAC;YACZ,QAAQ,EAAE,EAAE;SACb,CAAC,CAAA;QAEF,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;QAElD,MAAM,KAAK,GAAG,EAAE,CAAC,YAAY,EAAE,CAAA;QAC/B,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;QACjC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;IACzE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/addresses.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/addresses.node.d.ts deleted file mode 100644 index 8e88d60d9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/addresses.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=addresses.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/addresses.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/addresses.node.d.ts.map deleted file mode 100644 index de6ec2bd2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/addresses.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"addresses.node.d.ts","sourceRoot":"","sources":["../../../test/addresses/addresses.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/addresses.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/addresses.node.js deleted file mode 100644 index f263de103..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/addresses.node.js +++ /dev/null @@ -1,214 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { isLoopback } from '@libp2p/utils/multiaddr/is-loopback'; -import { webSockets } from '@libp2p/websockets'; -import { multiaddr, protocols } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { pEvent } from 'p-event'; -import sinon from 'sinon'; -import { createNode } from '../fixtures/creators/peer.js'; -import { AddressesOptions } from './utils.js'; -const listenAddresses = ['/ip4/127.0.0.1/tcp/0', '/ip4/127.0.0.1/tcp/8000/ws']; -const announceAddreses = ['/dns4/peer.io/tcp/433/p2p/12D3KooWNvSZnPi3RrhrTwEY4LuuBeB6K6facKUCJcyWG1aoDd2p']; -describe('libp2p.addressManager', () => { - let libp2p; - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('should keep listen addresses after start, even if changed', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses, - announce: announceAddreses - } - } - }); - let listenAddrs = libp2p.components.addressManager.getListenAddrs().map(ma => ma.toString()); - expect(listenAddrs).to.have.lengthOf(listenAddresses.length); - expect(listenAddrs).to.include(listenAddresses[0]); - expect(listenAddrs).to.include(listenAddresses[1]); - // Should not replace listen addresses after transport listen - // Only transportManager has visibility of the port used - await libp2p.start(); - listenAddrs = libp2p.components.addressManager.getListenAddrs().map(ma => ma.toString()); - expect(listenAddrs).to.have.lengthOf(listenAddresses.length); - expect(listenAddrs).to.include(listenAddresses[0]); - expect(listenAddrs).to.include(listenAddresses[1]); - }); - it('should announce transport listen addresses if announce addresses are not provided', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses - } - } - }); - await libp2p.start(); - const tmListen = libp2p.components.transportManager.getAddrs().map((ma) => ma.toString()); - // Announce 2 listen (transport) - const advertiseMultiaddrs = libp2p.components.addressManager.getAddresses().map((ma) => ma.decapsulateCode(protocols('p2p').code).toString()); - expect(advertiseMultiaddrs).to.have.lengthOf(2); - tmListen.forEach((m) => { - expect(advertiseMultiaddrs).to.include(m); - }); - expect(advertiseMultiaddrs).to.not.include(listenAddresses[0]); // Random Port switch - }); - it('should only announce the given announce addresses when provided', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses, - announce: announceAddreses - } - } - }); - await libp2p.start(); - const tmListen = libp2p.components.transportManager.getAddrs().map((ma) => ma.toString()); - // Announce 1 announce addr - const advertiseMultiaddrs = libp2p.components.addressManager.getAddresses().map((ma) => ma.decapsulateCode(protocols('p2p').code).toString()); - expect(advertiseMultiaddrs.length).to.equal(announceAddreses.length); - advertiseMultiaddrs.forEach((m) => { - expect(tmListen).to.not.include(m); - expect(announceAddreses).to.include(m); - }); - }); - it('can filter out loopback addresses by the announce filter', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses, - announceFilter: (multiaddrs) => multiaddrs.filter(m => !isLoopback(m)) - } - } - }); - await libp2p.start(); - expect(libp2p.components.addressManager.getAddresses()).to.have.lengthOf(0); - // Stub transportManager addresses to add a public address - const stubMa = multiaddr('/ip4/120.220.10.1/tcp/1000'); - sinon.stub(libp2p.components.transportManager, 'getAddrs').returns([ - ...listenAddresses.map((a) => multiaddr(a)), - stubMa - ]); - const multiaddrs = libp2p.components.addressManager.getAddresses(); - expect(multiaddrs.length).to.equal(1); - expect(multiaddrs[0].decapsulateCode(protocols('p2p').code).equals(stubMa)).to.eql(true); - }); - it('can filter out loopback addresses to announced by the announce filter', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses, - announce: announceAddreses, - announceFilter: (multiaddrs) => multiaddrs.filter(m => !isLoopback(m)) - } - } - }); - const listenAddrs = libp2p.components.addressManager.getListenAddrs().map((ma) => ma.toString()); - expect(listenAddrs).to.have.lengthOf(listenAddresses.length); - expect(listenAddrs).to.include(listenAddresses[0]); - expect(listenAddrs).to.include(listenAddresses[1]); - await libp2p.start(); - const loopbackAddrs = libp2p.components.addressManager.getAddresses().filter(ma => isLoopback(ma)); - expect(loopbackAddrs).to.be.empty(); - }); - it('should include observed addresses in returned multiaddrs', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses - } - } - }); - const ma = '/ip4/83.32.123.53/tcp/43928'; - await libp2p.start(); - expect(libp2p.components.addressManager.getAddresses()).to.have.lengthOf(listenAddresses.length); - libp2p.components.addressManager.confirmObservedAddr(multiaddr(ma)); - expect(libp2p.components.addressManager.getAddresses()).to.have.lengthOf(listenAddresses.length + 1); - expect(libp2p.components.addressManager.getAddresses().map(ma => ma.decapsulateCode(protocols('p2p').code).toString())).to.include(ma); - }); - it('should populate the AddressManager from the config', async () => { - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: listenAddresses, - announce: announceAddreses - }, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - } - }); - expect(libp2p.getMultiaddrs().map(ma => ma.decapsulateCode(protocols('p2p').code).toString())).to.have.members(announceAddreses); - expect(libp2p.getMultiaddrs().map(ma => ma.decapsulateCode(protocols('p2p').code).toString())).to.not.have.members(listenAddresses); - }); - it('should update our peer record with announce addresses on startup', async () => { - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: listenAddresses, - announce: announceAddreses - }, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - } - }); - const eventPromise = pEvent(libp2p, 'self:peer:update'); - await libp2p.start(); - const event = await eventPromise; - expect(event.detail.peer.addresses.map(({ multiaddr }) => multiaddr.toString())) - .to.include.members(announceAddreses, 'peer info did not include announce addresses'); - }); - it('should only include confirmed observed addresses in peer record', async () => { - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: listenAddresses, - announce: announceAddreses - }, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - } - }); - await libp2p.start(); - const eventPromise = pEvent(libp2p, 'self:peer:update'); - const unconfirmedAddress = multiaddr('/ip4/127.0.0.1/tcp/4010/ws'); - libp2p.components.addressManager.addObservedAddr(unconfirmedAddress); - const confirmedAddress = multiaddr('/ip4/127.0.0.1/tcp/4011/ws'); - libp2p.components.addressManager.confirmObservedAddr(confirmedAddress); - const event = await eventPromise; - expect(event.detail.peer.addresses.map(({ multiaddr }) => multiaddr.toString())) - .to.not.include(unconfirmedAddress.toString(), 'peer info included unconfirmed observed address'); - expect(event.detail.peer.addresses.map(({ multiaddr }) => multiaddr.toString())) - .to.include(confirmedAddress.toString(), 'peer info did not include confirmed observed address'); - }); -}); -//# sourceMappingURL=addresses.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/addresses.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/addresses.node.js.map deleted file mode 100644 index 7452a01a9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/addresses.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"addresses.node.js","sourceRoot":"","sources":["../../../test/addres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Y,CAAA;QAEhC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;aAC7E,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,QAAQ,EAAE,EAAE,iDAAiD,CAAC,CAAA;QAEnG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;aAC7E,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,EAAE,sDAAsD,CAAC,CAAA;IACpG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/utils.d.ts deleted file mode 100644 index fe756c845..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/utils.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const AddressesOptions: import("../../src/index.js").Libp2pOptions>; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/utils.d.ts.map deleted file mode 100644 index 887bb9fda..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../test/addresses/utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,qEAK3B,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/utils.js deleted file mode 100644 index 5329e4337..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/utils.js +++ /dev/null @@ -1,10 +0,0 @@ -import { tcp } from '@libp2p/tcp'; -import { webSockets } from '@libp2p/websockets'; -import { createBaseOptions } from '../fixtures/base-options.js'; -export const AddressesOptions = createBaseOptions({ - transports: [ - tcp(), - webSockets() - ] -}); -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/utils.js.map deleted file mode 100644 index d4fc62356..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/addresses/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../test/addresses/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAE/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;IAChD,UAAU,EAAE;QACV,GAAG,EAAE;QACL,UAAU,EAAE;KACb;CACF,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts deleted file mode 100644 index ce6da4870..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=auto-dial.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts.map deleted file mode 100644 index fe1b08ef2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auto-dial.spec.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/auto-dial.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.js deleted file mode 100644 index 721a8f1c9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.js +++ /dev/null @@ -1,254 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { defaultLogger } from '@libp2p/logger'; -import { PeerMap } from '@libp2p/peer-collections'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core'; -import delay from 'delay'; -import pWaitFor from 'p-wait-for'; -import Sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { defaultComponents } from '../../src/components.js'; -import { AutoDial } from '../../src/connection-manager/auto-dial.js'; -import { LAST_DIAL_FAILURE_KEY } from '../../src/connection-manager/constants.js'; -import { matchPeerId } from '../fixtures/match-peer-id.js'; -describe('auto-dial', () => { - let autoDialer; - let events; - let peerStore; - let peerId; - beforeEach(async () => { - peerId = await createEd25519PeerId(); - events = new TypedEventEmitter(); - peerStore = new PersistentPeerStore({ - datastore: new MemoryDatastore(), - events, - peerId, - logger: defaultLogger() - }); - }); - afterEach(() => { - if (autoDialer != null) { - autoDialer.stop(); - } - }); - it('should not dial peers without multiaddrs', async () => { - // peers with protocols are dialled before peers without protocols - const peerWithAddress = { - id: await createEd25519PeerId(), - protocols: [ - '/foo/bar' - ], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - const peerWithoutAddress = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [], - metadata: new Map(), - tags: new Map() - }; - await peerStore.save(peerWithAddress.id, peerWithAddress); - await peerStore.save(peerWithoutAddress.id, peerWithoutAddress); - const connectionManager = stubInterface({ - getConnectionsMap: Sinon.stub().returns(new PeerMap()), - getDialQueue: Sinon.stub().returns([]) - }); - autoDialer = new AutoDial(defaultComponents({ - peerStore, - connectionManager, - events - }), { - minConnections: 10, - autoDialInterval: 10000 - }); - autoDialer.start(); - void autoDialer.autoDial(); - await pWaitFor(() => { - return connectionManager.openConnection.callCount === 1; - }); - await delay(1000); - expect(connectionManager.openConnection.callCount).to.equal(1); - expect(connectionManager.openConnection.calledWith(matchPeerId(peerWithAddress.id))).to.be.true(); - expect(connectionManager.openConnection.calledWith(matchPeerId(peerWithoutAddress.id))).to.be.false(); - }); - it('should not dial connected peers', async () => { - const connectedPeer = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - const unConnectedPeer = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4002'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - await peerStore.save(connectedPeer.id, connectedPeer); - await peerStore.save(unConnectedPeer.id, unConnectedPeer); - const connectionMap = new PeerMap(); - connectionMap.set(connectedPeer.id, [stubInterface()]); - const connectionManager = stubInterface({ - getConnectionsMap: Sinon.stub().returns(connectionMap), - getDialQueue: Sinon.stub().returns([]) - }); - autoDialer = new AutoDial(defaultComponents({ - peerStore, - connectionManager, - events - }), { - minConnections: 10 - }); - autoDialer.start(); - await autoDialer.autoDial(); - await pWaitFor(() => connectionManager.openConnection.callCount === 1); - await delay(1000); - expect(connectionManager.openConnection.callCount).to.equal(1); - expect(connectionManager.openConnection.calledWith(matchPeerId(unConnectedPeer.id))).to.be.true(); - expect(connectionManager.openConnection.calledWith(matchPeerId(connectedPeer.id))).to.be.false(); - }); - it('should not dial peers already in the dial queue', async () => { - // peers with protocols are dialled before peers without protocols - const peerInDialQueue = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - const peerNotInDialQueue = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4002'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - await peerStore.save(peerInDialQueue.id, peerInDialQueue); - await peerStore.save(peerNotInDialQueue.id, peerNotInDialQueue); - const connectionManager = stubInterface({ - getConnectionsMap: Sinon.stub().returns(new PeerMap()), - getDialQueue: Sinon.stub().returns([{ - id: 'foo', - peerId: peerInDialQueue.id, - multiaddrs: [], - status: 'queued' - }]) - }); - autoDialer = new AutoDial(defaultComponents({ - peerStore, - connectionManager, - events - }), { - minConnections: 10 - }); - autoDialer.start(); - await autoDialer.autoDial(); - await pWaitFor(() => connectionManager.openConnection.callCount === 1); - await delay(1000); - expect(connectionManager.openConnection.callCount).to.equal(1); - expect(connectionManager.openConnection.calledWith(matchPeerId(peerNotInDialQueue.id))).to.be.true(); - expect(connectionManager.openConnection.calledWith(matchPeerId(peerInDialQueue.id))).to.be.false(); - }); - it('should not start parallel autodials', async () => { - const peerStoreAllSpy = Sinon.spy(peerStore, 'all'); - const connectionManager = stubInterface({ - getConnectionsMap: Sinon.stub().returns(new PeerMap()), - getDialQueue: Sinon.stub().returns([]) - }); - autoDialer = new AutoDial(defaultComponents({ - peerStore, - connectionManager, - events - }), { - minConnections: 10, - autoDialInterval: 10000 - }); - autoDialer.start(); - // call autodial twice - await Promise.all([ - autoDialer.autoDial(), - autoDialer.autoDial() - ]); - // should only have queried peer store once - expect(peerStoreAllSpy.callCount).to.equal(1); - }); - it('should not re-dial peers we have recently failed to dial', async () => { - const peerWithAddress = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - const undialablePeer = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4002'), - isCertified: true - }], - // we failed to dial them recently - metadata: new Map([[LAST_DIAL_FAILURE_KEY, uint8ArrayFromString(`${Date.now() - 10}`)]]), - tags: new Map() - }; - await peerStore.save(peerWithAddress.id, peerWithAddress); - await peerStore.save(undialablePeer.id, undialablePeer); - const connectionManager = stubInterface({ - getConnectionsMap: Sinon.stub().returns(new PeerMap()), - getDialQueue: Sinon.stub().returns([]) - }); - autoDialer = new AutoDial(defaultComponents({ - peerStore, - connectionManager, - events - }), { - minConnections: 10, - autoDialPeerRetryThreshold: 2000 - }); - autoDialer.start(); - void autoDialer.autoDial(); - await pWaitFor(() => { - return connectionManager.openConnection.callCount === 1; - }); - expect(connectionManager.openConnection.callCount).to.equal(1); - expect(connectionManager.openConnection.calledWith(matchPeerId(peerWithAddress.id))).to.be.true(); - expect(connectionManager.openConnection.calledWith(matchPeerId(undialablePeer.id))).to.be.false(); - // pass the retry threshold - await delay(2000); - // autodial again - void autoDialer.autoDial(); - await pWaitFor(() => { - return connectionManager.openConnection.callCount === 3; - }); - // should have retried the unreachable peer - expect(connectionManager.openConnection.calledWith(matchPeerId(undialablePeer.id))).to.be.true(); - }); -}); -//# sourceMappingURL=auto-dial.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.js.map deleted file mode 100644 index 9f6f42597..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/auto-dial.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auto-dial.spec.js","sourceRoot":"","sources":["../../../test/connection-manager/auto-dial.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,iBAAiB,EAAyB,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,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v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts deleted file mode 100644 index 9a6ef4706..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=dial-queue.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts.map deleted file mode 100644 index a7f5a2683..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dial-queue.spec.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/dial-queue.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.js deleted file mode 100644 index 34f8adb10..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.js +++ /dev/null @@ -1,218 +0,0 @@ -/* eslint-env mocha */ -import { mockConnection, mockDuplex, mockMultiaddrConnection } from '@libp2p/interface-compliance-tests/mocks'; -import { peerLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { multiaddr, resolvers } from '@multiformats/multiaddr'; -import { WebRTC } from '@multiformats/multiaddr-matcher'; -import { expect } from 'aegir/chai'; -import delay from 'delay'; -import pDefer from 'p-defer'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { DialQueue } from '../../src/connection-manager/dial-queue.js'; -describe('dial queue', () => { - let components; - let dialer; - beforeEach(async () => { - const peerId = await createEd25519PeerId(); - components = { - peerId, - peerStore: stubInterface(), - transportManager: stubInterface(), - connectionGater: stubInterface(), - logger: peerLogger(peerId) - }; - }); - afterEach(() => { - if (dialer != null) { - dialer.stop(); - } - sinon.reset(); - }); - it('should end when a single multiaddr dials succeeds', async () => { - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), await createEd25519PeerId())); - const deferredConn = pDefer(); - const actions = { - '/ip4/127.0.0.1/tcp/1231': async () => Promise.reject(new Error('dial failure')), - '/ip4/127.0.0.1/tcp/1232': async () => Promise.resolve(connection), - '/ip4/127.0.0.1/tcp/1233': async () => deferredConn.promise - }; - components.transportManager.transportForMultiaddr.returns(stubInterface()); - components.transportManager.dial.callsFake(async (ma) => { - const maStr = ma.toString(); - const action = actions[maStr]; - if (action != null) { - return action(); - } - throw new Error(`No action found for multiaddr ${maStr}`); - }); - dialer = new DialQueue(components, { - maxParallelDials: 2 - }); - // Make sure that dial attempt comes back before terminating last dial action - await expect(dialer.dial(Object.keys(actions).map(str => multiaddr(str)))) - .to.eventually.equal(connection); - // End third dial attempt - deferredConn.resolve(); - // prevent playwright-core error Error: Cannot find parent object page@... to create handle@... - await expect(deferredConn.promise).to.eventually.be.undefined(); - }); - it('should end when a single multiaddr dials succeeds even when a final dial fails', async () => { - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), await createEd25519PeerId())); - const deferredConn = pDefer(); - const actions = { - '/ip4/127.0.0.1/tcp/1231': async () => Promise.reject(new Error('dial failure')), - '/ip4/127.0.0.1/tcp/1232': async () => Promise.resolve(connection), - '/ip4/127.0.0.1/tcp/1233': async () => deferredConn.promise - }; - components.transportManager.transportForMultiaddr.returns(stubInterface()); - components.transportManager.dial.callsFake(async (ma) => { - const maStr = ma.toString(); - const action = actions[maStr]; - if (action != null) { - return action(); - } - throw new Error(`No action found for multiaddr ${maStr}`); - }); - dialer = new DialQueue(components, { - maxParallelDials: 2 - }); - // Make sure that dial attempt comes back before terminating last dial action - await expect(dialer.dial(Object.keys(actions).map(str => multiaddr(str)))) - .to.eventually.equal(connection); - // End third dial attempt - deferredConn.reject(new Error('Oh noes!')); - // prevent playwright-core error Error: Cannot find parent object page@... to create handle@... - await expect(deferredConn.promise).to.eventually.be.rejected(); - }); - it('should throw an AggregateError if all dials fail', async () => { - const actions = { - '/ip4/127.0.0.1/tcp/1231': async () => Promise.reject(new Error('dial failure')), - '/ip4/127.0.0.1/tcp/1232': async () => Promise.reject(new Error('dial failure')), - '/ip4/127.0.0.1/tcp/1233': async () => Promise.reject(new Error('dial failure')) - }; - dialer = new DialQueue(components, { - maxParallelDials: 2 - }); - components.transportManager.transportForMultiaddr.returns(stubInterface()); - components.transportManager.dial.callsFake(async (ma) => { - const maStr = ma.toString(); - const action = actions[maStr]; - if (action != null) { - return action(); - } - throw new Error(`No action found for multiaddr ${maStr}`); - }); - sinon.spy(actions, '/ip4/127.0.0.1/tcp/1231'); - sinon.spy(actions, '/ip4/127.0.0.1/tcp/1232'); - sinon.spy(actions, '/ip4/127.0.0.1/tcp/1233'); - try { - await dialer.dial(Object.keys(actions).map(str => multiaddr(str))); - expect.fail('Should have thrown'); - } - catch (err) { - expect(err).to.have.property('name', 'AggregateError'); - } - expect(actions['/ip4/127.0.0.1/tcp/1231']).to.have.property('callCount', 1); - expect(actions['/ip4/127.0.0.1/tcp/1232']).to.have.property('callCount', 1); - expect(actions['/ip4/127.0.0.1/tcp/1233']).to.have.property('callCount', 1); - }); - it('should handle a large number of addrs', async () => { - const reject = sinon.stub().callsFake(async () => Promise.reject(new Error('dial failure'))); - const actions = {}; - const addrs = [...new Array(25)].map((_, index) => `/ip4/127.0.0.1/tcp/12${index + 1}`); - addrs.forEach(addr => { - actions[addr] = reject; - }); - dialer = new DialQueue(components, { - maxParallelDials: 2 - }); - components.transportManager.transportForMultiaddr.returns(stubInterface()); - components.transportManager.dial.callsFake(async (ma) => { - const maStr = ma.toString(); - const action = actions[maStr]; - if (action != null) { - return action(); - } - throw new Error(`No action found for multiaddr ${maStr}`); - }); - try { - await dialer.dial(Object.keys(actions).map(str => multiaddr(str))); - expect.fail('Should have thrown'); - } - catch (err) { - expect(err).to.have.property('name', 'AggregateError'); - } - expect(reject).to.have.property('callCount', addrs.length); - }); - it('should ignore DNS addresses for other peers', async () => { - const remotePeer = await createEd25519PeerId(); - const otherRemotePeer = await createEd25519PeerId(); - const ma = multiaddr(`/dnsaddr/example.com/p2p/${remotePeer}`); - const maStr = `/ip4/123.123.123.123/tcp/2348/p2p/${remotePeer}`; - const resolvedAddresses = [ - `/ip4/234.234.234.234/tcp/4213/p2p/${otherRemotePeer}`, - maStr - ]; - let resolvedDNSAddrs = false; - let dialedBadAddress = false; - // simulate a DNSAddr that resolves to multiple different peers like - // bootstrap.libp2p.io - resolvers.set('dnsaddr', async (addr) => { - if (addr.equals(ma)) { - resolvedDNSAddrs = true; - return resolvedAddresses; - } - return []; - }); - dialer = new DialQueue(components, { - maxParallelDials: 50 - }); - components.transportManager.transportForMultiaddr.returns(stubInterface()); - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeer)); - components.transportManager.dial.callsFake(async (ma, opts = {}) => { - if (ma.toString() === maStr) { - await delay(100); - return connection; - } - dialedBadAddress = true; - throw new Error('Could not dial address'); - }); - await expect(dialer.dial(ma)).to.eventually.equal(connection); - expect(resolvedDNSAddrs).to.be.true('Did not resolve DNSAddrs'); - expect(dialedBadAddress).to.be.false('Dialed address with wrong peer id'); - resolvers.delete('dnsaddr'); - }); - it('should dial WebRTC address with peer id appended', async () => { - const remotePeer = await createEd25519PeerId(); - const relayPeer = await createEd25519PeerId(); - const ma = multiaddr(`/ip4/123.123.123.123/tcp/123/ws/p2p/${relayPeer}/p2p-circuit/webrtc`); - const maWithPeer = `${ma}/p2p/${remotePeer}`; - components.transportManager.transportForMultiaddr.callsFake(ma => { - if (WebRTC.exactMatch(ma)) { - return stubInterface(); - } - }); - components.peerStore.get.withArgs(remotePeer).resolves({ - id: remotePeer, - protocols: [], - metadata: new Map(), - tags: new Map(), - addresses: [{ - multiaddr: ma, - isCertified: true - }] - }); - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeer)); - components.transportManager.dial.callsFake(async (ma, opts = {}) => { - if (ma.toString() === maWithPeer) { - await delay(100); - return connection; - } - throw new Error('Could not dial address'); - }); - dialer = new DialQueue(components); - await expect(dialer.dial(remotePeer)).to.eventually.equal(connection); - }); -}); -//# sourceMappingURL=dial-queue.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.js.map deleted file mode 100644 index 2b79846f3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/dial-queue.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dial-queue.spec.js","sourceRoot":"","sources":["../../../test/connection-manager/dial-queue.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAA;AAC9G,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;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AE,IAAI,GAAG,EAAE,EAAE,EAAE;YACjE,IAAI,EAAE,CAAC,QAAQ,EAAE,KAAK,UAAU,EAAE;gBAChC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;gBAChB,OAAO,UAAU,CAAA;aAClB;YAED,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;QAC3C,CAAC,CAAC,CAAA;QAEF,MAAM,GAAG,IAAI,SAAS,CAAC,UAAU,CAAC,CAAA;QAClC,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;IACvE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.node.d.ts deleted file mode 100644 index bf3a5d6de..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=direct.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.node.d.ts.map deleted file mode 100644 index 2626222c7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"direct.node.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/direct.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.node.js deleted file mode 100644 index 52332f6f5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.node.js +++ /dev/null @@ -1,544 +0,0 @@ -/* eslint-env mocha */ -import fs from 'node:fs'; -import os from 'node:os'; -import path from 'node:path'; -import { yamux } from '@chainsafe/libp2p-yamux'; -import { isConnection } from '@libp2p/interface/connection'; -import { AbortError, ERR_TIMEOUT } from '@libp2p/interface/errors'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { start, stop } from '@libp2p/interface/startable'; -import { mockConnection, mockConnectionGater, mockDuplex, mockMultiaddrConnection, mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { mplex } from '@libp2p/mplex'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { plaintext } from '@libp2p/plaintext'; -import { tcp } from '@libp2p/tcp'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core/memory'; -import delay from 'delay'; -import { pipe } from 'it-pipe'; -import { pushable } from 'it-pushable'; -import pWaitFor from 'p-wait-for'; -import Sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { DefaultAddressManager } from '../../src/address-manager/index.js'; -import { defaultComponents } from '../../src/components.js'; -import { DialQueue } from '../../src/connection-manager/dial-queue.js'; -import { DefaultConnectionManager } from '../../src/connection-manager/index.js'; -import { codes as ErrorCodes } from '../../src/errors.js'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { DefaultTransportManager } from '../../src/transport-manager.js'; -import { ECHO_PROTOCOL, echo } from '../fixtures/echo-service.js'; -const listenAddr = multiaddr('/ip4/127.0.0.1/tcp/0'); -const unsupportedAddr = multiaddr('/ip4/127.0.0.1/tcp/9999/ws/p2p/QmckxVrJw1Yo8LqvmDJNUmdAsKtSbiKWmrXJFyKmUraBoN'); -describe('dialing (direct, TCP)', () => { - let remoteTM; - let localTM; - let remoteAddr; - let remoteComponents; - let localComponents; - let resolver; - beforeEach(async () => { - resolver = Sinon.stub(); - const [localPeerId, remotePeerId] = await Promise.all([ - createEd25519PeerId(), - createEd25519PeerId() - ]); - const remoteEvents = new TypedEventEmitter(); - remoteComponents = defaultComponents({ - peerId: remotePeerId, - events: remoteEvents, - datastore: new MemoryDatastore(), - upgrader: mockUpgrader({ events: remoteEvents }), - connectionGater: mockConnectionGater(), - transportManager: stubInterface({ - getAddrs: Sinon.stub().returns([]) - }) - }); - remoteComponents.peerStore = new PersistentPeerStore(remoteComponents); - remoteComponents.addressManager = new DefaultAddressManager(remoteComponents, { - listen: [ - listenAddr.toString() - ] - }); - remoteTM = remoteComponents.transportManager = new DefaultTransportManager(remoteComponents); - remoteTM.add(tcp()({ - logger: defaultLogger() - })); - const localEvents = new TypedEventEmitter(); - localComponents = defaultComponents({ - peerId: localPeerId, - events: localEvents, - datastore: new MemoryDatastore(), - upgrader: mockUpgrader({ events: localEvents }), - transportManager: stubInterface(), - connectionGater: mockConnectionGater() - }); - localComponents.peerStore = new PersistentPeerStore(localComponents); - localComponents.connectionManager = new DefaultConnectionManager(localComponents, { - maxConnections: 100, - minConnections: 50, - inboundUpgradeTimeout: 1000 - }); - localComponents.addressManager = new DefaultAddressManager(localComponents); - localTM = localComponents.transportManager = new DefaultTransportManager(localComponents); - localTM.add(tcp()({ - logger: defaultLogger() - })); - await start(localComponents); - await start(remoteComponents); - remoteAddr = remoteTM.getAddrs()[0].encapsulate(`/p2p/${remotePeerId.toString()}`); - }); - afterEach(async () => { - await stop(localComponents); - await stop(remoteComponents); - }); - afterEach(() => { - Sinon.restore(); - }); - it('should be able to connect to a remote node via its multiaddr', async () => { - const dialer = new DialQueue(localComponents); - const connection = await dialer.dial(remoteAddr); - expect(connection).to.exist(); - await connection.close(); - }); - it('should be able to connect to remote node with duplicated addresses', async () => { - const remotePeer = peerIdFromString(remoteAddr.getPeerId() ?? ''); - const dnsaddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remotePeer}`); - await localComponents.peerStore.merge(remotePeer, { - multiaddrs: [ - dnsaddr - ] - }); - const dialer = new DialQueue(localComponents, { - resolvers: { - dnsaddr: resolver - }, - maxParallelDials: 1 - }); - // Resolver stub - resolver.withArgs(dnsaddr).resolves([remoteAddr.toString()]); - const connection = await dialer.dial(remotePeer); - expect(connection).to.exist(); - await connection.close(); - }); - it('should fail to connect to an unsupported multiaddr', async () => { - const dialer = new DialQueue(localComponents); - await expect(dialer.dial(unsupportedAddr)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('should fail to connect if peer has no known addresses', async () => { - const dialer = new DialQueue(localComponents); - const peerId = await createEd25519PeerId(); - await expect(dialer.dial(peerId)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('should be able to connect to a given peer id', async () => { - await localComponents.peerStore.patch(remoteComponents.peerId, { - multiaddrs: remoteTM.getAddrs() - }); - const dialer = new DialQueue(localComponents); - const connection = await dialer.dial(remoteComponents.peerId); - expect(connection).to.exist(); - await connection.close(); - }); - it('should fail to connect to a given peer with unsupported addresses', async () => { - await localComponents.peerStore.patch(remoteComponents.peerId, { - multiaddrs: [unsupportedAddr] - }); - const dialer = new DialQueue(localComponents); - await expect(dialer.dial(remoteComponents.peerId)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('should only try to connect to addresses supported by the transports configured', async () => { - const remoteAddrs = remoteTM.getAddrs(); - const peerId = await createEd25519PeerId(); - await localComponents.peerStore.patch(peerId, { - multiaddrs: [...remoteAddrs, unsupportedAddr] - }); - const dialer = new DialQueue(localComponents); - Sinon.spy(localTM, 'dial'); - const connection = await dialer.dial(peerId); - expect(localTM.dial).to.have.property('callCount', remoteAddrs.length); - expect(connection).to.exist(); - await connection.close(); - }); - it('should abort dials on queue task timeout', async () => { - const dialer = new DialQueue(localComponents, { - dialTimeout: 50 - }); - Sinon.stub(localTM, 'dial').callsFake(async (addr, options = {}) => { - expect(options.signal).to.exist(); - expect(options.signal?.aborted).to.equal(false); - expect(addr.toString()).to.eql(remoteAddr.toString()); - await delay(60); - expect(options.signal?.aborted).to.equal(true); - throw new AbortError(); - }); - await expect(dialer.dial(remoteAddr)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.property('code', ERR_TIMEOUT); - }); - it('should only dial to the max concurrency', async () => { - const peerId1 = await createEd25519PeerId(); - const peerId2 = await createEd25519PeerId(); - const peerId3 = await createEd25519PeerId(); - const addr1 = multiaddr(`/ip4/127.0.0.1/tcp/1234/p2p/${peerId1}`); - const addr2 = multiaddr(`/ip4/127.0.12.4/tcp/3210/p2p/${peerId2}`); - const addr3 = multiaddr(`/ip4/123.3.11.1/tcp/2010/p2p/${peerId3}`); - const slowDial = async () => { - await delay(100); - return mockConnection(mockMultiaddrConnection(mockDuplex(), peerId1)); - }; - const actions = { - [addr1.toString()]: slowDial, - [addr2.toString()]: slowDial, - [addr3.toString()]: async () => mockConnection(mockMultiaddrConnection(mockDuplex(), peerId3)) - }; - const dialer = new DialQueue(localComponents, { - maxParallelDials: 2 - }); - const transportManagerDialStub = Sinon.stub(localTM, 'dial'); - transportManagerDialStub.callsFake(async (ma) => { - const maStr = ma.toString(); - const action = actions[maStr]; - if (action != null) { - return action(); - } - throw new Error(`No action found for multiaddr ${maStr}`); - }); - // dial 3 different peers - void Promise.all([ - dialer.dial(addr1), - dialer.dial(addr2), - dialer.dial(addr3) - ]); - // Let the call stack run - await delay(0); - // We should have 2 in progress, and 1 waiting - expect(transportManagerDialStub).to.have.property('callCount', 2); - // stop dials - dialer.stop(); - }); -}); -describe('libp2p.dialer (direct, TCP)', () => { - let peerId; - let remotePeerId; - let libp2p; - let remoteLibp2p; - let remoteAddr; - beforeEach(async () => { - [peerId, remotePeerId] = await Promise.all([ - createEd25519PeerId(), - createEd25519PeerId() - ]); - remoteLibp2p = await createLibp2pNode({ - peerId: remotePeerId, - addresses: { - listen: [listenAddr.toString()] - }, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - echo: echo() - } - }); - await remoteLibp2p.start(); - remoteAddr = remoteLibp2p.getMultiaddrs()[0]; - }); - afterEach(async () => { - Sinon.restore(); - if (libp2p != null) { - await libp2p.stop(); - } - if (remoteLibp2p != null) { - await remoteLibp2p.stop(); - } - }); - it('should use the dialer for connecting to a peer', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - await libp2p.peerStore.patch(remotePeerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - const connection = await libp2p.dial(remotePeerId); - expect(connection).to.exist(); - const stream = await connection.newStream(ECHO_PROTOCOL); - expect(stream).to.exist(); - expect(stream).to.have.property('protocol', ECHO_PROTOCOL); - await connection.close(); - }); - it('should close all streams when the connection closes', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - // register some stream handlers to simulate several protocols - await libp2p.handle('/stream-count/1', ({ stream }) => { - void pipe(stream, stream); - }); - await libp2p.handle('/stream-count/2', ({ stream }) => { - void pipe(stream, stream); - }); - await remoteLibp2p.handle('/stream-count/3', ({ stream }) => { - void pipe(stream, stream); - }); - await remoteLibp2p.handle('/stream-count/4', ({ stream }) => { - void pipe(stream, stream); - }); - const connection = await libp2p.dial(remoteLibp2p.getMultiaddrs()); - // Create local to remote streams - const stream = await connection.newStream([ECHO_PROTOCOL, '/other/1.0.0']); - await connection.newStream('/stream-count/3'); - await libp2p.dialProtocol(remoteLibp2p.peerId, '/stream-count/4'); - // Partially write to the echo stream - const source = pushable(); - void stream.sink(source); - source.push(uint8ArrayFromString('hello')); - // Create remote to local streams - await remoteLibp2p.dialProtocol(libp2p.peerId, ['/stream-count/1', '/other/1.0.0']); - await remoteLibp2p.dialProtocol(libp2p.peerId, ['/stream-count/2', '/other/1.0.0']); - // Verify stream count - const remoteConn = remoteLibp2p.getConnections(libp2p.peerId); - if (remoteConn == null) { - throw new Error('No remote connection found'); - } - expect(connection.streams).to.have.length(5); - expect(remoteConn).to.have.lengthOf(1); - expect(remoteConn).to.have.nested.property('[0].streams').with.lengthOf(5); - // Close the connection and verify all streams have been closed - await connection.close(); - await pWaitFor(() => connection.streams.length === 0); - await pWaitFor(() => remoteConn[0].streams.length === 0); - }); - it('should throw when using dialProtocol with no protocols', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - // @ts-expect-error invalid params - await expect(libp2p.dialProtocol(remoteAddr)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.property('code', ErrorCodes.ERR_INVALID_PROTOCOLS_FOR_STREAM); - await expect(libp2p.dialProtocol(remoteAddr, [])) - .to.eventually.be.rejectedWith(Error) - .and.to.have.property('code', ErrorCodes.ERR_INVALID_PROTOCOLS_FOR_STREAM); - }); - it('should be able to use hangup to close connections', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - const connection = await libp2p.dial(remoteAddr); - expect(connection).to.exist(); - expect(connection.timeline.close).to.not.exist(); - await libp2p.hangUp(connection.remotePeer); - expect(connection.timeline.close).to.exist(); - }); - it('should use the protectors when provided for connecting', async () => { - const protector = { - async protect(connection) { - return connection; - } - }; - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionProtector: () => protector - }); - const protectorProtectSpy = Sinon.spy(protector, 'protect'); - await libp2p.start(); - const connection = await libp2p.dial(remoteAddr); - expect(connection).to.exist(); - const stream = await connection.newStream(ECHO_PROTOCOL); - expect(stream).to.exist(); - expect(stream).to.have.property('protocol', ECHO_PROTOCOL); - await connection.close(); - expect(protectorProtectSpy.callCount).to.equal(1); - }); - it('should coalesce parallel dials to the same peer (id in multiaddr)', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - const dials = 10; - // PeerId should be in multiaddr - expect(remoteAddr.getPeerId()).to.equal(remoteLibp2p.peerId.toString()); - await libp2p.peerStore.patch(remotePeerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - const dialResults = await Promise.all([...new Array(dials)].map(async (_, index) => { - if (index % 2 === 0) - return libp2p.dial(remoteLibp2p.peerId); - return libp2p.dial(remoteAddr); - })); - // All should succeed and we should have ten results - expect(dialResults).to.have.length(10); - for (const connection of dialResults) { - expect(isConnection(connection)).to.equal(true); - } - // 1 connection, because we know the peer in the multiaddr - expect(libp2p.getConnections()).to.have.lengthOf(1); - expect(remoteLibp2p.getConnections()).to.have.lengthOf(1); - }); - it('should coalesce parallel dials to the same error on failure', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - const dials = 10; - const error = new Error('Boom'); - Sinon.stub(libp2p.components.transportManager, 'dial').callsFake(async () => Promise.reject(error)); - await libp2p.peerStore.patch(remotePeerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - const dialResults = await Promise.allSettled([...new Array(dials)].map(async (_, index) => { - if (index % 2 === 0) - return libp2p.dial(remoteLibp2p.peerId); - return libp2p.dial(remoteAddr); - })); - // All should succeed and we should have ten results - expect(dialResults).to.have.length(10); - for (const result of dialResults) { - // All errors should be the exact same as `error` - expect(result).to.have.property('status', 'rejected'); - expect(result).to.have.property('reason', error); - } - // 1 connection, because we know the peer in the multiaddr - expect(libp2p.getConnections()).to.have.lengthOf(0); - expect(remoteLibp2p.getConnections()).to.have.lengthOf(0); - }); - it('should dial a unix socket', async () => { - if (os.platform() === 'win32') { - return; - } - if (remoteLibp2p != null) { - await remoteLibp2p.stop(); - } - const unixAddr = path.join(os.tmpdir(), `test-${Math.random()}.sock`); - const unixMultiaddr = multiaddr('/unix' + unixAddr); - remoteLibp2p = await createLibp2pNode({ - peerId: remotePeerId, - addresses: { - listen: [ - unixMultiaddr.toString() - ] - }, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await remoteLibp2p.start(); - expect(fs.existsSync(unixAddr)).to.be.true(); - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - const connection = await libp2p.dial(unixMultiaddr); - expect(connection.remotePeer.toString()).to.equal(remotePeerId.toString()); - }); -}); -//# sourceMappingURL=direct.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.node.js.map deleted file mode 100644 index e0168e929..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.node.js.map +++ /dev/null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AE1B,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QAE5C,MAAM,GAAG,MAAM,gBAAgB,CAAC;YAC9B,MAAM;YACN,UAAU,EAAE;gBACV,GAAG,EAAE;aACN;YACD,YAAY,EAAE;gBACZ,KAAK,EAAE;gBACP,KAAK,EAAE;aACR;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;QAEpB,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QAEnD,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC5E,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.spec.d.ts deleted file mode 100644 index bd766c5f7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=direct.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.spec.d.ts.map deleted file mode 100644 index 45ebfd5e7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"direct.spec.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/direct.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.spec.js deleted file mode 100644 index dd509b936..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.spec.js +++ /dev/null @@ -1,420 +0,0 @@ -/* eslint-env mocha */ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { identify } from '@libp2p/identify'; -import { AbortError, ERR_TIMEOUT } from '@libp2p/interface/errors'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockConnectionGater, mockDuplex, mockMultiaddrConnection, mockUpgrader, mockConnection } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { mplex } from '@libp2p/mplex'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { plaintext } from '@libp2p/plaintext'; -import { defaultAddressSort } from '@libp2p/utils/address-sort'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core/memory'; -import delay from 'delay'; -import pDefer from 'p-defer'; -import { pEvent } from 'p-event'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { defaultComponents } from '../../src/components.js'; -import { LAST_DIAL_FAILURE_KEY } from '../../src/connection-manager/constants.js'; -import { DefaultConnectionManager } from '../../src/connection-manager/index.js'; -import { codes as ErrorCodes } from '../../src/errors.js'; -import { createLibp2p } from '../../src/index.js'; -import { DefaultTransportManager } from '../../src/transport-manager.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -const unsupportedAddr = multiaddr('/ip4/127.0.0.1/tcp/9999'); -const relayMultiaddr = multiaddr(process.env.RELAY_MULTIADDR); -describe('dialing (direct, WebSockets)', () => { - let localTM; - let localComponents; - let remoteAddr; - let remoteComponents; - let connectionManager; - beforeEach(async () => { - const localEvents = new TypedEventEmitter(); - localComponents = defaultComponents({ - peerId: await createEd25519PeerId(), - datastore: new MemoryDatastore(), - upgrader: mockUpgrader({ events: localEvents }), - connectionGater: mockConnectionGater(), - transportManager: stubInterface(), - events: localEvents - }); - localComponents.peerStore = new PersistentPeerStore(localComponents, { - addressFilter: localComponents.connectionGater.filterMultiaddrForPeer - }); - localComponents.connectionManager = new DefaultConnectionManager(localComponents, { - maxConnections: 100, - minConnections: 50, - inboundUpgradeTimeout: 1000 - }); - localTM = new DefaultTransportManager(localComponents); - localTM.add(webSockets({ filter: filters.all })({ - logger: defaultLogger() - })); - localComponents.transportManager = localTM; - // this peer is spun up in .aegir.cjs - remoteAddr = relayMultiaddr; - remoteComponents = defaultComponents({ - peerId: peerIdFromString(remoteAddr.getPeerId() ?? '') - }); - }); - afterEach(async () => { - sinon.restore(); - if (connectionManager != null) { - await connectionManager.stop(); - } - }); - it('should be able to connect to a remote node via its multiaddr', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - const remotePeerId = peerIdFromString(remoteAddr.getPeerId() ?? ''); - await localComponents.peerStore.patch(remotePeerId, { - multiaddrs: [remoteAddr] - }); - const connection = await connectionManager.openConnection(remoteAddr); - expect(connection).to.exist(); - await connection.close(); - }); - it('should fail to connect to an unsupported multiaddr', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - await expect(connectionManager.openConnection(unsupportedAddr.encapsulate(`/p2p/${remoteComponents.peerId.toString()}`))) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('should mark a peer as having recently failed to connect', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - await expect(connectionManager.openConnection(multiaddr(`/ip4/127.0.0.1/tcp/12984/ws/p2p/${remoteComponents.peerId.toString()}`))) - .to.eventually.be.rejected(); - const peer = await localComponents.peerStore.get(remoteComponents.peerId); - expect(peer.metadata.has(LAST_DIAL_FAILURE_KEY)).to.be.true(); - }); - it('should be able to connect to a given peer', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - const remotePeerId = peerIdFromString(remoteAddr.getPeerId() ?? ''); - await localComponents.peerStore.patch(remotePeerId, { - multiaddrs: [remoteAddr] - }); - const connection = await connectionManager.openConnection(remotePeerId); - expect(connection).to.exist(); - await connection.close(); - }); - it('should fail to connect to a given peer with unsupported addresses', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - const remotePeerId = peerIdFromString(remoteAddr.getPeerId() ?? ''); - await localComponents.peerStore.patch(remotePeerId, { - multiaddrs: [unsupportedAddr] - }); - await expect(connectionManager.openConnection(remotePeerId)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('should abort dials on queue task timeout', async () => { - connectionManager = new DefaultConnectionManager(localComponents, { - dialTimeout: 50 - }); - await connectionManager.start(); - const remotePeerId = peerIdFromString(remoteAddr.getPeerId() ?? ''); - await localComponents.peerStore.patch(remotePeerId, { - multiaddrs: [remoteAddr] - }); - sinon.stub(localTM, 'dial').callsFake(async (addr, options) => { - expect(options.signal).to.exist(); - expect(options.signal.aborted).to.equal(false); - expect(addr.toString()).to.eql(remoteAddr.toString()); - await delay(60); - expect(options.signal.aborted).to.equal(true); - throw new AbortError(); - }); - await expect(connectionManager.openConnection(remoteAddr)) - .to.eventually.be.rejected() - .and.to.have.property('code', ERR_TIMEOUT); - }); - it('should throw when a peer advertises more than the allowed number of addresses', async () => { - connectionManager = new DefaultConnectionManager(localComponents, { - maxPeerAddrsToDial: 10 - }); - await connectionManager.start(); - const remotePeerId = peerIdFromString(remoteAddr.getPeerId() ?? ''); - await localComponents.peerStore.patch(remotePeerId, { - multiaddrs: Array.from({ length: 11 }, (_, i) => multiaddr(`/ip4/127.0.0.1/tcp/1500${i}/ws/p2p/${remotePeerId.toString()}`)) - }); - await expect(connectionManager.openConnection(remotePeerId)) - .to.eventually.be.rejected() - .and.to.have.property('code', ErrorCodes.ERR_TOO_MANY_ADDRESSES); - }); - it('should sort addresses on dial', async () => { - const peerMultiaddrs = [ - multiaddr('/ip4/127.0.0.1/tcp/15001/ws'), - multiaddr('/ip4/20.0.0.1/tcp/15001/ws'), - multiaddr('/ip4/30.0.0.1/tcp/15001/ws') - ]; - const addressesSorttSpy = sinon.spy(defaultAddressSort); - const localTMDialStub = sinon.stub(localTM, 'dial').callsFake(async (ma) => mockConnection(mockMultiaddrConnection(mockDuplex(), remoteComponents.peerId))); - connectionManager = new DefaultConnectionManager(localComponents, { - addressSorter: addressesSorttSpy, - maxParallelDials: 3 - }); - await connectionManager.start(); - // Inject data into the AddressBook - await localComponents.peerStore.merge(remoteComponents.peerId, { - multiaddrs: peerMultiaddrs - }); - // Perform 3 multiaddr dials - await connectionManager.openConnection(remoteComponents.peerId); - const sortedAddresses = peerMultiaddrs - .map((m) => ({ multiaddr: m, isCertified: false })) - .sort(defaultAddressSort); - expect(localTMDialStub.getCall(0).args[0].equals(sortedAddresses[0].multiaddr)); - }); - it('shutting down should abort pending dials', async () => { - const addrs = [ - multiaddr('/ip4/0.0.0.0/tcp/8000/ws'), - multiaddr('/ip4/0.0.0.0/tcp/8001/ws'), - multiaddr('/ip4/0.0.0.0/tcp/8002/ws') - ]; - connectionManager = new DefaultConnectionManager(localComponents, { - maxParallelDials: 2 - }); - await connectionManager.start(); - // Inject data into the AddressBook - await localComponents.peerStore.merge(remoteComponents.peerId, { - multiaddrs: addrs - }); - sinon.stub(localTM, 'dial').callsFake(async (_, options) => { - const deferredDial = pDefer(); - const onAbort = () => { - options.signal.removeEventListener('abort', onAbort); - deferredDial.reject(new AbortError()); - }; - options.signal.addEventListener('abort', onAbort); - return deferredDial.promise; - }); - // Perform 3 multiaddr dials - const dialPromise = connectionManager.openConnection(remoteComponents.peerId); - // Let the call stack run - await delay(0); - try { - await connectionManager.stop(); - await dialPromise; - expect.fail('should have failed'); - } - catch { - expect(connectionManager.getDialQueue()).to.have.lengthOf(0); // 0 dial requests - } - }); - it('should dial only the multiaddr that is passed', async () => { - const addrs = [ - multiaddr(`/ip4/0.0.0.0/tcp/8000/ws/p2p/${remoteComponents.peerId.toString()}`), - multiaddr(`/ip4/0.0.0.0/tcp/8001/ws/p2p/${remoteComponents.peerId.toString()}`), - multiaddr(`/ip4/0.0.0.0/tcp/8002/ws/p2p/${remoteComponents.peerId.toString()}`) - ]; - // Inject data into the AddressBook - await localComponents.peerStore.merge(remoteComponents.peerId, { - multiaddrs: addrs - }); - // different address not in the address book, same peer id - const dialMultiaddr = multiaddr(`/ip4/0.0.0.0/tcp/8003/ws/p2p/${remoteComponents.peerId.toString()}`); - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - const transactionManagerDialStub = sinon.stub(localTM, 'dial'); - transactionManagerDialStub.callsFake(async (ma) => mockConnection(mockMultiaddrConnection(mockDuplex(), remoteComponents.peerId))); - // Perform dial - await connectionManager.openConnection(dialMultiaddr); - expect(transactionManagerDialStub).to.have.property('callCount', 1); - expect(transactionManagerDialStub.getCall(0).args[0].toString()).to.equal(dialMultiaddr.toString()); - }); - it('should throw if dialling an empty array is attempted', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - // Perform dial - await expect(connectionManager.openConnection([])).to.eventually.rejected - .with.property('code', 'ERR_NO_VALID_ADDRESSES'); - }); - it('should throw if dialling multiaddrs with mismatched peer ids', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - // Perform dial - await expect(connectionManager.openConnection([ - multiaddr(`/ip4/0.0.0.0/tcp/8000/ws/p2p/${(await createPeerId()).toString()}`), - multiaddr(`/ip4/0.0.0.0/tcp/8001/ws/p2p/${(await createPeerId()).toString()}`) - ])).to.eventually.rejected - .with.property('code', 'ERR_INVALID_PARAMETERS'); - }); - it('should throw if dialling multiaddrs with inconsistent peer ids', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - // Perform dial - await expect(connectionManager.openConnection([ - multiaddr(`/ip4/0.0.0.0/tcp/8000/ws/p2p/${(await createPeerId()).toString()}`), - multiaddr('/ip4/0.0.0.0/tcp/8001/ws') - ])).to.eventually.rejected - .with.property('code', 'ERR_INVALID_PARAMETERS'); - // Perform dial - await expect(connectionManager.openConnection([ - multiaddr('/ip4/0.0.0.0/tcp/8001/ws'), - multiaddr(`/ip4/0.0.0.0/tcp/8000/ws/p2p/${(await createPeerId()).toString()}`) - ])).to.eventually.rejected - .with.property('code', 'ERR_INVALID_PARAMETERS'); - }); -}); -describe('libp2p.dialer (direct, WebSockets)', () => { - let libp2p; - let peerId; - beforeEach(async () => { - peerId = await createPeerId(); - }); - afterEach(async () => { - sinon.restore(); - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('should run identify automatically after connecting', async () => { - libp2p = await createLibp2p({ - peerId, - transports: [ - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - identify: identify() - }, - connectionGater: mockConnectionGater() - }); - if (libp2p.services.identify == null) { - throw new Error('Identify service missing'); - } - const identifySpy = sinon.spy(libp2p.services.identify, 'identify'); - const peerStorePatchSpy = sinon.spy(libp2p.peerStore, 'patch'); - const connectionPromise = pEvent(libp2p, 'connection:open'); - await libp2p.start(); - const connection = await libp2p.dial(relayMultiaddr); - expect(connection).to.exist(); - // Wait for connection event to be emitted - await connectionPromise; - expect(identifySpy.callCount).to.equal(1); - await identifySpy.firstCall.returnValue; - expect(peerStorePatchSpy.callCount).to.equal(1); - await libp2p.stop(); - }); - it('should not run identify automatically after connecting', async () => { - libp2p = await createLibp2p({ - peerId, - transports: [ - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - plaintext() - ], - services: { - identify: identify({ - runOnConnectionOpen: false - }) - }, - connectionGater: mockConnectionGater() - }); - if (libp2p.services.identify == null) { - throw new Error('Identify service missing'); - } - const identifySpy = sinon.spy(libp2p.services.identify, 'identify'); - const connectionPromise = pEvent(libp2p, 'connection:open'); - await libp2p.start(); - const connection = await libp2p.dial(relayMultiaddr); - expect(connection).to.exist(); - // Wait for connection event to be emitted - await connectionPromise; - expect(identifySpy.callCount).to.equal(0); - await libp2p.stop(); - }); - it('should be able to use hangup to close connections', async () => { - libp2p = await createLibp2p({ - peerId, - transports: [ - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }); - await libp2p.start(); - const connection = await libp2p.dial(relayMultiaddr); - expect(connection).to.exist(); - expect(connection.timeline.close).to.not.exist(); - await libp2p.hangUp(connection.remotePeer); - expect(connection.timeline.close).to.exist(); - await libp2p.stop(); - }); - it('should be able to use hangup when no connection exists', async () => { - libp2p = await createLibp2p({ - peerId, - transports: [ - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }); - await libp2p.hangUp(relayMultiaddr); - }); - it('should fail to dial self', async () => { - libp2p = await createLibp2p({ - peerId, - transports: [ - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }); - await libp2p.start(); - await expect(libp2p.dial(multiaddr(`/ip4/127.0.0.1/tcp/1234/ws/p2p/${peerId.toString()}`))) - .to.eventually.be.rejected() - .and.to.have.property('code', ErrorCodes.ERR_DIALED_SELF); - }); -}); -//# sourceMappingURL=direct.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.spec.js.map deleted file mode 100644 index 527cd2c3d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/direct.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"direct.spec.js","sourceRoot":"","sources":["../../../test/connection-manager/direct.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAiB,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,uBAAuB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAA;AACjJ,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAA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ACD,eAAe,EAAE,mBAAmB,EAAE;SACvC,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;QAEpB,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,kCAAkC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;aACxF,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE;aAC3B,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,eAAe,CAAC,CAAA;IAC7D,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.node.d.ts deleted file mode 100644 index 95867294f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.node.d.ts.map deleted file mode 100644 index 5b7c5c52c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/index.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.node.js deleted file mode 100644 index 7bdc7f4d0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.node.js +++ /dev/null @@ -1,540 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { start } from '@libp2p/interface/startable'; -import { mockConnection, mockDuplex, mockMultiaddrConnection } from '@libp2p/interface-compliance-tests/mocks'; -import { expect } from 'aegir/chai'; -import delay from 'delay'; -import all from 'it-all'; -import { pipe } from 'it-pipe'; -import pWaitFor from 'p-wait-for'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { defaultComponents } from '../../src/components.js'; -import { DefaultConnectionManager } from '../../src/connection-manager/index.js'; -import { codes } from '../../src/errors.js'; -import { createBaseOptions } from '../fixtures/base-options.browser.js'; -import { createNode, createPeerId } from '../fixtures/creators/peer.js'; -import { ECHO_PROTOCOL, echo } from '../fixtures/echo-service.js'; -describe('Connection Manager', () => { - let libp2p; - let peerIds; - before(async () => { - peerIds = await Promise.all([ - createPeerId(), - createPeerId() - ]); - }); - beforeEach(async () => { - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - } - }) - }); - }); - afterEach(async () => { - await libp2p.stop(); - }); - it('should filter connections on disconnect, removing the closed one', async () => { - const peerStore = stubInterface(); - const components = defaultComponents({ - peerId: peerIds[0], - peerStore, - transportManager: stubInterface(), - connectionGater: stubInterface(), - events: new TypedEventEmitter() - }); - const connectionManager = new DefaultConnectionManager(components, { - maxConnections: 1000, - minConnections: 50, - inboundUpgradeTimeout: 1000 - }); - await start(connectionManager); - const conn1 = mockConnection(mockMultiaddrConnection(mockDuplex(), peerIds[1])); - const conn2 = mockConnection(mockMultiaddrConnection(mockDuplex(), peerIds[1])); - expect(connectionManager.getConnections(peerIds[1])).to.have.lengthOf(0); - // Add connection to the connectionManager - components.events.safeDispatchEvent('connection:open', { detail: conn1 }); - components.events.safeDispatchEvent('connection:open', { detail: conn2 }); - expect(connectionManager.getConnections(peerIds[1])).to.have.lengthOf(2); - await conn2.close(); - components.events.safeDispatchEvent('connection:close', { detail: conn2 }); - expect(connectionManager.getConnections(peerIds[1])).to.have.lengthOf(1); - expect(conn1).to.have.nested.property('status', 'open'); - await connectionManager.stop(); - }); - it('should close connections on stop', async () => { - const peerStore = stubInterface(); - const components = defaultComponents({ - peerId: peerIds[0], - peerStore, - transportManager: stubInterface(), - connectionGater: stubInterface(), - events: new TypedEventEmitter() - }); - const connectionManager = new DefaultConnectionManager(components, { - maxConnections: 1000, - minConnections: 50, - inboundUpgradeTimeout: 1000 - }); - await start(connectionManager); - const conn1 = mockConnection(mockMultiaddrConnection(mockDuplex(), peerIds[1])); - const conn2 = mockConnection(mockMultiaddrConnection(mockDuplex(), peerIds[1])); - // Add connection to the connectionManager - components.events.safeDispatchEvent('connection:open', { detail: conn1 }); - components.events.safeDispatchEvent('connection:open', { detail: conn2 }); - expect(connectionManager.getConnections(peerIds[1])).to.have.lengthOf(2); - await connectionManager.stop(); - expect(connectionManager.getConnections(peerIds[1])).to.have.lengthOf(0); - }); -}); -describe('libp2p.connections', () => { - let peerIds; - let libp2p; - before(async () => { - peerIds = await Promise.all([ - createPeerId(), - createPeerId() - ]); - }); - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('libp2p.connections gets the connectionManager conns', async () => { - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/15003/ws'] - } - }) - }); - const remoteLibp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[1], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/15004/ws'] - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - const conn = await libp2p.dial(remoteLibp2p.peerId); - expect(conn).to.be.ok(); - expect(libp2p.getConnections()).to.have.lengthOf(1); - await libp2p.stop(); - await remoteLibp2p.stop(); - }); - describe('proactive connections', () => { - let libp2p; - let nodes = []; - beforeEach(async () => { - nodes = await Promise.all([ - createNode({ - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - } - } - }), - createNode({ - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - } - } - }) - ]); - }); - afterEach(async () => { - await Promise.all(nodes.map(async (node) => { await node.stop(); })); - if (libp2p != null) { - await libp2p.stop(); - } - sinon.reset(); - }); - it('should connect to all the peers stored in the PeerStore, if their number is below minConnections', async () => { - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionManager: { - minConnections: 3 - } - } - }); - // Populate PeerStore before starting - await libp2p.peerStore.patch(nodes[0].peerId, { - multiaddrs: nodes[0].getMultiaddrs() - }); - await libp2p.peerStore.patch(nodes[1].peerId, { - multiaddrs: nodes[1].getMultiaddrs() - }); - await libp2p.start(); - // Wait for peers to connect - await pWaitFor(() => libp2p.getConnections().length === 2); - await libp2p.stop(); - }); - it('should connect to all the peers stored in the PeerStore until reaching the minConnections', async () => { - const minConnections = 1; - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionManager: { - minConnections, - maxConnections: 1 - } - } - }); - // Populate PeerStore before starting - await libp2p.peerStore.patch(nodes[0].peerId, { - multiaddrs: nodes[0].getMultiaddrs() - }); - await libp2p.peerStore.patch(nodes[1].peerId, { - multiaddrs: nodes[1].getMultiaddrs() - }); - await libp2p.start(); - // Wait for peer to connect - await pWaitFor(() => libp2p.components.connectionManager.getConnections().length === minConnections); - // Wait more time to guarantee no other connection happened - await delay(200); - expect(libp2p.components.connectionManager.getConnections().length).to.eql(minConnections); - await libp2p.stop(); - }); - // flaky - it.skip('should connect to all the peers stored in the PeerStore until reaching the minConnections sorted', async () => { - const minConnections = 1; - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionManager: { - minConnections, - maxConnections: 1 - } - } - }); - // Populate PeerStore before starting - await libp2p.peerStore.patch(nodes[0].peerId, { - multiaddrs: nodes[0].getMultiaddrs() - }); - await libp2p.peerStore.patch(nodes[1].peerId, { - multiaddrs: nodes[1].getMultiaddrs(), - protocols: ['/protocol-min-conns'] - }); - await libp2p.start(); - // Wait for peer to connect - await pWaitFor(() => libp2p.components.connectionManager.getConnections().length === minConnections); - // Should have connected to the peer with protocols - expect(libp2p.components.connectionManager.getConnections(nodes[0].peerId)).to.be.empty(); - expect(libp2p.components.connectionManager.getConnections(nodes[1].peerId)).to.not.be.empty(); - await libp2p.stop(); - }); - it('should connect to peers in the PeerStore when a peer disconnected', async () => { - const minConnections = 1; - libp2p = await createNode({ - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionManager: { - minConnections - } - } - }); - // Populate PeerStore after starting (discovery) - await libp2p.peerStore.patch(nodes[0].peerId, { - multiaddrs: nodes[0].getMultiaddrs() - }); - // Wait for peer to connect - const conn = await libp2p.dial(nodes[0].peerId); - expect(libp2p.components.connectionManager.getConnections(nodes[0].peerId)).to.not.be.empty(); - await conn.close(); - // Closed - await pWaitFor(() => libp2p.components.connectionManager.getConnections().length === 0); - // Connected - await pWaitFor(() => libp2p.components.connectionManager.getConnections().length === 1); - expect(libp2p.components.connectionManager.getConnections(nodes[0].peerId)).to.not.be.empty(); - await libp2p.stop(); - }); - it('should be closed status once immediately stopping', async () => { - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/15003/ws'] - } - }) - }); - const remoteLibp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[1], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/15004/ws'] - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - await libp2p.dial(remoteLibp2p.peerId); - const conns = libp2p.components.connectionManager.getConnections(); - expect(conns.length).to.eql(1); - const conn = conns[0]; - await libp2p.stop(); - expect(conn.status).to.eql('closed'); - await remoteLibp2p.stop(); - }); - it('should open multiple connections when forced', async () => { - libp2p = await createNode({ - config: createBaseOptions({ - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - } - }) - }); - // connect once, should have one connection - await libp2p.components.connectionManager.openConnection(nodes[0].getMultiaddrs()); - expect(libp2p.components.connectionManager.getConnections()).to.have.lengthOf(1); - // connect twice, should still only have one connection - await libp2p.components.connectionManager.openConnection(nodes[0].getMultiaddrs(), { - force: false - }); - expect(libp2p.components.connectionManager.getConnections()).to.have.lengthOf(1); - // force connection, should have two connections now - await libp2p.components.connectionManager.openConnection(nodes[0].getMultiaddrs(), { - force: true - }); - expect(libp2p.components.connectionManager.getConnections()).to.have.lengthOf(2); - }); - }); - describe('connection gater', () => { - let libp2p; - let remoteLibp2p; - beforeEach(async () => { - remoteLibp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[1], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - services: { - echo: echo() - } - }) - }); - }); - afterEach(async () => { - if (remoteLibp2p != null) { - await remoteLibp2p.stop(); - } - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('intercept peer dial', async () => { - const denyDialPeer = sinon.stub().returns(true); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyDialPeer - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - await expect(libp2p.dial(remoteLibp2p.peerId)) - .to.eventually.be.rejected().with.property('code', codes.ERR_PEER_DIAL_INTERCEPTED); - }); - it('intercept addr dial', async () => { - const denyDialMultiaddr = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyDialMultiaddr - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - await libp2p.components.connectionManager.openConnection(remoteLibp2p.peerId); - for (const multiaddr of remoteLibp2p.getMultiaddrs()) { - expect(denyDialMultiaddr.calledWith(multiaddr)).to.be.true(); - } - }); - it('intercept multiaddr store', async () => { - const filterMultiaddrForPeer = sinon.stub().returns(true); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - filterMultiaddrForPeer - } - }) - }); - const fullMultiaddr = remoteLibp2p.getMultiaddrs()[0]; - await libp2p.peerStore.merge(remoteLibp2p.peerId, { - multiaddrs: [fullMultiaddr] - }); - expect(filterMultiaddrForPeer.callCount).to.equal(1); - const args = filterMultiaddrForPeer.getCall(0).args; - expect(args[0].toString()).to.equal(remoteLibp2p.peerId.toString()); - expect(args[1].toString()).to.equal(fullMultiaddr.toString()); - }); - it('intercept accept inbound connection', async () => { - const denyInboundConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyInboundConnection - } - }) - }); - await remoteLibp2p.peerStore.patch(libp2p.peerId, { - multiaddrs: libp2p.getMultiaddrs() - }); - await remoteLibp2p.dial(libp2p.peerId); - expect(denyInboundConnection.called).to.be.true(); - }); - it('intercept accept outbound connection', async () => { - const denyOutboundConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyOutboundConnection - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - await libp2p.dial(remoteLibp2p.peerId); - expect(denyOutboundConnection.called).to.be.true(); - }); - it('intercept inbound encrypted', async () => { - const denyInboundEncryptedConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyInboundEncryptedConnection - } - }) - }); - await remoteLibp2p.peerStore.patch(libp2p.peerId, { - multiaddrs: libp2p.getMultiaddrs() - }); - await remoteLibp2p.dial(libp2p.peerId); - expect(denyInboundEncryptedConnection.called).to.be.true(); - expect(denyInboundEncryptedConnection.getCall(0)).to.have.nested.property('args[0].multihash.digest').that.equalBytes(remoteLibp2p.peerId.multihash.digest); - }); - it('intercept outbound encrypted', async () => { - const denyOutboundEncryptedConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyOutboundEncryptedConnection - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - await libp2p.dial(remoteLibp2p.peerId); - expect(denyOutboundEncryptedConnection.called).to.be.true(); - expect(denyOutboundEncryptedConnection.getCall(0)).to.have.nested.property('args[0].multihash.digest').that.equalBytes(remoteLibp2p.peerId.multihash.digest); - }); - it('intercept inbound upgraded', async () => { - const denyInboundUpgradedConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyInboundUpgradedConnection - }, - services: { - echo: echo() - } - }) - }); - await remoteLibp2p.peerStore.patch(libp2p.peerId, { - multiaddrs: libp2p.getMultiaddrs() - }); - const connection = await remoteLibp2p.dial(libp2p.peerId); - const stream = await connection.newStream(ECHO_PROTOCOL); - const input = [Uint8Array.from([0])]; - const output = await pipe(input, stream, async (source) => all(source)); - expect(denyInboundUpgradedConnection.called).to.be.true(); - expect(denyInboundUpgradedConnection.getCall(0)).to.have.nested.property('args[0].multihash.digest').that.equalBytes(remoteLibp2p.peerId.multihash.digest); - expect(output.map(b => b.subarray())).to.deep.equal(input); - }); - it('intercept outbound upgraded', async () => { - const denyOutboundUpgradedConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyOutboundUpgradedConnection - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - const connection = await libp2p.dial(remoteLibp2p.peerId); - const stream = await connection.newStream(ECHO_PROTOCOL); - const input = [Uint8Array.from([0])]; - const output = await pipe(input, stream, async (source) => all(source)); - expect(denyOutboundUpgradedConnection.called).to.be.true(); - expect(denyOutboundUpgradedConnection.getCall(0)).to.have.nested.property('args[0].multihash.digest').that.equalBytes(remoteLibp2p.peerId.multihash.digest); - expect(output.map(b => b.subarray())).to.deep.equal(input); - }); - }); -}); -//# sourceMappingURL=index.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.node.js.map deleted file mode 100644 index 1d96b5d8e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.node.js","sourceRoot":"","sources":["../../../test/connection-manager/index.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO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AAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACpC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;YAEvE,MAAM,CAAC,8BAA8B,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;YAC1D,MAAM,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;YAC3J,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAC5D,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.spec.d.ts deleted file mode 100644 index b37c2d278..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.spec.d.ts.map deleted file mode 100644 index 2ed10ac80..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/index.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.spec.js deleted file mode 100644 index 3a90b5750..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.spec.js +++ /dev/null @@ -1,445 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { KEEP_ALIVE } from '@libp2p/interface/peer-store/tags'; -import { mockConnection, mockDuplex, mockMultiaddrConnection, mockMetrics } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { pEvent } from 'p-event'; -import pWaitFor from 'p-wait-for'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { DefaultConnectionManager } from '../../src/connection-manager/index.js'; -import { createBaseOptions } from '../fixtures/base-options.browser.js'; -import { createNode } from '../fixtures/creators/peer.js'; -const defaultOptions = { - maxConnections: 10, - minConnections: 1, - autoDialInterval: Infinity, - inboundUpgradeTimeout: 10000 -}; -function defaultComponents(peerId) { - return { - peerId, - peerStore: stubInterface(), - transportManager: stubInterface(), - connectionGater: stubInterface(), - events: new TypedEventEmitter(), - logger: defaultLogger() - }; -} -describe('Connection Manager', () => { - let libp2p; - let connectionManager; - afterEach(async () => { - sinon.restore(); - if (connectionManager != null) { - await connectionManager.stop(); - } - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('should be able to create without metrics', async () => { - libp2p = await createNode({ - config: createBaseOptions(), - started: false - }); - const spy = sinon.spy(libp2p.components.connectionManager, 'start'); - await libp2p.start(); - expect(spy).to.have.property('callCount', 1); - expect(libp2p.metrics).to.not.exist(); - }); - it('should be able to create with metrics', async () => { - libp2p = await createNode({ - config: createBaseOptions({ - metrics: mockMetrics() - }), - started: false - }); - const spy = sinon.spy(libp2p.components.connectionManager, 'start'); - await libp2p.start(); - expect(spy).to.have.property('callCount', 1); - expect(libp2p.metrics).to.exist(); - }); - it('should close connections with low tag values first', async () => { - const max = 5; - libp2p = await createNode({ - config: createBaseOptions({ - connectionManager: { - maxConnections: max, - minConnections: 2 - } - }), - started: false - }); - await libp2p.start(); - const connectionManager = libp2p.components.connectionManager; - const connectionManagerMaybePruneConnectionsSpy = sinon.spy(connectionManager.connectionPruner, 'maybePruneConnections'); - const spies = new Map(); - // wait for prune event - const eventPromise = pEvent(libp2p, 'connection:prune'); - // Add 1 connection too many - for (let i = 0; i < max + 1; i++) { - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), await createEd25519PeerId())); - const spy = sinon.spy(connection, 'close'); - const value = i * 10; - spies.set(value, spy); - await libp2p.peerStore.merge(connection.remotePeer, { - tags: { - 'test-tag': { - value - } - } - }); - libp2p.components.events.safeDispatchEvent('connection:open', { detail: connection }); - } - await eventPromise; - // get the lowest value - const lowest = Array.from(spies.keys()).sort((a, b) => { - if (a > b) { - return 1; - } - if (a < b) { - return -1; - } - return 0; - })[0]; - const lowestSpy = spies.get(lowest); - expect(connectionManagerMaybePruneConnectionsSpy.callCount).to.equal(6); - expect(lowestSpy).to.have.property('callCount', 1); - }); - it('should close shortest-lived connection if the tag values are equal', async () => { - const max = 5; - libp2p = await createNode({ - config: createBaseOptions({ - connectionManager: { - maxConnections: max, - minConnections: 2 - } - }), - started: false - }); - await libp2p.start(); - const connectionManager = libp2p.components.connectionManager; - const connectionManagerMaybePruneConnectionsSpy = sinon.spy(connectionManager.connectionPruner, 'maybePruneConnections'); - const spies = new Map(); - const eventPromise = pEvent(libp2p, 'connection:prune'); - const createConnection = async (value, open = Date.now(), peerTag = 'test-tag') => { - // #TODO: Mock the connection timeline to simulate an older connection - const connection = mockConnection(mockMultiaddrConnection({ ...mockDuplex(), timeline: { open } }, await createEd25519PeerId())); - const spy = sinon.spy(connection, 'close'); - // The lowest tag value will have the longest connection - spies.set(peerTag, spy); - await libp2p.peerStore.merge(connection.remotePeer, { - tags: { - [peerTag]: { - value - } - } - }); - libp2p.components.events.safeDispatchEvent('connection:open', { detail: connection }); - }; - // Create one short of enough connections to initiate pruning - for (let i = 1; i < max; i++) { - const value = i * 10; - await createConnection(value); - } - const value = 0 * 10; - // Add a connection with the lowest tag value BUT the longest lived connection - await createConnection(value, 18000, 'longest'); - // Add one more connection with the lowest tag value BUT the shortest-lived connection - await createConnection(value, Date.now(), 'shortest'); - // wait for prune event - await eventPromise; - // get the lowest tagged value, but this would be also the longest lived connection - const longestLivedWithLowestTagSpy = spies.get('longest'); - // Get lowest tagged connection but with a shorter-lived connection - const shortestLivedWithLowestTagSpy = spies.get('shortest'); - expect(connectionManagerMaybePruneConnectionsSpy.callCount).to.equal(6); - expect(longestLivedWithLowestTagSpy).to.have.property('callCount', 0); - expect(shortestLivedWithLowestTagSpy).to.have.property('callCount', 1); - }); - it('should not close connection that is on the allowlist when pruning', async () => { - const max = 2; - const remoteAddr = multiaddr('/ip4/83.13.55.32/tcp/59283'); - libp2p = await createNode({ - config: createBaseOptions({ - connectionManager: { - maxConnections: max, - minConnections: 0, - allow: [ - '/ip4/83.13.55.32' - ] - } - }), - started: false - }); - await libp2p.start(); - const connectionManager = libp2p.components.connectionManager; - const connectionManagerMaybePruneConnectionsSpy = sinon.spy(connectionManager.connectionPruner, 'maybePruneConnections'); - const spies = new Map(); - const eventPromise = pEvent(libp2p, 'connection:prune'); - // Max out connections - for (let i = 0; i < max; i++) { - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), await createEd25519PeerId())); - const spy = sinon.spy(connection, 'close'); - const value = (i + 1) * 10; - spies.set(value, spy); - await libp2p.peerStore.merge(connection.remotePeer, { - tags: { - 'test-tag': { - value - } - } - }); - libp2p.components.events.safeDispatchEvent('connection:open', { detail: connection }); - } - // an outbound connection is opened from an address in the allow list - const remotePeer = await createEd25519PeerId(); - const connection = mockConnection(mockMultiaddrConnection({ - remoteAddr, - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, remotePeer)); - const value = 0; - const spy = sinon.spy(connection, 'close'); - spies.set(value, spy); - // Tag that allowed peer with lowest value - await libp2p.peerStore.merge(connection.remotePeer, { - tags: { - 'test-tag': { - value - } - } - }); - libp2p.components.events.safeDispatchEvent('connection:open', { detail: connection }); - // wait for prune event - await eventPromise; - // get the lowest value - const lowest = Array.from(spies.keys()).sort((a, b) => { - if (a > b) { - return 1; - } - if (a < b) { - return -1; - } - return 0; - })[0]; - const lowestSpy = spies.get(lowest); - expect(connectionManagerMaybePruneConnectionsSpy.callCount).to.equal(3); - // expect lowest value spy NOT to be called since the peer is in the allow list - expect(lowestSpy).to.have.property('callCount', 0); - }); - it('should close connection when the maximum connections has been reached even without tags', async () => { - const max = 5; - libp2p = await createNode({ - config: createBaseOptions({ - connectionManager: { - maxConnections: max, - minConnections: 0 - } - }), - started: false - }); - await libp2p.start(); - const connectionManager = libp2p.components.connectionManager; - const connectionManagerMaybePruneConnectionsSpy = sinon.spy(connectionManager.connectionPruner, 'maybePruneConnections'); - const eventPromise = pEvent(libp2p, 'connection:prune'); - // Add 1 too many connections - const spy = sinon.spy(); - for (let i = 0; i < max + 1; i++) { - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), await createEd25519PeerId())); - sinon.stub(connection, 'close').callsFake(async () => spy()); // eslint-disable-line - libp2p.components.events.safeDispatchEvent('connection:open', { detail: connection }); - } - // wait for prune event - await eventPromise; - expect(connectionManagerMaybePruneConnectionsSpy.callCount).to.equal(6); - expect(spy).to.have.property('callCount', 1); - }); - it('should fail if the connection manager has mismatched connection limit options', async () => { - await expect(createNode({ - config: createBaseOptions({ - connectionManager: { - maxConnections: 5, - minConnections: 6 - } - }), - started: false - })).to.eventually.rejected('maxConnections must be greater'); - }); - it('should reconnect to important peers on startup', async () => { - const peerId = await createEd25519PeerId(); - libp2p = await createNode({ - config: createBaseOptions(), - started: false - }); - const connectionManager = libp2p.components.connectionManager; - const connectionManagerOpenConnectionSpy = sinon.spy(connectionManager, 'openConnection'); - await libp2p.start(); - expect(connectionManagerOpenConnectionSpy.called).to.be.false('Attempted to connect to peers'); - await libp2p.peerStore.merge(peerId, { - tags: { - [KEEP_ALIVE]: {} - } - }); - await libp2p.stop(); - await libp2p.start(); - await pWaitFor(() => connectionManagerOpenConnectionSpy.called, { - interval: 100 - }); - expect(connectionManagerOpenConnectionSpy.called).to.be.true('Did not attempt to connect to important peer'); - expect(connectionManagerOpenConnectionSpy.getCall(0).args[0].toString()).to.equal(peerId.toString(), 'Attempted to connect to the wrong peer'); - }); - it('should deny connections from denylist multiaddrs', async () => { - const remoteAddr = multiaddr('/ip4/83.13.55.32/tcp/59283'); - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - deny: [ - '/ip4/83.13.55.32' - ] - }); - await connectionManager.start(); - const remotePeer = await createEd25519PeerId(); - const maConn = mockMultiaddrConnection({ - remoteAddr, - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, remotePeer); - await expect(connectionManager.acceptIncomingConnection(maConn)) - .to.eventually.be.false(); - }); - it('should deny connections when maxConnections is exceeded', async () => { - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - maxConnections: 1 - }); - await connectionManager.start(); - sinon.stub(connectionManager.dialQueue, 'dial').resolves(stubInterface()); - // max out the connection limit - await connectionManager.openConnection(await createEd25519PeerId()); - expect(connectionManager.getConnections()).to.have.lengthOf(1); - // an inbound connection is opened - const remotePeer = await createEd25519PeerId(); - const maConn = mockMultiaddrConnection({ - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, remotePeer); - await expect(connectionManager.acceptIncomingConnection(maConn)) - .to.eventually.be.false(); - }); - it('should deny connections from peers that connect too frequently', async () => { - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - inboundConnectionThreshold: 1 - }); - await connectionManager.start(); - sinon.stub(connectionManager.dialQueue, 'dial').resolves(stubInterface()); - // an inbound connection is opened - const remotePeer = await createEd25519PeerId(); - const maConn = mockMultiaddrConnection({ - source: (async function* () { - yield* []; - })(), - sink: async () => { }, - // has to be thin waist, which it will be since we've not done the peer id handshake - // yet in the code being exercised by this test - remoteAddr: multiaddr('/ip4/34.4.63.125/tcp/4001') - }, remotePeer); - await expect(connectionManager.acceptIncomingConnection(maConn)) - .to.eventually.be.true(); - // connect again within a second - await expect(connectionManager.acceptIncomingConnection(maConn)) - .to.eventually.be.false(); - }); - it('should allow connections from allowlist multiaddrs', async () => { - const remoteAddr = multiaddr('/ip4/83.13.55.32/tcp/59283'); - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - maxConnections: 1, - allow: [ - '/ip4/83.13.55.32' - ] - }); - await connectionManager.start(); - sinon.stub(connectionManager.dialQueue, 'dial').resolves(stubInterface()); - // max out the connection limit - await connectionManager.openConnection(await createEd25519PeerId()); - expect(connectionManager.getConnections()).to.have.lengthOf(1); - // an inbound connection is opened from an address in the allow list - const remotePeer = await createEd25519PeerId(); - const maConn = mockMultiaddrConnection({ - remoteAddr, - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, remotePeer); - await expect(connectionManager.acceptIncomingConnection(maConn)) - .to.eventually.be.true(); - }); - it('should limit the number of inbound pending connections', async () => { - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - maxIncomingPendingConnections: 1 - }); - await connectionManager.start(); - sinon.stub(connectionManager.dialQueue, 'dial').resolves(stubInterface()); - // start the upgrade - const maConn1 = mockMultiaddrConnection({ - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, await createEd25519PeerId()); - await expect(connectionManager.acceptIncomingConnection(maConn1)) - .to.eventually.be.true(); - // start the upgrade - const maConn2 = mockMultiaddrConnection({ - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, await createEd25519PeerId()); - // should be false because we have not completed the upgrade of maConn1 - await expect(connectionManager.acceptIncomingConnection(maConn2)) - .to.eventually.be.false(); - // finish the maConn1 pending upgrade - connectionManager.afterUpgradeInbound(); - // should be true because we have now completed the upgrade of maConn1 - await expect(connectionManager.acceptIncomingConnection(maConn2)) - .to.eventually.be.true(); - }); - it('should allow dialing peers when an existing transient connection exists', async () => { - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - maxIncomingPendingConnections: 1 - }); - await connectionManager.start(); - const targetPeer = await createEd25519PeerId(); - const addr = multiaddr(`/ip4/123.123.123.123/tcp/123/p2p/${targetPeer}`); - const existingConnection = stubInterface({ - transient: true - }); - const newConnection = stubInterface(); - sinon.stub(connectionManager.dialQueue, 'dial') - .withArgs(addr) - .resolves(newConnection); - // we have an existing transient connection - const map = connectionManager.getConnectionsMap(); - map.set(targetPeer, [ - existingConnection - ]); - const conn = await connectionManager.openConnection(addr); - expect(conn).to.equal(newConnection); - }); -}); -//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.spec.js.map deleted file mode 100644 index 66230badf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/index.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../test/connection-manager/index.spec.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AM,GAAG,GAAG,iBAAiB,CAAC,iBAAiB,EAAE,CAAA;QACjD,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE;YAClB,kBAAkB;SACnB,CAAC,CAAA;QAEF,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;QAEzD,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;IACtC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/resolver.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/resolver.spec.d.ts deleted file mode 100644 index f08a5bfbd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/resolver.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=resolver.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/resolver.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/resolver.spec.d.ts.map deleted file mode 100644 index 976ef1837..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/resolver.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolver.spec.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/resolver.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/resolver.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/resolver.spec.js deleted file mode 100644 index 3944ab008..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/resolver.spec.js +++ /dev/null @@ -1,221 +0,0 @@ -/* eslint-env mocha */ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { RELAY_V2_HOP_CODEC } from '@libp2p/circuit-relay-v2'; -import { circuitRelayServer, circuitRelayTransport } from '@libp2p/circuit-relay-v2'; -import { mockConnection, mockConnectionGater, mockDuplex, mockMultiaddrConnection } from '@libp2p/interface-compliance-tests/mocks'; -import { mplex } from '@libp2p/mplex'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import pDefer from 'p-defer'; -import sinon from 'sinon'; -import { codes as ErrorCodes } from '../../src/errors.js'; -import { createLibp2pNode } from '../../src/libp2p.js'; -const relayAddr = multiaddr(process.env.RELAY_MULTIADDR); -const getDnsaddrStub = (peerId) => [ - `/dnsaddr/ams-1.bootstrap.libp2p.io/p2p/${peerId.toString()}`, - `/dnsaddr/ams-2.bootstrap.libp2p.io/p2p/${peerId.toString()}`, - `/dnsaddr/lon-1.bootstrap.libp2p.io/p2p/${peerId.toString()}`, - `/dnsaddr/nrt-1.bootstrap.libp2p.io/p2p/${peerId.toString()}`, - `/dnsaddr/nyc-1.bootstrap.libp2p.io/p2p/${peerId.toString()}`, - `/dnsaddr/sfo-2.bootstrap.libp2p.io/p2p/${peerId.toString()}` -]; -const relayedAddr = (peerId) => `${relayAddr.toString()}/p2p-circuit/p2p/${peerId.toString()}`; -const getDnsRelayedAddrStub = (peerId) => [ - `${relayedAddr(peerId)}` -]; -describe('dialing (resolvable addresses)', () => { - let libp2p; - let remoteLibp2p; - let resolver; - beforeEach(async () => { - resolver = sinon.stub(); - [libp2p, remoteLibp2p] = await Promise.all([ - createLibp2pNode({ - addresses: { - listen: [`${relayAddr.toString()}/p2p-circuit`] - }, - transports: [ - circuitRelayTransport(), - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionManager: { - resolvers: { - dnsaddr: resolver - } - }, - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }), - createLibp2pNode({ - addresses: { - listen: [`${relayAddr.toString()}/p2p-circuit`] - }, - transports: [ - circuitRelayTransport(), - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionManager: { - resolvers: { - dnsaddr: resolver - } - }, - connectionEncryption: [ - plaintext() - ], - services: { - relay: circuitRelayServer() - }, - connectionGater: mockConnectionGater() - }) - ]); - await Promise.all([ - libp2p.start(), - remoteLibp2p.start() - ]); - }); - afterEach(async () => { - sinon.restore(); - await Promise.all([libp2p, remoteLibp2p].map(async (n) => { - if (n != null) { - await n.stop(); - } - })); - }); - it('resolves dnsaddr to ws local address', async () => { - const peerId = await createEd25519PeerId(); - // ensure remote libp2p creates reservation on relay - await remoteLibp2p.peerStore.merge(peerId, { - protocols: [RELAY_V2_HOP_CODEC] - }); - const remoteId = remoteLibp2p.peerId; - const dialAddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remoteId.toString()}`); - const relayedAddrFetched = multiaddr(relayedAddr(remoteId)); - // Transport spy - const transport = getTransport(libp2p, 'libp2p/circuit-relay-v2'); - const transportDialSpy = sinon.spy(transport, 'dial'); - // Resolver stub - resolver.onCall(0).returns(Promise.resolve(getDnsRelayedAddrStub(remoteId))); - // Dial with address resolve - const connection = await libp2p.dial(dialAddr); - expect(connection).to.exist(); - expect(connection.remoteAddr.equals(relayedAddrFetched)); - const dialArgs = transportDialSpy.firstCall.args; - expect(dialArgs[0].equals(relayedAddrFetched)).to.eql(true); - }); - it('resolves a dnsaddr recursively', async () => { - const remoteId = remoteLibp2p.peerId; - const dialAddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remoteId.toString()}`); - const relayedAddrFetched = multiaddr(relayedAddr(remoteId)); - const relayId = await createEd25519PeerId(); - // ensure remote libp2p creates reservation on relay - await remoteLibp2p.peerStore.merge(relayId, { - protocols: [RELAY_V2_HOP_CODEC] - }); - // Transport spy - const transport = getTransport(libp2p, 'libp2p/circuit-relay-v2'); - const transportDialSpy = sinon.spy(transport, 'dial'); - // Resolver stub - let firstCall = false; - resolver.callsFake(async () => { - if (!firstCall) { - firstCall = true; - // Return an array of dnsaddr - return Promise.resolve(getDnsaddrStub(remoteId)); - } - return Promise.resolve(getDnsRelayedAddrStub(remoteId)); - }); - // Dial with address resolve - const connection = await libp2p.dial(dialAddr); - expect(connection).to.exist(); - expect(connection.remoteAddr.equals(relayedAddrFetched)); - const dialArgs = transportDialSpy.firstCall.args; - expect(dialArgs[0].equals(relayedAddrFetched)).to.eql(true); - }); - // TODO: Temporary solution does not resolve dns4/dns6 - // Resolver just returns the received multiaddrs - it('stops recursive resolve if finds dns4/dns6 and dials it', async () => { - const remoteId = remoteLibp2p.peerId; - const dialAddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remoteId.toString()}`); - // Stub resolver - const dnsMa = multiaddr(`/dns4/ams-1.remote.libp2p.io/tcp/443/wss/p2p/${remoteId.toString()}`); - resolver.returns(Promise.resolve([ - `${dnsMa.toString()}` - ])); - const deferred = pDefer(); - // Stub transport - const transport = getTransport(libp2p, '@libp2p/websockets'); - const stubTransport = sinon.stub(transport, 'dial'); - stubTransport.callsFake(async (multiaddr) => { - expect(multiaddr.equals(dnsMa)).to.equal(true); - deferred.resolve(); - return mockConnection(mockMultiaddrConnection(mockDuplex(), peerIdFromString(multiaddr.getPeerId() ?? ''))); - }); - void libp2p.dial(dialAddr); - await deferred.promise; - }); - it('resolves a dnsaddr recursively not failing if one address fails to resolve', async () => { - const remoteId = remoteLibp2p.peerId; - const dialAddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remoteId.toString()}`); - const relayedAddrFetched = multiaddr(relayedAddr(remoteId)); - const relayId = await createEd25519PeerId(); - // ensure remote libp2p creates reservation on relay - await remoteLibp2p.peerStore.merge(relayId, { - protocols: [RELAY_V2_HOP_CODEC] - }); - // Transport spy - const transport = getTransport(libp2p, 'libp2p/circuit-relay-v2'); - const transportDialSpy = sinon.spy(transport, 'dial'); - // Resolver stub - resolver.onCall(0).callsFake(async () => Promise.resolve(getDnsaddrStub(remoteId))); - resolver.onCall(1).callsFake(async () => Promise.reject(new Error())); - resolver.callsFake(async () => Promise.resolve(getDnsRelayedAddrStub(remoteId))); - // Dial with address resolve - const connection = await libp2p.dial(dialAddr); - expect(connection).to.exist(); - expect(connection.remoteAddr.equals(relayedAddrFetched)); - const dialArgs = transportDialSpy.firstCall.args; - expect(dialArgs[0].equals(relayedAddrFetched)).to.eql(true); - }); - it('fails to dial if resolve fails and there are no addresses to dial', async () => { - const remoteId = remoteLibp2p.peerId; - const dialAddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remoteId.toString()}`); - // Stub resolver - resolver.returns(Promise.reject(new Error())); - // Stub transport - const transport = getTransport(libp2p, '@libp2p/websockets'); - const spy = sinon.spy(transport, 'dial'); - await expect(libp2p.dial(dialAddr)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - expect(spy.callCount).to.eql(0); - }); -}); -function getTransport(libp2p, tag) { - const transport = libp2p.components.transportManager.getTransports().find(t => { - return t[Symbol.toStringTag] === tag; - }); - if (transport != null) { - return transport; - } - throw new Error(`No transport found for ${tag}`); -} -//# sourceMappingURL=resolver.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/resolver.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/resolver.spec.js.map deleted file mode 100644 index 705bf09ee..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection-manager/resolver.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolver.spec.js","sourceRoot":"","sources":["../../../test/connection-manager/resolver.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAA4B,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAC9G,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAA;AACnI,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,qBAAqB,CAAA;AAKvE,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;AAExD,MAAM,cAAc,GAAG,CAAC,MAAc,EAAY,EAAE,CAAC;IACnD,0CAA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,CAAC,CAAC,CAAA;IAEF,IAAI,SAAS,IAAI,IAAI,EAAE;QACrB,OAAO,SAAS,CAAA;KACjB;IAED,MAAM,IAAI,KAAK,CAAC,0BAA0B,GAAG,EAAE,CAAC,CAAA;AAClD,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/compliance.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/compliance.spec.d.ts deleted file mode 100644 index dac08d9d2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/compliance.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=compliance.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/compliance.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/compliance.spec.d.ts.map deleted file mode 100644 index 182587254..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/compliance.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.d.ts","sourceRoot":"","sources":["../../../test/connection/compliance.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/compliance.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/compliance.spec.js deleted file mode 100644 index f8761d588..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/compliance.spec.js +++ /dev/null @@ -1,72 +0,0 @@ -import tests from '@libp2p/interface-compliance-tests/connection'; -import peers from '@libp2p/interface-compliance-tests/peers'; -import { logger, peerLogger } from '@libp2p/logger'; -import * as PeerIdFactory from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import { createConnection } from '../../src/connection/index.js'; -import { pair } from './fixtures/pair.js'; -describe('connection compliance', () => { - tests({ - /** - * Test setup. `properties` allows the compliance test to override - * certain values for testing. - */ - async setup(properties) { - const localPeer = await PeerIdFactory.createEd25519PeerId(); - const remoteAddr = multiaddr('/ip4/127.0.0.1/tcp/8081'); - const remotePeer = await PeerIdFactory.createFromJSON(peers[0]); - let openStreams = []; - let streamId = 0; - const connection = createConnection({ - remotePeer, - remoteAddr, - timeline: { - open: Date.now() - 10, - upgraded: Date.now() - }, - direction: 'outbound', - encryption: '/secio/1.0.0', - multiplexer: '/mplex/6.7.0', - status: 'open', - logger: peerLogger(localPeer), - newStream: async (protocols) => { - const id = `${streamId++}`; - const stream = { - ...pair(), - close: async () => { - void stream.sink(async function* () { }()); - openStreams = openStreams.filter(s => s.id !== id); - }, - closeRead: async () => { }, - closeWrite: async () => { - void stream.sink(async function* () { }()); - }, - id, - abort: () => { }, - direction: 'outbound', - protocol: protocols[0], - timeline: { - open: 0 - }, - metadata: {}, - status: 'open', - writeStatus: 'ready', - readStatus: 'ready', - log: logger('test') - }; - openStreams.push(stream); - return stream; - }, - close: async () => { }, - abort: () => { }, - getStreams: () => openStreams, - ...properties - }); - return connection; - }, - async teardown() { - // cleanup resources created by setup() - } - }); -}); -//# sourceMappingURL=compliance.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/compliance.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/compliance.spec.js.map deleted file mode 100644 index 159229d1f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/compliance.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec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2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/fixtures/pair.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/fixtures/pair.d.ts deleted file mode 100644 index 1d866b335..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/fixtures/pair.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import type { Source, Duplex } from 'it-stream-types'; -/** - * A pair of streams where one drains from the other - */ -export declare function pair(): Duplex, Source, Promise>; -//# sourceMappingURL=pair.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/fixtures/pair.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/fixtures/pair.d.ts.map deleted file mode 100644 index b5f8d6292..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/fixtures/pair.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pair.d.ts","sourceRoot":"","sources":["../../../../test/connection/fixtures/pair.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAErD;;GAEG;AACH,wBAAgB,IAAI,IAAK,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,cAAc,GAAG,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAmBlH"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/fixtures/pair.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/fixtures/pair.js deleted file mode 100644 index e5b3f71c5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/fixtures/pair.js +++ /dev/null @@ -1,24 +0,0 @@ -import map from 'it-map'; -import defer from 'p-defer'; -import { Uint8ArrayList } from 'uint8arraylist'; -/** - * A pair of streams where one drains from the other - */ -export function pair() { - const deferred = defer(); - let piped = false; - return { - sink: async (source) => { - if (piped) { - throw new Error('already piped'); - } - piped = true; - deferred.resolve(source); - }, - source: (async function* () { - const source = await deferred.promise; - yield* map(source, (buf) => buf instanceof Uint8Array ? new Uint8ArrayList(buf) : buf); - }()) - }; -} -//# sourceMappingURL=pair.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/fixtures/pair.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/fixtures/pair.js.map deleted file mode 100644 index 0f5932345..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/fixtures/pair.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pair.js","sourceRoot":"","sources":["../../../../test/connection/fixtures/pair.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,QAAQ,CAAA;AACxB,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAG/C;;GAEG;AACH,MAAM,UAAU,IAAI;IAClB,MAAM,QAAQ,GAAG,KAAK,EAAuC,CAAA;IAC7D,IAAI,KAAK,GAAG,KAAK,CAAA;IAEjB,OAAO;QACL,IAAI,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;YACnB,IAAI,KAAK,EAAE;gBACT,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;aACjC;YAED,KAAK,GAAG,IAAI,CAAA;YACZ,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAC1B,CAAC;QACD,MAAM,EAAE,CAAC,KAAK,SAAU,CAAC;YACvB,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAA;YAErC,KAAM,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,YAAY,UAAU,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;QACzF,CAAC,EAAE,CAAC;KACL,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/index.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/index.spec.d.ts deleted file mode 100644 index b37c2d278..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/index.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/index.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/index.spec.d.ts.map deleted file mode 100644 index 99cb1ba5b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/index.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../../test/connection/index.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/index.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/index.spec.js deleted file mode 100644 index 2024f76a3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/index.spec.js +++ /dev/null @@ -1,53 +0,0 @@ -import { defaultLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import Sinon from 'sinon'; -import { createConnection } from '../../src/connection/index.js'; -function defaultConnectionInit() { - return { - timeline: { - open: Date.now() - 10, - upgraded: Date.now() - }, - direction: 'outbound', - encryption: '/secio/1.0.0', - multiplexer: '/mplex/6.7.0', - status: 'open', - newStream: Sinon.stub(), - close: Sinon.stub(), - abort: Sinon.stub(), - getStreams: Sinon.stub(), - logger: defaultLogger() - }; -} -describe('connection', () => { - it('should not require local or remote addrs', async () => { - const remotePeer = await createEd25519PeerId(); - return createConnection({ - remotePeer, - remoteAddr: multiaddr('/ip4/127.0.0.1/tcp/4002'), - ...defaultConnectionInit() - }); - }); - it('should append remote peer id to address if not already present', async () => { - const remotePeer = await createEd25519PeerId(); - const conn = createConnection({ - remotePeer, - remoteAddr: multiaddr('/ip4/127.0.0.1/tcp/4002'), - ...defaultConnectionInit() - }); - expect(conn.remoteAddr.getPeerId()).to.equal(remotePeer.toString()); - }); - it('should not append remote peer id to address if present', async () => { - const remotePeer = await createEd25519PeerId(); - const otherPeer = await createEd25519PeerId(); - const conn = createConnection({ - remotePeer, - remoteAddr: multiaddr(`/ip4/127.0.0.1/tcp/4002/p2p/${otherPeer}`), - ...defaultConnectionInit() - }); - expect(conn.remoteAddr.getPeerId()).to.equal(otherPeer.toString()); - }); -}); -//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/index.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/index.spec.js.map deleted file mode 100644 index c3e9bc2cf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/connection/index.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../test/connection/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAEhE,SAAS,qBAAqB;IAC5B,OAAO;QACL,QAAQ,EAAE;YACR,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE;YACrB,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE;SACrB;QACD,SAAS,EAAE,UAAU;QACrB,UAAU,EAAE,cAAc;QAC1B,WAAW,EAAE,cAAc;QAC3B,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,KAAK,CAAC,IAAI,EAAE;QACvB,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE;QACnB,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE;QACnB,UAAU,EAAE,KAAK,CAAC,IAAI,EAAE;QACxB,MAAM,EAAE,aAAa,EAAE;KACxB,CAAA;AACH,CAAC;AAED,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,UAAU,GAAG,MAAM,mBAAmB,EAAE,CAAA;QAE9C,OAAO,gBAAgB,CAAC;YACtB,UAAU;YACV,UAAU,EAAE,SAAS,CAAC,yBAAyB,CAAC;YAChD,GAAG,qBAAqB,EAAE;SAC3B,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gEAAgE,EAAE,KAAK,IAAI,EAAE;QAC9E,MAAM,UAAU,GAAG,MAAM,mBAAmB,EAAE,CAAA;QAE9C,MAAM,IAAI,GAAG,gBAAgB,CAAC;YAC5B,UAAU;YACV,UAAU,EAAE,SAAS,CAAC,yBAAyB,CAAC;YAChD,GAAG,qBAAqB,EAAE;SAC3B,CAAC,CAAA;QAEF,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAA;IACrE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACtE,MAAM,UAAU,GAAG,MAAM,mBAAmB,EAAE,CAAA;QAC9C,MAAM,SAAS,GAAG,MAAM,mBAAmB,EAAE,CAAA;QAE7C,MAAM,IAAI,GAAG,gBAAgB,CAAC;YAC5B,UAAU;YACV,UAAU,EAAE,SAAS,CAAC,+BAA+B,SAAS,EAAE,CAAC;YACjE,GAAG,qBAAqB,EAAE;SAC3B,CAAC,CAAA;QAEF,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAA;IACpE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/content-routing.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/content-routing.node.d.ts deleted file mode 100644 index 36e6e389e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/content-routing.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=content-routing.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/content-routing.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/content-routing.node.d.ts.map deleted file mode 100644 index e37f9e48b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/content-routing.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"content-routing.node.d.ts","sourceRoot":"","sources":["../../../test/content-routing/content-routing.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/content-routing.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/content-routing.node.js deleted file mode 100644 index f0efca1f7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/content-routing.node.js +++ /dev/null @@ -1,378 +0,0 @@ -/* eslint-env mocha */ -import { EventTypes } from '@libp2p/kad-dht'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import all from 'it-all'; -import drain from 'it-drain'; -import { CID } from 'multiformats/cid'; -import pDefer from 'p-defer'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { createLibp2p } from '../../src/index.js'; -import { createBaseOptions } from '../fixtures/base-options.js'; -import { createNode, createPeerId, populateAddressBooks } from '../fixtures/creators/peer.js'; -import { createRoutingOptions } from './utils.js'; -describe('content-routing', () => { - describe('no routers', () => { - let node; - before(async () => { - node = await createNode({ - config: createBaseOptions() - }); - }); - after(async () => { await node.stop(); }); - it('.findProviders should return an error', async () => { - try { - // @ts-expect-error invalid params - for await (const _ of node.contentRouting.findProviders('a cid')) { } // eslint-disable-line - throw new Error('.findProviders should return an error'); - } - catch (err) { - expect(err).to.exist(); - expect(err.code).to.equal('ERR_NO_ROUTERS_AVAILABLE'); - } - }); - it('.provide should return an error', async () => { - // @ts-expect-error invalid params - await expect(node.contentRouting.provide('a cid')) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_NO_ROUTERS_AVAILABLE'); - }); - }); - describe('via dht router', () => { - const number = 5; - let nodes; - before(async () => { - nodes = await Promise.all([ - createLibp2p(createRoutingOptions()), - createLibp2p(createRoutingOptions()), - createLibp2p(createRoutingOptions()), - createLibp2p(createRoutingOptions()), - createLibp2p(createRoutingOptions()) - ]); - await populateAddressBooks(nodes); - // Ring dial - await Promise.all(nodes.map(async (peer, i) => peer.dial(nodes[(i + 1) % number].peerId))); - }); - afterEach(() => { - sinon.restore(); - }); - after(async () => Promise.all(nodes.map(async (n) => { await n.stop(); }))); - it('should use the nodes dht to provide', async () => { - const deferred = pDefer(); - if (nodes[0].services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(nodes[0].services.dht, 'provide').callsFake(async function* () { - deferred.resolve(); - }); - void nodes[0].contentRouting.provide(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB')); - return deferred.promise; - }); - it('should use the nodes dht to find providers', async () => { - const deferred = pDefer(); - if (nodes[0].services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(nodes[0].services.dht, 'findProviders').callsFake(async function* () { - yield { - from: nodes[0].peerId, - type: EventTypes.PROVIDER, - name: 'PROVIDER', - providers: [{ - id: nodes[0].peerId, - multiaddrs: [], - protocols: [] - }] - }; - deferred.resolve(); - }); - await drain(nodes[0].contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))); - return deferred.promise; - }); - }); - describe('via delegate router', () => { - let node; - let delegate; - beforeEach(async () => { - delegate = stubInterface(); - delegate.provide.returns(Promise.resolve()); - delegate.findProviders.returns(async function* () { }()); - node = await createNode({ - config: createBaseOptions({ - contentRouters: [ - () => delegate - ] - }) - }); - }); - afterEach(async () => { - if (node != null) { - await node.stop(); - } - sinon.restore(); - }); - it('should use the delegate router to provide', async () => { - const deferred = pDefer(); - delegate.provide.callsFake(async () => { - deferred.resolve(); - }); - void node.contentRouting.provide(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB')); - return deferred.promise; - }); - it('should use the delegate router to find providers', async () => { - const deferred = pDefer(); - delegate.findProviders.returns(async function* () { - yield { - id: node.peerId, - multiaddrs: [], - protocols: [] - }; - deferred.resolve(); - }()); - await drain(node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))); - return deferred.promise; - }); - it('should be able to register as a provider', async () => { - const cid = CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'); - await node.contentRouting.provide(cid); - expect(delegate.provide.calledWith(cid)).to.equal(true); - }); - it('should handle errors when registering as a provider', async () => { - const cid = CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'); - delegate.provide.withArgs(cid).throws(new Error('Could not provide')); - await expect(node.contentRouting.provide(cid)) - .to.eventually.be.rejected() - .with.property('message', 'Could not provide'); - }); - it('should be able to find providers', async () => { - const cid = CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'); - const provider = 'QmZNgCqZCvTsi3B4Vt7gsSqpkqDpE7M2Y9TDmEhbDb4ceF'; - delegate.findProviders.withArgs(cid).returns(async function* () { - yield { - id: peerIdFromString(provider), - multiaddrs: [ - multiaddr('/ip4/0.0.0.0/tcp/0') - ], - protocols: [] - }; - }()); - const providers = await all(node.contentRouting.findProviders(cid)); - expect(providers).to.have.length(1); - expect(providers[0].id.toString()).to.equal(provider); - }); - it('should handle errors when finding providers', async () => { - const cid = CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'); - delegate.findProviders.withArgs(cid).throws(new Error('Could not find providers')); - await expect(drain(node.contentRouting.findProviders(cid))) - .to.eventually.be.rejected() - .with.property('message', 'Could not find providers'); - }); - }); - describe('via dht and delegate routers', () => { - let node; - let delegate; - beforeEach(async () => { - delegate = stubInterface(); - delegate.provide.returns(Promise.resolve()); - delegate.findProviders.returns(async function* () { }()); - node = await createNode({ - config: createRoutingOptions({ - contentRouters: [ - () => delegate - ] - }) - }); - }); - afterEach(() => { - sinon.restore(); - }); - afterEach(async () => { await node.stop(); }); - it('should store the multiaddrs of a peer', async () => { - const providerPeerId = await createPeerId(); - const result = { - id: providerPeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/49320') - ] - }; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { }); - delegate.findProviders.callsFake(async function* () { - yield result; - }); - expect(await node.peerStore.has(providerPeerId)).to.not.be.ok(); - await drain(node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))); - await expect(node.peerStore.get(providerPeerId)).to.eventually.have.property('addresses').that.deep.include({ - isCertified: false, - multiaddr: result.multiaddrs[0] - }); - }); - it('should not wait for routing findProviders to finish before returning results', async () => { - const providerPeerId = await createPeerId(); - const result = { - id: providerPeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/49320') - ], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - const defer = pDefer(); - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { - await defer.promise; - }); - delegate.findProviders.callsFake(async function* () { - yield result; - await defer.promise; - }); - for await (const provider of node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))) { - expect(provider.id).to.deep.equal(providerPeerId); - defer.resolve(); - } - }); - it('should dedupe results', async () => { - const providerPeerId = await createPeerId(); - const result = { - id: providerPeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/49320') - ], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { - yield { - from: providerPeerId, - type: EventTypes.PROVIDER, - name: 'PROVIDER', - providers: [ - result - ] - }; - }); - delegate.findProviders.callsFake(async function* () { - yield result; - }); - const results = await all(node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))); - expect(results).to.be.an('array').with.lengthOf(1).that.deep.equals([result]); - }); - it('should combine multiaddrs when different addresses are returned by different content routers', async () => { - const providerPeerId = await createPeerId(); - const result1 = { - id: providerPeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/49320') - ], - protocols: [] - }; - const result2 = { - id: providerPeerId, - multiaddrs: [ - multiaddr('/ip4/213.213.213.213/tcp/2344') - ], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { - yield { - from: providerPeerId, - type: EventTypes.PROVIDER, - name: 'PROVIDER', - providers: [ - result1 - ] - }; - }); - delegate.findProviders.callsFake(async function* () { - yield result2; - }); - await drain(node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))); - await expect(node.peerStore.get(providerPeerId)).to.eventually.have.property('addresses').that.deep.include({ - isCertified: false, - multiaddr: result1.multiaddrs[0] - }).and.to.deep.include({ - isCertified: false, - multiaddr: result2.multiaddrs[0] - }); - }); - it('should use both the dht and delegate router to provide', async () => { - const dhtDeferred = pDefer(); - const delegatedDeferred = pDefer(); - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'provide').callsFake(async function* () { - dhtDeferred.resolve(); - }); - delegate.provide.callsFake(async function () { - delegatedDeferred.resolve(); - }); - await node.contentRouting.provide(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB')); - await Promise.all([ - dhtDeferred.promise, - delegatedDeferred.promise - ]); - }); - it('should use the dht if the delegate fails to find providers', async () => { - const providerPeerId = await createPeerId(); - const results = [{ - id: providerPeerId, - multiaddrs: [], - protocols: [] - }]; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { - yield { - from: providerPeerId, - type: EventTypes.PROVIDER, - name: 'PROVIDER', - providers: [ - results[0] - ] - }; - }); - delegate.findProviders.callsFake(async function* () { - }); - const providers = []; - for await (const prov of node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))) { - providers.push(prov); - } - expect(providers).to.have.length.above(0); - expect(providers).to.eql(results); - }); - it('should use the delegate if the dht fails to find providers', async () => { - const providerPeerId = await createPeerId(); - const results = [{ - id: providerPeerId, - multiaddrs: [], - protocols: [] - }]; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { }); - delegate.findProviders.callsFake(async function* () { - yield results[0]; - }); - const providers = []; - for await (const prov of node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))) { - providers.push(prov); - } - expect(providers).to.have.length.above(0); - expect(providers).to.eql(results); - }); - }); -}); -//# sourceMappingURL=content-routing.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/content-routing.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/content-routing.node.js.map deleted file mode 100644 index c4d01da22..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/content-routing.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"content-routing.node.js","sour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AAC,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,SAAS,CAAC,KAAK,SAAU,CAAC,MAAK,CAAC,CAAC,CAAA;YAEhF,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,SAAU,CAAC;gBAC/C,MAAM,OAAO,CAAC,CAAC,CAAC,CAAA;YAClB,CAAC,CAAC,CAAA;YAEF,MAAM,SAAS,GAAG,EAAE,CAAA;YACpB,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC,EAAE;gBACvH,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;aACrB;YAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YACzC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QACnC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/operation.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/operation.node.d.ts deleted file mode 100644 index 1cf770100..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/operation.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=operation.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/operation.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/operation.node.d.ts.map deleted file mode 100644 index 698f65880..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/operation.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"operation.node.d.ts","sourceRoot":"","sources":["../../../../test/content-routing/dht/operation.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/operation.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/operation.node.js deleted file mode 100644 index 83b2e9daa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/operation.node.js +++ /dev/null @@ -1,119 +0,0 @@ -/* eslint-env mocha */ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { kadDHT } from '@libp2p/kad-dht'; -import { mplex } from '@libp2p/mplex'; -import { plaintext } from '@libp2p/plaintext'; -import { tcp } from '@libp2p/tcp'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import pWaitFor from 'p-wait-for'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { createLibp2p } from '../../../src/index.js'; -import { createPeerId } from '../../fixtures/creators/peer.js'; -import { subsystemMulticodecs } from './utils.js'; -const listenAddr = multiaddr('/ip4/127.0.0.1/tcp/8000'); -const remoteListenAddr = multiaddr('/ip4/127.0.0.1/tcp/8001'); -async function getRemoteAddr(remotePeerId, libp2p) { - const { addresses } = await libp2p.peerStore.get(remotePeerId); - if (addresses.length === 0) { - throw new Error('No addrs found'); - } - const addr = addresses[0]; - return addr.multiaddr.encapsulate(`/p2p/${remotePeerId.toString()}`); -} -describe('DHT subsystem operates correctly', () => { - let peerId; - let remotePeerId; - let libp2p; - let remoteLibp2p; - let remAddr; - beforeEach(async () => { - [peerId, remotePeerId] = await Promise.all([ - createPeerId(), - createPeerId() - ]); - }); - describe('dht started before connect', () => { - beforeEach(async () => { - libp2p = await createLibp2p({ - peerId, - addresses: { - listen: [listenAddr.toString()] - }, - transports: [ - tcp() - ], - connectionEncryption: [ - plaintext() - ], - streamMuxers: [ - yamux(), - mplex() - ], - services: { - dht: kadDHT({ - allowQueryWithZeroPeers: true - }) - } - }); - remoteLibp2p = await createLibp2p({ - peerId: remotePeerId, - addresses: { - listen: [remoteListenAddr.toString()] - }, - transports: [ - tcp() - ], - connectionEncryption: [ - plaintext() - ], - streamMuxers: [ - yamux(), - mplex() - ], - services: { - dht: kadDHT({ - allowQueryWithZeroPeers: true - }) - } - }); - await Promise.all([ - libp2p.start(), - remoteLibp2p.start() - ]); - await libp2p.peerStore.patch(remotePeerId, { - multiaddrs: [remoteListenAddr] - }); - remAddr = await getRemoteAddr(remotePeerId, libp2p); - }); - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - if (remoteLibp2p != null) { - await remoteLibp2p.stop(); - } - }); - it('should get notified of connected peers on dial', async () => { - const stream = await libp2p.dialProtocol(remAddr, subsystemMulticodecs); - expect(stream).to.exist(); - return Promise.all([ - pWaitFor(() => libp2p.services.dht.lan.routingTable.size === 1), - pWaitFor(() => remoteLibp2p.services.dht.lan.routingTable.size === 1) - ]); - }); - it('should put on a peer and get from the other', async () => { - const key = uint8ArrayFromString('hello'); - const value = uint8ArrayFromString('world'); - await libp2p.dialProtocol(remotePeerId, subsystemMulticodecs); - await Promise.all([ - pWaitFor(() => libp2p.services.dht.lan.routingTable.size === 1), - pWaitFor(() => remoteLibp2p.services.dht.lan.routingTable.size === 1) - ]); - await libp2p.contentRouting.put(key, value); - const fetchedValue = await remoteLibp2p.contentRouting.get(key); - expect(fetchedValue).to.equalBytes(value); - }); - }); -}); -//# sourceMappingURL=operation.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/operation.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/operation.node.js.map deleted file mode 100644 index 55800e26a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/operation.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"operation.node.js","sourceRoot":"","sources":["../../../../test/content-routing/dht/operation.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAMjD,MAAM,UAAU,GAAG,SAAS,CAAC,yBAAyB,CAAC,CAAA;AACvD,MAAM,gBAAgB,GAAG,SAAS,CAAC,yBAAyB,CAAC,CAAA;AAE7D,KAAK,UAAU,aAAa,CAAE,YAAoB,EAAE,MAAc;IAChE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IAE9D,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;QAC1B,MAAM,IA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,CAAC,IAAI,KAAK,CAAC,CAAC;aACtE,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;YAC3D,MAAM,GAAG,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAA;YACzC,MAAM,KAAK,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAA;YAE3C,MAAM,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAA;YAC7D,MAAM,OAAO,CAAC,GAAG,CAAC;gBAChB,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,CAAC;gBAC/D,QAAQ,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,CAAC;aACtE,CAAC,CAAA;YAEF,MAAM,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;YAE3C,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YAC/D,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QAC3C,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/utils.d.ts deleted file mode 100644 index 8334a000c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/utils.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const subsystemMulticodecs: string[]; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/utils.d.ts.map deleted file mode 100644 index de0b19e10..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../test/content-routing/dht/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,UAGhC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/utils.js deleted file mode 100644 index 9cc3c44f0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/utils.js +++ /dev/null @@ -1,5 +0,0 @@ -export const subsystemMulticodecs = [ - '/ipfs/lan/kad/1.0.0', - '/other/1.0.0' -]; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/utils.js.map deleted file mode 100644 index c3b8faf94..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/dht/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../test/content-routing/dht/utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,qBAAqB;IACrB,cAAc;CACf,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/utils.d.ts deleted file mode 100644 index 3d1c83fcd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/utils.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Libp2pOptions } from '../../src/index.js'; -import type { KadDHT } from '@libp2p/kad-dht'; -export declare function createRoutingOptions(...overrides: Libp2pOptions[]): Libp2pOptions<{ - dht: KadDHT; -}>; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/utils.d.ts.map deleted file mode 100644 index 1298f0f57..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../test/content-routing/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C,wBAAgB,oBAAoB,CAAE,GAAG,SAAS,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAMnG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/utils.js deleted file mode 100644 index 62abfb2ec..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/utils.js +++ /dev/null @@ -1,10 +0,0 @@ -import { kadDHT } from '@libp2p/kad-dht'; -import { createBaseOptions } from '../fixtures/base-options.js'; -export function createRoutingOptions(...overrides) { - return createBaseOptions({ - services: { - dht: kadDHT() - } - }, ...overrides); -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/utils.js.map deleted file mode 100644 index f79b7fd0b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/content-routing/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../test/content-routing/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAI/D,MAAM,UAAU,oBAAoB,CAAE,GAAG,SAA0B;IACjE,OAAO,iBAAiB,CAAC;QACvB,QAAQ,EAAE;YACR,GAAG,EAAE,MAAM,EAAE;SACd;KACF,EAAE,GAAG,SAAS,CAAC,CAAA;AAClB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/consume-peer-record.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/consume-peer-record.spec.d.ts deleted file mode 100644 index 1f60e50d4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/consume-peer-record.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=consume-peer-record.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/consume-peer-record.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/consume-peer-record.spec.d.ts.map deleted file mode 100644 index e87be48f2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/consume-peer-record.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"consume-peer-record.spec.d.ts","sourceRoot":"","sources":["../../../test/core/consume-peer-record.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/consume-peer-record.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/consume-peer-record.spec.js deleted file mode 100644 index 54f77f66a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/consume-peer-record.spec.js +++ /dev/null @@ -1,39 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { multiaddr } from '@multiformats/multiaddr'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -describe('Consume peer record', () => { - let libp2p; - beforeEach(async () => { - const peerId = await createPeerId(); - libp2p = await createLibp2pNode({ - peerId, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - }); - }); - afterEach(async () => { - await libp2p.stop(); - }); - it('should update addresses when observed addrs are confirmed', async () => { - let done; - libp2p.peerStore.patch = async () => { - done(); - return {}; - }; - const p = new Promise(resolve => { - done = resolve; - }); - await libp2p.start(); - libp2p.components.addressManager.confirmObservedAddr(multiaddr('/ip4/123.123.123.123/tcp/3983')); - await p; - await libp2p.stop(); - }); -}); -//# sourceMappingURL=consume-peer-record.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/consume-peer-record.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/consume-peer-record.spec.js.map deleted file mode 100644 index 33b1c77ef..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/consume-peer-record.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"consume-peer-record.spec.js","sourceRoot":"","sources":["../../../test/core/consume-peer-record.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,IAAI,MAAkB,CAAA;IAEtB,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAA;QACnC,MAAM,GAAG,MAAM,gBAAgB,CAAC;YAC9B,MAAM;YACN,UAAU,EAAE;gBACV,UAAU,EAAE;aACb;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,2DAA2D,EAAE,KAAK,IAAI,EAAE;QACzE,IAAI,IAAgB,CAAA;QAEpB,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE;YAClC,IAAI,EAAE,CAAA;YACN,OAAO,EAAS,CAAA;QAClB,CAAC,CAAA;QAED,MAAM,CAAC,GAAG,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE;YACpC,IAAI,GAAG,OAAO,CAAA;QAChB,CAAC,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;QAEpB,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,mBAAmB,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAC,CAAA;QAEhG,MAAM,CAAC,CAAA;QAEP,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/encryption.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/encryption.spec.d.ts deleted file mode 100644 index 63c83cb90..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/encryption.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=encryption.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/encryption.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/encryption.spec.d.ts.map deleted file mode 100644 index 85fb6d201..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/encryption.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encryption.spec.d.ts","sourceRoot":"","sources":["../../../test/core/encryption.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/encryption.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/encryption.spec.js deleted file mode 100644 index e76a69348..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/encryption.spec.js +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { createLibp2p } from '../../src/index.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -describe('Connection encryption configuration', () => { - let peerId; - before(async () => { - peerId = await createPeerId(); - }); - it('can be created', async () => { - const config = { - peerId, - start: false, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - }; - await createLibp2p(config); - }); -}); -//# sourceMappingURL=encryption.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/encryption.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/encryption.spec.js.map deleted file mode 100644 index 9a184e96f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/encryption.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encryption.spec.js","sourceRoot":"","sources":["../../../test/core/encryption.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAsB,MAAM,oBAAoB,CAAA;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAG3D,QAAQ,CAAC,qCAAqC,EAAE,GAAG,EAAE;IACnD,IAAI,MAAc,CAAA;IAElB,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,MAAM,GAAG,MAAM,YAAY,EAAE,CAAA;IAC/B,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE;QAC9B,MAAM,MAAM,GAAkB;YAC5B,MAAM;YACN,KAAK,EAAE,KAAK;YACZ,UAAU,EAAE;gBACV,UAAU,EAAE;aACb;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAA;QACD,MAAM,YAAY,CAAC,MAAM,CAAC,CAAA;IAC5B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/events.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/events.spec.d.ts deleted file mode 100644 index 35b5a7f51..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/events.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=events.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/events.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/events.spec.d.ts.map deleted file mode 100644 index 967176175..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/events.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"events.spec.d.ts","sourceRoot":"","sources":["../../../test/core/events.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/events.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/events.spec.js deleted file mode 100644 index 0ba89d0da..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/events.spec.js +++ /dev/null @@ -1,42 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { expect } from 'aegir/chai'; -import { pEvent } from 'p-event'; -import { createLibp2p } from '../../src/index.js'; -describe('events', () => { - let node; - afterEach(async () => { - if (node != null) { - await node.stop(); - } - }); - it('should emit a start event', async () => { - node = await createLibp2p({ - start: false, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - }); - const eventPromise = pEvent(node, 'start'); - await node.start(); - await expect(eventPromise).to.eventually.have.property('detail', node); - }); - it('should emit a stop event', async () => { - node = await createLibp2p({ - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - }); - const eventPromise = pEvent(node, 'stop'); - await node.stop(); - await expect(eventPromise).to.eventually.have.property('detail', node); - }); -}); -//# sourceMappingURL=events.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/events.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/events.spec.js.map deleted file mode 100644 index 0db4e55bb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/events.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"events.spec.js","sourceRoot":"","sources":["../../../test/core/events.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,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C,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/get-public-key.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/get-public-key.spec.d.ts deleted file mode 100644 index 6dbf4bcf0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/get-public-key.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=get-public-key.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/get-public-key.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/get-public-key.spec.d.ts.map deleted file mode 100644 index 92e484a0e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/get-public-key.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-public-key.spec.d.ts","sourceRoot":"","sources":["../../../test/core/get-public-key.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/get-public-key.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/get-public-key.spec.js deleted file mode 100644 index 1ab28b1f6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/get-public-key.spec.js +++ /dev/null @@ -1,62 +0,0 @@ -/* eslint-env mocha */ -import { kadDHT } from '@libp2p/kad-dht'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { expect } from 'aegir/chai'; -import sinon from 'sinon'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -describe('getPublicKey', () => { - let libp2p; - beforeEach(async () => { - const peerId = await createPeerId(); - libp2p = await createLibp2pNode({ - peerId, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ], - services: { - dht: kadDHT() - } - }); - await libp2p.start(); - }); - afterEach(async () => { - await libp2p.stop(); - }); - it('should extract embedded public key', async () => { - const otherPeer = await createPeerId(); - const key = await libp2p.getPublicKey(otherPeer); - expect(otherPeer.publicKey).to.equalBytes(key); - }); - it('should get key from the keystore', async () => { - const otherPeer = await createPeerId({ opts: { type: 'rsa' } }); - if (otherPeer.publicKey == null) { - throw new Error('Public key was missing'); - } - await libp2p.peerStore.patch(otherPeer, { - publicKey: otherPeer.publicKey - }); - const key = await libp2p.getPublicKey(otherPeer); - expect(otherPeer.publicKey).to.equalBytes(key); - }); - it('should query the DHT when the key is not in the keystore', async () => { - const otherPeer = await createPeerId({ opts: { type: 'rsa' } }); - if (otherPeer.publicKey == null) { - throw new Error('Public key was missing'); - } - if (libp2p.services.dht == null) { - throw new Error('DHT was not configured'); - } - libp2p.services.dht.get = sinon.stub().returns([{ - name: 'VALUE', - value: otherPeer.publicKey - }]); - const key = await libp2p.getPublicKey(otherPeer); - expect(otherPeer.publicKey).to.equalBytes(key); - }); -}); -//# sourceMappingURL=get-public-key.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/get-public-key.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/get-public-key.spec.js.map deleted file mode 100644 index b9936d463..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/get-public-key.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-public-key.spec.js","sourceRoot":"","sources":["../../../test/core/get-public-key.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;A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AAA;IAChD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/listening.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/listening.node.d.ts deleted file mode 100644 index 9c74e4ee8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/listening.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=listening.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/listening.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/listening.node.d.ts.map deleted file mode 100644 index 8d6164770..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/listening.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listening.node.d.ts","sourceRoot":"","sources":["../../../test/core/listening.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/listening.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/listening.node.js deleted file mode 100644 index 81e71fe21..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/listening.node.js +++ /dev/null @@ -1,45 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { tcp } from '@libp2p/tcp'; -import { expect } from 'aegir/chai'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -const listenAddr = '/ip4/0.0.0.0/tcp/0'; -describe('Listening', () => { - let peerId; - let libp2p; - before(async () => { - peerId = await createPeerId(); - }); - after(async () => { - await libp2p.stop(); - }); - it('should replace wildcard host and port with actual host and port on startup', async () => { - libp2p = await createLibp2pNode({ - peerId, - addresses: { - listen: [listenAddr] - }, - transports: [ - tcp() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - const addrs = libp2p.components.transportManager.getAddrs(); - // Should get something like: - // /ip4/127.0.0.1/tcp/50866 - // /ip4/192.168.1.2/tcp/50866 - expect(addrs.length).to.be.at.least(1); - for (const addr of addrs) { - const opts = addr.toOptions(); - expect(opts.family).to.equal(4); - expect(opts.transport).to.equal('tcp'); - expect(opts.host).to.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/); - expect(opts.port).to.be.gt(0); - } - }); -}); -//# sourceMappingURL=listening.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/listening.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/listening.node.js.map deleted file mode 100644 index 1cd4d3774..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/listening.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listening.node.js","sourceRoot":"","sources":["../../../test/core/listening.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAG3D,MAAM,UAAU,GAAG,oBAAoB,CAAA;AAEvC,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,IAAI,MAAc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C,EAAE,CAAC,CAAC,CAAC,CAAA;SAC9B;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/peer-id.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/peer-id.spec.d.ts deleted file mode 100644 index 6a1b64052..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/peer-id.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=peer-id.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/peer-id.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/peer-id.spec.d.ts.map deleted file mode 100644 index 7d06eaac1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/peer-id.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-id.spec.d.ts","sourceRoot":"","sources":["../../../test/core/peer-id.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/peer-id.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/peer-id.spec.js deleted file mode 100644 index c9883cdb3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/peer-id.spec.js +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { expect } from 'aegir/chai'; -import { createLibp2p } from '../../src/index.js'; -describe('peer-id', () => { - let libp2p; - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('should create a PeerId if none is passed', async () => { - libp2p = await createLibp2p({ - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - }); - expect(libp2p.peerId).to.be.ok(); - }); -}); -//# sourceMappingURL=peer-id.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/peer-id.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/peer-id.spec.js.map deleted file mode 100644 index da4596502..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/core/peer-id.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-id.spec.js","sourceRoot":"","sources":["../../../test/core/peer-id.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,YAAY,EAAe,MAAM,oBAAoB,CAAA;AAE9D,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,IAAI,MAAc,CAAA;IAElB,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;SACpB;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,GAAG,MAAM,YAAY,CAAC;YAC1B,UAAU,EAAE;gBACV,UAAU,EAAE;aACb;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAC,CAAA;QAEF,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAA;IAClC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.browser.d.ts deleted file mode 100644 index 76a8cbd22..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.browser.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Libp2pOptions } from '../../src/index.js'; -import type { ServiceMap } from '@libp2p/interface'; -export declare function createBaseOptions>(overrides?: Libp2pOptions): Libp2pOptions; -//# sourceMappingURL=base-options.browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.browser.d.ts.map deleted file mode 100644 index de49e9388..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-options.browser.d.ts","sourceRoot":"","sources":["../../../test/fixtures/base-options.browser.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,wBAAgB,iBAAiB,CAAE,CAAC,SAAS,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAG,SAAS,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAmBlI"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.browser.js deleted file mode 100644 index cb4bf1def..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.browser.js +++ /dev/null @@ -1,27 +0,0 @@ -import { circuitRelayTransport } from '@libp2p/circuit-relay-v2'; -import { mockConnectionGater } from '@libp2p/interface-compliance-tests/mocks'; -import { mplex } from '@libp2p/mplex'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import mergeOptions from 'merge-options'; -export function createBaseOptions(overrides) { - const options = { - transports: [ - webSockets({ - filter: filters.all - }), - circuitRelayTransport() - ], - streamMuxers: [ - mplex(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }; - return mergeOptions(options, overrides); -} -//# sourceMappingURL=base-options.browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.browser.js.map deleted file mode 100644 index 9b0376976..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-options.browser.js","sourceRoot":"","sources":["../../../test/fixtures/base-options.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAA;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAA;AACrD,OAAO,YAAY,MAAM,eAAe,CAAA;AAIxC,MAAM,UAAU,iBAAiB,CAAmD,SAA4B;IAC9G,MAAM,OAAO,GAAkB;QAC7B,UAAU,EAAE;YACV,UAAU,CAAC;gBACT,MAAM,EAAE,OAAO,CAAC,GAAG;aACpB,CAAC;YACF,qBAAqB,EAAE;SACxB;QACD,YAAY,EAAE;YACZ,KAAK,EAAE;YACP,KAAK,EAAE;SACR;QACD,oBAAoB,EAAE;YACpB,SAAS,EAAE;SACZ;QACD,eAAe,EAAE,mBAAmB,EAAE;KACvC,CAAA;IAED,OAAO,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;AACzC,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.d.ts deleted file mode 100644 index d816a2472..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Libp2pOptions } from '../../src'; -import type { ServiceMap } from '@libp2p/interface'; -export declare function createBaseOptions>(...overrides: Array>): Libp2pOptions; -//# sourceMappingURL=base-options.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.d.ts.map deleted file mode 100644 index bd719bb0d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-options.d.ts","sourceRoot":"","sources":["../../../test/fixtures/base-options.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,wBAAgB,iBAAiB,CAAE,CAAC,SAAS,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAG,GAAG,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAsB3I"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.js deleted file mode 100644 index 4a20946b6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.js +++ /dev/null @@ -1,31 +0,0 @@ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { circuitRelayTransport } from '@libp2p/circuit-relay-v2'; -import { mplex } from '@libp2p/mplex'; -import { plaintext } from '@libp2p/plaintext'; -import { tcp } from '@libp2p/tcp'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import mergeOptions from 'merge-options'; -export function createBaseOptions(...overrides) { - const options = { - addresses: { - listen: [`${process.env.RELAY_MULTIADDR}/p2p-circuit`] - }, - transports: [ - tcp(), - webSockets({ - filter: filters.all - }), - circuitRelayTransport() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }; - return mergeOptions(options, ...overrides); -} -//# sourceMappingURL=base-options.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.js.map deleted file mode 100644 index fb4f2fbc9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/base-options.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-options.js","sourceRoot":"","sources":["../../../test/fixtures/base-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAA;AACrD,OAAO,YAAY,MAAM,eAAe,CAAA;AAIxC,MAAM,UAAU,iBAAiB,CAAmD,GAAG,SAAkC;IACvH,MAAM,OAAO,GAAkB;QAC7B,SAAS,EAAE;YACT,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,cAAc,CAAC;SACvD;QACD,UAAU,EAAE;YACV,GAAG,EAAE;YACL,UAAU,CAAC;gBACT,MAAM,EAAE,OAAO,CAAC,GAAG;aACpB,CAAC;YACF,qBAAqB,EAAE;SACxB;QACD,YAAY,EAAE;YACZ,KAAK,EAAE;YACP,KAAK,EAAE;SACR;QACD,oBAAoB,EAAE;YACpB,SAAS,EAAE;SACZ;KACF,CAAA;IAED,OAAO,YAAY,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,CAAA;AAC5C,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/creators/peer.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/creators/peer.d.ts deleted file mode 100644 index 8fd586a6a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/creators/peer.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { type Libp2pNode } from '../../../src/libp2p.js'; -import type { Libp2pOptions } from '../../../src/index.js'; -import type { Libp2p, ServiceMap } from '@libp2p/interface'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export interface CreatePeerOptions { - /** - * number of peers (default: 1) - */ - number?: number; - /** - * nodes should start (default: true) - */ - started?: boolean; - config?: Libp2pOptions; -} -/** - * Create libp2p nodes. - */ -export declare function createNode(options?: CreatePeerOptions): Promise>; -export declare function populateAddressBooks(peers: Libp2p[]): Promise; -export interface CreatePeerIdOptions { - /** - * Options to pass to the PeerId constructor - */ - opts?: { - type?: 'rsa' | 'ed25519'; - bits?: number; - }; -} -/** - * Create Peer-id - */ -export declare function createPeerId(options?: CreatePeerIdOptions): Promise; -/** - * Create Peer-ids - */ -export declare function createPeerIds(count: number, options?: Omit): Promise; -//# sourceMappingURL=peer.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/creators/peer.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/creators/peer.d.ts.map deleted file mode 100644 index 814b7946b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/creators/peer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer.d.ts","sourceRoot":"","sources":["../../../../test/fixtures/creators/peer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAIvD,MAAM,WAAW,iBAAiB,CAAE,CAAC,SAAS,UAAU;IACtD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB,MAAM,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;CAC1B;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAE,CAAC,SAAS,UAAU,EAAG,OAAO,GAAE,iBAAiB,CAAC,CAAC,CAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CA6BnH;AAED,wBAAsB,oBAAoB,CAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAU1E;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,CAAA;QACxB,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;CACF;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAE,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CAItF;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAE,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAIzH"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/creators/peer.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/creators/peer.js deleted file mode 100644 index 194ca26ee..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/creators/peer.js +++ /dev/null @@ -1,63 +0,0 @@ -import { createEd25519PeerId, createRSAPeerId } from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import pTimes from 'p-times'; -import { createLibp2pNode } from '../../../src/libp2p.js'; -import { createBaseOptions } from '../base-options.browser.js'; -const listenAddr = multiaddr('/ip4/127.0.0.1/tcp/0'); -/** - * Create libp2p nodes. - */ -export async function createNode(options = {}) { - const started = options.started ?? true; - const config = options.config ?? {}; - const peerId = await createPeerId(); - const addresses = started - ? { - listen: [listenAddr.toString()], - announce: [], - noAnnounce: [], - announceFilter: (addrs) => addrs - } - : { - listen: [], - announce: [], - noAnnounce: [], - announceFilter: (addrs) => addrs - }; - const peer = await createLibp2pNode(createBaseOptions({ - peerId, - addresses, - start: started, - ...config - })); - if (started) { - await peer.start(); - } - return peer; -} -export async function populateAddressBooks(peers) { - for (let i = 0; i < peers.length; i++) { - for (let j = 0; j < peers.length; j++) { - if (i !== j) { - await peers[i].peerStore.patch(peers[j].peerId, { - multiaddrs: peers[j].getMultiaddrs() - }); - } - } - } -} -/** - * Create Peer-id - */ -export async function createPeerId(options = {}) { - const opts = options.opts ?? {}; - return opts.type === 'rsa' ? createRSAPeerId({ bits: opts.bits ?? 512 }) : createEd25519PeerId(); -} -/** - * Create Peer-ids - */ -export async function createPeerIds(count, options = {}) { - const opts = options.opts ?? {}; - return pTimes(count, async (i) => createPeerId({ opts })); -} -//# sourceMappingURL=peer.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/creators/peer.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/creators/peer.js.map deleted file mode 100644 index 54db26ed6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/creators/peer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer.js","sourceRoot":"","sources":["../../../../test/fixtures/creators/peer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,gBAAgB,EAAmB,MAAM,wBAAwB,CAAA;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAM9D,MAAM,UAAU,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAA;AAgBpD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAyB,UAAgC,EAAE;IACzF,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,CAAA;IACvC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,EAAE,CAAA;IACnC,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAA;IACnC,MAAM,SAAS,GAAuB,OAAO;QAC3C,CAAC,CAAC;YACE,MAAM,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;YAC/B,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,EAAE;YACd,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;SACjC;QACH,CAAC,CAAC;YACE,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,EAAE;YACd,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;SACjC,CAAA;IACL,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,iBAAiB,CAAC;QACpD,MAAM;QACN,SAAS;QACT,KAAK,EAAE,OAAO;QACd,GAAG,MAAM;KACV,CAAC,CAAC,CAAA;IAEH,IAAI,OAAO,EAAE;QACX,MAAM,IAAI,CAAC,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f/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/echo-service.d.ts deleted file mode 100644 index 0e7733ab2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/echo-service.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Registrar } from '@libp2p/interface-internal/registrar'; -export declare const ECHO_PROTOCOL = "/echo/1.0.0"; -export interface EchoInit { - protocol?: string; -} -export interface EchoComponents { - registrar: Registrar; -} -export declare function echo(init?: EchoInit): (components: EchoComponents) => unknown; -//# sourceMappingURL=echo-service.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/echo-service.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/echo-service.d.ts.map deleted file mode 100644 index d7f6f3d04..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/echo-service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"echo-service.d.ts","sourceRoot":"","sources":["../../../test/fixtures/echo-service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAErE,eAAO,MAAM,aAAa,gBAAgB,CAAA;AAE1C,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,SAAS,CAAA;CACrB;AAyBD,wBAAgB,IAAI,CAAE,IAAI,GAAE,QAAa,GAAG,CAAC,UAAU,EAAE,cAAc,KAAK,OAAO,CAIlF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/echo-service.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/echo-service.js deleted file mode 100644 index 2610f79bd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/echo-service.js +++ /dev/null @@ -1,27 +0,0 @@ -import { pipe } from 'it-pipe'; -export const ECHO_PROTOCOL = '/echo/1.0.0'; -class EchoService { - protocol; - registrar; - constructor(components, init = {}) { - this.protocol = init.protocol ?? ECHO_PROTOCOL; - this.registrar = components.registrar; - } - async start() { - await this.registrar.handle(this.protocol, ({ stream }) => { - void pipe(stream, stream) - // sometimes connections are closed before multistream-select finishes - // which causes an error - .catch(); - }); - } - async stop() { - await this.registrar.unhandle(this.protocol); - } -} -export function echo(init = {}) { - return (components) => { - return new EchoService(components, init); - }; -} -//# sourceMappingURL=echo-service.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/echo-service.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/echo-service.js.map deleted file mode 100644 index 6aa1a5d72..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/echo-service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"echo-service.js","sourceRoot":"","sources":["../../../test/fixtures/echo-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAI9B,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAA;AAU1C,MAAM,WAAW;IACE,QAAQ,CAAQ;IAChB,SAAS,CAAW;IAErC,YAAa,UAA0B,EAAE,OAAiB,EAAE;QAC1D,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,aAAa,CAAA;QAC9C,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAA;IACvC,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;YACxD,KAAK,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;gBACvB,sEAAsE;gBACtE,wBAAwB;iBACvB,KAAK,EAAE,CAAA;QACZ,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC9C,CAAC;CACF;AAED,MAAM,UAAU,IAAI,CAAE,OAAiB,EAAE;IACvC,OAAO,CAAC,UAAU,EAAE,EAAE;QACpB,OAAO,IAAI,WAAW,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;IAC1C,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/match-peer-id.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/match-peer-id.d.ts deleted file mode 100644 index 344fbcd01..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/match-peer-id.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import Sinon from 'sinon'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export declare function matchPeerId(peerId: PeerId): Sinon.SinonMatcher; -//# sourceMappingURL=match-peer-id.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/match-peer-id.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/match-peer-id.d.ts.map deleted file mode 100644 index 17083c74d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/match-peer-id.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"match-peer-id.d.ts","sourceRoot":"","sources":["../../../test/fixtures/match-peer-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,wBAAgB,WAAW,CAAE,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAE/D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/match-peer-id.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/match-peer-id.js deleted file mode 100644 index 699cedd88..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/match-peer-id.js +++ /dev/null @@ -1,5 +0,0 @@ -import Sinon from 'sinon'; -export function matchPeerId(peerId) { - return Sinon.match(p => p.toString() === peerId.toString()); -} -//# sourceMappingURL=match-peer-id.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/match-peer-id.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/match-peer-id.js.map deleted file mode 100644 index 0032df46f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/fixtures/match-peer-id.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"match-peer-id.js","sourceRoot":"","sources":["../../../test/fixtures/match-peer-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,UAAU,WAAW,CAAE,MAAc;IACzC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAA;AAC7D,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/interop.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/interop.d.ts deleted file mode 100644 index f160cf14e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/interop.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=interop.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/interop.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/interop.d.ts.map deleted file mode 100644 index 14efbf496..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/interop.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interop.d.ts","sourceRoot":"","sources":["../../test/interop.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/interop.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/interop.js deleted file mode 100644 index 093dd456a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/interop.js +++ /dev/null @@ -1,197 +0,0 @@ -import fs from 'fs'; -import { gossipsub } from '@chainsafe/libp2p-gossipsub'; -import { noise } from '@chainsafe/libp2p-noise'; -import { yamux } from '@chainsafe/libp2p-yamux'; -import { circuitRelayServer, circuitRelayTransport } from '@libp2p/circuit-relay-v2'; -import { unmarshalPrivateKey } from '@libp2p/crypto/keys'; -import { createClient } from '@libp2p/daemon-client'; -import { createServer } from '@libp2p/daemon-server'; -import { floodsub } from '@libp2p/floodsub'; -import { identify } from '@libp2p/identify'; -import { contentRouting } from '@libp2p/interface/content-routing'; -import { peerDiscovery } from '@libp2p/interface/peer-discovery'; -import { peerRouting } from '@libp2p/interface/peer-routing'; -import { interopTests } from '@libp2p/interop'; -import { kadDHT } from '@libp2p/kad-dht'; -import { logger } from '@libp2p/logger'; -import { mplex } from '@libp2p/mplex'; -import { peerIdFromKeys } from '@libp2p/peer-id'; -import { tcp } from '@libp2p/tcp'; -import { multiaddr } from '@multiformats/multiaddr'; -import { execa } from 'execa'; -import { path as p2pd } from 'go-libp2p'; -import pDefer from 'p-defer'; -import { createLibp2p } from '../src/index.js'; -/** - * @packageDocumentation - * - * To enable debug logging, run the tests with the following env vars: - * - * ```console - * DEBUG=libp2p*,go-libp2p:* npm run test:interop - * ``` - */ -async function createGoPeer(options) { - const controlPort = Math.floor(Math.random() * (50000 - 10000 + 1)) + 10000; - const apiAddr = multiaddr(`/ip4/127.0.0.1/tcp/${controlPort}`); - const log = logger(`go-libp2p:${controlPort}`); - const opts = [ - `-listen=${apiAddr.toString()}` - ]; - if (options.noListen === true) { - opts.push('-noListenAddrs'); - } - else { - opts.push('-hostAddrs=/ip4/127.0.0.1/tcp/0'); - } - if (options.noise === true) { - opts.push('-noise=true'); - } - if (options.dht === true) { - opts.push('-dhtServer'); - } - if (options.relay === true) { - opts.push('-relay'); - } - if (options.pubsub === true) { - opts.push('-pubsub'); - } - if (options.pubsubRouter != null) { - opts.push(`-pubsubRouter=${options.pubsubRouter}`); - } - if (options.key != null) { - opts.push(`-id=${options.key}`); - } - if (options.muxer === 'mplex') { - opts.push('-muxer=mplex'); - } - else { - opts.push('-muxer=yamux'); - } - const deferred = pDefer(); - const proc = execa(p2pd(), opts, { - env: { - GOLOG_LOG_LEVEL: 'debug' - } - }); - proc.stdout?.on('data', (buf) => { - const str = buf.toString(); - log(str); - // daemon has started - if (str.includes('Control socket:')) { - deferred.resolve(); - } - }); - proc.stderr?.on('data', (buf) => { - log.error(buf.toString()); - }); - await deferred.promise; - return { - client: createClient(apiAddr), - stop: async () => { - proc.kill(); - } - }; -} -async function createJsPeer(options) { - let peerId; - if (options.key != null) { - const keyFile = fs.readFileSync(options.key); - const privateKey = await unmarshalPrivateKey(keyFile); - peerId = await peerIdFromKeys(privateKey.public.bytes, privateKey.bytes); - } - const opts = { - peerId, - addresses: { - listen: options.noListen === true ? [] : ['/ip4/127.0.0.1/tcp/0'] - }, - transports: [tcp(), circuitRelayTransport()], - streamMuxers: [], - connectionEncryption: [noise()], - connectionManager: { - minConnections: 0 - } - }; - const services = { - identify: identify() - }; - if (options.muxer === 'mplex') { - opts.streamMuxers?.push(mplex()); - } - else { - opts.streamMuxers?.push(yamux()); - } - if (options.pubsub === true) { - if (options.pubsubRouter === 'floodsub') { - services.pubsub = floodsub(); - } - else { - services.pubsub = gossipsub(); - } - } - if (options.relay === true) { - services.relay = circuitRelayServer(); - } - if (options.dht === true) { - services.dht = (components) => { - const dht = kadDHT({ - clientMode: false - })(components); - // go-libp2p-daemon only has the older single-table DHT instead of the dual - // lan/wan version found in recent go-ipfs versions. unfortunately it's been - // abandoned so here we simulate the older config with the js implementation - const lan = dht.lan; - const protocol = '/ipfs/kad/1.0.0'; - lan.protocol = protocol; - lan.network.protocol = protocol; - lan.topologyListener.protocol = protocol; - Object.defineProperties(lan, { - [contentRouting]: { - get() { - return dht[contentRouting]; - } - }, - [peerRouting]: { - get() { - return dht[peerRouting]; - } - }, - [peerDiscovery]: { - get() { - return dht[peerDiscovery]; - } - } - }); - return lan; - }; - } - const node = await createLibp2p({ - ...opts, - services - }); - const server = createServer(multiaddr('/ip4/0.0.0.0/tcp/0'), node); - await server.start(); - return { - client: createClient(server.getMultiaddr()), - stop: async () => { - await server.stop(); - await node.stop(); - } - }; -} -async function main() { - const factory = { - async spawn(options) { - if (options.type === 'go') { - return createGoPeer(options); - } - return createJsPeer(options); - } - }; - await interopTests(factory); -} -main().catch(err => { - console.error(err); // eslint-disable-line no-console - process.exit(1); -}); -//# sourceMappingURL=interop.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/interop.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/interop.js.map deleted file mode 100644 index bb68e4de3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/interop.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interop.js","sourceRoot":"","sources":["../../test/interop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,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,CAAA;IAEF,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,oBAAoB,CAAC,EAAE,IAAI,CAAC,CAAA;IAClE,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;IAEpB,OAAO;QACL,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QAC3C,IAAI,EAAE,KAAK,IAAI,EAAE;YACf,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;YACnB,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;QACnB,CAAC;KACF,CAAA;AACH,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAkB;QAC7B,KAAK,CAAC,KAAK,CAAE,OAAqB;YAChC,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE;gBACzB,OAAO,YAAY,CAAC,OAAO,CAAC,CAAA;aAC7B;YAED,OAAO,YAAY,CAAC,OAAO,CAAC,CAAA;QAC9B,CAAC;KACF,CAAA;IAED,MAAM,YAAY,CAAC,OAAO,CAAC,CAAA;AAC7B,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA,CAAC,iCAAiC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.node.d.ts deleted file mode 100644 index 95867294f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.node.d.ts.map deleted file mode 100644 index d01c584d3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../../test/peer-discovery/index.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.node.js deleted file mode 100644 index 5ebb0631a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.node.js +++ /dev/null @@ -1,185 +0,0 @@ -/* eslint-env mocha */ -import { bootstrap } from '@libp2p/bootstrap'; -import { randomBytes } from '@libp2p/crypto'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { peerDiscovery } from '@libp2p/interface/peer-discovery'; -import { kadDHT } from '@libp2p/kad-dht'; -import { mdns } from '@libp2p/mdns'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import defer from 'p-defer'; -import sinon from 'sinon'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { createLibp2p } from '../../src/index.js'; -import { createBaseOptions } from '../fixtures/base-options.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -const listenAddr = multiaddr('/ip4/127.0.0.1/tcp/0'); -class TestPeerDiscovery extends TypedEventEmitter { - get [peerDiscovery]() { - return this; - } - [Symbol.toStringTag] = '@libp2p/test-peer-discovery'; -} -describe('peer discovery scenarios', () => { - let peerId; - let remotePeerId1; - let remotePeerId2; - let libp2p; - beforeEach(async () => { - [peerId, remotePeerId1, remotePeerId2] = await Promise.all([ - createPeerId(), - createPeerId(), - createPeerId() - ]); - }); - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('should ignore self on discovery', async () => { - const discovery = new TestPeerDiscovery(); - libp2p = await createLibp2p(createBaseOptions({ - peerId, - peerDiscovery: [ - () => discovery - ] - })); - await libp2p.start(); - const discoverySpy = sinon.spy(); - libp2p.addEventListener('peer:discovery', discoverySpy); - discovery.safeDispatchEvent('peer', { - detail: { - id: libp2p.peerId, - multiaddrs: [], - protocols: [] - } - }); - expect(discoverySpy.called).to.eql(false); - }); - it('bootstrap should discover all peers in the list', async () => { - const deferred = defer(); - const bootstrappers = [ - `${listenAddr.toString()}/p2p/${remotePeerId1.toString()}`, - `${listenAddr.toString()}/p2p/${remotePeerId2.toString()}` - ]; - libp2p = await createLibp2p(createBaseOptions({ - peerId, - addresses: { - listen: [ - listenAddr.toString() - ] - }, - peerDiscovery: [ - bootstrap({ - list: bootstrappers - }) - ] - })); - const expectedPeers = new Set([ - remotePeerId1.toString(), - remotePeerId2.toString() - ]); - libp2p.addEventListener('peer:discovery', (evt) => { - const { id } = evt.detail; - expectedPeers.delete(id.toString()); - if (expectedPeers.size === 0) { - libp2p.removeEventListener('peer:discovery'); - deferred.resolve(); - } - }); - await libp2p.start(); - return deferred.promise; - }); - it('MulticastDNS should discover all peers on the local network', async () => { - const deferred = defer(); - // use a random tag to prevent CI collision - const serviceTag = `libp2p-test-${uint8ArrayToString(randomBytes(4), 'base16')}.local`; - const getConfig = (peerId) => createBaseOptions({ - peerId, - addresses: { - listen: [ - listenAddr.toString() - ] - }, - peerDiscovery: [ - mdns({ - interval: 200, - serviceTag - }) - ] - }); - libp2p = await createLibp2p(getConfig(peerId)); - const remoteLibp2p1 = await createLibp2p(getConfig(remotePeerId1)); - const remoteLibp2p2 = await createLibp2p(getConfig(remotePeerId2)); - const expectedPeers = new Set([ - remotePeerId1.toString(), - remotePeerId2.toString() - ]); - libp2p.addEventListener('peer:discovery', (evt) => { - const { id } = evt.detail; - expectedPeers.delete(id.toString()); - if (expectedPeers.size === 0) { - libp2p.removeEventListener('peer:discovery'); - deferred.resolve(); - } - }); - await Promise.all([ - remoteLibp2p1.start(), - remoteLibp2p2.start(), - libp2p.start() - ]); - await deferred.promise; - await remoteLibp2p1.stop(); - await remoteLibp2p2.stop(); - }); - it('kad-dht should discover other peers', async () => { - const deferred = defer(); - const getConfig = (peerId) => createBaseOptions({ - peerId, - addresses: { - listen: [ - listenAddr.toString() - ] - }, - services: { - dht: kadDHT() - } - }); - const localConfig = getConfig(peerId); - libp2p = await createLibp2p(localConfig); - const remoteLibp2p1 = await createLibp2p(getConfig(remotePeerId1)); - const remoteLibp2p2 = await createLibp2p(getConfig(remotePeerId2)); - libp2p.addEventListener('peer:discovery', (evt) => { - const { id } = evt.detail; - if (id.equals(remotePeerId1)) { - libp2p.removeEventListener('peer:discovery'); - deferred.resolve(); - } - }); - await Promise.all([ - libp2p.start(), - remoteLibp2p1.start(), - remoteLibp2p2.start() - ]); - await libp2p.peerStore.patch(remotePeerId1, { - multiaddrs: remoteLibp2p1.getMultiaddrs() - }); - await remoteLibp2p2.peerStore.patch(remotePeerId1, { - multiaddrs: remoteLibp2p1.getMultiaddrs() - }); - // Topology: - // A -> B - // C -> B - await Promise.all([ - libp2p.dial(remotePeerId1), - remoteLibp2p2.dial(remotePeerId1) - ]); - await deferred.promise; - return Promise.all([ - remoteLibp2p1.stop(), - remoteLibp2p2.stop() - ]); - }); -}); -//# sourceMappingURL=index.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.node.js.map deleted file mode 100644 index 3a2b8982b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.node.js","sourceRoot":"","sources":["../../../test/peer-discovery/index.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAO3D,MAAM,UAAU,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAA;AAEpD,MAAM,iBAAkB,SAAQ,iBAAsC;IACpE,IAAI,CAAC,aAAa,CAAC;QACjB,OAAO,IAAI,CAAA;IACb,CAAC;IAEQ,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,6BAA6B,CAAA;CAC9D;AAED,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,IAAI,MAAc,CAAA;IAClB,IAAI,aAAqB,CAAA;IACzB,IAAI,aAAqB,CAAA;IACzB,IAAI,MAAc,CAAA;IAElB,UAAU,CAAC,KAAK,I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;QAEF,YAAY;QACZ,SAAS;QACT,SAAS;QACT,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;YAC1B,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC;SAClC,CAAC,CAAA;QAEF,MAAM,QAAQ,CAAC,OAAO,CAAA;QACtB,OAAO,OAAO,CAAC,GAAG,CAAC;YACjB,aAAa,CAAC,IAAI,EAAE;YACpB,aAAa,CAAC,IAAI,EAAE;SACrB,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.spec.d.ts deleted file mode 100644 index b37c2d278..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.spec.d.ts.map deleted file mode 100644 index ddc4c2518..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../../test/peer-discovery/index.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.spec.js deleted file mode 100644 index 96db53097..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.spec.js +++ /dev/null @@ -1,38 +0,0 @@ -/* eslint-env mocha */ -import { expect } from 'aegir/chai'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { createBaseOptions } from '../fixtures/base-options.browser.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -describe('peer discovery', () => { - describe('basic functions', () => { - let peerId; - let libp2p; - before(async () => { - peerId = await createPeerId(); - }); - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - sinon.reset(); - }); - it('should start/stop startable discovery on libp2p start/stop', async () => { - const discovery = stubInterface(); - libp2p = await createLibp2pNode(createBaseOptions({ - peerId, - peerDiscovery: [ - () => discovery - ] - })); - await libp2p.start(); - expect(discovery.start.calledOnce).to.be.true(); - expect(discovery.stop.called).to.be.false(); - await libp2p.stop(); - expect(discovery.start.calledOnce).to.be.true(); - expect(discovery.stop.calledOnce).to.be.true(); - }); - }); -}); -//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.spec.js.map deleted file mode 100644 index 262766661..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-discovery/index.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../test/peer-discovery/index.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA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,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;YAC/C,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QAChD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/peer-routing.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/peer-routing.node.d.ts deleted file mode 100644 index 9f5c2bfd9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/peer-routing.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=peer-routing.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/peer-routing.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/peer-routing.node.d.ts.map deleted file mode 100644 index 6b4f26365..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/peer-routing.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-routing.node.d.ts","sourceRoot":"","sources":["../../../test/peer-routing/peer-routing.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/peer-routing.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/peer-routing.node.js deleted file mode 100644 index 52cd620c5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/peer-routing.node.js +++ /dev/null @@ -1,449 +0,0 @@ -/* eslint-env mocha */ -import { EventTypes, MessageType } from '@libp2p/kad-dht'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import delay from 'delay'; -import all from 'it-all'; -import drain from 'it-drain'; -import pDefer from 'p-defer'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { createBaseOptions } from '../fixtures/base-options.js'; -import { createNode, createPeerId, populateAddressBooks } from '../fixtures/creators/peer.js'; -import { createRoutingOptions } from './utils.js'; -describe('peer-routing', () => { - let peerId; - beforeEach(async () => { - peerId = await createEd25519PeerId(); - }); - describe('no routers', () => { - let node; - before(async () => { - node = await createNode({ - config: createBaseOptions() - }); - }); - after(async () => { await node.stop(); }); - it('.findPeer should return an error', async () => { - await expect(node.peerRouting.findPeer(peerId)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_NO_ROUTERS_AVAILABLE'); - }); - it('.getClosestPeers should return an error', async () => { - try { - for await (const _ of node.peerRouting.getClosestPeers(peerId.toBytes())) { } // eslint-disable-line - throw new Error('.getClosestPeers should return an error'); - } - catch (err) { - expect(err).to.exist(); - expect(err.code).to.equal('ERR_NO_ROUTERS_AVAILABLE'); - } - }); - }); - describe('via dht router', () => { - let nodes; - before(async () => { - nodes = await Promise.all([ - createNode({ config: createRoutingOptions() }), - createNode({ config: createRoutingOptions() }), - createNode({ config: createRoutingOptions() }), - createNode({ config: createRoutingOptions() }), - createNode({ config: createRoutingOptions() }) - ]); - await populateAddressBooks(nodes); - // Ring dial - await Promise.all(nodes.map(async (peer, i) => peer.dial(nodes[(i + 1) % nodes.length].peerId))); - }); - after(() => { - sinon.restore(); - }); - after(async () => Promise.all(nodes.map(async (n) => { await n.stop(); }))); - it('should use the nodes dht', async () => { - if (nodes[0].services.dht == null) { - throw new Error('DHT not configured'); - } - const dhtFindPeerStub = sinon.stub(nodes[0].services.dht, 'findPeer').callsFake(async function* () { - yield { - from: nodes[2].peerId, - type: EventTypes.FINAL_PEER, - name: 'FINAL_PEER', - peer: { - id: nodes[1].peerId, - multiaddrs: [], - protocols: [] - } - }; - }); - expect(dhtFindPeerStub.called).to.be.false(); - await nodes[0].peerRouting.findPeer(nodes[1].peerId); - expect(dhtFindPeerStub.called).to.be.true(); - dhtFindPeerStub.restore(); - }); - it('should use the nodes dht to get the closest peers', async () => { - if (nodes[0].services.dht == null) { - throw new Error('DHT not configured'); - } - const dhtGetClosestPeersStub = sinon.stub(nodes[0].services.dht, 'getClosestPeers').callsFake(async function* () { - yield { - from: nodes[2].peerId, - type: EventTypes.FINAL_PEER, - name: 'FINAL_PEER', - messageName: 'FIND_NODE', - messageType: MessageType.FIND_NODE, - peer: { - id: nodes[1].peerId, - multiaddrs: [], - protocols: [] - } - }; - }); - expect(dhtGetClosestPeersStub.called).to.be.false(); - await drain(nodes[0].peerRouting.getClosestPeers(nodes[1].peerId.toBytes())); - expect(dhtGetClosestPeersStub.called).to.be.true(); - dhtGetClosestPeersStub.restore(); - }); - it('should error when peer tries to find itself', async () => { - await expect(nodes[0].peerRouting.findPeer(nodes[0].peerId)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_FIND_SELF'); - }); - it('should handle error thrown synchronously during find peer', async () => { - const unknownPeer = await createPeerId(); - // @ts-expect-error private field - nodes[0].peerRouting.routers = [{ - findPeer() { - throw new Error('Thrown sync'); - } - }]; - await expect(nodes[0].peerRouting.findPeer(unknownPeer)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_NOT_FOUND'); - }); - it('should handle error thrown asynchronously during find peer', async () => { - const unknownPeer = await createPeerId(); - // @ts-expect-error private field - nodes[0].peerRouting.routers = [{ - async findPeer() { - throw new Error('Thrown async'); - } - }]; - await expect(nodes[0].peerRouting.findPeer(unknownPeer)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_NOT_FOUND'); - }); - it('should handle error thrown asynchronously after delay during find peer', async () => { - const unknownPeer = await createPeerId(); - // @ts-expect-error private field - nodes[0].peerRouting.routers = [{ - async findPeer() { - await delay(100); - throw new Error('Thrown async after delay'); - } - }]; - await expect(nodes[0].peerRouting.findPeer(unknownPeer)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_NOT_FOUND'); - }); - it('should return value when one router errors synchronously and another returns a value', async () => { - const peer = await createPeerId(); - // @ts-expect-error private field - nodes[0].peerRouting.routers = [{ - findPeer() { - throw new Error('Thrown sync'); - } - }, { - async findPeer() { - return Promise.resolve({ - id: peer, - multiaddrs: [] - }); - } - }]; - await expect(nodes[0].peerRouting.findPeer(peer)) - .to.eventually.deep.equal({ - id: peer, - multiaddrs: [] - }); - }); - it('should return value when one router errors asynchronously and another returns a value', async () => { - const peer = await createPeerId(); - // @ts-expect-error private field - nodes[0].peerRouting.routers = [{ - async findPeer() { - throw new Error('Thrown sync'); - } - }, { - async findPeer() { - return Promise.resolve({ - id: peer, - multiaddrs: [] - }); - } - }]; - await expect(nodes[0].peerRouting.findPeer(peer)) - .to.eventually.deep.equal({ - id: peer, - multiaddrs: [] - }); - }); - }); - describe('via delegate router', () => { - let node; - let delegate; - beforeEach(async () => { - delegate = stubInterface(); - delegate.findPeer.rejects(new Error('Could not find peer')); - delegate.getClosestPeers.returns(async function* () { }()); - node = await createNode({ - config: createBaseOptions({ - peerRouters: [ - () => delegate - ] - }) - }); - }); - afterEach(() => { - sinon.restore(); - }); - afterEach(async () => { await node.stop(); }); - it('should only have one router', () => { - // @ts-expect-error private field - expect(node.peerRouting.routers).to.have.lengthOf(1); - }); - it('should use the delegate router to find peers', async () => { - const remotePeerId = await createPeerId(); - delegate.findPeer.callsFake(async function () { - return { - id: remotePeerId, - multiaddrs: [], - protocols: [] - }; - }); - expect(delegate.findPeer.called).to.be.false(); - await node.peerRouting.findPeer(remotePeerId); - expect(delegate.findPeer.called).to.be.true(); - }); - it('should use the delegate router to get the closest peers', async () => { - const remotePeerId = await createPeerId(); - delegate.getClosestPeers.callsFake(async function* () { - yield { - id: remotePeerId, - multiaddrs: [], - protocols: [] - }; - }); - expect(delegate.getClosestPeers.called).to.be.false(); - await drain(node.peerRouting.getClosestPeers(remotePeerId.toBytes())); - expect(delegate.getClosestPeers.called).to.be.true(); - }); - it('should error when peer tries to find itself', async () => { - await expect(node.peerRouting.findPeer(node.peerId)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_FIND_SELF'); - }); - it('should handle errors from the delegate when finding closest peers', async () => { - const remotePeerId = await createPeerId(); - delegate.getClosestPeers.callsFake(async function* () { - throw new Error('Could not find closer peers'); - }); - expect(delegate.getClosestPeers.called).to.be.false(); - await expect(drain(node.peerRouting.getClosestPeers(remotePeerId.toBytes()))) - .to.eventually.be.rejectedWith('Could not find closer peers'); - }); - }); - describe('via dht and delegate routers', () => { - let node; - let delegate; - beforeEach(async () => { - delegate = stubInterface(); - delegate.findPeer.throws(new Error('Could not find peer')); - delegate.getClosestPeers.returns(async function* () { }()); - node = await createNode({ - config: createRoutingOptions({ - peerRouters: [ - () => delegate - ] - }) - }); - }); - afterEach(() => { - sinon.restore(); - }); - afterEach(async () => { await node.stop(); }); - it('should use the delegate if the dht fails to find the peer', async () => { - const remotePeerId = await createPeerId(); - const results = { - id: remotePeerId, - multiaddrs: [], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - sinon.stub(node.services.dht, 'findPeer').callsFake(async function* () { }); - delegate.findPeer.reset(); - delegate.findPeer.callsFake(async () => { - return results; - }); - const peer = await node.peerRouting.findPeer(remotePeerId); - expect(peer).to.eql(results); - }); - it('should not wait for the dht to return if the delegate does first', async () => { - const remotePeerId = await createPeerId(); - const results = { - id: remotePeerId, - multiaddrs: [], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - const defer = pDefer(); - sinon.stub(node.services.dht, 'findPeer').callsFake(async function* () { - yield { - name: 'SEND_QUERY', - type: EventTypes.SEND_QUERY, - to: remotePeerId, - messageName: 'FIND_NODE', - messageType: MessageType.FIND_NODE - }; - await defer.promise; - }); - delegate.findPeer.reset(); - delegate.findPeer.callsFake(async () => { - return results; - }); - const peer = await node.peerRouting.findPeer(remotePeerId); - expect(peer).to.eql(results); - defer.resolve(); - }); - it('should not wait for the delegate to return if the dht does first', async () => { - const remotePeerId = await createPeerId(); - const result = { - id: remotePeerId, - multiaddrs: [], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - const defer = pDefer(); - sinon.stub(node.services.dht, 'findPeer').callsFake(async function* () { - yield { - from: remotePeerId, - name: 'FINAL_PEER', - type: EventTypes.FINAL_PEER, - peer: result - }; - }); - delegate.findPeer.reset(); - delegate.findPeer.callsFake(async () => { - return defer.promise; - }); - const peer = await node.peerRouting.findPeer(remotePeerId); - expect(peer).to.eql(result); - defer.resolve(result); - }); - it('should store the addresses of the found peer', async () => { - const remotePeerId = await createPeerId(); - const result = { - id: remotePeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/38982') - ], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - const spy = sinon.spy(node.peerStore, 'merge'); - sinon.stub(node.services.dht, 'findPeer').callsFake(async function* () { - yield { - from: remotePeerId, - name: 'FINAL_PEER', - type: EventTypes.FINAL_PEER, - peer: result - }; - }); - delegate.findPeer.reset(); - delegate.findPeer.callsFake(async () => { - const deferred = pDefer(); - return deferred.promise; - }); - await node.peerRouting.findPeer(remotePeerId); - expect(spy.calledWith(result.id, { - multiaddrs: result.multiaddrs - })).to.be.true(); - }); - it('should use the delegate if the dht fails to get the closest peer', async () => { - const remotePeerId = await createPeerId(); - const results = [{ - id: remotePeerId, - multiaddrs: [], - protocols: [] - }]; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - sinon.stub(node.services.dht, 'getClosestPeers').callsFake(async function* () { }); - delegate.getClosestPeers.callsFake(async function* () { - yield results[0]; - }); - const closest = await all(node.peerRouting.getClosestPeers(remotePeerId.toBytes())); - expect(closest).to.have.length.above(0); - expect(closest).to.eql(results); - }); - it('should store the addresses of the closest peer', async () => { - const remotePeerId = await createPeerId(); - const result = { - id: remotePeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/38982') - ], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - const spy = sinon.spy(node.peerStore, 'merge'); - sinon.stub(node.services.dht, 'getClosestPeers').callsFake(async function* () { }); - delegate.getClosestPeers.callsFake(async function* () { - yield result; - }); - await drain(node.peerRouting.getClosestPeers(remotePeerId.toBytes())); - expect(spy.calledWith(result.id, { - multiaddrs: result.multiaddrs - })).to.be.true(); - }); - it('should dedupe closest peers', async () => { - const remotePeerId = await createPeerId(); - const results = [{ - id: remotePeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/38982') - ], - protocols: [] - }]; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - sinon.stub(node.services.dht, 'getClosestPeers').callsFake(async function* () { - for (const peer of results) { - yield { - from: remotePeerId, - name: 'FINAL_PEER', - type: EventTypes.FINAL_PEER, - peer - }; - } - }); - delegate.getClosestPeers.callsFake(async function* () { - yield* results; - }); - const peers = await all(node.peerRouting.getClosestPeers(remotePeerId.toBytes())); - expect(peers).to.be.an('array').with.a.lengthOf(1).that.deep.equals(results); - }); - }); -}); -//# sourceMappingURL=peer-routing.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/peer-routing.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/peer-routing.node.js.map deleted file mode 100644 index fccc46d67..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/peer-routing.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-routing.node.js","sourceRoot":"","sources":["../../../test/peer-routing/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diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/utils.d.ts deleted file mode 100644 index 3d1c83fcd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/utils.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Libp2pOptions } from '../../src/index.js'; -import type { KadDHT } from '@libp2p/kad-dht'; -export declare function createRoutingOptions(...overrides: Libp2pOptions[]): Libp2pOptions<{ - dht: KadDHT; -}>; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/utils.d.ts.map deleted file mode 100644 index 405f5d650..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../test/peer-routing/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C,wBAAgB,oBAAoB,CAAE,GAAG,SAAS,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAMnG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/utils.js deleted file mode 100644 index 62abfb2ec..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/utils.js +++ /dev/null @@ -1,10 +0,0 @@ -import { kadDHT } from '@libp2p/kad-dht'; -import { createBaseOptions } from '../fixtures/base-options.js'; -export function createRoutingOptions(...overrides) { - return createBaseOptions({ - services: { - dht: kadDHT() - } - }, ...overrides); -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/utils.js.map deleted file mode 100644 index d527ca63f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/peer-routing/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../test/peer-routing/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAI/D,MAAM,UAAU,oBAAoB,CAAE,GAAG,SAA0B;IACjE,OAAO,iBAAiB,CAAC;QACvB,QAAQ,EAAE;YACR,GAAG,EAAE,MAAM,EAAE;SACd;KACF,EAAE,GAAG,SAAS,CAAC,CAAA;AAClB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/registrar/registrar.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/registrar/registrar.spec.d.ts deleted file mode 100644 index 49a866882..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/registrar/registrar.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=registrar.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/registrar/registrar.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/registrar/registrar.spec.d.ts.map deleted file mode 100644 index 222915a66..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/registrar/registrar.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registrar.spec.d.ts","sourceRoot":"","sources":["../../../test/registrar/registrar.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/registrar/registrar.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/registrar/registrar.spec.js deleted file mode 100644 index 10e85a47c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/registrar/registrar.spec.js +++ /dev/null @@ -1,360 +0,0 @@ -/* eslint-env mocha */ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockDuplex, mockMultiaddrConnection, mockUpgrader, mockConnection } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { mplex } from '@libp2p/mplex'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core/memory'; -import pDefer from 'p-defer'; -import { stubInterface } from 'sinon-ts'; -import { defaultComponents } from '../../src/components.js'; -import { DefaultConnectionManager } from '../../src/connection-manager/index.js'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { DefaultRegistrar } from '../../src/registrar.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -import { matchPeerId } from '../fixtures/match-peer-id.js'; -const protocol = '/test/1.0.0'; -describe('registrar', () => { - let components; - let registrar; - let peerId; - let libp2p; - before(async () => { - peerId = await createPeerId(); - }); - describe('errors', () => { - beforeEach(() => { - const events = new TypedEventEmitter(); - components = defaultComponents({ - peerId, - events, - datastore: new MemoryDatastore(), - upgrader: mockUpgrader({ events }), - transportManager: stubInterface(), - connectionGater: stubInterface() - }); - components.peerStore = new PersistentPeerStore(components); - components.connectionManager = new DefaultConnectionManager(components, { - minConnections: 50, - maxConnections: 1000, - inboundUpgradeTimeout: 1000 - }); - registrar = new DefaultRegistrar(components); - }); - it('should fail to register a protocol if no multicodec is provided', () => { - // @ts-expect-error invalid parameters - return expect(registrar.register()).to.eventually.be.rejected(); - }); - it('should fail to register a protocol if an invalid topology is provided', () => { - const fakeTopology = { - random: 1 - }; - // @ts-expect-error invalid parameters - return expect(registrar.register(fakeTopology)).to.eventually.be.rejected(); - }); - }); - describe('registration', () => { - let registrar; - let peerId; - let connectionManager; - let peerStore; - let events; - beforeEach(async () => { - peerId = await createEd25519PeerId(); - connectionManager = stubInterface(); - peerStore = stubInterface(); - events = new TypedEventEmitter(); - registrar = new DefaultRegistrar({ - peerId, - connectionManager, - peerStore, - events, - logger: defaultLogger() - }); - }); - it('should be able to register a protocol', async () => { - const topology = { - onConnect: () => { }, - onDisconnect: () => { } - }; - expect(registrar.getTopologies(protocol)).to.have.lengthOf(0); - const identifier = await registrar.register(protocol, topology); - expect(identifier).to.exist(); - expect(registrar.getTopologies(protocol)).to.have.lengthOf(1); - }); - it('should be able to unregister a protocol', async () => { - const topology = { - onConnect: () => { }, - onDisconnect: () => { } - }; - expect(registrar.getTopologies(protocol)).to.have.lengthOf(0); - const identifier = await registrar.register(protocol, topology); - expect(registrar.getTopologies(protocol)).to.have.lengthOf(1); - registrar.unregister(identifier); - expect(registrar.getTopologies(protocol)).to.have.lengthOf(0); - }); - it('should not error if unregistering unregistered topology handler', () => { - registrar.unregister('bad-identifier'); - }); - it('should call onConnect handler for connected peers after register', async () => { - const onConnectDefer = pDefer(); - const onDisconnectDefer = pDefer(); - // Setup connections before registrar - const remotePeerId = await createEd25519PeerId(); - const conn = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - // return connection from connection manager - connectionManager.getConnections.withArgs(remotePeerId).returns([conn]); - const topology = { - onConnect: (peerId, connection) => { - expect(peerId.equals(remotePeerId)).to.be.true(); - expect(connection.id).to.eql(conn.id); - onConnectDefer.resolve(); - }, - onDisconnect: (peerId) => { - expect(peerId.equals(remotePeerId)).to.be.true(); - onDisconnectDefer.resolve(); - } - }; - // Register protocol - await registrar.register(protocol, topology); - // Peer data is in the peer store - peerStore.get.withArgs(matchPeerId(remotePeerId)).resolves({ - id: remotePeerId, - addresses: [], - protocols: [protocol], - metadata: new Map(), - tags: new Map() - }); - // remote peer connects - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: conn - } - }); - await onConnectDefer.promise; - // remote peer disconnects - await conn.close(); - events.safeDispatchEvent('peer:disconnect', { - detail: remotePeerId - }); - await onDisconnectDefer.promise; - }); - it('should call onConnect handler after register, once a peer is connected and protocols are updated', async () => { - const onConnectDefer = pDefer(); - const onDisconnectDefer = pDefer(); - // Setup connections before registrar - const remotePeerId = await createEd25519PeerId(); - const conn = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - // return connection from connection manager - connectionManager.getConnections.withArgs(matchPeerId(remotePeerId)).returns([conn]); - const topology = { - onConnect: () => { - onConnectDefer.resolve(); - }, - onDisconnect: () => { - onDisconnectDefer.resolve(); - } - }; - // Register protocol - await registrar.register(protocol, topology); - // remote peer connects - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: conn - } - }); - // Can get details after identify - peerStore.get.withArgs(matchPeerId(conn.remotePeer)).resolves({ - id: conn.remotePeer, - addresses: [], - protocols: [protocol], - metadata: new Map(), - tags: new Map() - }); - // we have a connection to this peer - connectionManager.getConnections.withArgs(matchPeerId(conn.remotePeer)).returns([conn]); - // identify completes - events.safeDispatchEvent('peer:update', { - detail: { - peer: { - id: conn.remotePeer, - protocols: [protocol], - addresses: [], - metadata: new Map() - } - } - }); - await onConnectDefer.promise; - // Peer no longer supports the protocol our topology is registered for - events.safeDispatchEvent('peer:update', { - detail: { - peer: { - id: conn.remotePeer, - protocols: [], - addresses: [], - metadata: new Map() - }, - previous: { - id: conn.remotePeer, - protocols: [protocol], - addresses: [], - metadata: new Map() - } - } - }); - await onDisconnectDefer.promise; - }); - it('should not call topology handlers for transient connection', async () => { - const onConnectDefer = pDefer(); - const onDisconnectDefer = pDefer(); - // Setup connections before registrar - const remotePeerId = await createEd25519PeerId(); - const conn = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - // connection is transient - conn.transient = true; - // return connection from connection manager - connectionManager.getConnections.withArgs(matchPeerId(remotePeerId)).returns([conn]); - const topology = { - onConnect: () => { - onConnectDefer.reject(new Error('Topolgy onConnect called for transient connection')); - }, - onDisconnect: () => { - onDisconnectDefer.reject(new Error('Topolgy onDisconnect called for transient connection')); - } - }; - // Register topology for protocol - await registrar.register(protocol, topology); - // remote peer connects - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: conn - } - }); - await expect(Promise.any([ - onConnectDefer.promise, - onDisconnectDefer.promise, - new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, 1000); - }) - ])).to.eventually.not.be.rejected(); - }); - it('should call topology onConnect handler for transient connection when explicitly requested', async () => { - const onConnectDefer = pDefer(); - // Setup connections before registrar - const remotePeerId = await createEd25519PeerId(); - const conn = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - // connection is transient - conn.transient = true; - // return connection from connection manager - connectionManager.getConnections.withArgs(matchPeerId(remotePeerId)).returns([conn]); - const topology = { - notifyOnTransient: true, - onConnect: () => { - onConnectDefer.resolve(); - } - }; - // Register topology for protocol - await registrar.register(protocol, topology); - // remote peer connects - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: conn - } - }); - await expect(onConnectDefer.promise).to.eventually.be.undefined(); - }); - it('should call topology handlers for non-transient connection opened after transient connection', async () => { - const onConnectDefer = pDefer(); - let callCount = 0; - const topology = { - notifyOnTransient: true, - onConnect: () => { - callCount++; - if (callCount === 2) { - onConnectDefer.resolve(); - } - } - }; - // Register topology for protocol - await registrar.register(protocol, topology); - // Setup connections before registrar - const remotePeerId = await createEd25519PeerId(); - const transientConnection = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - transientConnection.transient = true; - const nonTransientConnection = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - nonTransientConnection.transient = false; - // return connection from connection manager - connectionManager.getConnections.withArgs(matchPeerId(remotePeerId)).returns([ - transientConnection, - nonTransientConnection - ]); - // remote peer connects over transient connection - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: transientConnection - } - }); - // remote peer opens non-transient connection - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: nonTransientConnection - } - }); - await expect(onConnectDefer.promise).to.eventually.be.undefined(); - }); - it('should be able to register and unregister a handler', async () => { - const deferred = pDefer(); - libp2p = await createLibp2pNode({ - peerId: await createEd25519PeerId(), - transports: [ - webSockets() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - deferred.resolve(components); - } - } - }); - const components = await deferred.promise; - const registrar = components.registrar; - expect(registrar.getProtocols()).to.not.have.any.keys(['/echo/1.0.0', '/echo/1.0.1']); - const echoHandler = () => { }; - await libp2p.handle(['/echo/1.0.0', '/echo/1.0.1'], echoHandler); - expect(registrar.getHandler('/echo/1.0.0')).to.have.property('handler', echoHandler); - expect(registrar.getHandler('/echo/1.0.1')).to.have.property('handler', echoHandler); - await libp2p.unhandle(['/echo/1.0.0']); - expect(registrar.getProtocols()).to.not.have.any.keys(['/echo/1.0.0']); - expect(registrar.getHandler('/echo/1.0.1')).to.have.property('handler', echoHandler); - await expect(libp2p.peerStore.get(libp2p.peerId)).to.eventually.have.deep.property('protocols', [ - '/echo/1.0.1' - ]); - }); - }); -}); -//# sourceMappingURL=registrar.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/registrar/registrar.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/registrar/registrar.spec.js.map deleted file mode 100644 index 221e63da6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/registrar/registrar.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registrar.spec.js","sourceRoot":"","sources":["../../../test/registrar/registrar.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAyB,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAA;AAC5H,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAA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2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.node.d.ts deleted file mode 100644 index e263e69a5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=transport-manager.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.node.d.ts.map deleted file mode 100644 index a4afdb959..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.node.d.ts","sourceRoot":"","sources":["../../../test/transports/transport-manager.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.node.js deleted file mode 100644 index 46a77e5fd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.node.js +++ /dev/null @@ -1,110 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { start, stop } from '@libp2p/interface/startable'; -import { FaultTolerance } from '@libp2p/interface/transport'; -import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { tcp } from '@libp2p/tcp'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core/memory'; -import { pEvent } from 'p-event'; -import pWaitFor from 'p-wait-for'; -import sinon from 'sinon'; -import { DefaultAddressManager } from '../../src/address-manager/index.js'; -import { defaultComponents } from '../../src/components.js'; -import { DefaultTransportManager } from '../../src/transport-manager.js'; -const addrs = [ - multiaddr('/ip4/127.0.0.1/tcp/0'), - multiaddr('/ip4/127.0.0.1/tcp/0') -]; -describe('Transport Manager (TCP)', () => { - let tm; - let localPeer; - let components; - before(async () => { - localPeer = await createEd25519PeerId(); - }); - beforeEach(async () => { - const events = new TypedEventEmitter(); - components = defaultComponents({ - peerId: localPeer, - events, - datastore: new MemoryDatastore(), - upgrader: mockUpgrader({ events }) - }); - components.addressManager = new DefaultAddressManager(components, { listen: addrs.map(addr => addr.toString()) }); - components.peerStore = new PersistentPeerStore(components); - tm = new DefaultTransportManager(components, { - faultTolerance: FaultTolerance.NO_FATAL - }); - components.transportManager = tm; - await start(tm); - }); - afterEach(async () => { - await tm.removeAll(); - expect(tm.getTransports()).to.be.empty(); - await stop(tm); - }); - it('should be able to add and remove a transport', async () => { - expect(tm.getTransports()).to.have.lengthOf(0); - tm.add(tcp()({ - logger: defaultLogger() - })); - expect(tm.getTransports()).to.have.lengthOf(1); - await tm.remove('@libp2p/tcp'); - expect(tm.getTransports()).to.have.lengthOf(0); - }); - it('should be able to listen', async () => { - const transport = tcp()({ - logger: defaultLogger() - }); - expect(tm.getTransports()).to.be.empty(); - tm.add(transport); - expect(tm.getTransports()).to.have.lengthOf(1); - const spyListener = sinon.spy(transport, 'createListener'); - await tm.listen(addrs); - // Ephemeral ip addresses may result in multiple listeners - expect(tm.getAddrs().length).to.equal(addrs.length); - await tm.stop(); - expect(spyListener.called).to.be.true(); - }); - it('should be able to dial', async () => { - tm.add(tcp()({ - logger: defaultLogger() - })); - await tm.listen(addrs); - const addr = tm.getAddrs().shift(); - if (addr == null) { - throw new Error('Could not find addr'); - } - const connection = await tm.dial(addr); - expect(connection).to.exist(); - await connection.close(); - }); - it('should remove listeners when they stop listening', async () => { - const transport = tcp()({ - logger: defaultLogger() - }); - tm.add(transport); - expect(tm.getListeners()).to.have.lengthOf(0); - const spyListener = sinon.spy(transport, 'createListener'); - await tm.listen(addrs); - expect(spyListener.callCount).to.equal(addrs.length); - // wait for listeners to start listening - await pWaitFor(async () => { - return tm.getListeners().length === addrs.length; - }); - // wait for listeners to stop listening - const closePromise = Promise.all(spyListener.getCalls().map(async (call) => { - return pEvent(call.returnValue, 'close'); - })); - await Promise.all(tm.getListeners().map(async (l) => { await l.close(); })); - await closePromise; - expect(tm.getListeners()).to.have.lengthOf(0); - await tm.stop(); - }); -}); -//# sourceMappingURL=transport-manager.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.node.js.map deleted file mode 100644 index ca003966e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.node.js","sourceRoot":"","sources":["../../../test/transports/transport-manager.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,GA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AAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;QAE7C,MAAM,EAAE,CAAC,IAAI,EAAE,CAAA;IACjB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.spec.d.ts deleted file mode 100644 index 9f7b811b6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=transport-manager.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.spec.d.ts.map deleted file mode 100644 index edad9dac1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.spec.d.ts","sourceRoot":"","sources":["../../../test/transports/transport-manager.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.spec.js deleted file mode 100644 index 7cbfe284f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.spec.js +++ /dev/null @@ -1,158 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { start, stop } from '@libp2p/interface/startable'; -import { FaultTolerance } from '@libp2p/interface/transport'; -import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import sinon from 'sinon'; -import { DefaultAddressManager } from '../../src/address-manager/index.js'; -import { codes as ErrorCodes } from '../../src/errors.js'; -import { createLibp2p } from '../../src/index.js'; -import { DefaultTransportManager } from '../../src/transport-manager.js'; -const listenAddr = multiaddr('/ip4/127.0.0.1/tcp/0'); -describe('Transport Manager (WebSockets)', () => { - let tm; - let components; - beforeEach(async () => { - const events = new TypedEventEmitter(); - components = { - peerId: await createEd25519PeerId(), - events, - upgrader: mockUpgrader({ events }), - logger: defaultLogger() - }; - components.addressManager = new DefaultAddressManager(components, { listen: [listenAddr.toString()] }); - tm = new DefaultTransportManager(components, { - faultTolerance: FaultTolerance.NO_FATAL - }); - await start(tm); - }); - afterEach(async () => { - await tm.removeAll(); - await stop(tm); - expect(tm.getTransports()).to.be.empty(); - }); - it('should be able to add and remove a transport', async () => { - const transport = webSockets({ - filter: filters.all - }); - expect(tm.getTransports()).to.have.lengthOf(0); - tm.add(transport({ - logger: defaultLogger() - })); - expect(tm.getTransports()).to.have.lengthOf(1); - await tm.remove('@libp2p/websockets'); - expect(tm.getTransports()).to.have.lengthOf(0); - }); - it('should not be able to add a transport twice', async () => { - tm.add(webSockets()({ - logger: defaultLogger() - })); - expect(() => { - tm.add(webSockets()({ - logger: defaultLogger() - })); - }) - .to.throw() - .and.to.have.property('code', ErrorCodes.ERR_DUPLICATE_TRANSPORT); - }); - it('should be able to dial', async () => { - tm.add(webSockets({ filter: filters.all })({ - logger: defaultLogger() - })); - const addr = multiaddr(process.env.RELAY_MULTIADDR); - const connection = await tm.dial(addr); - expect(connection).to.exist(); - await connection.close(); - }); - it('should fail to dial an unsupported address', async () => { - tm.add(webSockets({ filter: filters.all })({ - logger: defaultLogger() - })); - const addr = multiaddr('/ip4/127.0.0.1/tcp/0'); - await expect(tm.dial(addr)) - .to.eventually.be.rejected() - .and.to.have.property('code', ErrorCodes.ERR_TRANSPORT_UNAVAILABLE); - }); - it('should fail to listen with no valid address', async () => { - tm = new DefaultTransportManager(components); - tm.add(webSockets({ filter: filters.all })({ - logger: defaultLogger() - })); - await expect(start(tm)) - .to.eventually.be.rejected() - .and.to.have.property('code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - await stop(tm); - }); -}); -describe('libp2p.transportManager (dial only)', () => { - let peerId; - let libp2p; - before(async () => { - peerId = await createEd25519PeerId(); - }); - afterEach(async () => { - sinon.restore(); - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('fails to start if multiaddr fails to listen', async () => { - libp2p = await createLibp2p({ - peerId, - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0'] - }, - transports: [webSockets()], - connectionEncryption: [plaintext()], - start: false - }); - await expect(libp2p.start()).to.eventually.be.rejected - .with.property('code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('does not fail to start if provided listen multiaddr are not compatible to configured transports (when supporting dial only mode)', async () => { - libp2p = await createLibp2p({ - peerId, - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0'] - }, - transportManager: { - faultTolerance: FaultTolerance.NO_FATAL - }, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ], - start: false - }); - await expect(libp2p.start()).to.eventually.be.undefined(); - }); - it('does not fail to start if provided listen multiaddr fail to listen on configured transports (when supporting dial only mode)', async () => { - libp2p = await createLibp2p({ - peerId, - addresses: { - listen: ['/ip4/127.0.0.1/tcp/12345/p2p/QmWDn2LY8nannvSWJzruUYoLZ4vV83vfCBwd8DipvdgQc3/p2p-circuit'] - }, - transportManager: { - faultTolerance: FaultTolerance.NO_FATAL - }, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ], - start: false - }); - await expect(libp2p.start()).to.eventually.be.undefined(); - }); -}); -//# sourceMappingURL=transport-manager.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.spec.js.map deleted file mode 100644 index fa5f523bb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/transports/transport-manager.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.spec.js","sourceRoot":"","sources":["../../../test/transports/transport-manager.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAC1E,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,qBAAqB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;SACb,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,CAAA;IAC3D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,8HAA8H,EAAE,KAAK,IAAI,EAAE;QAC5I,MAAM,GAAG,MAAM,YAAY,CAAC;YAC1B,MAAM;YACN,SAAS,EAAE;gBACT,MAAM,EAAE,CAAC,yFAAyF,CAAC;aACpG;YACD,gBAAgB,EAAE;gBAChB,cAAc,EAAE,cAAc,CAAC,QAAQ;aACxC;YACD,UAAU,EAAE;gBACV,UAAU,EAAE;aACb;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;YACD,KAAK,EAAE,KAAK;SACb,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,CAAA;IAC3D,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/upgrading/upgrader.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/upgrading/upgrader.spec.d.ts deleted file mode 100644 index 9763583dc..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/upgrading/upgrader.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=upgrader.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/upgrading/upgrader.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/upgrading/upgrader.spec.d.ts.map deleted file mode 100644 index aa7115453..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/upgrading/upgrader.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"upgrader.spec.d.ts","sourceRoot":"","sources":["../../../test/upgrading/upgrader.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/upgrading/upgrader.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/upgrading/upgrader.spec.js deleted file mode 100644 index 156069e09..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/upgrading/upgrader.spec.js +++ /dev/null @@ -1,857 +0,0 @@ -/* eslint-env mocha */ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { circuitRelayTransport } from '@libp2p/circuit-relay-v2'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockConnectionGater, mockConnectionManager, mockMultiaddrConnPair, mockRegistrar, mockStream, mockMuxer } from '@libp2p/interface-compliance-tests/mocks'; -import { mplex } from '@libp2p/mplex'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core'; -import delay from 'delay'; -import all from 'it-all'; -import drain from 'it-drain'; -import { pipe } from 'it-pipe'; -import pDefer from 'p-defer'; -import { pEvent } from 'p-event'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { Uint8ArrayList } from 'uint8arraylist'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { defaultComponents } from '../../src/components.js'; -import { codes } from '../../src/errors.js'; -import { createLibp2p } from '../../src/index.js'; -import { DEFAULT_MAX_OUTBOUND_STREAMS } from '../../src/registrar.js'; -import { DefaultUpgrader } from '../../src/upgrader.js'; -const addrs = [ - multiaddr('/ip4/127.0.0.1/tcp/0'), - multiaddr('/ip4/127.0.0.1/tcp/0') -]; -describe('Upgrader', () => { - let localUpgrader; - let localMuxerFactory; - let localYamuxerFactory; - let localConnectionEncrypter; - let localConnectionProtector; - let remoteUpgrader; - let remoteMuxerFactory; - let remoteYamuxerFactory; - let remoteConnectionEncrypter; - let remoteConnectionProtector; - let localPeer; - let remotePeer; - let localComponents; - let remoteComponents; - beforeEach(async () => { - ([ - localPeer, - remotePeer - ] = await Promise.all([ - createEd25519PeerId(), - createEd25519PeerId() - ])); - localConnectionProtector = stubInterface(); - localConnectionProtector.protect.resolvesArg(0); - localComponents = defaultComponents({ - peerId: localPeer, - connectionGater: mockConnectionGater(), - registrar: mockRegistrar(), - datastore: new MemoryDatastore(), - connectionProtector: localConnectionProtector, - events: new TypedEventEmitter() - }); - localComponents.peerStore = new PersistentPeerStore(localComponents); - localComponents.connectionManager = mockConnectionManager(localComponents); - localMuxerFactory = mplex()(localComponents); - localYamuxerFactory = yamux()(); - localConnectionEncrypter = plaintext()(localComponents); - localUpgrader = new DefaultUpgrader(localComponents, { - connectionEncryption: [ - localConnectionEncrypter - ], - muxers: [ - localMuxerFactory, - localYamuxerFactory - ], - inboundUpgradeTimeout: 1000 - }); - remoteConnectionProtector = stubInterface(); - remoteConnectionProtector.protect.resolvesArg(0); - remoteComponents = defaultComponents({ - peerId: remotePeer, - connectionGater: mockConnectionGater(), - registrar: mockRegistrar(), - datastore: new MemoryDatastore(), - connectionProtector: remoteConnectionProtector, - events: new TypedEventEmitter() - }); - remoteComponents.peerStore = new PersistentPeerStore(remoteComponents); - remoteComponents.connectionManager = mockConnectionManager(remoteComponents); - remoteMuxerFactory = mplex()(remoteComponents); - remoteYamuxerFactory = yamux()(); - remoteConnectionEncrypter = plaintext()(remoteComponents); - remoteUpgrader = new DefaultUpgrader(remoteComponents, { - connectionEncryption: [ - remoteConnectionEncrypter - ], - muxers: [ - remoteMuxerFactory, - remoteYamuxerFactory - ], - inboundUpgradeTimeout: 1000 - }); - await localComponents.registrar.handle('/echo/1.0.0', ({ stream }) => { - void pipe(stream, stream); - }, { - maxInboundStreams: 10, - maxOutboundStreams: 10 - }); - await remoteComponents.registrar.handle('/echo/1.0.0', ({ stream }) => { - void pipe(stream, stream); - }, { - maxInboundStreams: 10, - maxOutboundStreams: 10 - }); - }); - afterEach(() => { - sinon.restore(); - }); - it('should upgrade with valid muxers and crypto', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - const stream = await connections[0].newStream('/echo/1.0.0'); - expect(stream).to.have.property('protocol', '/echo/1.0.0'); - const hello = uint8ArrayFromString('hello there!'); - const result = await pipe([hello], stream, function toBuffer(source) { - return (async function* () { - for await (const val of source) - yield val.slice(); - })(); - }, async (source) => all(source)); - expect(result).to.eql([hello]); - }); - it('should upgrade with only crypto', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - // No available muxers - localUpgrader = new DefaultUpgrader(localComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [], - inboundUpgradeTimeout: 1000 - }); - remoteUpgrader = new DefaultUpgrader(remoteComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [], - inboundUpgradeTimeout: 1000 - }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - await expect(connections[0].newStream('/echo/1.0.0')).to.be.rejected(); - // Verify the MultiaddrConnection close method is called - const inboundCloseSpy = sinon.spy(inbound, 'close'); - const outboundCloseSpy = sinon.spy(outbound, 'close'); - await Promise.all(connections.map(async (conn) => { await conn.close(); })); - expect(inboundCloseSpy.callCount).to.equal(1); - expect(outboundCloseSpy.callCount).to.equal(1); - }); - it('should use a private connection protector when provided', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const protector = { - async protect(connection) { - return connection; - } - }; - const protectorProtectSpy = sinon.spy(protector, 'protect'); - localComponents.connectionProtector = protector; - remoteComponents.connectionProtector = protector; - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - const stream = await connections[0].newStream('/echo/1.0.0'); - expect(stream).to.have.property('protocol', '/echo/1.0.0'); - const hello = uint8ArrayFromString('hello there!'); - const result = await pipe([hello], stream, function toBuffer(source) { - return (async function* () { - for await (const val of source) - yield val.slice(); - })(); - }, async (source) => all(source)); - expect(result).to.eql([hello]); - expect(protectorProtectSpy.callCount).to.eql(2); - }); - it('should fail if crypto fails', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - class BoomCrypto { - static protocol = '/insecure'; - protocol = '/insecure'; - async secureInbound() { throw new Error('Boom'); } - async secureOutbound() { throw new Error('Boom'); } - } - localUpgrader = new DefaultUpgrader(localComponents, { - connectionEncryption: [ - new BoomCrypto() - ], - muxers: [], - inboundUpgradeTimeout: 1000 - }); - remoteUpgrader = new DefaultUpgrader(remoteComponents, { - connectionEncryption: [ - new BoomCrypto() - ], - muxers: [], - inboundUpgradeTimeout: 1000 - }); - // Wait for the results of each side of the connection - const results = await Promise.allSettled([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - // Ensure both sides fail - expect(results).to.have.length(2); - results.forEach(result => { - expect(result).to.have.property('status', 'rejected'); - expect(result).to.have.nested.property('reason.code', codes.ERR_ENCRYPTION_FAILED); - }); - }); - it('should clear timeout if upgrade is successful', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - localUpgrader = new DefaultUpgrader(localComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [ - yamux()() - ], - inboundUpgradeTimeout: 1000 - }); - remoteUpgrader = new DefaultUpgrader(remoteComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [ - yamux()() - ], - inboundUpgradeTimeout: 1000 - }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - await delay(2000); - expect(connections).to.have.length(2); - connections.forEach(conn => { - conn.close().catch(() => { - throw new Error('Failed to close connection'); - }); - }); - }); - it('should fail if muxers do not match', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - class OtherMuxer { - protocol = '/muxer-local'; - streams = []; - newStream(name) { - throw new Error('Not implemented'); - } - source = (async function* () { - yield* []; - })(); - async sink() { } - async close() { } - abort() { } - } - class OtherMuxerFactory { - protocol = '/muxer-local'; - createStreamMuxer(init) { - return new OtherMuxer(); - } - } - class OtherOtherMuxerFactory { - protocol = '/muxer-local-other'; - createStreamMuxer(init) { - return new OtherMuxer(); - } - } - localUpgrader = new DefaultUpgrader(localComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [ - new OtherMuxerFactory(), - new OtherOtherMuxerFactory() - ], - inboundUpgradeTimeout: 1000 - }); - remoteUpgrader = new DefaultUpgrader(remoteComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [ - yamux()(), - mplex()(localComponents) - ], - inboundUpgradeTimeout: 1000 - }); - // Wait for the results of each side of the connection - const results = await Promise.allSettled([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - // Ensure both sides fail - expect(results).to.have.length(2); - results.forEach(result => { - expect(result).to.have.property('status', 'rejected'); - expect(result).to.have.nested.property('reason.code', codes.ERR_MUXER_UNAVAILABLE); - }); - }); - it('should map getStreams and close methods', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - // Create a few streams, at least 1 in each direction - // use multiple protocols to trigger regular multistream select - await connections[0].newStream(['/echo/1.0.0', '/echo/1.0.1']); - await connections[1].newStream(['/echo/1.0.0', '/echo/1.0.1']); - await connections[0].newStream(['/echo/1.0.0', '/echo/1.0.1']); - connections.forEach(conn => { - expect(conn.streams).to.have.length(3); - }); - // Verify the MultiaddrConnection close method is called - const inboundCloseSpy = sinon.spy(inbound, 'close'); - const outboundCloseSpy = sinon.spy(outbound, 'close'); - await Promise.all(connections.map(async (conn) => { await conn.close(); })); - expect(inboundCloseSpy.callCount).to.equal(1); - expect(outboundCloseSpy.callCount).to.equal(1); - }); - it('should call connection handlers', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const localConnectionEventReceived = pDefer(); - const localConnectionEndEventReceived = pDefer(); - const remoteConnectionEventReceived = pDefer(); - const remoteConnectionEndEventReceived = pDefer(); - localComponents.events.addEventListener('connection:open', () => { - localConnectionEventReceived.resolve(); - }); - localComponents.events.addEventListener('connection:close', () => { - localConnectionEndEventReceived.resolve(); - }); - remoteComponents.events.addEventListener('connection:open', () => { - remoteConnectionEventReceived.resolve(); - }); - remoteComponents.events.addEventListener('connection:close', () => { - remoteConnectionEndEventReceived.resolve(); - }); - // Verify onConnection is called with the connection - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - await Promise.all([ - localConnectionEventReceived.promise, - remoteConnectionEventReceived.promise - ]); - // Verify onConnectionEnd is called with the connection - await Promise.all(connections.map(async (conn) => { await conn.close(); })); - await Promise.all([ - localConnectionEndEventReceived.promise, - remoteConnectionEndEventReceived.promise - ]); - }); - it('should fail to create a stream for an unsupported protocol', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - const results = await Promise.allSettled([ - connections[0].newStream('/unsupported/1.0.0'), - connections[1].newStream('/unsupported/1.0.0') - ]); - expect(results).to.have.length(2); - results.forEach(result => { - expect(result).to.have.property('status', 'rejected'); - expect(result).to.have.nested.property('reason.code', codes.ERR_UNSUPPORTED_PROTOCOL); - }); - }); - it('should abort protocol selection for slow streams', async () => { - const createStreamMuxerSpy = sinon.spy(localMuxerFactory, 'createStreamMuxer'); - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - // 10 ms timeout - const signal = AbortSignal.timeout(10); - // should have created muxer for connection - expect(createStreamMuxerSpy).to.have.property('callCount', 1); - // create mock muxed stream that never sends data - const muxer = createStreamMuxerSpy.getCall(0).returnValue; - muxer.newStream = () => { - return mockStream({ - source: (async function* () { - // longer than the timeout - await delay(1000); - yield new Uint8ArrayList(); - }()), - sink: drain - }); - }; - await expect(connections[0].newStream(['/echo/1.0.0', '/echo/1.0.1'], { - signal - })) - .to.eventually.be.rejected.with.property('code', 'ABORT_ERR'); - }); - it('should close streams when protocol negotiation fails', async () => { - await remoteComponents.registrar.unhandle('/echo/1.0.0'); - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections[0].streams).to.have.lengthOf(0); - expect(connections[1].streams).to.have.lengthOf(0); - await expect(connections[0].newStream(['/echo/1.0.0', '/echo/1.0.1'])) - .to.eventually.be.rejected.with.property('code', 'ERR_UNSUPPORTED_PROTOCOL'); - // wait for remote to close - await delay(100); - expect(connections[0].streams).to.have.lengthOf(0); - expect(connections[1].streams).to.have.lengthOf(0); - }); - it('should allow skipping encryption, protection and muxing', async () => { - const localStreamMuxerFactorySpy = sinon.spy(localMuxerFactory, 'createStreamMuxer'); - const localMuxerFactoryOverride = mockMuxer(); - const localStreamMuxerFactoryOverrideSpy = sinon.spy(localMuxerFactoryOverride, 'createStreamMuxer'); - const localConnectionEncrypterSpy = sinon.spy(localConnectionEncrypter, 'secureOutbound'); - const remoteStreamMuxerFactorySpy = sinon.spy(remoteMuxerFactory, 'createStreamMuxer'); - const remoteMuxerFactoryOverride = mockMuxer(); - const remoteStreamMuxerFactoryOverrideSpy = sinon.spy(remoteMuxerFactoryOverride, 'createStreamMuxer'); - const remoteConnectionEncrypterSpy = sinon.spy(remoteConnectionEncrypter, 'secureInbound'); - const { inbound, outbound } = mockMultiaddrConnPair({ - addrs: [ - multiaddr('/ip4/127.0.0.1/tcp/0').encapsulate(`/p2p/${remotePeer.toString()}`), - multiaddr('/ip4/127.0.0.1/tcp/0') - ], - remotePeer - }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound, { - skipEncryption: true, - skipProtection: true, - muxerFactory: localMuxerFactoryOverride - }), - remoteUpgrader.upgradeInbound(inbound, { - skipEncryption: true, - skipProtection: true, - muxerFactory: remoteMuxerFactoryOverride - }) - ]); - expect(connections).to.have.length(2); - const stream = await connections[0].newStream(['/echo/1.0.0', '/echo/1.0.1']); - expect(stream).to.have.property('protocol', '/echo/1.0.0'); - const hello = uint8ArrayFromString('hello there!'); - const result = await pipe([hello], stream, function toBuffer(source) { - return (async function* () { - for await (const val of source) - yield val.slice(); - })(); - }, async (source) => all(source)); - expect(result).to.eql([hello]); - expect(localStreamMuxerFactorySpy.callCount).to.equal(0, 'did not use passed stream muxer factory'); - expect(localStreamMuxerFactoryOverrideSpy.callCount).to.equal(1, 'did not use passed stream muxer factory'); - expect(remoteStreamMuxerFactorySpy.callCount).to.equal(0, 'did not use passed stream muxer factory'); - expect(remoteStreamMuxerFactoryOverrideSpy.callCount).to.equal(1, 'did not use passed stream muxer factory'); - expect(localConnectionEncrypterSpy.callCount).to.equal(0, 'used local connection encrypter'); - expect(remoteConnectionEncrypterSpy.callCount).to.equal(0, 'used remote connection encrypter'); - expect(localConnectionProtector.protect.callCount).to.equal(0, 'used local connection protector'); - expect(remoteConnectionProtector.protect.callCount).to.equal(0, 'used remote connection protector'); - }); -}); -describe('libp2p.upgrader', () => { - let peers; - let libp2p; - let remoteLibp2p; - before(async () => { - peers = await Promise.all([ - createEd25519PeerId(), - createEd25519PeerId() - ]); - }); - afterEach(async () => { - sinon.restore(); - if (libp2p != null) { - await libp2p.stop(); - } - if (remoteLibp2p != null) { - await remoteLibp2p.stop(); - } - }); - it('should create an Upgrader', async () => { - const deferred = pDefer(); - const protector = { - async protect(connection) { - return connection; - } - }; - libp2p = await createLibp2p({ - peerId: peers[0], - transports: [ - webSockets() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionProtector: () => protector, - services: { - test: (components) => { - deferred.resolve(components); - } - } - }); - const components = await deferred.promise; - expect(components.upgrader).to.exist(); - expect(components.connectionProtector).to.exist(); - }); - it('should return muxed streams', async () => { - const localDeferred = pDefer(); - const remoteDeferred = pDefer(); - const remotePeer = peers[1]; - libp2p = await createLibp2p({ - peerId: peers[0], - transports: [ - webSockets() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - localDeferred.resolve(components); - } - } - }); - const echoHandler = () => { }; - await libp2p.handle(['/echo/1.0.0'], echoHandler); - remoteLibp2p = await createLibp2p({ - peerId: remotePeer, - transports: [ - webSockets() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - remoteDeferred.resolve(components); - } - } - }); - await remoteLibp2p.handle('/echo/1.0.0', echoHandler); - const localComponents = await localDeferred.promise; - const remoteComponents = await remoteDeferred.promise; - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const [localConnection] = await Promise.all([ - localComponents.upgrader.upgradeOutbound(outbound), - remoteComponents.upgrader.upgradeInbound(inbound) - ]); - const remoteLibp2pUpgraderOnStreamSpy = sinon.spy(remoteComponents.upgrader, '_onStream'); - const stream = await localConnection.newStream(['/echo/1.0.0', '/echo/1.0.1']); - expect(stream).to.include.keys(['id', 'sink', 'source']); - const [arg0] = remoteLibp2pUpgraderOnStreamSpy.getCall(0).args; - expect(arg0.stream).to.include.keys(['id', 'sink', 'source']); - }); - it('should emit connect and disconnect events', async () => { - const remotePeer = peers[1]; - libp2p = await createLibp2p({ - peerId: peers[0], - addresses: { - listen: [ - `${process.env.RELAY_MULTIADDR}/p2p-circuit` - ] - }, - transports: [ - webSockets({ - filter: filters.all - }), - circuitRelayTransport() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }); - await libp2p.start(); - remoteLibp2p = await createLibp2p({ - peerId: remotePeer, - transports: [ - webSockets({ - filter: filters.all - }), - circuitRelayTransport() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }); - await remoteLibp2p.start(); - // Upgrade and check the connect event - const connectionPromise = pEvent(libp2p, 'connection:open'); - const connection = await remoteLibp2p.dial(libp2p.getMultiaddrs()); - const connectEvent = await connectionPromise; - if (connectEvent.type !== 'connection:open') { - throw new Error(`Incorrect event type, expected: 'connection:open' actual: ${connectEvent.type}`); - } - expect(remotePeer.equals(connectEvent.detail.remotePeer)).to.equal(true); - const disconnectionPromise = pEvent(libp2p, 'peer:disconnect'); - // Close and check the disconnect event - await connection.close(); - const disconnectEvent = await disconnectionPromise; - if (disconnectEvent.type !== 'peer:disconnect') { - throw new Error(`Incorrect event type, expected: 'peer:disconnect' actual: ${disconnectEvent.type}`); - } - expect(remotePeer.equals(disconnectEvent.detail)).to.equal(true); - }); - it('should limit the number of incoming streams that can be opened using a protocol', async () => { - const localDeferred = pDefer(); - const remoteDeferred = pDefer(); - const protocol = '/a-test-protocol/1.0.0'; - const remotePeer = peers[1]; - libp2p = await createLibp2p({ - peerId: peers[0], - transports: [ - webSockets() - ], - streamMuxers: [ - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - localDeferred.resolve(components); - } - }, - connectionGater: mockConnectionGater() - }); - remoteLibp2p = await createLibp2p({ - peerId: remotePeer, - transports: [ - webSockets() - ], - streamMuxers: [ - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - remoteDeferred.resolve(components); - } - }, - connectionGater: mockConnectionGater() - }); - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const localComponents = await localDeferred.promise; - const remoteComponents = await remoteDeferred.promise; - const [localToRemote] = await Promise.all([ - localComponents.upgrader.upgradeOutbound(outbound), - remoteComponents.upgrader.upgradeInbound(inbound) - ]); - let streamCount = 0; - await libp2p.handle(protocol, (data) => { }, { - maxInboundStreams: 10, - maxOutboundStreams: 10 - }); - await remoteLibp2p.handle(protocol, (data) => { - streamCount++; - }, { - maxInboundStreams: 1, - maxOutboundStreams: 1 - }); - expect(streamCount).to.equal(0); - await localToRemote.newStream([protocol, '/other/1.0.0']); - expect(streamCount).to.equal(1); - const s = await localToRemote.newStream(protocol); - await expect(drain(s.source)).to.eventually.be.rejected() - .with.property('code', 'ERR_STREAM_RESET'); - }); - it('should limit the number of outgoing streams that can be opened using a protocol', async () => { - const localDeferred = pDefer(); - const remoteDeferred = pDefer(); - const protocol = '/a-test-protocol/1.0.0'; - const remotePeer = peers[1]; - libp2p = await createLibp2p({ - peerId: peers[0], - transports: [ - webSockets() - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - localDeferred.resolve(components); - } - }, - connectionGater: mockConnectionGater() - }); - remoteLibp2p = await createLibp2p({ - peerId: remotePeer, - transports: [ - webSockets() - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - remoteDeferred.resolve(components); - } - } - }); - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const localComponents = await localDeferred.promise; - const remoteComponents = await remoteDeferred.promise; - const [localToRemote] = await Promise.all([ - localComponents.upgrader.upgradeOutbound(outbound), - remoteComponents.upgrader.upgradeInbound(inbound) - ]); - let streamCount = 0; - await libp2p.handle(protocol, (data) => { }, { - maxInboundStreams: 1, - maxOutboundStreams: 1 - }); - await remoteLibp2p.handle(protocol, (data) => { - streamCount++; - }, { - maxInboundStreams: 10, - maxOutboundStreams: 10 - }); - expect(streamCount).to.equal(0); - await localToRemote.newStream([protocol, '/other/1.0.0']); - expect(streamCount).to.equal(1); - await expect(localToRemote.newStream(protocol)).to.eventually.be.rejected() - .with.property('code', codes.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS); - }); - it('should allow overriding the number of outgoing streams that can be opened using a protocol without a handler', async () => { - const localDeferred = pDefer(); - const remoteDeferred = pDefer(); - const protocol = '/a-test-protocol/1.0.0'; - const remotePeer = peers[1]; - libp2p = await createLibp2p({ - peerId: peers[0], - transports: [ - webSockets() - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - localDeferred.resolve(components); - } - }, - connectionGater: mockConnectionGater() - }); - remoteLibp2p = await createLibp2p({ - peerId: remotePeer, - transports: [ - webSockets() - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - remoteDeferred.resolve(components); - } - } - }); - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const localComponents = await localDeferred.promise; - const remoteComponents = await remoteDeferred.promise; - const [localToRemote] = await Promise.all([ - localComponents.upgrader.upgradeOutbound(outbound), - remoteComponents.upgrader.upgradeInbound(inbound) - ]); - let streamCount = 0; - const limit = DEFAULT_MAX_OUTBOUND_STREAMS + 1; - await remoteLibp2p.handle(protocol, (data) => { - streamCount++; - }, { - maxInboundStreams: limit + 1, - maxOutboundStreams: 10 - }); - expect(streamCount).to.equal(0); - for (let i = 0; i < limit; i++) { - await localToRemote.newStream([protocol, '/other/1.0.0'], { - maxOutboundStreams: limit - }); - } - expect(streamCount).to.equal(limit); - // should reject without overriding limit - await expect(localToRemote.newStream(protocol)).to.eventually.be.rejected() - .with.property('code', codes.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS); - // should reject even with overriding limit - await expect(localToRemote.newStream(protocol, { - maxOutboundStreams: limit - })).to.eventually.be.rejected() - .with.property('code', codes.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS); - }); -}); -//# sourceMappingURL=upgrader.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/upgrading/upgrader.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/upgrading/upgrader.spec.js.map deleted file mode 100644 index 216c17147..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/test/upgrading/upgrader.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"upgrader.spec.js","sourceRoot":"","sources":["../../../test/upgrading/upgrader.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAClK,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EA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YACD,iBAAiB,EAAE,KAAK,GAAG,CAAC;YAC5B,kBAAkB,EAAE,EAAE;SACvB,CAAC,CAAA;QAEF,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAE/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;YAC9B,MAAM,aAAa,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,cAAc,CAAC,EAAE;gBACxD,kBAAkB,EAAE,KAAK;aAC1B,CAAC,CAAA;SACH;QAED,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAEnC,yCAAyC;QACzC,MAAM,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE;aACxE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,sCAAsC,CAAC,CAAA;QAEtE,2CAA2C;QAC3C,MAAM,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,EAAE;YAC7C,kBAAkB,EAAE,KAAK;SAC1B,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE;aAC5B,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,sCAAsC,CAAC,CAAA;IACxE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/tsconfig.tsbuildinfo deleted file mode 100644 index 92126c681..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../interface/dist/src/errors.d.ts","../../interface/dist/src/startable.d.ts","../../../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../../../node_modules/multiformats/dist/types/src/block/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../../../node_modules/multiformats/dist/types/src/link/interface.d.ts","../../../node_modules/multiformats/dist/types/src/cid.d.ts","../../interface/dist/src/peer-id/index.d.ts","../../logger/dist/src/index.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../../../node_modules/it-stream-types/dist/src/index.d.ts","../../../node_modules/uint8arraylist/dist/src/index.d.ts","../../interface/dist/src/connection/index.d.ts","../../interface/dist/src/peer-info/index.d.ts","../../interface/dist/src/content-routing/index.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../interface/dist/src/events.d.ts","../../interface/dist/src/metrics/index.d.ts","../../interface/dist/src/peer-routing/index.d.ts","../../interface/dist/src/peer-store/index.d.ts","../../interface/dist/src/stream-handler/index.d.ts","../../interface/dist/src/topology/index.d.ts","../../interface/dist/src/stream-muxer/index.d.ts","../../interface/dist/src/transport/index.d.ts","../../interface/dist/src/index.d.ts","../../interface/dist/src/connection-gater/index.d.ts","../../interface-internal/dist/src/address-manager/index.d.ts","../../peer-collections/dist/src/map.d.ts","../../peer-collections/dist/src/set.d.ts","../../peer-collections/dist/src/list.d.ts","../../peer-collections/dist/src/index.d.ts","../../interface-internal/dist/src/connection-manager/index.d.ts","../../interface-internal/dist/src/registrar/index.d.ts","../../interface-internal/dist/src/transport-manager/index.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../../../node_modules/multiformats/dist/types/src/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../../../node_modules/multiformats/dist/types/src/varint.d.ts","../../../node_modules/multiformats/dist/types/src/bytes.d.ts","../../../node_modules/multiformats/dist/types/src/index.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/raw.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/json.d.ts","../../../node_modules/multiformats/dist/types/src/bases/base.d.ts","../../../node_modules/multiformats/dist/types/src/basics.d.ts","../../../node_modules/uint8arrays/dist/src/util/bases.d.ts","../../../node_modules/uint8arrays/dist/src/to-string.d.ts","../../../node_modules/interface-datastore/dist/src/key.d.ts","../../../node_modules/interface-store/dist/src/index.d.ts","../../../node_modules/interface-datastore/dist/src/index.d.ts","../src/components.ts","../../utils/dist/src/address-sort.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/resolvers/index.d.ts","../../../node_modules/merge-options/index.d.ts","../src/errors.ts","../../crypto/dist/src/keys/ed25519-class.d.ts","../../crypto/dist/src/keys/interface.d.ts","../../crypto/dist/src/keys/ecdh.d.ts","../../crypto/dist/src/keys/ephemeral-keys.d.ts","../../crypto/dist/src/keys/key-stretcher.d.ts","../../../node_modules/protons-runtime/dist/src/codec.d.ts","../../../node_modules/protons-runtime/dist/src/decode.d.ts","../../../node_modules/protons-runtime/dist/src/encode.d.ts","../../../node_modules/protons-runtime/dist/src/codecs/enum.d.ts","../../../node_modules/protons-runtime/dist/src/codecs/message.d.ts","../../../node_modules/protons-runtime/dist/src/utils/reader.d.ts","../../../node_modules/protons-runtime/dist/src/utils/writer.d.ts","../../../node_modules/protons-runtime/dist/src/index.d.ts","../../crypto/dist/src/keys/keys.d.ts","../../crypto/dist/src/keys/rsa-class.d.ts","../../crypto/dist/src/keys/secp256k1-class.d.ts","../../interface/dist/src/keys/index.d.ts","../../crypto/dist/src/keys/index.d.ts","../../interface/dist/src/peer-discovery/index.d.ts","../../peer-id/dist/src/index.d.ts","../../peer-id-factory/dist/src/index.d.ts","../../peer-store/dist/src/index.d.ts","../../../node_modules/datastore-core/dist/src/base.d.ts","../../../node_modules/datastore-core/dist/src/memory.d.ts","../../../node_modules/uint8arrays/dist/src/concat.d.ts","../../../node_modules/uint8arrays/dist/src/from-string.d.ts","../src/address-manager/utils.ts","../src/address-manager/index.ts","../src/config/connection-gater.ts","../../interface/dist/src/peer-store/tags.d.ts","../../../node_modules/rate-limiter-flexible/lib/index.d.ts","../src/get-peer.ts","../../../node_modules/eventemitter3/index.d.ts","../../../node_modules/p-queue/dist/queue.d.ts","../../../node_modules/p-queue/dist/options.d.ts","../../../node_modules/p-queue/dist/priority-queue.d.ts","../../../node_modules/p-queue/dist/index.d.ts","../../utils/dist/src/peer-job-queue.d.ts","../src/connection-manager/constants.defaults.ts","../src/connection-manager/constants.ts","../src/connection-manager/auto-dial.ts","../src/connection-manager/connection-pruner.ts","../../../node_modules/any-signal/dist/src/index.d.ts","../../../node_modules/p-defer/index.d.ts","../src/connection-manager/utils.ts","../src/connection-manager/dial-queue.ts","../src/connection-manager/index.ts","../../../node_modules/it-merge/dist/src/index.d.ts","../../../node_modules/it-pipe/dist/src/index.d.ts","../../../node_modules/it-filter/dist/src/index.d.ts","../../../node_modules/it-map/dist/src/index.d.ts","../src/content-routing/utils.ts","../src/content-routing/index.ts","../../../node_modules/it-first/dist/src/index.d.ts","../src/peer-routing.ts","../src/registrar.ts","../../interface/dist/src/metrics/tracked-map.d.ts","../src/transport-manager.ts","../../multistream-select/dist/src/constants.d.ts","../../../node_modules/it-byte-stream/dist/src/index.d.ts","../../../node_modules/it-length-prefixed/dist/src/encode.d.ts","../../../node_modules/it-reader/dist/src/index.d.ts","../../../node_modules/it-length-prefixed/dist/src/decode.d.ts","../../../node_modules/it-length-prefixed/dist/src/index.d.ts","../../../node_modules/it-length-prefixed-stream/dist/src/index.d.ts","../../multistream-select/dist/src/select.d.ts","../../multistream-select/dist/src/handle.d.ts","../../multistream-select/dist/src/index.d.ts","../src/connection/index.ts","../../interface/dist/src/connection-encrypter/index.d.ts","../src/upgrader.ts","../src/version.ts","../src/libp2p.ts","../src/index.ts","../src/config.ts","../../../node_modules/private-ip/lib/index.d.ts","../src/config/connection-gater.browser.ts","../src/connection-manager/constants.browser.ts","../../../node_modules/protobufjs/index.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.d.ts","../../../node_modules/it-pushable/dist/src/index.d.ts","../../interface/dist/src/pubsub/index.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message-cache.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-stats.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/compute-score.d.ts","../../../node_modules/denque/index.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/message-deliveries.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/metrics.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/set.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/index.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/tracer.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/config.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/stream.d.ts","../../../node_modules/protobufjs/minimal.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/decoderpc.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/@types/basic.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/proto/payload.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/@types/libp2p.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/nonce.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/@types/handshake.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/crypto.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/noise.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/crypto/js.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/index.d.ts","../../../node_modules/@chainsafe/libp2p-yamux/dist/src/config.d.ts","../../../node_modules/@chainsafe/libp2p-yamux/dist/src/frame.d.ts","../../utils/dist/src/abstract-stream.d.ts","../../../node_modules/@chainsafe/libp2p-yamux/dist/src/stream.d.ts","../../../node_modules/@chainsafe/libp2p-yamux/dist/src/muxer.d.ts","../../../node_modules/@chainsafe/libp2p-yamux/dist/src/index.d.ts","../../transport-circuit-relay-v2/dist/src/pb/index.d.ts","../../../node_modules/it-protobuf-stream/dist/src/index.d.ts","../../transport-circuit-relay-v2/dist/src/server/advert-service.d.ts","../../transport-circuit-relay-v2/dist/src/server/reservation-store.d.ts","../../transport-circuit-relay-v2/dist/src/server/index.d.ts","../../transport-circuit-relay-v2/dist/src/transport/discovery.d.ts","../../transport-circuit-relay-v2/dist/src/transport/reservation-store.d.ts","../../transport-circuit-relay-v2/dist/src/transport/index.d.ts","../../transport-circuit-relay-v2/dist/src/constants.d.ts","../../transport-circuit-relay-v2/dist/src/index.d.ts","../../../node_modules/@libp2p/daemon-protocol/dist/src/index.d.ts","../../../node_modules/@libp2p/daemon-protocol/dist/src/stream-handler.d.ts","../../../node_modules/@libp2p/daemon-client/dist/src/index.d.ts","../../kad-dht/dist/src/providers.d.ts","../../../node_modules/progress-events/dist/src/index.d.ts","../../kad-dht/dist/src/record/record.d.ts","../../kad-dht/dist/src/record/index.d.ts","../../kad-dht/dist/src/index.d.ts","../../../node_modules/@libp2p/daemon-server/dist/src/index.d.ts","../../pubsub/dist/src/index.d.ts","../../pubsub-floodsub/dist/src/cache.d.ts","../../pubsub-floodsub/dist/src/config.d.ts","../../pubsub-floodsub/dist/src/index.d.ts","../../protocol-identify/dist/src/index.d.ts","../../../node_modules/@libp2p/interop/dist/src/connect.d.ts","../../../node_modules/@libp2p/interop/dist/src/dht/index.d.ts","../../../node_modules/@libp2p/interop/dist/src/pubsub/index.d.ts","../../../node_modules/@libp2p/interop/dist/src/relay/index.d.ts","../../../node_modules/@libp2p/interop/dist/src/streams/index.d.ts","../../../node_modules/@libp2p/interop/dist/src/index.d.ts","../../stream-multiplexer-mplex/dist/src/message-types.d.ts","../../stream-multiplexer-mplex/dist/src/stream.d.ts","../../stream-multiplexer-mplex/dist/src/mplex.d.ts","../../stream-multiplexer-mplex/dist/src/index.d.ts","../../transport-tcp/dist/src/listener.d.ts","../../transport-tcp/dist/src/index.d.ts","../../../node_modules/execa/index.d.ts","../../../node_modules/go-libp2p/dist/src/index.d.ts","../test/interop.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/@types/chai-as-promised/index.d.ts","../../../node_modules/chai-parentheses/index.d.ts","../../../node_modules/@types/chai-subset/index.d.ts","../../../node_modules/chai-bites/index.d.ts","../../../node_modules/@types/chai-string/index.d.ts","../../../node_modules/aegir/dist/utils/chai.d.ts","../../../node_modules/delay/index.d.ts","../../../node_modules/@types/sinonjs__fake-timers/index.d.ts","../../../node_modules/@types/sinon/index.d.ts","../../../node_modules/sinon-ts/dist/src/index.d.ts","../test/addresses/address-manager.spec.ts","../../connection-encrypter-plaintext/dist/src/index.d.ts","../../utils/dist/src/multiaddr/is-loopback.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/it-ws/dist/src/sink.d.ts","../../../node_modules/it-ws/dist/src/web-socket.d.ts","../../../node_modules/it-ws/dist/src/duplex.d.ts","../../../node_modules/it-ws/dist/src/client.d.ts","../../transport-websockets/dist/src/index.d.ts","../../../node_modules/p-timeout/index.d.ts","../../../node_modules/p-event/index.d.ts","../../../node_modules/p-times/node_modules/p-map/index.d.ts","../../../node_modules/p-times/index.d.ts","../../interface-compliance-tests/dist/src/mocks/connection-gater.d.ts","../../interface-compliance-tests/dist/src/mocks/connection-manager.d.ts","../../interface-compliance-tests/dist/src/mocks/connection.d.ts","../../interface-compliance-tests/dist/src/mocks/multiaddr-connection.d.ts","../../interface-compliance-tests/dist/src/mocks/muxer.d.ts","../../interface-compliance-tests/dist/src/mocks/registrar.d.ts","../../interface-compliance-tests/dist/src/mocks/upgrader.d.ts","../../interface-compliance-tests/dist/src/mocks/duplex.d.ts","../../interface-compliance-tests/dist/src/mocks/metrics.d.ts","../../interface-compliance-tests/dist/src/mocks/index.d.ts","../../transport-websockets/dist/src/filters.d.ts","../test/fixtures/base-options.browser.ts","../test/fixtures/creators/peer.ts","../test/fixtures/base-options.ts","../test/addresses/utils.ts","../test/addresses/addresses.node.ts","../../interface-compliance-tests/dist/src/index.d.ts","../../interface-compliance-tests/dist/src/connection/index.d.ts","../../interface-compliance-tests/dist/src/peers.d.ts","../test/connection/fixtures/pair.ts","../test/connection/compliance.spec.ts","../test/connection/index.spec.ts","../../../node_modules/datastore-core/dist/src/errors.d.ts","../../../node_modules/datastore-core/dist/src/shard.d.ts","../../../node_modules/datastore-core/dist/src/keytransform.d.ts","../../../node_modules/datastore-core/dist/src/sharding.d.ts","../../../node_modules/datastore-core/dist/src/mount.d.ts","../../../node_modules/datastore-core/dist/src/tiered.d.ts","../../../node_modules/datastore-core/dist/src/namespace.d.ts","../../../node_modules/datastore-core/dist/src/index.d.ts","../../../node_modules/p-wait-for/index.d.ts","../test/fixtures/match-peer-id.ts","../test/connection-manager/auto-dial.spec.ts","../../../node_modules/@multiformats/multiaddr-matcher/dist/src/index.d.ts","../test/connection-manager/dial-queue.spec.ts","../test/fixtures/echo-service.ts","../test/connection-manager/direct.node.ts","../test/connection-manager/direct.spec.ts","../../../node_modules/it-all/dist/src/index.d.ts","../test/connection-manager/index.node.ts","../test/connection-manager/index.spec.ts","../test/connection-manager/resolver.spec.ts","../../../node_modules/it-drain/dist/src/index.d.ts","../test/content-routing/utils.ts","../test/content-routing/content-routing.node.ts","../test/content-routing/dht/utils.ts","../test/content-routing/dht/operation.node.ts","../test/core/consume-peer-record.spec.ts","../test/core/encryption.spec.ts","../test/core/events.spec.ts","../test/core/get-public-key.spec.ts","../test/core/listening.node.ts","../test/core/peer-id.spec.ts","../../peer-discovery-bootstrap/dist/src/index.d.ts","../../crypto/dist/src/aes/index.d.ts","../../crypto/dist/src/hmac/index.d.ts","../../crypto/dist/src/pbkdf2.d.ts","../../crypto/dist/src/random-bytes.d.ts","../../crypto/dist/src/index.d.ts","../../../node_modules/@types/dns-packet/index.d.ts","../../../node_modules/@types/multicast-dns/index.d.ts","../../peer-discovery-mdns/dist/src/mdns.d.ts","../../peer-discovery-mdns/dist/src/index.d.ts","../test/peer-discovery/index.node.ts","../test/peer-discovery/index.spec.ts","../test/peer-routing/utils.ts","../test/peer-routing/peer-routing.node.ts","../test/registrar/registrar.spec.ts","../test/transports/transport-manager.node.ts","../test/transports/transport-manager.spec.ts","../test/upgrading/upgrader.spec.ts","../../../node_modules/keyv/src/index.d.ts","../../../node_modules/@types/http-cache-semantics/index.d.ts","../../../node_modules/@types/responselike/index.d.ts","../../../node_modules/@types/cacheable-request/index.d.ts","../../../node_modules/@types/ms/index.d.ts","../../../node_modules/@types/debug/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/keyv/index.d.ts","../../../node_modules/@types/linkify-it/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/lodash.random/index.d.ts","../../../node_modules/@types/lodash.range/index.d.ts","../../../node_modules/@types/mdurl/encode.d.ts","../../../node_modules/@types/mdurl/decode.d.ts","../../../node_modules/@types/mdurl/parse.d.ts","../../../node_modules/@types/mdurl/format.d.ts","../../../node_modules/@types/mdurl/index.d.ts","../../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../../node_modules/@types/markdown-it/lib/token.d.ts","../../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../../node_modules/@types/markdown-it/lib/index.d.ts","../../../node_modules/@types/markdown-it/index.d.ts","../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/mdast/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/minimist/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/retry/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/sinon-chai/index.d.ts","../../../node_modules/@types/strip-bom/index.d.ts","../../../node_modules/@types/strip-json-comments/index.d.ts","../../../node_modules/@types/which/index.d.ts","../../../node_modules/@types/xsalsa20/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts","../../../node_modules/@types/yauzl/index.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/proto/payload.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","cb4b40f34fe4b1d87c530a0f3c2c1e043e338829fab8cf5cbd92a91c8c1374b8","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc","176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","4369b27ca2716a04200930b5f24fa87a6ed62d8c70f80a83270956b6b23c32ae","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"8d6138a264ddc6f94f16e99d4e117a2d6eb31b217891cf091b6437a2f114d561","affectsGlobalScope":true},"a882b74c4ba115c6e86371f3592a3accb2c50874b6fcd92a4f83d17a4d6993af","4a8722c7d7a4dac1616db1f41ad0113998ccbbbcd37af43def3fbe6b41208c83","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"0b3868d3f87c95ea73bdfab380e536843ec3573aa76233b97aac40518494ea24","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","30c2ec6abf6aaa60eb4f32fb1235531506b7961c6d1bdc7430711aec8fd85295","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"d48009cbe8a30a504031cc82e1286f78fed33b7a42abf7602c23b5547b382563","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"24ba151e213906027e2b1f5223d33575a3612b0234a0e2b56119520bbe0e594b","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","28c1fc8505da2181ee74c9fe902fac964159cfae266c4413905d50eaecea8a19","84b8cc86ad19115f2637401cdd220460a25542df478c966a5ffc5eeaf3825299",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","1bf687d978bdd6d5aff10b9eb0ff0695179f8594d4446946fd0182d6d25fa433","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1","7f2cc72a16a663ab9f8d99bd5658e583251ce0c003bf80a948973e15a7ef9596","af89ab13b40dd28cd91818fc6329914d2b9663591831f032ff0f0cb4a028d4a5","83a1426ac1a9cf144141dfe10d71a68629623a7c28245c9ca0e0352bead501fd","2726c0a6a4a87fad11e6846e6b0b40b8924fbe66340adc512093c4273bc53e4e","c888daaa99fdf6c5712d98605fdcf21cbbaab756a629661a44cac44ede464d37","e044f60686dc70015a3b7e7c64ad0ac5ec5ec101a0aede0782ec077e136b6a65","a232f867897bbecfebf68df575a417af1afd9b5dd3d83fb4d59e0a133a0de93d","228dbc8825b7a45af7d416dee95c0a2162d7cf73ffddfd52357b7e548882bdaa","4e152867a5b1bea2dc6a2921c0196f877630fc144369f8c7b9a69905caa62741","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","88de5467cd5e4c2c1384629806d56ac1215657bddf39ef9f60a0e05beee2b131","ff5820394809bfc32a7e4586ff11b3c07327a0f4c756709aef92f1cd73d6da48","bfe2af20f3ff0579331661ef4c5d2597e0c31a7a0d760e41eaff0502bf064c4d","f52a0e53f79d7fd1c1c55a3cbda59499d4cce75f3188969024cdc286b29ad3ea","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","a878d4c7237a7af50e96534295fcf723134d70cbb1e9bfd8365266b912aee6ec","8970ab047d89c71edf9973609dd62f61bb366abeabbff36a1200103b6c1c605b","36d756189d9295e3a964e5cd45cb8ac965d5d2ada53ed848e08608426c146d69","8bdb5c16e8b9ba625ec08d8189879a6fb47b2c3c458a5d43ebd53a8763b5712e",{"version":"d920cd596508281d66f5b040b2e5c2728b02dc59cd481905dfa019dcf7151473","signature":"0d954151e68f83130428c7c4e47b4578edb239e5d1f4e0e3fce6fa3987fd0c46"},"38efa025cf48a42e6f449592f2bccb35729b182b1f6435701f75c6fe555b9cde","fadc84f69bab30e956d9926db282149dacad42d5f300a4cf6ed81b7d43c51d0b","d9619bdf47b220d356c646b3693eb6fd5cd0cfd1016da5b2f1d37ad0763da88d",{"version":"73d6a504cf3a99898e727db717d4d65d804f07c27324feb7e6991f4d9c8f7557","signature":"faac43934437f1d0900b60a80bca64fe9b7357b02fdabfe16b5e735155de3d42"},"b9998d79c6cb4e43e9d812fec5ccafbedee623c589904e3e3f0439ef861e25dd","7a6f74294b8fb90f5e3832be21e25898dd81b2a1adc36dda6929813ba4135311","d25e693302c8e284b417884b40dbadffe693b0daff8999a000995114dbf74c49","a1d4ac1b15cd62c7346d976e3a01e6cbcd4f166ea6b7866907d25c5acc832d77","5d40e6a7071d0d1e6e558e17214ff786ecb3ea73e31b25a88c2cbe2435fa1252","fd617cc8eec6f43227ab572160bac9d23c723073e83a9b100bd15c758eff34c2","ec3786b43d68955ecdb12ce679d3bc61b6b25c4d0ac5bcdaf50fa4a746189b98","3155e98b0df0c1523715e8a1c75c8a67c401aeb58d6eccf8bd89d5d775b8c1cf","fa82b7b22d9df87323e31e9e2ad75911028f3e544647fd212424b3c4452fee3f","90aa0b916eef195a17c3dbd621746f82ac7969ecc3dbf27c81ee4c68c5af7f25","9ceec2a882368c0160a8a3879aa0efce0fb985751fc23ff6191006030969cfa4","cad5d6451789234434c28dd2d6a8267b0d64c479b1ad267321faa31ba90d570b","e0e8254f7a1a21b5768beb4dbc9d4574ce67aefa59d88251d16b17c658f2a69e","c45242078469b9680653d6a0667b23b1b767ec908825a14bfa8bb1dde2e30dae","5dcd218cfe8eb7fd6a1e5668c1a98734ddefe888d17129f8844552dddda2a74d","0564c90e8c2577950a446d6197a3ab7ec433ad5ac98435378e8855427f4cbf24","e1712267198fc3dd7903d0b945d5049fd56d68cadaf986c0adc40235fee43488","df21f5c49d638cbd6bd322eeb5b16d8352ba14ccb88cc9b23a7d8d5c2eaaf659","40924f439552f559ffa4e41d300a411646ac9f3b53e578a012f7c439d36c6a30","f6d13788d90394a540d136fb8ba9a0a647d8baa2e51d2ae155d039b031f4717f","81c6dd936bf342efbb1b1a5440a4300db5d39d70a6ad49ebc91ca7033ae9ce79","924dd07d0dce2040a5106708a766802871d83562671e5aa3a443a87007428af1","8b1b666fe96fd9e713f1279a3e446f16ee824f46ca0c2c075e4e89f0b1258e6c","6aecbb60c2216da24acb86490f7c6270a820fd85424c8a509e3d284aa47f7a56","6af9cf238459fe6d7e2d61cd50a157a6f540905c9793718e0e6e5993ab0cd650","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f",{"version":"a9c5ce8f8c58d9765a03253195220cf4f92dafcec282422eb8a040529347810f","signature":"eb7e1526f24a930a1704fb10dbb8ea6b67155201538511c0597a78fe52cd5ad0"},{"version":"9d2c89e67738dde758932be6024680e8a75fcb29a5bcae0e849c880b9b5a2874","signature":"e21613b58d0d5d11dc5145c33a4e946e2f1c45a8a205af81605756688dd6ceaf"},{"version":"b549b4d3c0dbcbd5ba7e390f73551e47da1a2f4540f02748b67d097c839e8d5b","signature":"b627014446a386a8d065a2d0b4101c30694d51727e23da49233d8907e5b713c7"},"55e5a976b594dc02f054860fb59a5299872a5b3c8c90e96733a5c9c9d4ed1fb8","fd0dcd93884e6815d949e96fa15c89fdcbdab54503da402ae3a4caf31579c936",{"version":"e6bb2b7fadde29c393d340275d4ac7aeacf1eb876595f57aa24e5513a382b3ef","signature":"63ca909407550cae71c33965de45eecd193b8f8f039351c035fa5f1048c56844"},"27679e96d1bd38c5938178aaf4abe8627493090b63d6bae2ce8436e6a87ebe4d","a77fbecee25688f568e18b43f8f54195d6c278a2a9a687ada5ab3d2f726524eb","e29f2b3a93ca3392fe29fa8e7b93985e854b44fe28e2b5c113f08296095bd6b7","d27956c8b392088a06d882e1edb58aab4d5cf5ab1229b73f99329ab21f352147","d643518d0b08b3d8d6e7f1fa884bca57ef95caaa1c312abbd9e1d4ed0d51c370","2808ffd2725582e383a1d994188f0ad0eb2c456dc9845e8b6aa327383adb061e",{"version":"41ae2c0b7d01b64ec7b62ad4ccda00ad31a0aa7ae7f7284c2fd42e0936a88c5e","signature":"80988a4177913a1a01949bbf9e937652db5c88e54ccd3c3cceb76b333e456dd8"},{"version":"626ea938ac500bfaa0949f341ef326537d5892fc0c5657f3daf19a26fdbba9ec","signature":"5bfc6fd511694c1b7a798f9d8ba74c36f0319fe250a8d0620f938754316cc63f"},{"version":"bcf650f73a69cfe54c668c11901d7ce5baf9fdaaaa6420ec17253e67a1632c8f","signature":"be50726c9d62972a6797fc828490aaf8bf47a0b316f513c62043d6d26763ca25"},{"version":"614db724cedd81dc8a8b7ec3a375169d3055db2220c77bfbeeb5312eb4adf07b","signature":"3d9fe271b931d600a0f40f892b38fef1ce19193598aa7c41a649f9d70681ba3b"},"ca027df9fd496a200d99ca0db4b0077463ce4926a6c8e05cfae522c5971ccbc0","acd5d501223e3a7cdd229b501fce5fb071937b72bd05fa33e543eb21c8ee0aba",{"version":"0f2023112b4aa2e14dcff2572aefcaa69cdcf4143d1316a7c2f72dd3af8168e4","signature":"4de820fd1ee608149e674b6a7cc0d1fc0e492602238318696bc1887545874828"},{"version":"c5fda50b180cf1afdd1a3a68a8fa4a2723fcd4360a4e528db486d0ee4a598c16","signature":"2cac9001d5225ca959d0c3f5f80d35d5f013e8ebed154c498eca6c4972f4bab4"},{"version":"65827869dba0b53120021452552098e9ae4f4f4893d02e3809aea287379d0385","signature":"b958ae1dbad15a21485564e451f5e2228d90b71ec5a34bbdac9d9a5e724977e8"},"ebc51770c27d90812d97af081e035c941e7ce706a909c838e759b6d605967f83","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6","b9c8e45d6c518e88e902d77684fd368aff2965cf1b68553f65595a02fcdb9271","4c7450b3aa5f4eca98e0cc2c9345ced21ff3eac3e1d7e9cdb60c1506af3c28ac",{"version":"e0db3f04a02c9ef7e7dcc6b2d3df5b1429772cf2a621c10a7c55f1d900b5f08b","signature":"c8be47f329ddbed80083263f609d8c371aef74f245533fe8f735cfdc7ff81f46"},{"version":"5e72b8a1f80b69026210580877854692458685702dc6e594be768610a2ec3c40","signature":"0818e6c6df479d2fa37a814b3dfb485bc62cdaa0d2bc0975a8f8c92cb94d0019"},"f0d7ddd36a5f0302dbad31ae1756103614b1d2cb5d66787f6c7707421844600f",{"version":"0eab3309046467aa3bc74d3a63144a23c5d752fbc51a866cd5151bb3a0135b95","signature":"cc709944ab0871c160c167f85783e1d4c6965118253189a7d4050929f3ee9731"},{"version":"3e89bcb6787647878dee340dd79c3cc80cf12acfe49292f8b0a675c76d25fd80","signature":"663d1476d5406bb576933204087e4f6ca44c046ae2dbfa9557d1984c9f4625de"},"4dd9ae44b5db6481b9e4b97d73a11c70bc73b9872fcbe7afd294ac144524327a",{"version":"0faaec63b3842dcfff015dd500d6c4e5a2638f68ab6f118d743171a8492b8ff0","signature":"d6015cb929c7cb6ccde98f27cc9132dcf19c17ecc9603dcf9d7f3db1f3f2a407"},"18ea46e4d0790901645c0c35dba475cd9cc807bff21069d0712dc6cdd8e5a948","f7cd98b9514f659b7c56823a01bfbc090d160315d6cbec8b0bc93cb6e51256ee","f30cfcfff28ee8f87563225b47239bb07b9b11edd09dda0ea6499b18cca1a30e","0edb8a97ead1fefd337458449050857e80740e31a3f76cffa656262f4e651a50","db8e4b47dd8c22634e3a326e5a5f60aa71a8ad4a0458fc0aadb6951f1c7cdc54","5b7a6d3f5c1b1d94d6cbc6c1e113588e20ae61d583d0d0cb5ec3fd92926d3749","61e6c9b8686325521a57c5b666fe2eff5a2ded387d784ef798074be55c065115","49e4e28978a87105cd9f0751ef1de0f0027f05b54bb7fa7e6623384e249e2b69","08fa330c7b2cff91534f26d3b425c1c91e4dc09456eac94a4b90d7327d78ff45","6b36e4d73dc098ce39e690245b11bcddf64d3bf899ee3492c3a3b90fe7c4ef4a",{"version":"48d1f43215005531a8504b28ead6eeb1028e207f0ba5d0a48bf662c3cd83aee7","signature":"a57c2842a2521df37424e2408aa2a56959fb21289cdad0e1f46db96b90f26bab"},"f5337c3ea7b8702ffe2718f56a24325a67d517c0d552ef71b8d578d9f33a99d3",{"version":"b0150ab8495cfd4663d8dd8e9e0d7ca41ae2ef11949660ba5f8a8a7f4ed48977","signature":"dba2c5b1d82935514a77d71247e55bee230e03a5ae4e0e81bd3100910a74fd72"},{"version":"49edd25481acf33a4ddc1e247ec183e8baedcc3046ec73d0bd667d548002e8a3","signature":"fa091e487523449b62860cde2e6b83dddccf8443c3340f5834ff8ee937b97862"},{"version":"6fba7311ed757f04bef53b3681d9bbba4b681ea26a9b5fc0f05441df9247faca","signature":"452a1c5114901a45142bd00787acdbfcec0df71d6e8f08d44359990ac5018512"},{"version":"a7041eccf3ab5836cef6a250d19891dafa0baa144d356e4e995951ae07638abe","signature":"8f184e0e9ab262f3876e9df1c4f558d073e2423c5f52f9e5fcdb26401f1f1da6"},{"version":"ce2a4ca07d0b15fce4d2524e40d0c43a8631034996e92944e041fa090f9d0a18","signature":"1a0f1f766840f4d8da9242bd623dae922220a68103649d69ebb2de45b48e815d"},"db5a96761bf022851439f3e689ea8b7aca6055037647ba21501ed22d7c1b3bb3",{"version":"49ce78b09ad6872188259c0581435bc04faf9e09ed51ebd8e14ea73c7b6cf2ce","signature":"9e01780d391da4a7ff69191f227e324d7c6eff00f2c43cce9b6241761847741c"},{"version":"698b99e5612a81874c7c8816ebfd905bb2f4241a08dddb6dc6172a66a33a58a3","signature":"8c28bf28c8f832aa42278508fcb89eb937ebc13e3d39039a42d5cc72516974e8"},"688c9dfd2b7114f5f01022abb5b179659f990d5af5924f185c2644ca99fe7b77","925a8770415572378b7b62dcd714e744b7ffed86de59bdbe1d25c68d9d1f7f51","fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","03e385ae2125c9aa9dead008b42a0ab20d0812c26c19ee210d84c2666113f867","444fd02034dcb14575c1d65b39678654508784d34c4d66d6631b54bb6aa24d21","d4936633d5453e441ad5ab182efad46a0e1285fe5f9f5c2948cad3e71b7c2c23","7378c8a8eb3feec7b36b268d55794b625a77f1a3a4d075932425fd263aadd8c2","a1b60bd2328318dcbec30bdf529dad31a13315ff2df60c8bd71630c58a575b06","5d11703e2c5d4dbe00bbe79f3bc864d178cf8d6ebccc2d1448ea29e93654f029","92aabe63a01fe06680e7e49775d5a66524f4816d49490af8e82330e5aeff91fd","ed849d616865076f44a41c87f27698f7cdf230290c44bafc71d7c2bc6919b202","5c2862817a9073efcdc8608cb171525067c4a7afd82f2cd800bf208104085234","626a82c4bd44767fb7ab3709a2a7857d43b02b575e7d1678d3d24f889515983c","8f364fec0ef20506aa9cf00b5cd8b620c1c0389687b11a3a32b0b5d4716ad894","dcef5e69bfd584dd4640a8363792acac1f2328767a57f401ee6daa0f281c632a","763bb8df872cbb8783e29e19bd7a1dea0f88f7fd7398343af38be8509a65df82","c286b410193495d067668bcdbd13ea3f3a39001edff02edee248babf2652e563","ba1405da509cc84896a588978efc45400d4f9844ee738d750b59868b1ad1618a","129e03ea345ad2ec480758767408a6119112e1c1d6a454f83524c8590549a949","932cade1c5802123b5831f332ad8a6297f0f7d14d0ee04f5a774408f393e2200","1165dc3daad62e737ee6c7016470a4a9a4c751be9f47da494a718a0b428bfe49","1969a7f95125132dd513d57d726f4a645270bbe2c4036ae23231f6fe916b0bd3","35095a100857bdbca3c31ddd6e1eb18259140dee0092d97e631889daf084eaec","6744c64cda78d6af7280d69c20ead828fa4296efe0b582548cb10ab66914993d","612bf9cb0b0a7ce6eab9fa9c09da1b1e4e5ec8f6b94f282035bfc89f68d4f3c6","1cc2659564153cef042b6a377a36a04d861398d678e7032ec42698d8c80ec77f","1f66808998faa0d77e425d4c5ae8f481c3234d4b8c1deff001e1af71b4b041f3","2f37bd92ed3c6cbac299dbfd79abe367c5e5d72e098abdb8d3e3900badd53e88","4110b29391d0835f9b88a4c69cb7e1cdddbac43ca9ee86393ebc15567c271b4d","8db42cde9161c917ae86f075cb21c16d1fab5965db0c4f4b372b4e7a0276f82e","f2dc190b33c1e842552ab4117c29cc960edd8ce2327a22254ec47cbcbdbb91f7","c8031a5db82b240f801a5684ab693e95e1e06dc76958894fe42d35acbd446f28","1633b84fd3346ad6500a88e7a119ac778bb6f6b2746a3b7b8164c5ef2721822f","75e0c62536016dac8cc0d825742ff7cc4c0455ebc86923e47edcc19edac0997c","de6afce5d1e6f2f81a5030fee9c7400a56b3c4077c5f9699cd71294c91e525cf","067ab20bf63d65f9b724398636d5083a71fb7d8cfe80a504ce2d2fe31400eab7","df54eaa5ea53c6bb3a9548bc5d2f6fb22583ea3e8b936a4e8ec5acfd90422ff3","faff9c6bf0fdb4020a7562249152411c8836693214e96fb1ec8af5935ccf6f1f","a982ea9a0d0c2fd5bb64eb8b251a80528fd73dc75a0ff2945483c778d1538a45","c23e3a1201af6ac7008a961c755134b204e3a9cf88b0483dbcf84e6a8439abf6","58cb8a81e19e00682e13e339d3f5ca0e24062d4144459b83f5fab67fddb4ab2b","bbd1f1105b91037d6ea5e27a488842f519a639bf9544140a80887069d98aef79","91061d4b30ccb1bdecb7f77e1b2fe4851834216214e836a4bdc3e4ff509ace65","90c062de3a56230a2788738b08a1180ade53bff424fbcc4cccef9010f8ff8bf5","02501688d58478fe06e958ddb5e194c1176e59bc7978b98d565a25ada290e294","e1b02ca4c82a90dabfdf773d4e80e56741e57923f2b73b2626a0555d61c9b7b4","71d388419783d94fb23aa078aec7258e470733d2d0ef80e792c226f820d245d2","be8d072f400254824429edab10acbe595299b702c97b99cc47f8e8018b7102ff","1a319786bea64c944ba8dd33331090034468efbab9c2fb96552850033d62d8d8","33174450482b921bbf093e3d52f501f7f93b5fd612311aa86e7339f2800162aa","a549d8215160fc249abf80f37aeebc573b26b491fe99c90a4ab70e50ea44948e","6e6733927ade923e34b243d6fbec1465cfc8ed6edf62c6e09ed00c529f0d93de","83b3a9e85f7967509436fcdfa9be9bd543fb54003a9233c5c0af087e4a2c11c8","dc92d6eccf12395aa1d47afb765d5e4a1cd2639a385db0e3e88e9937ad2b63a3","efcac7cadc707d5a2160f7ecb5c50e1c44491bdc400425edc3fbe8bdeb9b644d","1242141c87ba3396bead6f379f6d6778bd38d02017f243aa448d1454a5fdc90e","359a90789781b494878462da0ce3542c3e2ba9a7ecf15c2fbff8af21eeed3117","db4d7c9c5038c75e1df338d780a6c06c79589b5105f138dd29b62310aab749fe","b056f955c85dd0eb196ff290138eb4a83787c3f413505b9ae2676a602be7d40d","d2012ac9bb5854c62e3a26000bda07f7ed765a3dd8ee7b705c7d83e085706271","0af481fc1bf41aafebc2f02c5df80b1a41bdb1cea1b202c44c1bb0e681f9d63e","17a4105ddae0308e19ee8532bdeb76278efa9dc644366060ca644541d3fd831c","913ffa031f7455c53e99c75ae130a046612d2ee0e716ed92707e996cbd3952ea","44e897d02326bf4d8169ea9638fe0a4c53b8f85cc48ae2fcbbb67b2f72c1d805","288fb1b9df77067c3c2675bde87d23d4a3f01bb6f929f854f11bdb68662968ff","b43b5156bc2831b46f6226777e292ff1646b3651ce190708b6228a078d42da4a","c3e77c4aa1097a38dcf4a20a093ce65033a16f3a48dab0ae3c5f6661bc39b11c","22c980472aeac42a88c7954c9645c5cf0c511142afd048699daf516b25f9ea2d","aabcb267f8a73a9923157af617c47e2d707481760e60967dfa836613e2b7433b","502048f764485a8d13079c153f3ab8659c8d40c900e3d13fe5a4f901216ef7ea","3fdffecf635bb6a2a57a4b5eb321f302355168a775b9d2b56aa0a61748c4db87","0d6e9983d87ca882bd160af191909bce5c1d9b22f4bcb247d914b572cbddc076","590815e7bd28778a71732b03b4852917e18bf42670cc1931e4f95ebe99157838","32cbe201bfe8ed7f4c323fb8a3fcfdfb451f22e84d3c49da33ceda2fbf9230be","50d536e2e8bdbb4234b6ade05992aa4227fbf0401aba24922734c3ddb4a3ff11",{"version":"0ea1988bfa2de2538b465f03ccec8d23a4ad137733c0ac943686044c59301b9b","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d","27573b15894c6311146838fa3b45786bacc013a4bca6c84adc1b11a4e7c8a4c0","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2","8d16e3ff29dd0650435766702b01c2f7e9d1f289a48fcbf8e93687d6ecf33f26",{"version":"4cc7b06037a8b4d268685c9c5f3a7512e5abbbe85754de00eea65e4af69f4d18","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"325d8f966024c6ee9696a9b1ef84fae789029aa40c2f492f513f042506067dd4","4f590c560ee71a07def1a8e0d663d9d7ddb0d806deab94d8ceaac1f6408ac314","f7163a5d37d21f636f6a5cd1c064ce95fada21917859a64b6cc49a8b6fd5c1a8","3f666b04eebdae90161ddb1688911a72644fb9836c076707758391ecdd0efaaa","1dcd0086953c3ed3210ddbb09c9933c3a59629a47feacfdf8245cf3efc69c7af","c18f4ad1703534835a14df4eb6de7e7dfa70f82fe947cb7864399c68169ad3e7","0c4ba3558cec749d376e43f9795ecfab6ad3893e0f8a40a761b0d32bf95524f8","1d34cb56aad5cbca58399312584b2d573e1d4d79917cf9548397b7f5dc8a4a48","91764b36fe5e1c5d688f5f90eeea47703a059ab9a81bf80f7bbc9b04507b7bd3","115327b8e1f68c03004d841b83e332ed16b8f48af59ac00f38313887d7ec2920","177efa90a97917618cef3f68b04ee95c393fceea045dfc0aef2820d5aaa9e8f0","f3c65459172595a5a332a5f74e99d3ddb6200201550a2d1ed1b03dcfa9c0d76f","f6e125b70d7118004733e6856a90163bbeb01a4633316fc2a2aaccbfca6ded6f","46507ca157c8093e9b90b1c62be468ccb4aa693eaacae464b3935f6f24ccc9ff","af9a54fd33c9b0b2c05e433a71994ae07b75a3c4adbe82bdf6de863ce0f0e340","818068f6c587f5540e5cdc7b0f2ea6c04a0b9fe11745ca60f031bf349c17ba5c","d5840c8f2acfef007839d4e252ad45bf87219021c81de7de5cc98646f5d99d0d","f2601f76cd8ebb45e274730c33b44897fdea4bc742cb83fd98586754f08a3398","054dda98b75dec317926dddfb103939b99cccfc8ade63d7e6a2ef2f3343d37f9","a3f9f52ce73700565c8d9ba2aa75823ab8fc8e7258a27ecb828cd4257b8f918d","ad3490364b6442ca8694fc6cd364b63a5d807651a514837cc22ef29df624bb9d","4b5603a1ccca455500cfb39517d41ec011f31ba84bb6de44473344a237d89168","2e5e5c1e456256a0ae3b2aad2b771fc751081ce0a28ec5dc2c64e65b0412dea0",{"version":"29cbd44b63e1373c5333f6a15b146de939492adee7bd0f365daf3a06cd65e21b","signature":"24e087d3b31a47d62c6c3993d39192013c5053f8fbca6071bafc7cec8a8d001b"},{"version":"664564e7585304eef4017daec5cfae3363cab137a5886f60778907349bde8b5b","signature":"3f17c7fa020acaea60b13c7a4aa818b43af21e670a63d2dadc23c91b9e18d0b7"},{"version":"bb3fbadbd80095e2a4e6b4ab3660abad522e3dd29c7ed789b5587a896da0bb54","signature":"e0f6fbf8d68b52c380346198897e0a93f1ae28f86330a88becc270b8c0091036"},{"version":"8cb350cb47ec9806c322ff42235c998bfd2431f8aaea942bc8fa788c4884602a","signature":"878912f2da7af40fcdf0e9c72301491113ad60d80b56f75f9dbcdaf9560efc75"},{"version":"ffcea8929e2e7bcfc9681b53d930d4d76bffa486f3867bc419aa14330c77b922","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","4a337d4b854af8d61f943bb689ccdf523a615d109638148e7c04f8d451124bde","bac9f741786fd70df187dc6a82222ac8516fb7b7034a1266d422febb635c1cbb",{"version":"f18c42254c093ff60ee9d0fd4e7ee14cd6d1a15bacc4cd987eefc2e2557a8dc6","signature":"518a3cef0d51ba223da57c7e8be03696fc4aa41a9f55e1630d548dac970eb6ac"},{"version":"71f5318cea6e3b64a4e1dab2564e819172c476d8769ccb2538aa57932cc65218","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"72033392f964381ad90647d2d9f06cab5bfec7e620f50a7d55de2823544efe19","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"d626f2c25d5d6daddb082576771a8e7b591233a7893a1739513c44f35a3f7489","7c59943d77166c1aecd731af8683a7b5a0984e1bc0427fa35be504d77c41fdcd","d357e56d630bcd0f63cfc678e306702555b4f791c2d8e07f037de39171be4cd3","238f87de951ed064c7ec3e30a987f386d4821bacfc8c7548cdccf848b8b6035c","a93ae01c9ed49ba423599144ffa3cd520db83e53b32471865905a65113bb3e59","6088973936033e869d3616b63d25c15363862b491f46af77d40a5215ee8cc1a8","04a80a0c9937d8d13620c1dcbcad60f3dd44385a76ac4e3b6cc389a955628256","02a8cc0d6cd7bf40d796bc94f975889aa82d0aae28a9b1ae470f4ba036f6ad8d","adb5ad16c19ff8dbfa9daa3a7dc8e1b039c381a2b94383144a53368681ad8ca0",{"version":"f73b9058c762abbcbb49d84b763f34f1dd47b71778e4f8963f01ed3bcc799749","signature":"b7b69c2e092bcba2a7ed8e26febeb8a8c15820c842451da89295ad8fea198e4b"},{"version":"0811daf51c6804a50262affde5c65480f51079b2d2aa1c1a1a948a7946a78ed7","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"b095fc8b641823c0a9dff9b0c7efa153db137c7c1512bb600995cf281b8f607f",{"version":"65ebfc151c78d1f6280915961897bd653175f71d1f0d48d070b0e12a6ee9b5d2","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"ab3cd789079dc58a03c1fa4b03baec764a24355aee00ab9ac4f29a1425d43b6d","signature":"f32f42a0ff6a2c2888746fc195585b4b70d62d09b2013bbb4f984c7ea7a48a66"},{"version":"ae856979375d9e5639b638af0d29ae832c8962ee023cb2b4fc8245e4aab0addd","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"eaa3b7616b2b314395494c049103baac9abed5130c37d8b171b64e841a2d940d","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"5ccc3c7f73ef48c223635cd4506f21133560de7abc4c09c623327bb1b54386dc",{"version":"830cf570c14fc77bfb7077aeaf8d22d124aab3fa6b23f337cedb0e4f65f19cba","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"14fafdc45e77ab7ce0ae87f1e8ceff495e7f80cbf89a8ce939a55eeb673deac6","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"d364010282a38935c34224a3c710246ece045a4f856dd48d46d7706d5ab6f246","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"687ec53a7422d8cf80477fffa82a2db211f724039267931642befcd4907aec26",{"version":"0569aabb972296b4eda3354f04ee852be3a3e5e9146150e410d966d8193e9a8d","signature":"a70f34c07bd6616df1a739e849c159f8cb144e6848808da94983cfdd80717264"},{"version":"8857f2b989814577c48410c51b19210a75e1142d6f673559b8e8cb7cee9155e5","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"74380673bfbcfab03e2ac8fbf7ab3040854088f0135ec6f1a80dab310bf087c7","signature":"1685b7bf75a707a658191846463c7b441d7617876816187236c2f7456f84b67c"},{"version":"6b0182ebdbd5187e44f4d50ed41ea8df8506b17e074e6fba97958542c06b1eae","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"571d2b33d636318cea915cc18aef35d858b9923fa5eec3a2dbdca5ac3b86c543","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"19cff718745012226a4232482c19c3566aeb846d58b0d72fd9e13cfe9925085b","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"3a0c74a63edf77177b54a9bd654315f37ab866823cce9cb11309b526a72b2c8c","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"e1be5fd899f565dfac8d7f831451d3d364ee2438e500ab36b7290ac3f77dfdf1","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"4b4a9cacb07588f869af5e910a9f262ac8c7c61f95a60d7a9766caf52bcf9877","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"42759c04bda25b20ab982e99963f6921934895f60e78d94a22d8d137a78dde59","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"6bcccfb00fbd5e180d8a9f28a4594e50fcf847628e8fc1d8f984d4c9bd24ed1d","df1bbd333631040027035b56cb31093015e59ce977a590500ed09feab109939b","a4f27ea63e3ff26a94b6681967a5276a2df9ddb80ae990df1ad03c0fffb34eca","18418f70457cee30da01c21bc26869ceb1ae65564784136f7fe2f7f2ff8f740f","3d2ec84143e6462a786b5d9ecf06f4f6f67a59a1f16c5a3a5e41721ba8478b7f","892f412f701d356f85cd3cb7d48b87ffecc0d4f85a2005c1d53e5e08414df8b1","5bfd23a4c8765d347e296639b75f50f4dfca445d2eb41ea0892e68b8976a0cdf","62a8effc4dd17bbc2c05927b4ca5f67e73fdb458e203b128c041d0d70ffa6b55","6b235e2b5f651d8fc5e06e6a5e41164164ad1bcce02edbbec07ef9419a6164a9","237b9868dd1ad6ff90abdfe22a14d323162704c6d8987e2b7905684fa3f7bdf3",{"version":"2da3f60192fd2a1bc69d43216b1ba3cd8053df69ddc0466e60eba51469d8159a","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"a1e32322f27ed7e7a9854a1b0025829a9a8694962c8ff08b66bb84bde18d76b3","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"0569aabb972296b4eda3354f04ee852be3a3e5e9146150e410d966d8193e9a8d","signature":"a70f34c07bd6616df1a739e849c159f8cb144e6848808da94983cfdd80717264"},{"version":"b359bda98a583c52c22ec8d3f2f3a7be26fc3df601f9c655286a7203a6a6cd87","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"24265aed586bbedf558d98048c3988260266e11c45cb579a73e2c5dae4813207","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"89b712b3515bffd0c615b344d0934582f6958dbfba5e5d12fef599819953d996","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"8e87715118f25403983a9b577dbe5b0fe8b754de0ec013860c25c2cb62c93cb8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"7a8c93220e8ebf8fd54353d566e140b3679f527627c8a1317fce12ee660d3fb8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","b8442e9db28157344d1bc5d8a5a256f1692de213f0c0ddeb84359834015a008c","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","da2b6356b84a40111aaecb18304ea4e4fcb43d70efb1c13ca7d7a906445ee0d3","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","6f294731b495c65ecf46a5694f0082954b961cf05463bea823f8014098eaffa0","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","68a0d0c508e1b6d8d23a519a8a0a3303dc5baa4849ca049f21e5bad41945e3fc","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","b03afe4bec768ae333582915146f48b161e567a81b5ebc31c4d78af089770ac9","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","4f6a12044ee6f458db11964153830abbc499e73d065c51c329ec97407f4b13dd","13e834b958fe7e9010d2161497f98916974a0618be7a773281a253a948da8b0d","dae5c8e0ca15779492744cb4071c5b3c94c2121940fbaefb43ca9a045557a0c9","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a",{"version":"525b52b38b44420fb1758c0917e7b67cf379f7f9477d2ba7343f3d5f50a44258","affectsGlobalScope":true},"4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","dc5fa6012f710446a9ed04156d986bd81d9119c93ecb63d85c6a9d493264b5dc","5aac5efd20619b522faeeb0badf250834850c605ad8c5fb91c6502a54057f413","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[199,203,[230,232],235,[242,245],[248,250],255,256,258,259,261,272,[274,278],280,281,357,369,[393,397],[401,403],413,414,[416,419],[421,423],[425,434],[445,452]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[157],[68,69,157,165,168,180,181,283,285,286,287,294,297,298,299,300,302],[157,283,286],[157,283,301],[157,282],[157,283,285,286,289],[157,288,290],[157,288,289,296],[157,292],[157,286,288,290,291,293,294,295],[157,286],[74,75,157],[157,286,294],[68,72,157,220,283,285],[157,304,306,307],[157,273,304,305],[157,304,306,308],[157,309],[157,273,305,309,310,311],[68,73,74,75,157,166,273,304,305,306,309],[157,304],[74,157,216],[69,157],[157,171,314,317],[73,74,157,171,173,284,313,314,316],[74,157,173,313,314,315],[67,68,72,73,74,76,157,329,330],[73,74,157],[72,75,157,173,303,329,336],[157,348],[157,331,343,344,345,346,347],[72,157],[70,71,157],[127,130,156,157,164,453,454,455],[157,358],[157,457],[157,164],[127,157,164],[157,476],[157,464,466,467,468,469,470,471,472,473,474,475,476],[157,464,465,467,468,469,470,471,472,473,474,475,476],[157,465,466,467,468,469,470,471,472,473,474,475,476],[157,464,465,466,468,469,470,471,472,473,474,475,476],[157,464,465,466,467,469,470,471,472,473,474,475,476],[157,464,465,466,467,468,470,471,472,473,474,475,476],[157,464,465,466,467,468,469,471,472,473,474,475,476],[157,464,465,466,467,468,469,470,472,473,474,475,476],[157,464,465,466,467,468,469,470,471,473,474,475,476],[157,464,465,466,467,468,469,470,471,472,474,475,476],[157,464,465,466,467,468,469,470,471,472,473,475,476],[157,464,465,466,467,468,469,470,471,472,473,474,476],[157,464,465,466,467,468,469,470,471,472,473,474,475],[157,498],[157,483],[157,487,488,489],[157,486],[157,488],[157,463,484,485,490,493,495,496,497],[157,485,491,492,498],[157,491,494],[157,485,486,491,498],[157,485,498],[157,500],[157,479,480,481,482],[121,127,157,164,441],[78,157],[114,157],[115,120,148,157],[116,127,128,135,145,156,157],[116,117,127,135,157],[118,157],[119,120,128,136,157],[120,145,153,157],[121,123,127,135,157],[122,157],[123,124,157],[127,157],[125,127,157],[114,127,157],[127,128,129,145,156,157],[127,128,129,142,145,148,157],[112,157,161],[123,127,130,135,145,156,157],[127,128,130,131,135,145,153,156,157],[130,132,145,153,156,157],[78,79,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163],[127,133,157],[134,156,157,161],[123,127,135,145,157],[136,157],[137,157],[114,138,157],[139,155,157,161],[140,157],[141,157],[127,142,143,157],[142,144,157,159],[115,127,145,146,147,148,157],[115,145,147,157],[145,146,157],[148,157],[149,157],[114,145,157],[127,151,152,157],[151,152,157],[120,135,145,153,157],[154,157],[135,155,157],[115,130,141,156,157],[120,157],[145,157,158],[134,157,159],[157,160],[115,120,127,129,138,145,156,157,159,161],[145,157,162],[130,145,157,164],[157,508,547],[157,508,532,547],[157,547],[157,508],[157,508,533,547],[157,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546],[157,533,547],[157,358,367],[157,366],[127,130,132,145,153,156,157,162,164],[157,553],[127,145,157,164],[157,358,359,360,361,362,363],[157,358,359],[157,197,198],[157,198,226,227,404,405,406,407,408,409,410],[157,197,198,226,411],[157,196,197,198,226],[157,197,198,226],[157,198,406],[157,198,411],[115,116,145,157],[157,196,197],[157,195],[73,74,157,263,267],[73,74,157,265,267],[73,74,157,267],[74,157,264,266],[73,157],[73,74,157,268],[157,372,373,375],[73,157,372,373,374],[73,157,372],[157,372],[63,157],[157,189,190,191,192],[66,67,157],[66,157],[64,157],[157,183],[65,157],[65,157,185],[67,157,184,185,186,187,188],[63,64,65,66,157,183],[63,64,65,157],[157,378],[157,236,237,238,239],[157,237],[157,237,238],[157,380],[157,216],[157,209],[157,209,216],[74,157,209],[157,209,210,211,212,213,214,215],[157,367],[157,194],[157,189,193],[89,93,156,157],[89,145,156,157],[84,157],[86,89,153,156,157],[135,153,157],[84,157,164],[86,89,135,156,157],[81,82,85,88,115,127,145,156,157],[81,87,157],[85,89,115,148,156,157,164],[115,157,164],[105,115,157,164],[83,84,157,164],[89,157],[83,84,85,86,87,88,89,90,91,93,94,95,96,97,98,99,100,101,102,103,104,106,107,108,109,110,111,157],[89,96,97,157],[87,89,97,98,157],[88,157],[81,84,89,157],[89,93,97,98,157],[93,157],[87,89,92,156,157],[81,86,87,89,93,96,157],[115,145,157],[84,89,105,115,157,161,164],[157,173,273],[157,221,436,437,438,439],[157,205],[157,189],[157,206],[157,204,207,208,217,218,219,220],[75,157,398],[157,174],[68,72,157,165,173,180,181,285],[68,73,74,75,157,171,173,181],[157,382,383,384,385,386,387,388,389,390],[157,166],[68,72,73,74,75,157],[75,157,171,284,315],[68,75,157,170,181],[157,165,172,173,181],[68,72,75,157,173,179],[75,157,170],[72,75,157,172],[68,73,74,75,157],[68,72,75,157],[68,72,73,74,157,173],[67,76,157,173],[62,68,72,75,76,77,157,165,166,167,168,169,170,172],[75,157],[76,157,165],[65,67,157],[68,72,157],[68,76,157,173],[68,74,75,157,165,284],[73,74,75,157,173],[68,75,157],[72,75,157,165,171,173],[67,68,76,157,165,166,168,173,175,180,181,198,332,333,335],[62,68,157,173,189,198],[74,157,334],[68,72,157,165,168,173,182,223,230],[61,62,68,69,75,77,157,165,166,167,168,172,173,174,175,180,181,182,198],[61,72,157,172,173,200,201,202,203,277],[72,157,174,279],[62,157,165,168,173,179,180,195,241,243],[72,157,165,168,173,179,180,243],[157,242],[61,68,72,75,157,165,166,168,173,174,179,182,200,201,203,229,235,240,243,246,247,248],[61,62,68,72,75,157,165,166,168,173,174,179,180,182,200,201,203,233,234,235,243,244,245,249],[72,157,165,173,246],[61,68,72,75,157,165,173],[61,62,67,76,77,157,168,173,203,251,252,255],[61,73,76,157,168,253,254],[61,68,72,157,203,223],[68,75,77,157,166,167,171,172,173,174,198,199,222,225,231,250,261,273,276],[61,68,69,72,75,76,77,157,165,166,167,168,170,173,179,181,199,203,221,222,223,224,225,227,228,229,231,232,250,256,258,259,261,274,275,277,278],[61,68,69,76,157,167,168,173,203,251,252,253,255,257],[61,68,69,157,165,168,170,173,180,181,202,203],[61,62,72,75,157,165,166,172,173,175,182,203,260],[61,68,75,157,165,166,168,171,172,173,174,180,181,203,223,243,259,271,272,273],[68,69,72,157,165,168,173,182,224,231,364,365,367,368],[72,157,173,276,364,367,370,371,377,379,394,396],[157,354,377,395],[68,69,72,75,157,165,168,173,179,180,199,224,225,229,243,244,364,365,367,368,411,412,413],[68,69,72,75,157,168,172,173,174,182,224,247,249,364,365,367,368,391,415],[61,62,68,69,72,75,128,136,137,157,165,182,199,203,223,224,225,227,229,231,249,250,252,261,276,284,318,352,354,364,365,367,368,370,391,412,417],[61,68,69,72,75,157,165,173,182,199,200,203,223,224,225,227,243,247,250,261,277,318,342,352,364,365,367,368,370,377,379,391,392,394],[62,68,157,165,168,174,182,199,203,250,252,276,277,364,365,367,368,391,393,394,412,417,420],[68,69,72,75,157,165,168,173,174,182,224,233,250,276,364,367,368,379,391,393,394,412],[68,72,157,172,203,223,224,247,276,318,328,352,364,367,370,377,391,392],[69,72,75,157,224,272,399,400,401],[73,74,157,247,254],[69,72,157,224,272,364,367],[67,72,76,77,157,223,247,277,336,364,367,368,394,395,420,424,425],[68,72,157,173,229,277,318,336,352,354,364,370,394,412,427],[157,277,336,395],[72,157,276,370,377,394],[68,157,277,370,377,394],[157,173,277,364,370,377,379],[157,173,276,336,364,367,370,377,394],[68,157,276,354,364,370,394],[157,277,364,370,377],[157,173,202,277,328,352,370,377,391,392],[157,173,202,277,318,328,352,354,370,377,392],[68,72,157,173,224,231,276,277,381,393],[62,157,181,252],[68,157,367],[68,69,72,77,128,157,167,173,221,222,223,247,277,303,312,318,328,331,336,337,341,342,348,352,354,355,356],[68,72,157,165,173,195,222,247,277,336,364,367,394,395,435,440,444],[62,68,157,222,276,364,367,368,393,394],[68,72,76,157,167,173,224,247,276,336,364,365,367,368,394,395,420,424,447],[68,69,157,165,168,170,173,174,180,181,182,199,224,225,227,247,250,259,276,318,352,364,368,370,377,391,394,413],[62,68,69,72,157,165,172,199,224,225,227,231,261,354,364,367,379,391,412],[62,68,69,72,157,165,172,173,199,203,224,231,261,277,364,367,370,377,391,392],[68,72,74,75,157,165,171,172,173,199,203,224,225,229,247,252,259,273,274,277,318,328,352,364,365,367,368,370,377,379,391,392,411,420,424],[68,157],[73,157,271],[157,173,262,268,269,270],[73,157,173,271],[157,176,177,178],[157,168,173,222],[157,222,443],[62,157,165,173,175,222,442],[68,157,220],[63,65,67,68,157],[68,72,157,165,168,173,198],[68,75,157,165,168,173,175,180,181],[68,74,157,285,338,339,340],[68,74,75,157,165,173,179,181,240,285],[157,171,351],[74,157],[73,74,75,157,171,173,349,350,352],[74,157,173,315,349],[72,157,165,179,319,323,326,327],[62,77,157,165,173],[68,75,157,168,173,174,175,180,181,319,320,321,322,328],[62,68,72,157,173,179,319,328],[62,68,77,157,165,168,173,180,181,182],[68,77,157,165,168,172,173,174,175,180,181,324,325],[62,68,157,165,168,173,180,182,319],[72,157,166,172,173,353],[72,75,157,165,166,172,173,354],[130,157,164,172,173,372,376],[69,73,74,75,157,173],[157,168],[68,157,240],[157,273,304,556],[157,273,309,310,311,556],[68,72,165,168,173,182],[62,68,75,77,165,166,167,168,172,173,174,175,180,181,182,198],[173,277],[174],[62,165,168,173,180],[72,165,168,173,180],[242],[68,72,75,166,168,173,174,179,182,240],[62,68,72,75,165,166,168,173,174,179,180,182,244,245,249],[72,173,246],[68,72,75,173],[62,67,76,77,168,173],[73,76,168],[68,72],[68,75,77,166,167,171,172,173,174,198,199,222,225,231,250,261,273],[68,72,75,77,165,166,167,168,170,173,181,199,277],[68,69,76,167,168,173],[68,69,165,168,170,173,180,181],[62,72,75,165,166,172,173,175,182],[68,75,165,166,168,171,172,173,174,180,181,273],[277],[73,74],[277,336],[68,173,276,277],[181],[68,367]],"referencedMap":[[299,1],[303,2],[287,3],[302,4],[283,5],[294,6],[291,7],[297,8],[293,9],[288,1],[289,1],[296,10],[290,11],[300,12],[298,13],[286,14],[295,1],[304,1],[308,15],[306,16],[309,17],[311,18],[312,19],[310,20],[307,21],[305,22],[313,23],[314,1],[318,24],[317,25],[316,26],[331,27],[329,22],[330,28],[337,29],[343,30],[344,30],[348,31],[345,30],[346,30],[347,30],[415,32],[71,32],[72,33],[70,32],[201,32],[456,34],[359,35],[363,35],[361,35],[358,1],[458,36],[441,37],[454,1],[459,1],[460,1],[461,1],[462,38],[463,1],[477,39],[478,39],[465,40],[466,41],[464,42],[467,43],[468,44],[469,45],[470,46],[471,47],[472,48],[473,49],[474,50],[475,51],[476,52],[499,53],[484,54],[490,55],[488,1],[487,56],[489,57],[498,58],[493,59],[495,60],[496,61],[497,62],[491,1],[492,62],[494,62],[486,62],[485,1],[501,63],[480,1],[479,1],[482,54],[483,64],[481,54],[502,1],[503,1],[504,1],[457,1],[442,65],[78,66],[79,66],[114,67],[115,68],[116,69],[117,70],[118,71],[119,72],[120,73],[121,74],[122,75],[123,76],[124,76],[126,77],[125,78],[127,79],[128,80],[129,81],[113,82],[163,1],[130,83],[131,84],[132,85],[164,86],[133,87],[134,88],[135,89],[136,90],[137,91],[138,92],[139,93],[140,94],[141,95],[142,96],[143,96],[144,97],[145,98],[147,99],[146,100],[148,101],[149,102],[150,103],[151,104],[152,105],[153,106],[154,107],[155,108],[156,109],[157,110],[158,111],[159,112],[160,113],[161,114],[162,115],[505,1],[506,1],[455,116],[507,1],[532,117],[533,118],[508,119],[511,119],[530,117],[531,117],[521,117],[520,120],[518,117],[513,117],[526,117],[524,117],[528,117],[512,117],[525,117],[529,117],[514,117],[515,117],[527,117],[509,117],[516,117],[517,117],[519,117],[523,117],[534,121],[522,117],[510,117],[547,122],[546,1],[541,121],[543,123],[542,121],[535,121],[536,121],[538,121],[540,121],[544,123],[545,123],[537,123],[539,123],[548,124],[367,125],[366,1],[549,1],[550,1],[500,1],[551,1],[372,126],[552,37],[553,1],[554,127],[555,128],[364,129],[246,1],[80,1],[362,35],[360,130],[226,131],[404,1],[411,132],[406,133],[227,134],[408,135],[410,136],[405,137],[407,133],[409,135],[365,1],[292,1],[236,1],[355,138],[356,1],[198,139],[196,140],[197,1],[420,1],[263,28],[424,1],[253,1],[257,1],[268,141],[266,142],[264,143],[267,144],[254,1],[251,1],[252,145],[320,146],[284,1],[265,28],[73,1],[376,147],[375,148],[373,149],[374,150],[453,77],[202,1],[192,151],[63,1],[193,152],[64,153],[188,1],[67,154],[183,155],[191,156],[190,156],[185,157],[186,158],[65,1],[189,159],[184,160],[66,161],[187,1],[247,1],[379,162],[240,163],[238,164],[239,165],[237,1],[378,1],[381,166],[380,1],[412,162],[279,1],[333,1],[282,1],[301,5],[209,167],[212,168],[213,169],[210,170],[211,168],[216,171],[214,22],[215,167],[234,1],[368,172],[59,1],[60,1],[10,1],[11,1],[14,1],[13,1],[2,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[3,1],[4,1],[23,1],[27,1],[24,1],[25,1],[26,1],[28,1],[29,1],[30,1],[5,1],[31,1],[32,1],[33,1],[34,1],[6,1],[38,1],[35,1],[36,1],[37,1],[39,1],[7,1],[40,1],[45,1],[46,1],[41,1],[42,1],[43,1],[44,1],[8,1],[50,1],[47,1],[48,1],[49,1],[51,1],[9,1],[52,1],[53,1],[54,1],[57,1],[55,1],[56,1],[1,1],[58,1],[12,1],[74,1],[228,1],[229,173],[195,173],[194,174],[96,175],[103,176],[95,175],[110,177],[87,178],[86,179],[109,37],[104,180],[107,181],[89,182],[88,183],[84,184],[83,185],[106,186],[85,187],[90,188],[91,1],[94,188],[81,1],[112,189],[111,188],[98,190],[99,191],[101,192],[97,193],[100,194],[105,37],[92,195],[93,196],[102,197],[82,198],[108,199],[370,200],[436,1],[437,1],[440,201],[206,202],[204,203],[207,204],[221,205],[205,1],[208,202],[217,22],[218,203],[219,203],[438,1],[439,1],[399,206],[398,1],[382,207],[383,208],[384,209],[389,28],[391,210],[390,211],[385,212],[386,213],[387,214],[388,215],[400,1],[175,32],[180,216],[181,217],[182,218],[273,219],[174,220],[75,221],[77,222],[61,1],[165,38],[173,223],[220,1],[166,224],[260,211],[222,225],[68,226],[76,227],[167,228],[168,227],[233,1],[285,229],[62,1],[169,224],[171,230],[170,231],[172,232],[336,233],[332,234],[335,235],[334,22],[231,236],[230,1],[199,237],[278,238],[280,239],[232,207],[244,240],[245,241],[281,242],[242,1],[243,242],[249,243],[250,244],[248,245],[272,246],[256,247],[255,248],[203,1],[235,249],[277,250],[276,251],[258,252],[259,253],[261,254],[274,255],[275,1],[369,256],[397,257],[396,258],[414,259],[416,260],[418,261],[419,262],[421,263],[422,264],[423,265],[402,266],[401,267],[403,268],[426,269],[428,270],[427,1],[425,271],[429,272],[430,273],[431,274],[432,275],[433,276],[434,277],[393,278],[395,279],[394,280],[417,281],[413,282],[357,283],[445,284],[446,285],[448,286],[447,271],[449,287],[450,288],[451,289],[452,290],[69,291],[262,1],[270,292],[271,293],[269,294],[179,295],[178,291],[176,291],[177,291],[435,296],[444,297],[443,298],[224,299],[223,300],[225,301],[342,302],[339,1],[340,1],[341,303],[338,304],[352,305],[349,306],[351,307],[350,308],[327,1],[328,309],[319,22],[321,310],[323,311],[322,312],[324,313],[326,314],[325,315],[354,316],[353,317],[392,32],[377,318],[315,319],[200,320],[371,32],[241,321]],"exportedModulesMap":[[299,1],[303,2],[287,3],[302,4],[283,5],[294,6],[291,7],[297,8],[293,9],[288,1],[289,1],[296,10],[290,11],[300,12],[298,13],[286,14],[295,1],[304,1],[308,15],[306,322],[309,17],[311,18],[312,323],[310,20],[307,21],[305,22],[313,23],[314,1],[318,24],[317,25],[316,26],[331,27],[329,22],[330,28],[337,29],[343,30],[344,30],[348,31],[345,30],[346,30],[347,30],[415,32],[71,32],[72,33],[70,32],[201,32],[456,34],[359,35],[363,35],[361,35],[358,1],[458,36],[441,37],[454,1],[459,1],[460,1],[461,1],[462,38],[463,1],[477,39],[478,39],[465,40],[466,41],[464,42],[467,43],[468,44],[469,45],[470,46],[471,47],[472,48],[473,49],[474,50],[475,51],[476,52],[499,53],[484,54],[490,55],[488,1],[487,56],[489,57],[498,58],[493,59],[495,60],[496,61],[497,62],[491,1],[492,62],[494,62],[486,62],[485,1],[501,63],[480,1],[479,1],[482,54],[483,64],[481,54],[502,1],[503,1],[504,1],[457,1],[442,65],[78,66],[79,66],[114,67],[115,68],[116,69],[117,70],[118,71],[119,72],[120,73],[121,74],[122,75],[123,76],[124,76],[126,77],[125,78],[127,79],[128,80],[129,81],[113,82],[163,1],[130,83],[131,84],[132,85],[164,86],[133,87],[134,88],[135,89],[136,90],[137,91],[138,92],[139,93],[140,94],[141,95],[142,96],[143,96],[144,97],[145,98],[147,99],[146,100],[148,101],[149,102],[150,103],[151,104],[152,105],[153,106],[154,107],[155,108],[156,109],[157,110],[158,111],[159,112],[160,113],[161,114],[162,115],[505,1],[506,1],[455,116],[507,1],[532,117],[533,118],[508,119],[511,119],[530,117],[531,117],[521,117],[520,120],[518,117],[513,117],[526,117],[524,117],[528,117],[512,117],[525,117],[529,117],[514,117],[515,117],[527,117],[509,117],[516,117],[517,117],[519,117],[523,117],[534,121],[522,117],[510,117],[547,122],[546,1],[541,121],[543,123],[542,121],[535,121],[536,121],[538,121],[540,121],[544,123],[545,123],[537,123],[539,123],[548,124],[367,125],[366,1],[549,1],[550,1],[500,1],[551,1],[372,126],[552,37],[553,1],[554,127],[555,128],[364,129],[246,1],[80,1],[362,35],[360,130],[226,131],[404,1],[411,132],[406,133],[227,134],[408,135],[410,136],[405,137],[407,133],[409,135],[365,1],[292,1],[236,1],[355,138],[356,1],[198,139],[196,140],[197,1],[420,1],[263,28],[424,1],[253,1],[257,1],[268,141],[266,142],[264,143],[267,144],[254,1],[251,1],[252,145],[320,146],[284,1],[265,28],[73,1],[376,147],[375,148],[373,149],[374,150],[453,77],[202,1],[192,151],[63,1],[193,152],[64,153],[188,1],[67,154],[183,155],[191,156],[190,156],[185,157],[186,158],[65,1],[189,159],[184,160],[66,161],[187,1],[247,1],[379,162],[240,163],[238,164],[239,165],[237,1],[378,1],[381,166],[380,1],[412,162],[279,1],[333,1],[282,1],[301,5],[209,167],[212,168],[213,169],[210,170],[211,168],[216,171],[214,22],[215,167],[234,1],[368,172],[59,1],[60,1],[10,1],[11,1],[14,1],[13,1],[2,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[3,1],[4,1],[23,1],[27,1],[24,1],[25,1],[26,1],[28,1],[29,1],[30,1],[5,1],[31,1],[32,1],[33,1],[34,1],[6,1],[38,1],[35,1],[36,1],[37,1],[39,1],[7,1],[40,1],[45,1],[46,1],[41,1],[42,1],[43,1],[44,1],[8,1],[50,1],[47,1],[48,1],[49,1],[51,1],[9,1],[52,1],[53,1],[54,1],[57,1],[55,1],[56,1],[1,1],[58,1],[12,1],[74,1],[228,1],[229,173],[195,173],[194,174],[96,175],[103,176],[95,175],[110,177],[87,178],[86,179],[109,37],[104,180],[107,181],[89,182],[88,183],[84,184],[83,185],[106,186],[85,187],[90,188],[91,1],[94,188],[81,1],[112,189],[111,188],[98,190],[99,191],[101,192],[97,193],[100,194],[105,37],[92,195],[93,196],[102,197],[82,198],[108,199],[370,200],[436,1],[437,1],[440,201],[206,202],[204,203],[207,204],[221,205],[205,1],[208,202],[217,22],[218,203],[219,203],[438,1],[439,1],[399,206],[398,1],[382,207],[383,208],[384,209],[389,28],[391,210],[390,211],[385,212],[386,213],[387,214],[388,215],[400,1],[175,32],[180,216],[181,217],[182,218],[273,219],[174,220],[75,221],[77,222],[61,1],[165,38],[173,223],[220,1],[166,224],[260,211],[222,225],[68,226],[76,227],[167,228],[168,227],[233,1],[285,229],[62,1],[169,224],[171,230],[170,231],[172,232],[336,233],[332,234],[335,235],[334,22],[231,324],[199,325],[278,326],[280,327],[232,327],[244,328],[245,329],[281,330],[243,330],[249,331],[250,332],[248,333],[272,334],[256,335],[255,336],[235,337],[277,338],[276,339],[258,340],[259,341],[261,342],[274,343],[396,344],[401,345],[425,346],[393,326],[395,326],[394,347],[417,348],[413,349],[447,346],[69,291],[262,1],[270,292],[271,293],[269,294],[179,295],[178,291],[176,291],[177,291],[435,296],[444,297],[443,298],[224,299],[223,300],[225,301],[342,302],[339,1],[340,1],[341,303],[338,304],[352,305],[349,306],[351,307],[350,308],[327,1],[328,309],[319,22],[321,310],[323,311],[322,312],[324,313],[326,314],[325,315],[354,316],[353,317],[392,32],[377,318],[315,319],[200,320],[371,32],[241,321]],"semanticDiagnosticsPerFile":[299,303,287,302,283,294,291,297,293,288,289,296,290,300,298,286,295,304,308,306,309,311,312,310,307,305,313,314,318,317,316,331,329,330,337,343,344,348,345,346,347,415,71,72,70,201,456,359,363,361,358,458,441,454,459,460,461,462,463,477,478,465,466,464,467,468,469,470,471,472,473,474,475,476,499,484,490,488,487,489,498,493,495,496,497,491,492,494,486,485,501,480,479,482,483,481,502,503,504,457,442,78,79,114,115,116,117,118,119,120,121,122,123,124,126,125,127,128,129,113,163,130,131,132,164,133,134,135,136,137,138,139,140,141,142,143,144,145,147,146,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,505,506,455,507,532,533,508,511,530,531,521,520,518,513,526,524,528,512,525,529,514,515,527,509,516,517,519,523,534,522,510,547,546,541,543,542,535,536,538,540,544,545,537,539,548,367,366,549,550,500,551,372,552,553,554,555,364,246,80,362,360,226,404,411,406,227,408,410,405,407,409,365,292,236,355,356,198,196,197,420,263,424,253,257,268,266,264,267,254,251,252,320,284,265,73,376,375,373,374,453,202,192,63,193,64,188,67,183,191,190,185,186,65,189,184,66,187,247,379,240,238,239,237,378,381,380,412,279,333,282,301,209,212,213,210,211,216,214,215,234,368,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,74,228,229,195,194,96,103,95,110,87,86,109,104,107,89,88,84,83,106,85,90,91,94,81,112,111,98,99,101,97,100,105,92,93,102,82,108,370,436,437,440,206,204,207,221,205,208,217,218,219,438,439,399,398,382,383,384,389,391,390,385,386,387,388,400,175,180,181,182,273,174,75,77,61,165,173,220,166,260,222,68,76,167,168,233,285,62,169,171,170,172,336,332,335,334,231,230,199,278,280,232,244,245,281,242,243,249,250,248,272,256,255,203,235,277,276,258,259,261,274,275,369,397,396,414,416,418,419,421,422,423,402,401,403,426,428,427,425,429,430,431,432,433,434,393,395,394,417,413,357,445,446,448,447,449,450,451,452,69,262,270,271,269,179,178,176,177,435,444,443,224,223,225,342,339,340,341,338,352,349,351,350,327,328,319,321,323,322,324,326,325,354,353,392,377,315,200,371,241],"latestChangedDtsFile":"./src/upgrader.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/package.json deleted file mode 100644 index 3e8023769..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/package.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "name": "libp2p", - "version": "0.46.21", - "description": "JavaScript implementation of libp2p, a modular peer to peer network stack", - "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/libp2p#readme", - "repository": { - "type": "git", - "url": "git+https://github.com/libp2p/js-libp2p.git" - }, - "bugs": { - "url": "https://github.com/libp2p/js-libp2p/issues" - }, - "keywords": [ - "IPFS", - "libp2p", - "network", - "p2p", - "peer", - "peer-to-peer" - ], - "type": "module", - "types": "./dist/src/index.d.ts", - "files": [ - "src", - "dist", - "!dist/test", - "!**/*.tsbuildinfo" - ], - "exports": { - ".": { - "types": "./dist/src/index.d.ts", - "import": "./dist/src/index.js" - } - }, - "eslintConfig": { - "extends": "ipfs", - "parserOptions": { - "project": true, - "sourceType": "module" - }, - "ignorePatterns": [ - "!.aegir.js", - "test/ts-use", - "*.d.ts" - ] - }, - "scripts": { - "clean": "aegir clean", - "lint": "aegir lint", - "dep-check": "aegir dep-check", - "prepublishOnly": "node scripts/update-version.js && npm run build", - "build": "aegir build", - "test": "aegir test", - "test:node": "aegir test -t node -f \"./dist/test/**/*.{node,spec}.js\" --cov", - "test:chrome": "aegir test -t browser -f \"./dist/test/**/*.spec.js\" --cov", - "test:chrome-webworker": "aegir test -t webworker -f \"./dist/test/**/*.spec.js\"", - "test:firefox": "aegir test -t browser -f \"./dist/test/**/*.spec.js\" -- --browser firefox", - "test:firefox-webworker": "aegir test -t webworker -f \"./dist/test/**/*.spec.js\" -- --browser firefox", - "test:webkit": "aegir test -t browser -f \"./dist/test/**/*.spec.js\" -- --browser webkit", - "test:interop": "aegir test -t node -f dist/test/interop.js" - }, - "dependencies": { - "@libp2p/crypto": "^2.0.8", - "@libp2p/interface": "^0.1.6", - "@libp2p/interface-internal": "^0.1.9", - "@libp2p/logger": "^3.1.0", - "@libp2p/multistream-select": "^4.0.6", - "@libp2p/peer-collections": "^4.0.8", - "@libp2p/peer-id": "^3.0.6", - "@libp2p/peer-id-factory": "^3.0.8", - "@libp2p/peer-store": "^9.0.9", - "@libp2p/utils": "^4.0.7", - "@multiformats/mafmt": "^12.1.6", - "@multiformats/multiaddr": "^12.1.10", - "@multiformats/multiaddr-matcher": "^1.1.0", - "any-signal": "^4.1.1", - "datastore-core": "^9.0.1", - "delay": "^6.0.0", - "interface-datastore": "^8.2.0", - "it-all": "^3.0.2", - "it-drain": "^3.0.2", - "it-filter": "^3.0.1", - "it-first": "^3.0.3", - "it-map": "^3.0.4", - "it-merge": "^3.0.0", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "merge-options": "^3.0.4", - "multiformats": "^12.1.3", - "p-defer": "^4.0.0", - "p-queue": "^7.4.1", - "private-ip": "^3.0.1", - "rate-limiter-flexible": "^3.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - }, - "devDependencies": { - "@chainsafe/libp2p-gossipsub": "^10.0.0", - "@chainsafe/libp2p-noise": "^13.0.2", - "@chainsafe/libp2p-yamux": "^5.0.0", - "@libp2p/bootstrap": "^9.0.12", - "@libp2p/circuit-relay-v2": "^0.0.0", - "@libp2p/daemon-client": "^7.0.0", - "@libp2p/daemon-server": "^6.0.0", - "@libp2p/floodsub": "^8.0.13", - "@libp2p/identify": "^0.0.0", - "@libp2p/interface-compliance-tests": "^4.1.5", - "@libp2p/interop": "^9.0.0", - "@libp2p/kad-dht": "^10.0.15", - "@libp2p/mdns": "^9.0.14", - "@libp2p/mplex": "^9.0.12", - "@libp2p/plaintext": "^0.0.0", - "@libp2p/tcp": "^8.0.13", - "@libp2p/websockets": "^7.0.13", - "aegir": "^41.0.2", - "execa": "^8.0.1", - "go-libp2p": "^1.1.1", - "it-pushable": "^3.2.1", - "p-event": "^6.0.0", - "p-times": "^4.0.0", - "p-wait-for": "^5.0.2", - "sinon": "^17.0.0", - "sinon-ts": "^2.0.0" - }, - "browser": { - "./dist/src/connection-manager/constants.js": "./dist/src/connection-manager/constants.browser.js", - "./dist/src/config/connection-gater.js": "./dist/src/config/connection-gater.browser.js" - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/address-manager/README.md b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/address-manager/README.md deleted file mode 100644 index ae181eba9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/address-manager/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Address Manager - -The Address manager is responsible for keeping an updated register of the peer's addresses. It includes 2 different types of Addresses: `Listen Addresses` and `Announce Addresses`. - -These Addresses should be specified in your libp2p [configuration](../../../../doc/CONFIGURATION.md) when you create your node. - -## Listen Addresses - -A libp2p node should have a set of listen addresses, which will be used by libp2p underlying transports to listen for dials from other nodes in the network. - -Before a libp2p node starts, its configured listen addresses will be passed to the AddressManager, so that during startup the libp2p transports can use them to listen for connections. Accordingly, listen addresses should be specified through the libp2p configuration, in order to have the `AddressManager` created with them. - -It is important pointing out that libp2p accepts ephemeral listening addresses. In this context, the provided listen addresses might not be exactly the same as the ones used by the transports. For example TCP may replace `/ip4/0.0.0.0/tcp/0` with something like `/ip4/127.0.0.1/tcp/8989`. As a consequence, libp2p should take into account this when determining its advertised addresses. - -## Announce Addresses - -In some scenarios, a libp2p node will need to announce addresses that it is not listening on. In other words, Announce Addresses are an amendment to the Listen Addresses that aim to enable other nodes to achieve connectivity to this node. - -Scenarios for Announce Addresses include: -- when you setup a libp2p node in your private network at home, but you need to announce your public IP Address to the outside world; -- when you want to announce a DNS address, which maps to your public IP Address. - -## Implementation - -When a libp2p node is created, the Address Manager will be populated from the provided addresses through the libp2p configuration. Once the node is started, the Transport Manager component will gather the listen addresses from the Address Manager, so that the libp2p transports can attempt to bind to them. - -Libp2p will use the the Address Manager as the source of truth when advertising the peers addresses. After all transports are ready, other libp2p components/subsystems will kickoff, namely the Identify Service and the DHT. Both of them will announce the node addresses to the other peers in the network. The announce addresses will have an important role here and will be gathered by libp2p to compute its current addresses to advertise everytime it is needed. - -## Future Considerations - -### Dynamic address modifications - -In a future iteration, we can enable these addresses to be modified in runtime. For this, the Address Manager should be responsible for notifying interested subsystems of these changes, through an Event Emitter. - -#### Modify Listen Addresses - -While adding new addresses to listen on runtime should be trivial, removing a listen address might have bad implications for the node, since all the connections using that listen address will be closed. However, libp2p should provide a mechanism for both adding and removing listen addresses in the future. - -Every time a new listen address is added, the Address Manager should emit an event with the new multiaddrs to listen. The Transport Manager should listen to this events and act accordingly. - -#### Modify Announce Addresses - -When the announce addresses are modified, the Address Manager should emit an event so that other subsystems can act accordingly. For example, libp2p identify service should use the libp2p push protocol to inform other peers about these changes. diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/address-manager/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/address-manager/index.ts deleted file mode 100644 index 1ff557a6a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/address-manager/index.ts +++ /dev/null @@ -1,237 +0,0 @@ -import { peerIdFromString } from '@libp2p/peer-id' -import { multiaddr } from '@multiformats/multiaddr' -import { debounce } from './utils.js' -import type { ComponentLogger, Libp2pEvents, Logger } from '@libp2p/interface' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { TransportManager } from '@libp2p/interface-internal/transport-manager' -import type { Multiaddr } from '@multiformats/multiaddr' - -export interface AddressManagerInit { - /** - * Pass an function in this field to override the list of addresses - * that are announced to the network - */ - announceFilter?: AddressFilter - - /** - * list of multiaddrs string representation to listen - */ - listen?: string[] - - /** - * list of multiaddrs string representation to announce - */ - announce?: string[] - - /** - * list of multiaddrs string representation to never announce - */ - noAnnounce?: string[] -} - -export interface DefaultAddressManagerComponents { - peerId: PeerId - transportManager: TransportManager - peerStore: PeerStore - events: TypedEventTarget - logger: ComponentLogger -} - -/** - * A function that takes a list of multiaddrs and returns a list - * to announce - */ -export interface AddressFilter { - (addrs: Multiaddr[]): Multiaddr[] -} - -const defaultAddressFilter = (addrs: Multiaddr[]): Multiaddr[] => addrs - -interface ObservedAddressMetadata { - confident: boolean -} - -/** - * If the passed multiaddr contains the passed peer id, remove it - */ -function stripPeerId (ma: Multiaddr, peerId: PeerId): Multiaddr { - const observedPeerIdStr = ma.getPeerId() - - // strip our peer id if it has been passed - if (observedPeerIdStr != null) { - const observedPeerId = peerIdFromString(observedPeerIdStr) - - // use same encoding for comparison - if (observedPeerId.equals(peerId)) { - ma = ma.decapsulate(multiaddr(`/p2p/${peerId.toString()}`)) - } - } - - return ma -} - -export class DefaultAddressManager { - private readonly log: Logger - private readonly components: DefaultAddressManagerComponents - // this is an array to allow for duplicates, e.g. multiples of `/ip4/0.0.0.0/tcp/0` - private readonly listen: string[] - private readonly announce: Set - private readonly observed: Map - private readonly announceFilter: AddressFilter - - /** - * Responsible for managing the peer addresses. - * Peers can specify their listen and announce addresses. - * The listen addresses will be used by the libp2p transports to listen for new connections, - * while the announce addresses will be used for the peer addresses' to other peers in the network. - */ - constructor (components: DefaultAddressManagerComponents, init: AddressManagerInit = {}) { - const { listen = [], announce = [] } = init - - this.components = components - this.log = components.logger.forComponent('libp2p:address-manager') - this.listen = listen.map(ma => ma.toString()) - this.announce = new Set(announce.map(ma => ma.toString())) - this.observed = new Map() - this.announceFilter = init.announceFilter ?? defaultAddressFilter - - // this method gets called repeatedly on startup when transports start listening so - // debounce it so we don't cause multiple self:peer:update events to be emitted - this._updatePeerStoreAddresses = debounce(this._updatePeerStoreAddresses.bind(this), 1000) - - // update our stored addresses when new transports listen - components.events.addEventListener('transport:listening', () => { - this._updatePeerStoreAddresses() - }) - // update our stored addresses when existing transports stop listening - components.events.addEventListener('transport:close', () => { - this._updatePeerStoreAddresses() - }) - } - - _updatePeerStoreAddresses (): void { - // if announce addresses have been configured, ensure they make it into our peer - // record for things like identify - const addrs = this.getAnnounceAddrs() - .concat(this.components.transportManager.getAddrs()) - .concat( - [...this.observed.entries()] - .filter(([_, metadata]) => metadata.confident) - .map(([str]) => multiaddr(str)) - ).map(ma => { - // strip our peer id if it is present - if (ma.getPeerId() === this.components.peerId.toString()) { - return ma.decapsulate(`/p2p/${this.components.peerId.toString()}`) - } - - return ma - }) - - this.components.peerStore.patch(this.components.peerId, { - multiaddrs: addrs - }) - .catch(err => { this.log.error('error updating addresses', err) }) - } - - /** - * Get peer listen multiaddrs - */ - getListenAddrs (): Multiaddr[] { - return Array.from(this.listen).map((a) => multiaddr(a)) - } - - /** - * Get peer announcing multiaddrs - */ - getAnnounceAddrs (): Multiaddr[] { - return Array.from(this.announce).map((a) => multiaddr(a)) - } - - /** - * Get observed multiaddrs - */ - getObservedAddrs (): Multiaddr[] { - return Array.from(this.observed).map(([a]) => multiaddr(a)) - } - - /** - * Add peer observed addresses - */ - addObservedAddr (addr: Multiaddr): void { - addr = stripPeerId(addr, this.components.peerId) - const addrString = addr.toString() - - // do not trigger the change:addresses event if we already know about this address - if (this.observed.has(addrString)) { - return - } - - this.observed.set(addrString, { - confident: false - }) - } - - confirmObservedAddr (addr: Multiaddr): void { - addr = stripPeerId(addr, this.components.peerId) - const addrString = addr.toString() - - const metadata = this.observed.get(addrString) ?? { - confident: false - } - - const startingConfidence = metadata.confident - - this.observed.set(addrString, { - confident: true - }) - - // only trigger the 'self:peer:update' event if our confidence in an address has changed - if (!startingConfidence) { - this._updatePeerStoreAddresses() - } - } - - removeObservedAddr (addr: Multiaddr): void { - addr = stripPeerId(addr, this.components.peerId) - const addrString = addr.toString() - - this.observed.delete(addrString) - } - - getAddresses (): Multiaddr[] { - let addrs = this.getAnnounceAddrs().map(ma => ma.toString()) - - if (addrs.length === 0) { - // no configured announce addrs, add configured listen addresses - addrs = this.components.transportManager.getAddrs().map(ma => ma.toString()) - } - - // add observed addresses we are confident in - addrs = addrs.concat( - Array.from(this.observed) - .filter(([ma, metadata]) => metadata.confident) - .map(([ma]) => ma) - ) - - // dedupe multiaddrs - const addrSet = new Set(addrs) - - // Create advertising list - return this.announceFilter(Array.from(addrSet) - .map(str => multiaddr(str))) - .map(ma => { - // do not append our peer id to a path multiaddr as it will become invalid - if (ma.protos().pop()?.path === true) { - return ma - } - - if (ma.getPeerId() === this.components.peerId.toString()) { - return ma - } - - return ma.encapsulate(`/p2p/${this.components.peerId.toString()}`) - }) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/address-manager/utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/address-manager/utils.ts deleted file mode 100644 index 7062446a8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/address-manager/utils.ts +++ /dev/null @@ -1,13 +0,0 @@ -export function debounce (func: () => void, wait: number): () => void { - let timeout: ReturnType | undefined - - return function () { - const later = function (): void { - timeout = undefined - func() - } - - clearTimeout(timeout) - timeout = setTimeout(later, wait) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/components.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/components.ts deleted file mode 100644 index f03169820..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/components.ts +++ /dev/null @@ -1,164 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { isStartable, type Startable } from '@libp2p/interface/startable' -import { defaultLogger } from '@libp2p/logger' -import type { Libp2pEvents, ComponentLogger, NodeInfo } from '@libp2p/interface' -import type { ConnectionProtector } from '@libp2p/interface/connection' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { ContentRouting } from '@libp2p/interface/content-routing' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerRouting } from '@libp2p/interface/peer-routing' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Upgrader } from '@libp2p/interface/transport' -import type { AddressManager } from '@libp2p/interface-internal/address-manager' -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager' -import type { Registrar } from '@libp2p/interface-internal/registrar' -import type { TransportManager } from '@libp2p/interface-internal/transport-manager' -import type { Datastore } from 'interface-datastore' - -export interface Components extends Record, Startable { - peerId: PeerId - nodeInfo: NodeInfo - logger: ComponentLogger - events: TypedEventTarget - addressManager: AddressManager - peerStore: PeerStore - upgrader: Upgrader - registrar: Registrar - connectionManager: ConnectionManager - transportManager: TransportManager - connectionGater: ConnectionGater - contentRouting: ContentRouting - peerRouting: PeerRouting - datastore: Datastore - connectionProtector?: ConnectionProtector - metrics?: Metrics -} - -export interface ComponentsInit { - peerId?: PeerId - nodeInfo?: NodeInfo - logger?: ComponentLogger - events?: TypedEventTarget - addressManager?: AddressManager - peerStore?: PeerStore - upgrader?: Upgrader - metrics?: Metrics - registrar?: Registrar - connectionManager?: ConnectionManager - transportManager?: TransportManager - connectionGater?: ConnectionGater - contentRouting?: ContentRouting - peerRouting?: PeerRouting - datastore?: Datastore - connectionProtector?: ConnectionProtector -} - -class DefaultComponents implements Startable { - public components: Record = {} - private _started = false - - constructor (init: ComponentsInit = {}) { - this.components = {} - - for (const [key, value] of Object.entries(init)) { - this.components[key] = value - } - - if (this.components.logger == null) { - this.components.logger = defaultLogger() - } - } - - isStarted (): boolean { - return this._started - } - - private async _invokeStartableMethod (methodName: 'beforeStart' | 'start' | 'afterStart' | 'beforeStop' | 'stop' | 'afterStop'): Promise { - await Promise.all( - Object.values(this.components) - .filter(obj => isStartable(obj)) - .map(async (startable: Startable) => { - await startable[methodName]?.() - }) - ) - } - - async beforeStart (): Promise { - await this._invokeStartableMethod('beforeStart') - } - - async start (): Promise { - await this._invokeStartableMethod('start') - this._started = true - } - - async afterStart (): Promise { - await this._invokeStartableMethod('afterStart') - } - - async beforeStop (): Promise { - await this._invokeStartableMethod('beforeStop') - } - - async stop (): Promise { - await this._invokeStartableMethod('stop') - this._started = false - } - - async afterStop (): Promise { - await this._invokeStartableMethod('afterStop') - } -} - -const OPTIONAL_SERVICES = [ - 'metrics', - 'connectionProtector' -] - -const NON_SERVICE_PROPERTIES = [ - 'components', - 'isStarted', - 'beforeStart', - 'start', - 'afterStart', - 'beforeStop', - 'stop', - 'afterStop', - 'then', - '_invokeStartableMethod' -] - -export function defaultComponents (init: ComponentsInit = {}): Components { - const components = new DefaultComponents(init) - - const proxy = new Proxy(components, { - get (target, prop, receiver) { - if (typeof prop === 'string' && !NON_SERVICE_PROPERTIES.includes(prop)) { - const service = components.components[prop] - - if (service == null && !OPTIONAL_SERVICES.includes(prop)) { - throw new CodeError(`${prop} not set`, 'ERR_SERVICE_MISSING') - } - - return service - } - - return Reflect.get(target, prop, receiver) - }, - - set (target, prop, value) { - if (typeof prop === 'string') { - components.components[prop] = value - } else { - Reflect.set(target, prop, value) - } - - return true - } - }) - - // @ts-expect-error component keys are proxied - return proxy -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/config.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/config.ts deleted file mode 100644 index a9b83fb53..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/config.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { FaultTolerance } from '@libp2p/interface/transport' -import { defaultAddressSort } from '@libp2p/utils/address-sort' -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers' -import mergeOptions from 'merge-options' -import { codes, messages } from './errors.js' -import type { Libp2pInit } from './index.js' -import type { ServiceMap, RecursivePartial } from '@libp2p/interface' -import type { Multiaddr } from '@multiformats/multiaddr' - -const DefaultConfig: Partial = { - addresses: { - listen: [], - announce: [], - noAnnounce: [], - announceFilter: (multiaddrs: Multiaddr[]) => multiaddrs - }, - connectionManager: { - resolvers: { - dnsaddr: dnsaddrResolver - }, - addressSorter: defaultAddressSort - }, - transportManager: { - faultTolerance: FaultTolerance.FATAL_ALL - } -} - -export function validateConfig > (opts: RecursivePartial>): Libp2pInit { - const resultingOptions: Libp2pInit = mergeOptions(DefaultConfig, opts) - - if (resultingOptions.transports == null || resultingOptions.transports.length < 1) { - throw new CodeError(messages.ERR_TRANSPORTS_REQUIRED, codes.ERR_TRANSPORTS_REQUIRED) - } - - if (resultingOptions.connectionProtector === null && globalThis.process?.env?.LIBP2P_FORCE_PNET != null) { // eslint-disable-line no-undef - throw new CodeError(messages.ERR_PROTECTOR_REQUIRED, codes.ERR_PROTECTOR_REQUIRED) - } - - return resultingOptions -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/config/connection-gater.browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/config/connection-gater.browser.ts deleted file mode 100644 index c03a15369..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/config/connection-gater.browser.ts +++ /dev/null @@ -1,31 +0,0 @@ -import isPrivate from 'private-ip' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { Multiaddr } from '@multiformats/multiaddr' - -/** - * Returns a connection gater that disallows dialling private addresses by - * default. Browsers are severely limited in their resource usage so don't - * waste time trying to dial undiallable addresses. - */ -export function connectionGater (gater: ConnectionGater = {}): ConnectionGater { - return { - denyDialPeer: async () => false, - denyDialMultiaddr: async (multiaddr: Multiaddr) => { - const tuples = multiaddr.stringTuples() - - if (tuples[0][0] === 4 || tuples[0][0] === 41) { - return Boolean(isPrivate(`${tuples[0][1]}`)) - } - - return false - }, - denyInboundConnection: async () => false, - denyOutboundConnection: async () => false, - denyInboundEncryptedConnection: async () => false, - denyOutboundEncryptedConnection: async () => false, - denyInboundUpgradedConnection: async () => false, - denyOutboundUpgradedConnection: async () => false, - filterMultiaddrForPeer: async () => true, - ...gater - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/config/connection-gater.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/config/connection-gater.ts deleted file mode 100644 index 40f1827ae..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/config/connection-gater.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ConnectionGater } from '@libp2p/interface/connection-gater' - -/** - * Returns a default connection gater implementation that allows everything - */ -export function connectionGater (gater: ConnectionGater = {}): ConnectionGater { - return { - denyDialPeer: async () => false, - denyDialMultiaddr: async () => false, - denyInboundConnection: async () => false, - denyOutboundConnection: async () => false, - denyInboundEncryptedConnection: async () => false, - denyOutboundEncryptedConnection: async () => false, - denyInboundUpgradedConnection: async () => false, - denyOutboundUpgradedConnection: async () => false, - filterMultiaddrForPeer: async () => true, - ...gater - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/auto-dial.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/auto-dial.ts deleted file mode 100644 index 9cd95d6df..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/auto-dial.ts +++ /dev/null @@ -1,287 +0,0 @@ -import { PeerMap, PeerSet } from '@libp2p/peer-collections' -import { PeerJobQueue } from '@libp2p/utils/peer-job-queue' -import { toString as uint8ArrayToString } from 'uint8arrays/to-string' -import { AUTO_DIAL_CONCURRENCY, AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE, AUTO_DIAL_INTERVAL, AUTO_DIAL_MAX_QUEUE_LENGTH, AUTO_DIAL_PEER_RETRY_THRESHOLD, AUTO_DIAL_PRIORITY, LAST_DIAL_FAILURE_KEY, MIN_CONNECTIONS } from './constants.js' -import type { Libp2pEvents, Logger, ComponentLogger } from '@libp2p/interface' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Startable } from '@libp2p/interface/startable' -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager' - -interface AutoDialInit { - minConnections?: number - maxQueueLength?: number - autoDialConcurrency?: number - autoDialPriority?: number - autoDialInterval?: number - autoDialPeerRetryThreshold?: number - autoDialDiscoveredPeersDebounce?: number -} - -interface AutoDialComponents { - connectionManager: ConnectionManager - peerStore: PeerStore - events: TypedEventTarget - logger: ComponentLogger -} - -const defaultOptions = { - minConnections: MIN_CONNECTIONS, - maxQueueLength: AUTO_DIAL_MAX_QUEUE_LENGTH, - autoDialConcurrency: AUTO_DIAL_CONCURRENCY, - autoDialPriority: AUTO_DIAL_PRIORITY, - autoDialInterval: AUTO_DIAL_INTERVAL, - autoDialPeerRetryThreshold: AUTO_DIAL_PEER_RETRY_THRESHOLD, - autoDialDiscoveredPeersDebounce: AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE -} - -export class AutoDial implements Startable { - private readonly connectionManager: ConnectionManager - private readonly peerStore: PeerStore - private readonly queue: PeerJobQueue - private readonly minConnections: number - private readonly autoDialPriority: number - private readonly autoDialIntervalMs: number - private readonly autoDialMaxQueueLength: number - private readonly autoDialPeerRetryThresholdMs: number - private readonly autoDialDiscoveredPeersDebounce: number - private autoDialInterval?: ReturnType - private started: boolean - private running: boolean - private readonly log: Logger - - /** - * Proactively tries to connect to known peers stored in the PeerStore. - * It will keep the number of connections below the upper limit and sort - * the peers to connect based on whether we know their keys and protocols. - */ - constructor (components: AutoDialComponents, init: AutoDialInit) { - this.connectionManager = components.connectionManager - this.peerStore = components.peerStore - this.minConnections = init.minConnections ?? defaultOptions.minConnections - this.autoDialPriority = init.autoDialPriority ?? defaultOptions.autoDialPriority - this.autoDialIntervalMs = init.autoDialInterval ?? defaultOptions.autoDialInterval - this.autoDialMaxQueueLength = init.maxQueueLength ?? defaultOptions.maxQueueLength - this.autoDialPeerRetryThresholdMs = init.autoDialPeerRetryThreshold ?? defaultOptions.autoDialPeerRetryThreshold - this.autoDialDiscoveredPeersDebounce = init.autoDialDiscoveredPeersDebounce ?? defaultOptions.autoDialDiscoveredPeersDebounce - this.log = components.logger.forComponent('libp2p:connection-manager:auto-dial') - this.started = false - this.running = false - this.queue = new PeerJobQueue({ - concurrency: init.autoDialConcurrency ?? defaultOptions.autoDialConcurrency - }) - this.queue.addListener('error', (err) => { - this.log.error('error during auto-dial', err) - }) - - // check the min connection limit whenever a peer disconnects - components.events.addEventListener('connection:close', () => { - this.autoDial() - .catch(err => { - this.log.error(err) - }) - }) - - // sometimes peers are discovered in quick succession so add a small - // debounce to ensure all eligible peers are autodialed - let debounce: ReturnType - - // when new peers are discovered, dial them if we don't have - // enough connections - components.events.addEventListener('peer:discovery', () => { - clearTimeout(debounce) - debounce = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error(err) - }) - }, this.autoDialDiscoveredPeersDebounce) - }) - } - - isStarted (): boolean { - return this.started - } - - start (): void { - this.autoDialInterval = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err) - }) - }, this.autoDialIntervalMs) - this.started = true - } - - afterStart (): void { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err) - }) - } - - stop (): void { - // clear the queue - this.queue.clear() - clearTimeout(this.autoDialInterval) - this.started = false - this.running = false - } - - async autoDial (): Promise { - if (!this.started) { - return - } - - const connections = this.connectionManager.getConnectionsMap() - const numConnections = connections.size - - // Already has enough connections - if (numConnections >= this.minConnections) { - if (this.minConnections > 0) { - this.log.trace('have enough connections %d/%d', numConnections, this.minConnections) - } - return - } - - if (this.queue.size > this.autoDialMaxQueueLength) { - this.log('not enough connections %d/%d but auto dial queue is full', numConnections, this.minConnections) - return - } - - if (this.running) { - this.log('not enough connections %d/%d - but skipping autodial as it is already running', numConnections, this.minConnections) - return - } - - this.running = true - - this.log('not enough connections %d/%d - will dial peers to increase the number of connections', numConnections, this.minConnections) - - const dialQueue = new PeerSet( - // @ts-expect-error boolean filter removes falsy peer IDs - this.connectionManager.getDialQueue() - .map(queue => queue.peerId) - .filter(Boolean) - ) - - // Sort peers on whether we know protocols or public keys for them - const peers = await this.peerStore.all({ - filters: [ - // Remove some peers - (peer) => { - // Remove peers without addresses - if (peer.addresses.length === 0) { - this.log.trace('not autodialing %p because they have no addresses', peer.id) - return false - } - - // remove peers we are already connected to - if (connections.has(peer.id)) { - this.log.trace('not autodialing %p because they are already connected', peer.id) - return false - } - - // remove peers we are already dialling - if (dialQueue.has(peer.id)) { - this.log.trace('not autodialing %p because they are already being dialed', peer.id) - return false - } - - // remove peers already in the autodial queue - if (this.queue.hasJob(peer.id)) { - this.log.trace('not autodialing %p because they are already being autodialed', peer.id) - return false - } - - return true - } - ] - }) - - // shuffle the peers - this is so peers with the same tag values will be - // dialled in a different order each time - const shuffledPeers = peers.sort(() => Math.random() > 0.5 ? 1 : -1) - - // Sort shuffled peers by tag value - const peerValues = new PeerMap() - for (const peer of shuffledPeers) { - if (peerValues.has(peer.id)) { - continue - } - - // sum all tag values - peerValues.set(peer.id, [...peer.tags.values()].reduce((acc, curr) => { - return acc + curr.value - }, 0)) - } - - // sort by value, highest to lowest - const sortedPeers = shuffledPeers.sort((a, b) => { - const peerAValue = peerValues.get(a.id) ?? 0 - const peerBValue = peerValues.get(b.id) ?? 0 - - if (peerAValue > peerBValue) { - return -1 - } - - if (peerAValue < peerBValue) { - return 1 - } - - return 0 - }) - - const peersThatHaveNotFailed = sortedPeers.filter(peer => { - const lastDialFailure = peer.metadata.get(LAST_DIAL_FAILURE_KEY) - - if (lastDialFailure == null) { - return true - } - - const lastDialFailureTimestamp = parseInt(uint8ArrayToString(lastDialFailure)) - - if (isNaN(lastDialFailureTimestamp)) { - return true - } - - // only dial if the time since the last failure is above the retry threshold - return Date.now() - lastDialFailureTimestamp > this.autoDialPeerRetryThresholdMs - }) - - this.log('selected %d/%d peers to dial', peersThatHaveNotFailed.length, peers.length) - - for (const peer of peersThatHaveNotFailed) { - this.queue.add(async () => { - const numConnections = this.connectionManager.getConnectionsMap().size - - // Check to see if we still need to auto dial - if (numConnections >= this.minConnections) { - this.log('got enough connections now %d/%d', numConnections, this.minConnections) - this.queue.clear() - return - } - - this.log('connecting to a peerStore stored peer %p', peer.id) - await this.connectionManager.openConnection(peer.id, { - priority: this.autoDialPriority - }) - }, { - peerId: peer.id - }).catch(err => { - this.log.error('could not connect to peerStore stored peer', err) - }) - } - - this.running = false - - if (this.started) { - this.autoDialInterval = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err) - }) - }, this.autoDialIntervalMs) - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/connection-pruner.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/connection-pruner.ts deleted file mode 100644 index 71a2f2308..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/connection-pruner.ts +++ /dev/null @@ -1,157 +0,0 @@ -import { PeerMap } from '@libp2p/peer-collections' -import { MAX_CONNECTIONS } from './constants.js' -import type { Libp2pEvents, Logger, ComponentLogger } from '@libp2p/interface' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager' -import type { Multiaddr } from '@multiformats/multiaddr' - -interface ConnectionPrunerInit { - maxConnections?: number - allow?: Multiaddr[] -} - -interface ConnectionPrunerComponents { - connectionManager: ConnectionManager - peerStore: PeerStore - events: TypedEventTarget - logger: ComponentLogger -} - -const defaultOptions = { - maxConnections: MAX_CONNECTIONS, - allow: [] -} - -/** - * If we go over the max connections limit, choose some connections to close - */ -export class ConnectionPruner { - private readonly maxConnections: number - private readonly connectionManager: ConnectionManager - private readonly peerStore: PeerStore - private readonly allow: Multiaddr[] - private readonly events: TypedEventTarget - private readonly log: Logger - - constructor (components: ConnectionPrunerComponents, init: ConnectionPrunerInit = {}) { - this.maxConnections = init.maxConnections ?? defaultOptions.maxConnections - this.allow = init.allow ?? defaultOptions.allow - this.connectionManager = components.connectionManager - this.peerStore = components.peerStore - this.events = components.events - this.log = components.logger.forComponent('libp2p:connection-manager:connection-pruner') - - // check the max connection limit whenever a peer connects - components.events.addEventListener('connection:open', () => { - this.maybePruneConnections() - .catch(err => { - this.log.error(err) - }) - }) - } - - /** - * If we have more connections than our maximum, select some excess connections - * to prune based on peer value - */ - async maybePruneConnections (): Promise { - const connections = this.connectionManager.getConnections() - const numConnections = connections.length - const toPrune = Math.max(numConnections - this.maxConnections, 0) - - this.log('checking max connections limit %d/%d', numConnections, this.maxConnections) - if (numConnections <= this.maxConnections) { - return - } - - this.log('max connections limit exceeded %d/%d, pruning %d connection(s)', numConnections, this.maxConnections, toPrune) - const peerValues = new PeerMap() - - // work out peer values - for (const connection of connections) { - const remotePeer = connection.remotePeer - - if (peerValues.has(remotePeer)) { - continue - } - - peerValues.set(remotePeer, 0) - - try { - const peer = await this.peerStore.get(remotePeer) - - // sum all tag values - peerValues.set(remotePeer, [...peer.tags.values()].reduce((acc, curr) => { - return acc + curr.value - }, 0)) - } catch (err: any) { - if (err.code !== 'ERR_NOT_FOUND') { - this.log.error('error loading peer tags', err) - } - } - } - - // sort by value, lowest to highest - const sortedConnections = connections.sort((a, b) => { - const peerAValue = peerValues.get(a.remotePeer) ?? 0 - const peerBValue = peerValues.get(b.remotePeer) ?? 0 - - if (peerAValue > peerBValue) { - return 1 - } - - if (peerAValue < peerBValue) { - return -1 - } - - // if the peers have an equal tag value then we want to close short-lived connections first - const connectionALifespan = a.timeline.open - const connectionBLifespan = b.timeline.open - - if (connectionALifespan < connectionBLifespan) { - return 1 - } - - if (connectionALifespan > connectionBLifespan) { - return -1 - } - - return 0 - }) - - // close some connections - const toClose = [] - - for (const connection of sortedConnections) { - this.log('too many connections open - closing a connection to %p', connection.remotePeer) - // check allow list - const connectionInAllowList = this.allow.some((ma) => { - return connection.remoteAddr.toString().startsWith(ma.toString()) - }) - - // Connections in the allow list should be excluded from pruning - if (!connectionInAllowList) { - toClose.push(connection) - } - - if (toClose.length === toPrune) { - break - } - } - - // close connections - await Promise.all( - toClose.map(async connection => { - try { - await connection.close() - } catch (err) { - this.log.error(err) - } - }) - ) - - // despatch prune event - this.events.safeDispatchEvent('connection:prune', { detail: toClose }) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/constants.browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/constants.browser.ts deleted file mode 100644 index 2c369c124..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/constants.browser.ts +++ /dev/null @@ -1,21 +0,0 @@ -export * from './constants.defaults.js' - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export const MIN_CONNECTIONS = 5 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export const MAX_CONNECTIONS = 100 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export const MAX_PARALLEL_DIALS = 50 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export const AUTO_DIAL_PEER_RETRY_THRESHOLD = 1000 * 60 * 7 diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/constants.defaults.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/constants.defaults.ts deleted file mode 100644 index 2eb5044e7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/constants.defaults.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#dialTimeout - */ -export const DIAL_TIMEOUT = 30e3 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundUpgradeTimeout - */ -export const INBOUND_UPGRADE_TIMEOUT = 30e3 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxPeerAddrsToDial - */ -export const MAX_PEER_ADDRS_TO_DIAL = 25 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialInterval - */ -export const AUTO_DIAL_INTERVAL = 5000 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialConcurrency - */ -export const AUTO_DIAL_CONCURRENCY = 25 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialPriority - */ -export const AUTO_DIAL_PRIORITY = 0 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialMaxQueueLength - */ -export const AUTO_DIAL_MAX_QUEUE_LENGTH = 100 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialDiscoveredPeersDebounce - */ -export const AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE = 10 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundConnectionThreshold - */ -export const INBOUND_CONNECTION_THRESHOLD = 5 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxIncomingPendingConnections - */ -export const MAX_INCOMING_PENDING_CONNECTIONS = 10 - -/** - * Store as part of the peer store metadata for a given peer, the value for this - * key is a timestamp of the last time a dial attempted failed with the relevant - * peer stored as a string. - * - * Used to insure we do not endlessly try to auto dial peers we have recently - * failed to dial. - */ -export const LAST_DIAL_FAILURE_KEY = 'last-dial-failure' diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/constants.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/constants.ts deleted file mode 100644 index a6a6c486f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/constants.ts +++ /dev/null @@ -1,21 +0,0 @@ -export * from './constants.defaults.js' - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export const MIN_CONNECTIONS = 50 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export const MAX_CONNECTIONS = 300 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export const MAX_PARALLEL_DIALS = 100 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export const AUTO_DIAL_PEER_RETRY_THRESHOLD = 1000 * 60 diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/dial-queue.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/dial-queue.ts deleted file mode 100644 index 9550c95df..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/dial-queue.ts +++ /dev/null @@ -1,580 +0,0 @@ -import { AbortError, CodeError, ERR_TIMEOUT } from '@libp2p/interface/errors' -import { setMaxListeners } from '@libp2p/interface/events' -import { PeerMap } from '@libp2p/peer-collections' -import { defaultAddressSort } from '@libp2p/utils/address-sort' -import { type Multiaddr, type Resolver, resolvers } from '@multiformats/multiaddr' -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers' -import { type ClearableSignal, anySignal } from 'any-signal' -import pDefer from 'p-defer' -import PQueue from 'p-queue' -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' -import { codes } from '../errors.js' -import { getPeerAddress } from '../get-peer.js' -import { - DIAL_TIMEOUT, - MAX_PARALLEL_DIALS, - MAX_PEER_ADDRS_TO_DIAL, - LAST_DIAL_FAILURE_KEY -} from './constants.js' -import { combineSignals, resolveMultiaddrs } from './utils.js' -import type { AddressSorter, AbortOptions, PendingDial, ComponentLogger, Logger } from '@libp2p/interface' -import type { Connection } from '@libp2p/interface/connection' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { Metric, Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { Address, PeerStore } from '@libp2p/interface/peer-store' -import type { TransportManager } from '@libp2p/interface-internal/transport-manager' - -export interface PendingDialTarget { - resolve(value: any): void - reject(err: Error): void -} - -export interface DialOptions extends AbortOptions { - priority?: number - force?: boolean -} - -interface PendingDialInternal extends PendingDial { - promise: Promise -} - -interface DialerInit { - addressSorter?: AddressSorter - maxParallelDials?: number - maxPeerAddrsToDial?: number - dialTimeout?: number - resolvers?: Record - connections?: PeerMap -} - -const defaultOptions = { - addressSorter: defaultAddressSort, - maxParallelDials: MAX_PARALLEL_DIALS, - maxPeerAddrsToDial: MAX_PEER_ADDRS_TO_DIAL, - dialTimeout: DIAL_TIMEOUT, - resolvers: { - dnsaddr: dnsaddrResolver - } -} - -interface DialQueueComponents { - peerId: PeerId - metrics?: Metrics - peerStore: PeerStore - transportManager: TransportManager - connectionGater: ConnectionGater - logger: ComponentLogger -} - -export class DialQueue { - public pendingDials: PendingDialInternal[] - public queue: PQueue - private readonly peerId: PeerId - private readonly peerStore: PeerStore - private readonly connectionGater: ConnectionGater - private readonly transportManager: TransportManager - private readonly addressSorter: AddressSorter - private readonly maxPeerAddrsToDial: number - private readonly dialTimeout: number - private readonly inProgressDialCount?: Metric - private readonly pendingDialCount?: Metric - private readonly shutDownController: AbortController - private readonly connections: PeerMap - private readonly log: Logger - - constructor (components: DialQueueComponents, init: DialerInit = {}) { - this.addressSorter = init.addressSorter ?? defaultOptions.addressSorter - this.maxPeerAddrsToDial = init.maxPeerAddrsToDial ?? defaultOptions.maxPeerAddrsToDial - this.dialTimeout = init.dialTimeout ?? defaultOptions.dialTimeout - this.connections = init.connections ?? new PeerMap() - this.log = components.logger.forComponent('libp2p:connection-manager:dial-queue') - - this.peerId = components.peerId - this.peerStore = components.peerStore - this.connectionGater = components.connectionGater - this.transportManager = components.transportManager - this.shutDownController = new AbortController() - - setMaxListeners(Infinity, this.shutDownController.signal) - - this.pendingDialCount = components.metrics?.registerMetric('libp2p_dial_queue_pending_dials') - this.inProgressDialCount = components.metrics?.registerMetric('libp2p_dial_queue_in_progress_dials') - this.pendingDials = [] - - for (const [key, value] of Object.entries(init.resolvers ?? {})) { - resolvers.set(key, value) - } - - // controls dial concurrency - this.queue = new PQueue({ - concurrency: init.maxParallelDials ?? defaultOptions.maxParallelDials - }) - - // a job was added to the queue - this.queue.on('add', () => { - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - // a queued job started - this.queue.on('active', () => { - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - // a started job completed without error - this.queue.on('completed', () => { - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - // a started job errored - this.queue.on('error', (err) => { - this.log.error('error in dial queue', err) - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - // all queued jobs have been started - this.queue.on('empty', () => { - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - // add started jobs have run and the queue is empty - this.queue.on('idle', () => { - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - } - - /** - * Clears any pending dials - */ - stop (): void { - this.shutDownController.abort() - } - - /** - * Connects to a given peer, multiaddr or list of multiaddrs. - * - * If a peer is passed, all known multiaddrs will be tried. If a multiaddr or - * multiaddrs are passed only those will be dialled. - * - * Where a list of multiaddrs is passed, if any contain a peer id then all - * multiaddrs in the list must contain the same peer id. - * - * The dial to the first address that is successfully able to upgrade a connection - * will be used, all other dials will be aborted when that happens. - */ - async dial (peerIdOrMultiaddr: PeerId | Multiaddr | Multiaddr[], options: DialOptions = {}): Promise { - const { peerId, multiaddrs } = getPeerAddress(peerIdOrMultiaddr) - - const addrs: Address[] = multiaddrs.map(multiaddr => ({ - multiaddr, - isCertified: false - })) - - // create abort conditions - need to do this before `calculateMultiaddrs` as we may be about to - // resolve a dns addr which can time out - const signal = this.createDialAbortControllers(options.signal) - let addrsToDial: Address[] - - try { - // load addresses from address book, resolve and dnsaddrs, filter undiallables, add peer IDs, etc - addrsToDial = await this.calculateMultiaddrs(peerId, addrs, { - ...options, - signal - }) - } catch (err) { - signal.clear() - throw err - } - - // make sure we don't have an existing connection to any of the addresses we - // are about to dial - let existingConnection = Array.from(this.connections.values()).flat().find(conn => { - if (options.force === true) { - return false - } - - return addrsToDial.find(addr => { - return addr.multiaddr.equals(conn.remoteAddr) - }) - }) - - if (existingConnection != null) { - this.log('already connected to %a', existingConnection.remoteAddr) - return existingConnection - } - - // ready to dial, all async work finished - make sure we don't have any - // pending dials in progress for this peer or set of multiaddrs - const existingDial = this.pendingDials.find(dial => { - // is the dial for the same peer id? - if (dial.peerId != null && peerId != null && dial.peerId.equals(peerId)) { - return true - } - - // is the dial for the same set of multiaddrs? - if (addrsToDial.map(({ multiaddr }) => multiaddr.toString()).join() === dial.multiaddrs.map(multiaddr => multiaddr.toString()).join()) { - return true - } - - return false - }) - - if (existingDial != null) { - this.log('joining existing dial target for %p', peerId) - signal.clear() - return existingDial.promise - } - - this.log('creating dial target for', addrsToDial.map(({ multiaddr }) => multiaddr.toString())) - // @ts-expect-error .promise property is set below - const pendingDial: PendingDialInternal = { - id: randomId(), - status: 'queued', - peerId, - multiaddrs: addrsToDial.map(({ multiaddr }) => multiaddr) - } - - pendingDial.promise = this.performDial(pendingDial, { - ...options, - signal - }) - .finally(() => { - // remove our pending dial entry - this.pendingDials = this.pendingDials.filter(p => p.id !== pendingDial.id) - - // clean up abort signals/controllers - signal.clear() - }) - .catch(async err => { - this.log.error('dial failed to %s', pendingDial.multiaddrs.map(ma => ma.toString()).join(', '), err) - - if (peerId != null) { - // record the last failed dial - try { - await this.peerStore.patch(peerId, { - metadata: { - [LAST_DIAL_FAILURE_KEY]: uint8ArrayFromString(Date.now().toString()) - } - }) - } catch (err: any) { - this.log.error('could not update last dial failure key for %p', peerId, err) - } - } - - // Error is a timeout - if (signal.aborted) { - const error = new CodeError(err.message, ERR_TIMEOUT) - throw error - } - - throw err - }) - - // let other dials join this one - this.pendingDials.push(pendingDial) - - const connection = await pendingDial.promise - - // we may have been dialing a multiaddr without a peer id attached but by - // this point we have upgraded the connection so the remote peer information - // should be available - check again that we don't already have a connection - // to the remote multiaddr - existingConnection = Array.from(this.connections.values()).flat().find(conn => { - if (options.force === true) { - return false - } - - return conn.id !== connection.id && conn.remoteAddr.equals(connection.remoteAddr) - }) - - if (existingConnection != null) { - this.log('already connected to %a', existingConnection.remoteAddr) - await connection.close() - return existingConnection - } - - this.log('connection opened to %a', connection.remoteAddr) - return connection - } - - private createDialAbortControllers (userSignal?: AbortSignal): ClearableSignal { - // let any signal abort the dial - const signal = anySignal( - [AbortSignal.timeout(this.dialTimeout), - this.shutDownController.signal, - userSignal - ] - ) - - try { - // This emitter gets listened to a lot - setMaxListeners?.(Infinity, signal) - } catch {} - - return signal - } - - // eslint-disable-next-line complexity - private async calculateMultiaddrs (peerId?: PeerId, addrs: Address[] = [], options: DialOptions = {}): Promise { - // if a peer id or multiaddr(s) with a peer id, make sure it isn't our peer id and that we are allowed to dial it - if (peerId != null) { - if (this.peerId.equals(peerId)) { - throw new CodeError('Tried to dial self', codes.ERR_DIALED_SELF) - } - - if ((await this.connectionGater.denyDialPeer?.(peerId)) === true) { - throw new CodeError('The dial request is blocked by gater.allowDialPeer', codes.ERR_PEER_DIAL_INTERCEPTED) - } - - // if just a peer id was passed, load available multiaddrs for this peer from the address book - if (addrs.length === 0) { - this.log('loading multiaddrs for %p', peerId) - try { - const peer = await this.peerStore.get(peerId) - addrs.push(...peer.addresses) - this.log('loaded multiaddrs for %p', peerId, addrs.map(({ multiaddr }) => multiaddr.toString())) - } catch (err: any) { - if (err.code !== codes.ERR_NOT_FOUND) { - throw err - } - } - } - } - - // resolve addresses - this can result in a one-to-many translation when dnsaddrs are resolved - let resolvedAddresses = (await Promise.all( - addrs.map(async addr => { - const result = await resolveMultiaddrs(addr.multiaddr, { - ...options, - log: this.log - }) - - if (result.length === 1 && result[0].equals(addr.multiaddr)) { - return addr - } - - return result.map(multiaddr => ({ - multiaddr, - isCertified: false - })) - }) - )) - .flat() - - // ensure the peer id is appended to the multiaddr - if (peerId != null) { - const peerIdMultiaddr = `/p2p/${peerId.toString()}` - resolvedAddresses = resolvedAddresses.map(addr => { - const lastProto = addr.multiaddr.protos().pop() - - // do not append peer id to path multiaddrs - if (lastProto?.path === true) { - return addr - } - - // append peer id to multiaddr if it is not already present - if (addr.multiaddr.getPeerId() == null) { - return { - multiaddr: addr.multiaddr.encapsulate(peerIdMultiaddr), - isCertified: addr.isCertified - } - } - - return addr - }) - } - - const filteredAddrs = resolvedAddresses.filter(addr => { - // filter out any multiaddrs that we do not have transports for - if (this.transportManager.transportForMultiaddr(addr.multiaddr) == null) { - return false - } - - // if the resolved multiaddr has a PeerID but it's the wrong one, ignore it - // - this can happen with addresses like bootstrap.libp2p.io that resolve - // to multiple different peers - const addrPeerId = addr.multiaddr.getPeerId() - if (peerId != null && addrPeerId != null) { - return peerId.equals(addrPeerId) - } - - return true - }) - - // deduplicate addresses - const dedupedAddrs = new Map() - - for (const addr of filteredAddrs) { - const maStr = addr.multiaddr.toString() - const existing = dedupedAddrs.get(maStr) - - if (existing != null) { - existing.isCertified = existing.isCertified || addr.isCertified || false - continue - } - - dedupedAddrs.set(maStr, addr) - } - - const dedupedMultiaddrs = [...dedupedAddrs.values()] - - if (dedupedMultiaddrs.length === 0 || dedupedMultiaddrs.length > this.maxPeerAddrsToDial) { - this.log('addresses for %p before filtering', peerId ?? 'unknown peer', resolvedAddresses.map(({ multiaddr }) => multiaddr.toString())) - this.log('addresses for %p after filtering', peerId ?? 'unknown peer', dedupedMultiaddrs.map(({ multiaddr }) => multiaddr.toString())) - } - - // make sure we actually have some addresses to dial - if (dedupedMultiaddrs.length === 0) { - throw new CodeError('The dial request has no valid addresses', codes.ERR_NO_VALID_ADDRESSES) - } - - // make sure we don't have too many addresses to dial - if (dedupedMultiaddrs.length > this.maxPeerAddrsToDial) { - throw new CodeError('dial with more addresses than allowed', codes.ERR_TOO_MANY_ADDRESSES) - } - - const gatedAdrs: Address[] = [] - - for (const addr of dedupedMultiaddrs) { - if (this.connectionGater.denyDialMultiaddr != null && await this.connectionGater.denyDialMultiaddr(addr.multiaddr)) { - continue - } - - gatedAdrs.push(addr) - } - - const sortedGatedAddrs = gatedAdrs.sort(this.addressSorter) - - // make sure we actually have some addresses to dial - if (sortedGatedAddrs.length === 0) { - throw new CodeError('The connection gater denied all addresses in the dial request', codes.ERR_NO_VALID_ADDRESSES) - } - - return sortedGatedAddrs - } - - private async performDial (pendingDial: PendingDialInternal, options: DialOptions = {}): Promise { - const dialAbortControllers: Array<(AbortController | undefined)> = pendingDial.multiaddrs.map(() => new AbortController()) - - try { - // internal peer dial queue - only one dial per peer at a time - const peerDialQueue = new PQueue({ concurrency: 1 }) - peerDialQueue.on('error', (err) => { - this.log.error('error dialing %s %o', pendingDial.multiaddrs, err) - }) - - const conn = await Promise.any(pendingDial.multiaddrs.map(async (addr, i) => { - const controller = dialAbortControllers[i] - - if (controller == null) { - throw new CodeError('dialAction did not come with an AbortController', codes.ERR_INVALID_PARAMETERS) - } - - // let any signal abort the dial - const signal = combineSignals(controller.signal, options.signal) - signal.addEventListener('abort', () => { - this.log('dial to %a aborted', addr) - }) - const deferred = pDefer() - - await peerDialQueue.add(async () => { - if (signal.aborted) { - this.log('dial to %a was aborted before reaching the head of the peer dial queue', addr) - deferred.reject(new AbortError()) - return - } - - // add the individual dial to the dial queue so we don't breach maxConcurrentDials - await this.queue.add(async () => { - try { - if (signal.aborted) { - this.log('dial to %a was aborted before reaching the head of the dial queue', addr) - deferred.reject(new AbortError()) - return - } - - // update dial status - pendingDial.status = 'active' - - const conn = await this.transportManager.dial(addr, { - ...options, - signal - }) - - if (controller.signal.aborted) { - // another dial succeeded faster than this one - this.log('multiple dials succeeded, closing superfluous connection') - - conn.close().catch(err => { - this.log.error('error closing superfluous connection', err) - }) - - deferred.reject(new AbortError()) - return - } - - // remove the successful AbortController so it is not aborted - dialAbortControllers[i] = undefined - - // immediately abort any other dials - dialAbortControllers.forEach(c => { - if (c !== undefined) { - c.abort() - } - }) - - this.log('dial to %a succeeded', addr) - - // resolve the connection promise - deferred.resolve(conn) - } catch (err: any) { - // something only went wrong if our signal was not aborted - this.log.error('error during dial of %a', addr, err) - deferred.reject(err) - } - }, { - ...options, - signal - }).catch(err => { - deferred.reject(err) - }) - }, { - signal - }).catch(err => { - deferred.reject(err) - }).finally(() => { - signal.clear() - }) - - return deferred.promise - })) - - // dial succeeded or failed - if (conn == null) { - throw new CodeError('successful dial led to empty object returned from peer dial queue', codes.ERR_TRANSPORT_DIAL_FAILED) - } - - pendingDial.status = 'success' - - return conn - } catch (err: any) { - pendingDial.status = 'error' - - // if we only dialled one address, unwrap the AggregateError to provide more - // useful feedback to the user - if (pendingDial.multiaddrs.length === 1 && err.name === 'AggregateError') { - throw err.errors[0] - } - - throw err - } - } -} - -/** - * Returns a random string - */ -function randomId (): string { - return `${(parseInt(String(Math.random() * 1e9), 10)).toString()}${Date.now()}` -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/index.ts deleted file mode 100644 index 03240c4bf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/index.ts +++ /dev/null @@ -1,612 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { KEEP_ALIVE } from '@libp2p/interface/peer-store/tags' -import { PeerMap } from '@libp2p/peer-collections' -import { defaultAddressSort } from '@libp2p/utils/address-sort' -import { type Multiaddr, type Resolver, multiaddr } from '@multiformats/multiaddr' -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers' -import { RateLimiterMemory } from 'rate-limiter-flexible' -import { codes } from '../errors.js' -import { getPeerAddress } from '../get-peer.js' -import { AutoDial } from './auto-dial.js' -import { ConnectionPruner } from './connection-pruner.js' -import { AUTO_DIAL_CONCURRENCY, AUTO_DIAL_MAX_QUEUE_LENGTH, AUTO_DIAL_PRIORITY, DIAL_TIMEOUT, INBOUND_CONNECTION_THRESHOLD, MAX_CONNECTIONS, MAX_INCOMING_PENDING_CONNECTIONS, MAX_PARALLEL_DIALS, MAX_PEER_ADDRS_TO_DIAL, MIN_CONNECTIONS } from './constants.js' -import { DialQueue } from './dial-queue.js' -import type { PendingDial, AddressSorter, Libp2pEvents, AbortOptions, ComponentLogger, Logger } from '@libp2p/interface' -import type { Connection, MultiaddrConnection } from '@libp2p/interface/connection' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { Peer, PeerStore } from '@libp2p/interface/peer-store' -import type { Startable } from '@libp2p/interface/startable' -import type { ConnectionManager, OpenConnectionOptions } from '@libp2p/interface-internal/connection-manager' -import type { TransportManager } from '@libp2p/interface-internal/transport-manager' - -const DEFAULT_DIAL_PRIORITY = 50 - -export interface ConnectionManagerInit { - /** - * The maximum number of connections libp2p is willing to have before it starts - * pruning connections to reduce resource usage. (default: 300, 100 in browsers) - */ - maxConnections?: number - - /** - * The minimum number of connections below which libp2p will start to dial peers - * from the peer book. Setting this to 0 effectively disables this behaviour. - * (default: 50, 5 in browsers) - */ - minConnections?: number - - /** - * How long to wait between attempting to keep our number of concurrent connections - * above minConnections (default: 5000) - */ - autoDialInterval?: number - - /** - * When dialling peers from the peer book to keep the number of open connections - * above `minConnections`, add dials for this many peers to the dial queue - * at once. (default: 25) - */ - autoDialConcurrency?: number - - /** - * To allow user dials to take priority over auto dials, use this value as the - * dial priority. (default: 0) - */ - autoDialPriority?: number - - /** - * Limit the maximum number of peers to dial when trying to keep the number of - * open connections above `minConnections`. (default: 100) - */ - autoDialMaxQueueLength?: number - - /** - * When we've failed to dial a peer, do not autodial them again within this - * number of ms. (default: 1 minute, 7 minutes in browsers) - */ - autoDialPeerRetryThreshold?: number - - /** - * Newly discovered peers may be auto-dialed to increase the number of open - * connections, but they can be discovered in quick succession so add a small - * delay before attempting to dial them in case more peers have been - * discovered. (default: 10ms) - */ - autoDialDiscoveredPeersDebounce?: number - - /** - * Sort the known addresses of a peer before trying to dial, By default public - * addresses will be dialled before private (e.g. loopback or LAN) addresses. - */ - addressSorter?: AddressSorter - - /** - * The maximum number of dials across all peers to execute in parallel. - * (default: 100, 50 in browsers) - */ - maxParallelDials?: number - - /** - * Maximum number of addresses allowed for a given peer - if a peer has more - * addresses than this then the dial will fail. (default: 25) - */ - maxPeerAddrsToDial?: number - - /** - * How long a dial attempt is allowed to take, including DNS resolution - * of the multiaddr, opening a socket and upgrading it to a Connection. - */ - dialTimeout?: number - - /** - * When a new inbound connection is opened, the upgrade process (e.g. protect, - * encrypt, multiplex etc) must complete within this number of ms. (default: 30s) - */ - inboundUpgradeTimeout?: number - - /** - * Multiaddr resolvers to use when dialling - */ - resolvers?: Record - - /** - * A list of multiaddrs that will always be allowed (except if they are in the - * deny list) to open connections to this node even if we've reached maxConnections - */ - allow?: string[] - - /** - * A list of multiaddrs that will never be allowed to open connections to - * this node under any circumstances - */ - deny?: string[] - - /** - * If more than this many connections are opened per second by a single - * host, reject subsequent connections. (default: 5) - */ - inboundConnectionThreshold?: number - - /** - * The maximum number of parallel incoming connections allowed that have yet to - * complete the connection upgrade - e.g. choosing connection encryption, muxer, etc. - * (default: 10) - */ - maxIncomingPendingConnections?: number -} - -const defaultOptions = { - minConnections: MIN_CONNECTIONS, - maxConnections: MAX_CONNECTIONS, - inboundConnectionThreshold: INBOUND_CONNECTION_THRESHOLD, - maxIncomingPendingConnections: MAX_INCOMING_PENDING_CONNECTIONS, - autoDialConcurrency: AUTO_DIAL_CONCURRENCY, - autoDialPriority: AUTO_DIAL_PRIORITY, - autoDialMaxQueueLength: AUTO_DIAL_MAX_QUEUE_LENGTH -} - -export interface DefaultConnectionManagerComponents { - peerId: PeerId - metrics?: Metrics - peerStore: PeerStore - transportManager: TransportManager - connectionGater: ConnectionGater - events: TypedEventTarget - logger: ComponentLogger -} - -/** - * Responsible for managing known connections. - */ -export class DefaultConnectionManager implements ConnectionManager, Startable { - private started: boolean - private readonly connections: PeerMap - private readonly allow: Multiaddr[] - private readonly deny: Multiaddr[] - private readonly maxIncomingPendingConnections: number - private incomingPendingConnections: number - private readonly maxConnections: number - - public readonly dialQueue: DialQueue - public readonly autoDial: AutoDial - public readonly connectionPruner: ConnectionPruner - private readonly inboundConnectionRateLimiter: RateLimiterMemory - - private readonly peerStore: PeerStore - private readonly metrics?: Metrics - private readonly events: TypedEventTarget - private readonly log: Logger - - constructor (components: DefaultConnectionManagerComponents, init: ConnectionManagerInit = {}) { - this.maxConnections = init.maxConnections ?? defaultOptions.maxConnections - const minConnections = init.minConnections ?? defaultOptions.minConnections - - if (this.maxConnections < minConnections) { - throw new CodeError('Connection Manager maxConnections must be greater than minConnections', codes.ERR_INVALID_PARAMETERS) - } - - /** - * Map of connections per peer - */ - this.connections = new PeerMap() - - this.started = false - this.peerStore = components.peerStore - this.metrics = components.metrics - this.events = components.events - this.log = components.logger.forComponent('libp2p:connection-manager') - - this.onConnect = this.onConnect.bind(this) - this.onDisconnect = this.onDisconnect.bind(this) - this.events.addEventListener('connection:open', this.onConnect) - this.events.addEventListener('connection:close', this.onDisconnect) - - // allow/deny lists - this.allow = (init.allow ?? []).map(ma => multiaddr(ma)) - this.deny = (init.deny ?? []).map(ma => multiaddr(ma)) - - this.incomingPendingConnections = 0 - this.maxIncomingPendingConnections = init.maxIncomingPendingConnections ?? defaultOptions.maxIncomingPendingConnections - - // controls individual peers trying to dial us too quickly - this.inboundConnectionRateLimiter = new RateLimiterMemory({ - points: init.inboundConnectionThreshold ?? defaultOptions.inboundConnectionThreshold, - duration: 1 - }) - - // controls what happens when we don't have enough connections - this.autoDial = new AutoDial({ - connectionManager: this, - peerStore: components.peerStore, - events: components.events, - logger: components.logger - }, { - minConnections, - autoDialConcurrency: init.autoDialConcurrency ?? defaultOptions.autoDialConcurrency, - autoDialPriority: init.autoDialPriority ?? defaultOptions.autoDialPriority, - maxQueueLength: init.autoDialMaxQueueLength ?? defaultOptions.autoDialMaxQueueLength - }) - - // controls what happens when we have too many connections - this.connectionPruner = new ConnectionPruner({ - connectionManager: this, - peerStore: components.peerStore, - events: components.events, - logger: components.logger - }, { - maxConnections: this.maxConnections, - allow: this.allow - }) - - this.dialQueue = new DialQueue({ - peerId: components.peerId, - metrics: components.metrics, - peerStore: components.peerStore, - transportManager: components.transportManager, - connectionGater: components.connectionGater, - logger: components.logger - }, { - addressSorter: init.addressSorter ?? defaultAddressSort, - maxParallelDials: init.maxParallelDials ?? MAX_PARALLEL_DIALS, - maxPeerAddrsToDial: init.maxPeerAddrsToDial ?? MAX_PEER_ADDRS_TO_DIAL, - dialTimeout: init.dialTimeout ?? DIAL_TIMEOUT, - resolvers: init.resolvers ?? { - dnsaddr: dnsaddrResolver - }, - connections: this.connections - }) - } - - isStarted (): boolean { - return this.started - } - - /** - * Starts the Connection Manager. If Metrics are not enabled on libp2p - * only event loop and connection limits will be monitored. - */ - async start (): Promise { - // track inbound/outbound connections - this.metrics?.registerMetricGroup('libp2p_connection_manager_connections', { - calculate: () => { - const metric = { - inbound: 0, - outbound: 0 - } - - for (const conns of this.connections.values()) { - for (const conn of conns) { - if (conn.direction === 'inbound') { - metric.inbound++ - } else { - metric.outbound++ - } - } - } - - return metric - } - }) - - // track total number of streams per protocol - this.metrics?.registerMetricGroup('libp2p_protocol_streams_total', { - label: 'protocol', - calculate: () => { - const metric: Record = {} - - for (const conns of this.connections.values()) { - for (const conn of conns) { - for (const stream of conn.streams) { - const key = `${stream.direction} ${stream.protocol ?? 'unnegotiated'}` - - metric[key] = (metric[key] ?? 0) + 1 - } - } - } - - return metric - } - }) - - // track 90th percentile of streams per protocol - this.metrics?.registerMetricGroup('libp2p_connection_manager_protocol_streams_per_connection_90th_percentile', { - label: 'protocol', - calculate: () => { - const allStreams: Record = {} - - for (const conns of this.connections.values()) { - for (const conn of conns) { - const streams: Record = {} - - for (const stream of conn.streams) { - const key = `${stream.direction} ${stream.protocol ?? 'unnegotiated'}` - - streams[key] = (streams[key] ?? 0) + 1 - } - - for (const [protocol, count] of Object.entries(streams)) { - allStreams[protocol] = allStreams[protocol] ?? [] - allStreams[protocol].push(count) - } - } - } - - const metric: Record = {} - - for (let [protocol, counts] of Object.entries(allStreams)) { - counts = counts.sort((a, b) => a - b) - - const index = Math.floor(counts.length * 0.9) - metric[protocol] = counts[index] - } - - return metric - } - }) - - this.autoDial.start() - - this.started = true - this.log('started') - } - - async afterStart (): Promise { - // re-connect to any peers with the KEEP_ALIVE tag - void Promise.resolve() - .then(async () => { - const keepAlivePeers: Peer[] = await this.peerStore.all({ - filters: [(peer) => { - return peer.tags.has(KEEP_ALIVE) - }] - }) - - await Promise.all( - keepAlivePeers.map(async peer => { - await this.openConnection(peer.id) - .catch(err => { - this.log.error(err) - }) - }) - ) - }) - .catch(err => { - this.log.error(err) - }) - - this.autoDial.afterStart() - } - - /** - * Stops the Connection Manager - */ - async stop (): Promise { - this.dialQueue.stop() - this.autoDial.stop() - - // Close all connections we're tracking - const tasks: Array> = [] - for (const connectionList of this.connections.values()) { - for (const connection of connectionList) { - tasks.push((async () => { - try { - await connection.close() - } catch (err) { - this.log.error(err) - } - })()) - } - } - - this.log('closing %d connections', tasks.length) - await Promise.all(tasks) - this.connections.clear() - - this.log('stopped') - } - - onConnect (evt: CustomEvent): void { - void this._onConnect(evt).catch(err => { - this.log.error(err) - }) - } - - /** - * Tracks the incoming connection and check the connection limit - */ - async _onConnect (evt: CustomEvent): Promise { - const { detail: connection } = evt - - if (!this.started) { - // This can happen when we are in the process of shutting down the node - await connection.close() - return - } - - const peerId = connection.remotePeer - const storedConns = this.connections.get(peerId) - let isNewPeer = false - - if (storedConns != null) { - storedConns.push(connection) - } else { - isNewPeer = true - this.connections.set(peerId, [connection]) - } - - // only need to store RSA public keys, all other types are embedded in the peer id - if (peerId.publicKey != null && peerId.type === 'RSA') { - await this.peerStore.patch(peerId, { - publicKey: peerId.publicKey - }) - } - - if (isNewPeer) { - this.events.safeDispatchEvent('peer:connect', { detail: connection.remotePeer }) - } - } - - /** - * Removes the connection from tracking - */ - onDisconnect (evt: CustomEvent): void { - const { detail: connection } = evt - - if (!this.started) { - // This can happen when we are in the process of shutting down the node - return - } - - const peerId = connection.remotePeer - let storedConn = this.connections.get(peerId) - - if (storedConn != null && storedConn.length > 1) { - storedConn = storedConn.filter((conn) => conn.id !== connection.id) - this.connections.set(peerId, storedConn) - } else if (storedConn != null) { - this.connections.delete(peerId) - this.events.safeDispatchEvent('peer:disconnect', { detail: connection.remotePeer }) - } - } - - getConnections (peerId?: PeerId): Connection[] { - if (peerId != null) { - return this.connections.get(peerId) ?? [] - } - - let conns: Connection[] = [] - - for (const c of this.connections.values()) { - conns = conns.concat(c) - } - - return conns - } - - getConnectionsMap (): PeerMap { - return this.connections - } - - async openConnection (peerIdOrMultiaddr: PeerId | Multiaddr | Multiaddr[], options: OpenConnectionOptions = {}): Promise { - if (!this.isStarted()) { - throw new CodeError('Not started', codes.ERR_NODE_NOT_STARTED) - } - - options.signal?.throwIfAborted() - - const { peerId } = getPeerAddress(peerIdOrMultiaddr) - - if (peerId != null && options.force !== true) { - this.log('dial %p', peerId) - const existingConnection = this.getConnections(peerId) - .find(conn => !conn.transient) - - if (existingConnection != null) { - this.log('had an existing non-transient connection to %p', peerId) - - return existingConnection - } - } - - const connection = await this.dialQueue.dial(peerIdOrMultiaddr, { - ...options, - priority: options.priority ?? DEFAULT_DIAL_PRIORITY - }) - let peerConnections = this.connections.get(connection.remotePeer) - - if (peerConnections == null) { - peerConnections = [] - this.connections.set(connection.remotePeer, peerConnections) - } - - // we get notified of connections via the Upgrader emitting "connection" - // events, double check we aren't already tracking this connection before - // storing it - let trackedConnection = false - - for (const conn of peerConnections) { - if (conn.id === connection.id) { - trackedConnection = true - } - } - - if (!trackedConnection) { - peerConnections.push(connection) - } - - return connection - } - - async closeConnections (peerId: PeerId, options: AbortOptions = {}): Promise { - const connections = this.connections.get(peerId) ?? [] - - await Promise.all( - connections.map(async connection => { - try { - await connection.close(options) - } catch (err: any) { - connection.abort(err) - } - }) - ) - } - - async acceptIncomingConnection (maConn: MultiaddrConnection): Promise { - // check deny list - const denyConnection = this.deny.some(ma => { - return maConn.remoteAddr.toString().startsWith(ma.toString()) - }) - - if (denyConnection) { - this.log('connection from %a refused - connection remote address was in deny list', maConn.remoteAddr) - return false - } - - // check allow list - const allowConnection = this.allow.some(ma => { - return maConn.remoteAddr.toString().startsWith(ma.toString()) - }) - - if (allowConnection) { - this.incomingPendingConnections++ - - return true - } - - // check pending connections - if (this.incomingPendingConnections === this.maxIncomingPendingConnections) { - this.log('connection from %a refused - incomingPendingConnections exceeded by host', maConn.remoteAddr) - return false - } - - if (maConn.remoteAddr.isThinWaistAddress()) { - const host = maConn.remoteAddr.nodeAddress().address - - try { - await this.inboundConnectionRateLimiter.consume(host, 1) - } catch { - this.log('connection from %a refused - inboundConnectionThreshold exceeded by host %s', maConn.remoteAddr, host) - return false - } - } - - if (this.getConnections().length < this.maxConnections) { - this.incomingPendingConnections++ - - return true - } - - this.log('connection from %a refused - maxConnections exceeded', maConn.remoteAddr) - return false - } - - afterUpgradeInbound (): void { - this.incomingPendingConnections-- - } - - getDialQueue (): PendingDial[] { - return this.dialQueue.pendingDials - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/utils.ts deleted file mode 100644 index d32108e26..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection-manager/utils.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { setMaxListeners } from '@libp2p/interface/events' -import { type AbortOptions, multiaddr, type Multiaddr } from '@multiformats/multiaddr' -import { type ClearableSignal, anySignal } from 'any-signal' -import type { LoggerOptions } from '@libp2p/interface' - -/** - * Resolve multiaddr recursively - */ -export async function resolveMultiaddrs (ma: Multiaddr, options: AbortOptions & LoggerOptions): Promise { - // TODO: recursive logic should live in multiaddr once dns4/dns6 support is in place - // Now only supporting resolve for dnsaddr - const resolvableProto = ma.protoNames().includes('dnsaddr') - - // Multiaddr is not resolvable? End recursion! - if (!resolvableProto) { - return [ma] - } - - const resolvedMultiaddrs = await resolveRecord(ma, options) - const recursiveMultiaddrs = await Promise.all(resolvedMultiaddrs.map(async (nm) => { - return resolveMultiaddrs(nm, options) - })) - - const addrs = recursiveMultiaddrs.flat() - const output = addrs.reduce((array, newM) => { - if (array.find(m => m.equals(newM)) == null) { - array.push(newM) - } - return array - }, ([])) - - options.log('resolved %s to', ma, output.map(ma => ma.toString())) - - return output -} - -/** - * Resolve a given multiaddr. If this fails, an empty array will be returned - */ -async function resolveRecord (ma: Multiaddr, options: AbortOptions & LoggerOptions): Promise { - try { - ma = multiaddr(ma.toString()) // Use current multiaddr module - const multiaddrs = await ma.resolve(options) - return multiaddrs - } catch (err) { - options.log.error(`multiaddr ${ma.toString()} could not be resolved`, err) - return [] - } -} - -export function combineSignals (...signals: Array): ClearableSignal { - const sigs: AbortSignal[] = [] - - for (const sig of signals) { - if (sig != null) { - setMaxListeners(Infinity, sig) - sigs.push(sig) - } - } - - // let any signal abort the dial - const signal = anySignal(sigs) - - setMaxListeners(Infinity, signal) - - return signal -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection/index.ts deleted file mode 100644 index bbb248acb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/connection/index.ts +++ /dev/null @@ -1,208 +0,0 @@ -import { symbol } from '@libp2p/interface/connection' -import { CodeError } from '@libp2p/interface/errors' -import { setMaxListeners } from '@libp2p/interface/events' -import type { AbortOptions, Logger, ComponentLogger } from '@libp2p/interface' -import type { Direction, Connection, Stream, ConnectionTimeline, ConnectionStatus, NewStreamOptions } from '@libp2p/interface/connection' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { Multiaddr } from '@multiformats/multiaddr' - -const CLOSE_TIMEOUT = 500 - -interface ConnectionInit { - remoteAddr: Multiaddr - remotePeer: PeerId - newStream(protocols: string[], options?: AbortOptions): Promise - close(options?: AbortOptions): Promise - abort(err: Error): void - getStreams(): Stream[] - status: ConnectionStatus - direction: Direction - timeline: ConnectionTimeline - multiplexer?: string - encryption?: string - transient?: boolean - logger: ComponentLogger -} - -/** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ -export class ConnectionImpl implements Connection { - /** - * Connection identifier. - */ - public readonly id: string - - /** - * Observed multiaddr of the remote peer - */ - public readonly remoteAddr: Multiaddr - - /** - * Remote peer id - */ - public readonly remotePeer: PeerId - - public direction: Direction - public timeline: ConnectionTimeline - public multiplexer?: string - public encryption?: string - public status: ConnectionStatus - public transient: boolean - public readonly log: Logger - - /** - * User provided tags - * - */ - public tags: string[] - - /** - * Reference to the new stream function of the multiplexer - */ - private readonly _newStream: (protocols: string[], options?: NewStreamOptions) => Promise - - /** - * Reference to the close function of the raw connection - */ - private readonly _close: (options?: AbortOptions) => Promise - - private readonly _abort: (err: Error) => void - - /** - * Reference to the getStreams function of the muxer - */ - private readonly _getStreams: () => Stream[] - - /** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ - constructor (init: ConnectionInit) { - const { remoteAddr, remotePeer, newStream, close, abort, getStreams } = init - - this.id = `${(parseInt(String(Math.random() * 1e9))).toString(36)}${Date.now()}` - this.remoteAddr = remoteAddr - this.remotePeer = remotePeer - this.direction = init.direction - this.status = 'open' - this.timeline = init.timeline - this.multiplexer = init.multiplexer - this.encryption = init.encryption - this.transient = init.transient ?? false - this.log = init.logger.forComponent(`libp2p:connection:${this.direction}:${this.id}`) - - if (this.remoteAddr.getPeerId() == null) { - this.remoteAddr = this.remoteAddr.encapsulate(`/p2p/${this.remotePeer}`) - } - - this._newStream = newStream - this._close = close - this._abort = abort - this._getStreams = getStreams - this.tags = [] - } - - readonly [Symbol.toStringTag] = 'Connection' - - readonly [symbol] = true - - /** - * Get all the streams of the muxer - */ - get streams (): Stream[] { - return this._getStreams() - } - - /** - * Create a new stream from this connection - */ - async newStream (protocols: string | string[], options?: NewStreamOptions): Promise { - if (this.status === 'closing') { - throw new CodeError('the connection is being closed', 'ERR_CONNECTION_BEING_CLOSED') - } - - if (this.status === 'closed') { - throw new CodeError('the connection is closed', 'ERR_CONNECTION_CLOSED') - } - - if (!Array.isArray(protocols)) { - protocols = [protocols] - } - - if (this.transient && options?.runOnTransientConnection !== true) { - throw new CodeError('Cannot open protocol stream on transient connection', 'ERR_TRANSIENT_CONNECTION') - } - - const stream = await this._newStream(protocols, options) - - stream.direction = 'outbound' - - return stream - } - - /** - * Close the connection - */ - async close (options: AbortOptions = {}): Promise { - if (this.status === 'closed' || this.status === 'closing') { - return - } - - this.log('closing connection to %a', this.remoteAddr) - - this.status = 'closing' - - if (options.signal == null) { - const signal = AbortSignal.timeout(CLOSE_TIMEOUT) - setMaxListeners(Infinity, signal) - - options = { - ...options, - signal - } - } - - try { - this.log.trace('closing all streams') - - // close all streams gracefully - this can throw if we're not multiplexed - await Promise.all( - this.streams.map(async s => s.close(options)) - ) - - this.log.trace('closing underlying transport') - - // close raw connection - await this._close(options) - - this.log.trace('updating timeline with close time') - - this.status = 'closed' - this.timeline.close = Date.now() - } catch (err: any) { - this.log.error('error encountered during graceful close of connection to %a', this.remoteAddr, err) - this.abort(err) - } - } - - abort (err: Error): void { - this.log.error('aborting connection to %a due to error', this.remoteAddr, err) - - this.status = 'closing' - this.streams.forEach(s => { s.abort(err) }) - - this.log.error('all streams aborted', this.streams.length) - - // Abort raw connection - this._abort(err) - - this.timeline.close = Date.now() - this.status = 'closed' - } -} - -export function createConnection (init: ConnectionInit): Connection { - return new ConnectionImpl(init) -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/content-routing/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/content-routing/index.ts deleted file mode 100644 index a96c2bd9a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/content-routing/index.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import merge from 'it-merge' -import { pipe } from 'it-pipe' -import { codes, messages } from '../errors.js' -import { - storeAddresses, - uniquePeers, - requirePeers -} from './utils.js' -import type { AbortOptions } from '@libp2p/interface' -import type { ContentRouting } from '@libp2p/interface/content-routing' -import type { PeerInfo } from '@libp2p/interface/peer-info' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Startable } from '@libp2p/interface/startable' -import type { CID } from 'multiformats/cid' - -export interface CompoundContentRoutingInit { - routers: ContentRouting[] -} - -export interface CompoundContentRoutingComponents { - peerStore: PeerStore -} - -export class CompoundContentRouting implements ContentRouting, Startable { - private readonly routers: ContentRouting[] - private started: boolean - private readonly components: CompoundContentRoutingComponents - - constructor (components: CompoundContentRoutingComponents, init: CompoundContentRoutingInit) { - this.routers = init.routers ?? [] - this.started = false - this.components = components - } - - isStarted (): boolean { - return this.started - } - - async start (): Promise { - this.started = true - } - - async stop (): Promise { - this.started = false - } - - /** - * Iterates over all content routers in parallel to find providers of the given key - */ - async * findProviders (key: CID, options: AbortOptions = {}): AsyncIterable { - if (this.routers.length === 0) { - throw new CodeError('No content routers available', codes.ERR_NO_ROUTERS_AVAILABLE) - } - - yield * pipe( - merge( - ...this.routers.map(router => router.findProviders(key, options)) - ), - (source) => storeAddresses(source, this.components.peerStore), - (source) => uniquePeers(source), - (source) => requirePeers(source) - ) - } - - /** - * Iterates over all content routers in parallel to notify it is - * a provider of the given key - */ - async provide (key: CID, options: AbortOptions = {}): Promise { - if (this.routers.length === 0) { - throw new CodeError('No content routers available', codes.ERR_NO_ROUTERS_AVAILABLE) - } - - await Promise.all(this.routers.map(async (router) => { await router.provide(key, options) })) - } - - /** - * Store the given key/value pair in the available content routings - */ - async put (key: Uint8Array, value: Uint8Array, options?: AbortOptions): Promise { - if (!this.isStarted()) { - throw new CodeError(messages.NOT_STARTED_YET, codes.DHT_NOT_STARTED) - } - - await Promise.all(this.routers.map(async (router) => { - await router.put(key, value, options) - })) - } - - /** - * Get the value to the given key. - * Times out after 1 minute by default. - */ - async get (key: Uint8Array, options?: AbortOptions): Promise { - if (!this.isStarted()) { - throw new CodeError(messages.NOT_STARTED_YET, codes.DHT_NOT_STARTED) - } - - return Promise.any(this.routers.map(async (router) => { - return router.get(key, options) - })) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/content-routing/utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/content-routing/utils.ts deleted file mode 100644 index f114639c4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/content-routing/utils.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import filter from 'it-filter' -import map from 'it-map' -import type { PeerInfo } from '@libp2p/interface/peer-info' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Source } from 'it-stream-types' - -/** - * Store the multiaddrs from every peer in the passed peer store - */ -export async function * storeAddresses (source: Source, peerStore: PeerStore): AsyncIterable { - yield * map(source, async (peer) => { - // ensure we have the addresses for a given peer - await peerStore.merge(peer.id, { - multiaddrs: peer.multiaddrs - }) - - return peer - }) -} - -/** - * Filter peers by unique peer id - */ -export function uniquePeers (source: Source): AsyncIterable { - /** @type Set */ - const seen = new Set() - - return filter(source, (peer) => { - // dedupe by peer id - if (seen.has(peer.id.toString())) { - return false - } - - seen.add(peer.id.toString()) - - return true - }) -} - -/** - * Require at least `min` peers to be yielded from `source` - */ -export async function * requirePeers (source: Source, min: number = 1): AsyncIterable { - let seen = 0 - - for await (const peer of source) { - seen++ - - yield peer - } - - if (seen < min) { - throw new CodeError(`more peers required, seen: ${seen} min: ${min}`, 'NOT_FOUND') - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/errors.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/errors.ts deleted file mode 100644 index 0b84215aa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/errors.ts +++ /dev/null @@ -1,77 +0,0 @@ -export enum messages { - NOT_STARTED_YET = 'The libp2p node is not started yet', - DHT_DISABLED = 'DHT is not available', - PUBSUB_DISABLED = 'PubSub is not available', - CONN_ENCRYPTION_REQUIRED = 'At least one connection encryption module is required', - ERR_TRANSPORTS_REQUIRED = 'At least one transport module is required', - ERR_PROTECTOR_REQUIRED = 'Private network is enforced, but no protector was provided', - NOT_FOUND = 'Not found' -} - -export enum codes { - DHT_DISABLED = 'ERR_DHT_DISABLED', - ERR_PUBSUB_DISABLED = 'ERR_PUBSUB_DISABLED', - PUBSUB_NOT_STARTED = 'ERR_PUBSUB_NOT_STARTED', - DHT_NOT_STARTED = 'ERR_DHT_NOT_STARTED', - CONN_ENCRYPTION_REQUIRED = 'ERR_CONN_ENCRYPTION_REQUIRED', - ERR_TRANSPORTS_REQUIRED = 'ERR_TRANSPORTS_REQUIRED', - ERR_PROTECTOR_REQUIRED = 'ERR_PROTECTOR_REQUIRED', - ERR_PEER_DIAL_INTERCEPTED = 'ERR_PEER_DIAL_INTERCEPTED', - ERR_CONNECTION_INTERCEPTED = 'ERR_CONNECTION_INTERCEPTED', - ERR_INVALID_PROTOCOLS_FOR_STREAM = 'ERR_INVALID_PROTOCOLS_FOR_STREAM', - ERR_CONNECTION_ENDED = 'ERR_CONNECTION_ENDED', - ERR_CONNECTION_FAILED = 'ERR_CONNECTION_FAILED', - ERR_NODE_NOT_STARTED = 'ERR_NODE_NOT_STARTED', - ERR_ALREADY_ABORTED = 'ERR_ALREADY_ABORTED', - ERR_TOO_MANY_ADDRESSES = 'ERR_TOO_MANY_ADDRESSES', - ERR_NO_VALID_ADDRESSES = 'ERR_NO_VALID_ADDRESSES', - ERR_RELAYED_DIAL = 'ERR_RELAYED_DIAL', - ERR_DIALED_SELF = 'ERR_DIALED_SELF', - ERR_DISCOVERED_SELF = 'ERR_DISCOVERED_SELF', - ERR_DUPLICATE_TRANSPORT = 'ERR_DUPLICATE_TRANSPORT', - ERR_ENCRYPTION_FAILED = 'ERR_ENCRYPTION_FAILED', - ERR_HOP_REQUEST_FAILED = 'ERR_HOP_REQUEST_FAILED', - ERR_INVALID_KEY = 'ERR_INVALID_KEY', - ERR_INVALID_MESSAGE = 'ERR_INVALID_MESSAGE', - ERR_INVALID_PARAMETERS = 'ERR_INVALID_PARAMETERS', - ERR_INVALID_PEER = 'ERR_INVALID_PEER', - ERR_MUXER_UNAVAILABLE = 'ERR_MUXER_UNAVAILABLE', - ERR_NOT_FOUND = 'ERR_NOT_FOUND', - ERR_TRANSPORT_UNAVAILABLE = 'ERR_TRANSPORT_UNAVAILABLE', - ERR_TRANSPORT_DIAL_FAILED = 'ERR_TRANSPORT_DIAL_FAILED', - ERR_UNSUPPORTED_PROTOCOL = 'ERR_UNSUPPORTED_PROTOCOL', - ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED = 'ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED', - ERR_INVALID_MULTIADDR = 'ERR_INVALID_MULTIADDR', - ERR_SIGNATURE_NOT_VALID = 'ERR_SIGNATURE_NOT_VALID', - ERR_FIND_SELF = 'ERR_FIND_SELF', - ERR_NO_ROUTERS_AVAILABLE = 'ERR_NO_ROUTERS_AVAILABLE', - ERR_CONNECTION_NOT_MULTIPLEXED = 'ERR_CONNECTION_NOT_MULTIPLEXED', - ERR_NO_DIAL_TOKENS = 'ERR_NO_DIAL_TOKENS', - ERR_INVALID_CMS = 'ERR_INVALID_CMS', - ERR_MISSING_KEYS = 'ERR_MISSING_KEYS', - ERR_NO_KEY = 'ERR_NO_KEY', - ERR_INVALID_KEY_NAME = 'ERR_INVALID_KEY_NAME', - ERR_INVALID_KEY_TYPE = 'ERR_INVALID_KEY_TYPE', - ERR_KEY_ALREADY_EXISTS = 'ERR_KEY_ALREADY_EXISTS', - ERR_INVALID_KEY_SIZE = 'ERR_INVALID_KEY_SIZE', - ERR_KEY_NOT_FOUND = 'ERR_KEY_NOT_FOUND', - ERR_OLD_KEY_NAME_INVALID = 'ERR_OLD_KEY_NAME_INVALID', - ERR_NEW_KEY_NAME_INVALID = 'ERR_NEW_KEY_NAME_INVALID', - ERR_PASSWORD_REQUIRED = 'ERR_PASSWORD_REQUIRED', - ERR_PEM_REQUIRED = 'ERR_PEM_REQUIRED', - ERR_CANNOT_READ_KEY = 'ERR_CANNOT_READ_KEY', - ERR_MISSING_PRIVATE_KEY = 'ERR_MISSING_PRIVATE_KEY', - ERR_MISSING_PUBLIC_KEY = 'ERR_MISSING_PUBLIC_KEY', - ERR_INVALID_OLD_PASS_TYPE = 'ERR_INVALID_OLD_PASS_TYPE', - ERR_INVALID_NEW_PASS_TYPE = 'ERR_INVALID_NEW_PASS_TYPE', - ERR_INVALID_PASS_LENGTH = 'ERR_INVALID_PASS_LENGTH', - ERR_NOT_IMPLEMENTED = 'ERR_NOT_IMPLEMENTED', - ERR_WRONG_PING_ACK = 'ERR_WRONG_PING_ACK', - ERR_INVALID_RECORD = 'ERR_INVALID_RECORD', - ERR_ALREADY_SUCCEEDED = 'ERR_ALREADY_SUCCEEDED', - ERR_NO_HANDLER_FOR_PROTOCOL = 'ERR_NO_HANDLER_FOR_PROTOCOL', - ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS = 'ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS', - ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS = 'ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS', - ERR_CONNECTION_DENIED = 'ERR_CONNECTION_DENIED', - ERR_TRANSFER_LIMIT_EXCEEDED = 'ERR_TRANSFER_LIMIT_EXCEEDED' -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/get-peer.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/get-peer.ts deleted file mode 100644 index 8503fe7b6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/get-peer.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { isPeerId } from '@libp2p/interface/peer-id' -import { peerIdFromString } from '@libp2p/peer-id' -import { isMultiaddr } from '@multiformats/multiaddr' -import { codes } from './errors.js' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { Multiaddr } from '@multiformats/multiaddr' - -export interface PeerAddress { - peerId?: PeerId - multiaddrs: Multiaddr[] -} - -/** - * Extracts a PeerId and/or multiaddr from the passed PeerId or Multiaddr or an array of Multiaddrs - */ -export function getPeerAddress (peer: PeerId | Multiaddr | Multiaddr[]): PeerAddress { - if (isPeerId(peer)) { - return { peerId: peer, multiaddrs: [] } - } - - if (!Array.isArray(peer)) { - peer = [peer] - } - - let peerId: PeerId | undefined - - if (peer.length > 0) { - const peerIdStr = peer[0].getPeerId() - peerId = peerIdStr == null ? undefined : peerIdFromString(peerIdStr) - - // ensure PeerId is either not set or is consistent - peer.forEach(ma => { - if (!isMultiaddr(ma)) { - throw new CodeError('Invalid Multiaddr', codes.ERR_INVALID_MULTIADDR) - } - - const maPeerIdStr = ma.getPeerId() - - if (maPeerIdStr == null) { - if (peerId != null) { - throw new CodeError('Multiaddrs must all have the same peer id or have no peer id', codes.ERR_INVALID_PARAMETERS) - } - } else { - const maPeerId = peerIdFromString(maPeerIdStr) - - if (peerId == null || !peerId.equals(maPeerId)) { - throw new CodeError('Multiaddrs must all have the same peer id or have no peer id', codes.ERR_INVALID_PARAMETERS) - } - } - }) - } - - return { - peerId, - multiaddrs: peer - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/index.ts deleted file mode 100644 index 2c5fd44d4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/index.ts +++ /dev/null @@ -1,171 +0,0 @@ -/** - * @packageDocumentation - * - * Use the `createLibp2p` function to create a libp2p node. - * - * @example - * - * ```typescript - * import { createLibp2p } from 'libp2p' - * - * const node = await createLibp2p({ - * // ...other options - * }) - * ``` - */ - -import { createLibp2pNode } from './libp2p.js' -import type { AddressManagerInit } from './address-manager/index.js' -import type { Components } from './components.js' -import type { ConnectionManagerInit } from './connection-manager/index.js' -import type { TransportManagerInit } from './transport-manager.js' -import type { Libp2p, ServiceMap, RecursivePartial, ComponentLogger, NodeInfo } from '@libp2p/interface' -import type { ConnectionProtector } from '@libp2p/interface/connection' -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { ContentRouting } from '@libp2p/interface/content-routing' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerDiscovery } from '@libp2p/interface/peer-discovery' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerRouting } from '@libp2p/interface/peer-routing' -import type { StreamMuxerFactory } from '@libp2p/interface/stream-muxer' -import type { Transport } from '@libp2p/interface/transport' -import type { PersistentPeerStoreInit } from '@libp2p/peer-store' -import type { Datastore } from 'interface-datastore' - -export type ServiceFactoryMap = Record> = { - [Property in keyof T]: (components: Components) => T[Property] -} - -/** - * For Libp2p configurations and modules details read the [Configuration Document](./CONFIGURATION.md). - */ -export interface Libp2pInit }> { - /** - * peerId instance (it will be created if not provided) - */ - peerId: PeerId - - /** - * Metadata about the node - implementation name, version number, etc - */ - nodeInfo: NodeInfo - - /** - * Addresses for transport listening and to advertise to the network - */ - addresses: AddressManagerInit - - /** - * libp2p Connection Manager configuration - */ - connectionManager: ConnectionManagerInit - - /** - * A connection gater can deny new connections based on user criteria - */ - connectionGater: ConnectionGater - - /** - * libp2p transport manager configuration - */ - transportManager: TransportManagerInit - - /** - * An optional datastore to persist peer information, DHT records, etc. - * - * An in-memory datastore will be used if one is not provided. - */ - datastore: Datastore - - /** - * libp2p PeerStore configuration - */ - peerStore: PersistentPeerStoreInit - - /** - * An array that must include at least 1 compliant transport - */ - transports: Array<(components: Components) => Transport> - streamMuxers?: Array<(components: Components) => StreamMuxerFactory> - connectionEncryption?: Array<(components: Components) => ConnectionEncrypter> - peerDiscovery?: Array<(components: Components) => PeerDiscovery> - peerRouters?: Array<(components: Components) => PeerRouting> - contentRouters?: Array<(components: Components) => ContentRouting> - - /** - * A Metrics implementation can be supplied to collect metrics on this node - */ - metrics?(components: Components): Metrics - - /** - * A ConnectionProtector can be used to create a secure overlay on top of the network using pre-shared keys - */ - connectionProtector?(components: Components): ConnectionProtector - - /** - * Arbitrary libp2p modules - */ - services: ServiceFactoryMap - - /** - * An optional logging implementation that can be used to write runtime logs. - * - * Set the `DEBUG` env var or the `debug` key on LocalStorage to see logs. - * - * @example - * - * Node.js: - * - * ```console - * $ DEBUG="*libp2p:*" node myscript.js - * ``` - * - * Browsers: - * - * ```javascript - * localStorage.setItem('debug', '*libp2p:*') - * ``` - */ - logger?: ComponentLogger -} - -export type { Libp2p } - -export type Libp2pOptions> = RecursivePartial> & { start?: boolean } - -/** - * Returns a new instance of the Libp2p interface, generating a new PeerId - * if one is not passed as part of the options. - * - * The node will be started unless `start: false` is passed as an option. - * - * @example - * - * ```js - * import { createLibp2p } from 'libp2p' - * import { tcp } from '@libp2p/tcp' - * import { mplex } from '@libp2p/mplex' - * import { noise } from '@chainsafe/libp2p-noise' - * import { yamux } from '@chainsafe/libp2p-yamux' - * - * // specify options - * const options = { - * transports: [tcp()], - * streamMuxers: [yamux(), mplex()], - * connectionEncryption: [noise()] - * } - * - * // create libp2p - * const libp2p = await createLibp2p(options) - * ``` - */ -export async function createLibp2p }> (options: Libp2pOptions): Promise> { - const node = await createLibp2pNode(options) - - if (options.start !== false) { - await node.start() - } - - return node -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/libp2p.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/libp2p.ts deleted file mode 100644 index afe94969d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/libp2p.ts +++ /dev/null @@ -1,401 +0,0 @@ -import { unmarshalPublicKey } from '@libp2p/crypto/keys' -import { type ContentRouting, contentRouting } from '@libp2p/interface/content-routing' -import { CodeError } from '@libp2p/interface/errors' -import { TypedEventEmitter, CustomEvent, setMaxListeners } from '@libp2p/interface/events' -import { peerDiscovery } from '@libp2p/interface/peer-discovery' -import { type PeerRouting, peerRouting } from '@libp2p/interface/peer-routing' -import { defaultLogger } from '@libp2p/logger' -import { PeerSet } from '@libp2p/peer-collections' -import { peerIdFromString } from '@libp2p/peer-id' -import { createEd25519PeerId } from '@libp2p/peer-id-factory' -import { PersistentPeerStore } from '@libp2p/peer-store' -import { isMultiaddr, type Multiaddr } from '@multiformats/multiaddr' -import { MemoryDatastore } from 'datastore-core/memory' -import { concat as uint8ArrayConcat } from 'uint8arrays/concat' -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' -import { DefaultAddressManager } from './address-manager/index.js' -import { defaultComponents } from './components.js' -import { connectionGater } from './config/connection-gater.js' -import { validateConfig } from './config.js' -import { DefaultConnectionManager } from './connection-manager/index.js' -import { CompoundContentRouting } from './content-routing/index.js' -import { codes } from './errors.js' -import { DefaultPeerRouting } from './peer-routing.js' -import { DefaultRegistrar } from './registrar.js' -import { DefaultTransportManager } from './transport-manager.js' -import { DefaultUpgrader } from './upgrader.js' -import * as pkg from './version.js' -import type { Components } from './components.js' -import type { Libp2p, Libp2pInit, Libp2pOptions } from './index.js' -import type { Libp2pEvents, PendingDial, ServiceMap, AbortOptions, ComponentLogger, Logger } from '@libp2p/interface' -import type { Connection, NewStreamOptions, Stream } from '@libp2p/interface/connection' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerInfo } from '@libp2p/interface/peer-info' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Topology } from '@libp2p/interface/topology' -import type { StreamHandler, StreamHandlerOptions } from '@libp2p/interface-internal/registrar' - -export class Libp2pNode> extends TypedEventEmitter implements Libp2p { - public peerId: PeerId - public peerStore: PeerStore - public contentRouting: ContentRouting - public peerRouting: PeerRouting - public metrics?: Metrics - public services: T - public logger: ComponentLogger - - public components: Components - #started: boolean - private readonly log: Logger - - constructor (init: Libp2pInit) { - super() - - // event bus - components can listen to this emitter to be notified of system events - // and also cause them to be emitted - const events = new TypedEventEmitter() - const originalDispatch = events.dispatchEvent.bind(events) - events.dispatchEvent = (evt: any) => { - const internalResult = originalDispatch(evt) - const externalResult = this.dispatchEvent( - new CustomEvent(evt.type, { detail: evt.detail }) - ) - - return internalResult || externalResult - } - - // This emitter gets listened to a lot - setMaxListeners(Infinity, events) - - this.#started = false - this.peerId = init.peerId - this.logger = init.logger ?? defaultLogger() - this.log = this.logger.forComponent('libp2p') - // @ts-expect-error {} may not be of type T - this.services = {} - const components = this.components = defaultComponents({ - peerId: init.peerId, - nodeInfo: init.nodeInfo ?? { - name: pkg.name, - version: pkg.version - }, - logger: this.logger, - events, - datastore: init.datastore ?? new MemoryDatastore(), - connectionGater: connectionGater(init.connectionGater) - }) - - this.peerStore = this.configureComponent('peerStore', new PersistentPeerStore(components, { - addressFilter: this.components.connectionGater.filterMultiaddrForPeer, - ...init.peerStore - })) - - // Create Metrics - if (init.metrics != null) { - this.metrics = this.configureComponent('metrics', init.metrics(this.components)) - } - - components.events.addEventListener('peer:update', evt => { - // if there was no peer previously in the peer store this is a new peer - if (evt.detail.previous == null) { - const peerInfo: PeerInfo = { - id: evt.detail.peer.id, - multiaddrs: evt.detail.peer.addresses.map(a => a.multiaddr) - } - - components.events.safeDispatchEvent('peer:discovery', { detail: peerInfo }) - } - }) - - // Set up connection protector if configured - if (init.connectionProtector != null) { - this.configureComponent('connectionProtector', init.connectionProtector(components)) - } - - // Set up the Upgrader - this.components.upgrader = new DefaultUpgrader(this.components, { - connectionEncryption: (init.connectionEncryption ?? []).map((fn, index) => this.configureComponent(`connection-encryption-${index}`, fn(this.components))), - muxers: (init.streamMuxers ?? []).map((fn, index) => this.configureComponent(`stream-muxers-${index}`, fn(this.components))), - inboundUpgradeTimeout: init.connectionManager.inboundUpgradeTimeout - }) - - // Setup the transport manager - this.configureComponent('transportManager', new DefaultTransportManager(this.components, init.transportManager)) - - // Create the Connection Manager - this.configureComponent('connectionManager', new DefaultConnectionManager(this.components, init.connectionManager)) - - // Create the Registrar - this.configureComponent('registrar', new DefaultRegistrar(this.components)) - - // Addresses {listen, announce, noAnnounce} - this.configureComponent('addressManager', new DefaultAddressManager(this.components, init.addresses)) - - // Peer routers - const peerRouters: PeerRouting[] = (init.peerRouters ?? []).map((fn, index) => this.configureComponent(`peer-router-${index}`, fn(this.components))) - this.peerRouting = this.components.peerRouting = this.configureComponent('peerRouting', new DefaultPeerRouting(this.components, { - routers: peerRouters - })) - - // Content routers - const contentRouters: ContentRouting[] = (init.contentRouters ?? []).map((fn, index) => this.configureComponent(`content-router-${index}`, fn(this.components))) - this.contentRouting = this.components.contentRouting = this.configureComponent('contentRouting', new CompoundContentRouting(this.components, { - routers: contentRouters - })) - - // Discovery modules - ;(init.peerDiscovery ?? []).forEach((fn, index) => { - const service = this.configureComponent(`peer-discovery-${index}`, fn(this.components)) - - service.addEventListener('peer', (evt) => { - this.#onDiscoveryPeer(evt) - }) - }) - - // Transport modules - init.transports.forEach((fn, index) => { - this.components.transportManager.add(this.configureComponent(`transport-${index}`, fn(this.components))) - }) - - // User defined modules - if (init.services != null) { - for (const name of Object.keys(init.services)) { - const createService = init.services[name] - const service: any = createService(this.components) - - if (service == null) { - this.log.error('service factory %s returned null or undefined instance', name) - continue - } - - this.services[name as keyof T] = service - this.configureComponent(name, service) - - if (service[contentRouting] != null) { - this.log('registering service %s for content routing', name) - contentRouters.push(service[contentRouting]) - } - - if (service[peerRouting] != null) { - this.log('registering service %s for peer routing', name) - peerRouters.push(service[peerRouting]) - } - - if (service[peerDiscovery] != null) { - this.log('registering service %s for peer discovery', name) - service[peerDiscovery].addEventListener('peer', (evt: CustomEvent) => { - this.#onDiscoveryPeer(evt) - }) - } - } - } - } - - private configureComponent (name: string, component: T): T { - if (component == null) { - this.log.error('component %s was null or undefined', name) - } - - this.components[name] = component - - return component - } - - /** - * Starts the libp2p node and all its subsystems - */ - async start (): Promise { - if (this.#started) { - return - } - - this.#started = true - - this.log('libp2p is starting') - - try { - await this.components.beforeStart?.() - await this.components.start() - await this.components.afterStart?.() - - this.safeDispatchEvent('start', { detail: this }) - this.log('libp2p has started') - } catch (err: any) { - this.log.error('An error occurred starting libp2p', err) - await this.stop() - throw err - } - } - - /** - * Stop the libp2p node by closing its listeners and open connections - */ - async stop (): Promise { - if (!this.#started) { - return - } - - this.log('libp2p is stopping') - - this.#started = false - - await this.components.beforeStop?.() - await this.components.stop() - await this.components.afterStop?.() - - this.safeDispatchEvent('stop', { detail: this }) - this.log('libp2p has stopped') - } - - isStarted (): boolean { - return this.#started - } - - getConnections (peerId?: PeerId): Connection[] { - return this.components.connectionManager.getConnections(peerId) - } - - getDialQueue (): PendingDial[] { - return this.components.connectionManager.getDialQueue() - } - - getPeers (): PeerId[] { - const peerSet = new PeerSet() - - for (const conn of this.components.connectionManager.getConnections()) { - peerSet.add(conn.remotePeer) - } - - return Array.from(peerSet) - } - - async dial (peer: PeerId | Multiaddr | Multiaddr[], options: AbortOptions = {}): Promise { - return this.components.connectionManager.openConnection(peer, options) - } - - async dialProtocol (peer: PeerId | Multiaddr | Multiaddr[], protocols: string | string[], options: NewStreamOptions = {}): Promise { - if (protocols == null) { - throw new CodeError('no protocols were provided to open a stream', codes.ERR_INVALID_PROTOCOLS_FOR_STREAM) - } - - protocols = Array.isArray(protocols) ? protocols : [protocols] - - if (protocols.length === 0) { - throw new CodeError('no protocols were provided to open a stream', codes.ERR_INVALID_PROTOCOLS_FOR_STREAM) - } - - const connection = await this.dial(peer, options) - - return connection.newStream(protocols, options) - } - - getMultiaddrs (): Multiaddr[] { - return this.components.addressManager.getAddresses() - } - - getProtocols (): string[] { - return this.components.registrar.getProtocols() - } - - async hangUp (peer: PeerId | Multiaddr, options: AbortOptions = {}): Promise { - if (isMultiaddr(peer)) { - peer = peerIdFromString(peer.getPeerId() ?? '') - } - - await this.components.connectionManager.closeConnections(peer, options) - } - - /** - * Get the public key for the given peer id - */ - async getPublicKey (peer: PeerId, options: AbortOptions = {}): Promise { - this.log('getPublicKey %p', peer) - - if (peer.publicKey != null) { - return peer.publicKey - } - - const peerInfo = await this.peerStore.get(peer) - - if (peerInfo.id.publicKey != null) { - return peerInfo.id.publicKey - } - - const peerKey = uint8ArrayConcat([ - uint8ArrayFromString('/pk/'), - peer.multihash.digest - ]) - - // search any available content routing methods - const bytes = await this.contentRouting.get(peerKey, options) - // ensure the returned key is valid - unmarshalPublicKey(bytes) - - await this.peerStore.patch(peer, { - publicKey: bytes - }) - - return bytes - } - - async handle (protocols: string | string[], handler: StreamHandler, options?: StreamHandlerOptions): Promise { - if (!Array.isArray(protocols)) { - protocols = [protocols] - } - - await Promise.all( - protocols.map(async protocol => { - await this.components.registrar.handle(protocol, handler, options) - }) - ) - } - - async unhandle (protocols: string[] | string): Promise { - if (!Array.isArray(protocols)) { - protocols = [protocols] - } - - await Promise.all( - protocols.map(async protocol => { - await this.components.registrar.unhandle(protocol) - }) - ) - } - - async register (protocol: string, topology: Topology): Promise { - return this.components.registrar.register(protocol, topology) - } - - unregister (id: string): void { - this.components.registrar.unregister(id) - } - - /** - * Called whenever peer discovery services emit `peer` events and adds peers - * to the peer store. - */ - #onDiscoveryPeer (evt: CustomEvent): void { - const { detail: peer } = evt - - if (peer.id.toString() === this.peerId.toString()) { - this.log.error(new Error(codes.ERR_DISCOVERED_SELF)) - return - } - - void this.components.peerStore.merge(peer.id, { - multiaddrs: peer.multiaddrs - }) - .catch(err => { this.log.error(err) }) - } -} - -/** - * Returns a new Libp2pNode instance - this exposes more of the internals than the - * libp2p interface and is useful for testing and debugging. - */ -export async function createLibp2pNode > (options: Libp2pOptions): Promise> { - options.peerId ??= await createEd25519PeerId() - - return new Libp2pNode(validateConfig(options)) -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/peer-routing.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/peer-routing.ts deleted file mode 100644 index f5082cab5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/peer-routing.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import filter from 'it-filter' -import first from 'it-first' -import merge from 'it-merge' -import { pipe } from 'it-pipe' -import { - storeAddresses, - uniquePeers, - requirePeers -} from './content-routing/utils.js' -import { codes, messages } from './errors.js' -import type { AbortOptions, Logger } from '@libp2p/interface' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerInfo } from '@libp2p/interface/peer-info' -import type { PeerRouting } from '@libp2p/interface/peer-routing' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { ComponentLogger } from '@libp2p/logger' - -export interface PeerRoutingInit { - routers?: PeerRouting[] -} - -export interface DefaultPeerRoutingComponents { - peerId: PeerId - peerStore: PeerStore - logger: ComponentLogger -} - -export class DefaultPeerRouting implements PeerRouting { - private readonly log: Logger - private readonly peerId: PeerId - private readonly peerStore: PeerStore - private readonly routers: PeerRouting[] - - constructor (components: DefaultPeerRoutingComponents, init: PeerRoutingInit) { - this.log = components.logger.forComponent('libp2p:peer-routing') - this.peerId = components.peerId - this.peerStore = components.peerStore - this.routers = init.routers ?? [] - } - - /** - * Iterates over all peer routers in parallel to find the given peer - */ - async findPeer (id: PeerId, options?: AbortOptions): Promise { - if (this.routers.length === 0) { - throw new CodeError('No peer routers available', codes.ERR_NO_ROUTERS_AVAILABLE) - } - - if (id.toString() === this.peerId.toString()) { - throw new CodeError('Should not try to find self', codes.ERR_FIND_SELF) - } - - const self = this - - const output = await pipe( - merge( - ...this.routers.map(router => (async function * () { - try { - yield await router.findPeer(id, options) - } catch (err) { - self.log.error(err) - } - })()) - ), - (source) => filter(source, Boolean), - (source) => storeAddresses(source, this.peerStore), - async (source) => first(source) - ) - - if (output != null) { - return output - } - - throw new CodeError(messages.NOT_FOUND, codes.ERR_NOT_FOUND) - } - - /** - * Attempt to find the closest peers on the network to the given key - */ - async * getClosestPeers (key: Uint8Array, options?: AbortOptions): AsyncIterable { - if (this.routers.length === 0) { - throw new CodeError('No peer routers available', codes.ERR_NO_ROUTERS_AVAILABLE) - } - - yield * pipe( - merge( - ...this.routers.map(router => router.getClosestPeers(key, options)) - ), - (source) => storeAddresses(source, this.peerStore), - (source) => uniquePeers(source), - (source) => requirePeers(source) - ) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/registrar.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/registrar.ts deleted file mode 100644 index 11d70b05a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/registrar.ts +++ /dev/null @@ -1,234 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import merge from 'merge-options' -import { codes } from './errors.js' -import type { IdentifyResult, Libp2pEvents, Logger, PeerUpdate } from '@libp2p/interface' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Topology } from '@libp2p/interface/topology' -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager' -import type { StreamHandlerOptions, StreamHandlerRecord, Registrar, StreamHandler } from '@libp2p/interface-internal/registrar' -import type { ComponentLogger } from '@libp2p/logger' - -export const DEFAULT_MAX_INBOUND_STREAMS = 32 -export const DEFAULT_MAX_OUTBOUND_STREAMS = 64 - -export interface RegistrarComponents { - peerId: PeerId - connectionManager: ConnectionManager - peerStore: PeerStore - events: TypedEventTarget - logger: ComponentLogger -} - -/** - * Responsible for notifying registered protocols of events in the network. - */ -export class DefaultRegistrar implements Registrar { - private readonly log: Logger - private readonly topologies: Map> - private readonly handlers: Map - private readonly components: RegistrarComponents - - constructor (components: RegistrarComponents) { - this.log = components.logger.forComponent('libp2p:registrar') - this.topologies = new Map() - this.handlers = new Map() - this.components = components - - this._onDisconnect = this._onDisconnect.bind(this) - this._onPeerUpdate = this._onPeerUpdate.bind(this) - this._onPeerIdentify = this._onPeerIdentify.bind(this) - - this.components.events.addEventListener('peer:disconnect', this._onDisconnect) - this.components.events.addEventListener('peer:update', this._onPeerUpdate) - this.components.events.addEventListener('peer:identify', this._onPeerIdentify) - } - - getProtocols (): string[] { - return Array.from(new Set([ - ...this.handlers.keys() - ])).sort() - } - - getHandler (protocol: string): StreamHandlerRecord { - const handler = this.handlers.get(protocol) - - if (handler == null) { - throw new CodeError(`No handler registered for protocol ${protocol}`, codes.ERR_NO_HANDLER_FOR_PROTOCOL) - } - - return handler - } - - getTopologies (protocol: string): Topology[] { - const topologies = this.topologies.get(protocol) - - if (topologies == null) { - return [] - } - - return [ - ...topologies.values() - ] - } - - /** - * Registers the `handler` for each protocol - */ - async handle (protocol: string, handler: StreamHandler, opts?: StreamHandlerOptions): Promise { - if (this.handlers.has(protocol)) { - throw new CodeError(`Handler already registered for protocol ${protocol}`, codes.ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED) - } - - const options = merge.bind({ ignoreUndefined: true })({ - maxInboundStreams: DEFAULT_MAX_INBOUND_STREAMS, - maxOutboundStreams: DEFAULT_MAX_OUTBOUND_STREAMS - }, opts) - - this.handlers.set(protocol, { - handler, - options - }) - - // Add new protocol to self protocols in the peer store - await this.components.peerStore.merge(this.components.peerId, { - protocols: [protocol] - }) - } - - /** - * Removes the handler for each protocol. The protocol - * will no longer be supported on streams. - */ - async unhandle (protocols: string | string[]): Promise { - const protocolList = Array.isArray(protocols) ? protocols : [protocols] - - protocolList.forEach(protocol => { - this.handlers.delete(protocol) - }) - - // Update self protocols in the peer store - await this.components.peerStore.patch(this.components.peerId, { - protocols: this.getProtocols() - }) - } - - /** - * Register handlers for a set of multicodecs given - */ - async register (protocol: string, topology: Topology): Promise { - if (topology == null) { - throw new CodeError('invalid topology', codes.ERR_INVALID_PARAMETERS) - } - - // Create topology - const id = `${(Math.random() * 1e9).toString(36)}${Date.now()}` - - let topologies = this.topologies.get(protocol) - - if (topologies == null) { - topologies = new Map() - this.topologies.set(protocol, topologies) - } - - topologies.set(id, topology) - - return id - } - - /** - * Unregister topology - */ - unregister (id: string): void { - for (const [protocol, topologies] of this.topologies.entries()) { - if (topologies.has(id)) { - topologies.delete(id) - - if (topologies.size === 0) { - this.topologies.delete(protocol) - } - } - } - } - - /** - * Remove a disconnected peer from the record - */ - _onDisconnect (evt: CustomEvent): void { - const remotePeer = evt.detail - - void this.components.peerStore.get(remotePeer) - .then(peer => { - for (const protocol of peer.protocols) { - const topologies = this.topologies.get(protocol) - - if (topologies == null) { - // no topologies are interested in this protocol - continue - } - - for (const topology of topologies.values()) { - topology.onDisconnect?.(remotePeer) - } - } - }) - .catch(err => { - if (err.code === codes.ERR_NOT_FOUND) { - // peer has not completed identify so they are not in the peer store - return - } - - this.log.error('could not inform topologies of disconnecting peer %p', remotePeer, err) - }) - } - - /** - * When a peer is updated, if they have removed supported protocols notify any - * topologies interested in the removed protocols. - */ - _onPeerUpdate (evt: CustomEvent): void { - const { peer, previous } = evt.detail - const removed = (previous?.protocols ?? []).filter(protocol => !peer.protocols.includes(protocol)) - - for (const protocol of removed) { - const topologies = this.topologies.get(protocol) - - if (topologies == null) { - // no topologies are interested in this protocol - continue - } - - for (const topology of topologies.values()) { - topology.onDisconnect?.(peer.id) - } - } - } - - /** - * After identify has completed and we have received the list of supported - * protocols, notify any topologies interested in those protocols. - */ - _onPeerIdentify (evt: CustomEvent): void { - const protocols = evt.detail.protocols - const connection = evt.detail.connection - const peerId = evt.detail.peerId - - for (const protocol of protocols) { - const topologies = this.topologies.get(protocol) - - if (topologies == null) { - // no topologies are interested in this protocol - continue - } - - for (const topology of topologies.values()) { - if (connection.transient && topology.notifyOnTransient !== true) { - continue - } - - topology.onConnect?.(peerId, connection) - } - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/transport-manager.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/transport-manager.ts deleted file mode 100644 index a9b47d5cc..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/transport-manager.ts +++ /dev/null @@ -1,300 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { trackedMap } from '@libp2p/interface/metrics/tracked-map' -import { FaultTolerance } from '@libp2p/interface/transport' -import { codes } from './errors.js' -import type { Libp2pEvents, AbortOptions, ComponentLogger, Logger } from '@libp2p/interface' -import type { Connection } from '@libp2p/interface/connection' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { Metrics } from '@libp2p/interface/metrics' -import type { Startable } from '@libp2p/interface/startable' -import type { Listener, Transport, Upgrader } from '@libp2p/interface/transport' -import type { AddressManager } from '@libp2p/interface-internal/address-manager' -import type { TransportManager } from '@libp2p/interface-internal/transport-manager' -import type { Multiaddr } from '@multiformats/multiaddr' - -export interface TransportManagerInit { - faultTolerance?: FaultTolerance -} - -export interface DefaultTransportManagerComponents { - metrics?: Metrics - addressManager: AddressManager - upgrader: Upgrader - events: TypedEventTarget - logger: ComponentLogger -} - -export class DefaultTransportManager implements TransportManager, Startable { - private readonly log: Logger - private readonly components: DefaultTransportManagerComponents - private readonly transports: Map - private readonly listeners: Map - private readonly faultTolerance: FaultTolerance - private started: boolean - - constructor (components: DefaultTransportManagerComponents, init: TransportManagerInit = {}) { - this.log = components.logger.forComponent('libp2p:transports') - this.components = components - this.started = false - this.transports = new Map() - this.listeners = trackedMap({ - name: 'libp2p_transport_manager_listeners', - metrics: this.components.metrics - }) - this.faultTolerance = init.faultTolerance ?? FaultTolerance.FATAL_ALL - } - - /** - * Adds a `Transport` to the manager - */ - add (transport: Transport): void { - const tag = transport[Symbol.toStringTag] - - if (tag == null) { - throw new CodeError('Transport must have a valid tag', codes.ERR_INVALID_KEY) - } - - if (this.transports.has(tag)) { - throw new CodeError(`There is already a transport with the tag ${tag}`, codes.ERR_DUPLICATE_TRANSPORT) - } - - this.log('adding transport %s', tag) - - this.transports.set(tag, transport) - - if (!this.listeners.has(tag)) { - this.listeners.set(tag, []) - } - } - - isStarted (): boolean { - return this.started - } - - start (): void { - this.started = true - } - - async afterStart (): Promise { - // Listen on the provided transports for the provided addresses - const addrs = this.components.addressManager.getListenAddrs() - - await this.listen(addrs) - } - - /** - * Stops all listeners - */ - async stop (): Promise { - const tasks = [] - for (const [key, listeners] of this.listeners) { - this.log('closing listeners for %s', key) - while (listeners.length > 0) { - const listener = listeners.pop() - - if (listener == null) { - continue - } - - tasks.push(listener.close()) - } - } - - await Promise.all(tasks) - this.log('all listeners closed') - for (const key of this.listeners.keys()) { - this.listeners.set(key, []) - } - - this.started = false - } - - /** - * Dials the given Multiaddr over it's supported transport - */ - async dial (ma: Multiaddr, options?: AbortOptions): Promise { - const transport = this.transportForMultiaddr(ma) - - if (transport == null) { - throw new CodeError(`No transport available for address ${String(ma)}`, codes.ERR_TRANSPORT_UNAVAILABLE) - } - - try { - return await transport.dial(ma, { - ...options, - upgrader: this.components.upgrader - }) - } catch (err: any) { - if (err.code == null) { - err.code = codes.ERR_TRANSPORT_DIAL_FAILED - } - - throw err - } - } - - /** - * Returns all Multiaddr's the listeners are using - */ - getAddrs (): Multiaddr[] { - let addrs: Multiaddr[] = [] - for (const listeners of this.listeners.values()) { - for (const listener of listeners) { - addrs = [...addrs, ...listener.getAddrs()] - } - } - return addrs - } - - /** - * Returns all the transports instances - */ - getTransports (): Transport[] { - return Array.of(...this.transports.values()) - } - - /** - * Returns all the listener instances - */ - getListeners (): Listener[] { - return Array.of(...this.listeners.values()).flat() - } - - /** - * Finds a transport that matches the given Multiaddr - */ - transportForMultiaddr (ma: Multiaddr): Transport | undefined { - for (const transport of this.transports.values()) { - const addrs = transport.filter([ma]) - - if (addrs.length > 0) { - return transport - } - } - } - - /** - * Starts listeners for each listen Multiaddr - */ - async listen (addrs: Multiaddr[]): Promise { - if (!this.isStarted()) { - throw new CodeError('Not started', codes.ERR_NODE_NOT_STARTED) - } - - if (addrs == null || addrs.length === 0) { - this.log('no addresses were provided for listening, this node is dial only') - return - } - - const couldNotListen = [] - - for (const [key, transport] of this.transports.entries()) { - const supportedAddrs = transport.filter(addrs) - const tasks = [] - - // For each supported multiaddr, create a listener - for (const addr of supportedAddrs) { - this.log('creating listener for %s on %a', key, addr) - const listener = transport.createListener({ - upgrader: this.components.upgrader - }) - - let listeners: Listener[] = this.listeners.get(key) ?? [] - - if (listeners == null) { - listeners = [] - this.listeners.set(key, listeners) - } - - listeners.push(listener) - - // Track listen/close events - listener.addEventListener('listening', () => { - this.components.events.safeDispatchEvent('transport:listening', { - detail: listener - }) - }) - listener.addEventListener('close', () => { - const index = listeners.findIndex(l => l === listener) - - // remove the listener - listeners.splice(index, 1) - - this.components.events.safeDispatchEvent('transport:close', { - detail: listener - }) - }) - - // We need to attempt to listen on everything - tasks.push(listener.listen(addr)) - } - - // Keep track of transports we had no addresses for - if (tasks.length === 0) { - couldNotListen.push(key) - continue - } - - const results = await Promise.allSettled(tasks) - // If we are listening on at least 1 address, succeed. - // TODO: we should look at adding a retry (`p-retry`) here to better support - // listening on remote addresses as they may be offline. We could then potentially - // just wait for any (`p-any`) listener to succeed on each transport before returning - const isListening = results.find(r => r.status === 'fulfilled') - if ((isListening == null) && this.faultTolerance !== FaultTolerance.NO_FATAL) { - throw new CodeError(`Transport (${key}) could not listen on any available address`, codes.ERR_NO_VALID_ADDRESSES) - } - } - - // If no transports were able to listen, throw an error. This likely - // means we were given addresses we do not have transports for - if (couldNotListen.length === this.transports.size) { - const message = `no valid addresses were provided for transports [${couldNotListen.join(', ')}]` - if (this.faultTolerance === FaultTolerance.FATAL_ALL) { - throw new CodeError(message, codes.ERR_NO_VALID_ADDRESSES) - } - this.log(`libp2p in dial mode only: ${message}`) - } - } - - /** - * Removes the given transport from the manager. - * If a transport has any running listeners, they will be closed. - */ - async remove (key: string): Promise { - const listeners = this.listeners.get(key) ?? [] - this.log.trace('removing transport %s', key) - - // Close any running listeners - const tasks = [] - this.log.trace('closing listeners for %s', key) - while (listeners.length > 0) { - const listener = listeners.pop() - - if (listener == null) { - continue - } - - tasks.push(listener.close()) - } - await Promise.all(tasks) - - this.transports.delete(key) - this.listeners.delete(key) - } - - /** - * Removes all transports from the manager. - * If any listeners are running, they will be closed. - * - * @async - */ - async removeAll (): Promise { - const tasks = [] - for (const key of this.transports.keys()) { - tasks.push(this.remove(key)) - } - - await Promise.all(tasks) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/upgrader.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/upgrader.ts deleted file mode 100644 index 4310f07c7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/upgrader.ts +++ /dev/null @@ -1,744 +0,0 @@ -import { CodeError, ERR_TIMEOUT } from '@libp2p/interface/errors' -import { setMaxListeners } from '@libp2p/interface/events' -import * as mss from '@libp2p/multistream-select' -import { peerIdFromString } from '@libp2p/peer-id' -import { createConnection } from './connection/index.js' -import { INBOUND_UPGRADE_TIMEOUT } from './connection-manager/constants.js' -import { codes } from './errors.js' -import { DEFAULT_MAX_INBOUND_STREAMS, DEFAULT_MAX_OUTBOUND_STREAMS } from './registrar.js' -import type { Libp2pEvents, AbortOptions, ComponentLogger, Logger } from '@libp2p/interface' -import type { MultiaddrConnection, Connection, Stream, ConnectionProtector, NewStreamOptions } from '@libp2p/interface/connection' -import type { ConnectionEncrypter, SecuredConnection } from '@libp2p/interface/connection-encrypter' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { StreamMuxer, StreamMuxerFactory } from '@libp2p/interface/stream-muxer' -import type { Upgrader, UpgraderOptions } from '@libp2p/interface/transport' -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager' -import type { Registrar } from '@libp2p/interface-internal/registrar' - -const DEFAULT_PROTOCOL_SELECT_TIMEOUT = 30000 - -interface CreateConnectionOptions { - cryptoProtocol: string - direction: 'inbound' | 'outbound' - maConn: MultiaddrConnection - upgradedConn: MultiaddrConnection - remotePeer: PeerId - muxerFactory?: StreamMuxerFactory - transient?: boolean -} - -interface OnStreamOptions { - connection: Connection - stream: Stream - protocol: string -} - -export interface CryptoResult extends SecuredConnection { - protocol: string -} - -export interface UpgraderInit { - connectionEncryption: ConnectionEncrypter[] - muxers: StreamMuxerFactory[] - - /** - * An amount of ms by which an inbound connection upgrade - * must complete - */ - inboundUpgradeTimeout?: number -} - -function findIncomingStreamLimit (protocol: string, registrar: Registrar): number | undefined { - try { - const { options } = registrar.getHandler(protocol) - - return options.maxInboundStreams - } catch (err: any) { - if (err.code !== codes.ERR_NO_HANDLER_FOR_PROTOCOL) { - throw err - } - } - - return DEFAULT_MAX_INBOUND_STREAMS -} - -function findOutgoingStreamLimit (protocol: string, registrar: Registrar, options: NewStreamOptions = {}): number { - try { - const { options } = registrar.getHandler(protocol) - - if (options.maxOutboundStreams != null) { - return options.maxOutboundStreams - } - } catch (err: any) { - if (err.code !== codes.ERR_NO_HANDLER_FOR_PROTOCOL) { - throw err - } - } - - return options.maxOutboundStreams ?? DEFAULT_MAX_OUTBOUND_STREAMS -} - -function countStreams (protocol: string, direction: 'inbound' | 'outbound', connection: Connection): number { - let streamCount = 0 - - connection.streams.forEach(stream => { - if (stream.direction === direction && stream.protocol === protocol) { - streamCount++ - } - }) - - return streamCount -} - -export interface DefaultUpgraderComponents { - peerId: PeerId - metrics?: Metrics - connectionManager: ConnectionManager - connectionGater: ConnectionGater - connectionProtector?: ConnectionProtector - registrar: Registrar - peerStore: PeerStore - events: TypedEventTarget - logger: ComponentLogger -} - -type ConnectionDeniedType = keyof Pick - -export class DefaultUpgrader implements Upgrader { - private readonly components: DefaultUpgraderComponents - private readonly connectionEncryption: Map - private readonly muxers: Map - private readonly inboundUpgradeTimeout: number - private readonly events: TypedEventTarget - private readonly log: Logger - - constructor (components: DefaultUpgraderComponents, init: UpgraderInit) { - this.components = components - this.connectionEncryption = new Map() - this.log = components.logger.forComponent('libp2p:upgrader') - - init.connectionEncryption.forEach(encrypter => { - this.connectionEncryption.set(encrypter.protocol, encrypter) - }) - - this.muxers = new Map() - - init.muxers.forEach(muxer => { - this.muxers.set(muxer.protocol, muxer) - }) - - this.inboundUpgradeTimeout = init.inboundUpgradeTimeout ?? INBOUND_UPGRADE_TIMEOUT - this.events = components.events - } - - async shouldBlockConnection (remotePeer: PeerId, maConn: MultiaddrConnection, connectionType: ConnectionDeniedType): Promise { - const connectionGater = this.components.connectionGater[connectionType] - - if (connectionGater !== undefined) { - if (await connectionGater(remotePeer, maConn)) { - throw new CodeError(`The multiaddr connection is blocked by gater.${connectionType}`, codes.ERR_CONNECTION_INTERCEPTED) - } - } - } - - /** - * Upgrades an inbound connection - */ - async upgradeInbound (maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise { - const accept = await this.components.connectionManager.acceptIncomingConnection(maConn) - - if (!accept) { - throw new CodeError('connection denied', codes.ERR_CONNECTION_DENIED) - } - - let encryptedConn: MultiaddrConnection - let remotePeer - let upgradedConn: MultiaddrConnection - let muxerFactory: StreamMuxerFactory | undefined - let cryptoProtocol - - const signal = AbortSignal.timeout(this.inboundUpgradeTimeout) - - const onAbort = (): void => { - maConn.abort(new CodeError('inbound upgrade timeout', ERR_TIMEOUT)) - } - - signal.addEventListener('abort', onAbort, { once: true }) - - setMaxListeners(Infinity, signal) - - try { - if ((await this.components.connectionGater.denyInboundConnection?.(maConn)) === true) { - throw new CodeError('The multiaddr connection is blocked by gater.acceptConnection', codes.ERR_CONNECTION_INTERCEPTED) - } - - this.components.metrics?.trackMultiaddrConnection(maConn) - - this.log('starting the inbound connection upgrade') - - // Protect - let protectedConn = maConn - - if (opts?.skipProtection !== true) { - const protector = this.components.connectionProtector - - if (protector != null) { - this.log('protecting the inbound connection') - protectedConn = await protector.protect(maConn) - } - } - - try { - // Encrypt the connection - encryptedConn = protectedConn - if (opts?.skipEncryption !== true) { - ({ - conn: encryptedConn, - remotePeer, - protocol: cryptoProtocol - } = await this._encryptInbound(protectedConn)) - - const maConn: MultiaddrConnection = { - ...protectedConn, - ...encryptedConn - } - - await this.shouldBlockConnection(remotePeer, maConn, 'denyInboundEncryptedConnection') - } else { - const idStr = maConn.remoteAddr.getPeerId() - - if (idStr == null) { - throw new CodeError('inbound connection that skipped encryption must have a peer id', codes.ERR_INVALID_MULTIADDR) - } - - const remotePeerId = peerIdFromString(idStr) - - cryptoProtocol = 'native' - remotePeer = remotePeerId - } - - upgradedConn = encryptedConn - if (opts?.muxerFactory != null) { - muxerFactory = opts.muxerFactory - } else if (this.muxers.size > 0) { - // Multiplex the connection - const multiplexed = await this._multiplexInbound({ - ...protectedConn, - ...encryptedConn - }, this.muxers) - muxerFactory = multiplexed.muxerFactory - upgradedConn = multiplexed.stream - } - } catch (err: any) { - this.log.error('Failed to upgrade inbound connection', err) - throw err - } - - await this.shouldBlockConnection(remotePeer, maConn, 'denyInboundUpgradedConnection') - - this.log('successfully upgraded inbound connection') - - return this._createConnection({ - cryptoProtocol, - direction: 'inbound', - maConn, - upgradedConn, - muxerFactory, - remotePeer, - transient: opts?.transient - }) - } finally { - signal.removeEventListener('abort', onAbort) - - this.components.connectionManager.afterUpgradeInbound() - } - } - - /** - * Upgrades an outbound connection - */ - async upgradeOutbound (maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise { - const idStr = maConn.remoteAddr.getPeerId() - let remotePeerId: PeerId | undefined - - if (idStr != null) { - remotePeerId = peerIdFromString(idStr) - - await this.shouldBlockConnection(remotePeerId, maConn, 'denyOutboundConnection') - } - - let encryptedConn: MultiaddrConnection - let remotePeer: PeerId - let upgradedConn: MultiaddrConnection - let cryptoProtocol - let muxerFactory - - this.components.metrics?.trackMultiaddrConnection(maConn) - - this.log('Starting the outbound connection upgrade') - - // If the transport natively supports encryption, skip connection - // protector and encryption - - // Protect - let protectedConn = maConn - if (opts?.skipProtection !== true) { - const protector = this.components.connectionProtector - - if (protector != null) { - protectedConn = await protector.protect(maConn) - } - } - - try { - // Encrypt the connection - encryptedConn = protectedConn - if (opts?.skipEncryption !== true) { - ({ - conn: encryptedConn, - remotePeer, - protocol: cryptoProtocol - } = await this._encryptOutbound(protectedConn, remotePeerId)) - - const maConn: MultiaddrConnection = { - ...protectedConn, - ...encryptedConn - } - - await this.shouldBlockConnection(remotePeer, maConn, 'denyOutboundEncryptedConnection') - } else { - if (remotePeerId == null) { - throw new CodeError('Encryption was skipped but no peer id was passed', codes.ERR_INVALID_PEER) - } - - cryptoProtocol = 'native' - remotePeer = remotePeerId - } - - upgradedConn = encryptedConn - if (opts?.muxerFactory != null) { - muxerFactory = opts.muxerFactory - } else if (this.muxers.size > 0) { - // Multiplex the connection - const multiplexed = await this._multiplexOutbound({ - ...protectedConn, - ...encryptedConn - }, this.muxers) - muxerFactory = multiplexed.muxerFactory - upgradedConn = multiplexed.stream - } - } catch (err: any) { - this.log.error('Failed to upgrade outbound connection', err) - await maConn.close(err) - throw err - } - - await this.shouldBlockConnection(remotePeer, maConn, 'denyOutboundUpgradedConnection') - - this.log('Successfully upgraded outbound connection') - - return this._createConnection({ - cryptoProtocol, - direction: 'outbound', - maConn, - upgradedConn, - muxerFactory, - remotePeer, - transient: opts?.transient - }) - } - - /** - * A convenience method for generating a new `Connection` - */ - _createConnection (opts: CreateConnectionOptions): Connection { - const { - cryptoProtocol, - direction, - maConn, - upgradedConn, - remotePeer, - muxerFactory, - transient - } = opts - - let muxer: StreamMuxer | undefined - let newStream: ((multicodecs: string[], options?: AbortOptions) => Promise) | undefined - let connection: Connection // eslint-disable-line prefer-const - - if (muxerFactory != null) { - // Create the muxer - muxer = muxerFactory.createStreamMuxer({ - direction, - // Run anytime a remote stream is created - onIncomingStream: muxedStream => { - if (connection == null) { - return - } - - void Promise.resolve() - .then(async () => { - const protocols = this.components.registrar.getProtocols() - const { stream, protocol } = await mss.handle(muxedStream, protocols, { - log: muxedStream.log, - yieldBytes: false - }) - - if (connection == null) { - return - } - - connection.log('incoming stream opened on %s', protocol) - - const incomingLimit = findIncomingStreamLimit(protocol, this.components.registrar) - const streamCount = countStreams(protocol, 'inbound', connection) - - if (streamCount === incomingLimit) { - const err = new CodeError(`Too many inbound protocol streams for protocol "${protocol}" - limit ${incomingLimit}`, codes.ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS) - muxedStream.abort(err) - - throw err - } - - // after the handshake the returned stream can have early data so override - // the souce/sink - muxedStream.source = stream.source - muxedStream.sink = stream.sink - muxedStream.protocol = protocol - - // allow closing the write end of a not-yet-negotiated stream - if (stream.closeWrite != null) { - muxedStream.closeWrite = stream.closeWrite - } - - // allow closing the read end of a not-yet-negotiated stream - if (stream.closeRead != null) { - muxedStream.closeRead = stream.closeRead - } - - // make sure we don't try to negotiate a stream we are closing - if (stream.close != null) { - muxedStream.close = stream.close - } - - // If a protocol stream has been successfully negotiated and is to be passed to the application, - // the peerstore should ensure that the peer is registered with that protocol - await this.components.peerStore.merge(remotePeer, { - protocols: [protocol] - }) - - this.components.metrics?.trackProtocolStream(muxedStream, connection) - - this._onStream({ connection, stream: muxedStream, protocol }) - }) - .catch(async err => { - this.log.error('error handling incoming stream id %s', muxedStream.id, err.message, err.code, err.stack) - - if (muxedStream.timeline.close == null) { - await muxedStream.close() - } - }) - } - }) - - newStream = async (protocols: string[], options: NewStreamOptions = {}): Promise => { - if (muxer == null) { - throw new CodeError('Stream is not multiplexed', codes.ERR_MUXER_UNAVAILABLE) - } - - connection.log('starting new stream for protocols %s', protocols) - const muxedStream = await muxer.newStream() - connection.log.trace('started new stream %s for protocols %s', muxedStream.id, protocols) - - try { - if (options.signal == null) { - this.log('No abort signal was passed while trying to negotiate protocols %s falling back to default timeout', protocols) - - const signal = AbortSignal.timeout(DEFAULT_PROTOCOL_SELECT_TIMEOUT) - setMaxListeners(Infinity, signal) - - options = { - ...options, - signal - } - } - - muxedStream.log.trace('selecting protocol from protocols %s', protocols) - - const { - stream, - protocol - } = await mss.select(muxedStream, protocols, { - ...options, - log: muxedStream.log, - yieldBytes: true - }) - - muxedStream.log('selected protocol %s', protocol) - - const outgoingLimit = findOutgoingStreamLimit(protocol, this.components.registrar, options) - const streamCount = countStreams(protocol, 'outbound', connection) - - if (streamCount >= outgoingLimit) { - const err = new CodeError(`Too many outbound protocol streams for protocol "${protocol}" - limit ${outgoingLimit}`, codes.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS) - muxedStream.abort(err) - - throw err - } - - // If a protocol stream has been successfully negotiated and is to be passed to the application, - // the peerstore should ensure that the peer is registered with that protocol - await this.components.peerStore.merge(remotePeer, { - protocols: [protocol] - }) - - // after the handshake the returned stream can have early data so override - // the souce/sink - muxedStream.source = stream.source - muxedStream.sink = stream.sink - muxedStream.protocol = protocol - - // allow closing the write end of a not-yet-negotiated stream - if (stream.closeWrite != null) { - muxedStream.closeWrite = stream.closeWrite - } - - // allow closing the read end of a not-yet-negotiated stream - if (stream.closeRead != null) { - muxedStream.closeRead = stream.closeRead - } - - // make sure we don't try to negotiate a stream we are closing - if (stream.close != null) { - muxedStream.close = stream.close - } - - this.components.metrics?.trackProtocolStream(muxedStream, connection) - - return muxedStream - } catch (err: any) { - connection.log.error('could not create new stream for protocols %s', protocols, err) - - if (muxedStream.timeline.close == null) { - muxedStream.abort(err) - } - - if (err.code != null) { - throw err - } - - throw new CodeError(String(err), codes.ERR_UNSUPPORTED_PROTOCOL) - } - } - - // Pipe all data through the muxer - void Promise.all([ - muxer.sink(upgradedConn.source), - upgradedConn.sink(muxer.source) - ]).catch(err => { - this.log.error(err) - }) - } - - const _timeline = maConn.timeline - maConn.timeline = new Proxy(_timeline, { - set: (...args) => { - if (connection != null && args[1] === 'close' && args[2] != null && _timeline.close == null) { - // Wait for close to finish before notifying of the closure - (async () => { - try { - if (connection.status === 'open') { - await connection.close() - } - } catch (err: any) { - this.log.error(err) - } finally { - this.events.safeDispatchEvent('connection:close', { - detail: connection - }) - } - })().catch(err => { - this.log.error(err) - }) - } - - return Reflect.set(...args) - } - }) - maConn.timeline.upgraded = Date.now() - - const errConnectionNotMultiplexed = (): any => { - throw new CodeError('connection is not multiplexed', codes.ERR_CONNECTION_NOT_MULTIPLEXED) - } - - // Create the connection - connection = createConnection({ - remoteAddr: maConn.remoteAddr, - remotePeer, - status: 'open', - direction, - timeline: maConn.timeline, - multiplexer: muxer?.protocol, - encryption: cryptoProtocol, - transient, - logger: this.components.logger, - newStream: newStream ?? errConnectionNotMultiplexed, - getStreams: () => { if (muxer != null) { return muxer.streams } else { return [] } }, - close: async (options?: AbortOptions) => { - // Ensure remaining streams are closed gracefully - if (muxer != null) { - this.log.trace('close muxer') - await muxer.close(options) - } - - this.log.trace('close maconn') - // close the underlying transport - await maConn.close(options) - this.log.trace('closed maconn') - }, - abort: (err) => { - maConn.abort(err) - // Ensure remaining streams are aborted - if (muxer != null) { - muxer.abort(err) - } - } - }) - - this.events.safeDispatchEvent('connection:open', { - detail: connection - }) - - return connection - } - - /** - * Routes incoming streams to the correct handler - */ - _onStream (opts: OnStreamOptions): void { - const { connection, stream, protocol } = opts - const { handler, options } = this.components.registrar.getHandler(protocol) - - if (connection.transient && options.runOnTransientConnection !== true) { - throw new CodeError('Cannot open protocol stream on transient connection', 'ERR_TRANSIENT_CONNECTION') - } - - handler({ connection, stream }) - } - - /** - * Attempts to encrypt the incoming `connection` with the provided `cryptos` - */ - async _encryptInbound (connection: MultiaddrConnection): Promise { - const protocols = Array.from(this.connectionEncryption.keys()) - this.log('handling inbound crypto protocol selection', protocols) - - try { - const { stream, protocol } = await mss.handle(connection, protocols, { - log: connection.log - }) - const encrypter = this.connectionEncryption.get(protocol) - - if (encrypter == null) { - throw new Error(`no crypto module found for ${protocol}`) - } - - this.log('encrypting inbound connection using', protocol) - - return { - ...await encrypter.secureInbound(this.components.peerId, stream), - protocol - } - } catch (err: any) { - throw new CodeError(String(err), codes.ERR_ENCRYPTION_FAILED) - } - } - - /** - * Attempts to encrypt the given `connection` with the provided connection encrypters. - * The first `ConnectionEncrypter` module to succeed will be used - */ - async _encryptOutbound (connection: MultiaddrConnection, remotePeerId?: PeerId): Promise { - const protocols = Array.from(this.connectionEncryption.keys()) - this.log('selecting outbound crypto protocol', protocols) - - try { - connection.log.trace('selecting encrypter from %s', protocols) - - const { - stream, - protocol - } = await mss.select(connection, protocols, { - log: connection.log, - yieldBytes: true - }) - - const encrypter = this.connectionEncryption.get(protocol) - - if (encrypter == null) { - throw new Error(`no crypto module found for ${protocol}`) - } - - connection.log('encrypting outbound connection to %p using %p', remotePeerId) - - return { - ...await encrypter.secureOutbound(this.components.peerId, stream, remotePeerId), - protocol - } - } catch (err: any) { - throw new CodeError(String(err), codes.ERR_ENCRYPTION_FAILED) - } - } - - /** - * Selects one of the given muxers via multistream-select. That - * muxer will be used for all future streams on the connection. - */ - async _multiplexOutbound (connection: MultiaddrConnection, muxers: Map): Promise<{ stream: MultiaddrConnection, muxerFactory?: StreamMuxerFactory }> { - const protocols = Array.from(muxers.keys()) - this.log('outbound selecting muxer %s', protocols) - try { - connection.log.trace('selecting stream muxer from %s', protocols) - - const { - stream, - protocol - } = await mss.select(connection, protocols, { - log: connection.log, - yieldBytes: true - }) - - connection.log('selected %s as muxer protocol', protocol) - const muxerFactory = muxers.get(protocol) - - return { stream, muxerFactory } - } catch (err: any) { - connection.log.error('error multiplexing outbound stream', err) - throw new CodeError(String(err), codes.ERR_MUXER_UNAVAILABLE) - } - } - - /** - * Registers support for one of the given muxers via multistream-select. The - * selected muxer will be used for all future streams on the connection. - */ - async _multiplexInbound (connection: MultiaddrConnection, muxers: Map): Promise<{ stream: MultiaddrConnection, muxerFactory?: StreamMuxerFactory }> { - const protocols = Array.from(muxers.keys()) - this.log('inbound handling muxers %s', protocols) - try { - const { stream, protocol } = await mss.handle(connection, protocols, { - log: connection.log - }) - const muxerFactory = muxers.get(protocol) - - return { stream, muxerFactory } - } catch (err: any) { - this.log.error('error multiplexing inbound stream', err) - throw new CodeError(String(err), codes.ERR_MUXER_UNAVAILABLE) - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/version.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/version.ts deleted file mode 100644 index 36a3d88e7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/libp2p/src/version.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const version = '0.0.0' -export const name = 'libp2p' diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/index.min.js deleted file mode 100644 index 0beb5085b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/index.min.js +++ /dev/null @@ -1,51 +0,0 @@ -(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.ChainsafeLibp2PNoise = factory()}(typeof self !== 'undefined' ? self : this, function () { -"use strict";var ChainsafeLibp2PNoise=(()=>{var xu=Object.create;var On=Object.defineProperty;var mu=Object.getOwnPropertyDescriptor;var bu=Object.getOwnPropertyNames;var vu=Object.getPrototypeOf,wu=Object.prototype.hasOwnProperty;var ht=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),_t=(t,e)=>{for(var r in e)On(t,r,{get:e[r],enumerable:!0})},ha=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of bu(e))!wu.call(t,i)&&i!==r&&On(t,i,{get:()=>e[i],enumerable:!(n=mu(e,i))||n.enumerable});return t};var zt=(t,e,r)=>(r=t!=null?xu(vu(t)):{},ha(e||!t||!t.__esModule?On(r,"default",{value:t,enumerable:!0}):r,t)),Eu=t=>ha(On({},"__esModule",{value:!0}),t);var xa=ht((og,ga)=>{"use strict";function ya(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function Lu(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return ya(t,r)}catch{r.message=t.message,r.stack=t.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(t)),ya(new i,r)}}ga.exports=Lu});var lt=ht((h2,m0)=>{m0.exports={options:{usePureJavaScript:!1}}});var w0=ht((l2,v0)=>{var ks={};v0.exports=ks;var b0={};ks.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=il(t,e);else{var i=0,s=e.length,o=e.charAt(0),a=[0];for(i=0;i0;)a.push(f%s),f=f/s|0}for(i=0;t[i]===0&&i=0;--i)n+=e[a[i]]}if(r){var u=new RegExp(".{1,"+r+"}","g");n=n.match(u).join(`\r -`)}return n};ks.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=b0[e];if(!r){r=b0[e]=[];for(var n=0;n>=8;for(;f>0;)o.push(f&255),f>>=8}for(var u=0;t[u]===s&&u0;)s.push(a%n),a=a/n|0}var c="";for(r=0;t.at(r)===0&&r=0;--r)c+=e[s[r]];return c}});var Bt=ht((d2,A0)=>{var E0=lt(),S0=w0(),b=A0.exports=E0.util=E0.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){b.nextTick=process.nextTick,typeof setImmediate=="function"?b.setImmediate=setImmediate:b.setImmediate=b.nextTick;return}if(typeof setImmediate=="function"){b.setImmediate=function(){return setImmediate.apply(void 0,arguments)},b.nextTick=function(a){return setImmediate(a)};return}if(b.setImmediate=function(a){setTimeout(a,0)},typeof window<"u"&&typeof window.postMessage=="function"){let a=function(c){if(c.source===window&&c.data===t){c.stopPropagation();var f=e.slice();e.length=0,f.forEach(function(u){u()})}};var o=a,t="forge.setImmediate",e=[];b.setImmediate=function(c){e.push(c),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",a,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,i=document.createElement("div"),e=[];new MutationObserver(function(){var c=e.slice();e.length=0,c.forEach(function(f){f()})}).observe(i,{attributes:!0});var s=b.setImmediate;b.setImmediate=function(c){Date.now()-r>15?(r=Date.now(),s(c)):(e.push(c),e.length===1&&i.setAttribute("a",n=!n))}}b.nextTick=b.setImmediate})();b.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;b.globalScope=function(){return b.isNodejs?globalThis:typeof self>"u"?window:self}();b.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};b.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};b.isArrayBufferView=function(t){return t&&b.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function yn(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}b.ByteBuffer=Ps;function Ps(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(b.isArrayBuffer(t)||b.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;rsl&&(this.data.substr(0,1),this._constructedStringLength=0)};b.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};b.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};b.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};b.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};b.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};b.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(b.encodeUtf8(t))};b.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};b.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};b.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};b.ByteStringBuffer.prototype.putInt=function(t,e){yn(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};b.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};b.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};b.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};b.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};b.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};b.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};b.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};b.ByteStringBuffer.prototype.copy=function(){var t=b.createBuffer(this.data);return t.read=this.read,t};b.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};b.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};b.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};b.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};b.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};b.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};b.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};b.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};b.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};b.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};b.DataBuffer.prototype.putInt=function(t,e){yn(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};b.DataBuffer.prototype.putSignedInt=function(t,e){return yn(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};b.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};b.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};b.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};b.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};b.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};b.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};b.DataBuffer.prototype.copy=function(){return new b.DataBuffer(this)};b.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};b.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};b.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};b.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};b.xorBytes=function(t,e,r){for(var n="",i="",s="",o=0,a=0;r>0;--r,++o)i=t.charCodeAt(o)^e.charCodeAt(o),a>=10&&(n+=s,s="",a=0),s+=String.fromCharCode(i),++a;return n+=s,n};b.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var $e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",We=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],B0="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";b.encode64=function(t,e){for(var r="",n="",i,s,o,a=0;a>2),r+=$e.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=$e.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":$e.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};b.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,i,s,o=0;o>4),i!==64&&(e+=String.fromCharCode((n&15)<<4|i>>2),s!==64&&(e+=String.fromCharCode((i&3)<<6|s)));return e};b.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};b.decodeUtf8=function(t){return decodeURIComponent(escape(t))};b.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:S0.encode,decode:S0.decode}};b.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};b.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s>2),r+=$e.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=$e.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":$e.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};b.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,s,o,a,c=0,f=r;c>4,o!==64&&(n[f++]=(s&15)<<4|o>>2,a!==64&&(n[f++]=(o&3)<<6|a));return e?f-r:n.subarray(0,f)};b.binary.base58.encode=function(t,e){return b.binary.baseN.encode(t,B0,e)};b.binary.base58.decode=function(t,e){return b.binary.baseN.decode(t,B0,e)};b.text={utf8:{},utf16:{}};b.text.utf8.encode=function(t,e,r){t=b.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s"u"&&(r=["web","flash"]);var i,s=!1,o=null;for(var a in r){i=r[a];try{if(i==="flash"||i==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),s=i==="flash"}(i==="web"||i==="both")&&(e[0]=localStorage,n=t.apply(this,e),s=!0)}catch(c){o=c}if(s)break}if(!s)throw o;return n};b.setItem=function(t,e,r,n,i){pi(al,arguments,i)};b.getItem=function(t,e,r,n){return pi(cl,arguments,n)};b.removeItem=function(t,e,r,n){pi(fl,arguments,n)};b.clearItems=function(t,e,r){pi(ul,arguments,r)};b.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};b.format=function(t){for(var e=/%./g,r,n,i=0,s=[],o=0;r=e.exec(t);){n=t.substring(o,e.lastIndex-2),n.length>0&&s.push(n),o=e.lastIndex;var a=r[0][1];switch(a){case"s":case"o":i");break;case"%":s.push("%");break;default:s.push("<%"+a+"?>")}}return s.push(t.substring(o)),s.join("")};b.formatNumber=function(t,e,r,n){var i=t,s=isNaN(e=Math.abs(e))?2:e,o=r===void 0?",":r,a=n===void 0?".":n,c=i<0?"-":"",f=parseInt(i=Math.abs(+i||0).toFixed(s),10)+"",u=f.length>3?f.length%3:0;return c+(u?f.substr(0,u)+a:"")+f.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+a)+(s?o+Math.abs(i-f).toFixed(s).slice(2):"")};b.formatSize=function(t){return t>=1073741824?t=b.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=b.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=b.formatNumber(t/1024,0)+" KiB":t=b.formatNumber(t,0)+" bytes",t};b.bytesFromIP=function(t){return t.indexOf(".")!==-1?b.bytesFromIPv4(t):t.indexOf(":")!==-1?b.bytesFromIPv6(t):null};b.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=b.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1))}e.push(s)}if(r.length>0){var c=r[n];c.end-c.start>0&&(e.splice(c.start,c.end-c.start+1,""),c.start===0&&e.unshift(""),c.end===7&&e.push(""))}return e.join(":")};b.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in b&&!t.update)return e(null,b.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return b.cores=navigator.hardwareConcurrency,e(null,b.cores);if(typeof Worker>"u")return b.cores=1,e(null,b.cores);if(typeof Blob>"u")return b.cores=2,e(null,b.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(o){for(var a=Date.now(),c=a+4;Date.now()g.st&&u.stu.st&&g.st{var gn=lt();gn.pki=gn.pki||{};var Os=C0.exports=gn.pki.oids=gn.oids=gn.oids||{};function k(t,e){Os[t]=e,Os[e]=t}function ft(t,e){Os[t]=e}k("1.2.840.113549.1.1.1","rsaEncryption");k("1.2.840.113549.1.1.4","md5WithRSAEncryption");k("1.2.840.113549.1.1.5","sha1WithRSAEncryption");k("1.2.840.113549.1.1.7","RSAES-OAEP");k("1.2.840.113549.1.1.8","mgf1");k("1.2.840.113549.1.1.9","pSpecified");k("1.2.840.113549.1.1.10","RSASSA-PSS");k("1.2.840.113549.1.1.11","sha256WithRSAEncryption");k("1.2.840.113549.1.1.12","sha384WithRSAEncryption");k("1.2.840.113549.1.1.13","sha512WithRSAEncryption");k("1.3.101.112","EdDSA25519");k("1.2.840.10040.4.3","dsa-with-sha1");k("1.3.14.3.2.7","desCBC");k("1.3.14.3.2.26","sha1");k("1.3.14.3.2.29","sha1WithRSASignature");k("2.16.840.1.101.3.4.2.1","sha256");k("2.16.840.1.101.3.4.2.2","sha384");k("2.16.840.1.101.3.4.2.3","sha512");k("2.16.840.1.101.3.4.2.4","sha224");k("2.16.840.1.101.3.4.2.5","sha512-224");k("2.16.840.1.101.3.4.2.6","sha512-256");k("1.2.840.113549.2.2","md2");k("1.2.840.113549.2.5","md5");k("1.2.840.113549.1.7.1","data");k("1.2.840.113549.1.7.2","signedData");k("1.2.840.113549.1.7.3","envelopedData");k("1.2.840.113549.1.7.4","signedAndEnvelopedData");k("1.2.840.113549.1.7.5","digestedData");k("1.2.840.113549.1.7.6","encryptedData");k("1.2.840.113549.1.9.1","emailAddress");k("1.2.840.113549.1.9.2","unstructuredName");k("1.2.840.113549.1.9.3","contentType");k("1.2.840.113549.1.9.4","messageDigest");k("1.2.840.113549.1.9.5","signingTime");k("1.2.840.113549.1.9.6","counterSignature");k("1.2.840.113549.1.9.7","challengePassword");k("1.2.840.113549.1.9.8","unstructuredAddress");k("1.2.840.113549.1.9.14","extensionRequest");k("1.2.840.113549.1.9.20","friendlyName");k("1.2.840.113549.1.9.21","localKeyId");k("1.2.840.113549.1.9.22.1","x509Certificate");k("1.2.840.113549.1.12.10.1.1","keyBag");k("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");k("1.2.840.113549.1.12.10.1.3","certBag");k("1.2.840.113549.1.12.10.1.4","crlBag");k("1.2.840.113549.1.12.10.1.5","secretBag");k("1.2.840.113549.1.12.10.1.6","safeContentsBag");k("1.2.840.113549.1.5.13","pkcs5PBES2");k("1.2.840.113549.1.5.12","pkcs5PBKDF2");k("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");k("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");k("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");k("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");k("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");k("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");k("1.2.840.113549.2.7","hmacWithSHA1");k("1.2.840.113549.2.8","hmacWithSHA224");k("1.2.840.113549.2.9","hmacWithSHA256");k("1.2.840.113549.2.10","hmacWithSHA384");k("1.2.840.113549.2.11","hmacWithSHA512");k("1.2.840.113549.3.7","des-EDE3-CBC");k("2.16.840.1.101.3.4.1.2","aes128-CBC");k("2.16.840.1.101.3.4.1.22","aes192-CBC");k("2.16.840.1.101.3.4.1.42","aes256-CBC");k("2.5.4.3","commonName");k("2.5.4.4","surname");k("2.5.4.5","serialNumber");k("2.5.4.6","countryName");k("2.5.4.7","localityName");k("2.5.4.8","stateOrProvinceName");k("2.5.4.9","streetAddress");k("2.5.4.10","organizationName");k("2.5.4.11","organizationalUnitName");k("2.5.4.12","title");k("2.5.4.13","description");k("2.5.4.15","businessCategory");k("2.5.4.17","postalCode");k("2.5.4.42","givenName");k("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");k("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");k("2.16.840.1.113730.1.1","nsCertType");k("2.16.840.1.113730.1.13","nsComment");ft("2.5.29.1","authorityKeyIdentifier");ft("2.5.29.2","keyAttributes");ft("2.5.29.3","certificatePolicies");ft("2.5.29.4","keyUsageRestriction");ft("2.5.29.5","policyMapping");ft("2.5.29.6","subtreesConstraint");ft("2.5.29.7","subjectAltName");ft("2.5.29.8","issuerAltName");ft("2.5.29.9","subjectDirectoryAttributes");ft("2.5.29.10","basicConstraints");ft("2.5.29.11","nameConstraints");ft("2.5.29.12","policyConstraints");ft("2.5.29.13","basicConstraints");k("2.5.29.14","subjectKeyIdentifier");k("2.5.29.15","keyUsage");ft("2.5.29.16","privateKeyUsagePeriod");k("2.5.29.17","subjectAltName");k("2.5.29.18","issuerAltName");k("2.5.29.19","basicConstraints");ft("2.5.29.20","cRLNumber");ft("2.5.29.21","cRLReason");ft("2.5.29.22","expirationDate");ft("2.5.29.23","instructionCode");ft("2.5.29.24","invalidityDate");ft("2.5.29.25","cRLDistributionPoints");ft("2.5.29.26","issuingDistributionPoint");ft("2.5.29.27","deltaCRLIndicator");ft("2.5.29.28","issuingDistributionPoint");ft("2.5.29.29","certificateIssuer");ft("2.5.29.30","nameConstraints");k("2.5.29.31","cRLDistributionPoints");k("2.5.29.32","certificatePolicies");ft("2.5.29.33","policyMappings");ft("2.5.29.34","policyConstraints");k("2.5.29.35","authorityKeyIdentifier");ft("2.5.29.36","policyConstraints");k("2.5.29.37","extKeyUsage");ft("2.5.29.46","freshestCRL");ft("2.5.29.54","inhibitAnyPolicy");k("1.3.6.1.4.1.11129.2.4.2","timestampList");k("1.3.6.1.5.5.7.1.1","authorityInfoAccess");k("1.3.6.1.5.5.7.3.1","serverAuth");k("1.3.6.1.5.5.7.3.2","clientAuth");k("1.3.6.1.5.5.7.3.3","codeSigning");k("1.3.6.1.5.5.7.3.4","emailProtection");k("1.3.6.1.5.5.7.3.8","timeStamping")});var mn=ht((y2,T0)=>{var xt=lt();Bt();yi();var F=T0.exports=xt.asn1=xt.asn1||{};F.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};F.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};F.create=function(t,e,r,n,i){if(xt.util.isArray(n)){for(var s=[],o=0;oe){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}var hl=function(t,e){var r=t.getByte();if(e--,r!==128){var n,i=r&128;if(!i)n=r;else{var s=r&127;xn(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}};F.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof t=="string"&&(t=xt.util.createBuffer(t));var r=t.length(),n=gi(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=r,i.remaining=t.length(),i}return n};function gi(t,e,r,n){var i;xn(t,e,2);var s=t.getByte();e--;var o=s&192,a=s&31;i=t.length();var c=hl(t,e);if(e-=i-t.length(),c!==void 0&&c>e){if(n.strict){var f=new Error("Too few bytes to read ASN.1 value.");throw f.available=t.length(),f.remaining=e,f.requested=c,f}c=e}var u,h,l=(s&32)===32;if(l)if(u=[],c===void 0)for(;;){if(xn(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}i=t.length(),u.push(gi(t,e,r+1,n)),e-=i-t.length()}else for(;c>0;)i=t.length(),u.push(gi(t,c,r+1,n)),e-=i-t.length(),c-=i-t.length();if(u===void 0&&o===F.Class.UNIVERSAL&&a===F.Type.BITSTRING&&(h=t.bytes(c)),u===void 0&&n.decodeBitStrings&&o===F.Class.UNIVERSAL&&a===F.Type.BITSTRING&&c>1){var g=t.read,d=e,p=0;if(a===F.Type.BITSTRING&&(xn(t,e,1),p=t.getByte(),e--),p===0)try{i=t.length();var y={strict:!0,decodeBitStrings:!0},x=gi(t,e,r+1,y),v=i-t.length();e-=v,a==F.Type.BITSTRING&&v++;var m=x.tagClass;v===c&&(m===F.Class.UNIVERSAL||m===F.Class.CONTEXT_SPECIFIC)&&(u=[x])}catch{}u===void 0&&(t.read=g,e=d)}if(u===void 0){if(c===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=e}if(a===F.Type.BMPSTRING)for(u="";c>0;c-=2)xn(t,e,2),u+=String.fromCharCode(t.getInt16()),e-=2;else u=t.getBytes(c),e-=c}var A=h===void 0?null:{bitStringContents:h};return F.create(o,a,l,u,A)}F.toDer=function(t){var e=xt.util.createBuffer(),r=t.tagClass|t.type,n=xt.util.createBuffer(),i=!1;if("bitStringContents"in t&&(i=!0,t.original&&(i=F.equals(t,t.original))),i)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var s=0;s1&&(t.value.charCodeAt(0)===0&&!(t.value.charCodeAt(1)&128)||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var o=n.length(),a="";do a+=String.fromCharCode(o&255),o=o>>>8;while(o>0);e.putByte(a.length|128);for(var s=a.length-1;s>=0;--s)e.putByte(a.charCodeAt(s))}return e.putBuffer(n),e};F.oidToDer=function(t){var e=t.split("."),r=xt.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,i,s,o,a=2;a>>7,n||(o|=128),i.push(o),n=!1;while(s>0);for(var c=i.length-1;c>=0;--c)r.putByte(i[c])}return r};F.derToOid=function(t){var e;typeof t=="string"&&(t=xt.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;)r=t.getByte(),n=n<<7,r&128?n+=r&127:(e+="."+(n+r),n=0);return e};F.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),s=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=0;if(t.length>11){var c=t.charAt(10),f=10;c!=="+"&&c!=="-"&&(a=parseInt(t.substr(10,2),10),f+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,0),f&&(c=t.charAt(f),c==="+"||c==="-")){var u=parseInt(t.substr(f+1,2),10),h=parseInt(t.substr(f+4,2),10),l=u*60+h;l*=6e4,c==="+"?e.setTime(+e-l):e.setTime(+e+l)}return e};F.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),o=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),c=0,f=0,u=!1;t.charAt(t.length-1)==="Z"&&(u=!0);var h=t.length-5,l=t.charAt(h);if(l==="+"||l==="-"){var g=parseInt(t.substr(h+1,2),10),d=parseInt(t.substr(h+4,2),10);f=g*60+d,f*=6e4,l==="+"&&(f*=-1),u=!0}return t.charAt(14)==="."&&(c=parseFloat(t.substr(14),10)*1e3),u?(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,c),e.setTime(+e+f)):(e.setFullYear(r,n,i),e.setHours(s,o,a,c)),e};F.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};F.derToInteger=function(t){typeof t=="string"&&(t=xt.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};F.validate=function(t,e,r,n){var i=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(i=!0,e.value&&xt.util.isArray(e.value))for(var s=0,o=0;i&&o0&&(n+=` -`);for(var i="",s=0;s1?n+="0x"+xt.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var f=t.value.charCodeAt(0);f==1?n+=" (1 unused bit shown)":f>1&&(n+=" ("+f+" unused bits shown)")}}else if(t.type===F.Type.OCTETSTRING)I0.test(t.value)||(n+="("+t.value+") "),n+="0x"+xt.util.bytesToHex(t.value);else if(t.type===F.Type.UTF8)try{n+=xt.util.decodeUtf8(t.value)}catch(u){if(u.message==="URI malformed")n+="0x"+xt.util.bytesToHex(t.value)+" (malformed UTF8)";else throw u}else t.type===F.Type.PRINTABLESTRING||t.type===F.Type.IA5String?n+=t.value:I0.test(t.value)?n+="0x"+xt.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var Fs=ht((g2,_0)=>{var Nt=lt();Bt();_0.exports=Nt.cipher=Nt.cipher||{};Nt.cipher.algorithms=Nt.cipher.algorithms||{};Nt.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Nt.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Nt.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};Nt.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Nt.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Nt.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};Nt.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),Nt.cipher.algorithms[t]=e};Nt.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in Nt.cipher.algorithms?Nt.cipher.algorithms[t]:null};var Ms=Nt.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};Ms.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=Nt.util.createBuffer(),this.output=t.output||Nt.util.createBuffer(),this.mode.start(e)};Ms.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Ms.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var Hs=ht((x2,L0)=>{var Dt=lt();Bt();Dt.cipher=Dt.cipher||{};var nt=L0.exports=Dt.cipher.modes=Dt.cipher.modes||{};nt.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};nt.ecb.prototype.start=function(t){};nt.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};nt.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};nt.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=xi(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};nt.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};nt.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=xi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=xi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.ofb.prototype.decrypt=nt.ofb.prototype.encrypt;nt.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=xi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}mi(this._inBlock)};nt.ctr.prototype.decrypt=nt.ctr.prototype.encrypt;nt.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0,this._R=3774873600};nt.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=Dt.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=Dt.util.createBuffer(t.additionalData):r=Dt.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=Dt.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(Vs(n*8)))}this._inBlock=this._j0.slice(0),mi(this._inBlock),this._partialBytes=0,r=Dt.util.createBuffer(r),this._aDataLength=Vs(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};nt.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),mi(this._inBlock)};nt.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),mi(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};nt.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=t[n]>>>(7-r%8)*4&15,s=this._m[r][i];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};nt.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};nt.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,s=new Array(i),o=0;o>>1,i=new Array(r);i[n]=t.slice(0);for(var s=n>>>1;s>0;)this.pow(i[2*s],i[s]=[]),s>>=1;for(s=2;s4){var r=t;t=Dt.util.createBuffer();for(var n=0;n{var pt=lt();Fs();Hs();Bt();k0.exports=pt.aes=pt.aes||{};pt.aes.startEncrypting=function(t,e,r,n){var i=bi({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i};pt.aes.createEncryptionCipher=function(t,e){return bi({key:t,output:null,decrypt:!1,mode:e})};pt.aes.startDecrypting=function(t,e,r,n){var i=bi({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i};pt.aes.createDecryptionCipher=function(t,e){return bi({key:t,output:null,decrypt:!0,mode:e})};pt.aes.Algorithm=function(t,e){Gs||N0();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(n,i){return zs(r._w,n,i,!1)},decrypt:function(n,i){return zs(r._w,n,i,!0)}}}),r._init=!1};pt.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=pt.util.createBuffer(e);else if(pt.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=pt.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^a&255^99,$t[r]=a,qs[a]=r,c=t[a],i=t[r],s=t[i],o=t[s],f=c<<24^a<<16^a<<8^(a^c),u=(i^s^o)<<24^(r^o)<<16^(r^s^o)<<8^(r^i^o);for(var h=0;h<4;++h)ar[h][r]=f,ue[h][a]=u,f=f<<24|f>>>8,u=u<<24|u>>>8;r===0?r=n=1:(r=i^t[t[t[i^o]]],n^=t[t[n]])}}function D0(t,e){for(var r=t.slice(0),n,i=1,s=r.length,o=s+6+1,a=kr*o,c=s;c>>16&255]<<24^$t[n>>>8&255]<<16^$t[n&255]<<8^$t[n>>>24]^R0[i]<<24,i++):s>6&&c%s===4&&(n=$t[n>>>24]<<24^$t[n>>>16&255]<<16^$t[n>>>8&255]<<8^$t[n&255]),r[c]=r[c-s]^n;if(e){var f,u=ue[0],h=ue[1],l=ue[2],g=ue[3],d=r.slice(0);a=r.length;for(var c=0,p=a-kr;c>>24]]^h[$t[f>>>16&255]]^l[$t[f>>>8&255]]^g[$t[f&255]];r=d}return r}function zs(t,e,r,n){var i=t.length/4-1,s,o,a,c,f;n?(s=ue[0],o=ue[1],a=ue[2],c=ue[3],f=qs):(s=ar[0],o=ar[1],a=ar[2],c=ar[3],f=$t);var u,h,l,g,d,p,y;u=e[0]^t[0],h=e[n?3:1]^t[1],l=e[2]^t[2],g=e[n?1:3]^t[3];for(var x=3,v=1;v>>24]^o[h>>>16&255]^a[l>>>8&255]^c[g&255]^t[++x],p=s[h>>>24]^o[l>>>16&255]^a[g>>>8&255]^c[u&255]^t[++x],y=s[l>>>24]^o[g>>>16&255]^a[u>>>8&255]^c[h&255]^t[++x],g=s[g>>>24]^o[u>>>16&255]^a[h>>>8&255]^c[l&255]^t[++x],u=d,h=p,l=y;r[0]=f[u>>>24]<<24^f[h>>>16&255]<<16^f[l>>>8&255]<<8^f[g&255]^t[++x],r[n?3:1]=f[h>>>24]<<24^f[l>>>16&255]<<16^f[g>>>8&255]<<8^f[u&255]^t[++x],r[2]=f[l>>>24]<<24^f[g>>>16&255]<<16^f[u>>>8&255]<<8^f[h&255]^t[++x],r[n?1:3]=f[g>>>24]<<24^f[u>>>16&255]<<16^f[h>>>8&255]<<8^f[l&255]^t[++x]}function bi(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=pt.cipher.createDecipher(r,t.key):n=pt.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof pt.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var K0=ht((b2,U0)=>{var vt=lt();Fs();Hs();Bt();U0.exports=vt.des=vt.des||{};vt.des.startEncrypting=function(t,e,r,n){var i=vi({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};vt.des.createEncryptionCipher=function(t,e){return vi({key:t,output:null,decrypt:!1,mode:e})};vt.des.startDecrypting=function(t,e,r,n){var i=vi({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};vt.des.createDecryptionCipher=function(t,e){return vi({key:t,output:null,decrypt:!0,mode:e})};vt.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(n,i){return P0(r._keys,n,i,!1)},decrypt:function(n,i){return P0(r._keys,n,i,!0)}}}),r._init=!1};vt.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=vt.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=vl(e),this._init=!0}};pe("DES-ECB",vt.cipher.modes.ecb);pe("DES-CBC",vt.cipher.modes.cbc);pe("DES-CFB",vt.cipher.modes.cfb);pe("DES-OFB",vt.cipher.modes.ofb);pe("DES-CTR",vt.cipher.modes.ctr);pe("3DES-ECB",vt.cipher.modes.ecb);pe("3DES-CBC",vt.cipher.modes.cbc);pe("3DES-CFB",vt.cipher.modes.cfb);pe("3DES-OFB",vt.cipher.modes.ofb);pe("3DES-CTR",vt.cipher.modes.ctr);function pe(t,e){var r=function(){return new vt.des.Algorithm(t,e)};vt.cipher.registerAlgorithm(t,r)}var ll=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],dl=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],pl=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],yl=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],gl=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],xl=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],ml=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],bl=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function vl(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],a=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],l=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],d=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],p=t.length()>8?3:1,y=[],x=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,m,A=0;A>>4^B)&252645135,B^=m,S^=m<<4,m=(B>>>-16^S)&65535,S^=m,B^=m<<-16,m=(S>>>2^B)&858993459,B^=m,S^=m<<2,m=(B>>>-16^S)&65535,S^=m,B^=m<<-16,m=(S>>>1^B)&1431655765,B^=m,S^=m<<1,m=(B>>>8^S)&16711935,S^=m,B^=m<<8,m=(S>>>1^B)&1431655765,B^=m,S^=m<<1,m=S<<8|B>>>20&240,S=B<<24|B<<8&16711680|B>>>8&65280|B>>>24&240,B=m;for(var R=0;R>>26,B=B<<2|B>>>26):(S=S<<1|S>>>27,B=B<<1|B>>>27),S&=-15,B&=-15;var _=e[S>>>28]|r[S>>>24&15]|n[S>>>20&15]|i[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|a[S>>>4&15],O=c[B>>>28]|f[B>>>24&15]|u[B>>>20&15]|h[B>>>16&15]|l[B>>>12&15]|g[B>>>8&15]|d[B>>>4&15];m=(O>>>16^_)&65535,y[v++]=_^m,y[v++]=O^m<<16}}return y}function P0(t,e,r,n){var i=t.length===32?3:9,s;i===3?s=n?[30,-2,-2]:[0,32,2]:s=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,a=e[0],c=e[1];o=(a>>>4^c)&252645135,c^=o,a^=o<<4,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,a=a<<1|a>>>31,c=c<<1|c>>>31;for(var f=0;f>>4|c<<28)^t[l+1];o=a,a=c,c=o^(dl[g>>>24&63]|yl[g>>>16&63]|xl[g>>>8&63]|bl[g&63]|ll[d>>>24&63]|pl[d>>>16&63]|gl[d>>>8&63]|ml[d&63])}o=a,a=c,c=o}a=a>>>1|a<<31,c=c>>>1|c<<31,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(a>>>4^c)&252645135,c^=o,a^=o<<4,r[0]=a,r[1]=c}function vi(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=vt.cipher.createDecipher(r,t.key):n=vt.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof vt.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var cr=ht((v2,O0)=>{var wi=lt();O0.exports=wi.md=wi.md||{};wi.md.algorithms=wi.md.algorithms||{}});var F0=ht((w2,M0)=>{var Re=lt();cr();Bt();var wl=M0.exports=Re.hmac=Re.hmac||{};wl.create=function(){var t=null,e=null,r=null,n=null,i={};return i.start=function(s,o){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in Re.md.algorithms)e=Re.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else e=s;if(o===null)o=t;else{if(typeof o=="string")o=Re.util.createBuffer(o);else if(Re.util.isArray(o)){var a=o;o=Re.util.createBuffer();for(var c=0;ce.blockLength&&(e.start(),e.update(o.bytes()),o=e.digest()),r=Re.util.createBuffer(),n=Re.util.createBuffer(),f=o.length();for(var c=0;c{});var H0=ht((B2,V0)=>{var Wt=lt();F0();cr();Bt();var El=Wt.pkcs5=Wt.pkcs5||{},Ne;Wt.util.isNodejs&&!Wt.options.usePureJavaScript&&(Ne=Ei());V0.exports=Wt.pbkdf2=El.pbkdf2=function(t,e,r,n,i,s){if(typeof i=="function"&&(s=i,i=null),Wt.util.isNodejs&&!Wt.options.usePureJavaScript&&Ne.pbkdf2&&(i===null||typeof i!="object")&&(Ne.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?Ne.pbkdf2Sync.length===4?Ne.pbkdf2(t,e,r,n,function(m,A){if(m)return s(m);s(null,A.toString("binary"))}):Ne.pbkdf2(t,e,r,n,i,function(m,A){if(m)return s(m);s(null,A.toString("binary"))}):Ne.pbkdf2Sync.length===4?Ne.pbkdf2Sync(t,e,r,n).toString("binary"):Ne.pbkdf2Sync(t,e,r,n,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in Wt.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=Wt.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var a=new Error("Derived key is too long.");if(s)return s(a);throw a}var c=Math.ceil(n/o),f=n-(c-1)*o,u=Wt.hmac.create();u.start(i,t);var h="",l,g,d;if(!s){for(var p=1;p<=c;++p){u.start(null,null),u.update(e),u.update(Wt.util.int32ToBytes(p)),l=d=u.digest().getBytes();for(var y=2;y<=r;++y)u.start(null,null),u.update(d),g=u.digest().getBytes(),l=Wt.util.xorBytes(l,g,o),d=g;h+=pc)return s(null,h);u.start(null,null),u.update(e),u.update(Wt.util.int32ToBytes(p)),l=d=u.digest().getBytes(),y=2,v()}function v(){if(y<=r)return u.start(null,null),u.update(d),g=u.digest().getBytes(),l=Wt.util.xorBytes(l,g,o),d=g,++y,Wt.util.setImmediate(v);h+=p{var Bi=lt();Bt();var q0=z0.exports=Bi.pem=Bi.pem||{};q0.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r -`,n;if(t.procType&&(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=Si(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=Si(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=Si(n)),t.headers)for(var i=0;i65&&o!==-1){var a=e[o];a===","?(++o,e=e.substr(0,o)+`\r - `+e.substr(o)):e=e.substr(0,o)+`\r -`+a+e.substr(o+1),s=i-o-1,o=-1,++i}else(e[i]===" "||e[i]===" "||e[i]===",")&&(o=i);return e}function Sl(t){return t.replace(/^\s+/,"")}});var Q0=ht((C2,X0)=>{var ye=lt();cr();Bt();var W0=X0.exports=ye.sha256=ye.sha256||{};ye.md.sha256=ye.md.algorithms.sha256=W0;W0.create=function(){Y0||Bl();var t=null,e=ye.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),$0(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=ye.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(Ws.substr(0,n.blockLength-o));for(var a,c,f=n.fullMessageLength[0]*8,u=0;u>>0,f+=c,i.putInt32(f>>>0),f=a>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};$0(h,r,i);var l=ye.util.createBuffer();return l.putInt32(h.h0),l.putInt32(h.h1),l.putInt32(h.h2),l.putInt32(h.h3),l.putInt32(h.h4),l.putInt32(h.h5),l.putInt32(h.h6),l.putInt32(h.h7),l},n};var Ws=null,Y0=!1,Z0=null;function Bl(){Ws="\x80",Ws+=ye.util.fillString("\0",64),Z0=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Y0=!0}function $0(t,e,r){for(var n,i,s,o,a,c,f,u,h,l,g,d,p,y,x,v=r.length();v>=64;){for(f=0;f<16;++f)e[f]=r.getInt32();for(;f<64;++f)n=e[f-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=e[f-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[f]=n+e[f-7]+i+e[f-16]|0;for(u=t.h0,h=t.h1,l=t.h2,g=t.h3,d=t.h4,p=t.h5,y=t.h6,x=t.h7,f=0;f<64;++f)o=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),a=y^d&(p^y),s=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),c=u&h|l&(u^h),n=x+o+a+Z0[f]+e[f],i=s+c,x=y,y=p,p=d,d=g+n>>>0,g=l,l=h,h=u,u=n+i>>>0;t.h0=t.h0+u|0,t.h1=t.h1+h|0,t.h2=t.h2+l|0,t.h3=t.h3+g|0,t.h4=t.h4+d|0,t.h5=t.h5+p|0,t.h6=t.h6+y|0,t.h7=t.h7+x|0,v-=64}}});var j0=ht((I2,J0)=>{var ge=lt();Bt();var Ai=null;ge.util.isNodejs&&!ge.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Ai=Ei());var Al=J0.exports=ge.prng=ge.prng||{};Al.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();e.pools=n,e.pool=0,e.generate=function(f,u){if(!u)return e.generateSync(f);var h=e.plugin.cipher,l=e.plugin.increment,g=e.plugin.formatKey,d=e.plugin.formatSeed,p=ge.util.createBuffer();e.key=null,y();function y(x){if(x)return u(x);if(p.length()>=f)return u(null,p.getBytes(f));if(e.generated>1048575&&(e.key=null),e.key===null)return ge.util.nextTick(function(){s(y)});var v=h(e.key,e.seed);e.generated+=v.length,p.putBytes(v),e.key=g(h(e.key,l(e.seed))),e.seed=d(h(e.key,e.seed)),ge.util.setImmediate(y)}},e.generateSync=function(f){var u=e.plugin.cipher,h=e.plugin.increment,l=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var d=ge.util.createBuffer();d.length()1048575&&(e.key=null),e.key===null&&o();var p=u(e.key,e.seed);e.generated+=p.length,d.putBytes(p),e.key=l(u(e.key,h(e.seed))),e.seed=g(u(e.key,e.seed))}return d.getBytes(f)};function s(f){if(e.pools[0].messageLength>=32)return a(),f();var u=32-e.pools[0].messageLength<<5;e.seedFile(u,function(h,l){if(h)return f(h);e.collect(l),a(),f()})}function o(){if(e.pools[0].messageLength>=32)return a();var f=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(f)),a()}function a(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var f=e.plugin.md.create();f.update(e.keyBytes);for(var u=1,h=0;h<32;++h)e.reseeds%u===0&&(f.update(e.pools[h].digest().getBytes()),e.pools[h].start()),u=u<<1;e.keyBytes=f.digest().getBytes(),f.start(),f.update(e.keyBytes);var l=f.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(l),e.generated=0}function c(f){var u=null,h=ge.util.globalScope,l=h.crypto||h.msCrypto;l&&l.getRandomValues&&(u=function(S){return l.getRandomValues(S)});var g=ge.util.createBuffer();if(u)for(;g.length()>16),v+=(x&32767)<<16,v+=x>>15,v=(v&2147483647)+(v>>31),A=v&4294967295;for(var y=0;y<3;++y)m=A>>>(y<<3),m^=Math.floor(Math.random()*256),g.putByte(m&255)}return g.getBytes(f)}return Ai?(e.seedFile=function(f,u){Ai.randomBytes(f,function(h,l){if(h)return u(h);u(null,l.toString())})},e.seedFileSync=function(f){return Ai.randomBytes(f).toString()}):(e.seedFile=function(f,u){try{u(null,c(f))}catch(h){u(h)}},e.seedFileSync=c),e.collect=function(f){for(var u=f.length,h=0;h>l&255);e.collect(h)},e.registerWorker=function(f){if(f===self)e.seedFile=function(h,l){function g(d){var p=d.data;p.forge&&p.forge.prng&&(self.removeEventListener("message",g),l(p.forge.prng.err,p.forge.prng.bytes))}self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:h}}})};else{var u=function(h){var l=h.data;l.forge&&l.forge.prng&&e.seedFile(l.forge.prng.needed,function(g,d){f.postMessage({forge:{prng:{err:g,bytes:d}}})})};f.addEventListener("message",u)}},e}});var bn=ht((T2,Ys)=>{var kt=lt();$s();Q0();j0();Bt();(function(){if(kt.random&&kt.random.getBytes){Ys.exports=kt.random;return}(function(t){var e={},r=new Array(4),n=kt.util.createBuffer();e.formatKey=function(h){var l=kt.util.createBuffer(h);return h=new Array(4),h[0]=l.getInt32(),h[1]=l.getInt32(),h[2]=l.getInt32(),h[3]=l.getInt32(),kt.aes._expandKey(h,!1)},e.formatSeed=function(h){var l=kt.util.createBuffer(h);return h=new Array(4),h[0]=l.getInt32(),h[1]=l.getInt32(),h[2]=l.getInt32(),h[3]=l.getInt32(),h},e.cipher=function(h,l){return kt.aes._updateBlock(h,l,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=kt.md.sha256;function i(){var h=kt.prng.create(e);return h.getBytes=function(l,g){return h.generate(l,g)},h.getBytesSync=function(l){return h.generate(l)},h}var s=i(),o=null,a=kt.util.globalScope,c=a.crypto||a.msCrypto;if(c&&c.getRandomValues&&(o=function(h){return c.getRandomValues(h)}),kt.options.usePureJavaScript||!kt.util.isNodejs&&!o){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var f="";for(var u in navigator)try{typeof navigator[u]=="string"&&(f+=navigator[u])}catch{}s.collect(f),f=null}t&&(t().mousemove(function(h){s.collectInt(h.clientX,16),s.collectInt(h.clientY,16)}),t().keypress(function(h){s.collectInt(h.charCode,8)}))}if(!kt.random)kt.random=s;else for(var u in s)kt.random[u]=s[u];kt.random.createInstance=i,Ys.exports=kt.random})(typeof jQuery<"u"?jQuery:null)})()});var nc=ht((_2,rc)=>{var Yt=lt();Bt();var Zs=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],tc=[1,2,3,5],Cl=function(t,e){return t<>16-e},Il=function(t,e){return(t&65535)>>e|t<<16-e&65535};rc.exports=Yt.rc2=Yt.rc2||{};Yt.rc2.expandKey=function(t,e){typeof t=="string"&&(t=Yt.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),i=e,s=Math.ceil(i/8),o=255>>(i&7),a;for(a=n;a<128;a++)r.putByte(Zs[r.at(a-1)+r.at(a-n)&255]);for(r.setAt(128-s,Zs[r.at(128-s)&o]),a=127-s;a>=0;a--)r.setAt(a,Zs[r.at(a+1)^r.at(a+s)]);return r};var ec=function(t,e,r){var n=!1,i=null,s=null,o=null,a,c,f,u,h=[];for(t=Yt.rc2.expandKey(t,e),f=0;f<64;f++)h.push(t.getInt16Le());r?(a=function(d){for(f=0;f<4;f++)d[f]+=h[u]+(d[(f+3)%4]&d[(f+2)%4])+(~d[(f+3)%4]&d[(f+1)%4]),d[f]=Cl(d[f],tc[f]),u++},c=function(d){for(f=0;f<4;f++)d[f]+=h[d[(f+3)%4]&63]}):(a=function(d){for(f=3;f>=0;f--)d[f]=Il(d[f],tc[f]),d[f]-=h[u]+(d[(f+3)%4]&d[(f+2)%4])+(~d[(f+3)%4]&d[(f+1)%4]),u--},c=function(d){for(f=3;f>=0;f--)d[f]-=h[d[(f+3)%4]&63]});var l=function(d){var p=[];for(f=0;f<4;f++){var y=i.getInt16Le();o!==null&&(r?y^=o.getInt16Le():o.putInt16Le(y)),p.push(y&65535)}u=r?0:63;for(var x=0;x=8;)l([[5,a],[1,c],[6,a],[1,c],[5,a]])},finish:function(d){var p=!0;if(r)if(d)p=d(8,i,!r);else{var y=i.length()===8?8:8-i.length();i.fillWithByte(y,y)}if(p&&(n=!0,g.update()),!r&&(p=i.length()===0,p))if(d)p=d(8,s,!r);else{var x=s.length(),v=s.at(x-1);v>x?p=!1:s.truncate(v)}return p}},g};Yt.rc2.startEncrypting=function(t,e,r){var n=Yt.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};Yt.rc2.createEncryptionCipher=function(t,e){return ec(t,e,!0)};Yt.rc2.startDecrypting=function(t,e,r){var n=Yt.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};Yt.rc2.createDecryptionCipher=function(t,e){return ec(t,e,!1)}});var Ti=ht((L2,hc)=>{var Xs=lt();hc.exports=Xs.jsbn=Xs.jsbn||{};var De,Tl=0xdeadbeefcafe,ic=(Tl&16777215)==15715070;function D(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}Xs.jsbn.BigInteger=D;function ot(){return new D(null)}function _l(t,e,r,n,i,s){for(;--s>=0;){var o=e*this.data[t++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=o&67108863}return i}function Ll(t,e,r,n,i,s){for(var o=e&32767,a=e>>15;--s>=0;){var c=this.data[t]&32767,f=this.data[t++]>>15,u=a*c+f*o;c=o*c+((u&32767)<<15)+r.data[n]+(i&1073741823),i=(c>>>30)+(u>>>15)+a*f+(i>>>30),r.data[n++]=c&1073741823}return i}function sc(t,e,r,n,i,s){for(var o=e&16383,a=e>>14;--s>=0;){var c=this.data[t]&16383,f=this.data[t++]>>14,u=a*c+f*o;c=o*c+((u&16383)<<14)+r.data[n]+i,i=(c>>28)+(u>>14)+a*f,r.data[n++]=c&268435455}return i}typeof navigator>"u"?(D.prototype.am=sc,De=28):ic&&navigator.appName=="Microsoft Internet Explorer"?(D.prototype.am=Ll,De=30):ic&&navigator.appName!="Netscape"?(D.prototype.am=_l,De=26):(D.prototype.am=sc,De=28);D.prototype.DB=De;D.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function Dl(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}function Ye(t){var e=ot();return e.fromInt(t),e}function kl(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,i=!1,s=0;--n>=0;){var o=r==8?t[n]&255:ac(t,n);if(o<0){t.charAt(n)=="-"&&(i=!0);continue}i=!1,s==0?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB)}r==8&&t[0]&128&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}function Ul(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(a>a)>0&&(i=!0,s=oc(n));o>=0;)a>(a+=this.DB-e)):(n=this.data[o]>>(a-=e)&r,a<=0&&(a+=this.DB,--o)),n>0&&(i=!0),i&&(s+=oc(n));return i?s:"0"}function Kl(){var t=ot();return D.ZERO.subTo(this,t),t}function Ol(){return this.s<0?this.negate():this}function Ml(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}function Ii(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function Fl(){return this.t<=0?0:this.DB*(this.t-1)+Ii(this.data[this.t-1]^this.s&this.DM)}function Vl(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}function Hl(t,e){for(var r=t;r=0;--a)e.data[a+s+1]=this.data[a]>>n|o,o=(this.data[a]&i)<=0;--a)e.data[a]=0;e.data[s]=o,e.t=this.t+s+1,e.s=this.s,e.clamp()}function zl(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,i=this.DB-n,s=(1<>n;for(var o=r+1;o>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}function $l(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}function Yl(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,u=s.data[f-1];if(u!=0){var h=u*(1<1?s.data[f-2]>>this.F2:0),l=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(x,r)),D.ONE.dlShiftTo(f,x),x.subTo(s,s);s.t=0;){var v=r.data[--p]==u?this.DM:Math.floor(r.data[p]*l+(r.data[p-1]+d)*g);if((r.data[p]+=s.am(0,v,r,y,0,f))0&&r.rShiftTo(c,r),o<0&&D.ZERO.subTo(r,r)}}}function Zl(t){var e=ot();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(D.ZERO)>0&&t.subTo(e,e),e}function fr(t){this.m=t}function Xl(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function Ql(t){return t}function Jl(t){t.divRemTo(this.m,null,t)}function jl(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function td(t,e){t.squareTo(e),this.reduce(e)}fr.prototype.convert=Xl;fr.prototype.revert=Ql;fr.prototype.reduce=Jl;fr.prototype.mulTo=jl;fr.prototype.sqrTo=td;function ed(){if(this.t<1)return 0;var t=this.data[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function ur(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}function nd(t){var e=ot();return t.copyTo(e),this.reduce(e),e}function id(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function sd(t,e){t.squareTo(e),this.reduce(e)}function od(t,e,r){t.multiplyTo(e,r),this.reduce(r)}ur.prototype.convert=rd;ur.prototype.revert=nd;ur.prototype.reduce=id;ur.prototype.mulTo=od;ur.prototype.sqrTo=sd;function ad(){return(this.t>0?this.data[0]&1:this.s)==0}function cd(t,e){if(t>4294967295||t<1)return D.ONE;var r=ot(),n=ot(),i=e.convert(this),s=Ii(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,i,r);else{var o=r;r=n,n=o}return e.revert(r)}function fd(t,e){var r;return t<256||e.isEven()?r=new fr(e):r=new ur(e),this.exp(t,r)}D.prototype.copyTo=Nl;D.prototype.fromInt=Dl;D.prototype.fromString=kl;D.prototype.clamp=Pl;D.prototype.dlShiftTo=Vl;D.prototype.drShiftTo=Hl;D.prototype.lShiftTo=ql;D.prototype.rShiftTo=zl;D.prototype.subTo=Gl;D.prototype.multiplyTo=$l;D.prototype.squareTo=Wl;D.prototype.divRemTo=Yl;D.prototype.invDigit=ed;D.prototype.isEven=ad;D.prototype.exp=cd;D.prototype.toString=Ul;D.prototype.negate=Kl;D.prototype.abs=Ol;D.prototype.compareTo=Ml;D.prototype.bitLength=Fl;D.prototype.mod=Zl;D.prototype.modPowInt=fd;D.ZERO=Ye(0);D.ONE=Ye(1);function ud(){var t=ot();return this.copyTo(t),t}function hd(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}function dd(){return this.t==0?this.s:this.data[0]<<16>>16}function pd(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function yd(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function gd(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=Ye(r),i=ot(),s=ot(),o="";for(this.divRemTo(n,i,s);i.signum()>0;)o=(r+s.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,s);return s.intValue().toString(t)+o}function xd(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,s=0,o=0,a=0;a=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(o,0)),i&&D.ZERO.subTo(this,this)}function md(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(D.ONE.shiftLeft(t-1),Js,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(D.ONE.shiftLeft(t-1),this);else{var n=new Array,i=t&7;n.length=(t>>3)+1,e.nextBytes(n),i>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function vd(t){return this.compareTo(t)==0}function wd(t){return this.compareTo(t)<0?this:t}function Ed(t){return this.compareTo(t)>0?this:t}function Sd(t,e,r){var n,i,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),t&255||(t>>=8,e+=8),t&15||(t>>=4,e+=4),t&3||(t>>=2,e+=2),t&1||++e,e}function Dd(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}function Hd(t){var e=ot();return this.addTo(t,e),e}function qd(t){var e=ot();return this.subTo(t,e),e}function zd(t){var e=ot();return this.multiplyTo(t,e),e}function Gd(t){var e=ot();return this.divRemTo(t,e,null),e}function $d(t){var e=ot();return this.divRemTo(t,null,e),e}function Wd(t){var e=ot(),r=ot();return this.divRemTo(t,e,r),new Array(e,r)}function Yd(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Zd(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}function vn(){}function uc(t){return t}function Xd(t,e,r){t.multiplyTo(e,r)}function Qd(t,e){t.squareTo(e)}vn.prototype.convert=uc;vn.prototype.revert=uc;vn.prototype.mulTo=Xd;vn.prototype.sqrTo=Qd;function Jd(t){return this.exp(t,new vn)}function jd(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=ot();return t.copyTo(e),this.reduce(e),e}function rp(t){return t}function np(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function ip(t,e){t.squareTo(e),this.reduce(e)}function sp(t,e,r){t.multiplyTo(e,r),this.reduce(r)}Kr.prototype.convert=ep;Kr.prototype.revert=rp;Kr.prototype.reduce=np;Kr.prototype.mulTo=sp;Kr.prototype.sqrTo=ip;function op(t,e){var r=t.bitLength(),n,i=Ye(1),s;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new fr(e):e.isEven()?s=new Kr(e):s=new ur(e);var o=new Array,a=3,c=n-1,f=(1<1){var u=ot();for(s.sqrTo(o[1],u);a<=f;)o[a]=ot(),s.mulTo(u,o[a-2],o[a]),a+=2}var h=t.t-1,l,g=!0,d=ot(),p;for(r=Ii(t.data[h])-1;h>=0;){for(r>=c?l=t.data[h]>>r-c&f:(l=(t.data[h]&(1<0&&(l|=t.data[h-1]>>this.DB+r-c)),a=n;!(l&1);)l>>=1,--a;if((r-=a)<0&&(r+=this.DB,--h),g)o[l].copyTo(i),g=!1;else{for(;a>1;)s.sqrTo(i,d),s.sqrTo(d,i),a-=2;a>0?s.sqrTo(i,d):(p=i,i=d,d=p),s.mulTo(d,o[l],i)}for(;h>=0&&!(t.data[h]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function cp(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}function fp(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return D.ZERO;for(var r=t.clone(),n=this.clone(),i=Ye(1),s=Ye(0),o=Ye(0),a=Ye(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!i.isEven()||!s.isEven())&&(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!o.isEven()||!a.isEven())&&(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),s.subTo(a,s)):(n.subTo(r,n),e&&o.subTo(i,o),a.subTo(s,a))}if(n.compareTo(D.ONE)!=0)return D.ZERO;if(a.compareTo(t)>=0)return a.subtract(t);if(a.signum()<0)a.addTo(t,a);else return a;return a.signum()<0?a.add(t):a}var he=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],up=(1<<26)/he[he.length-1];function hp(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=he[he.length-1]){for(e=0;e=0);var a=s.modPow(n,this);if(a.compareTo(D.ONE)!=0&&a.compareTo(e)!=0){for(var c=1;c++{var xe=lt();cr();Bt();var dc=yc.exports=xe.sha1=xe.sha1||{};xe.md.sha1=xe.md.algorithms.sha1=dc;dc.create=function(){pc||pp();var t=null,e=xe.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),lc(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=xe.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(js.substr(0,n.blockLength-o));for(var a,c,f=n.fullMessageLength[0]*8,u=0;u>>0,f+=c,i.putInt32(f>>>0),f=a>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};lc(h,r,i);var l=xe.util.createBuffer();return l.putInt32(h.h0),l.putInt32(h.h1),l.putInt32(h.h2),l.putInt32(h.h3),l.putInt32(h.h4),l},n};var js=null,pc=!1;function pp(){js="\x80",js+=xe.util.fillString("\0",64),pc=!0}function lc(t,e,r){for(var n,i,s,o,a,c,f,u,h=r.length();h>=64;){for(i=t.h0,s=t.h1,o=t.h2,a=t.h3,c=t.h4,u=0;u<16;++u)n=r.getInt32(),e[u]=n,f=a^s&(o^a),n=(i<<5|i>>>27)+f+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<20;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,f=a^s&(o^a),n=(i<<5|i>>>27)+f+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<32;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<40;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<60;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s&o|a&(s^o),n=(i<<5|i>>>27)+f+c+2400959708+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<80;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+3395469782+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+s|0,t.h2=t.h2+o|0,t.h3=t.h3+a|0,t.h4=t.h4+c|0,h-=64}}});var bc=ht((N2,mc)=>{var me=lt();Bt();bn();gc();var xc=mc.exports=me.pkcs1=me.pkcs1||{};xc.encode_rsa_oaep=function(t,e,r){var n,i,s,o;typeof r=="string"?(n=r,i=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),s?s.start():s=me.md.sha1.create(),o||(o=s);var a=Math.ceil(t.n.bitLength()/8),c=a-2*s.digestLength-2;if(e.length>c){var f=new Error("RSAES-OAEP input message length is too long.");throw f.length=e.length,f.maxLength=c,f}n||(n=""),s.update(n,"raw");for(var u=s.digest(),h="",l=c-e.length,g=0;g>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+o),n+=r.digest().getBytes()}return n.substring(0,e)}});var vc=ht((D2,to)=>{var Ze=lt();Bt();Ti();bn();(function(){if(Ze.prime){to.exports=Ze.prime;return}var t=to.exports=Ze.prime=Ze.prime||{},e=Ze.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var i=function(h,l){return h|l};t.generateProbablePrime=function(h,l,g){typeof l=="function"&&(g=l,l={}),l=l||{};var d=l.algorithm||"PRIMEINC";typeof d=="string"&&(d={name:d}),d.options=d.options||{};var p=l.prng||Ze.random,y={nextBytes:function(x){for(var v=p.getBytesSync(x.length),m=0;ml&&(h=f(l,g)),h.isProbablePrime(p))return x(null,h);h.dAddOffset(r[d++%8],0)}while(y<0||+new Date-v"u")return o(h,l,g,d);var p=f(h,l),y=g.workers,x=g.workLoad||100,v=x*30/8,m=g.workerScript||"forge/prime.worker.js";if(y===-1)return Ze.util.estimateCores(function(S,B){S&&(B=2),y=B-1,A()});A();function A(){y=Math.max(1,y);for(var S=[],B=0;Bh&&(p=f(h,l));var z=p.toString(16);M.target.postMessage({hex:z,workLoad:x}),p.dAddOffset(v,0)}}}}function f(h,l){var g=new e(h,l),d=h-1;return g.testBit(d)||g.bitwiseTo(e.ONE.shiftLeft(d),i,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}function u(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}})()});var Ri=ht((k2,Ic)=>{var $=lt();mn();Ti();yi();bc();vc();bn();Bt();typeof st>"u"&&(st=$.jsbn.BigInteger);var st,eo=$.util.isNodejs?Ei():null,E=$.asn1,ne=$.util;$.pki=$.pki||{};Ic.exports=$.pki.rsa=$.rsa=$.rsa||{};var Q=$.pki,yp=[6,4,2,4,2,4,6,2],gp={name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},xp={name:"RSAPrivateKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},mp={name:"RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},bp=$.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},vp={name:"DigestInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:E.Class.UNIVERSAL,type:E.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},wp=function(t){var e;if(t.algorithm in Q.oids)e=Q.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=E.oidToDer(e).getBytes(),i=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]),s=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]);s.value.push(E.create(E.Class.UNIVERSAL,E.Type.OID,!1,n)),s.value.push(E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,""));var o=E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(s),i.value.push(o),E.toDer(i).getBytes()},Ac=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(st.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(st.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new st($.util.bytesToHex($.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(st.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var i=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(s)<0;)i=i.add(e.p);var o=i.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return o=o.multiply(n.modInverse(e.n)).mod(e.n),o};Q.rsa.encrypt=function(t,e,r){var n=r,i,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=Cc(t,e,r)):(i=$.util.createBuffer(),i.putBytes(t));for(var o=new st(i.toHex(),16),a=Ac(o,e,n),c=a.toString(16),f=$.util.createBuffer(),u=s-Math.ceil(c.length/2);u>0;)f.putByte(0),--u;return f.putBytes($.util.hexToBytes(c)),f.getBytes()};Q.rsa.decrypt=function(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=i,s}var o=new st($.util.createBuffer(t).toHex(),16);if(o.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var a=Ac(o,e,r),c=a.toString(16),f=$.util.createBuffer(),u=i-Math.ceil(c.length/2);u>0;)f.putByte(0),--u;return f.putBytes($.util.hexToBytes(c)),n!==!1?Li(f.getBytes(),e,r):f.getBytes()};Q.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||$.random,i={nextBytes:function(a){for(var c=n.getBytesSync(a.length),f=0;f>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+s);return o};Q.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new st(null);r.fromInt(30);for(var n=0,i=function(h,l){return h|l},s=+new Date,o,a=0;t.keys===null&&(e<=0||ac?t.pqState=0:t.num.isProbablePrime(Sp(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(yp[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(st.ONE),t.q1=t.q.subtract(st.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(st.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var u=t.e.modInverse(t.phi);t.keys={privateKey:Q.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Q.rsa.setPublicKey(t.n,t.e)}}o=+new Date,a+=o-s,s=o}return t.keys!==null};Q.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!$.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(wc("generateKeyPair"))return eo.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(a,c,f){if(a)return n(a);n(null,{privateKey:Q.privateKeyFromPem(f),publicKey:Q.publicKeyFromPem(c)})});if(Ec("generateKey")&&Ec("exportKey"))return ne.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:Bc(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(a){return ne.globalScope.crypto.subtle.exportKey("pkcs8",a.privateKey)}).then(void 0,function(a){n(a)}).then(function(a){if(a){var c=Q.privateKeyFromAsn1(E.fromDer($.util.createBuffer(a)));n(null,{privateKey:c,publicKey:Q.setRsaPublicKey(c.n,c.e)})}});if(Sc("generateKey")&&Sc("exportKey")){var i=ne.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:Bc(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(a){var c=a.target.result,f=ne.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);f.oncomplete=function(u){var h=u.target.result,l=Q.privateKeyFromAsn1(E.fromDer($.util.createBuffer(h)));n(null,{privateKey:l,publicKey:Q.setRsaPublicKey(l.n,l.e)})},f.onerror=function(u){n(u)}},i.onerror=function(a){n(a)};return}}else if(wc("generateKeyPairSync")){var s=eo.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Q.privateKeyFromPem(s.privateKey),publicKey:Q.publicKeyFromPem(s.publicKey)}}}var o=Q.rsa.createKeyPairGenerationState(t,e,r);if(!n)return Q.rsa.stepKeyPairGenerationState(o,0),o.keys;Ep(o,r,n)};Q.setRsaPublicKey=Q.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,i,s){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(a,c,f){return Cc(a,c,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(a,c){return $.pkcs1.encode_rsa_oaep(c,a,s)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(a){return a}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(n,r,!0);return Q.rsa.encrypt(o,r,!0)},r.verify=function(n,i,s,o){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),s==="RSASSA-PKCS1-V1_5"?s={verify:function(c,f){f=Li(f,r,!0);var u=E.fromDer(f,{parseAllBytes:o._parseAllDigestBytes}),h={},l=[];if(!E.validate(u,vp,h,l)){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=l,g}var d=E.derToOid(h.algorithmIdentifier);if(!(d===$.oids.md2||d===$.oids.md5||d===$.oids.sha1||d===$.oids.sha224||d===$.oids.sha256||d===$.oids.sha384||d===$.oids.sha512||d===$.oids["sha512-224"]||d===$.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=d,g}if((d===$.oids.md2||d===$.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return c===h.digest}}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:function(c,f){return f=Li(f,r,!0),c===f}});var a=Q.rsa.decrypt(i,r,!0,!1);return s.verify(n,a,r.n.bitLength())},r};Q.setRsaPrivateKey=Q.rsa.setPrivateKey=function(t,e,r,n,i,s,o,a){var c={n:t,e,d:r,p:n,q:i,dP:s,dQ:o,qInv:a};return c.decrypt=function(f,u,h){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var l=Q.rsa.decrypt(f,c,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:Li};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(g,d){return $.pkcs1.decode_rsa_oaep(d,g,h)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(g){return g}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(l,c,!1)},c.sign=function(f,u){var h=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:wp},h=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return f}},h=1);var l=u.encode(f,c.n.bitLength());return Q.rsa.encrypt(l,c,h)},c};Q.wrapRsaPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Q.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,E.toDer(t).getBytes())])};Q.privateKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,gp,e,r)&&(t=E.fromDer($.util.createBuffer(e.privateKey))),e={},r=[],!E.validate(t,xp,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,s,o,a,c,f,u,h;return i=$.util.createBuffer(e.privateKeyModulus).toHex(),s=$.util.createBuffer(e.privateKeyPublicExponent).toHex(),o=$.util.createBuffer(e.privateKeyPrivateExponent).toHex(),a=$.util.createBuffer(e.privateKeyPrime1).toHex(),c=$.util.createBuffer(e.privateKeyPrime2).toHex(),f=$.util.createBuffer(e.privateKeyExponent1).toHex(),u=$.util.createBuffer(e.privateKeyExponent2).toHex(),h=$.util.createBuffer(e.privateKeyCoefficient).toHex(),Q.setRsaPrivateKey(new st(i,16),new st(s,16),new st(o,16),new st(a,16),new st(c,16),new st(f,16),new st(u,16),new st(h,16))};Q.privateKeyToAsn1=Q.privateKeyToRSAPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.e)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.d)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.p)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.q)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.dP)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.dQ)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.qInv))])};Q.publicKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,bp,e,r)){var n=E.derToOid(e.publicKeyOid);if(n!==Q.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}t=e.rsaPublicKey}if(r=[],!E.validate(t,mp,e,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var s=$.util.createBuffer(e.publicKeyModulus).toHex(),o=$.util.createBuffer(e.publicKeyExponent).toHex();return Q.setRsaPublicKey(new st(s,16),new st(o,16))};Q.publicKeyToAsn1=Q.publicKeyToSubjectPublicKeyInfo=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Q.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.BITSTRING,!1,[Q.publicKeyToRSAPublicKey(t)])])};Q.publicKeyToRSAPublicKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.e))])};function Cc(t,e,r){var n=$.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=i-11,s}n.putByte(0),n.putByte(r);var o=i-3-t.length,a;if(r===0||r===1){a=r===0?0:255;for(var c=0;c0;){for(var f=0,u=$.random.getBytes(o),c=0;c"u")throw new Error("Encryption block is invalid.");var c=0;if(a===0){c=i-3-n;for(var f=0;f1;){if(s.getByte()!==255){--s.read;break}++c}else if(a===2)for(c=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++c}var u=s.getByte();if(u!==0||c!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function Ep(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),i();function i(){s(t.pBits,function(a,c){if(a)return r(a);if(t.p=c,t.q!==null)return o(a,t.q);s(t.qBits,o)})}function s(a,c){$.prime.generateProbablePrime(a,n,c)}function o(a,c){if(a)return r(a);if(t.q=c,t.p.compareTo(t.q)<0){var f=t.p;t.p=t.q,t.q=f}if(t.p.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)!==0){t.p=null,i();return}if(t.q.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)!==0){t.q=null,s(t.qBits,o);return}if(t.p1=t.p.subtract(st.ONE),t.q1=t.q.subtract(st.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(st.ONE)!==0){t.p=t.q=null,i();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,o);return}var u=t.e.modInverse(t.phi);t.keys={privateKey:Q.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Q.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function be(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=$.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function Sp(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function wc(t){return $.util.isNodejs&&typeof eo[t]=="function"}function Ec(t){return typeof ne.globalScope<"u"&&typeof ne.globalScope.crypto=="object"&&typeof ne.globalScope.crypto.subtle=="object"&&typeof ne.globalScope.crypto.subtle[t]=="function"}function Sc(t){return typeof ne.globalScope<"u"&&typeof ne.globalScope.msCrypto=="object"&&typeof ne.globalScope.msCrypto.subtle=="object"&&typeof ne.globalScope.msCrypto.subtle[t]=="function"}function Bc(t){for(var e=$.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{var H=lt();$s();mn();K0();cr();yi();H0();G0();bn();nc();Ri();Bt();typeof Tc>"u"&&(Tc=H.jsbn.BigInteger);var Tc,I=H.asn1,tt=H.pki=H.pki||{};Nc.exports=tt.pbe=H.pbe=H.pbe||{};var hr=tt.oids,Bp={name:"EncryptedPrivateKeyInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Ap={name:"PBES2Algorithms",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},Cp={name:"pkcs-12PbeParams",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"iterations"}]};tt.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=H.random.getBytesSync(r.saltSize),i=r.count,s=I.integerToDer(i),o,a,c;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var f,u,h;switch(r.algorithm){case"aes128":o=16,f=16,u=hr["aes128-CBC"],h=H.aes.createEncryptionCipher;break;case"aes192":o=24,f=16,u=hr["aes192-CBC"],h=H.aes.createEncryptionCipher;break;case"aes256":o=32,f=16,u=hr["aes256-CBC"],h=H.aes.createEncryptionCipher;break;case"des":o=8,f=8,u=hr.desCBC,h=H.des.createEncryptionCipher;break;default:var l=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw l.algorithm=r.algorithm,l}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),d=Rc(g),p=H.pkcs5.pbkdf2(e,n,i,o,d),y=H.random.getBytesSync(f),x=h(p);x.start(y),x.update(I.toDer(t)),x.finish(),c=x.output.getBytes();var v=Ip(n,s,o,g);a=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr.pkcs5PBES2).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr.pkcs5PBKDF2).getBytes()),v]),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(u).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,y)])])])}else if(r.algorithm==="3des"){o=24;var m=new H.util.ByteBuffer(n),p=tt.pbe.generatePkcs12Key(e,m,1,i,o),y=tt.pbe.generatePkcs12Key(e,m,2,i,o),x=H.des.createEncryptionCipher(p);x.start(y),x.update(I.toDer(t)),x.finish(),c=x.output.getBytes(),a=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,n),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,s.getBytes())])])}else{var l=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw l.algorithm=r.algorithm,l}var A=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[a,I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,c)]);return A};tt.decryptPrivateKeyInfo=function(t,e){var r=null,n={},i=[];if(!I.validate(t,Bp,n,i)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=I.derToOid(n.encryptionOid),a=tt.pbe.getCipher(o,n.encryptionParams,e),c=H.util.createBuffer(n.encryptedData);return a.update(c),a.finish()&&(r=I.fromDer(a.output)),r};tt.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:I.toDer(t).getBytes()};return H.pem.encode(r,{maxline:e})};tt.encryptedPrivateKeyFromPem=function(t){var e=H.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return I.fromDer(e.body)};tt.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=tt.wrapRsaPrivateKey(tt.privateKeyToAsn1(t));return n=tt.encryptPrivateKeyInfo(n,e,r),tt.encryptedPrivateKeyToPem(n)}var i,s,o,a;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,s=H.random.getBytesSync(8),a=H.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,s=H.random.getBytesSync(8),a=H.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var f=H.pbe.opensslDeriveBytes(e,s.substr(0,8),o),u=a(f);u.start(s),u.update(I.toDer(tt.privateKeyToAsn1(t))),u.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:H.util.bytesToHex(s).toUpperCase()},body:u.output.getBytes()};return H.pem.encode(h)};tt.decryptRsaPrivateKey=function(t,e){var r=null,n=H.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,o;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,o=H.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,o=H.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,o=H.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,o=H.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,o=H.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,o=function(h){return H.rc2.createDecryptionCipher(h,40)};break;case"RC2-64-CBC":s=8,o=function(h){return H.rc2.createDecryptionCipher(h,64)};break;case"RC2-128-CBC":s=16,o=function(h){return H.rc2.createDecryptionCipher(h,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var a=H.util.hexToBytes(n.dekInfo.parameters),c=H.pbe.opensslDeriveBytes(e,a.substr(0,8),s),f=o(c);if(f.start(a),f.update(H.util.createBuffer(n.body)),f.finish())r=f.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=tt.decryptPrivateKeyInfo(I.fromDer(r),e):r=I.fromDer(r),r!==null&&(r=tt.privateKeyFromAsn1(r)),r};tt.pbe.generatePkcs12Key=function(t,e,r,n,i,s){var o,a;if(typeof s>"u"||s===null){if(!("sha1"in H.md))throw new Error('"sha1" hash algorithm unavailable.');s=H.md.sha1.create()}var c=s.digestLength,f=s.blockLength,u=new H.util.ByteBuffer,h=new H.util.ByteBuffer;if(t!=null){for(a=0;a=0;a--)q=q>>8,q+=_.at(a)+U.at(a),U.setAt(a,q&255);M.putBuffer(U)}m=M,u.putBuffer(B)}return u.truncate(u.length()-i),u};tt.pbe.getCipher=function(t,e,r){switch(t){case tt.oids.pkcs5PBES2:return tt.pbe.getCipherForPBES2(t,e,r);case tt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case tt.oids["pbewithSHAAnd40BitRC2-CBC"]:return tt.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};tt.pbe.getCipherForPBES2=function(t,e,r){var n={},i=[];if(!I.validate(e,Ap,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}if(t=I.derToOid(n.kdfOid),t!==tt.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=I.derToOid(n.encOid),t!==tt.oids["aes128-CBC"]&&t!==tt.oids["aes192-CBC"]&&t!==tt.oids["aes256-CBC"]&&t!==tt.oids["des-EDE3-CBC"]&&t!==tt.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var o=n.kdfSalt,a=H.util.createBuffer(n.kdfIterationCount);a=a.getInt(a.length()<<3);var c,f;switch(tt.oids[t]){case"aes128-CBC":c=16,f=H.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,f=H.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,f=H.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,f=H.des.createDecryptionCipher;break;case"desCBC":c=8,f=H.des.createDecryptionCipher;break}var u=Lc(n.prfOid),h=H.pkcs5.pbkdf2(r,o,a,c,u),l=n.encIv,g=f(h);return g.start(l),g};tt.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},i=[];if(!I.validate(e,Cp,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=H.util.createBuffer(n.salt),a=H.util.createBuffer(n.iterations);a=a.getInt(a.length()<<3);var c,f,u;switch(t){case tt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,f=8,u=H.des.startDecrypting;break;case tt.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,f=8,u=function(p,y){var x=H.rc2.createDecryptionCipher(p,40);return x.start(y,null),x};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=Lc(n.prfOid),l=tt.pbe.generatePkcs12Key(r,o,1,a,c,h);h.start();var g=tt.pbe.generatePkcs12Key(r,o,2,a,f,h);return u(l,g)};tt.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in H.md))throw new Error('"md5" hash algorithm unavailable.');n=H.md.md5.create()}e===null&&(e="");for(var i=[_c(n,t+e)],s=16,o=1;s{var mt=lt();cr();Bt();var _n=wf.exports=mt.sha512=mt.sha512||{};mt.md.sha512=mt.md.algorithms.sha512=_n;var bf=mt.sha384=mt.sha512.sha384=mt.sha512.sha384||{};bf.create=function(){return _n.create("SHA-384")};mt.md.sha384=mt.md.algorithms.sha384=bf;mt.sha512.sha256=mt.sha512.sha256||{create:function(){return _n.create("SHA-512/256")}};mt.md["sha512/256"]=mt.md.algorithms["sha512/256"]=mt.sha512.sha256;mt.sha512.sha224=mt.sha512.sha224||{create:function(){return _n.create("SHA-512/224")}};mt.md["sha512/224"]=mt.md.algorithms["sha512/224"]=mt.sha512.sha224;_n.create=function(t){if(vf||Yy(),typeof t>"u"&&(t="SHA-512"),!(t in br))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=br[t],r=null,n=mt.util.createBuffer(),i=new Array(80),s=0;s<80;++s)i[s]=new Array(2);var o=64;switch(t){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var a={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength128=[];for(var c=a.messageLengthSize/4,f=0;f>>0,u>>>0];for(var h=a.fullMessageLength.length-1;h>=0;--h)a.fullMessageLength[h]+=u[1],u[1]=u[0]+(a.fullMessageLength[h]/4294967296>>>0),a.fullMessageLength[h]=a.fullMessageLength[h]>>>0,u[0]=u[1]/4294967296>>>0;return n.putBytes(c),mf(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),a},a.digest=function(){var c=mt.util.createBuffer();c.putBytes(n.bytes());var f=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize,u=f&a.blockLength-1;c.putBytes(Fo.substr(0,a.blockLength-u));for(var h,l,g=a.fullMessageLength[0]*8,d=0;d>>0,g+=l,c.putInt32(g>>>0),g=h>>>0;c.putInt32(g);for(var p=new Array(r.length),d=0;d=128;){for(C=0;C<16;++C)e[C][0]=r.getInt32()>>>0,e[C][1]=r.getInt32()>>>0;for(;C<80;++C)L=e[C-2],N=L[0],T=L[1],n=((N>>>19|T<<13)^(T>>>29|N<<3)^N>>>6)>>>0,i=((N<<13|T>>>19)^(T<<3|N>>>29)^(N<<26|T>>>6))>>>0,P=e[C-15],N=P[0],T=P[1],s=((N>>>1|T<<31)^(N>>>8|T<<24)^N>>>7)>>>0,o=((N<<31|T>>>1)^(N<<24|T>>>8)^(N<<25|T>>>7))>>>0,w=e[C-7],K=e[C-16],T=i+w[1]+o+K[1],e[C][0]=n+w[0]+s+K[0]+(T/4294967296>>>0)>>>0,e[C][1]=T>>>0;for(p=t[0][0],y=t[0][1],x=t[1][0],v=t[1][1],m=t[2][0],A=t[2][1],S=t[3][0],B=t[3][1],R=t[4][0],_=t[4][1],O=t[5][0],M=t[5][1],U=t[6][0],q=t[6][1],z=t[7][0],Z=t[7][1],C=0;C<80;++C)f=((R>>>14|_<<18)^(R>>>18|_<<14)^(_>>>9|R<<23))>>>0,u=((R<<18|_>>>14)^(R<<14|_>>>18)^(_<<23|R>>>9))>>>0,h=(U^R&(O^U))>>>0,l=(q^_&(M^q))>>>0,a=((p>>>28|y<<4)^(y>>>2|p<<30)^(y>>>7|p<<25))>>>0,c=((p<<4|y>>>28)^(y<<30|p>>>2)^(y<<25|p>>>7))>>>0,g=(p&x|m&(p^x))>>>0,d=(y&v|A&(y^v))>>>0,T=Z+u+l+Vo[C][1]+e[C][1],n=z+f+h+Vo[C][0]+e[C][0]+(T/4294967296>>>0)>>>0,i=T>>>0,T=c+d,s=a+g+(T/4294967296>>>0)>>>0,o=T>>>0,z=U,Z=q,U=O,q=M,O=R,M=_,T=B+i,R=S+n+(T/4294967296>>>0)>>>0,_=T>>>0,S=m,B=A,m=x,A=v,x=p,v=y,T=i+o,p=n+s+(T/4294967296>>>0)>>>0,y=T>>>0;T=t[0][1]+y,t[0][0]=t[0][0]+p+(T/4294967296>>>0)>>>0,t[0][1]=T>>>0,T=t[1][1]+v,t[1][0]=t[1][0]+x+(T/4294967296>>>0)>>>0,t[1][1]=T>>>0,T=t[2][1]+A,t[2][0]=t[2][0]+m+(T/4294967296>>>0)>>>0,t[2][1]=T>>>0,T=t[3][1]+B,t[3][0]=t[3][0]+S+(T/4294967296>>>0)>>>0,t[3][1]=T>>>0,T=t[4][1]+_,t[4][0]=t[4][0]+R+(T/4294967296>>>0)>>>0,t[4][1]=T>>>0,T=t[5][1]+M,t[5][0]=t[5][0]+O+(T/4294967296>>>0)>>>0,t[5][1]=T>>>0,T=t[6][1]+q,t[6][0]=t[6][0]+U+(T/4294967296>>>0)>>>0,t[6][1]=T>>>0,T=t[7][1]+Z,t[7][0]=t[7][0]+z+(T/4294967296>>>0)>>>0,t[7][1]=T>>>0,V-=128}}});var tu=ht((Cw,jf)=>{var jr=1e3,tn=jr*60,en=tn*60,Sr=en*24,B1=Sr*7,A1=Sr*365.25;jf.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return C1(t);if(r==="number"&&isFinite(t))return e.long?T1(t):I1(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function C1(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*A1;case"weeks":case"week":case"w":return r*B1;case"days":case"day":case"d":return r*Sr;case"hours":case"hour":case"hrs":case"hr":case"h":return r*en;case"minutes":case"minute":case"mins":case"min":case"m":return r*tn;case"seconds":case"second":case"secs":case"sec":case"s":return r*jr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function I1(t){var e=Math.abs(t);return e>=Sr?Math.round(t/Sr)+"d":e>=en?Math.round(t/en)+"h":e>=tn?Math.round(t/tn)+"m":e>=jr?Math.round(t/jr)+"s":t+"ms"}function T1(t){var e=Math.abs(t);return e>=Sr?Vi(t,e,Sr,"day"):e>=en?Vi(t,e,en,"hour"):e>=tn?Vi(t,e,tn,"minute"):e>=jr?Vi(t,e,jr,"second"):t+" ms"}function Vi(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var ru=ht((Iw,eu)=>{function _1(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=tu(),r.destroy=f,Object.keys(t).forEach(u=>{r[u]=t[u]}),r.names=[],r.skips=[],r.formatters={};function e(u){let h=0;for(let l=0;l{if(B==="%%")return"%";A++;let _=r.formatters[R];if(typeof _=="function"){let O=y[A];B=_.call(x,O),y.splice(A,1),A--}return B}),r.formatArgs.call(x,y),(x.log||r.log).apply(x,y)}return p.namespace=u,p.useColors=r.useColors(),p.color=r.selectColor(u),p.extend=n,p.destroy=r.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>l!==null?l:(g!==r.namespaces&&(g=r.namespaces,d=r.enabled(u)),d),set:y=>{l=y}}),typeof r.init=="function"&&r.init(p),p}function n(u,h){let l=r(this.namespace+(typeof h>"u"?":":h)+u);return l.log=this.log,l}function i(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let h,l=(typeof u=="string"?u:"").split(/[\s,]+/),g=l.length;for(h=0;h"-"+h)].join(",");return r.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let h,l;for(h=0,l=r.skips.length;h{jt.formatArgs=R1;jt.save=N1;jt.load=D1;jt.useColors=L1;jt.storage=k1();jt.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();jt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function L1(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function R1(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Hi.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}jt.log=console.debug||console.log||(()=>{});function N1(t){try{t?jt.storage.setItem("debug",t):jt.storage.removeItem("debug")}catch{}}function D1(){let t;try{t=jt.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function k1(){try{return localStorage}catch{}}Hi.exports=ru()(jt);var{formatters:P1}=Hi.exports;P1.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var V1={};_t(V1,{noise:()=>F1,pureJsCrypto:()=>di});function Me(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function rt(t=0){return globalThis.Buffer?.alloc!=null?Me(globalThis.Buffer.alloc(t)):new Uint8Array(t)}function It(t=0){return globalThis.Buffer?.allocUnsafe!=null?Me(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}var Su=Math.pow(2,7),Bu=Math.pow(2,14),Au=Math.pow(2,21),Zi=Math.pow(2,28),Xi=Math.pow(2,35),Qi=Math.pow(2,42),Ji=Math.pow(2,49),ct=128,Ht=127;function Be(t){if(tNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Cu(t,e,r=0){switch(Be(t)){case 8:e[r++]=t&255|ct,t/=128;case 7:e[r++]=t&255|ct,t/=128;case 6:e[r++]=t&255|ct,t/=128;case 5:e[r++]=t&255|ct,t/=128;case 4:e[r++]=t&255|ct,t>>>=7;case 3:e[r++]=t&255|ct,t>>>=7;case 2:e[r++]=t&255|ct,t>>>=7;case 1:{e[r++]=t&255,t>>>=7;break}default:throw new Error("unreachable")}return e}function Iu(t,e,r=0){switch(Be(t)){case 8:e.set(r++,t&255|ct),t/=128;case 7:e.set(r++,t&255|ct),t/=128;case 6:e.set(r++,t&255|ct),t/=128;case 5:e.set(r++,t&255|ct),t/=128;case 4:e.set(r++,t&255|ct),t>>>=7;case 3:e.set(r++,t&255|ct),t>>>=7;case 2:e.set(r++,t&255|ct),t>>>=7;case 1:{e.set(r++,t&255),t>>>=7;break}default:throw new Error("unreachable")}return e}function Tu(t,e){let r=t[e],n=0;if(n+=r&Ht,ri+s.length,0));let r=It(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return Me(r)}function Lt(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let r=0;for(let n of e)if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.push(n);else if(Fn(n))r+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}prepend(...e){this.prependAll(e)}prependAll(e){let r=0;for(let n of e.reverse())if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.unshift(n);else if(Fn(n))r+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}get(e){let r=da(this.bufs,e);return r.buf[r.index]}set(e,r){let n=da(this.bufs,e);n.buf[n.index]=r}write(e,r=0){if(e instanceof Uint8Array)for(let n=0;n0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,r){let{bufs:n,length:i}=this._subList(e,r);return Gt(n,i)}subarray(e,r){let{bufs:n,length:i}=this._subList(e,r);return n.length===1?n[0]:Gt(n,i)}sublist(e,r){let{bufs:n,length:i}=this._subList(e,r),s=new t;return s.length=i,s.bufs=n,s}_subList(e,r){if(e=e??0,r=r??this.length,e<0&&(e=this.length+e),r<0&&(r=this.length+r),e<0||r>this.length)throw new RangeError("index is out of bounds");if(e===r)return{bufs:[],length:0};if(e===0&&r===this.length)return{bufs:[...this.bufs],length:this.length};let n=[],i=0;for(let s=0;s=c)continue;let f=e>=a&&ea&&r<=c;if(f&&u){if(e===a&&r===c){n.push(o);break}let h=e-a;n.push(o.subarray(h,h+(r-e)));break}if(f){if(e===0){n.push(o);continue}n.push(o.subarray(e-a));continue}if(u){if(r===c){n.push(o);break}n.push(o.subarray(0,r-a));break}n.push(o)}return{bufs:n,length:r-e}}indexOf(e,r=0){if(!Fn(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(r=Number(r??0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),e.length===0)return r>this.length?this.length:r;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let s=256,o=new Int32Array(s);for(let h=0;h=0;l--){let g=this.get(h+l);if(n[l]!==g){u=Math.max(1,l-a[g]);break}}if(u===0)return h}return-1}getInt8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt8(0)}setInt8(e,r){let n=It(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,r),this.write(n,e)}getInt16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,r)}setInt16(e,r,n){let i=rt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,r,n),this.write(i,e)}getInt32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,r)}setInt32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,r,n),this.write(i,e)}getBigInt64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,r)}setBigInt64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,r,n),this.write(i,e)}getUint8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint8(0)}setUint8(e,r){let n=It(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,r),this.write(n,e)}getUint16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,r)}setUint16(e,r,n){let i=rt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,r,n),this.write(i,e)}getUint32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,r)}setUint32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,r,n),this.write(i,e)}getBigUint64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,r)}setBigUint64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,r,n),this.write(i,e)}getFloat32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,r)}setFloat32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,r,n),this.write(i,e)}getFloat64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,r)}setFloat64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,r,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof t)||e.bufs.length!==this.bufs.length)return!1;for(let r=0;ri+s.byteLength,0)),n.length=r,n}};function Vn(t){return t[Symbol.asyncIterator]!=null}var Hn=t=>{let e=Be(t),r=It(e);return la(t,r),Hn.bytes=e,r};Hn.bytes=0;function nn(t,e){e=e??{};let r=e.lengthEncoder??Hn;function*n(i){let s=r(i.byteLength);s instanceof Uint8Array?yield s:yield*s,i instanceof Uint8Array?yield i:yield*i}return Vn(t)?async function*(){for await(let i of t)yield*n(i)}():function*(){for(let i of t)yield*n(i)}()}nn.single=(t,e)=>{e=e??{};let r=e.lengthEncoder??Hn;return new Rt(r(t.byteLength),t)};var Br=zt(xa(),1);var Ru=8,Nu=1024*1024*4,er;(function(t){t[t.LENGTH=0]="LENGTH",t[t.DATA=1]="DATA"})(er||(er={}));var ts=t=>{let e=Mn(t);return ts.bytes=Be(e),e};ts.bytes=0;function sn(t,e){let r=new Rt,n=er.LENGTH,i=-1,s=e?.lengthDecoder??ts,o=e?.maxLengthLength??Ru,a=e?.maxDataLength??Nu;function*c(){for(;r.byteLength>0;){if(n===er.LENGTH)try{if(i=s(r),i<0)throw(0,Br.default)(new Error("invalid message length"),"ERR_INVALID_MSG_LENGTH");if(i>a)throw(0,Br.default)(new Error("message length too long"),"ERR_MSG_DATA_TOO_LONG");let f=s.bytes;r.consume(f),e?.onLength!=null&&e.onLength(i),n=er.DATA}catch(f){if(f instanceof RangeError){if(r.byteLength>o)throw(0,Br.default)(new Error("message length length too long"),"ERR_MSG_LENGTH_TOO_LONG");break}throw f}if(n===er.DATA){if(r.byteLength0)throw(0,Br.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}():function*(){for(let f of t)r.append(f),yield*c();if(r.byteLength>0)throw(0,Br.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}()}sn.fromReader=(t,e)=>{let r=1,n=async function*(){for(;;)try{let{done:s,value:o}=await t.next(r);if(s===!0)return;o!=null&&(yield o)}catch(s){if(s.code==="ERR_UNDER_READ")return{done:!0,value:null};throw s}finally{r=1}}();return sn(n,{...e??{},onLength:s=>{r=s}})};function oe(){let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}var qn=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=r??"ABORT_ERR"}};async function ma(t,e,r){if(e==null)return t;if(e.aborted)return Promise.reject(new qn(r?.errorMessage,r?.errorCode));let n,i=new qn(r?.errorMessage,r?.errorCode);try{return await Promise.race([t,new Promise((s,o)=>{n=()=>{o(i)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var es=class{needNext;haveNext;ended;nextResult;constructor(){this.ended=!1,this.needNext=oe(),this.needNext.resolve(),this.haveNext=oe()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("Have next but next was undefined");let e=this.nextResult;return this.nextResult=void 0,this.needNext.resolve(),this.needNext=oe(),e}async throw(e){return this.ended=!0,e!=null&&this.haveNext.reject(e),{done:!0,value:void 0}}async return(){let e={done:!0,value:void 0};return await this._push(void 0),e}async push(e,r){await this._push(e,r)}async end(e,r){e!=null?await this.throw(e):await this._push(void 0,r)}async _push(e,r){if(e!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");this.nextResult!=null&&await this.needNext.promise,e!=null?this.nextResult={done:!1,value:e}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=oe(),await ma(this.needNext.promise,r?.signal,r)}};function ba(){return new es}var zn=class extends Error{code;constructor(e,r){super(e),this.code=r}},rs=class extends zn{type;constructor(e){super(e,"ABORT_ERR"),this.type="aborted"}};function va(t,e){let r=ba();t.sink(r).catch(async o=>{await r.end(o)}),t.sink=async o=>{for await(let a of o)await r.push(a);await r.end()};let n=t.source;t.source[Symbol.iterator]!=null?n=t.source[Symbol.iterator]():t.source[Symbol.asyncIterator]!=null&&(n=t.source[Symbol.asyncIterator]());let i=new Rt;return{read:async(o,a)=>{a?.signal?.throwIfAborted();let c,f=new Promise((u,h)=>{c=()=>{h(new rs("Read aborted"))},a?.signal?.addEventListener("abort",c)});try{if(o==null){let{done:h,value:l}=await Promise.race([n.next(),f]);return h===!0?new Rt:l}for(;i.byteLength{a?.signal?.throwIfAborted(),o instanceof Uint8Array?await r.push(o,a):await r.push(o.subarray(),a)},unwrap:()=>{if(i.byteLength>0){let o=t.source;t.source=async function*(){e?.yieldBytes===!1?yield i:yield*i,yield*o}()}return t}}}var Gn=class extends Error{code;constructor(e,r){super(e),this.code=r}},wa=t=>Mn(t);wa.bytes=0;function ns(t,e={}){let r=va(t,e);return e.maxDataLength!=null&&e.maxLengthLength==null&&(e.maxLengthLength=Be(e.maxDataLength)),{read:async i=>{let s=-1,o=new Rt,a=e?.lengthDecoder??wa;for(;;){o.append(await r.read(1,i));try{s=a(o)}catch(c){if(c instanceof RangeError)continue;throw c}if(e?.maxLengthLength!=null&&o.byteLength>e.maxLengthLength)throw new Gn("message length length too long","ERR_MSG_LENGTH_TOO_LONG");if(s>-1)break}if(e?.maxDataLength!=null&&s>e.maxDataLength)throw new Gn("message length too long","ERR_MSG_DATA_TOO_LONG");return r.read(s,i)},write:async(i,s)=>{await r.write(nn.single(i,e),s)},writeV:async(i,s)=>{let o=new Rt(...i.map(a=>nn.single(a,e)));await r.write(o,s)},unwrap:()=>r.unwrap()}}function is(){let t=oe(),e=!1;return{sink:async r=>{if(e)throw new Error("already piped");e=!0,t.resolve(r)},source:async function*(){yield*await t.promise}()}}function Ea(){let t=is(),e=is();return[{source:t.source,sink:e.sink},{source:e.source,sink:t.sink}]}var $n=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},Ar=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new $n(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let r=this.head;this.head=r.next=new $n(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var ss=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function Wn(t={}){return ku(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},t)}function ku(t,e){e=e??{};let r=e.onEnd,n=new Ar,i,s,o,a=oe(),c=async()=>{try{return n.isEmpty()?o?{done:!0}:await new Promise((y,x)=>{s=v=>{s=null,n.push(v);try{y(t(n))}catch(m){x(m)}return i}}):t(n)}finally{n.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=oe()})}},f=y=>s!=null?s(y):(n.push(y),i),u=y=>(n=new Ar,s!=null?s({error:y}):(n.push({error:y}),i)),h=y=>{if(o)return i;if(e?.objectMode!==!0&&y?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return f({done:!1,value:y})},l=y=>o?i:(o=!0,y!=null?u(y):f({done:!0})),g=()=>(n=new Ar,l(),{done:!0}),d=y=>(l(y),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:c,return:g,throw:d,push:h,end:l,get readableLength(){return n.size},onEmpty:async y=>{let x=y?.signal;if(x?.throwIfAborted(),n.isEmpty())return;let v,m;x!=null&&(v=new Promise((A,S)=>{m=()=>{S(new ss)},x.addEventListener("abort",m)}));try{await Promise.race([a.promise,v])}finally{m!=null&&x!=null&&x?.removeEventListener("abort",m)}}},r==null)return i;let p=i;return i={[Symbol.asyncIterator](){return this},next(){return p.next()},throw(y){return p.throw(y),r!=null&&(r(y),r=void 0),{done:!0}},return(){return p.return(),r!=null&&(r(),r=void 0),{done:!0}},push:h,end(y){return p.end(y),r!=null&&(r(y),r=void 0),i},get readableLength(){return p.readableLength},onEmpty:y=>p.onEmpty(y)},i}function Pu(t){return t[Symbol.asyncIterator]!=null}function Uu(...t){let e=[];for(let r of t)Pu(r)||e.push(r);return e.length===t.length?function*(){for(let r of e)yield*r}():async function*(){let r=Wn({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(t.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var Sa=Uu;function Ba(t,...e){if(t==null)throw new Error("Empty pipeline");if(os(t)){let n=t;t=()=>n.source}else if(Ca(t)||Aa(t)){let n=t;t=()=>n}let r=[t,...e];if(r.length>1&&os(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n{let e;for(;t.length>0;)e=t.shift()(e);return e},Aa=t=>t?.[Symbol.asyncIterator]!=null,Ca=t=>t?.[Symbol.iterator]!=null,os=t=>t==null?!1:t.sink!=null&&t.source!=null,Ou=t=>e=>{let r=t.sink(e);if(r?.then!=null){let n=Wn({objectMode:!0});r.then(()=>{n.end()},o=>{n.end(o)});let i,s=t.source;if(Aa(s))i=async function*(){yield*s,n.end()};else if(Ca(s))i=function*(){yield*s,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return Sa(n,i())}return t.source};var Ia=!!globalThis.process?.env?.DUMP_SESSION_KEYS;var Mu=t=>t instanceof Uint8Array;var Ae=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Ta=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Fu=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Fu)throw new Error("Non little-endian hardware is not supported");function Yn(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Zn(t){if(typeof t=="string")t=Yn(t);else if(Mu(t))t=t.slice();else throw new Error(`expected Uint8Array, got ${typeof t}`);return t}var Vu=t=>Object.prototype.toString.call(t)==="[object Object]"&&t.constructor===Object;function _a(t,e){if(e!==void 0&&(typeof e!="object"||!Vu(e)))throw new Error("options must be object or undefined");return Object.assign(t,e)}function rr(t,e){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");if(typeof e=="number"&&t.length!==e)throw new Error(`Uint8Array length ${e} expected`)}function La(t,e){if(t.length!==e.length)throw new Error("equalBytes: Different size of Uint8Arrays");let r=!0;for(let n=0;n(Object.assign(e,t),e);function cs(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,f=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+f,a,n)}function Xn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function fs(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function Cr(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function us(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ra(t,e){Cr(t);let r=e.outputLen;if(t.lengtht[e++]&255|(t[e++]&255)<<8,hs=class{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=Zn(e),rr(e,32);let r=Ot(e,0),n=Ot(e,2),i=Ot(e,4),s=Ot(e,6),o=Ot(e,8),a=Ot(e,10),c=Ot(e,12),f=Ot(e,14);this.r[0]=r&8191,this.r[1]=(r>>>13|n<<3)&8191,this.r[2]=(n>>>10|i<<6)&7939,this.r[3]=(i>>>7|s<<9)&8191,this.r[4]=(s>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|f<<8)&8191,this.r[9]=f>>>5&127;for(let u=0;u<8;u++)this.pad[u]=Ot(e,16+2*u)}process(e,r,n=!1){let i=n?0:2048,{h:s,r:o}=this,a=o[0],c=o[1],f=o[2],u=o[3],h=o[4],l=o[5],g=o[6],d=o[7],p=o[8],y=o[9],x=Ot(e,r+0),v=Ot(e,r+2),m=Ot(e,r+4),A=Ot(e,r+6),S=Ot(e,r+8),B=Ot(e,r+10),R=Ot(e,r+12),_=Ot(e,r+14),O=s[0]+(x&8191),M=s[1]+((x>>>13|v<<3)&8191),U=s[2]+((v>>>10|m<<6)&8191),q=s[3]+((m>>>7|A<<9)&8191),z=s[4]+((A>>>4|S<<12)&8191),Z=s[5]+(S>>>1&8191),C=s[6]+((S>>>14|B<<2)&8191),N=s[7]+((B>>>11|R<<5)&8191),T=s[8]+((R>>>8|_<<8)&8191),L=s[9]+(_>>>5|i),w=0,P=w+O*a+M*(5*y)+U*(5*p)+q*(5*d)+z*(5*g);w=P>>>13,P&=8191,P+=Z*(5*l)+C*(5*h)+N*(5*u)+T*(5*f)+L*(5*c),w+=P>>>13,P&=8191;let K=w+O*c+M*a+U*(5*y)+q*(5*p)+z*(5*d);w=K>>>13,K&=8191,K+=Z*(5*g)+C*(5*l)+N*(5*h)+T*(5*u)+L*(5*f),w+=K>>>13,K&=8191;let V=w+O*f+M*c+U*a+q*(5*y)+z*(5*p);w=V>>>13,V&=8191,V+=Z*(5*d)+C*(5*g)+N*(5*l)+T*(5*h)+L*(5*u),w+=V>>>13,V&=8191;let W=w+O*u+M*f+U*c+q*a+z*(5*y);w=W>>>13,W&=8191,W+=Z*(5*p)+C*(5*d)+N*(5*g)+T*(5*l)+L*(5*h),w+=W>>>13,W&=8191;let Y=w+O*h+M*u+U*f+q*c+z*a;w=Y>>>13,Y&=8191,Y+=Z*(5*y)+C*(5*p)+N*(5*d)+T*(5*g)+L*(5*l),w+=Y>>>13,Y&=8191;let et=w+O*l+M*h+U*u+q*f+z*c;w=et>>>13,et&=8191,et+=Z*a+C*(5*y)+N*(5*p)+T*(5*d)+L*(5*g),w+=et>>>13,et&=8191;let X=w+O*g+M*l+U*h+q*u+z*f;w=X>>>13,X&=8191,X+=Z*c+C*a+N*(5*y)+T*(5*p)+L*(5*d),w+=X>>>13,X&=8191;let J=w+O*d+M*g+U*l+q*h+z*u;w=J>>>13,J&=8191,J+=Z*f+C*c+N*a+T*(5*y)+L*(5*p),w+=J>>>13,J&=8191;let dt=w+O*p+M*d+U*g+q*l+z*h;w=dt>>>13,dt&=8191,dt+=Z*u+C*f+N*c+T*a+L*(5*y),w+=dt>>>13,dt&=8191;let ut=w+O*y+M*p+U*d+q*g+z*l;w=ut>>>13,ut&=8191,ut+=Z*h+C*u+N*f+T*c+L*a,w+=ut>>>13,ut&=8191,w=(w<<2)+w|0,w=w+P|0,P=w&8191,w=w>>>13,K+=w,s[0]=P,s[1]=K,s[2]=V,s[3]=W,s[4]=Y,s[5]=et,s[6]=X,s[7]=J,s[8]=dt,s[9]=ut}finalize(){let{h:e,pad:r}=this,n=new Uint16Array(10),i=e[1]>>>13;e[1]&=8191;for(let a=2;a<10;a++)e[a]+=i,i=e[a]>>>13,e[a]&=8191;e[0]+=i*5,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,n[0]=e[0]+5,i=n[0]>>>13,n[0]&=8191;for(let a=1;a<10;a++)n[a]=e[a]+i,i=n[a]>>>13,n[a]&=8191;n[9]-=8192;let s=(i^1)-1;for(let a=0;a<10;a++)n[a]&=s;s=~s;for(let a=0;a<10;a++)e[a]=e[a]&s|n[a];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let o=e[0]+r[0];e[0]=o&65535;for(let a=1;a<8;a++)o=(e[a]+r[a]|0)+(o>>>16)|0,e[a]=o&65535}update(e){us(this);let{buffer:r,blockLen:n}=this;e=Zn(e);let i=e.length;for(let s=0;s>>0,e[s++]=n[o]>>>8;return e}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}};function Hu(t){let e=(n,i)=>t(i).update(Zn(n)).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}var Na=Hu(t=>new hs(t));var qu=Yn("expand 16-byte k"),zu=Yn("expand 32-byte k"),Gu=Ae(qu),$u=Ae(zu);function G(t,e){return t<>>32-e}function ls(t){return t.byteOffset%4===0}var Qn=64,Wu=16,ka=2**32-1,Da=new Uint32Array;function Yu(t,e,r,n,i,s,o,a){let c=i.length,f=new Uint8Array(Qn),u=Ae(f),h=ls(i)&&ls(s),l=h?Ae(i):Da,g=h?Ae(s):Da;for(let d=0;d=ka)throw new Error("arx: counter overflow");let p=Math.min(Qn,c-d);if(h&&p===Qn){let y=d/4;if(d%4!==0)throw new Error("arx: invalid block position");for(let x=0,v;x{Cr(a),Cr(c),Cr(f);let l=f.length;if(u||(u=new Uint8Array(l)),Cr(u),Xn(h),h<0||h>=ka)throw new Error("arx: counter overflow");if(u.length0;)g.pop().fill(0);return u}}function Ka(t,e,r,n,i,s=20){let o=t[0],a=t[1],c=t[2],f=t[3],u=e[0],h=e[1],l=e[2],g=e[3],d=e[4],p=e[5],y=e[6],x=e[7],v=i,m=r[0],A=r[1],S=r[2],B=o,R=a,_=c,O=f,M=u,U=h,q=l,z=g,Z=d,C=p,N=y,T=x,L=v,w=m,P=A,K=S;for(let W=0;W{t.update(e);let r=e.length%16;r&&t.update(Ju.subarray(r))},ju=new Uint8Array(32);function Ua(t,e,r,n,i){let s=t(e,r,ju),o=Na.create(s);i&&Pa(o,i),Pa(o,n);let a=new Uint8Array(16),c=Ta(a);cs(c,0,BigInt(i?i.length:0),!0),cs(c,8,BigInt(n.length),!0),o.update(a);let f=o.digest();return s.fill(0),f}var Oa=t=>(e,r,n)=>(rr(e,32),rr(r),{encrypt:(s,o)=>{let a=s.length,c=a+16;o?rr(o,c):o=new Uint8Array(c),t(e,r,s,o,1);let f=Ua(t,e,r,o.subarray(0,-16),n);return o.set(f,a),o},decrypt:(s,o)=>{let a=s.length,c=a-16;if(a<16)throw new Error("encrypted data must be at least 16 bytes");o?rr(o,c):o=new Uint8Array(c);let f=s.subarray(0,-16),u=s.subarray(-16),h=Ua(t,e,r,f,n);if(!La(u,h))throw new Error("invalid tag");return t(e,r,f,o,1),o}}),ps=as({blockSize:64,nonceLength:12,tagLength:16},Oa(Xu)),Zg=as({blockSize:64,nonceLength:24,tagLength:16},Oa(Qu));function Jn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function ys(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function on(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Jn(t.outputLen),Jn(t.blockLen)}function Ir(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ma(t,e){ys(t);let r=e.outputLen;if(t.lengtht instanceof Uint8Array;var ti=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ae=(t,e)=>t<<32-e|t>>>e,th=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!th)throw new Error("Non little-endian hardware is not supported");function gs(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Fe(t){if(typeof t=="string"&&(t=gs(t)),!Fa(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function ei(...t){let e=new Uint8Array(t.reduce((n,i)=>n+i.length,0)),r=0;return t.forEach(n=>{if(!Fa(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}var Tr=class{clone(){return this._cloneInto()}},tx={}.toString;function ri(t){let e=n=>t().update(Fe(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function nr(t=32){if(jn&&typeof jn.getRandomValues=="function")return jn.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function eh(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,f=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+f,a,n)}var _r=class extends Tr{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ti(this.buffer)}update(e){Ir(this);let{view:r,buffer:n,blockLen:i}=this;e=Fe(e);let s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let h=o;hu.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h>xs&ni)}:{h:Number(t>>xs&ni)|0,l:Number(t&ni)|0}}function rh(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),ih=(t,e,r)=>t>>>r,sh=(t,e,r)=>t<<32-r|e>>>r,oh=(t,e,r)=>t>>>r|e<<32-r,ah=(t,e,r)=>t<<32-r|e>>>r,ch=(t,e,r)=>t<<64-r|e>>>r-32,fh=(t,e,r)=>t>>>r-32|e<<64-r,uh=(t,e)=>e,hh=(t,e)=>t,lh=(t,e,r)=>t<>>32-r,dh=(t,e,r)=>e<>>32-r,ph=(t,e,r)=>e<>>64-r,yh=(t,e,r)=>t<>>64-r;function gh(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var xh=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),mh=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,bh=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),vh=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,wh=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Eh=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0;var Sh={fromBig:Va,split:rh,toBig:nh,shrSH:ih,shrSL:sh,rotrSH:oh,rotrSL:ah,rotrBH:ch,rotrBL:fh,rotr32H:uh,rotr32L:hh,rotlSH:lh,rotlSL:dh,rotlBH:ph,rotlBL:yh,add:gh,add3L:xh,add3H:mh,add4L:bh,add4H:vh,add5H:Eh,add5L:wh},j=Sh;var[Bh,Ah]=j.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Ve=new Uint32Array(80),He=new Uint32Array(80),ms=class extends _r{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:f,El:u,Fh:h,Fl:l,Gh:g,Gl:d,Hh:p,Hl:y}=this;return[e,r,n,i,s,o,a,c,f,u,h,l,g,d,p,y]}set(e,r,n,i,s,o,a,c,f,u,h,l,g,d,p,y){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=f|0,this.El=u|0,this.Fh=h|0,this.Fl=l|0,this.Gh=g|0,this.Gl=d|0,this.Hh=p|0,this.Hl=y|0}process(e,r){for(let m=0;m<16;m++,r+=4)Ve[m]=e.getUint32(r),He[m]=e.getUint32(r+=4);for(let m=16;m<80;m++){let A=Ve[m-15]|0,S=He[m-15]|0,B=j.rotrSH(A,S,1)^j.rotrSH(A,S,8)^j.shrSH(A,S,7),R=j.rotrSL(A,S,1)^j.rotrSL(A,S,8)^j.shrSL(A,S,7),_=Ve[m-2]|0,O=He[m-2]|0,M=j.rotrSH(_,O,19)^j.rotrBH(_,O,61)^j.shrSH(_,O,6),U=j.rotrSL(_,O,19)^j.rotrBL(_,O,61)^j.shrSL(_,O,6),q=j.add4L(R,U,He[m-7],He[m-16]),z=j.add4H(q,B,M,Ve[m-7],Ve[m-16]);Ve[m]=z|0,He[m]=q|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:f,Dl:u,Eh:h,El:l,Fh:g,Fl:d,Gh:p,Gl:y,Hh:x,Hl:v}=this;for(let m=0;m<80;m++){let A=j.rotrSH(h,l,14)^j.rotrSH(h,l,18)^j.rotrBH(h,l,41),S=j.rotrSL(h,l,14)^j.rotrSL(h,l,18)^j.rotrBL(h,l,41),B=h&g^~h&p,R=l&d^~l&y,_=j.add5L(v,S,R,Ah[m],He[m]),O=j.add5H(_,x,A,B,Bh[m],Ve[m]),M=_|0,U=j.rotrSH(n,i,28)^j.rotrBH(n,i,34)^j.rotrBH(n,i,39),q=j.rotrSL(n,i,28)^j.rotrBL(n,i,34)^j.rotrBL(n,i,39),z=n&s^n&a^s&a,Z=i&o^i&c^o&c;x=p|0,v=y|0,p=g|0,y=d|0,g=h|0,d=l|0,{h,l}=j.add(f|0,u|0,O|0,M|0),f=a|0,u=c|0,a=s|0,c=o|0,s=n|0,o=i|0;let C=j.add3L(M,q,Z);n=j.add3H(C,O,U,z),i=C|0}({h:n,l:i}=j.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=j.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=j.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:f,l:u}=j.add(this.Dh|0,this.Dl|0,f|0,u|0),{h,l}=j.add(this.Eh|0,this.El|0,h|0,l|0),{h:g,l:d}=j.add(this.Fh|0,this.Fl|0,g|0,d|0),{h:p,l:y}=j.add(this.Gh|0,this.Gl|0,p|0,y|0),{h:x,l:v}=j.add(this.Hh|0,this.Hl|0,x|0,v|0),this.set(n,i,s,o,a,c,f,u,h,l,g,d,p,y,x,v)}roundClean(){Ve.fill(0),He.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var bs=ri(()=>new ms);var oi={};_t(oi,{bitGet:()=>Nh,bitLen:()=>Rh,bitMask:()=>an,bitSet:()=>Dh,bytesToHex:()=>Ce,bytesToNumberBE:()=>Ie,bytesToNumberLE:()=>ce,concatBytes:()=>_e,createHmacDrbg:()=>Es,ensureBytes:()=>yt,equalBytes:()=>_h,hexToBytes:()=>ir,hexToNumber:()=>ws,numberToBytesBE:()=>qe,numberToBytesLE:()=>Te,numberToHexUnpadded:()=>za,numberToVarBytesBE:()=>Th,utf8ToBytes:()=>Lh,validateObject:()=>ee});var qa=BigInt(0),ii=BigInt(1),Ch=BigInt(2),si=t=>t instanceof Uint8Array,Ih=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Ce(t){if(!si(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0)),r=0;return t.forEach(n=>{if(!si(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function _h(t,e){if(t.length!==e.length)return!1;for(let r=0;rqa;t>>=ii,e+=1);return e}function Nh(t,e){return t>>BigInt(e)&ii}var Dh=(t,e,r)=>t|(r?ii:qa)<(Ch<new Uint8Array(t),Ha=t=>Uint8Array.from(t);function Es(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=vs(t),i=vs(t),s=0,o=()=>{n.fill(1),i.fill(0),s=0},a=(...h)=>r(i,n,...h),c=(h=vs())=>{i=a(Ha([0]),h),n=a(),h.length!==0&&(i=a(Ha([1]),h),n=a())},f=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let h=0,l=[];for(;h{o(),c(h);let g;for(;!(g=l(f()));)c();return o(),g}}var kh={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function ee(t,e,r={}){let n=(i,s,o)=>{let a=kh[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);let c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(let[i,s]of Object.entries(e))n(i,s,!1);for(let[i,s]of Object.entries(r))n(i,s,!0);return t}var Tt=BigInt(0),bt=BigInt(1),sr=BigInt(2),Ph=BigInt(3),Ss=BigInt(4),Ga=BigInt(5),$a=BigInt(8),Uh=BigInt(9),Kh=BigInt(16);function at(t,e){let r=t%e;return r>=Tt?r:e+r}function Bs(t,e,r){if(r<=Tt||e 0");if(r===bt)return Tt;let n=bt;for(;e>Tt;)e&bt&&(n=n*t%r),t=t*t%r,e>>=bt;return n}function gt(t,e,r){let n=t;for(;e-- >Tt;)n*=n,n%=r;return n}function ai(t,e){if(t===Tt||e<=Tt)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=at(t,e),n=e,i=Tt,s=bt,o=bt,a=Tt;for(;r!==Tt;){let f=n/r,u=n%r,h=i-o*f,l=s-a*f;n=r,r=u,i=o,s=a,o=h,a=l}if(n!==bt)throw new Error("invert: does not exist");return at(i,e)}function Oh(t){let e=(t-bt)/sr,r,n,i;for(r=t-bt,n=0;r%sr===Tt;r/=sr,n++);for(i=sr;i(at(t,e)&bt)===bt,Fh=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function As(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Fh.reduce((n,i)=>(n[i]="function",n),e);return ee(t,r)}function Vh(t,e,r){if(r 0");if(r===Tt)return t.ONE;if(r===bt)return e;let n=t.ONE,i=e;for(;r>Tt;)r&bt&&(n=t.mul(n,i)),i=t.sqr(i),r>>=bt;return n}function Hh(t,e){let r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function Cs(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function ci(t,e,r=!1,n={}){if(t<=Tt)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:s}=Cs(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=Mh(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:an(i),ZERO:Tt,ONE:bt,create:c=>at(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Tt<=c&&cc===Tt,isOdd:c=>(c&bt)===bt,neg:c=>at(-c,t),eql:(c,f)=>c===f,sqr:c=>at(c*c,t),add:(c,f)=>at(c+f,t),sub:(c,f)=>at(c-f,t),mul:(c,f)=>at(c*f,t),pow:(c,f)=>Vh(a,c,f),div:(c,f)=>at(c*ai(f,t),t),sqrN:c=>c*c,addN:(c,f)=>c+f,subN:(c,f)=>c-f,mulN:(c,f)=>c*f,inv:c=>ai(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>Hh(a,c),cmov:(c,f,u)=>u?f:c,toBytes:c=>r?Te(c,s):qe(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?ce(c):Ie(c)}});return Object.freeze(a)}function Ya(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}function Za(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function Is(t){let e=Za(t);return e+Math.ceil(e/2)}function Xa(t,e,r=!1){let n=t.length,i=Za(e),s=Is(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let o=r?Ie(t):ce(t),a=at(o,e-bt)+bt;return r?Te(a,i):qe(a,i)}var zh=BigInt(0),Ts=BigInt(1);function fi(t,e){let r=(i,s)=>{let o=s.negate();return i?o:s},n=i=>{let s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>zh;)s&Ts&&(o=o.add(a)),a=a.double(),s>>=Ts;return o},precomputeWindow(i,s){let{windows:o,windowSize:a}=n(s),c=[],f=i,u=f;for(let h=0;h>=g,y>c&&(y-=l,o+=Ts);let x=p,v=p+Math.abs(y)-1,m=d%2!==0,A=y<0;y===0?u=u.add(r(m,s[x])):f=f.add(r(A,s[v]))}return{p:f,f:u}},wNAFCached(i,s,o,a){let c=i._WINDOW_SIZE||1,f=s.get(i);return f||(f=this.precomputeWindow(i,c),c!==1&&s.set(i,a(f))),this.wNAF(c,f,o)}}}function cn(t){return As(t.Fp),ee(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Cs(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var fe=BigInt(0),Qt=BigInt(1),ui=BigInt(2),Gh=BigInt(8),$h={zip215:!0};function Wh(t){let e=cn(t);return ee(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function hi(t){let e=Wh(t),{Fp:r,n,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,f=ui<{try{return{isValid:!0,value:r.sqrt(L*r.inv(w))}}catch{return{isValid:!1,value:fe}}}),l=e.adjustScalarBytes||(L=>L),g=e.domain||((L,w,P)=>{if(w.length||P)throw new Error("Contexts/pre-hash are not supported");return L}),d=L=>typeof L=="bigint"&&fed(L)&&d(w)&&LL===fe||p(L,f);function x(L,w){if(p(L,w))return L;throw new Error(`Expected valid scalar < ${w}, got ${typeof L} ${L}`)}function v(L){return L===fe?L:x(L,n)}let m=new Map;function A(L){if(!(L instanceof S))throw new Error("ExtendedPoint expected")}class S{constructor(w,P,K,V){if(this.ex=w,this.ey=P,this.ez=K,this.et=V,!y(w))throw new Error("x required");if(!y(P))throw new Error("y required");if(!y(K))throw new Error("z required");if(!y(V))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(w){if(w instanceof S)throw new Error("extended point not allowed");let{x:P,y:K}=w||{};if(!y(P)||!y(K))throw new Error("invalid affine point");return new S(P,K,Qt,u(P*K))}static normalizeZ(w){let P=r.invertBatch(w.map(K=>K.ez));return w.map((K,V)=>K.toAffine(P[V])).map(S.fromAffine)}_setWindowSize(w){this._WINDOW_SIZE=w,m.delete(this)}assertValidity(){let{a:w,d:P}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:K,ey:V,ez:W,et:Y}=this,et=u(K*K),X=u(V*V),J=u(W*W),dt=u(J*J),ut=u(et*w),Ut=u(J*u(ut+X)),Kt=u(dt+u(P*u(et*X)));if(Ut!==Kt)throw new Error("bad point: equation left != right (1)");let Ct=u(K*V),Vt=u(W*Y);if(Ct!==Vt)throw new Error("bad point: equation left != right (2)")}equals(w){A(w);let{ex:P,ey:K,ez:V}=this,{ex:W,ey:Y,ez:et}=w,X=u(P*et),J=u(W*V),dt=u(K*et),ut=u(Y*V);return X===J&&dt===ut}is0(){return this.equals(S.ZERO)}negate(){return new S(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:w}=e,{ex:P,ey:K,ez:V}=this,W=u(P*P),Y=u(K*K),et=u(ui*u(V*V)),X=u(w*W),J=P+K,dt=u(u(J*J)-W-Y),ut=X+Y,Ut=ut-et,Kt=X-Y,Ct=u(dt*Ut),Vt=u(ut*Kt),Se=u(dt*Kt),tr=u(Ut*ut);return new S(Ct,Vt,tr,Se)}add(w){A(w);let{a:P,d:K}=e,{ex:V,ey:W,ez:Y,et}=this,{ex:X,ey:J,ez:dt,et:ut}=w;if(P===BigInt(-1)){let ia=u((W-V)*(J+X)),sa=u((W+V)*(J-X)),Yi=u(sa-ia);if(Yi===fe)return this.double();let oa=u(Y*ui*ut),aa=u(et*ui*dt),ca=aa+oa,fa=sa+ia,ua=aa-oa,du=u(ca*Yi),pu=u(fa*ua),yu=u(ca*ua),gu=u(Yi*fa);return new S(du,pu,gu,yu)}let Ut=u(V*X),Kt=u(W*J),Ct=u(et*K*ut),Vt=u(Y*dt),Se=u((V+W)*(X+J)-Ut-Kt),tr=Vt-Ct,rn=Vt+Ct,na=u(Kt-P*Ut),fu=u(Se*tr),uu=u(rn*na),hu=u(Se*na),lu=u(tr*rn);return new S(fu,uu,lu,hu)}subtract(w){return this.add(w.negate())}wNAF(w){return _.wNAFCached(this,m,w,S.normalizeZ)}multiply(w){let{p:P,f:K}=this.wNAF(x(w,n));return S.normalizeZ([P,K])[0]}multiplyUnsafe(w){let P=v(w);return P===fe?R:this.equals(R)||P===Qt?this:this.equals(B)?this.wNAF(P).p:_.unsafeLadder(this,P)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return _.unsafeLadder(this,n).is0()}toAffine(w){let{ex:P,ey:K,ez:V}=this,W=this.is0();w==null&&(w=W?Gh:r.inv(V));let Y=u(P*w),et=u(K*w),X=u(V*w);if(W)return{x:fe,y:Qt};if(X!==Qt)throw new Error("invZ was invalid");return{x:Y,y:et}}clearCofactor(){let{h:w}=e;return w===Qt?this:this.multiplyUnsafe(w)}static fromHex(w,P=!1){let{d:K,a:V}=e,W=r.BYTES;w=yt("pointHex",w,W);let Y=w.slice(),et=w[W-1];Y[W-1]=et&-129;let X=ce(Y);X===fe||(P?x(X,f):x(X,r.ORDER));let J=u(X*X),dt=u(J-Qt),ut=u(K*J-V),{isValid:Ut,value:Kt}=h(dt,ut);if(!Ut)throw new Error("Point.fromHex: invalid y coordinate");let Ct=(Kt&Qt)===Qt,Vt=(et&128)!==0;if(!P&&Kt===fe&&Vt)throw new Error("Point.fromHex: x=0 and x_0=1");return Vt!==Ct&&(Kt=u(-Kt)),S.fromAffine({x:Kt,y:X})}static fromPrivateKey(w){return U(w).point}toRawBytes(){let{x:w,y:P}=this.toAffine(),K=Te(P,r.BYTES);return K[K.length-1]|=w&Qt?128:0,K}toHex(){return Ce(this.toRawBytes())}}S.BASE=new S(e.Gx,e.Gy,Qt,u(e.Gx*e.Gy)),S.ZERO=new S(fe,Qt,Qt,fe);let{BASE:B,ZERO:R}=S,_=fi(S,a*8);function O(L){return at(L,n)}function M(L){return O(ce(L))}function U(L){let w=a;L=yt("private key",L,w);let P=yt("hashed private key",s(L),2*w),K=l(P.slice(0,w)),V=P.slice(w,2*w),W=M(K),Y=B.multiply(W),et=Y.toRawBytes();return{head:K,prefix:V,scalar:W,point:Y,pointBytes:et}}function q(L){return U(L).pointBytes}function z(L=new Uint8Array,...w){let P=_e(...w);return M(s(g(P,yt("context",L),!!i)))}function Z(L,w,P={}){L=yt("message",L),i&&(L=i(L));let{prefix:K,scalar:V,pointBytes:W}=U(w),Y=z(P.context,K,L),et=B.multiply(Y).toRawBytes(),X=z(P.context,et,W,L),J=O(Y+X*V);v(J);let dt=_e(et,Te(J,r.BYTES));return yt("result",dt,a*2)}let C=$h;function N(L,w,P,K=C){let{context:V,zip215:W}=K,Y=r.BYTES;L=yt("signature",L,2*Y),w=yt("message",w),i&&(w=i(w));let et=ce(L.slice(Y,2*Y)),X,J,dt;try{X=S.fromHex(P,W),J=S.fromHex(L.slice(0,Y),W),dt=B.multiplyUnsafe(et)}catch{return!1}if(!W&&X.isSmallOrder())return!1;let ut=z(V,J.toRawBytes(),X.toRawBytes(),w);return J.add(X.multiplyUnsafe(ut)).subtract(dt).clearCofactor().equals(S.ZERO)}return B._setWindowSize(8),{CURVE:e,getPublicKey:q,sign:Z,verify:N,ExtendedPoint:S,utils:{getExtendedPublicKey:U,randomPrivateKey:()=>o(r.BYTES),precompute(L=8,w=S.BASE){return w._setWindowSize(L),w.multiply(BigInt(3)),w}}}}var fn=BigInt(0),_s=BigInt(1);function Yh(t){return ee(t,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...t})}function Qa(t){let e=Yh(t),{P:r}=e,n=m=>at(m,r),i=e.montgomeryBits,s=Math.ceil(i/8),o=e.nByteLength,a=e.adjustScalarBytes||(m=>m),c=e.powPminus2||(m=>Bs(m,r-BigInt(2),r));function f(m,A,S){let B=n(m*(A-S));return A=n(A-B),S=n(S+B),[A,S]}function u(m){if(typeof m=="bigint"&&fn<=m&&m=fn;C--){let N=B>>C&_s;q^=N,z=f(q,_,M),_=z[0],M=z[1],z=f(q,O,U),O=z[0],U=z[1],q=N;let T=_+O,L=n(T*T),w=_-O,P=n(w*w),K=L-P,V=M+U,W=M-U,Y=n(W*T),et=n(V*w),X=Y+et,J=Y-et;M=n(X*X),U=n(R*n(J*J)),_=n(L*P),O=n(K*(L+n(h*K)))}z=f(q,_,M),_=z[0],M=z[1],z=f(q,O,U),O=z[0],U=z[1];let Z=c(O);return n(_*Z)}function g(m){return Te(n(m),s)}function d(m){let A=yt("u coordinate",m,s);return o===s&&(A[o-1]&=127),ce(A)}function p(m){let A=yt("scalar",m);if(A.length!==s&&A.length!==o)throw new Error(`Expected ${s} or ${o} bytes, got ${A.length}`);return ce(a(A))}function y(m,A){let S=d(A),B=p(m),R=l(S,B);if(R===fn)throw new Error("Invalid private or public key received");return g(R)}let x=g(e.Gu);function v(m){return y(m,x)}return{scalarMult:y,scalarMultBase:v,getSharedSecret:(m,A)=>y(m,A),getPublicKey:m=>v(m),utils:{randomPrivateKey:()=>e.randomBytes(e.nByteLength)},GuBytes:x}}var un=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Ja=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),Cx=BigInt(0),Zh=BigInt(1),Ls=BigInt(2),Xh=BigInt(5),ja=BigInt(10),Qh=BigInt(20),Jh=BigInt(40),t0=BigInt(80);function e0(t){let e=un,n=t*t%e*t%e,i=gt(n,Ls,e)*n%e,s=gt(i,Zh,e)*t%e,o=gt(s,Xh,e)*s%e,a=gt(o,ja,e)*o%e,c=gt(a,Qh,e)*a%e,f=gt(c,Jh,e)*c%e,u=gt(f,t0,e)*f%e,h=gt(u,t0,e)*f%e,l=gt(h,ja,e)*o%e;return{pow_p_5_8:gt(l,Ls,e)*t%e,b2:n}}function r0(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function jh(t,e){let r=un,n=at(e*e*e,r),i=at(n*n*e,r),s=e0(t*i).pow_p_5_8,o=at(t*n*s,r),a=at(e*o*o,r),c=o,f=at(o*Ja,r),u=a===t,h=a===at(-t,r),l=a===at(-t*Ja,r);return u&&(o=c),(h||l)&&(o=f),Wa(o,r)&&(o=at(-o,r)),{isValid:u||h,value:o}}var Le=ci(un,void 0,!0),Rs={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Le,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:bs,randomBytes:nr,adjustScalarBytes:r0,uvRatio:jh},Lr=hi(Rs);function n0(t,e,r){if(e.length>255)throw new Error("Context is too big");return ei(gs("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,e.length]),e,t)}var Ix=hi({...Rs,domain:n0}),Tx=hi({...Rs,domain:n0,prehash:bs}),hn=Qa({P:un,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:t=>{let e=un,{pow_p_5_8:r,b2:n}=e0(t);return at(gt(r,BigInt(3),e)*n,e)},adjustScalarBytes:r0,randomBytes:nr});var tl=(Le.ORDER+BigInt(3))/BigInt(8),_x=Le.pow(Ls,tl),Lx=Le.sqrt(Le.neg(Le.ONE)),Rx=(Le.ORDER-BigInt(5))/BigInt(8),Nx=BigInt(486662);var Dx=Ya(Le,Le.neg(BigInt(486664)));var kx=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Px=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Ux=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Kx=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var Ox=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var li=class extends Tr{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,on(e);let n=Fe(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew li(t,e).update(r).digest();Rr.create=(t,e)=>new li(t,e);function s0(t,e,r){return on(t),r===void 0&&(r=new Uint8Array(t.outputLen)),Rr(t,Fe(r),Fe(e))}var Ns=new Uint8Array([0]),i0=new Uint8Array;function o0(t,e,r,n=32){if(on(t),Jn(n),n>255*t.outputLen)throw new Error("Length should be <= 255*HashLen");let i=Math.ceil(n/t.outputLen);r===void 0&&(r=i0);let s=new Uint8Array(i*t.outputLen),o=Rr.create(t,e),a=o._cloneInto(),c=new Uint8Array(o.outputLen);for(let f=0;ft&e^~t&r,rl=(t,e,r)=>t&e^t&r^e&r,nl=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ze=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ge=new Uint32Array(64),Ds=class extends _r{constructor(){super(64,32,8,!1),this.A=ze[0]|0,this.B=ze[1]|0,this.C=ze[2]|0,this.D=ze[3]|0,this.E=ze[4]|0,this.F=ze[5]|0,this.G=ze[6]|0,this.H=ze[7]|0}get(){let{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let h=0;h<16;h++,r+=4)Ge[h]=e.getUint32(r,!1);for(let h=16;h<64;h++){let l=Ge[h-15],g=Ge[h-2],d=ae(l,7)^ae(l,18)^l>>>3,p=ae(g,17)^ae(g,19)^g>>>10;Ge[h]=p+Ge[h-7]+d+Ge[h-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:f,H:u}=this;for(let h=0;h<64;h++){let l=ae(a,6)^ae(a,11)^ae(a,25),g=u+l+el(a,c,f)+nl[h]+Ge[h]|0,p=(ae(n,2)^ae(n,13)^ae(n,22))+rl(n,i,s)|0;u=f,f=c,c=a,a=o+g|0,o=s,s=i,i=n,n=g+p|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,f=f+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,f,u)}roundClean(){Ge.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Nr=ri(()=>new Ds);var di={hashSHA256(t){return Nr(t)},getHKDF(t,e){let r=s0(Nr,e,t),i=o0(Nr,r,void 0,96),s=i.subarray(0,32),o=i.subarray(32,64),a=i.subarray(64,96);return[s,o,a]},generateX25519KeyPair(){let t=hn.utils.randomPrivateKey();return{publicKey:hn.getPublicKey(t),privateKey:t}},generateX25519KeyPairFromSeed(t){return{publicKey:hn.getPublicKey(t),privateKey:t}},generateX25519SharedKey(t,e){return hn.getSharedSecret(t,e)},chaCha20Poly1305Encrypt(t,e,r,n){return ps(n,e,r).encrypt(t)},chaCha20Poly1305Decrypt(t,e,r,n,i){return ps(n,e,r).decrypt(t,i)}};var a0=di;var Dr=t=>{let e=It(2);return new DataView(e.buffer,e.byteOffset,e.byteLength).setUint16(0,t,!1),e};Dr.bytes=2;var ln=t=>{if(t.length<2)throw RangeError("Could not decode int16BE");return t instanceof Uint8Array?new DataView(t.buffer,t.byteOffset,t.byteLength).getUint16(0,!1):t.getUint16(0)};ln.bytes=2;function c0(t){return new Rt(t.ne,t.ciphertext)}function f0(t){return new Rt(t.ne,t.ns,t.ciphertext)}function u0(t){return new Rt(t.ns,t.ciphertext)}function h0(t){if(t.length<32)throw new Error("Cannot decode stage 0 MessageBuffer: length less than 32 bytes.");return{ne:t.subarray(0,32),ciphertext:t.subarray(32,t.length),ns:rt(0)}}function l0(t){if(t.length<80)throw new Error("Cannot decode stage 1 MessageBuffer: length less than 80 bytes.");return{ne:t.subarray(0,32),ns:t.subarray(32,80),ciphertext:t.subarray(80,t.length)}}function d0(t){if(t.length<48)throw new Error("Cannot decode stage 2 MessageBuffer: length less than 48 bytes.");return{ne:rt(0),ns:t.subarray(0,48),ciphertext:t.subarray(48,t.length)}}var y0=16;function g0(t,e){return async function*(r){for await(let n of r)for(let i=0;in.length&&(s=n.length);let o=t.encrypt(n.subarray(i,s),t.session);e?.encryptedPackets.increment(),yield new Rt(Dr(o.byteLength),o)}}}function x0(t,e){return async function*(r){for await(let n of r)for(let i=0;in.length&&(s=n.length),s-y0Dp});function Tp(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,A=new Uint8Array(m);x!==v;){for(var S=d[x],B=0,R=m-1;(S!==0||B>>0,A[R]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");y=B,x++}for(var _=m-y;_!==m&&A[_]===0;)_++;for(var O=c.repeat(p);_>>0,m=new Uint8Array(v);d[p];){var A=r[d.charCodeAt(p)];if(A===255)return;for(var S=0,B=v-1;(A!==0||S>>0,m[B]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");x=S,p++}if(d[p]!==" "){for(var R=v-x;R!==v&&m[R]===0;)R++;for(var _=new Uint8Array(y+(v-R)),O=y;R!==v;)_[O++]=m[R++];return _}}}function g(d){var p=l(d);if(p)return p;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:l,decode:g}}var _p=Tp,Lp=_p,kc=Lp;var K2=new Uint8Array(0);var Pc=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var Uc=t=>new TextEncoder().encode(t),Kc=t=>new TextDecoder().decode(t);var ro=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},no=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Mc(this,e)}},io=class{constructor(e){this.decoders=e}or(e){return Mc(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Mc=(t,e)=>new io({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),so=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ro(e,r,n),this.decoder=new no(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Or=({name:t,prefix:e,encode:r,decode:n})=>new so(t,e,r,n),Xe=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=kc(r,e);return Or({prefix:t,name:e,encode:n,decode:s=>ke(i(s))})},Rp=(t,e,r,n)=>{let i={};for(let u=0;u=8&&(a-=8,o[f++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},Np=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<Or({prefix:e,name:t,encode(i){return Np(i,n,r)},decode(i){return Rp(i,n,r,t)}});var Dp=Xe({prefix:"9",name:"base10",alphabet:"0123456789"});var ao={};_t(ao,{base16:()=>kp,base16upper:()=>Pp});var kp=St({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Pp=St({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var co={};_t(co,{base2:()=>Up});var Up=St({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var fo={};_t(fo,{base256emoji:()=>Vp});var Fc=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Kp=Fc.reduce((t,e,r)=>(t[r]=e,t),[]),Op=Fc.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Mp(t){return t.reduce((e,r)=>(e+=Kp[r],e),"")}function Fp(t){let e=[];for(let r of t){let n=Op[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var Vp=Or({prefix:"\u{1F680}",name:"base256emoji",encode:Mp,decode:Fp});var uo={};_t(uo,{base32:()=>Qe,base32hex:()=>Gp,base32hexpad:()=>Wp,base32hexpadupper:()=>Yp,base32hexupper:()=>$p,base32pad:()=>qp,base32padupper:()=>zp,base32upper:()=>Hp,base32z:()=>Zp});var Qe=St({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Hp=St({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),qp=St({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),zp=St({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Gp=St({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),$p=St({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Wp=St({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Yp=St({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Zp=St({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ho={};_t(ho,{base36:()=>Xp,base36upper:()=>Qp});var Xp=Xe({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Qp=Xe({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var lo={};_t(lo,{base58btc:()=>Mt,base58flickr:()=>Jp});var Mt=Xe({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Jp=Xe({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var po={};_t(po,{base64:()=>Mr,base64pad:()=>jp,base64url:()=>ty,base64urlpad:()=>ey});var Mr=St({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),jp=St({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ty=St({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ey=St({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var yo={};_t(yo,{base8:()=>ry});var ry=St({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var go={};_t(go,{identity:()=>ny});var ny=Or({prefix:"\0",name:"identity",encode:t=>Kc(t),decode:t=>Uc(t)});var J2=new TextEncoder,j2=new TextDecoder;var mo={};_t(mo,{identity:()=>Je});var oy=qc,Vc=128,ay=127,cy=~ay,fy=Math.pow(2,31);function qc(t,e,r){e=e||[],r=r||0;for(var n=r;t>=fy;)e[r++]=t&255|Vc,t/=128;for(;t&cy;)e[r++]=t&255|Vc,t>>>=7;return e[r]=t|0,qc.bytes=r-n+1,e}var uy=xo,hy=128,Hc=127;function xo(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw xo.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&Hc)<=hy);return xo.bytes=s-n,r}var ly=Math.pow(2,7),dy=Math.pow(2,14),py=Math.pow(2,21),yy=Math.pow(2,28),gy=Math.pow(2,35),xy=Math.pow(2,42),my=Math.pow(2,49),by=Math.pow(2,56),vy=Math.pow(2,63),wy=function(t){return t[wn.decode(t,e),wn.decode.bytes],Fr=(t,e,r=0)=>(wn.encode(t,e,r),e),Vr=t=>wn.encodingLength(t);var ve=(t,e)=>{let r=e.byteLength,n=Vr(t),i=n+Vr(r),s=new Uint8Array(i+r);return Fr(t,s,0),Fr(r,s,n),s.set(e,i),new Hr(t,r,e,s)},Sn=t=>{let e=ke(t),[r,n]=En(e),[i,s]=En(e.subarray(n)),o=e.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new Hr(r,i,o,e)},zc=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&Pc(t.bytes,r.bytes)}},Hr=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var Gc=0,By="identity",$c=ke,Ay=t=>ve(Gc,$c(t)),Je={code:Gc,name:By,encode:$c,digest:Ay};var wo={};_t(wo,{sha256:()=>Ft,sha512:()=>Cy});var vo=({name:t,code:e,encode:r})=>new bo(t,e,r),bo=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?ve(this.code,r):r.then(n=>ve(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Yc=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Ft=vo({name:"sha2-256",code:18,encode:Yc("SHA-256")}),Cy=vo({name:"sha2-512",code:19,encode:Yc("SHA-512")});var Zc=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return Ty(r,Eo(t),e||Mt.encoder);default:return _y(r,Eo(t),e||Qe.encoder)}};var Xc=new WeakMap,Eo=t=>{let e=Xc.get(t);if(e==null){let r=new Map;return Xc.set(t,r),r}return e},lr=class t{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==Bn)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Ly)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=ve(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&zc(e.multihash,n.multihash)}toString(e){return Zc(this,e)}toJSON(){return{"/":Zc(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new t(n,i,s,o||Qc(n,i,s.bytes))}else if(r[Ry]===!0){let{version:n,multihash:i,code:s}=r,o=Sn(i);return t.create(n,s,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==Bn)throw new Error(`Version 0 CID must use dag-pb (code: ${Bn}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=Qc(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,Bn,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=ke(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new Hr(r.multihashCode,r.digestSize,s,i);return[r.version===0?t.createV0(o):t.createV1(r.codec,o),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,l]=En(e.subarray(r));return r+=l,h},i=n(),s=Bn;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),c=n(),f=r+c,u=f-o;return{version:i,codec:s,multihashCode:a,digestSize:c,multihashSize:u,size:f}}static parse(e,r){let[n,i]=Iy(e,r),s=t.decode(i);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Eo(s).set(n,e),s}},Iy=(t,e)=>{switch(t[0]){case"Q":{let r=e||Mt;return[Mt.prefix,r.decode(`${Mt.prefix}${t}`)]}case Mt.prefix:{let r=e||Mt;return[Mt.prefix,r.decode(t)]}case Qe.prefix:{let r=e||Qe;return[Qe.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},Ty=(t,e,r)=>{let{prefix:n}=r;if(n!==Mt.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let s=r.encode(t).slice(1);return e.set(n,s),s}else return i},_y=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let s=r.encode(t);return e.set(n,s),s}else return i},Bn=112,Ly=18,Qc=(t,e,r)=>{let n=Vr(t),i=n+Vr(e),s=new Uint8Array(i+r.byteLength);return Fr(t,s,0),Fr(e,s,n),s.set(r,i),s},Ry=Symbol.for("@ipld/js-cid/CID");var zr={...go,...co,...yo,...oo,...ao,...uo,...ho,...lo,...po,...fo},ym={...wo,...mo};function jc(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var Jc=jc("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),So=jc("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);let e=It(t.length);for(let r=0;rmr,Ed25519PublicKey:()=>Tn,generateKeyPair:()=>zy,generateKeyPairFromSeed:()=>yf,unmarshalEd25519PrivateKey:()=>Hy,unmarshalEd25519PublicKey:()=>qy});var Gr=32,Pe=64,ki=32;async function tf(){let t=Lr.utils.randomPrivateKey(),e=Lr.getPublicKey(t);return{privateKey:sf(t,e),publicKey:e}}async function ef(t){if(t.length!==ki)throw new TypeError('"seed" must be 32 bytes in length.');if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');let e=t,r=Lr.getPublicKey(e);return{privateKey:sf(e,r),publicKey:r}}async function rf(t,e){let r=t.subarray(0,ki);return Lr.sign(e,r)}async function nf(t,e,r){return Lr.verify(e,r,t)}function sf(t,e){let r=new Uint8Array(Pe);for(let n=0;n>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return dr;if(ePy)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,i=e-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>hf&&(i=0n,++n>hf&&(n=0n))),new t(Number(i),Number(n))}static fromNumber(e){if(e===0)return dr;let r=e<0;r&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new t(n,i)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):dr}},dr=new Xt(0,0);dr.toBigInt=function(){return 0n};dr.zzEncode=dr.zzDecode=function(){return this};dr.length=function(){return 1};var hf=4294967296n;function lf(t){let e=0,r=0;for(let n=0;n191&&a<224?s[o++]=(a&31)<<6|t[e++]&63:a>239&&a<365?(a=((a&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,s[o++]=55296+(a>>10),s[o++]=56320+(a&1023)):s[o++]=(a&15)<<12|(t[e++]&63)<<6|t[e++]&63,o>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,s)),o=0);return i!=null?(o>0&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))}function To(t,e,r){let n=r,i,s;for(let o=0;o>6|192,e[r++]=i&63|128):(i&64512)===55296&&((s=t.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(s&1023),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128);return r-n}function le(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Pi(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var _o=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,le(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw le(this,4);return Pi(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw le(this,4);return Pi(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw le(this,4);let e=cf(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw le(this,4);let e=uf(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw le(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return df(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw le(this,e);this.pos+=e}else do if(this.pos>=this.len)throw le(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Xt(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw le(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw le(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw le(this,8);let e=Pi(this.buf,this.pos+=4),r=Pi(this.buf,this.pos+=4);return new Xt(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Lo(t){return new _o(t instanceof Uint8Array?t:t.subarray())}function pr(t,e){let r=Lo(t);return e.decode(r)}function Ro(t){let e=t??8192,r=e>>>1,n,i=e;return function(o){if(o<1||o>r)return It(o);i+o>e&&(n=It(e),i=0);let a=n.subarray(i,i+=o);return i&7&&(i=(i|7)+1),a}}var yr=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function No(){}var ko=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},Uy=Ro();function Ky(t){return globalThis.Buffer!=null?It(t):Uy(t)}var In=class{len;head;tail;states;constructor(){this.len=0,this.head=new yr(No,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new yr(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new Po((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(An,10,Xt.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=Xt.fromBigInt(e);return this._push(An,r.length(),r)}uint64Number(e){let r=Xt.fromNumber(e);return this._push(An,r.length(),r)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=Xt.fromBigInt(e).zzEncode();return this._push(An,r.length(),r)}sint64Number(e){let r=Xt.fromNumber(e).zzEncode();return this._push(An,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(Do,1,e?1:0)}fixed32(e){return this._push(Cn,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=Xt.fromBigInt(e);return this._push(Cn,4,r.lo)._push(Cn,4,r.hi)}fixed64Number(e){let r=Xt.fromNumber(e);return this._push(Cn,4,r.lo)._push(Cn,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(af,4,e)}double(e){return this._push(ff,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(Do,1,0):this.uint32(r)._push(My,r,e)}string(e){let r=lf(e);return r!==0?this.uint32(r)._push(To,r,e):this._push(Do,1,0)}fork(){return this.states=new ko(this),this.head=this.tail=new yr(No,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new yr(No,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=Ky(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function Do(t,e,r){e[r]=t&255}function Oy(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var Po=class extends yr{next;constructor(e,r){super(Oy,e,r),this.next=void 0}};function An(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function Cn(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function My(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(In.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(Fy,e,t),this},In.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(Vy,e,t),this});function Fy(t,e,r){e.set(t,r)}function Vy(t,e,r){t.length<40?To(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(At(t),r)}function Uo(){return new In}function gr(t,e){let r=Uo();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var Wr;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(Wr||(Wr={}));function Ui(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function Ko(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(s,o){let a=e(s);o.int32(a)},n=function(s){let o=s.int32();return e(o)};return Ui("enum",Wr.VARINT,r,n)}function xr(t,e){return Ui("message",Wr.LENGTH_DELIMITED,t,e)}var wt;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.Secp256k1="Secp256k1"})(wt||(wt={}));var Oo;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.Secp256k1=2]="Secp256k1"})(Oo||(Oo={}));(function(t){t.codec=()=>Ko(Oo)})(wt||(wt={}));var we;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),wt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=wt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(we||(we={}));var Ee;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),wt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=wt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Ee||(Ee={}));var Tn=class{_key;constructor(e){this._key=Yr(e,Gr)}async verify(e,r){return nf(this._key,r,e)}marshal(){return this._key}get bytes(){return we.encode({Type:wt.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},mr=class{_key;_publicKey;constructor(e,r){this._key=Yr(e,Pe),this._publicKey=Yr(r,Gr)}async sign(e){return rf(this._key,e)}get public(){return new Tn(this._publicKey)}marshal(){return this._key}get bytes(){return Ee.encode({Type:wt.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=Je.digest(this.public.bytes);return Mt.encode(e.bytes).substring(1)}async export(e,r="libp2p-key"){if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function Hy(t){if(t.length>Pe){t=Yr(t,Pe+Gr);let n=t.subarray(0,Pe),i=t.subarray(Pe,t.length);return new mr(n,i)}t=Yr(t,Pe);let e=t.subarray(0,Pe),r=t.subarray(Gr);return new mr(e,r)}function qy(t){return t=Yr(t,Gr),new Tn(t)}async function zy(){let{privateKey:t,publicKey:e}=await tf();return new mr(t,e)}async function yf(t){let{privateKey:e,publicKey:r}=await ef(t);return new mr(e,r)}function Yr(t,e){if(t=Uint8Array.from(t??[]),t.length!==e)throw new it(`Key must be a Uint8Array of length ${e}, got ${t.length}`,"ERR_INVALID_KEY_TYPE");return t}function Et(t,e="utf8"){let r=Di[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var pb=zt(Bt(),1),yb=zt(Ti(),1),gf=zt(lt(),1);function de(t,e){let r=Uint8Array.from(t.abs().toByteArray());if(r=r[0]===0?r.subarray(1):r,e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Gt([new Uint8Array(e-r.length),r])}return Et(r,"base64url")}function Jt(t){let e=xf(t);return new gf.default.jsbn.BigInteger(Et(e,"base16"),16)}function xf(t,e){let r=At(t,"base64urlpad");if(e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Gt([new Uint8Array(e-r.length),r])}return r}var Gy={"P-256":256,"P-384":384,"P-521":521},$y=Object.keys(Gy),Cb=$y.join(" / ");var zo={};_t(zo,{MAX_KEY_SIZE:()=>Nn,RsaPrivateKey:()=>Zr,RsaPublicKey:()=>Rn,fromJwk:()=>n1,generateKeyPair:()=>i1,unmarshalRsaPrivateKey:()=>e1,unmarshalRsaPublicKey:()=>r1});var Ln=zt(lt(),1);var uv=zt(Ef(),1);function Oi(t){if(isNaN(t)||t<=0)throw new it("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return nr(t)}var $b=zt(Ri(),1),Ho=zt(lt(),1);function Sf(t,e){return e.map(r=>Jt(t[r]))}function Bf(t){return Ho.default.pki.setRsaPrivateKey(...Sf(t,["n","e","d","p","q","dp","dq","qi"]))}function Af(t){return Ho.default.pki.setRsaPublicKey(...Sf(t,["n","e"]))}var vr={};_t(vr,{jwkToPkcs1:()=>Xy,jwkToPkix:()=>Jy,pkcs1ToJwk:()=>Zy,pkixToJwk:()=>Qy});var Zb=zt(mn(),1),Xb=zt(Ri(),1);var Ue=zt(lt(),1);function Zy(t){let e=Ue.default.asn1.fromDer(Et(t,"ascii")),r=Ue.default.pki.privateKeyFromAsn1(e);return{kty:"RSA",n:de(r.n),e:de(r.e),d:de(r.d),p:de(r.p),q:de(r.q),dp:de(r.dP),dq:de(r.dQ),qi:de(r.qInv),alg:"RS256"}}function Xy(t){if(t.n==null||t.e==null||t.d==null||t.p==null||t.q==null||t.dp==null||t.dq==null||t.qi==null)throw new it("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ue.default.pki.privateKeyToAsn1({n:Jt(t.n),e:Jt(t.e),d:Jt(t.d),p:Jt(t.p),q:Jt(t.q),dP:Jt(t.dp),dQ:Jt(t.dq),qInv:Jt(t.qi)});return At(Ue.default.asn1.toDer(e).getBytes(),"ascii")}function Qy(t){let e=Ue.default.asn1.fromDer(Et(t,"ascii")),r=Ue.default.pki.publicKeyFromAsn1(e);return{kty:"RSA",n:de(r.n),e:de(r.e)}}function Jy(t){if(t.n==null||t.e==null)throw new it("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ue.default.pki.publicKeyToAsn1({n:Jt(t.n),e:Jt(t.e)});return At(Ue.default.asn1.toDer(e).getBytes(),"ascii")}async function Cf(t){let e=await Zt.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await _f(e);return{privateKey:r[0],publicKey:r[1]}}async function qo(t){let r=[await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await jy(t)],n=await _f({privateKey:r[0],publicKey:r[1]});return{privateKey:n[0],publicKey:n[1]}}async function If(t,e){let r=await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),n=await Zt.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(e));return new Uint8Array(n,0,n.byteLength)}async function Tf(t,e,r){let n=await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return Zt.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},n,e,r)}async function _f(t){if(t.privateKey==null||t.publicKey==null)throw new it("Private and public key are required","ERR_INVALID_PARAMETERS");return Promise.all([Zt.get().subtle.exportKey("jwk",t.privateKey),Zt.get().subtle.exportKey("jwk",t.publicKey)])}async function jy(t){return Zt.get().subtle.importKey("jwk",{kty:t.kty,n:t.n,e:t.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}function Lf(t,e,r,n){let i=e?Af(t):Bf(t),s=Et(Uint8Array.from(r),"ascii"),o=n(s,i);return At(o,"ascii")}function Rf(t,e){return Lf(t,!0,e,(r,n)=>n.encrypt(r))}function Nf(t,e){return Lf(t,!1,e,(r,n)=>n.decrypt(r))}function Mi(t){if(t.kty!=="RSA")throw new it("invalid key type","ERR_INVALID_KEY_TYPE");if(t.n==null)throw new it("invalid key modulus","ERR_INVALID_KEY_MODULUS");return At(t.n,"base64url").length*8}var Nn=8192,Rn=class{_key;constructor(e){this._key=e}async verify(e,r){return Tf(this._key,r,e)}marshal(){return vr.jwkToPkix(this._key)}get bytes(){return we.encode({Type:wt.RSA,Data:this.marshal()}).subarray()}encrypt(e){return Rf(this._key,e)}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},Zr=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r}genSecret(){return Oi(16)}async sign(e){return If(this._key,e)}get public(){if(this._publicKey==null)throw new it("public key not provided","ERR_PUBKEY_NOT_PROVIDED");return new Rn(this._publicKey)}decrypt(e){return Nf(this._key,e)}marshal(){return vr.jwkToPkcs1(this._key)}get bytes(){return Ee.encode({Type:wt.RSA,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=await this.public.hash();return Et(e,"base58btc")}async export(e,r="pkcs-8"){if(r==="pkcs-8"){let n=new Ln.default.util.ByteBuffer(this.marshal()),i=Ln.default.asn1.fromDer(n),s=Ln.default.pki.privateKeyFromAsn1(i),o={algorithm:"aes256",count:1e4,saltSize:128/8,prfAlgorithm:"sha512"};return Ln.default.pki.encryptRsaPrivateKey(s,e,o)}else{if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}}};async function e1(t){let e=vr.pkcs1ToJwk(t);if(Mi(e)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let r=await qo(e);return new Zr(r.privateKey,r.publicKey)}function r1(t){let e=vr.pkixToJwk(t);if(Mi(e)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");return new Rn(e)}async function n1(t){if(Mi(t)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await qo(t);return new Zr(e.privateKey,e.publicKey)}async function i1(t){if(t>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await Cf(t);return new Zr(e.privateKey,e.publicKey)}var Yo={};_t(Yo,{Secp256k1PrivateKey:()=>kn,Secp256k1PublicKey:()=>Dn,generateKeyPair:()=>g1,unmarshalSecp256k1PrivateKey:()=>p1,unmarshalSecp256k1PublicKey:()=>y1});function s1(t){let e=cn(t);ee(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:o1,hexToBytes:a1}=oi,wr={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){let{Err:e}=wr;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:o1(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=wr,r=typeof t=="string"?a1(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:s}=wr._parseInt(r.subarray(2)),{d:o,l:a}=wr._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){let e=f=>Number.parseInt(f[0],16)&8?"00"+f:f,r=f=>{let u=f.toString(16);return u.length&1?`0${u}`:u},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},Ke=BigInt(0),ie=BigInt(1),gv=BigInt(2),Df=BigInt(3),xv=BigInt(4);function c1(t){let e=s1(t),{Fp:r}=e,n=e.toBytes||((d,p,y)=>{let x=p.toAffine();return _e(Uint8Array.from([4]),r.toBytes(x.x),r.toBytes(x.y))}),i=e.fromBytes||(d=>{let p=d.subarray(1),y=r.fromBytes(p.subarray(0,r.BYTES)),x=r.fromBytes(p.subarray(r.BYTES,2*r.BYTES));return{x:y,y:x}});function s(d){let{a:p,b:y}=e,x=r.sqr(d),v=r.mul(x,d);return r.add(r.add(v,r.mul(d,p)),y)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(d){return typeof d=="bigint"&&Ker.eql(m,r.ZERO);return v(y)&&v(x)?h.ZERO:new h(y,x,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){let y=r.invertBatch(p.map(x=>x.pz));return p.map((x,v)=>x.toAffine(y[v])).map(h.fromAffine)}static fromHex(p){let y=h.fromAffine(i(yt("pointHex",p)));return y.assertValidity(),y}static fromPrivateKey(p){return h.BASE.multiply(c(p))}_setWindowSize(p){this._WINDOW_SIZE=p,f.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:p,y}=this.toAffine();if(!r.isValid(p)||!r.isValid(y))throw new Error("bad point: x or y not FE");let x=r.sqr(y),v=s(p);if(!r.eql(x,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:p}=this.toAffine();if(r.isOdd)return!r.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){u(p);let{px:y,py:x,pz:v}=this,{px:m,py:A,pz:S}=p,B=r.eql(r.mul(y,S),r.mul(m,v)),R=r.eql(r.mul(x,S),r.mul(A,v));return B&&R}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){let{a:p,b:y}=e,x=r.mul(y,Df),{px:v,py:m,pz:A}=this,S=r.ZERO,B=r.ZERO,R=r.ZERO,_=r.mul(v,v),O=r.mul(m,m),M=r.mul(A,A),U=r.mul(v,m);return U=r.add(U,U),R=r.mul(v,A),R=r.add(R,R),S=r.mul(p,R),B=r.mul(x,M),B=r.add(S,B),S=r.sub(O,B),B=r.add(O,B),B=r.mul(S,B),S=r.mul(U,S),R=r.mul(x,R),M=r.mul(p,M),U=r.sub(_,M),U=r.mul(p,U),U=r.add(U,R),R=r.add(_,_),_=r.add(R,_),_=r.add(_,M),_=r.mul(_,U),B=r.add(B,_),M=r.mul(m,A),M=r.add(M,M),_=r.mul(M,U),S=r.sub(S,_),R=r.mul(M,O),R=r.add(R,R),R=r.add(R,R),new h(S,B,R)}add(p){u(p);let{px:y,py:x,pz:v}=this,{px:m,py:A,pz:S}=p,B=r.ZERO,R=r.ZERO,_=r.ZERO,O=e.a,M=r.mul(e.b,Df),U=r.mul(y,m),q=r.mul(x,A),z=r.mul(v,S),Z=r.add(y,x),C=r.add(m,A);Z=r.mul(Z,C),C=r.add(U,q),Z=r.sub(Z,C),C=r.add(y,v);let N=r.add(m,S);return C=r.mul(C,N),N=r.add(U,z),C=r.sub(C,N),N=r.add(x,v),B=r.add(A,S),N=r.mul(N,B),B=r.add(q,z),N=r.sub(N,B),_=r.mul(O,C),B=r.mul(M,z),_=r.add(B,_),B=r.sub(q,_),_=r.add(q,_),R=r.mul(B,_),q=r.add(U,U),q=r.add(q,U),z=r.mul(O,z),C=r.mul(M,C),q=r.add(q,z),z=r.sub(U,z),z=r.mul(O,z),C=r.add(C,z),U=r.mul(q,C),R=r.add(R,U),U=r.mul(N,C),B=r.mul(Z,B),B=r.sub(B,U),U=r.mul(Z,q),_=r.mul(N,_),_=r.add(_,U),new h(B,R,_)}subtract(p){return this.add(p.negate())}is0(){return this.equals(h.ZERO)}wNAF(p){return g.wNAFCached(this,f,p,y=>{let x=r.invertBatch(y.map(v=>v.pz));return y.map((v,m)=>v.toAffine(x[m])).map(h.fromAffine)})}multiplyUnsafe(p){let y=h.ZERO;if(p===Ke)return y;if(a(p),p===ie)return this;let{endo:x}=e;if(!x)return g.unsafeLadder(this,p);let{k1neg:v,k1:m,k2neg:A,k2:S}=x.splitScalar(p),B=y,R=y,_=this;for(;m>Ke||S>Ke;)m&ie&&(B=B.add(_)),S&ie&&(R=R.add(_)),_=_.double(),m>>=ie,S>>=ie;return v&&(B=B.negate()),A&&(R=R.negate()),R=new h(r.mul(R.px,x.beta),R.py,R.pz),B.add(R)}multiply(p){a(p);let y=p,x,v,{endo:m}=e;if(m){let{k1neg:A,k1:S,k2neg:B,k2:R}=m.splitScalar(y),{p:_,f:O}=this.wNAF(S),{p:M,f:U}=this.wNAF(R);_=g.constTimeNegate(A,_),M=g.constTimeNegate(B,M),M=new h(r.mul(M.px,m.beta),M.py,M.pz),x=_.add(M),v=O.add(U)}else{let{p:A,f:S}=this.wNAF(y);x=A,v=S}return h.normalizeZ([x,v])[0]}multiplyAndAddUnsafe(p,y,x){let v=h.BASE,m=(S,B)=>B===Ke||B===ie||!S.equals(v)?S.multiplyUnsafe(B):S.multiply(B),A=m(this,y).add(m(p,x));return A.is0()?void 0:A}toAffine(p){let{px:y,py:x,pz:v}=this,m=this.is0();p==null&&(p=m?r.ONE:r.inv(v));let A=r.mul(y,p),S=r.mul(x,p),B=r.mul(v,p);if(m)return{x:r.ZERO,y:r.ZERO};if(!r.eql(B,r.ONE))throw new Error("invZ was invalid");return{x:A,y:S}}isTorsionFree(){let{h:p,isTorsionFree:y}=e;if(p===ie)return!0;if(y)return y(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:p,clearCofactor:y}=e;return p===ie?this:y?y(h,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),n(h,this,p)}toHex(p=!0){return Ce(this.toRawBytes(p))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);let l=e.nBitLength,g=fi(h,e.endo?Math.ceil(l/2):l);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function f1(t){let e=cn(t);return ee(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function kf(t){let e=f1(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(C){return KeCe(qe(C,e.nByteLength));function d(C){let N=n>>ie;return C>N}function p(C){return d(C)?a(-C):C}let y=(C,N,T)=>Ie(C.slice(N,T));class x{constructor(N,T,L){this.r=N,this.s=T,this.recovery=L,this.assertValidity()}static fromCompact(N){let T=e.nByteLength;return N=yt("compactSignature",N,T*2),new x(y(N,0,T),y(N,T,2*T))}static fromDER(N){let{r:T,s:L}=wr.toSig(yt("DER",N));return new x(T,L)}assertValidity(){if(!l(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!l(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(N){return new x(this.r,this.s,N)}recoverPublicKey(N){let{r:T,s:L,recovery:w}=this,P=R(yt("msgHash",N));if(w==null||![0,1,2,3].includes(w))throw new Error("recovery id invalid");let K=w===2||w===3?T+e.n:T;if(K>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let V=w&1?"03":"02",W=f.fromHex(V+g(K)),Y=c(K),et=a(-P*Y),X=a(L*Y),J=f.BASE.multiplyAndAddUnsafe(W,et,X);if(!J)throw new Error("point at infinify");return J.assertValidity(),J}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return ir(this.toDERHex())}toDERHex(){return wr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ir(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}let v={isValidPrivateKey(C){try{return u(C),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let C=Is(e.n);return Xa(e.randomBytes(C),e.n)},precompute(C=8,N=f.BASE){return N._setWindowSize(C),N.multiply(BigInt(3)),N}};function m(C,N=!0){return f.fromPrivateKey(C).toRawBytes(N)}function A(C){let N=C instanceof Uint8Array,T=typeof C=="string",L=(N||T)&&C.length;return N?L===i||L===s:T?L===2*i||L===2*s:C instanceof f}function S(C,N,T=!0){if(A(C))throw new Error("first arg must be private key");if(!A(N))throw new Error("second arg must be public key");return f.fromHex(N).multiply(u(C)).toRawBytes(T)}let B=e.bits2int||function(C){let N=Ie(C),T=C.length*8-e.nBitLength;return T>0?N>>BigInt(T):N},R=e.bits2int_modN||function(C){return a(B(C))},_=an(e.nBitLength);function O(C){if(typeof C!="bigint")throw new Error("bigint expected");if(!(Ke<=C&&C<_))throw new Error(`bigint expected < 2^${e.nBitLength}`);return qe(C,e.nByteLength)}function M(C,N,T=U){if(["recovered","canonical"].some(ut=>ut in T))throw new Error("sign() legacy options not supported");let{hash:L,randomBytes:w}=e,{lowS:P,prehash:K,extraEntropy:V}=T;P==null&&(P=!0),C=yt("msgHash",C),K&&(C=yt("prehashed msgHash",L(C)));let W=R(C),Y=u(N),et=[O(Y),O(W)];if(V!=null){let ut=V===!0?w(r.BYTES):V;et.push(yt("extraEntropy",ut))}let X=_e(...et),J=W;function dt(ut){let Ut=B(ut);if(!l(Ut))return;let Kt=c(Ut),Ct=f.BASE.multiply(Ut).toAffine(),Vt=a(Ct.x);if(Vt===Ke)return;let Se=a(Kt*a(J+Vt*Y));if(Se===Ke)return;let tr=(Ct.x===Vt?0:2)|Number(Ct.y&ie),rn=Se;return P&&d(Se)&&(rn=p(Se),tr^=1),new x(Vt,rn,tr)}return{seed:X,k2sig:dt}}let U={lowS:e.lowS,prehash:!1},q={lowS:e.lowS,prehash:!1};function z(C,N,T=U){let{seed:L,k2sig:w}=M(C,N,T),P=e;return Es(P.hash.outputLen,P.nByteLength,P.hmac)(L,w)}f.BASE._setWindowSize(8);function Z(C,N,T,L=q){let w=C;if(N=yt("msgHash",N),T=yt("publicKey",T),"strict"in L)throw new Error("options.strict was renamed to lowS");let{lowS:P,prehash:K}=L,V,W;try{if(typeof w=="string"||w instanceof Uint8Array)try{V=x.fromDER(w)}catch(Ct){if(!(Ct instanceof wr.Err))throw Ct;V=x.fromCompact(w)}else if(typeof w=="object"&&typeof w.r=="bigint"&&typeof w.s=="bigint"){let{r:Ct,s:Vt}=w;V=new x(Ct,Vt)}else throw new Error("PARSE");W=f.fromHex(T)}catch(Ct){if(Ct.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(P&&V.hasHighS())return!1;K&&(N=e.hash(N));let{r:Y,s:et}=V,X=R(N),J=c(et),dt=a(X*J),ut=a(Y*J),Ut=f.BASE.multiplyAndAddUnsafe(W,dt,ut)?.toAffine();return Ut?a(Ut.x)===Y:!1}return{CURVE:e,getPublicKey:m,getSharedSecret:S,sign:z,verify:Z,ProjectivePoint:f,Signature:x,utils:v}}function u1(t){return{hash:t,hmac:(e,...r)=>Rr(t,e,ei(...r)),randomBytes:nr}}function Pf(t,e){let r=n=>kf({...t,...u1(n)});return Object.freeze({...r(e),create:r})}var Of=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Uf=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h1=BigInt(1),Go=BigInt(2),Kf=(t,e)=>(t+e/Go)/e;function l1(t){let e=Of,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),f=t*t*t%e,u=f*f*t%e,h=gt(u,r,e)*u%e,l=gt(h,r,e)*u%e,g=gt(l,Go,e)*f%e,d=gt(g,i,e)*g%e,p=gt(d,s,e)*d%e,y=gt(p,a,e)*p%e,x=gt(y,c,e)*y%e,v=gt(x,a,e)*p%e,m=gt(v,r,e)*u%e,A=gt(m,o,e)*d%e,S=gt(A,n,e)*f%e,B=gt(S,Go,e);if(!$o.eql($o.sqr(B),t))throw new Error("Cannot find square root");return B}var $o=ci(Of,void 0,void 0,{sqrt:l1}),Oe=Pf({a:BigInt(0),b:BigInt(7),Fp:$o,n:Uf,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=Uf,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-h1*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=Kf(s*t,e),c=Kf(-n*t,e),f=at(t-a*r-c*i,e),u=at(-a*n-c*s,e),h=f>o,l=u>o;if(h&&(f=e-f),l&&(u=e-u),f>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:f,k2neg:l,k2:u}}}},Nr),Cv=BigInt(0);var Iv=Oe.ProjectivePoint;function Mf(){return Oe.utils.randomPrivateKey()}async function Ff(t,e){let{digest:r}=await Ft.digest(e);try{return Oe.sign(r,t).toDERRawBytes()}catch(n){throw new it(String(n),"ERR_INVALID_INPUT")}}async function Vf(t,e,r){try{let{digest:n}=await Ft.digest(r);return Oe.verify(e,n,t)}catch(n){throw new it(String(n),"ERR_INVALID_INPUT")}}function Hf(t){return Oe.ProjectivePoint.fromHex(t).toRawBytes(!0)}function qf(t){try{Oe.getPublicKey(t,!0)}catch(e){throw new it(String(e),"ERR_INVALID_PRIVATE_KEY")}}function Wo(t){try{Oe.ProjectivePoint.fromHex(t)}catch(e){throw new it(String(e),"ERR_INVALID_PUBLIC_KEY")}}function zf(t){try{return Oe.getPublicKey(t,!0)}catch(e){throw new it(String(e),"ERR_INVALID_PRIVATE_KEY")}}var Dn=class{_key;constructor(e){Wo(e),this._key=e}async verify(e,r){return Vf(this._key,r,e)}marshal(){return Hf(this._key)}get bytes(){return we.encode({Type:wt.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},kn=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r??zf(e),qf(this._key),Wo(this._publicKey)}async sign(e){return Ff(this._key,e)}get public(){return new Dn(this._publicKey)}marshal(){return this._key}get bytes(){return Ee.encode({Type:wt.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=await this.public.hash();return Et(e,"base58btc")}async export(e,r="libp2p-key"){if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function p1(t){return new kn(t)}function y1(t){return new Dn(t)}async function g1(){let t=Mf();return new kn(t)}var Er={rsa:zo,ed25519:Mo,secp256k1:Yo};function Gf(t){let e=Object.keys(Er).join(" / ");return new it(`invalid or unsupported key type ${t}. Must be ${e}`,"ERR_UNSUPPORTED_KEY_TYPE")}function $f(t){let e=we.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case wt.RSA:return Er.rsa.unmarshalRsaPublicKey(r);case wt.Ed25519:return Er.ed25519.unmarshalEd25519PublicKey(r);case wt.Secp256k1:return Er.secp256k1.unmarshalSecp256k1PublicKey(r);default:throw Gf(e.Type??"unknown")}}async function Wf(t){let e=Ee.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case wt.RSA:return Er.rsa.unmarshalRsaPrivateKey(r);case wt.Ed25519:return Er.ed25519.unmarshalEd25519PrivateKey(r);case wt.Secp256k1:return Er.secp256k1.unmarshalSecp256k1PrivateKey(r);default:throw Gf(e.Type??"RSA")}}var Yf=Symbol.for("@libp2p/peer-id");var m1=Symbol.for("nodejs.util.inspect.custom"),Zf=Object.values(zr).map(t=>t.decoder).reduce((t,e)=>t.or(e),zr.identity.decoder),Xf=114,Zo=36,Xo=37,Pn=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[Yf]=!0;toString(){return this.string==null&&(this.string=Mt.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return lr.createV1(Xf,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return Lt(this.multihash.bytes,e);if(typeof e=="string")return b1(e).equals(this);if(e?.multihash?.bytes!=null)return Lt(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[m1](){return`PeerId(${this.toString()})`}},Xr=class extends Pn{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},Qr=class extends Pn{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},Jr=class extends Pn{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function b1(t,e){if(e=e??Zf,t.charAt(0)==="1"||t.charAt(0)==="Q"){let r=Sn(Mt.decode(`z${t}`));return t.startsWith("12D")?new Qr({multihash:r}):t.startsWith("16U")?new Jr({multihash:r}):new Xr({multihash:r})}return v1(Zf.decode(t))}function v1(t){try{let e=Sn(t);if(e.code===Je.code){if(e.digest.length===Zo)return new Qr({multihash:e});if(e.digest.length===Xo)return new Jr({multihash:e})}if(e.code===Ft.code)return new Xr({multihash:e})}catch{return w1(lr.decode(t))}throw new Error("Supplied PeerID CID is invalid")}function w1(t){if(t==null||t.multihash==null||t.version==null||t.version===1&&t.code!==Xf)throw new Error("Supplied PeerID CID is invalid");let e=t.multihash;if(e.code===Ft.code)return new Xr({multihash:t.multihash});if(e.code===Je.code){if(e.digest.length===Zo)return new Qr({multihash:t.multihash});if(e.digest.length===Xo)return new Jr({multihash:t.multihash})}throw new Error("Supplied PeerID CID is invalid")}async function Qo(t,e){return t.length===Zo?new Qr({multihash:ve(Je.code,t),privateKey:e}):t.length===Xo?new Jr({multihash:ve(Je.code,t),privateKey:e}):new Xr({multihash:await Ft.digest(t),publicKey:t,privateKey:e})}var Fi;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{if(i.lengthDelimited!==!1&&n.fork(),r.webtransportCerthashes!=null)for(let s of r.webtransportCerthashes)n.uint32(10),n.bytes(s);i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={webtransportCerthashes:[]},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:{i.webtransportCerthashes.push(r.bytes());break}default:{r.skipType(o&7);break}}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Fi||(Fi={}));var Un;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.identityKey!=null&&r.identityKey.byteLength>0&&(n.uint32(10),n.bytes(r.identityKey)),r.identitySig!=null&&r.identitySig.byteLength>0&&(n.uint32(18),n.bytes(r.identitySig)),r.extensions!=null&&(n.uint32(34),Fi.codec().encode(r.extensions,n)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={identityKey:rt(0),identitySig:rt(0)},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:{i.identityKey=r.bytes();break}case 2:{i.identitySig=r.bytes();break}case 4:{i.extensions=Fi.codec().decode(r,r.uint32());break}default:{r.skipType(o&7);break}}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Un||(Un={}));async function Qf(t,e,r){let n=await S1(t,Jf(e));if(t.publicKey==null)throw new Error("PublicKey was missing from local PeerId");return E1(t.publicKey,n,r)}function E1(t,e,r){return Un.encode({identityKey:t,identitySig:e,extensions:r??{webtransportCerthashes:[]}}).subarray()}async function S1(t,e){if(t.privateKey==null)throw new Error("PrivateKey was missing from PeerId");return(await Wf(t.privateKey)).sign(e)}async function Jo(t){return Qo(t.identityKey)}function jo(t){return Un.decode(t)}function Jf(t){let e=At("noise-libp2p-static-key:");return Gt([e,t],e.length+t.length)}async function ta(t,e,r){let n=await Qo(e.identityKey);if(!n.equals(r))throw new Error(`Payload identity key ${n.toString()} does not match expected remote peer ${r.toString()}`);let i=Jf(t);if(n.publicKey==null)throw new Error("PublicKey was missing from PeerId");if(e.identitySig==null)throw new Error("Signature was missing from message");if(!await $f(n.publicKey).verify(i,e.identitySig))throw new Error("Static key doesn't match to peer that signed payload!");return n}function Kn(t){return!(!(t instanceof Uint8Array)||t.length!==32)}var te=zt(nu(),1);te.default.formatters.b=t=>t==null?"undefined":Mt.baseEncode(t);te.default.formatters.t=t=>t==null?"undefined":Qe.baseEncode(t);te.default.formatters.m=t=>t==null?"undefined":Mr.baseEncode(t);te.default.formatters.p=t=>t==null?"undefined":t.toString();te.default.formatters.c=t=>t==null?"undefined":t.toString();te.default.formatters.k=t=>t==null?"undefined":t.toString();te.default.formatters.a=t=>t==null?"undefined":t.toString();function U1(t){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=t,e.destroy=()=>!0,e.extend=()=>e,e}function iu(t){let e=U1(`${t}:trace`);return te.default.enabled(`${t}:trace`)&&te.default.names.map(r=>r.toString()).find(r=>r.includes(":trace"))!=null&&(e=(0,te.default)(`${t}:trace`)),Object.assign((0,te.default)(t),{error:(0,te.default)(`${t}:error`),trace:e})}var Pt=iu("libp2p:noise");var se;Ia?se=Pt:se=Object.assign(()=>{},{enabled:!1,trace:()=>{},error:()=>{}});function su(t){se(`LOCAL_STATIC_PUBLIC_KEY ${Et(t.publicKey,"hex")}`),se(`LOCAL_STATIC_PRIVATE_KEY ${Et(t.privateKey,"hex")}`)}function ea(t){t?(se(`LOCAL_PUBLIC_EPHEMERAL_KEY ${Et(t.publicKey,"hex")}`),se(`LOCAL_PRIVATE_EPHEMERAL_KEY ${Et(t.privateKey,"hex")}`)):se("Missing local ephemeral keys.")}function ou(t){se(`REMOTE_STATIC_PUBLIC_KEY ${Et(t,"hex")}`)}function ra(t){se(`REMOTE_EPHEMERAL_PUBLIC_KEY ${Et(t,"hex")}`)}function au(t){t.cs1&&t.cs2?(se(`CIPHER_STATE_1 ${t.cs1.n.getUint64()} ${Et(t.cs1.k,"hex")}`),se(`CIPHER_STATE_2 ${t.cs2.n.getUint64()} ${Et(t.cs2.k,"hex")}`)):se("Missing cipher state.")}var K1=0,O1=4294967295,M1="Cipherstate has reached maximum n, a new handshake must be performed",qi=class{n;bytes;view;constructor(e=K1){this.n=e,this.bytes=rt(12),this.view=new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength),this.view.setUint32(4,e,!0)}increment(){this.n++,this.view.setUint32(4,this.n,!0)}getBytes(){return this.bytes}getUint64(){return this.n}assertValue(){if(this.n>O1)throw new Error(M1)}};var zi=class{crypto;constructor(e){this.crypto=e}encryptWithAd(e,r,n){let i=this.encrypt(e.k,e.n,r,n);return e.n.increment(),i}decryptWithAd(e,r,n,i){let{plaintext:s,valid:o}=this.decrypt(e.k,e.n,r,n,i);return o&&e.n.increment(),{plaintext:s,valid:o}}hasKey(e){return!this.isEmptyKey(e.k)}createEmptyKey(){return rt(32)}isEmptyKey(e){let r=this.createEmptyKey();return Lt(r,e)}encrypt(e,r,n,i){return r.assertValue(),this.crypto.chaCha20Poly1305Encrypt(i,r.getBytes(),n,e)}encryptAndHash(e,r){let n;return this.hasKey(e.cs)?n=this.encryptWithAd(e.cs,e.h,r):n=r,this.mixHash(e,n),n}decrypt(e,r,n,i,s){r.assertValue();let o=this.crypto.chaCha20Poly1305Decrypt(i,r.getBytes(),n,e,s);return o?{plaintext:o,valid:!0}:{plaintext:rt(0),valid:!1}}decryptAndHash(e,r){let n,i=!0;return this.hasKey(e.cs)?{plaintext:n,valid:i}=this.decryptWithAd(e.cs,e.h,r):n=r,this.mixHash(e,r),{plaintext:n,valid:i}}dh(e,r){try{let n=this.crypto.generateX25519SharedKey(e,r);return n.length===32?n:n.subarray(0,32)}catch(n){let i=n;return Pt.error(i),rt(32)}}mixHash(e,r){e.h=this.getHash(e.h,r)}getHash(e,r){return this.crypto.hashSHA256(Gt([e,r],e.length+r.length))}mixKey(e,r){let[n,i]=this.crypto.getHKDF(e.ck,r);e.cs=this.initializeKey(i),e.ck=n}initializeKey(e){return{k:e,n:new qi}}initializeSymmetric(e){let r=At(e,"utf-8"),n=this.hashProtocolName(r),i=n,s=this.createEmptyKey();return{cs:this.initializeKey(s),ck:i,h:n}}hashProtocolName(e){if(e.length<=32){let r=rt(32);return r.set(e),r}else return this.getHash(e,rt(0))}split(e){let[r,n]=this.crypto.getHKDF(e.ck,rt(0)),i=this.initializeKey(r),s=this.initializeKey(n);return{cs1:i,cs2:s}}writeMessageRegular(e,r){let n=this.encryptWithAd(e,rt(0),r),i=this.createEmptyKey(),s=rt(0);return{ne:i,ns:s,ciphertext:n}}readMessageRegular(e,r){return this.decryptWithAd(e,rt(0),r.ciphertext)}};var Gi=class extends zi{initializeInitiator(e,r,n,i){let s="Noise_XX_25519_ChaChaPoly_SHA256",o=this.initializeSymmetric(s);this.mixHash(o,e);let a=rt(32);return{ss:o,s:r,rs:n,psk:i,re:a}}initializeResponder(e,r,n,i){let s="Noise_XX_25519_ChaChaPoly_SHA256",o=this.initializeSymmetric(s);this.mixHash(o,e);let a=rt(32);return{ss:o,s:r,rs:n,psk:i,re:a}}writeMessageA(e,r,n){let i=rt(0);n!==void 0?e.e=n:e.e=this.crypto.generateX25519KeyPair();let s=e.e.publicKey;this.mixHash(e.ss,s);let o=this.encryptAndHash(e.ss,r);return{ne:s,ns:i,ciphertext:o}}writeMessageB(e,r){e.e=this.crypto.generateX25519KeyPair();let n=e.e.publicKey;this.mixHash(e.ss,n),this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));let i=e.s.publicKey,s=this.encryptAndHash(e.ss,i);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));let o=this.encryptAndHash(e.ss,r);return{ne:n,ns:s,ciphertext:o}}writeMessageC(e,r){let n=e.s.publicKey,i=this.encryptAndHash(e.ss,n);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));let s=this.encryptAndHash(e.ss,r),a={ne:this.createEmptyKey(),ns:i,ciphertext:s},{cs1:c,cs2:f}=this.split(e.ss);return{h:e.ss.h,messageBuffer:a,cs1:c,cs2:f}}readMessageA(e,r){return Kn(r.ne)&&(e.re=r.ne),this.mixHash(e.ss,e.re),this.decryptAndHash(e.ss,r.ciphertext)}readMessageB(e,r){if(Kn(r.ne)&&(e.re=r.ne),this.mixHash(e.ss,e.re),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));let{plaintext:n,valid:i}=this.decryptAndHash(e.ss,r.ns);i&&Kn(n)&&(e.rs=n),this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));let{plaintext:s,valid:o}=this.decryptAndHash(e.ss,r.ciphertext);return{plaintext:s,valid:i&&o}}readMessageC(e,r){let{plaintext:n,valid:i}=this.decryptAndHash(e.ss,r.ns);if(i&&Kn(n)&&(e.rs=n),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));let{plaintext:s,valid:o}=this.decryptAndHash(e.ss,r.ciphertext),{cs1:a,cs2:c}=this.split(e.ss);return{h:e.ss.h,plaintext:s,valid:i&&o,cs1:a,cs2:c}}initSession(e,r,n){let i=this.createEmptyKey(),s=rt(32),o;return e?o=this.initializeInitiator(r,n,s,i):o=this.initializeResponder(r,n,s,i),{hs:o,i:e,mc:0}}sendMessage(e,r,n){let i;if(e.mc===0)i=this.writeMessageA(e.hs,r,n);else if(e.mc===1)i=this.writeMessageB(e.hs,r);else if(e.mc===2){let{h:s,messageBuffer:o,cs1:a,cs2:c}=this.writeMessageC(e.hs,r);i=o,e.h=s,e.cs1=a,e.cs2=c}else if(e.mc>2)if(e.i){if(!e.cs1)throw new Error("CS1 (cipher state) is not defined");i=this.writeMessageRegular(e.cs1,r)}else{if(!e.cs2)throw new Error("CS2 (cipher state) is not defined");i=this.writeMessageRegular(e.cs2,r)}else throw new Error("Session invalid.");return e.mc++,i}recvMessage(e,r){let n=rt(0),i=!1;if(e.mc===0)({plaintext:n,valid:i}=this.readMessageA(e.hs,r));else if(e.mc===1)({plaintext:n,valid:i}=this.readMessageB(e.hs,r));else if(e.mc===2){let{h:s,plaintext:o,valid:a,cs1:c,cs2:f}=this.readMessageC(e.hs,r);n=o,i=a,e.h=s,e.cs1=c,e.cs2=f}return e.mc++,{plaintext:n,valid:i}}};var $i=class{isInitiator;session;remotePeer;remoteExtensions={webtransportCerthashes:[]};payload;connection;xx;staticKeypair;prologue;constructor(e,r,n,i,s,o,a,c){this.isInitiator=e,this.payload=r,this.prologue=n,this.staticKeypair=s,this.connection=o,a&&(this.remotePeer=a),this.xx=c??new Gi(i),this.session=this.xx.initSession(this.isInitiator,this.prologue,this.staticKeypair)}async propose(){if(su(this.session.hs.s),this.isInitiator){Pt.trace("Stage 0 - Initiator starting to send first message.");let e=this.xx.sendMessage(this.session,rt(0));await this.connection.write(c0(e)),Pt.trace("Stage 0 - Initiator finished sending first message."),ea(this.session.hs.e)}else{Pt.trace("Stage 0 - Responder waiting to receive first message...");let e=h0((await this.connection.read()).subarray()),{valid:r}=this.xx.recvMessage(this.session,e);if(!r)throw new or("xx handshake stage 0 validation fail");Pt.trace("Stage 0 - Responder received first message."),ra(this.session.hs.re)}}async exchange(){if(this.isInitiator){Pt.trace("Stage 1 - Initiator waiting to receive first message from responder...");let e=l0((await this.connection.read()).subarray()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new or("xx handshake stage 1 validation fail");Pt.trace("Stage 1 - Initiator received the message."),ra(this.session.hs.re),ou(this.session.hs.rs),Pt.trace("Initiator going to check remote's signature...");try{let i=jo(r);this.remotePeer=this.remotePeer||await Jo(i),await ta(this.session.hs.rs,i,this.remotePeer),this.setRemoteNoiseExtension(i.extensions)}catch(i){let s=i;throw new pn(`Error occurred while verifying signed payload: ${s.message}`)}Pt.trace("All good with the signature!")}else{Pt.trace("Stage 1 - Responder sending out first message with signed payload and static key.");let e=this.xx.sendMessage(this.session,this.payload);await this.connection.write(f0(e)),Pt.trace("Stage 1 - Responder sent the second handshake message with signed payload."),ea(this.session.hs.e)}}async finish(){if(this.isInitiator){Pt.trace("Stage 2 - Initiator sending third handshake message.");let e=this.xx.sendMessage(this.session,this.payload);await this.connection.write(u0(e)),Pt.trace("Stage 2 - Initiator sent message with signed payload.")}else{Pt.trace("Stage 2 - Responder waiting for third handshake message...");let e=d0((await this.connection.read()).subarray()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new or("xx handshake stage 2 validation fail");Pt.trace("Stage 2 - Responder received the message, finished handshake.");try{let i=jo(r);this.remotePeer=this.remotePeer||await Jo(i),await ta(this.session.hs.rs,i,this.remotePeer),this.setRemoteNoiseExtension(i.extensions)}catch(i){let s=i;throw new pn(`Error occurred while verifying signed payload: ${s.message}`)}}au(this.session)}encrypt(e,r){let n=this.getCS(r);return this.xx.encryptWithAd(n,rt(0),e)}decrypt(e,r,n){let i=this.getCS(r,!1);return this.xx.decryptWithAd(i,rt(0),e,n)}getRemoteStaticKey(){return this.session.hs.rs}getCS(e,r=!0){if(!e.cs1||!e.cs2)throw new or("Handshake not completed properly, cipher state does not exist.");return this.isInitiator?r?e.cs1:e.cs2:r?e.cs2:e.cs1}setRemoteNoiseExtension(e){e&&(this.remoteExtensions=e)}};function cu(t){return{xxHandshakeSuccesses:t.registerCounter("libp2p_noise_xxhandshake_successes_total",{help:"Total count of noise xxHandshakes successes_"}),xxHandshakeErrors:t.registerCounter("libp2p_noise_xxhandshake_error_total",{help:"Total count of noise xxHandshakes errors"}),encryptedPackets:t.registerCounter("libp2p_noise_encrypted_packets_total",{help:"Total count of noise encrypted packets successfully"}),decryptedPackets:t.registerCounter("libp2p_noise_decrypted_packets_total",{help:"Total count of noise decrypted packets"}),decryptErrors:t.registerCounter("libp2p_noise_decrypt_errors_total",{help:"Total count of noise decrypt errors"})}}var Wi=class{protocol="/noise";crypto;prologue;staticKeys;extensions;metrics;constructor(e={}){let{staticNoiseKey:r,extensions:n,crypto:i,prologueBytes:s,metrics:o}=e;this.crypto=i??a0,this.extensions=n,this.metrics=o?cu(o):void 0,r?this.staticKeys=this.crypto.generateX25519KeyPairFromSeed(r):this.staticKeys=this.crypto.generateX25519KeyPair(),this.prologue=s??rt(0)}async secureOutbound(e,r,n){let i=ns(r,{lengthEncoder:Dr,lengthDecoder:ln,maxDataLength:65535}),s=await this.performHandshake({connection:i,isInitiator:!0,localPeer:e,remotePeer:n}),o=await this.createSecureConnection(i,s);return r.source=o.source,r.sink=o.sink,{conn:r,remoteExtensions:s.remoteExtensions,remotePeer:s.remotePeer}}async secureInbound(e,r,n){let i=ns(r,{lengthEncoder:Dr,lengthDecoder:ln,maxDataLength:65535}),s=await this.performHandshake({connection:i,isInitiator:!1,localPeer:e,remotePeer:n}),o=await this.createSecureConnection(i,s);return r.source=o.source,r.sink=o.sink,{conn:r,remotePeer:s.remotePeer,remoteExtensions:s.remoteExtensions}}async performHandshake(e){let r=await Qf(e.localPeer,this.staticKeys.publicKey,this.extensions);return this.performXXHandshake(e,r)}async performXXHandshake(e,r){let{isInitiator:n,remotePeer:i,connection:s}=e,o=new $i(n,r,this.prologue,this.crypto,this.staticKeys,s,i);try{await o.propose(),await o.exchange(),await o.finish(),this.metrics?.xxHandshakeSuccesses.increment()}catch(a){if(this.metrics?.xxHandshakeErrors.increment(),a instanceof Error)throw a.message=`Error occurred during XX handshake: ${a.message}`,a}return o}async createSecureConnection(e,r){let[n,i]=Ea(),s=e.unwrap();return await Ba(n,g0(r,this.metrics),s,o=>sn(o,{lengthDecoder:ln}),x0(r,this.metrics),n),i}};function F1(t={}){return()=>new Wi(t)}return Eu(V1);})(); -/*! Bundled license information: - -@noble/ciphers/esm/utils.js: - (*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *) - -@noble/hashes/esm/utils.js: - (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/modular.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/curve.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/edwards.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/montgomery.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/ed25519.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/weierstrass.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/_shortw_utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/secp256k1.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) -*/ -return ChainsafeLibp2PNoise})); diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/basic.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/basic.d.ts deleted file mode 100644 index 5b8bbb19b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/basic.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type bytes = Uint8Array; -export type bytes32 = Uint8Array; -export type bytes16 = Uint8Array; -export type uint64 = number; -//# sourceMappingURL=basic.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/basic.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/basic.d.ts.map deleted file mode 100644 index eeee2bada..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/basic.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../src/@types/basic.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG,UAAU,CAAA;AAC9B,MAAM,MAAM,OAAO,GAAG,UAAU,CAAA;AAChC,MAAM,MAAM,OAAO,GAAG,UAAU,CAAA;AAEhC,MAAM,MAAM,MAAM,GAAG,MAAM,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/basic.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/basic.js deleted file mode 100644 index f839d2b8c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/basic.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=basic.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/basic.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/basic.js.map deleted file mode 100644 index aa623d697..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/basic.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"basic.js","sourceRoot":"","sources":["../../../src/@types/basic.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake-interface.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake-interface.d.ts deleted file mode 100644 index 40a820d88..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake-interface.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { bytes } from './basic.js'; -import type { NoiseSession } from './handshake.js'; -import type { NoiseExtensions } from '../proto/payload.js'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export interface IHandshake { - session: NoiseSession; - remotePeer: PeerId; - remoteExtensions: NoiseExtensions; - encrypt: (plaintext: bytes, session: NoiseSession) => bytes; - decrypt: (ciphertext: bytes, session: NoiseSession, dst?: Uint8Array) => { - plaintext: bytes; - valid: boolean; - }; -} -//# sourceMappingURL=handshake-interface.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake-interface.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake-interface.d.ts.map deleted file mode 100644 index 2b64678a8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake-interface.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake-interface.d.ts","sourceRoot":"","sources":["../../../src/@types/handshake-interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,YAAY,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,eAAe,CAAA;IACjC,OAAO,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,KAAK,KAAK,CAAA;IAC3D,OAAO,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,UAAU,KAAK;QAAE,SAAS,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAA;CAC9G"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake-interface.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake-interface.js deleted file mode 100644 index 6cb504ea8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake-interface.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=handshake-interface.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake-interface.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake-interface.js.map deleted file mode 100644 index f59aae35f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake-interface.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake-interface.js","sourceRoot":"","sources":["../../../src/@types/handshake-interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake.d.ts deleted file mode 100644 index 558a55238..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { bytes, bytes32, uint64 } from './basic.js'; -import type { KeyPair } from './libp2p.js'; -import type { Nonce } from '../nonce.js'; -export type Hkdf = [bytes, bytes, bytes]; -export interface MessageBuffer { - ne: bytes32; - ns: bytes; - ciphertext: bytes; -} -export interface CipherState { - k: bytes32; - n: Nonce; -} -export interface SymmetricState { - cs: CipherState; - ck: bytes32; - h: bytes32; -} -export interface HandshakeState { - ss: SymmetricState; - s: KeyPair; - e?: KeyPair; - rs: bytes32; - re: bytes32; - psk: bytes32; -} -export interface NoiseSession { - hs: HandshakeState; - h?: bytes32; - cs1?: CipherState; - cs2?: CipherState; - mc: uint64; - i: boolean; -} -export interface INoisePayload { - identityKey: bytes; - identitySig: bytes; - data: bytes; -} -//# sourceMappingURL=handshake.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake.d.ts.map deleted file mode 100644 index e4a428b8e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake.d.ts","sourceRoot":"","sources":["../../../src/@types/handshake.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAExC,MAAM,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;AAExC,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAA;IACX,EAAE,EAAE,KAAK,CAAA;IACT,UAAU,EAAE,KAAK,CAAA;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,OAAO,CAAA;IAGV,CAAC,EAAE,KAAK,CAAA;CACT;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,WAAW,CAAA;IACf,EAAE,EAAE,OAAO,CAAA;IACX,CAAC,EAAE,OAAO,CAAA;CACX;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,cAAc,CAAA;IAClB,CAAC,EAAE,OAAO,CAAA;IACV,CAAC,CAAC,EAAE,OAAO,CAAA;IACX,EAAE,EAAE,OAAO,CAAA;IACX,EAAE,EAAE,OAAO,CAAA;IACX,GAAG,EAAE,OAAO,CAAA;CACb;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,cAAc,CAAA;IAClB,CAAC,CAAC,EAAE,OAAO,CAAA;IACX,GAAG,CAAC,EAAE,WAAW,CAAA;IACjB,GAAG,CAAC,EAAE,WAAW,CAAA;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,CAAC,EAAE,OAAO,CAAA;CACX;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,KAAK,CAAA;IAClB,WAAW,EAAE,KAAK,CAAA;IAClB,IAAI,EAAE,KAAK,CAAA;CACZ"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake.js deleted file mode 100644 index 39c1bf13f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=handshake.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake.js.map deleted file mode 100644 index bed86a99f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/handshake.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake.js","sourceRoot":"","sources":["../../../src/@types/handshake.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/libp2p.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/libp2p.d.ts deleted file mode 100644 index d573b2ab6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/libp2p.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { bytes32 } from './basic.js'; -import type { NoiseExtensions } from '../proto/payload.js'; -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter'; -export interface KeyPair { - publicKey: bytes32; - privateKey: bytes32; -} -export interface INoiseConnection extends ConnectionEncrypter { -} -//# sourceMappingURL=libp2p.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/libp2p.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/libp2p.d.ts.map deleted file mode 100644 index 07f8bb308..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/libp2p.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"libp2p.d.ts","sourceRoot":"","sources":["../../../src/@types/libp2p.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAEjF,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB,CAAC,eAAe,CAAC;CAAG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/libp2p.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/libp2p.js deleted file mode 100644 index 9b5e5678e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/libp2p.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=libp2p.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/libp2p.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/libp2p.js.map deleted file mode 100644 index efd4520e6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/@types/libp2p.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"libp2p.js","sourceRoot":"","sources":["../../../src/@types/libp2p.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/constants.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/constants.d.ts deleted file mode 100644 index 576fb1857..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/constants.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare const NOISE_MSG_MAX_LENGTH_BYTES = 65535; -export declare const NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG: number; -export declare const DUMP_SESSION_KEYS: boolean; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/constants.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/constants.d.ts.map deleted file mode 100644 index 8bb0fa819..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,QAAQ,CAAA;AAC/C,eAAO,MAAM,sCAAsC,QAAkC,CAAA;AAErF,eAAO,MAAM,iBAAiB,SAAsD,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/constants.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/constants.js deleted file mode 100644 index e1381b284..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/constants.js +++ /dev/null @@ -1,4 +0,0 @@ -export const NOISE_MSG_MAX_LENGTH_BYTES = 65535; -export const NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG = NOISE_MSG_MAX_LENGTH_BYTES - 16; -export const DUMP_SESSION_KEYS = Boolean(globalThis.process?.env?.DUMP_SESSION_KEYS); -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/constants.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/constants.js.map deleted file mode 100644 index d21a05013..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAA;AAC/C,MAAM,CAAC,MAAM,sCAAsC,GAAG,0BAA0B,GAAG,EAAE,CAAA;AAErF,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto.d.ts deleted file mode 100644 index c98b18b9a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { bytes32, bytes } from './@types/basic.js'; -import type { Hkdf } from './@types/handshake.js'; -import type { KeyPair } from './@types/libp2p.js'; -export interface ICryptoInterface { - hashSHA256: (data: Uint8Array) => Uint8Array; - getHKDF: (ck: bytes32, ikm: Uint8Array) => Hkdf; - generateX25519KeyPair: () => KeyPair; - generateX25519KeyPairFromSeed: (seed: Uint8Array) => KeyPair; - generateX25519SharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Uint8Array; - chaCha20Poly1305Encrypt: (plaintext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32) => bytes; - chaCha20Poly1305Decrypt: (ciphertext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array) => bytes | null; -} -//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto.d.ts.map deleted file mode 100644 index 21fb764ad..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,UAAU,CAAA;IAE5C,OAAO,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,KAAK,IAAI,CAAA;IAE/C,qBAAqB,EAAE,MAAM,OAAO,CAAA;IACpC,6BAA6B,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAA;IAC5D,uBAAuB,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,KAAK,UAAU,CAAA;IAEtF,uBAAuB,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,KAAK,KAAK,CAAA;IACxG,uBAAuB,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,UAAU,KAAK,KAAK,GAAG,IAAI,CAAA;CACnI"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto.js deleted file mode 100644 index d4b4414d0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto.js.map deleted file mode 100644 index e85268dce..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.browser.d.ts deleted file mode 100644 index c819d1f23..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.browser.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const defaultCrypto: import("..").ICryptoInterface; -//# sourceMappingURL=index.browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.browser.d.ts.map deleted file mode 100644 index 8ae396c49..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../../../src/crypto/index.browser.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,+BAAe,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.browser.js deleted file mode 100644 index 04eea2a62..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.browser.js +++ /dev/null @@ -1,3 +0,0 @@ -import { pureJsCrypto } from './js'; -export const defaultCrypto = pureJsCrypto; -//# sourceMappingURL=index.browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.browser.js.map deleted file mode 100644 index e96421aa8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../../../src/crypto/index.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAEnC,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.d.ts deleted file mode 100644 index cf8aff630..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ICryptoInterface } from '../crypto.js'; -export declare const defaultCrypto: ICryptoInterface; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.d.ts.map deleted file mode 100644 index 5f7efefc8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crypto/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AA2DpD,eAAO,MAAM,aAAa,EAAE,gBA+E3B,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.js deleted file mode 100644 index bde9ae3dd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.js +++ /dev/null @@ -1,138 +0,0 @@ -import crypto from 'node:crypto'; -import { newInstance, ChaCha20Poly1305 } from '@chainsafe/as-chacha20poly1305'; -import { digest } from '@chainsafe/as-sha256'; -import { isElectronMain } from 'wherearewe'; -import { pureJsCrypto } from './js.js'; -const ctx = newInstance(); -const asImpl = new ChaCha20Poly1305(ctx); -const CHACHA_POLY1305 = 'chacha20-poly1305'; -const PKCS8_PREFIX = Buffer.from([0x30, 0x2e, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x04, 0x22, 0x04, 0x20]); -const X25519_PREFIX = Buffer.from([0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x03, 0x21, 0x00]); -const nodeCrypto = { - hashSHA256(data) { - return crypto.createHash('sha256').update(data).digest(); - }, - chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - const cipher = crypto.createCipheriv(CHACHA_POLY1305, k, nonce, { - authTagLength: 16 - }); - cipher.setAAD(ad, { plaintextLength: plaintext.byteLength }); - const updated = cipher.update(plaintext); - const final = cipher.final(); - const tag = cipher.getAuthTag(); - const encrypted = Buffer.concat([updated, tag, final], updated.byteLength + tag.byteLength + final.byteLength); - return encrypted; - }, - chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, _dst) { - const authTag = ciphertext.subarray(ciphertext.length - 16); - const text = ciphertext.subarray(0, ciphertext.length - 16); - const decipher = crypto.createDecipheriv(CHACHA_POLY1305, k, nonce, { - authTagLength: 16 - }); - decipher.setAAD(ad, { - plaintextLength: text.byteLength - }); - decipher.setAuthTag(authTag); - const updated = decipher.update(text); - const final = decipher.final(); - if (final.byteLength > 0) { - return Buffer.concat([updated, final], updated.byteLength + final.byteLength); - } - return updated; - } -}; -const asCrypto = { - hashSHA256(data) { - return digest(data); - }, - chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - return asImpl.seal(k, nonce, plaintext, ad); - }, - chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) { - return asImpl.open(k, nonce, ciphertext, ad, dst); - } -}; -// benchmarks show that for chacha20poly1305 -// the as implementation is faster for smaller payloads(<1200) -// and the node implementation is faster for larger payloads -export const defaultCrypto = { - ...pureJsCrypto, - hashSHA256(data) { - return nodeCrypto.hashSHA256(data); - }, - chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - if (plaintext.length < 1200) { - return asCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k); - } - return nodeCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k); - }, - chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) { - if (ciphertext.length < 1200) { - return asCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst); - } - return nodeCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst); - }, - generateX25519KeyPair() { - const { publicKey, privateKey } = crypto.generateKeyPairSync('x25519', { - publicKeyEncoding: { - type: 'spki', - format: 'der' - }, - privateKeyEncoding: { - type: 'pkcs8', - format: 'der' - } - }); - return { - publicKey: publicKey.subarray(X25519_PREFIX.length), - privateKey: privateKey.subarray(PKCS8_PREFIX.length) - }; - }, - generateX25519KeyPairFromSeed(seed) { - const privateKey = crypto.createPrivateKey({ - key: Buffer.concat([ - PKCS8_PREFIX, - seed - ], PKCS8_PREFIX.byteLength + seed.byteLength), - type: 'pkcs8', - format: 'der' - }); - const publicKey = crypto.createPublicKey(privateKey) - .export({ - type: 'spki', - format: 'der' - }).subarray(X25519_PREFIX.length); - return { - publicKey, - privateKey: seed - }; - }, - generateX25519SharedKey(privateKey, publicKey) { - publicKey = Buffer.concat([ - X25519_PREFIX, - publicKey - ], X25519_PREFIX.byteLength + publicKey.byteLength); - privateKey = Buffer.concat([ - PKCS8_PREFIX, - privateKey - ], PKCS8_PREFIX.byteLength + privateKey.byteLength); - return crypto.diffieHellman({ - publicKey: crypto.createPublicKey({ - key: Buffer.from(publicKey, publicKey.byteOffset, publicKey.byteLength), - type: 'spki', - format: 'der' - }), - privateKey: crypto.createPrivateKey({ - key: Buffer.from(privateKey, privateKey.byteOffset, privateKey.byteLength), - type: 'pkcs8', - format: 'der' - }) - }); - } -}; -// no chacha20-poly1305 in electron https://github.com/electron/electron/issues/24024 -if (isElectronMain) { - defaultCrypto.chaCha20Poly1305Encrypt = asCrypto.chaCha20Poly1305Encrypt; - defaultCrypto.chaCha20Poly1305Decrypt = asCrypto.chaCha20Poly1305Decrypt; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.js.map deleted file mode 100644 index 8e5524ac5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/crypto/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAC9E,OAAO,EAAE,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CAAC,CAAA;QAEnD,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;YACzB,YAAY;YACZ,UAAU;SACX,EAAE,YAAY,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,CAAA;QAEnD,OAAO,MAAM,CAAC,aAAa,CAAC;YAC1B,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC;gBAChC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,UAAU,CAAC;gBACvE,IAAI,EAAE,MAAM;gBACZ,MAAM,EAAE,KAAK;aACd,CAAC;YACF,UAAU,EAAE,MAAM,CAAC,gBAAgB,CAAC;gBAClC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC;gBAC1E,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,KAAK;aACd,CAAC;SACH,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,qFAAqF;AACrF,IAAI,cAAc,EAAE;IAClB,aAAa,CAAC,uBAAuB,GAAG,QAAQ,CAAC,uBAAuB,CAAA;IACxE,aAAa,CAAC,uBAAuB,GAAG,QAAQ,CAAC,uBAAuB,CAAA;CACzE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/js.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/js.d.ts deleted file mode 100644 index 4020b8611..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/js.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ICryptoInterface } from '../crypto.js'; -export declare const pureJsCrypto: ICryptoInterface; -//# sourceMappingURL=js.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/js.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/js.d.ts.map deleted file mode 100644 index d9693c950..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/js.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"js.d.ts","sourceRoot":"","sources":["../../../src/crypto/js.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpD,eAAO,MAAM,YAAY,EAAE,gBA+C1B,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/js.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/js.js deleted file mode 100644 index b2aa8b079..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/js.js +++ /dev/null @@ -1,43 +0,0 @@ -import { chacha20poly1305 } from '@noble/ciphers/chacha'; -import { x25519 } from '@noble/curves/ed25519'; -import { extract, expand } from '@noble/hashes/hkdf'; -import { sha256 } from '@noble/hashes/sha256'; -export const pureJsCrypto = { - hashSHA256(data) { - return sha256(data); - }, - getHKDF(ck, ikm) { - const prk = extract(sha256, ikm, ck); - const okmU8Array = expand(sha256, prk, undefined, 96); - const okm = okmU8Array; - const k1 = okm.subarray(0, 32); - const k2 = okm.subarray(32, 64); - const k3 = okm.subarray(64, 96); - return [k1, k2, k3]; - }, - generateX25519KeyPair() { - const secretKey = x25519.utils.randomPrivateKey(); - const publicKey = x25519.getPublicKey(secretKey); - return { - publicKey, - privateKey: secretKey - }; - }, - generateX25519KeyPairFromSeed(seed) { - const publicKey = x25519.getPublicKey(seed); - return { - publicKey, - privateKey: seed - }; - }, - generateX25519SharedKey(privateKey, publicKey) { - return x25519.getSharedSecret(privateKey, publicKey); - }, - chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - return chacha20poly1305(k, nonce, ad).encrypt(plaintext); - }, - chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) { - return chacha20poly1305(k, nonce, ad).decrypt(ciphertext, dst); - } -}; -//# sourceMappingURL=js.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/js.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/js.js.map deleted file mode 100644 index a58e0e68d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/js.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"js.js","sourceRoot":"","sources":["../../../src/crypto/js.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAM7C,MAAM,CAAC,MAAM,YAAY,GAAqB;IAC5C,UAAU,CAAE,IAAgB;QAC1B,OAAO,MAAM,CAAC,IAAI,CAAC,CAAA;IACrB,CAAC;IAED,OAAO,CAAE,EAAW,EAAE,GAAe;QACnC,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAAA;QACpC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,CAAA;QACrD,MAAM,GAAG,GAAG,UAAU,CAAA;QAEtB,MAAM,EAAE,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;QAC9B,MAAM,EAAE,GAAG,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QAC/B,MAAM,EAAE,GAAG,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QAE/B,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;IACrB,CAAC;IAED,qBAAqB;QACnB,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACjD,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;QAEhD,OAAO;YACL,SAAS;YACT,UAAU,EAAE,SAAS;SACtB,CAAA;IACH,CAAC;IAED,6BAA6B,CAAE,IAAgB;QAC7C,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QAE3C,OAAO;YACL,SAAS;YACT,UAAU,EAAE,IAAI;SACjB,CAAA;IACH,CAAC;IAED,uBAAuB,CAAE,UAAsB,EAAE,SAAqB;QACpE,OAAO,MAAM,CAAC,eAAe,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;IACtD,CAAC;IAED,uBAAuB,CAAE,SAAqB,EAAE,KAAiB,EAAE,EAAc,EAAE,CAAU;QAC3F,OAAO,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAC1D,CAAC;IAED,uBAAuB,CAAE,UAAsB,EAAE,KAAiB,EAAE,EAAc,EAAE,CAAU,EAAE,GAAgB;QAC9G,OAAO,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;IAChE,CAAC;CACF,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/streaming.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/streaming.d.ts deleted file mode 100644 index a897b30ad..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/streaming.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import type { IHandshake } from '../@types/handshake-interface.js'; -import type { MetricsRegistry } from '../metrics.js'; -import type { Transform } from 'it-stream-types'; -export declare function encryptStream(handshake: IHandshake, metrics?: MetricsRegistry): Transform>; -export declare function decryptStream(handshake: IHandshake, metrics?: MetricsRegistry): Transform, AsyncGenerator>; -//# sourceMappingURL=streaming.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/streaming.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/streaming.d.ts.map deleted file mode 100644 index 76ac88dcd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/streaming.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../../src/crypto/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAG/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAKhD,wBAAgB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,CAgBvI;AAGD,wBAAgB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC,CA4BtJ"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/streaming.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/streaming.js deleted file mode 100644 index 5a6723913..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/streaming.js +++ /dev/null @@ -1,50 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import { NOISE_MSG_MAX_LENGTH_BYTES, NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG } from '../constants.js'; -import { uint16BEEncode } from '../encoder.js'; -const CHACHA_TAG_LENGTH = 16; -// Returns generator that encrypts payload from the user -export function encryptStream(handshake, metrics) { - return async function* (source) { - for await (const chunk of source) { - for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG) { - let end = i + NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG; - if (end > chunk.length) { - end = chunk.length; - } - const data = handshake.encrypt(chunk.subarray(i, end), handshake.session); - metrics?.encryptedPackets.increment(); - yield new Uint8ArrayList(uint16BEEncode(data.byteLength), data); - } - } - }; -} -// Decrypt received payload to the user -export function decryptStream(handshake, metrics) { - return async function* (source) { - for await (const chunk of source) { - for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES) { - let end = i + NOISE_MSG_MAX_LENGTH_BYTES; - if (end > chunk.length) { - end = chunk.length; - } - if (end - CHACHA_TAG_LENGTH < i) { - throw new Error('Invalid chunk'); - } - const encrypted = chunk.subarray(i, end); - // memory allocation is not cheap so reuse the encrypted Uint8Array - // see https://github.com/ChainSafe/js-libp2p-noise/pull/242#issue-1422126164 - // this is ok because chacha20 reads bytes one by one and don't reread after that - // it's also tested in https://github.com/ChainSafe/as-chacha20poly1305/pull/1/files#diff-25252846b58979dcaf4e41d47b3eadd7e4f335e7fb98da6c049b1f9cd011f381R48 - const dst = chunk.subarray(i, end - CHACHA_TAG_LENGTH); - const { plaintext: decrypted, valid } = handshake.decrypt(encrypted, handshake.session, dst); - if (!valid) { - metrics?.decryptErrors.increment(); - throw new Error('Failed to validate decrypted chunk'); - } - metrics?.decryptedPackets.increment(); - yield decrypted; - } - } - }; -} -//# sourceMappingURL=streaming.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/streaming.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/streaming.js.map deleted file mode 100644 index 302b7fff6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/crypto/streaming.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streaming.js","sourceRoot":"","sources":["../../../src/crypto/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,0BAA0B,EAAE,sCAAsC,EAAE,MAAM,iBAAiB,CAAA;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAK9C,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAE5B,wDAAwD;AACxD,MAAM,UAAU,aAAa,CAAE,SAAqB,EAAE,OAAyB;IAC7E,OAAO,KAAK,SAAU,CAAC,EAAE,MAAM;QAC7B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE;YAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,sCAAsC,EAAE;gBAC7E,IAAI,GAAG,GAAG,CAAC,GAAG,sCAAsC,CAAA;gBACpD,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE;oBACtB,GAAG,GAAG,KAAK,CAAC,MAAM,CAAA;iBACnB;gBA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CAAC,KAAK,EAAE;oBACV,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,CAAA;oBAClC,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;iBACtD;gBACD,OAAO,EAAE,gBAAgB,CAAC,SAAS,EAAE,CAAA;gBACrC,MAAM,SAAS,CAAA;aAChB;SACF;IACH,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/encoder.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/encoder.d.ts deleted file mode 100644 index a24ce9256..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/encoder.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import type { bytes } from './@types/basic.js'; -import type { MessageBuffer } from './@types/handshake.js'; -import type { LengthDecoderFunction } from 'it-length-prefixed'; -export declare const uint16BEEncode: { - (value: number): Uint8Array; - bytes: number; -}; -export declare const uint16BEDecode: LengthDecoderFunction; -export declare function encode0(message: MessageBuffer): Uint8ArrayList; -export declare function encode1(message: MessageBuffer): Uint8ArrayList; -export declare function encode2(message: MessageBuffer): Uint8ArrayList; -export declare function decode0(input: bytes): MessageBuffer; -export declare function decode1(input: bytes): MessageBuffer; -export declare function decode2(input: bytes): MessageBuffer; -//# sourceMappingURL=encoder.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/encoder.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/encoder.d.ts.map deleted file mode 100644 index 76e8c0a65..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/encoder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encoder.d.ts","sourceRoot":"","sources":["../../src/encoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAE/D,eAAO,MAAM,cAAc;YAAW,MAAM,GAAG,UAAU;;CAIxD,CAAA;AAGD,eAAO,MAAM,cAAc,EAAE,qBAQ5B,CAAA;AAKD,wBAAgB,OAAO,CAAE,OAAO,EAAE,aAAa,GAAG,cAAc,CAE/D;AAED,wBAAgB,OAAO,CAAE,OAAO,EAAE,aAAa,GAAG,cAAc,CAE/D;AAED,wBAAgB,OAAO,CAAE,OAAO,EAAE,aAAa,GAAG,cAAc,CAE/D;AAED,wBAAgB,OAAO,CAAE,KAAK,EAAE,KAAK,GAAG,aAAa,CAUpD;AAED,wBAAgB,OAAO,CAAE,KAAK,EAAE,KAAK,GAAG,aAAa,CAUpD;AAED,wBAAgB,OAAO,CAAE,KAAK,EAAE,KAAK,GAAG,aAAa,CAUpD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/encoder.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/encoder.js deleted file mode 100644 index fb9145e54..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/encoder.js +++ /dev/null @@ -1,58 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import { alloc as uint8ArrayAlloc, allocUnsafe as uint8ArrayAllocUnsafe } from 'uint8arrays/alloc'; -export const uint16BEEncode = (value) => { - const target = uint8ArrayAllocUnsafe(2); - new DataView(target.buffer, target.byteOffset, target.byteLength).setUint16(0, value, false); - return target; -}; -uint16BEEncode.bytes = 2; -export const uint16BEDecode = (data) => { - if (data.length < 2) - throw RangeError('Could not decode int16BE'); - if (data instanceof Uint8Array) { - return new DataView(data.buffer, data.byteOffset, data.byteLength).getUint16(0, false); - } - return data.getUint16(0); -}; -uint16BEDecode.bytes = 2; -// Note: IK and XX encoder usage is opposite (XX uses in stages encode0 where IK uses encode1) -export function encode0(message) { - return new Uint8ArrayList(message.ne, message.ciphertext); -} -export function encode1(message) { - return new Uint8ArrayList(message.ne, message.ns, message.ciphertext); -} -export function encode2(message) { - return new Uint8ArrayList(message.ns, message.ciphertext); -} -export function decode0(input) { - if (input.length < 32) { - throw new Error('Cannot decode stage 0 MessageBuffer: length less than 32 bytes.'); - } - return { - ne: input.subarray(0, 32), - ciphertext: input.subarray(32, input.length), - ns: uint8ArrayAlloc(0) - }; -} -export function decode1(input) { - if (input.length < 80) { - throw new Error('Cannot decode stage 1 MessageBuffer: length less than 80 bytes.'); - } - return { - ne: input.subarray(0, 32), - ns: input.subarray(32, 80), - ciphertext: input.subarray(80, input.length) - }; -} -export function decode2(input) { - if (input.length < 48) { - throw new Error('Cannot decode stage 2 MessageBuffer: length less than 48 bytes.'); - } - return { - ne: uint8ArrayAlloc(0), - ns: input.subarray(0, 48), - ciphertext: input.subarray(48, input.length) - }; -} -//# sourceMappingURL=encoder.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/encoder.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/encoder.js.map deleted file mode 100644 index 243826435..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/encoder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encoder.js","sourceRoot":"","sources":["../../src/encoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,WAAW,IA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yield-chunks-nagle/noise/dist/src/handshake-xx.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshake-xx.d.ts deleted file mode 100644 index 8bde3f774..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshake-xx.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { XX } from './handshakes/xx.js'; -import type { bytes, bytes32 } from './@types/basic.js'; -import type { IHandshake } from './@types/handshake-interface.js'; -import type { NoiseSession } from './@types/handshake.js'; -import type { KeyPair } from './@types/libp2p.js'; -import type { ICryptoInterface } from './crypto.js'; -import type { NoiseExtensions } from './proto/payload.js'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { LengthPrefixedStream } from 'it-length-prefixed-stream'; -export declare class XXHandshake implements IHandshake { - isInitiator: boolean; - session: NoiseSession; - remotePeer: PeerId; - remoteExtensions: NoiseExtensions; - protected payload: bytes; - protected connection: LengthPrefixedStream; - protected xx: XX; - protected staticKeypair: KeyPair; - private readonly prologue; - constructor(isInitiator: boolean, payload: bytes, prologue: bytes32, crypto: ICryptoInterface, staticKeypair: KeyPair, connection: LengthPrefixedStream, remotePeer?: PeerId, handshake?: XX); - propose(): Promise; - exchange(): Promise; - finish(): Promise; - encrypt(plaintext: Uint8Array, session: NoiseSession): bytes; - decrypt(ciphertext: Uint8Array, session: NoiseSession, dst?: Uint8Array): { - plaintext: bytes; - valid: boolean; - }; - getRemoteStaticKey(): bytes; - private getCS; - protected setRemoteNoiseExtension(e: NoiseExtensions | null | undefined): void; -} -//# sourceMappingURL=handshake-xx.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshake-xx.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshake-xx.d.ts.map deleted file mode 100644 index cb8bec51a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshake-xx.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake-xx.d.ts","sourceRoot":"","sources":["../../src/handshake-xx.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAcvC,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAErE,qBAAa,WAAY,YAAW,UAAU;IACrC,WAAW,EAAE,OAAO,CAAA;IACpB,OAAO,EAAE,YAAY,CAAA;IACrB,UAAU,EAAG,MAAM,CAAA;IACnB,gBAAgB,EAAE,eAAe,CAAiC;IAEzE,SAAS,CAAC,OAAO,EAAE,KAAK,CAAA;IACxB,SAAS,CAAC,UAAU,EAAE,oBAAoB,CAAA;IAC1C,SAAS,CAAC,EAAE,EAAE,EAAE,CAAA;IAChB,SAAS,CAAC,aAAa,EAAE,OAAO,CAAA;IAEhC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;gBAGhC,WAAW,EAAE,OAAO,EACpB,OAAO,EAAE,KAAK,EACd,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,gBAAgB,EACxB,aAAa,EAAE,OAAO,EACtB,UAAU,EAAE,oBAAoB,EAChC,UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,EAAE;IAeH,OAAO,IAAK,OAAO,CAAC,IAAI,CAAC;IAqBzB,QAAQ,IAAK,OAAO,CAAC,IAAI,CAAC;IAiC1B,MAAM,IAAK,OAAO,CAAC,IAAI,CAAC;IA4B9B,OAAO,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,GAAG,KAAK;IAM7D,OAAO,CAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG;QAAE,SAAS,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE;IAM/G,kBAAkB,IAAK,KAAK;IAInC,OAAO,CAAC,KAAK;IAYb,SAAS,CAAC,uBAAuB,CAAE,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;CAKhF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshake-xx.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshake-xx.js deleted file mode 100644 index 373013b03..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshake-xx.js +++ /dev/null @@ -1,140 +0,0 @@ -import { InvalidCryptoExchangeError, UnexpectedPeerError } from '@libp2p/interface/errors'; -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { decode0, decode1, decode2, encode0, encode1, encode2 } from './encoder.js'; -import { XX } from './handshakes/xx.js'; -import { logger, logLocalStaticKeys, logLocalEphemeralKeys, logRemoteEphemeralKey, logRemoteStaticKey, logCipherState } from './logger.js'; -import { decodePayload, getPeerIdFromPayload, verifySignedPayload } from './utils.js'; -export class XXHandshake { - isInitiator; - session; - remotePeer; - remoteExtensions = { webtransportCerthashes: [] }; - payload; - connection; - xx; - staticKeypair; - prologue; - constructor(isInitiator, payload, prologue, crypto, staticKeypair, connection, remotePeer, handshake) { - this.isInitiator = isInitiator; - this.payload = payload; - this.prologue = prologue; - this.staticKeypair = staticKeypair; - this.connection = connection; - if (remotePeer) { - this.remotePeer = remotePeer; - } - this.xx = handshake ?? new XX(crypto); - this.session = this.xx.initSession(this.isInitiator, this.prologue, this.staticKeypair); - } - // stage 0 - async propose() { - logLocalStaticKeys(this.session.hs.s); - if (this.isInitiator) { - logger.trace('Stage 0 - Initiator starting to send first message.'); - const messageBuffer = this.xx.sendMessage(this.session, uint8ArrayAlloc(0)); - await this.connection.write(encode0(messageBuffer)); - logger.trace('Stage 0 - Initiator finished sending first message.'); - logLocalEphemeralKeys(this.session.hs.e); - } - else { - logger.trace('Stage 0 - Responder waiting to receive first message...'); - const receivedMessageBuffer = decode0((await this.connection.read()).subarray()); - const { valid } = this.xx.recvMessage(this.session, receivedMessageBuffer); - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 0 validation fail'); - } - logger.trace('Stage 0 - Responder received first message.'); - logRemoteEphemeralKey(this.session.hs.re); - } - } - // stage 1 - async exchange() { - if (this.isInitiator) { - logger.trace('Stage 1 - Initiator waiting to receive first message from responder...'); - const receivedMessageBuffer = decode1((await this.connection.read()).subarray()); - const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer); - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 1 validation fail'); - } - logger.trace('Stage 1 - Initiator received the message.'); - logRemoteEphemeralKey(this.session.hs.re); - logRemoteStaticKey(this.session.hs.rs); - logger.trace("Initiator going to check remote's signature..."); - try { - const decodedPayload = decodePayload(plaintext); - this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload); - await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer); - this.setRemoteNoiseExtension(decodedPayload.extensions); - } - catch (e) { - const err = e; - throw new UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`); - } - logger.trace('All good with the signature!'); - } - else { - logger.trace('Stage 1 - Responder sending out first message with signed payload and static key.'); - const messageBuffer = this.xx.sendMessage(this.session, this.payload); - await this.connection.write(encode1(messageBuffer)); - logger.trace('Stage 1 - Responder sent the second handshake message with signed payload.'); - logLocalEphemeralKeys(this.session.hs.e); - } - } - // stage 2 - async finish() { - if (this.isInitiator) { - logger.trace('Stage 2 - Initiator sending third handshake message.'); - const messageBuffer = this.xx.sendMessage(this.session, this.payload); - await this.connection.write(encode2(messageBuffer)); - logger.trace('Stage 2 - Initiator sent message with signed payload.'); - } - else { - logger.trace('Stage 2 - Responder waiting for third handshake message...'); - const receivedMessageBuffer = decode2((await this.connection.read()).subarray()); - const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer); - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 2 validation fail'); - } - logger.trace('Stage 2 - Responder received the message, finished handshake.'); - try { - const decodedPayload = decodePayload(plaintext); - this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload); - await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer); - this.setRemoteNoiseExtension(decodedPayload.extensions); - } - catch (e) { - const err = e; - throw new UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`); - } - } - logCipherState(this.session); - } - encrypt(plaintext, session) { - const cs = this.getCS(session); - return this.xx.encryptWithAd(cs, uint8ArrayAlloc(0), plaintext); - } - decrypt(ciphertext, session, dst) { - const cs = this.getCS(session, false); - return this.xx.decryptWithAd(cs, uint8ArrayAlloc(0), ciphertext, dst); - } - getRemoteStaticKey() { - return this.session.hs.rs; - } - getCS(session, encryption = true) { - if (!session.cs1 || !session.cs2) { - throw new InvalidCryptoExchangeError('Handshake not completed properly, cipher state does not exist.'); - } - if (this.isInitiator) { - return encryption ? session.cs1 : session.cs2; - } - else { - return encryption ? session.cs2 : session.cs1; - } - } - setRemoteNoiseExtension(e) { - if (e) { - this.remoteExtensions = e; - } - } -} -//# sourceMappingURL=handshake-xx.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshake-xx.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshake-xx.js.map deleted file mode 100644 index 1b47203b9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshake-xx.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake-xx.js","sourceRoot":"","sources":["../../src/handshake-xx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC1F,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACnF,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACf,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,YAAY,CAAA;AAUnB,MAAM,OAAO,WAAW;IACf,WAAW,CAAS;IACpB,OAAO,CAAc;IACrB,UAAU,CAAS;IACnB,gBAAgB,GAAoB,EAAE,sBAAsB,EAAE,EAAE,EAAE,CAAA;IAE/D,OAAO,CAAO;IACd,UAAU,CAAsB;IAChC,EAAE,CAAI;IACN,aAAa,CAAS;IAEf,QAAQ,CAAS;IAElC,YACE,WAAoB,EACpB,OAAc,EACd,QAAiB,EACjB,MAAwB,EACxB,aAAsB,EACtB,UAAgC,EAChC,UAAmB,EACnB,SAAc;QAEd,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;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AAe,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,CAAA;IACvE,CAAC;IAEM,kBAAkB;QACvB,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAA;IAC3B,CAAC;IAEO,KAAK,CAAE,OAAqB,EAAE,UAAU,GAAG,IAAI;QACrD,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChC,MAAM,IAAI,0BAA0B,CAAC,gEAAgE,CAAC,CAAA;SACvG;QAED,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,OAAO,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA;SAC9C;aAAM;YACL,OAAO,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA;SAC9C;IACH,CAAC;IAES,uBAAuB,CAAE,CAAqC;QACtE,IAAI,CAAC,EAAE;YACL,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAA;SAC1B;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/abstract-handshake.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/abstract-handshake.d.ts deleted file mode 100644 index eb1e51754..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/abstract-handshake.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Nonce } from '../nonce.js'; -import type { bytes, bytes32 } from '../@types/basic.js'; -import type { CipherState, MessageBuffer, SymmetricState } from '../@types/handshake.js'; -import type { ICryptoInterface } from '../crypto.js'; -export interface DecryptedResult { - plaintext: bytes; - valid: boolean; -} -export interface SplitState { - cs1: CipherState; - cs2: CipherState; -} -export declare abstract class AbstractHandshake { - crypto: ICryptoInterface; - constructor(crypto: ICryptoInterface); - encryptWithAd(cs: CipherState, ad: Uint8Array, plaintext: Uint8Array): bytes; - decryptWithAd(cs: CipherState, ad: Uint8Array, ciphertext: Uint8Array, dst?: Uint8Array): DecryptedResult; - protected hasKey(cs: CipherState): boolean; - protected createEmptyKey(): bytes32; - protected isEmptyKey(k: bytes32): boolean; - protected encrypt(k: bytes32, n: Nonce, ad: Uint8Array, plaintext: Uint8Array): bytes; - protected encryptAndHash(ss: SymmetricState, plaintext: bytes): bytes; - protected decrypt(k: bytes32, n: Nonce, ad: bytes, ciphertext: bytes, dst?: Uint8Array): DecryptedResult; - protected decryptAndHash(ss: SymmetricState, ciphertext: bytes): DecryptedResult; - protected dh(privateKey: bytes32, publicKey: bytes32): bytes32; - protected mixHash(ss: SymmetricState, data: bytes): void; - protected getHash(a: Uint8Array, b: Uint8Array): bytes32; - protected mixKey(ss: SymmetricState, ikm: bytes32): void; - protected initializeKey(k: bytes32): CipherState; - protected initializeSymmetric(protocolName: string): SymmetricState; - protected hashProtocolName(protocolName: Uint8Array): bytes32; - protected split(ss: SymmetricState): SplitState; - protected writeMessageRegular(cs: CipherState, payload: bytes): MessageBuffer; - protected readMessageRegular(cs: CipherState, message: MessageBuffer): DecryptedResult; -} -//# sourceMappingURL=abstract-handshake.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/abstract-handshake.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/abstract-handshake.d.ts.map deleted file mode 100644 index 0ffc88414..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/abstract-handshake.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-handshake.d.ts","sourceRoot":"","sources":["../../../src/handshakes/abstract-handshake.ts"],"names":[],"mappings":"AAKA,O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AK,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG,eAAe;IAkBzG,SAAS,CAAC,cAAc,CAAE,EAAE,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,GAAG,eAAe;IAYjF,SAAS,CAAC,EAAE,CAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO;IAgB/D,SAAS,CAAC,OAAO,CAAE,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,KAAK,GAAG,IAAI;IAIzD,SAAS,CAAC,OAAO,CAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO;IAKzD,SAAS,CAAC,MAAM,CAAE,EAAE,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI;IAMzD,SAAS,CAAC,aAAa,CAAE,CAAC,EAAE,OAAO,GAAG,WAAW;IAMjD,SAAS,CAAC,mBAAmB,CAAE,YAAY,EAAE,MAAM,GAAG,cAAc;IAWpE,SAAS,CAAC,gBAAgB,CAAE,YAAY,EAAE,UAAU,GAAG,OAAO;IAU9D,SAAS,CAAC,KAAK,CAAE,EAAE,EAAE,cAAc,GAAG,UAAU;IAQhD,SAAS,CAAC,mBAAmB,CAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,GAAG,aAAa;IAQ9E,SAAS,CAAC,kBAAkB,CAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,GAAG,eAAe;CAGxF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/abstract-handshake.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/abstract-handshake.js deleted file mode 100644 index f1d205fe1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/abstract-handshake.js +++ /dev/null @@ -1,141 +0,0 @@ -import { fromString as uint8ArrayFromString } from 'uint8arrays'; -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; -import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; -import { logger } from '../logger.js'; -import { Nonce } from '../nonce.js'; -export class AbstractHandshake { - crypto; - constructor(crypto) { - this.crypto = crypto; - } - encryptWithAd(cs, ad, plaintext) { - const e = this.encrypt(cs.k, cs.n, ad, plaintext); - cs.n.increment(); - return e; - } - decryptWithAd(cs, ad, ciphertext, dst) { - const { plaintext, valid } = this.decrypt(cs.k, cs.n, ad, ciphertext, dst); - if (valid) - cs.n.increment(); - return { plaintext, valid }; - } - // Cipher state related - hasKey(cs) { - return !this.isEmptyKey(cs.k); - } - createEmptyKey() { - return uint8ArrayAlloc(32); - } - isEmptyKey(k) { - const emptyKey = this.createEmptyKey(); - return uint8ArrayEquals(emptyKey, k); - } - encrypt(k, n, ad, plaintext) { - n.assertValue(); - return this.crypto.chaCha20Poly1305Encrypt(plaintext, n.getBytes(), ad, k); - } - encryptAndHash(ss, plaintext) { - let ciphertext; - if (this.hasKey(ss.cs)) { - ciphertext = this.encryptWithAd(ss.cs, ss.h, plaintext); - } - else { - ciphertext = plaintext; - } - this.mixHash(ss, ciphertext); - return ciphertext; - } - decrypt(k, n, ad, ciphertext, dst) { - n.assertValue(); - const encryptedMessage = this.crypto.chaCha20Poly1305Decrypt(ciphertext, n.getBytes(), ad, k, dst); - if (encryptedMessage) { - return { - plaintext: encryptedMessage, - valid: true - }; - } - else { - return { - plaintext: uint8ArrayAlloc(0), - valid: false - }; - } - } - decryptAndHash(ss, ciphertext) { - let plaintext; - let valid = true; - if (this.hasKey(ss.cs)) { - ({ plaintext, valid } = this.decryptWithAd(ss.cs, ss.h, ciphertext)); - } - else { - plaintext = ciphertext; - } - this.mixHash(ss, ciphertext); - return { plaintext, valid }; - } - dh(privateKey, publicKey) { - try { - const derivedU8 = this.crypto.generateX25519SharedKey(privateKey, publicKey); - if (derivedU8.length === 32) { - return derivedU8; - } - return derivedU8.subarray(0, 32); - } - catch (e) { - const err = e; - logger.error(err); - return uint8ArrayAlloc(32); - } - } - mixHash(ss, data) { - ss.h = this.getHash(ss.h, data); - } - getHash(a, b) { - const u = this.crypto.hashSHA256(uint8ArrayConcat([a, b], a.length + b.length)); - return u; - } - mixKey(ss, ikm) { - const [ck, tempK] = this.crypto.getHKDF(ss.ck, ikm); - ss.cs = this.initializeKey(tempK); - ss.ck = ck; - } - initializeKey(k) { - return { k, n: new Nonce() }; - } - // Symmetric state related - initializeSymmetric(protocolName) { - const protocolNameBytes = uint8ArrayFromString(protocolName, 'utf-8'); - const h = this.hashProtocolName(protocolNameBytes); - const ck = h; - const key = this.createEmptyKey(); - const cs = this.initializeKey(key); - return { cs, ck, h }; - } - hashProtocolName(protocolName) { - if (protocolName.length <= 32) { - const h = uint8ArrayAlloc(32); - h.set(protocolName); - return h; - } - else { - return this.getHash(protocolName, uint8ArrayAlloc(0)); - } - } - split(ss) { - const [tempk1, tempk2] = this.crypto.getHKDF(ss.ck, uint8ArrayAlloc(0)); - const cs1 = this.initializeKey(tempk1); - const cs2 = this.initializeKey(tempk2); - return { cs1, cs2 }; - } - writeMessageRegular(cs, payload) { - const ciphertext = this.encryptWithAd(cs, uint8ArrayAlloc(0), payload); - const ne = this.createEmptyKey(); - const ns = uint8ArrayAlloc(0); - return { ne, ns, ciphertext }; - } - readMessageRegular(cs, message) { - return this.decryptWithAd(cs, uint8ArrayAlloc(0), message.ciphertext); - } -} -//# sourceMappingURL=abstract-handshake.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/abstract-handshake.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/abstract-handshake.js.map deleted file mode 100644 index 757420896..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/abstract-handshake.js.map +++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CAAC,YAAY,CAAC,CAAA;YACnB,OAAO,CAAC,CAAA;SACT;aAAM;YACL,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAA;SACtD;IACH,CAAC;IAES,KAAK,CAAE,EAAkB;QACjC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAA;QACvE,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAEtC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;IACrB,CAAC;IAES,mBAAmB,CAAE,EAAe,EAAE,OAAc;QAC5D,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;QACtE,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;QAChC,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,CAAC,CAAA;QAE7B,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,CAAA;IAC/B,CAAC;IAES,kBAAkB,CAAE,EAAe,EAAE,OAAsB;QACnE,OAAO,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;IACvE,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/xx.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/xx.d.ts deleted file mode 100644 index bf79dc414..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/xx.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { AbstractHandshake, type DecryptedResult } from './abstract-handshake.js'; -import type { bytes32, bytes } from '../@types/basic.js'; -import type { MessageBuffer, NoiseSession } from '../@types/handshake.js'; -import type { KeyPair } from '../@types/libp2p.js'; -export declare class XX extends AbstractHandshake { - private initializeInitiator; - private initializeResponder; - private writeMessageA; - private writeMessageB; - private writeMessageC; - private readMessageA; - private readMessageB; - private readMessageC; - initSession(initiator: boolean, prologue: bytes32, s: KeyPair): NoiseSession; - sendMessage(session: NoiseSession, message: bytes, ephemeral?: KeyPair): MessageBuffer; - recvMessage(session: NoiseSession, message: MessageBuffer): DecryptedResult; -} -//# sourceMappingURL=xx.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/xx.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/xx.d.ts.map deleted file mode 100644 index 76c3cbdac..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/xx.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx.d.ts","sourceRoot":"","sources":["../../../src/handshakes/xx.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACjF,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAA+B,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACtG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,qBAAa,EAAG,SAAQ,iBAAiB;IACvC,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,YAAY;IAmBpB,OAAO,CAAC,YAAY;IAgBb,WAAW,CAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,YAAY;IAkB7E,WAAW,CAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,aAAa;IAkCvF,WAAW,CAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,GAAG,eAAe;CAkBpF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/xx.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/xx.js deleted file mode 100644 index dbfa58f06..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/xx.js +++ /dev/null @@ -1,162 +0,0 @@ -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { isValidPublicKey } from '../utils.js'; -import { AbstractHandshake } from './abstract-handshake.js'; -export class XX extends AbstractHandshake { - initializeInitiator(prologue, s, rs, psk) { - const name = 'Noise_XX_25519_ChaChaPoly_SHA256'; - const ss = this.initializeSymmetric(name); - this.mixHash(ss, prologue); - const re = uint8ArrayAlloc(32); - return { ss, s, rs, psk, re }; - } - initializeResponder(prologue, s, rs, psk) { - const name = 'Noise_XX_25519_ChaChaPoly_SHA256'; - const ss = this.initializeSymmetric(name); - this.mixHash(ss, prologue); - const re = uint8ArrayAlloc(32); - return { ss, s, rs, psk, re }; - } - writeMessageA(hs, payload, e) { - const ns = uint8ArrayAlloc(0); - if (e !== undefined) { - hs.e = e; - } - else { - hs.e = this.crypto.generateX25519KeyPair(); - } - const ne = hs.e.publicKey; - this.mixHash(hs.ss, ne); - const ciphertext = this.encryptAndHash(hs.ss, payload); - return { ne, ns, ciphertext }; - } - writeMessageB(hs, payload) { - hs.e = this.crypto.generateX25519KeyPair(); - const ne = hs.e.publicKey; - this.mixHash(hs.ss, ne); - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re)); - const spk = hs.s.publicKey; - const ns = this.encryptAndHash(hs.ss, spk); - this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re)); - const ciphertext = this.encryptAndHash(hs.ss, payload); - return { ne, ns, ciphertext }; - } - writeMessageC(hs, payload) { - const spk = hs.s.publicKey; - const ns = this.encryptAndHash(hs.ss, spk); - this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re)); - const ciphertext = this.encryptAndHash(hs.ss, payload); - const ne = this.createEmptyKey(); - const messageBuffer = { ne, ns, ciphertext }; - const { cs1, cs2 } = this.split(hs.ss); - return { h: hs.ss.h, messageBuffer, cs1, cs2 }; - } - readMessageA(hs, message) { - if (isValidPublicKey(message.ne)) { - hs.re = message.ne; - } - this.mixHash(hs.ss, hs.re); - return this.decryptAndHash(hs.ss, message.ciphertext); - } - readMessageB(hs, message) { - if (isValidPublicKey(message.ne)) { - hs.re = message.ne; - } - this.mixHash(hs.ss, hs.re); - if (!hs.e) { - throw new Error('Handshake state `e` param is missing.'); - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re)); - const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns); - if (valid1 && isValidPublicKey(ns)) { - hs.rs = ns; - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs)); - const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext); - return { plaintext, valid: (valid1 && valid2) }; - } - readMessageC(hs, message) { - const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns); - if (valid1 && isValidPublicKey(ns)) { - hs.rs = ns; - } - if (!hs.e) { - throw new Error('Handshake state `e` param is missing.'); - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs)); - const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext); - const { cs1, cs2 } = this.split(hs.ss); - return { h: hs.ss.h, plaintext, valid: (valid1 && valid2), cs1, cs2 }; - } - initSession(initiator, prologue, s) { - const psk = this.createEmptyKey(); - const rs = uint8ArrayAlloc(32); // no static key yet - let hs; - if (initiator) { - hs = this.initializeInitiator(prologue, s, rs, psk); - } - else { - hs = this.initializeResponder(prologue, s, rs, psk); - } - return { - hs, - i: initiator, - mc: 0 - }; - } - sendMessage(session, message, ephemeral) { - let messageBuffer; - if (session.mc === 0) { - messageBuffer = this.writeMessageA(session.hs, message, ephemeral); - } - else if (session.mc === 1) { - messageBuffer = this.writeMessageB(session.hs, message); - } - else if (session.mc === 2) { - const { h, messageBuffer: resultingBuffer, cs1, cs2 } = this.writeMessageC(session.hs, message); - messageBuffer = resultingBuffer; - session.h = h; - session.cs1 = cs1; - session.cs2 = cs2; - } - else if (session.mc > 2) { - if (session.i) { - if (!session.cs1) { - throw new Error('CS1 (cipher state) is not defined'); - } - messageBuffer = this.writeMessageRegular(session.cs1, message); - } - else { - if (!session.cs2) { - throw new Error('CS2 (cipher state) is not defined'); - } - messageBuffer = this.writeMessageRegular(session.cs2, message); - } - } - else { - throw new Error('Session invalid.'); - } - session.mc++; - return messageBuffer; - } - recvMessage(session, message) { - let plaintext = uint8ArrayAlloc(0); - let valid = false; - if (session.mc === 0) { - ({ plaintext, valid } = this.readMessageA(session.hs, message)); - } - else if (session.mc === 1) { - ({ plaintext, valid } = this.readMessageB(session.hs, message)); - } - else if (session.mc === 2) { - const { h, plaintext: resultingPlaintext, valid: resultingValid, cs1, cs2 } = this.readMessageC(session.hs, message); - plaintext = resultingPlaintext; - valid = resultingValid; - session.h = h; - session.cs1 = cs1; - session.cs2 = cs2; - } - session.mc++; - return { plaintext, valid }; - } -} -//# sourceMappingURL=xx.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/xx.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/xx.js.map deleted file mode 100644 index e4e4a1586..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/handshakes/xx.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx.js","sourceRoot":"","sources":["../../../src/handshakes/xx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAwB,MAAM,yBAAyB,CAAA;AAKjF,MAAM,OAAO,EAAG,SAAQ,iBAAiB;IAC/B,mBAAmB,CAAE,QAAiB,EAAE,CAAU,EAAE,EAAW,EAAE,GAAY;QACnF,MAAM,IAAI,GAAG,kCAAkC,CAAA;QAC/C,MAAM,EAAE,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAA;QACzC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;QAC1B,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,CAAC,CAAA;QAE9B,OAAO,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAA;IAC/B,CAAC;IAEO,mBAAmB,CAAE,QAAiB,EAAE,CAAU,EAAE,EAAW,EAAE,GAAY;QACnF,MAAM,IAAI,GAAG,kCAAkC,CAAA;QAC/C,MAAM,EAAE,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAA;QACzC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;QAC1B,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,CAAC,CAAA;QAE9B,OAAO,EAAE,EAAE,EAAE,CAAC,EAAE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AO,CAAC,GAAG,GAAG,GAAG,CAAA;YACjB,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA;SAClB;QACD,OAAO,CAAC,EAAE,EAAE,CAAA;QACZ,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;IAC7B,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/index.d.ts deleted file mode 100644 index 20ec9c473..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { NoiseInit } from './noise.js'; -import type { NoiseExtensions } from './proto/payload.js'; -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter'; -export type { ICryptoInterface } from './crypto.js'; -export { pureJsCrypto } from './crypto/js.js'; -export declare function noise(init?: NoiseInit): () => ConnectionEncrypter; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/index.d.ts.map deleted file mode 100644 index 4c067ef45..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AACjF,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,wBAAgB,KAAK,CAAE,IAAI,GAAE,SAAc,GAAG,MAAM,mBAAmB,CAAC,eAAe,CAAC,CAEvF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/index.js deleted file mode 100644 index 83cdd3f49..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import { Noise } from './noise.js'; -export { pureJsCrypto } from './crypto/js.js'; -export function noise(init = {}) { - return () => new Noise(init); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/index.js.map deleted file mode 100644 index fbdf2daf9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAKlC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,UAAU,KAAK,CAAE,OAAkB,EAAE;IACzC,OAAO,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/logger.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/logger.d.ts deleted file mode 100644 index 55e6ab35d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/logger.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { type Logger } from '@libp2p/logger'; -import type { NoiseSession } from './@types/handshake.js'; -import type { KeyPair } from './@types/libp2p.js'; -declare const log: Logger; -export { log as logger }; -export declare function logLocalStaticKeys(s: KeyPair): void; -export declare function logLocalEphemeralKeys(e: KeyPair | undefined): void; -export declare function logRemoteStaticKey(rs: Uint8Array): void; -export declare function logRemoteEphemeralKey(re: Uint8Array): void; -export declare function logCipherState(session: NoiseSession): void; -//# sourceMappingURL=logger.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/logger.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/logger.d.ts.map deleted file mode 100644 index 8873892ba..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/logger.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAU,MAAM,gBAAgB,CAAA;AAGpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAEjD,QAAA,MAAM,GAAG,QAAyB,CAAA;AAElC,OAAO,EAAE,GAAG,IAAI,MAAM,EAAE,CAAA;AAaxB,wBAAgB,kBAAkB,CAAE,CAAC,EAAE,OAAO,GAAG,IAAI,CAGpD;AAED,wBAAgB,qBAAqB,CAAE,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAOnE;AAED,wBAAgB,kBAAkB,CAAE,EAAE,EAAE,UAAU,GAAG,IAAI,CAExD;AAED,wBAAgB,qBAAqB,CAAE,EAAE,EAAE,UAAU,GAAG,IAAI,CAE3D;AAED,wBAAgB,cAAc,CAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CAO3D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/logger.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/logger.js deleted file mode 100644 index daf1e24aa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/logger.js +++ /dev/null @@ -1,45 +0,0 @@ -import { logger } from '@libp2p/logger'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { DUMP_SESSION_KEYS } from './constants.js'; -const log = logger('libp2p:noise'); -export { log as logger }; -let keyLogger; -if (DUMP_SESSION_KEYS) { - keyLogger = log; -} -else { - keyLogger = Object.assign(() => { }, { - enabled: false, - trace: () => { }, - error: () => { } - }); -} -export function logLocalStaticKeys(s) { - keyLogger(`LOCAL_STATIC_PUBLIC_KEY ${uint8ArrayToString(s.publicKey, 'hex')}`); - keyLogger(`LOCAL_STATIC_PRIVATE_KEY ${uint8ArrayToString(s.privateKey, 'hex')}`); -} -export function logLocalEphemeralKeys(e) { - if (e) { - keyLogger(`LOCAL_PUBLIC_EPHEMERAL_KEY ${uint8ArrayToString(e.publicKey, 'hex')}`); - keyLogger(`LOCAL_PRIVATE_EPHEMERAL_KEY ${uint8ArrayToString(e.privateKey, 'hex')}`); - } - else { - keyLogger('Missing local ephemeral keys.'); - } -} -export function logRemoteStaticKey(rs) { - keyLogger(`REMOTE_STATIC_PUBLIC_KEY ${uint8ArrayToString(rs, 'hex')}`); -} -export function logRemoteEphemeralKey(re) { - keyLogger(`REMOTE_EPHEMERAL_PUBLIC_KEY ${uint8ArrayToString(re, 'hex')}`); -} -export function logCipherState(session) { - if (session.cs1 && session.cs2) { - keyLogger(`CIPHER_STATE_1 ${session.cs1.n.getUint64()} ${uint8ArrayToString(session.cs1.k, 'hex')}`); - keyLogger(`CIPHER_STATE_2 ${session.cs2.n.getUint64()} ${uint8ArrayToString(session.cs2.k, 'hex')}`); - } - else { - keyLogger('Missing cipher state.'); - } -} -//# sourceMappingURL=logger.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/logger.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/logger.js.map deleted file mode 100644 index e408da6b8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/logger.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAIlD,MAAM,GAAG,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA;AAElC,OAAO,EAAE,GAAG,IAAI,MAAM,EAAE,CAAA;AAExB,IAAI,SAAiB,CAAA;AACrB,IAAI,iBAAiB,EAAE;IACrB,SAAS,GAAG,GAAG,CAAA;CAChB;KAAM;IACL,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,GAAoB,CAAC,EAAE;QACpD,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;QACf,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;KAChB,CAAC,CAAA;CACH;AAED,MAAM,UAAU,kBAAkB,CAAE,CAAU;IAC5C,SAAS,CAAC,2BAA2B,kBAAkB,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;IAC9E,SAAS,CAAC,4BAA4B,kBAAkB,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;AAClF,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAE,CAAsB;IAC3D,IAAI,CAAC,EAAE;QACL,SAAS,CAAC,8BAA8B,kBAAkB,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;QACjF,SAAS,CAAC,+BAA+B,kBAAkB,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;KACpF;SAAM;QACL,SAAS,CAAC,+BAA+B,CAAC,CAAA;KAC3C;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAE,EAAc;IAChD,SAAS,CAAC,4BAA4B,kBAAkB,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;AACxE,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAE,EAAc;IACnD,SAAS,CAAC,+BAA+B,kBAAkB,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;AAC3E,CAAC;AAED,MAAM,UAAU,cAAc,CAAE,OAAqB;IACnD,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE;QAC9B,SAAS,CAAC,kBAAkB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;QACpG,SAAS,CAAC,kBAAkB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;KACrG;SAAM;QACL,SAAS,CAAC,uBAAuB,CAAC,CAAA;KACnC;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/metrics.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/metrics.d.ts deleted file mode 100644 index 4fe5a1280..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/metrics.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Counter, Metrics } from '@libp2p/interface/metrics'; -export type MetricsRegistry = Record; -export declare function registerMetrics(metrics: Metrics): MetricsRegistry; -//# sourceMappingURL=metrics.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/metrics.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/metrics.d.ts.map deleted file mode 100644 index 5d29159ee..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/metrics.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../src/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEjE,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAErD,wBAAgB,eAAe,CAAE,OAAO,EAAE,OAAO,GAAG,eAAe,CA2BlE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/metrics.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/metrics.js deleted file mode 100644 index 1b5123db8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/metrics.js +++ /dev/null @@ -1,20 +0,0 @@ -export function registerMetrics(metrics) { - return { - xxHandshakeSuccesses: metrics.registerCounter('libp2p_noise_xxhandshake_successes_total', { - help: 'Total count of noise xxHandshakes successes_' - }), - xxHandshakeErrors: metrics.registerCounter('libp2p_noise_xxhandshake_error_total', { - help: 'Total count of noise xxHandshakes errors' - }), - encryptedPackets: metrics.registerCounter('libp2p_noise_encrypted_packets_total', { - help: 'Total count of noise encrypted packets successfully' - }), - decryptedPackets: metrics.registerCounter('libp2p_noise_decrypted_packets_total', { - help: 'Total count of noise decrypted packets' - }), - decryptErrors: metrics.registerCounter('libp2p_noise_decrypt_errors_total', { - help: 'Total count of noise decrypt errors' - }) - }; -} -//# sourceMappingURL=metrics.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/metrics.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/metrics.js.map deleted file mode 100644 index 9c23b331e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/metrics.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/metrics.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,eAAe,CAAE,OAAgB;IAC/C,OAAO;QACL,oBAAoB,EAAE,OAAO,CAAC,eAAe,CAC3C,0CAA0C,EAAE;YAC1C,IAAI,EAAE,8CAA8C;SACrD,CAAC;QAEJ,iBAAiB,EAAE,OAAO,CAAC,eAAe,CACxC,sCAAsC,EAAE;YACtC,IAAI,EAAE,0CAA0C;SACjD,CAAC;QAEJ,gBAAgB,EAAE,OAAO,CAAC,eAAe,CACvC,sCAAsC,EAAE;YACtC,IAAI,EAAE,qDAAqD;SAC5D,CAAC;QAEJ,gBAAgB,EAAE,OAAO,CAAC,eAAe,CACvC,sCAAsC,EAAE;YACtC,IAAI,EAAE,wCAAwC;SAC/C,CAAC;QAEJ,aAAa,EAAE,OAAO,CAAC,eAAe,CACpC,mCAAmC,EAAE;YACnC,IAAI,EAAE,qCAAqC;SAC5C,CAAC;KACL,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/noise.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/noise.d.ts deleted file mode 100644 index 51255c0e1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/noise.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { bytes } from './@types/basic.js'; -import type { INoiseConnection } from './@types/libp2p.js'; -import type { ICryptoInterface } from './crypto.js'; -import type { NoiseExtensions } from './proto/payload.js'; -import type { MultiaddrConnection } from '@libp2p/interface/connection'; -import type { SecuredConnection } from '@libp2p/interface/connection-encrypter'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { Duplex } from 'it-stream-types'; -import type { Uint8ArrayList } from 'uint8arraylist'; -export interface NoiseInit { - /** - * x25519 private key, reuse for faster handshakes - */ - staticNoiseKey?: bytes; - extensions?: NoiseExtensions; - crypto?: ICryptoInterface; - prologueBytes?: Uint8Array; - metrics?: Metrics; -} -export declare class Noise implements INoiseConnection { - protocol: string; - crypto: ICryptoInterface; - private readonly prologue; - private readonly staticKeys; - private readonly extensions?; - private readonly metrics?; - constructor(init?: NoiseInit); - /** - * Encrypt outgoing data to the remote party (handshake as initiator) - * - * @param {PeerId} localPeer - PeerId of the receiving peer - * @param {Stream} connection - streaming iterable duplex that will be encrypted - * @param {PeerId} remotePeer - PeerId of the remote peer. Used to validate the integrity of the remote peer. - * @returns {Promise>} - */ - secureOutbound> = MultiaddrConnection>(localPeer: PeerId, connection: Stream, remotePeer?: PeerId): Promise>; - /** - * Decrypt incoming data (handshake as responder). - * - * @param {PeerId} localPeer - PeerId of the receiving peer. - * @param {Stream} connection - streaming iterable duplex that will be encrypted. - * @param {PeerId} remotePeer - optional PeerId of the initiating peer, if known. This may only exist during transport upgrades. - * @returns {Promise>} - */ - secureInbound> = MultiaddrConnection>(localPeer: PeerId, connection: Stream, remotePeer?: PeerId): Promise>; - /** - * If Noise pipes supported, tries IK handshake first with XX as fallback if it fails. - * If noise pipes disabled or remote peer static key is unknown, use XX. - * - * @param {HandshakeParams} params - */ - private performHandshake; - private performXXHandshake; - private createSecureConnection; -} -//# sourceMappingURL=noise.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/noise.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/noise.d.ts.map deleted file mode 100644 index cec69f3cf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/noise.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise.d.ts","sourceRoot":"","sources":["../../src/noise.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAW,MAAM,oBAAoB,CAAA;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC/E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AASpD,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAA;IACtB,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,aAAa,CAAC,EAAE,UAAU,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,qBAAa,KAAM,YAAW,gBAAgB;IACrC,QAAQ,SAAW;IACnB,MAAM,EAAE,gBAAgB,CAAA;IAE/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAY;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAiB;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAiB;gBAE7B,IAAI,GAAE,SAAc;IAgBjC;;;;;;;OAOG;IACU,cAAc,CAAE,MAAM,SAAS,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,GAAG,mBAAmB,EAAG,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IA2BxO;;;;;;;OAOG;IACU,aAAa,CAAE,MAAM,SAAS,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,GAAG,mBAAmB,EAAG,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IA2BvO;;;;;OAKG;YACW,gBAAgB;YAOhB,kBAAkB;YA+BlB,sBAAsB;CAmBrC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/noise.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/noise.js deleted file mode 100644 index ff97e2199..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/noise.js +++ /dev/null @@ -1,135 +0,0 @@ -import { decode } from 'it-length-prefixed'; -import { lpStream } from 'it-length-prefixed-stream'; -import { duplexPair } from 'it-pair/duplex'; -import { pipe } from 'it-pipe'; -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { NOISE_MSG_MAX_LENGTH_BYTES } from './constants.js'; -import { defaultCrypto } from './crypto/index.js'; -import { decryptStream, encryptStream } from './crypto/streaming.js'; -import { uint16BEDecode, uint16BEEncode } from './encoder.js'; -import { XXHandshake } from './handshake-xx.js'; -import { registerMetrics } from './metrics.js'; -import { getPayload } from './utils.js'; -export class Noise { - protocol = '/noise'; - crypto; - prologue; - staticKeys; - extensions; - metrics; - constructor(init = {}) { - const { staticNoiseKey, extensions, crypto, prologueBytes, metrics } = init; - this.crypto = crypto ?? defaultCrypto; - this.extensions = extensions; - this.metrics = metrics ? registerMetrics(metrics) : undefined; - if (staticNoiseKey) { - // accepts x25519 private key of length 32 - this.staticKeys = this.crypto.generateX25519KeyPairFromSeed(staticNoiseKey); - } - else { - this.staticKeys = this.crypto.generateX25519KeyPair(); - } - this.prologue = prologueBytes ?? uint8ArrayAlloc(0); - } - /** - * Encrypt outgoing data to the remote party (handshake as initiator) - * - * @param {PeerId} localPeer - PeerId of the receiving peer - * @param {Stream} connection - streaming iterable duplex that will be encrypted - * @param {PeerId} remotePeer - PeerId of the remote peer. Used to validate the integrity of the remote peer. - * @returns {Promise>} - */ - async secureOutbound(localPeer, connection, remotePeer) { - const wrappedConnection = lpStream(connection, { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - }); - const handshake = await this.performHandshake({ - connection: wrappedConnection, - isInitiator: true, - localPeer, - remotePeer - }); - const conn = await this.createSecureConnection(wrappedConnection, handshake); - connection.source = conn.source; - connection.sink = conn.sink; - return { - conn: connection, - remoteExtensions: handshake.remoteExtensions, - remotePeer: handshake.remotePeer - }; - } - /** - * Decrypt incoming data (handshake as responder). - * - * @param {PeerId} localPeer - PeerId of the receiving peer. - * @param {Stream} connection - streaming iterable duplex that will be encrypted. - * @param {PeerId} remotePeer - optional PeerId of the initiating peer, if known. This may only exist during transport upgrades. - * @returns {Promise>} - */ - async secureInbound(localPeer, connection, remotePeer) { - const wrappedConnection = lpStream(connection, { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - }); - const handshake = await this.performHandshake({ - connection: wrappedConnection, - isInitiator: false, - localPeer, - remotePeer - }); - const conn = await this.createSecureConnection(wrappedConnection, handshake); - connection.source = conn.source; - connection.sink = conn.sink; - return { - conn: connection, - remotePeer: handshake.remotePeer, - remoteExtensions: handshake.remoteExtensions - }; - } - /** - * If Noise pipes supported, tries IK handshake first with XX as fallback if it fails. - * If noise pipes disabled or remote peer static key is unknown, use XX. - * - * @param {HandshakeParams} params - */ - async performHandshake(params) { - const payload = await getPayload(params.localPeer, this.staticKeys.publicKey, this.extensions); - // run XX handshake - return this.performXXHandshake(params, payload); - } - async performXXHandshake(params, payload) { - const { isInitiator, remotePeer, connection } = params; - const handshake = new XXHandshake(isInitiator, payload, this.prologue, this.crypto, this.staticKeys, connection, remotePeer); - try { - await handshake.propose(); - await handshake.exchange(); - await handshake.finish(); - this.metrics?.xxHandshakeSuccesses.increment(); - } - catch (e) { - this.metrics?.xxHandshakeErrors.increment(); - if (e instanceof Error) { - e.message = `Error occurred during XX handshake: ${e.message}`; - throw e; - } - } - return handshake; - } - async createSecureConnection(connection, handshake) { - // Create encryption box/unbox wrapper - const [secure, user] = duplexPair(); - const network = connection.unwrap(); - await pipe(secure, // write to wrapper - encryptStream(handshake, this.metrics), // encrypt data + prefix with message length - network, // send to the remote peer - (source) => decode(source, { lengthDecoder: uint16BEDecode }), // read message length prefix - decryptStream(handshake, this.metrics), // decrypt the incoming data - secure // pipe to the wrapper - ); - return user; - } -} -//# sourceMappingURL=noise.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/noise.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/noise.js.map deleted file mode 100644 index dae7d9748..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/noise.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise.js","sourceRoot":"","sources":["../../src/noise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAA6B,MAAM,2BAA2B,CAAA;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAwB,eAAe,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AA+BvC,MAAM,OAAO,KAAK;IACT,QAAQ,GAAG,QAAQ,CAAA;IACnB,MAAM,CAAkB;IAEd,QAAQ,CAAY;IACpB,UAAU,CAAS;IACnB,UAAU,CAAkB;IAC5B,OAAO,CAAkB;IAE1C,YAAa,OAAkB,EAAE;QAC/B,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;QAE3E,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,aAAa,CAAA;QACrC,IAAI,CAAC,UAAU,GAA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,CAAA;YACzB,MAAM,SAAS,CAAC,QAAQ,EAAE,CAAA;YAC1B,MAAM,SAAS,CAAC,MAAM,EAAE,CAAA;YACxB,IAAI,CAAC,OAAO,EAAE,oBAAoB,CAAC,SAAS,EAAE,CAAA;SAC/C;QAAC,OAAO,CAAU,EAAE;YACnB,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,SAAS,EAAE,CAAA;YAC3C,IAAI,CAAC,YAAY,KAAK,EAAE;gBACtB,CAAC,CAAC,OAAO,GAAG,uCAAuC,CAAC,CAAC,OAAO,EAAE,CAAA;gBAC9D,MAAM,CAAC,CAAA;aACR;SACF;QAED,OAAO,SAAS,CAAA;IAClB,CAAC;IAEO,KAAK,CAAC,sBAAsB,CAClC,UAAqF,EACrF,SAAqB;QAErB,sCAAsC;QACtC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,UAAU,EAA+B,CAAA;QAChE,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,CAAA;QAEnC,MAAM,IAAI,CACR,MAAM,EAAE,mBAAmB;QAC3B,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,4CAA4C;QACpF,OAAO,EAAE,0BAA0B;QACnC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC,EAAE,6BAA6B;QAC5F,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,4BAA4B;QACpE,MAAM,CAAC,sBAAsB;SAC9B,CAAA;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/nonce.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/nonce.d.ts deleted file mode 100644 index 662855bd3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/nonce.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { bytes, uint64 } from './@types/basic.js'; -export declare const MIN_NONCE = 0; -export declare const MAX_NONCE = 4294967295; -/** - * The nonce is an uint that's increased over time. - * Maintaining different representations help improve performance. - */ -export declare class Nonce { - private n; - private readonly bytes; - private readonly view; - constructor(n?: number); - increment(): void; - getBytes(): bytes; - getUint64(): uint64; - assertValue(): void; -} -//# sourceMappingURL=nonce.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/nonce.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/nonce.d.ts.map deleted file mode 100644 index 6e502d077..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/nonce.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nonce.d.ts","sourceRoot":"","sources":["../../src/nonce.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAEtD,eAAO,MAAM,SAAS,IAAI,CAAA;AAO1B,eAAO,MAAM,SAAS,aAAa,CAAA;AAInC;;;GAGG;AACH,qBAAa,KAAK;IAChB,OAAO,CAAC,CAAC,CAAQ;IACjB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;IAC7B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;gBAElB,CAAC,SAAY;IAO1B,SAAS,IAAK,IAAI;IAMlB,QAAQ,IAAK,KAAK;IAIlB,SAAS,IAAK,MAAM;IAIpB,WAAW,IAAK,IAAI;CAKrB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/nonce.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/nonce.js deleted file mode 100644 index 0130475cf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/nonce.js +++ /dev/null @@ -1,42 +0,0 @@ -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -export const MIN_NONCE = 0; -// For performance reasons, the nonce is represented as a JS `number` -// Although JS `number` can safely represent integers up to 2 ** 53 - 1, we choose to only use -// 4 bytes to store the data for performance reason. -// This is a slight deviation from the noise spec, which describes the max nonce as 2 ** 64 - 2 -// The effect is that this implementation will need a new handshake to be performed after fewer messages are exchanged than other implementations with full uint64 nonces. -// this MAX_NONCE is still a large number of messages, so the practical effect of this is negligible. -export const MAX_NONCE = 0xffffffff; -const ERR_MAX_NONCE = 'Cipherstate has reached maximum n, a new handshake must be performed'; -/** - * The nonce is an uint that's increased over time. - * Maintaining different representations help improve performance. - */ -export class Nonce { - n; - bytes; - view; - constructor(n = MIN_NONCE) { - this.n = n; - this.bytes = uint8ArrayAlloc(12); - this.view = new DataView(this.bytes.buffer, this.bytes.byteOffset, this.bytes.byteLength); - this.view.setUint32(4, n, true); - } - increment() { - this.n++; - // Even though we're treating the nonce as 8 bytes, RFC7539 specifies 12 bytes for a nonce. - this.view.setUint32(4, this.n, true); - } - getBytes() { - return this.bytes; - } - getUint64() { - return this.n; - } - assertValue() { - if (this.n > MAX_NONCE) { - throw new Error(ERR_MAX_NONCE); - } - } -} -//# sourceMappingURL=nonce.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/nonce.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/nonce.js.map deleted file mode 100644 index d663be87f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/nonce.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nonce.js","sourceRoot":"","sources":["../../src/nonce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,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to/payload.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/proto/payload.d.ts deleted file mode 100644 index 9d10fef73..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/proto/payload.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { type Codec } from 'protons-runtime'; -import type { Uint8ArrayList } from 'uint8arraylist'; -export interface NoiseExtensions { - webtransportCerthashes: Uint8Array[]; -} -export declare namespace NoiseExtensions { - const codec: () => Codec; - const encode: (obj: Partial) => Uint8Array; - const decode: (buf: Uint8Array | Uint8ArrayList) => NoiseExtensions; -} -export interface NoiseHandshakePayload { - identityKey: Uint8Array; - identitySig: Uint8Array; - extensions?: NoiseExtensions; -} -export declare namespace NoiseHandshakePayload { - const codec: () => Codec; - const encode: (obj: Partial) => Uint8Array; - const decode: (buf: Uint8Array | Uint8ArrayList) => NoiseHandshakePayload; -} -//# sourceMappingURL=payload.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/proto/payload.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/proto/payload.d.ts.map deleted file mode 100644 index 69519e688..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/proto/payload.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/proto/payload.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,KAAK,EAAyC,MAAM,iBAAiB,CAAA;AAEnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,WAAW,eAAe;IAC9B,sBAAsB,EAAE,UAAU,EAAE,CAAA;CACrC;AAED,yBAAiB,eAAe,CAAC;IAGxB,MAAM,KAAK,QAAO,MAAM,eAAe,CA4C7C,CAAA;IAEM,MAAM,MAAM,QAAS,QAAQ,eAAe,CAAC,KAAG,UAEtD,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,GAAG,cAAc,KAAG,eAEzD,CAAA;CACF;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,UAAU,CAAA;IACvB,WAAW,EAAE,UAAU,CAAA;IACvB,UAAU,CAAC,EAAE,eAAe,CAAA;CAC7B;AAED,yBAAiB,qBAAqB,CAAC;IAG9B,MAAM,KAAK,QAAO,MAAM,qBAAqB,CA6DnD,CAAA;IAEM,MAAM,MAAM,QAAS,QAAQ,qBAAqB,CAAC,KAAG,UAE5D,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,GAAG,cAAc,KAAG,qBAEzD,CAAA;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/proto/payload.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/proto/payload.js deleted file mode 100644 index 6ff217bdf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/proto/payload.js +++ /dev/null @@ -1,119 +0,0 @@ -/* eslint-disable import/export */ -/* eslint-disable complexity */ -/* eslint-disable @typescript-eslint/no-namespace */ -/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ -/* eslint-disable @typescript-eslint/no-empty-interface */ -import { decodeMessage, encodeMessage, message } from 'protons-runtime'; -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -export var NoiseExtensions; -(function (NoiseExtensions) { - let _codec; - NoiseExtensions.codec = () => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork(); - } - if (obj.webtransportCerthashes != null) { - for (const value of obj.webtransportCerthashes) { - w.uint32(10); - w.bytes(value); - } - } - if (opts.lengthDelimited !== false) { - w.ldelim(); - } - }, (reader, length) => { - const obj = { - webtransportCerthashes: [] - }; - const end = length == null ? reader.len : reader.pos + length; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - obj.webtransportCerthashes.push(reader.bytes()); - break; - } - default: { - reader.skipType(tag & 7); - break; - } - } - } - return obj; - }); - } - return _codec; - }; - NoiseExtensions.encode = (obj) => { - return encodeMessage(obj, NoiseExtensions.codec()); - }; - NoiseExtensions.decode = (buf) => { - return decodeMessage(buf, NoiseExtensions.codec()); - }; -})(NoiseExtensions || (NoiseExtensions = {})); -export var NoiseHandshakePayload; -(function (NoiseHandshakePayload) { - let _codec; - NoiseHandshakePayload.codec = () => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork(); - } - if ((obj.identityKey != null && obj.identityKey.byteLength > 0)) { - w.uint32(10); - w.bytes(obj.identityKey); - } - if ((obj.identitySig != null && obj.identitySig.byteLength > 0)) { - w.uint32(18); - w.bytes(obj.identitySig); - } - if (obj.extensions != null) { - w.uint32(34); - NoiseExtensions.codec().encode(obj.extensions, w); - } - if (opts.lengthDelimited !== false) { - w.ldelim(); - } - }, (reader, length) => { - const obj = { - identityKey: uint8ArrayAlloc(0), - identitySig: uint8ArrayAlloc(0) - }; - const end = length == null ? reader.len : reader.pos + length; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - obj.identityKey = reader.bytes(); - break; - } - case 2: { - obj.identitySig = reader.bytes(); - break; - } - case 4: { - obj.extensions = NoiseExtensions.codec().decode(reader, reader.uint32()); - break; - } - default: { - reader.skipType(tag & 7); - break; - } - } - } - return obj; - }); - } - return _codec; - }; - NoiseHandshakePayload.encode = (obj) => { - return encodeMessage(obj, NoiseHandshakePayload.codec()); - }; - NoiseHandshakePayload.decode = (buf) => { - return decodeMessage(buf, NoiseHandshakePayload.codec()); - }; -})(NoiseHandshakePayload || (NoiseHandshakePayload = {})); -//# sourceMappingURL=payload.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/proto/payload.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/proto/payload.js.map deleted file mode 100644 index d87a4016f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/proto/payload.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../src/proto/payload.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,+BAA+B;AAC/B,oDAAoD;AACpD,8EAA8E;AAC9E,0DAA0D;AAE1D,OAAO,EAAc,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACnF,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAO5D,MAAM,KAAW,eAAe,CAwD/B;AAxDD,WAAiB,eAAe;IAC9B,IAAI,MAA8B,CAAA;IAErB,qBAAK,GAAG,GAA2B,EAAE;QAChD,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,GAAG,OAAO,CAAkB,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,EAAE;gBACtD,IAAI,IAAI,CAAC,eAAe,KAAK,KAAK,EAAE;oBAClC,CAAC,CAAC,IAAI,EAAE,CAAA;iBACT;gBAED,IAAI,GAAG,CAAC,sBAAsB,IAAI,IAAI,EAAE;oBACtC,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,sBAAsB,EAAE;wBAC9C,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;wBACZ,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;qBACf;iBACF;gBAED,IAAI,IAAI,CAAC,eAAe,KAAK,KAAK,EAAE;oBAClC,CAAC,CAAC,MAAM,EAAE,CAAA;iBACX;YACH,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE;gBACpB,MAAM,GAAG,GA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AM,EAAE,CAAA;oBAE3B,QAAQ,GAAG,KAAK,CAAC,EAAE;wBACjB,KAAK,CAAC,CAAC,CAAC;4BACN,GAAG,CAAC,WAAW,GAAG,MAAM,CAAC,KAAK,EAAE,CAAA;4BAChC,MAAK;yBACN;wBACD,KAAK,CAAC,CAAC,CAAC;4BACN,GAAG,CAAC,WAAW,GAAG,MAAM,CAAC,KAAK,EAAE,CAAA;4BAChC,MAAK;yBACN;wBACD,KAAK,CAAC,CAAC,CAAC;4BACN,GAAG,CAAC,UAAU,GAAG,eAAe,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;4BACxE,MAAK;yBACN;wBACD,OAAO,CAAC,CAAC;4BACP,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;4BACxB,MAAK;yBACN;qBACF;iBACF;gBAED,OAAO,GAAG,CAAA;YACZ,CAAC,CAAC,CAAA;SACH;QAED,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;IAEY,4BAAM,GAAG,CAAC,GAAmC,EAAc,EAAE;QACxE,OAAO,aAAa,CAAC,GAAG,EAAE,qBAAqB,CAAC,KAAK,EAAE,CAAC,CAAA;IAC1D,CAAC,CAAA;IAEY,4BAAM,GAAG,CAAC,GAAgC,EAAyB,EAAE;QAChF,OAAO,aAAa,CAAC,GAAG,EAAE,qBAAqB,CAAC,KAAK,EAAE,CAAC,CAAA;IAC1D,CAAC,CAAA;AACH,CAAC,EAzEgB,qBAAqB,KAArB,qBAAqB,QAyErC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/utils.d.ts deleted file mode 100644 index 84d925c27..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/utils.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { type NoiseExtensions, NoiseHandshakePayload } from './proto/payload.js'; -import type { bytes } from './@types/basic.js'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export declare function getPayload(localPeer: PeerId, staticPublicKey: bytes, extensions?: NoiseExtensions): Promise; -export declare function createHandshakePayload(libp2pPublicKey: Uint8Array, signedPayload: Uint8Array, extensions?: NoiseExtensions): bytes; -export declare function signPayload(peerId: PeerId, payload: bytes): Promise; -export declare function getPeerIdFromPayload(payload: NoiseHandshakePayload): Promise; -export declare function decodePayload(payload: bytes | Uint8Array): NoiseHandshakePayload; -export declare function getHandshakePayload(publicKey: bytes): bytes; -/** - * Verifies signed payload, throws on any irregularities. - * - * @param {bytes} noiseStaticKey - owner's noise static key - * @param {bytes} payload - decoded payload - * @param {PeerId} remotePeer - owner's libp2p peer ID - * @returns {Promise} - peer ID of payload owner - */ -export declare function verifySignedPayload(noiseStaticKey: bytes, payload: NoiseHandshakePayload, remotePeer: PeerId): Promise; -export declare function isValidPublicKey(pk: bytes): boolean; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/utils.d.ts.map deleted file mode 100644 index 50f0d9642..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,wBAAsB,UAAU,CAC9B,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,KAAK,EACtB,UAAU,CAAC,EAAE,eAAe,GAC3B,OAAO,CAAC,KAAK,CAAC,CAYhB;AAED,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,UAAU,EAC3B,aAAa,EAAE,UAAU,EACzB,UAAU,CAAC,EAAE,eAAe,GAC3B,KAAK,CAMP;AAED,wBAAsB,WAAW,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAQjF;AAED,wBAAsB,oBAAoB,CAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAE3F;AAED,wBAAgB,aAAa,CAAE,OAAO,EAAE,KAAK,GAAG,UAAU,GAAG,qBAAqB,CAEjF;AAED,wBAAgB,mBAAmB,CAAE,SAAS,EAAE,KAAK,GAAG,KAAK,CAG5D;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,cAAc,EAAE,KAAK,EACrB,OAAO,EAAE,qBAAqB,EAC9B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAyBjB;AAED,wBAAgB,gBAAgB,CAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAUpD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/utils.js deleted file mode 100644 index b88ea5ef4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/utils.js +++ /dev/null @@ -1,74 +0,0 @@ -import { unmarshalPublicKey, unmarshalPrivateKey } from '@libp2p/crypto/keys'; -import { peerIdFromKeys } from '@libp2p/peer-id'; -import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { NoiseHandshakePayload } from './proto/payload.js'; -export async function getPayload(localPeer, staticPublicKey, extensions) { - const signedPayload = await signPayload(localPeer, getHandshakePayload(staticPublicKey)); - if (localPeer.publicKey == null) { - throw new Error('PublicKey was missing from local PeerId'); - } - return createHandshakePayload(localPeer.publicKey, signedPayload, extensions); -} -export function createHandshakePayload(libp2pPublicKey, signedPayload, extensions) { - return NoiseHandshakePayload.encode({ - identityKey: libp2pPublicKey, - identitySig: signedPayload, - extensions: extensions ?? { webtransportCerthashes: [] } - }).subarray(); -} -export async function signPayload(peerId, payload) { - if (peerId.privateKey == null) { - throw new Error('PrivateKey was missing from PeerId'); - } - const privateKey = await unmarshalPrivateKey(peerId.privateKey); - return privateKey.sign(payload); -} -export async function getPeerIdFromPayload(payload) { - return peerIdFromKeys(payload.identityKey); -} -export function decodePayload(payload) { - return NoiseHandshakePayload.decode(payload); -} -export function getHandshakePayload(publicKey) { - const prefix = uint8ArrayFromString('noise-libp2p-static-key:'); - return uint8ArrayConcat([prefix, publicKey], prefix.length + publicKey.length); -} -/** - * Verifies signed payload, throws on any irregularities. - * - * @param {bytes} noiseStaticKey - owner's noise static key - * @param {bytes} payload - decoded payload - * @param {PeerId} remotePeer - owner's libp2p peer ID - * @returns {Promise} - peer ID of payload owner - */ -export async function verifySignedPayload(noiseStaticKey, payload, remotePeer) { - // Unmarshaling from PublicKey protobuf - const payloadPeerId = await peerIdFromKeys(payload.identityKey); - if (!payloadPeerId.equals(remotePeer)) { - throw new Error(`Payload identity key ${payloadPeerId.toString()} does not match expected remote peer ${remotePeer.toString()}`); - } - const generatedPayload = getHandshakePayload(noiseStaticKey); - if (payloadPeerId.publicKey == null) { - throw new Error('PublicKey was missing from PeerId'); - } - if (payload.identitySig == null) { - throw new Error('Signature was missing from message'); - } - const publicKey = unmarshalPublicKey(payloadPeerId.publicKey); - const valid = await publicKey.verify(generatedPayload, payload.identitySig); - if (!valid) { - throw new Error("Static key doesn't match to peer that signed payload!"); - } - return payloadPeerId; -} -export function isValidPublicKey(pk) { - if (!(pk instanceof Uint8Array)) { - return false; - } - if (pk.length !== 32) { - return false; - } - return true; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/utils.js.map deleted file mode 100644 index 7e09ad531..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/src/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAwB,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAIhF,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,SAAiB,EACjB,eAAsB,EACtB,UAA4B;IAE5B,MAAM,aAAa,GAAG,MAAM,WAAW,CAAC,SAAS,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAA;IAExF,IAAI,SAAS,CAAC,SAAS,IAAI,IAAI,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAA;KAC3D;IAED,OAAO,sBAAsB,CAC3B,SAAS,CAAC,SAAS,EACnB,aAAa,EACb,UAAU,CACX,CAAA;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,eAA2B,EAC3B,aAAyB,EACzB,UAA4B;IAE5B,OAAO,qBAAqB,CAAC,MAAM,CAAC;QAClC,WAAW,EAAE,eAAe;QAC5B,WAAW,EAAE,aAAa;QAC1B,U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MAAM,gBAAgB,GAAG,mBAAmB,CAAC,cAAc,CAAC,CAAA;IAE5D,IAAI,aAAa,CAAC,SAAS,IAAI,IAAI,EAAE;QACnC,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;KACrD;IAED,IAAI,OAAO,CAAC,WAAW,IAAI,IAAI,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;KACtD;IAED,MAAM,SAAS,GAAG,kBAAkB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAA;IAE7D,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;IAE3E,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;KACzE;IAED,OAAO,aAAa,CAAA;AACtB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAE,EAAS;IACzC,IAAI,CAAC,CAAC,EAAE,YAAY,UAAU,CAAC,EAAE;QAC/B,OAAO,KAAK,CAAA;KACb;IAED,IAAI,EAAE,CAAC,MAAM,KAAK,EAAE,EAAE;QACpB,OAAO,KAAK,CAAA;KACb;IAED,OAAO,IAAI,CAAA;AACb,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/compliance.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/compliance.spec.d.ts deleted file mode 100644 index dac08d9d2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/compliance.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=compliance.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/compliance.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/compliance.spec.d.ts.map deleted file mode 100644 index dc9e71995..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/compliance.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.d.ts","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/compliance.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/compliance.spec.js deleted file mode 100644 index 68cfabeb5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/compliance.spec.js +++ /dev/null @@ -1,11 +0,0 @@ -import tests from '@libp2p/interface-compliance-tests/connection-encryption'; -import { Noise } from '../src/noise.js'; -describe('spec compliance tests', function () { - tests({ - async setup() { - return new Noise(); - }, - async teardown() { } - }); -}); -//# sourceMappingURL=compliance.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/compliance.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/compliance.spec.js.map deleted file mode 100644 index 43ca499a2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/compliance.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.js","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,0DAA0D,CAAA;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,QAAQ,CAAC,uBAAuB,EAAE;IAChC,KAAK,CAAC;QACJ,KAAK,CAAC,KAAK;YACT,OAAO,IAAI,KAAK,EAAE,CAAA;QACpB,CAAC;QACD,KAAK,CAAC,QAAQ,KAAK,CAAC;KACrB,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/fixtures/peer.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/fixtures/peer.d.ts deleted file mode 100644 index 7a23a4986..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/fixtures/peer.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PeerId } from '@libp2p/interface/peer-id'; -export declare function createPeerIdsFromFixtures(length: number): Promise; -export declare function createPeerIds(length: number): Promise; -//# sourceMappingURL=peer.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/fixtures/peer.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/fixtures/peer.d.ts.map deleted file mode 100644 index f076c8510..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/fixtures/peer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer.d.ts","sourceRoot":"","sources":["../../../test/fixtures/peer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAqBvD,wBAAsB,yBAAyB,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAIlF;AAED,wBAAsB,aAAa,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAQtE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/fixtures/peer.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/fixtures/peer.js deleted file mode 100644 index 307e38c37..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/fixtures/peer.js +++ /dev/null @@ -1,31 +0,0 @@ -import { createEd25519PeerId, createFromJSON } from '@libp2p/peer-id-factory'; -// ed25519 keys -const peers = [{ - id: '12D3KooWH45PiqBjfnEfDfCD6TqJrpqTBJvQDwGHvjGpaWwms46D', - privKey: 'CAESYBtKXrMwawAARmLScynQUuSwi/gGSkwqDPxi15N3dqDHa4T4iWupkMe5oYGwGH3Hyfvd/QcgSTqg71oYZJadJ6prhPiJa6mQx7mhgbAYfcfJ+939ByBJOqDvWhhklp0nqg==', - pubKey: 'CAESIGuE+IlrqZDHuaGBsBh9x8n73f0HIEk6oO9aGGSWnSeq' - }, { - id: '12D3KooWP63uzL78BRMpkQ7augMdNi1h3VBrVWZucKjyhzGVaSi1', - privKey: 'CAESYPxO3SHyfc2578hDmfkGGBY255JjiLuVavJWy+9ivlpsxSyVKf36ipyRGL6szGzHuFs5ceEuuGVrPMg/rW2Ch1bFLJUp/fqKnJEYvqzMbMe4Wzlx4S64ZWs8yD+tbYKHVg==', - pubKey: 'CAESIMUslSn9+oqckRi+rMxsx7hbOXHhLrhlazzIP61tgodW' - }, { - id: '12D3KooWF85R7CM2Wikdtb2sjwnd24e1tgojf3MEWwizmVB8PA6U', - privKey: 'CAESYNXoQ5CnooE939AEqE2JJGPqvhoFJn0xP+j9KwjfOfDkTtPyfn2kJ1gn3uOYTcmoHFU1bbETNtRVuPMi1fmDmqFO0/J+faQnWCfe45hNyagcVTVtsRM21FW48yLV+YOaoQ==', - pubKey: 'CAESIE7T8n59pCdYJ97jmE3JqBxVNW2xEzbUVbjzItX5g5qh' - }, { - id: '12D3KooWPCofiCjhdtezP4eMnqBjjutFZNHjV39F5LWNrCvaLnzT', - privKey: 'CAESYLhUut01XPu+yIPbtZ3WnxOd26FYuTMRn/BbdFYsZE2KxueKRlo9yIAxmFReoNFUKztUU4G2aUiTbqDQaA6i0MDG54pGWj3IgDGYVF6g0VQrO1RTgbZpSJNuoNBoDqLQwA==', - pubKey: 'CAESIMbnikZaPciAMZhUXqDRVCs7VFOBtmlIk26g0GgOotDA' - }]; -export async function createPeerIdsFromFixtures(length) { - return Promise.all(Array.from({ length }).map(async (_, i) => createFromJSON(peers[i]))); -} -export async function createPeerIds(length) { - const peerIds = []; - for (let i = 0; i < length; i++) { - const id = await createEd25519PeerId(); - peerIds.push(id); - } - return peerIds; -} -//# sourceMappingURL=peer.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/fixtures/peer.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/fixtures/peer.js.map deleted file mode 100644 index a0da6c2d9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/fixtures/peer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer.js","sourceRoot":"","sources":["../../../test/fixtures/peer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAG7E,eAAe;AACf,MAAM,KAAK,GAAG,CAAC;QACb,EAAE,EAAE,sDAAsD;QAC1D,OAAO,EAAE,0IAA0I;QACnJ,MAAM,EAAE,kDAAkD;KAC3D,EAAE;QACD,EAAE,EAAE,sDAAsD;QAC1D,OAAO,EAAE,0IAA0I;QACnJ,MAAM,EAAE,kDAAkD;KAC3D,EAAE;QACD,EAAE,EAAE,sDAAsD;QAC1D,OAAO,EAAE,0IAA0I;QACnJ,MAAM,EAAE,kDAAkD;KAC3D,EAAE;QACD,EAAE,EAAE,sDAAsD;QAC1D,OAAO,EAAE,0IAA0I;QACnJ,MAAM,EAAE,kDAAkD;KAC3D,CAAC,CAAA;AAEF,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAE,MAAc;IAC7D,OAAO,OAAO,CAAC,GAAG,CAChB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CACrE,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAE,MAAc;IACjD,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,MAAM,EAAE,GAAG,MAAM,mBAAmB,EAAE,CAAA;QACtC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;KACjB;IAED,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/handshakes/xx.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/handshakes/xx.spec.d.ts deleted file mode 100644 index 638a8ffa7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/handshakes/xx.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=xx.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/handshakes/xx.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/handshakes/xx.spec.d.ts.map deleted file mode 100644 index d46c424d4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/handshakes/xx.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx.spec.d.ts","sourceRoot":"","sources":["../../../test/handshakes/xx.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/handshakes/xx.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/handshakes/xx.spec.js deleted file mode 100644 index 1fb4f4029..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/handshakes/xx.spec.js +++ /dev/null @@ -1,126 +0,0 @@ -import { Buffer } from 'buffer'; -import { expect, assert } from 'aegir/chai'; -import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { pureJsCrypto } from '../../src/crypto/js.js'; -import { XX } from '../../src/handshakes/xx.js'; -import { createHandshakePayload, getHandshakePayload } from '../../src/utils.js'; -import { generateEd25519Keys } from '../utils.js'; -describe('XX Handshake', () => { - const prologue = Buffer.alloc(0); - it('Test creating new XX session', async () => { - try { - const xx = new XX(pureJsCrypto); - const kpInitiator = pureJsCrypto.generateX25519KeyPair(); - xx.initSession(true, prologue, kpInitiator); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('Test get HKDF', () => { - const ckBytes = Buffer.from('4e6f6973655f58585f32353531395f58436861436861506f6c795f53484132353600000000000000000000000000000000000000000000000000000000000000', 'hex'); - const ikm = Buffer.from('a3eae50ea37a47e8a7aa0c7cd8e16528670536dcd538cebfd724fb68ce44f1910ad898860666227d4e8dd50d22a9a64d1c0a6f47ace092510161e9e442953da3', 'hex'); - const ck = Buffer.alloc(32); - ckBytes.copy(ck); - const [k1, k2, k3] = pureJsCrypto.getHKDF(ck, ikm); - expect(uint8ArrayToString(k1, 'hex')).to.equal('cc5659adff12714982f806e2477a8d5ddd071def4c29bb38777b7e37046f6914'); - expect(uint8ArrayToString(k2, 'hex')).to.equal('a16ada915e551ab623f38be674bb4ef15d428ae9d80688899c9ef9b62ef208fa'); - expect(uint8ArrayToString(k3, 'hex')).to.equal('ff67bf9727e31b06efc203907e6786667d2c7a74ac412b4d31a80ba3fd766f68'); - }); - async function doHandshake(xx) { - const kpInit = pureJsCrypto.generateX25519KeyPair(); - const kpResp = pureJsCrypto.generateX25519KeyPair(); - // initiator setup - const libp2pInitKeys = await generateEd25519Keys(); - const initSignedPayload = await libp2pInitKeys.sign(getHandshakePayload(kpInit.publicKey)); - // responder setup - const libp2pRespKeys = await generateEd25519Keys(); - const respSignedPayload = await libp2pRespKeys.sign(getHandshakePayload(kpResp.publicKey)); - // initiator: new XX noise session - const nsInit = xx.initSession(true, prologue, kpInit); - // responder: new XX noise session - const nsResp = xx.initSession(false, prologue, kpResp); - /* STAGE 0 */ - // initiator creates payload - libp2pInitKeys.marshal().slice(0, 32); - const libp2pInitPubKey = libp2pInitKeys.marshal().slice(32, 64); - const payloadInitEnc = createHandshakePayload(libp2pInitPubKey, initSignedPayload); - // initiator sends message - const message = Buffer.concat([Buffer.alloc(0), payloadInitEnc]); - const messageBuffer = xx.sendMessage(nsInit, message); - expect(messageBuffer.ne.length).not.equal(0); - // responder receives message - xx.recvMessage(nsResp, messageBuffer); - /* STAGE 1 */ - // responder creates payload - libp2pRespKeys.marshal().slice(0, 32); - const libp2pRespPubKey = libp2pRespKeys.marshal().slice(32, 64); - const payloadRespEnc = createHandshakePayload(libp2pRespPubKey, respSignedPayload); - const message1 = Buffer.concat([message, payloadRespEnc]); - const messageBuffer2 = xx.sendMessage(nsResp, message1); - expect(messageBuffer2.ne.length).not.equal(0); - expect(messageBuffer2.ns.length).not.equal(0); - // initiator receive payload - xx.recvMessage(nsInit, messageBuffer2); - /* STAGE 2 */ - // initiator send message - const messageBuffer3 = xx.sendMessage(nsInit, Buffer.alloc(0)); - // responder receive message - xx.recvMessage(nsResp, messageBuffer3); - if (nsInit.cs1 == null || nsResp.cs1 == null || nsInit.cs2 == null || nsResp.cs2 == null) { - throw new Error('CipherState missing'); - } - assert(uint8ArrayEquals(nsInit.cs1.k, nsResp.cs1.k)); - assert(uint8ArrayEquals(nsInit.cs2.k, nsResp.cs2.k)); - return { nsInit, nsResp }; - } - it('Test handshake', async () => { - try { - const xx = new XX(pureJsCrypto); - await doHandshake(xx); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('Test symmetric encrypt and decrypt', async () => { - try { - const xx = new XX(pureJsCrypto); - const { nsInit, nsResp } = await doHandshake(xx); - const ad = Buffer.from('authenticated'); - const message = Buffer.from('HelloCrypto'); - if (nsInit.cs1 == null || nsResp.cs1 == null || nsInit.cs2 == null || nsResp.cs2 == null) { - throw new Error('CipherState missing'); - } - const ciphertext = xx.encryptWithAd(nsInit.cs1, ad, message); - assert(!uint8ArrayEquals(Buffer.from('HelloCrypto'), ciphertext), 'Encrypted message should not be same as plaintext.'); - const { plaintext: decrypted, valid } = xx.decryptWithAd(nsResp.cs1, ad, ciphertext); - assert(uint8ArrayEquals(Buffer.from('HelloCrypto'), decrypted), 'Decrypted text not equal to original message.'); - assert(valid); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('Test multiple messages encryption and decryption', async () => { - const xx = new XX(pureJsCrypto); - const { nsInit, nsResp } = await doHandshake(xx); - const ad = Buffer.from('authenticated'); - const message = Buffer.from('ethereum1'); - if (nsInit.cs1 == null || nsResp.cs1 == null || nsInit.cs2 == null || nsResp.cs2 == null) { - throw new Error('CipherState missing'); - } - const encrypted = xx.encryptWithAd(nsInit.cs1, ad, message); - const { plaintext: decrypted } = xx.decryptWithAd(nsResp.cs1, ad, encrypted); - assert.equal('ethereum1', uint8ArrayToString(decrypted, 'utf8'), 'Decrypted text not equal to original message.'); - const message2 = Buffer.from('ethereum2'); - const encrypted2 = xx.encryptWithAd(nsInit.cs1, ad, message2); - const { plaintext: decrypted2 } = xx.decryptWithAd(nsResp.cs1, ad, encrypted2); - assert.equal('ethereum2', uint8ArrayToString(decrypted2, 'utf-8'), 'Decrypted text not equal to original message.'); - }); -}); -//# sourceMappingURL=xx.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/handshakes/xx.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/handshakes/xx.spec.js.map deleted file mode 100644 index c1bd0610e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/handshakes/xx.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx.spec.js","sourceRoot":"","sources":["../../../test/handshakes/xx.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,EAAE,EAAE,MAAM,4BAA4B,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAIjD,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAEhC,EAAE,CAAC,8BAA8B,EAAE,KAAK,IAAI,EAAE;QAC5C,IAAI;YACF,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,YAAY,CAAC,CAAA;YAE/B,MAAM,WAAW,GAAY,YAAY,CAAC,qBAAqB,EAAE,CAAA;YAEjE,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAA;SAC5C;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,GAAG,GAAG,CAAU,CAAA;YACtB,MAAM,CAAC,KAA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IAAI,CAAC,WAAW,CAAC,CAAA;QACzC,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAA;QAC7D,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,EAAE,UAAU,CAAC,CAAA;QAC9E,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,kBAAkB,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,+CAA+C,CAAC,CAAA;IACrH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/index.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/index.spec.d.ts deleted file mode 100644 index b37c2d278..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/index.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/index.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/index.spec.d.ts.map deleted file mode 100644 index 5c897805d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/index.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../test/index.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/index.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/index.spec.js deleted file mode 100644 index 19e71aa40..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/index.spec.js +++ /dev/null @@ -1,49 +0,0 @@ -import { expect } from 'aegir/chai'; -import { lpStream } from 'it-length-prefixed-stream'; -import { duplexPair } from 'it-pair/duplex'; -import sinon from 'sinon'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { noise } from '../src/index.js'; -import { Noise } from '../src/noise.js'; -import { createPeerIdsFromFixtures } from './fixtures/peer.js'; -function createCounterSpy() { - return sinon.spy({ - increment: () => { }, - reset: () => { } - }); -} -describe('Index', () => { - it('should expose class with tag and required functions', () => { - const noiseInstance = noise()(); - expect(noiseInstance.protocol).to.equal('/noise'); - expect(typeof (noiseInstance.secureInbound)).to.equal('function'); - expect(typeof (noiseInstance.secureOutbound)).to.equal('function'); - }); - it('should collect metrics', async () => { - const [localPeer, remotePeer] = await createPeerIdsFromFixtures(2); - const metricsRegistry = new Map(); - const metrics = { - registerCounter: (name) => { - const counter = createCounterSpy(); - metricsRegistry.set(name, counter); - return counter; - } - }; - const noiseInit = new Noise({ metrics: metrics }); - const noiseResp = new Noise({}); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection, localPeer) - ]); - const wrappedInbound = lpStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - await wrappedOutbound.write(uint8ArrayFromString('test')); - await wrappedInbound.read(); - expect(metricsRegistry.get('libp2p_noise_xxhandshake_successes_total')?.increment.callCount).to.equal(1); - expect(metricsRegistry.get('libp2p_noise_xxhandshake_error_total')?.increment.callCount).to.equal(0); - expect(metricsRegistry.get('libp2p_noise_encrypted_packets_total')?.increment.callCount).to.equal(1); - expect(metricsRegistry.get('libp2p_noise_decrypt_errors_total')?.increment.callCount).to.equal(0); - }); -}); -//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/index.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/index.spec.js.map deleted file mode 100644 index 65a6567d3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/index.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../test/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAI9D,SAAS,gBAAgB;IACvB,OAAO,KAAK,CAAC,GAAG,CAAC;QACf,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;QACnB,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;KAChB,CAAC,CAAA;AACJ,CAAC;AAED,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC7D,MAAM,aAAa,GAAG,KAAK,EAAE,EAAE,CAAA;QAC/B,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QACjD,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU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AAc,CAAC,IAAI,EAAE,CAAA;QAC3B,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,0CAA0C,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACxG,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,sCAAsC,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACpG,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,sCAAsC,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACpG,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,mCAAmC,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACnG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/interop.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/interop.d.ts deleted file mode 100644 index f160cf14e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/interop.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=interop.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/interop.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/interop.d.ts.map deleted file mode 100644 index 14efbf496..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/interop.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interop.d.ts","sourceRoot":"","sources":["../../test/interop.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/interop.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/interop.js deleted file mode 100644 index 031d7f039..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/interop.js +++ /dev/null @@ -1,93 +0,0 @@ -import fs from 'fs'; -import { yamux } from '@chainsafe/libp2p-yamux'; -import { unmarshalPrivateKey } from '@libp2p/crypto/keys'; -import { createClient } from '@libp2p/daemon-client'; -import { createServer } from '@libp2p/daemon-server'; -import { connectInteropTests } from '@libp2p/interop'; -import { logger } from '@libp2p/logger'; -import { peerIdFromKeys } from '@libp2p/peer-id'; -import { tcp } from '@libp2p/tcp'; -import { multiaddr } from '@multiformats/multiaddr'; -import { execa } from 'execa'; -import { path as p2pd } from 'go-libp2p'; -import { createLibp2p } from 'libp2p'; -import pDefer from 'p-defer'; -import { noise } from '../src/index.js'; -async function createGoPeer(options) { - const controlPort = Math.floor(Math.random() * (50000 - 10000 + 1)) + 10000; - const apiAddr = multiaddr(`/ip4/0.0.0.0/tcp/${controlPort}`); - const log = logger(`go-libp2p:${controlPort}`); - const opts = [ - `-listen=${apiAddr.toString()}`, - '-hostAddrs=/ip4/0.0.0.0/tcp/0' - ]; - if (options.noise === true) { - opts.push('-noise=true'); - } - if (options.key != null) { - opts.push(`-id=${options.key}`); - } - const deferred = pDefer(); - const proc = execa(p2pd(), opts); - proc.stdout?.on('data', (buf) => { - const str = buf.toString(); - log(str); - // daemon has started - if (str.includes('Control socket:')) { - deferred.resolve(); - } - }); - proc.stderr?.on('data', (buf) => { - log.error(buf.toString()); - }); - await deferred.promise; - return { - client: createClient(apiAddr), - stop: async () => { - proc.kill(); - } - }; -} -async function createJsPeer(options) { - let peerId; - if (options.key != null) { - const keyFile = fs.readFileSync(options.key); - const privateKey = await unmarshalPrivateKey(keyFile); - peerId = await peerIdFromKeys(privateKey.public.bytes, privateKey.bytes); - } - const opts = { - peerId, - addresses: { - listen: ['/ip4/0.0.0.0/tcp/0'] - }, - transports: [tcp()], - streamMuxers: [yamux()], - connectionEncryption: [noise()] - }; - const node = await createLibp2p(opts); - const server = createServer(multiaddr('/ip4/0.0.0.0/tcp/0'), node); - await server.start(); - return { - client: createClient(server.getMultiaddr()), - stop: async () => { - await server.stop(); - await node.stop(); - } - }; -} -async function main() { - const factory = { - async spawn(options) { - if (options.type === 'go') { - return createGoPeer(options); - } - return createJsPeer(options); - } - }; - connectInteropTests(factory); -} -main().catch(err => { - console.error(err); // eslint-disable-line no-console - process.exit(1); -}); -//# sourceMappingURL=interop.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/interop.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/interop.js.map deleted file mode 100644 index 28efc87f8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/interop.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interop.js","sourceRoot":"","sources":["../../test/interop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EA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ACzE,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;IAEpB,OAAO;QACL,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QAC3C,IAAI,EAAE,KAAK,IAAI,EAAE;YACf,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;YACnB,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;QACnB,CAAC;KACF,CAAA;AACH,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAkB;QAC7B,KAAK,CAAC,KAAK,CAAE,OAAqB;YAChC,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE;gBACzB,OAAO,YAAY,CAAC,OAAO,CAAC,CAAA;aAC7B;YAED,OAAO,YAAY,CAAC,OAAO,CAAC,CAAA;QAC9B,CAAC;KACF,CAAA;IAED,mBAAmB,CAAC,OAAO,CAAC,CAAA;AAC9B,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA,CAAC,iCAAiC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/noise.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/noise.spec.d.ts deleted file mode 100644 index f520ec336..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/noise.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=noise.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/noise.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/noise.spec.d.ts.map deleted file mode 100644 index 2e9faaa67..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/noise.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise.spec.d.ts","sourceRoot":"","sources":["../../test/noise.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/noise.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/noise.spec.js deleted file mode 100644 index b8a3acafb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/noise.spec.js +++ /dev/null @@ -1,182 +0,0 @@ -import { Buffer } from 'buffer'; -import { assert, expect } from 'aegir/chai'; -import { randomBytes } from 'iso-random-stream'; -import { byteStream } from 'it-byte-stream'; -import { lpStream } from 'it-length-prefixed-stream'; -import { duplexPair } from 'it-pair/duplex'; -import sinon from 'sinon'; -import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { NOISE_MSG_MAX_LENGTH_BYTES } from '../src/constants.js'; -import { pureJsCrypto } from '../src/crypto/js.js'; -import { decode0, decode2, encode1, uint16BEDecode, uint16BEEncode } from '../src/encoder.js'; -import { XXHandshake } from '../src/handshake-xx.js'; -import { XX } from '../src/handshakes/xx.js'; -import { Noise } from '../src/noise.js'; -import { createHandshakePayload, getHandshakePayload, getPayload, signPayload } from '../src/utils.js'; -import { createPeerIdsFromFixtures } from './fixtures/peer.js'; -import { getKeyPairFromPeerId } from './utils.js'; -describe('Noise', () => { - let remotePeer, localPeer; - const sandbox = sinon.createSandbox(); - before(async () => { - [localPeer, remotePeer] = await createPeerIdsFromFixtures(2); - }); - afterEach(function () { - sandbox.restore(); - }); - it('should communicate through encrypted streams without noise pipes', async () => { - try { - const noiseInit = new Noise({ staticNoiseKey: undefined, extensions: undefined }); - const noiseResp = new Noise({ staticNoiseKey: undefined, extensions: undefined }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection, localPeer) - ]); - const wrappedInbound = lpStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - await wrappedOutbound.write(Buffer.from('test')); - const response = await wrappedInbound.read(); - expect(uint8ArrayToString(response.slice())).equal('test'); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('should test that secureOutbound is spec compliant', async () => { - const noiseInit = new Noise({ staticNoiseKey: undefined }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, { wrapped, handshake }] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - (async () => { - const wrapped = lpStream(inboundConnection, { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - }); - const prologue = Buffer.alloc(0); - const staticKeys = pureJsCrypto.generateX25519KeyPair(); - const xx = new XX(pureJsCrypto); - const payload = await getPayload(remotePeer, staticKeys.publicKey); - const handshake = new XXHandshake(false, payload, prologue, pureJsCrypto, staticKeys, wrapped, localPeer, xx); - let receivedMessageBuffer = decode0((await wrapped.read()).slice()); - // The first handshake message contains the initiator's ephemeral public key - expect(receivedMessageBuffer.ne.length).equal(32); - xx.recvMessage(handshake.session, receivedMessageBuffer); - // Stage 1 - const { publicKey: libp2pPubKey } = getKeyPairFromPeerId(remotePeer); - const signedPayload = await signPayload(remotePeer, getHandshakePayload(staticKeys.publicKey)); - const handshakePayload = createHandshakePayload(libp2pPubKey, signedPayload); - const messageBuffer = xx.sendMessage(handshake.session, handshakePayload); - await wrapped.write(encode1(messageBuffer)); - // Stage 2 - finish handshake - receivedMessageBuffer = decode2((await wrapped.read()).slice()); - xx.recvMessage(handshake.session, receivedMessageBuffer); - return { wrapped, handshake }; - })() - ]); - const wrappedOutbound = byteStream(outbound.conn); - await wrappedOutbound.write(uint8ArrayFromString('test')); - // Check that noise message is prefixed with 16-bit big-endian unsigned integer - const data = (await wrapped.read()).slice(); - const { plaintext: decrypted, valid } = handshake.decrypt(data, handshake.session); - // Decrypted data should match - expect(uint8ArrayEquals(decrypted, uint8ArrayFromString('test'))).to.be.true(); - expect(valid).to.be.true(); - }); - it('should test large payloads', async function () { - this.timeout(10000); - try { - const noiseInit = new Noise({ staticNoiseKey: undefined }); - const noiseResp = new Noise({ staticNoiseKey: undefined }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection, localPeer) - ]); - const wrappedInbound = byteStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - const largePlaintext = randomBytes(60000); - await wrappedOutbound.write(Buffer.from(largePlaintext)); - const response = await wrappedInbound.read(60000); - expect(response.length).equals(largePlaintext.length); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('should working without remote peer provided in incoming connection', async () => { - try { - const staticKeysInitiator = pureJsCrypto.generateX25519KeyPair(); - const noiseInit = new Noise({ staticNoiseKey: staticKeysInitiator.privateKey }); - const staticKeysResponder = pureJsCrypto.generateX25519KeyPair(); - const noiseResp = new Noise({ staticNoiseKey: staticKeysResponder.privateKey }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection) - ]); - const wrappedInbound = lpStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - await wrappedOutbound.write(Buffer.from('test v2')); - const response = await wrappedInbound.read(); - expect(uint8ArrayToString(response.slice())).equal('test v2'); - if (inbound.remotePeer.publicKey == null || localPeer.publicKey == null || - outbound.remotePeer.publicKey == null || remotePeer.publicKey == null) { - throw new Error('Public key missing from PeerId'); - } - assert(uint8ArrayEquals(inbound.remotePeer.publicKey, localPeer.publicKey)); - assert(uint8ArrayEquals(outbound.remotePeer.publicKey, remotePeer.publicKey)); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('should accept and return Noise extension from remote peer', async () => { - try { - const certhashInit = Buffer.from('certhash data from init'); - const staticKeysInitiator = pureJsCrypto.generateX25519KeyPair(); - const noiseInit = new Noise({ staticNoiseKey: staticKeysInitiator.privateKey, extensions: { webtransportCerthashes: [certhashInit] } }); - const staticKeysResponder = pureJsCrypto.generateX25519KeyPair(); - const certhashResp = Buffer.from('certhash data from respon'); - const noiseResp = new Noise({ staticNoiseKey: staticKeysResponder.privateKey, extensions: { webtransportCerthashes: [certhashResp] } }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection) - ]); - assert(uint8ArrayEquals(inbound.remoteExtensions?.webtransportCerthashes[0] ?? new Uint8Array(), certhashInit)); - assert(uint8ArrayEquals(outbound.remoteExtensions?.webtransportCerthashes[0] ?? new Uint8Array(), certhashResp)); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('should accept a prologue', async () => { - try { - const noiseInit = new Noise({ staticNoiseKey: undefined, crypto: pureJsCrypto, prologueBytes: Buffer.from('Some prologue') }); - const noiseResp = new Noise({ staticNoiseKey: undefined, crypto: pureJsCrypto, prologueBytes: Buffer.from('Some prologue') }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection, localPeer) - ]); - const wrappedInbound = lpStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - await wrappedOutbound.write(Buffer.from('test')); - const response = await wrappedInbound.read(); - expect(uint8ArrayToString(response.slice())).equal('test'); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); -}); -//# sourceMappingURL=noise.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/noise.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/noise.spec.js.map deleted file mode 100644 index 0f925ef77..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/noise.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise.spec.js","sourceRoot":"","sources":["../../test/noise.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAC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,OAAO,CAAC,CAAA;SAC3B;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/utils.d.ts deleted file mode 100644 index c7109157e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/utils.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { KeyPair } from '../src/@types/libp2p.js'; -import type { PrivateKey } from '@libp2p/interface/keys'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export declare function generateEd25519Keys(): Promise; -export declare function getKeyPairFromPeerId(peerId: PeerId): KeyPair; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/utils.d.ts.map deleted file mode 100644 index 5d1b75ca9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../test/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,wBAAsB,mBAAmB,IAAK,OAAO,CAAC,UAAU,CAAC,CAEhE;AAED,wBAAgB,oBAAoB,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAS7D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/utils.js deleted file mode 100644 index decf6328f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/utils.js +++ /dev/null @@ -1,14 +0,0 @@ -import { keys } from '@libp2p/crypto'; -export async function generateEd25519Keys() { - return keys.generateKeyPair('Ed25519', 32); -} -export function getKeyPairFromPeerId(peerId) { - if (peerId.privateKey == null || peerId.publicKey == null) { - throw new Error('PrivateKey or PublicKey missing from PeerId'); - } - return { - privateKey: peerId.privateKey.subarray(0, 32), - publicKey: peerId.publicKey - }; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/utils.js.map deleted file mode 100644 index b318263c0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../test/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAKrC,MAAM,CAAC,KAAK,UAAU,mBAAmB;IACvC,OAAO,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;AAC5C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAE,MAAc;IAClD,IAAI,MAAM,CAAC,UAAU,IAAI,IAAI,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI,EAAE;QACzD,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;KAC/D;IAED,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;QAC7C,SAAS,EAAE,MAAM,CAAC,SAAS;KAC5B,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/xx-handshake.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/xx-handshake.spec.d.ts deleted file mode 100644 index 32a0f4c79..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/xx-handshake.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=xx-handshake.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/xx-handshake.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/xx-handshake.spec.d.ts.map deleted file mode 100644 index fa3bf2512..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/xx-handshake.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx-handshake.spec.d.ts","sourceRoot":"","sources":["../../test/xx-handshake.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/xx-handshake.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/xx-handshake.spec.js deleted file mode 100644 index a89a68b08..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/xx-handshake.spec.js +++ /dev/null @@ -1,119 +0,0 @@ -import { Buffer } from 'buffer'; -import { assert, expect } from 'aegir/chai'; -import { lpStream } from 'it-length-prefixed-stream'; -import { duplexPair } from 'it-pair/duplex'; -import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; -import { defaultCrypto } from '../src/crypto/index.js'; -import { XXHandshake } from '../src/handshake-xx.js'; -import { getPayload } from '../src/utils.js'; -import { createPeerIdsFromFixtures } from './fixtures/peer.js'; -describe('XX Handshake', () => { - let peerA, peerB, fakePeer; - before(async () => { - [peerA, peerB, fakePeer] = await createPeerIdsFromFixtures(3); - }); - it('should propose, exchange and finish handshake', async () => { - try { - const duplex = duplexPair(); - const connectionFrom = lpStream(duplex[0]); - const connectionTo = lpStream(duplex[1]); - const prologue = Buffer.alloc(0); - const staticKeysInitiator = defaultCrypto.generateX25519KeyPair(); - const staticKeysResponder = defaultCrypto.generateX25519KeyPair(); - const initPayload = await getPayload(peerA, staticKeysInitiator.publicKey); - const handshakeInitiator = new XXHandshake(true, initPayload, prologue, defaultCrypto, staticKeysInitiator, connectionFrom, peerB); - const respPayload = await getPayload(peerB, staticKeysResponder.publicKey); - const handshakeResponder = new XXHandshake(false, respPayload, prologue, defaultCrypto, staticKeysResponder, connectionTo, peerA); - await Promise.all([ - handshakeInitiator.propose(), - handshakeResponder.propose() - ]); - await Promise.all([ - handshakeResponder.exchange(), - handshakeInitiator.exchange() - ]); - await Promise.all([ - handshakeInitiator.finish(), - handshakeResponder.finish() - ]); - const sessionInitator = handshakeInitiator.session; - const sessionResponder = handshakeResponder.session; - // Test shared key - if (sessionInitator.cs1 && sessionResponder.cs1 && sessionInitator.cs2 && sessionResponder.cs2) { - assert(uint8ArrayEquals(sessionInitator.cs1.k, sessionResponder.cs1.k)); - assert(uint8ArrayEquals(sessionInitator.cs2.k, sessionResponder.cs2.k)); - } - else { - assert(false); - } - // Test encryption and decryption - const encrypted = handshakeInitiator.encrypt(Buffer.from('encryptthis'), handshakeInitiator.session); - const { plaintext: decrypted, valid } = handshakeResponder.decrypt(encrypted, handshakeResponder.session); - assert(uint8ArrayEquals(decrypted, Buffer.from('encryptthis'))); - assert(valid); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('Initiator should fail to exchange handshake if given wrong public key in payload', async () => { - try { - const duplex = duplexPair(); - const connectionFrom = lpStream(duplex[0]); - const connectionTo = lpStream(duplex[1]); - const prologue = Buffer.alloc(0); - const staticKeysInitiator = defaultCrypto.generateX25519KeyPair(); - const staticKeysResponder = defaultCrypto.generateX25519KeyPair(); - const initPayload = await getPayload(peerA, staticKeysInitiator.publicKey); - const handshakeInitiator = new XXHandshake(true, initPayload, prologue, defaultCrypto, staticKeysInitiator, connectionFrom, fakePeer); - const respPayload = await getPayload(peerB, staticKeysResponder.publicKey); - const handshakeResponder = new XXHandshake(false, respPayload, prologue, defaultCrypto, staticKeysResponder, connectionTo, peerA); - await Promise.all([ - handshakeInitiator.propose(), - handshakeResponder.propose() - ]); - await Promise.all([ - handshakeResponder.exchange(), - handshakeInitiator.exchange() - ]); - assert(false, 'Should throw exception'); - } - catch (e) { - const err = e; - expect(err.message).equals(`Error occurred while verifying signed payload: Payload identity key ${peerB.toString()} does not match expected remote peer ${fakePeer.toString()}`); - } - }); - it('Responder should fail to exchange handshake if given wrong public key in payload', async () => { - try { - const duplex = duplexPair(); - const connectionFrom = lpStream(duplex[0]); - const connectionTo = lpStream(duplex[1]); - const prologue = Buffer.alloc(0); - const staticKeysInitiator = defaultCrypto.generateX25519KeyPair(); - const staticKeysResponder = defaultCrypto.generateX25519KeyPair(); - const initPayload = await getPayload(peerA, staticKeysInitiator.publicKey); - const handshakeInitiator = new XXHandshake(true, initPayload, prologue, defaultCrypto, staticKeysInitiator, connectionFrom, peerB); - const respPayload = await getPayload(peerB, staticKeysResponder.publicKey); - const handshakeResponder = new XXHandshake(false, respPayload, prologue, defaultCrypto, staticKeysResponder, connectionTo, fakePeer); - await Promise.all([ - handshakeInitiator.propose(), - handshakeResponder.propose() - ]); - await Promise.all([ - handshakeResponder.exchange(), - handshakeInitiator.exchange() - ]); - await Promise.all([ - handshakeInitiator.finish(), - handshakeResponder.finish() - ]); - assert(false, 'Should throw exception'); - } - catch (e) { - const err = e; - expect(err.message).equals(`Error occurred while verifying signed payload: Payload identity key ${peerA.toString()} does not match expected remote peer ${fakePeer.toString()}`); - } - }); -}); -//# sourceMappingURL=xx-handshake.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/xx-handshake.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/xx-handshake.spec.js.map deleted file mode 100644 index 6b3161d8a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/test/xx-handshake.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx-handshake.spec.js","sourceRoot":"","sources":["../../test/xx-handshake.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAG9D,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAI,KAAa,EAAE,KAAa,EAAE,QAAgB,CAAA;IAElD,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,MAAM,yBAAyB,CAAC,CAAC,CAAC,CAAA;IAC/D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC7D,IAAI;YACF,MAAM,MAAM,GAAG,UAAU,EAAc,CAAA;YACvC,MAAM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CAAC,CAAA;YAEF,MAAM,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAA;SACxC;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,GAAG,GAAG,CAAU,CAAA;YACtB,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,uEAAuE,KAAK,CAAC,QAAQ,EAAE,wCAAwC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;SACjL;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/tsconfig.tsbuildinfo deleted file mode 100644 index def3f48e9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/constants.ts","../src/@types/basic.ts","../node_modules/protons-runtime/dist/src/codec.d.ts","../node_modules/uint8arraylist/dist/src/index.d.ts","../node_modules/protons-runtime/dist/src/decode.d.ts","../node_modules/protons-runtime/dist/src/encode.d.ts","../node_modules/protons-runtime/dist/src/codecs/enum.d.ts","../node_modules/protons-runtime/dist/src/codecs/message.d.ts","../node_modules/protons-runtime/dist/src/utils/reader.d.ts","../node_modules/protons-runtime/dist/src/utils/writer.d.ts","../node_modules/protons-runtime/dist/src/index.d.ts","../node_modules/uint8arrays/dist/src/alloc.d.ts","../src/proto/payload.ts","../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface/dist/src/peer-id/index.d.ts","../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-info/index.d.ts","../node_modules/@libp2p/interface/dist/src/content-routing/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/buffer/index.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@libp2p/interface/dist/src/events.d.ts","../node_modules/@libp2p/interface/dist/src/metrics/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-routing/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-store/index.d.ts","../node_modules/@libp2p/interface/dist/src/startable.d.ts","../node_modules/@libp2p/interface/dist/src/stream-handler/index.d.ts","../node_modules/@libp2p/interface/dist/src/topology/index.d.ts","../node_modules/it-stream-types/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/index.d.ts","../node_modules/@libp2p/interface/dist/src/transport/index.d.ts","../node_modules/@libp2p/interface/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-encrypter/index.d.ts","../src/@types/libp2p.ts","../src/nonce.ts","../src/@types/handshake.ts","../src/crypto.ts","../node_modules/it-length-prefixed/dist/src/encode.d.ts","../node_modules/it-reader/dist/src/index.d.ts","../node_modules/it-length-prefixed/dist/src/decode.d.ts","../node_modules/it-length-prefixed/dist/src/index.d.ts","../src/encoder.ts","../node_modules/@libp2p/interface/dist/src/errors.d.ts","../node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../node_modules/multiformats/dist/types/src/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../node_modules/multiformats/dist/types/src/varint.d.ts","../node_modules/multiformats/dist/types/src/bytes.d.ts","../node_modules/multiformats/dist/types/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ed25519-class.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/interface.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ecdh.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ephemeral-keys.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/key-stretcher.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/keys.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/rsa-class.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/secp256k1-class.d.ts","../node_modules/@libp2p/interface/dist/src/keys/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/index.d.ts","../node_modules/@libp2p/peer-id/dist/src/index.d.ts","../node_modules/uint8arrays/dist/src/concat.d.ts","../node_modules/multiformats/dist/types/src/codecs/raw.d.ts","../node_modules/multiformats/dist/types/src/codecs/json.d.ts","../node_modules/multiformats/dist/types/src/bases/base.d.ts","../node_modules/multiformats/dist/types/src/basics.d.ts","../node_modules/uint8arrays/dist/src/util/bases.d.ts","../node_modules/uint8arrays/dist/src/from-string.d.ts","../src/utils.ts","../node_modules/uint8arrays/dist/src/compare.d.ts","../node_modules/uint8arrays/dist/src/equals.d.ts","../node_modules/uint8arrays/dist/src/to-string.d.ts","../node_modules/uint8arrays/dist/src/xor.d.ts","../node_modules/uint8arrays/dist/src/index.d.ts","../node_modules/@libp2p/logger/dist/src/index.d.ts","../src/logger.ts","../src/handshakes/abstract-handshake.ts","../src/handshakes/xx.ts","../src/@types/handshake-interface.ts","../node_modules/it-byte-stream/dist/src/index.d.ts","../node_modules/it-length-prefixed-stream/dist/src/index.d.ts","../src/handshake-xx.ts","../node_modules/it-pair/dist/src/duplex.d.ts","../node_modules/it-pipe/dist/src/index.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/types.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/wasm.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/chacha20poly1305.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/poly1305.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/chacha20.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/index.d.ts","../node_modules/@chainsafe/as-sha256/lib/hashobject.d.ts","../node_modules/@chainsafe/as-sha256/lib/wasm.d.ts","../node_modules/@chainsafe/as-sha256/lib/sha256.d.ts","../node_modules/@chainsafe/as-sha256/lib/index.d.ts","../node_modules/wherearewe/dist/src/index.d.ts","../node_modules/@noble/ciphers/utils.d.ts","../node_modules/@noble/ciphers/chacha.d.ts","../node_modules/@noble/curves/abstract/utils.d.ts","../node_modules/@noble/curves/abstract/modular.d.ts","../node_modules/@noble/curves/abstract/curve.d.ts","../node_modules/@noble/curves/abstract/edwards.d.ts","../node_modules/@noble/curves/abstract/hash-to-curve.d.ts","../node_modules/@noble/curves/abstract/montgomery.d.ts","../node_modules/@noble/curves/ed25519.d.ts","../node_modules/@noble/hashes/utils.d.ts","../node_modules/@noble/hashes/hkdf.d.ts","../node_modules/@noble/hashes/_sha2.d.ts","../node_modules/@noble/hashes/sha256.d.ts","../src/crypto/js.ts","../src/crypto/index.ts","../src/metrics.ts","../src/crypto/streaming.ts","../src/noise.ts","../src/index.ts","../src/crypto/index.browser.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/index.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/connection-encryption/index.d.ts","../test/compliance.spec.ts","../node_modules/@types/chai/index.d.ts","../node_modules/@types/chai-as-promised/index.d.ts","../node_modules/chai-parentheses/index.d.ts","../node_modules/@types/chai-subset/index.d.ts","../node_modules/chai-bites/index.d.ts","../node_modules/@types/chai-string/index.d.ts","../node_modules/aegir/dist/utils/chai.d.ts","../node_modules/@types/sinonjs__fake-timers/index.d.ts","../node_modules/@types/sinon/index.d.ts","../node_modules/@libp2p/peer-id-factory/dist/src/index.d.ts","../test/fixtures/peer.ts","../test/index.spec.ts","../node_modules/it-pushable/dist/src/index.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/config.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/frame.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/stream.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/muxer.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/index.d.ts","../node_modules/@libp2p/daemon-protocol/dist/src/index.d.ts","../node_modules/@libp2p/daemon-protocol/dist/src/stream-handler.d.ts","../node_modules/@libp2p/daemon-client/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/pubsub/index.d.ts","../node_modules/protobufjs/index.d.ts","../node_modules/protobufjs/minimal.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/decoderpc.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message-cache.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/metrics.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/set.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-stats.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/compute-score.d.ts","../node_modules/denque/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/message-deliveries.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/tracer.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/config.d.ts","../node_modules/@libp2p/peer-collections/dist/src/map.d.ts","../node_modules/@libp2p/peer-collections/dist/src/set.d.ts","../node_modules/@libp2p/peer-collections/dist/src/list.d.ts","../node_modules/@libp2p/peer-collections/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/connection-manager/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/registrar/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/key.d.ts","../node_modules/interface-store/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/providers.d.ts","../node_modules/@libp2p/interface-internal/dist/src/address-manager/index.d.ts","../node_modules/progress-events/dist/src/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/record/record.d.ts","../node_modules/@libp2p/kad-dht/dist/src/record/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/index.d.ts","../node_modules/@libp2p/daemon-server/dist/src/index.d.ts","../node_modules/@libp2p/interop/dist/src/connect.d.ts","../node_modules/@libp2p/interop/dist/src/dht/index.d.ts","../node_modules/@libp2p/interop/dist/src/pubsub/index.d.ts","../node_modules/@libp2p/interop/dist/src/relay/index.d.ts","../node_modules/@libp2p/interop/dist/src/streams/index.d.ts","../node_modules/@libp2p/interop/dist/src/index.d.ts","../node_modules/@libp2p/tcp/dist/src/listener.d.ts","../node_modules/@libp2p/tcp/dist/src/index.d.ts","../node_modules/execa/index.d.ts","../node_modules/go-libp2p/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/transport-manager/index.d.ts","../node_modules/libp2p/dist/src/address-manager/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-gater/index.d.ts","../node_modules/libp2p/dist/src/components.d.ts","../node_modules/libp2p/dist/src/connection-manager/auto-dial.d.ts","../node_modules/libp2p/dist/src/connection-manager/connection-pruner.d.ts","../node_modules/eventemitter3/index.d.ts","../node_modules/p-queue/dist/queue.d.ts","../node_modules/p-queue/dist/options.d.ts","../node_modules/p-queue/dist/priority-queue.d.ts","../node_modules/p-queue/dist/index.d.ts","../node_modules/libp2p/dist/src/connection-manager/dial-queue.d.ts","../node_modules/libp2p/dist/src/connection-manager/index.d.ts","../node_modules/libp2p/dist/src/transport-manager.d.ts","../node_modules/@libp2p/interface/dist/src/peer-discovery/index.d.ts","../node_modules/@libp2p/keychain/dist/src/index.d.ts","../node_modules/@libp2p/peer-store/dist/src/index.d.ts","../node_modules/libp2p/dist/src/index.d.ts","../node_modules/p-defer/index.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface-peer-id/dist/src/index.d.ts","../test/interop.ts","../node_modules/iso-random-stream/dist/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/aes/index.d.ts","../node_modules/@libp2p/crypto/dist/src/hmac/index.d.ts","../node_modules/@libp2p/crypto/dist/src/pbkdf2.d.ts","../node_modules/@libp2p/crypto/dist/src/random-bytes.d.ts","../node_modules/@libp2p/crypto/dist/src/index.d.ts","../test/utils.ts","../test/noise.spec.ts","../test/xx-handshake.spec.ts","../test/handshakes/xx.spec.ts","../node_modules/keyv/src/index.d.ts","../node_modules/@types/http-cache-semantics/index.d.ts","../node_modules/@types/responselike/index.d.ts","../node_modules/@types/cacheable-request/index.d.ts","../node_modules/@types/ms/index.d.ts","../node_modules/@types/debug/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/keyv/index.d.ts","../node_modules/@types/linkify-it/index.d.ts","../node_modules/@types/mdurl/encode.d.ts","../node_modules/@types/mdurl/decode.d.ts","../node_modules/@types/mdurl/parse.d.ts","../node_modules/@types/mdurl/format.d.ts","../node_modules/@types/mdurl/index.d.ts","../node_modules/@types/markdown-it/lib/common/utils.d.ts","../node_modules/@types/markdown-it/lib/token.d.ts","../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../node_modules/@types/markdown-it/lib/ruler.d.ts","../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../node_modules/@types/markdown-it/lib/parser_block.d.ts","../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../node_modules/@types/markdown-it/lib/parser_core.d.ts","../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../node_modules/@types/markdown-it/lib/renderer.d.ts","../node_modules/@types/markdown-it/lib/index.d.ts","../node_modules/@types/markdown-it/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/mdast/index.d.ts","../node_modules/@types/minimatch/index.d.ts","../node_modules/@types/minimist/index.d.ts","../node_modules/@types/mocha/index.d.ts","../node_modules/@types/normalize-package-data/index.d.ts","../node_modules/@types/parse-json/index.d.ts","../node_modules/@types/retry/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts","../node_modules/@types/strip-bom/index.d.ts","../node_modules/@types/strip-json-comments/index.d.ts","../node_modules/@types/ungap__structured-clone/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts","../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"1bc2fdadc59c4529e51cd693e1bb45c0f9d6c4cf079b008fa3a17da4cd08af44","signature":"a5b2968580425f209992ad1d8a62ab079d84643e00e0f0b11f65fe6423a643f5"},{"version":"a00b40912153391370bfc844161907779723e82cd2d671b3bebea763212f048e","signature":"35095a100857bdbca3c31ddd6e1eb18259140dee0092d97e631889daf084eaec"},"fd617cc8eec6f43227ab572160bac9d23c723073e83a9b100bd15c758eff34c2","176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d","ec3786b43d68955ecdb12ce679d3bc61b6b25c4d0ac5bcdaf50fa4a746189b98","3155e98b0df0c1523715e8a1c75c8a67c401aeb58d6eccf8bd89d5d775b8c1cf","fa82b7b22d9df87323e31e9e2ad75911028f3e544647fd212424b3c4452fee3f","90aa0b916eef195a17c3dbd621746f82ac7969ecc3dbf27c81ee4c68c5af7f25","9ceec2a882368c0160a8a3879aa0efce0fb985751fc23ff6191006030969cfa4","cad5d6451789234434c28dd2d6a8267b0d64c479b1ad267321faa31ba90d570b","e0e8254f7a1a21b5768beb4dbc9d4574ce67aefa59d88251d16b17c658f2a69e","c33b700f5d0797c331e08b29f8440204e19cf035555ea9111321f881f1b4702a",{"version":"b2d663f1f5da5b395c5dc6ba6dbc633d61580235f82faaca06bf420fcdae46cf","signature":"6744c64cda78d6af7280d69c20ead828fa4296efe0b582548cb10ab66914993d"},"f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","4369b27ca2716a04200930b5f24fa87a6ed62d8c70f80a83270956b6b23c32ae","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"8d6138a264ddc6f94f16e99d4e117a2d6eb31b217891cf091b6437a2f114d561","affectsGlobalScope":true},"a882b74c4ba115c6e86371f3592a3accb2c50874b6fcd92a4f83d17a4d6993af","4a8722c7d7a4dac1616db1f41ad0113998ccbbbcd37af43def3fbe6b41208c83","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"0b3868d3f87c95ea73bdfab380e536843ec3573aa76233b97aac40518494ea24","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","30c2ec6abf6aaa60eb4f32fb1235531506b7961c6d1bdc7430711aec8fd85295","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"d48009cbe8a30a504031cc82e1286f78fed33b7a42abf7602c23b5547b382563","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"24ba151e213906027e2b1f5223d33575a3612b0234a0e2b56119520bbe0e594b","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","28c1fc8505da2181ee74c9fe902fac964159cfae266c4413905d50eaecea8a19","84b8cc86ad19115f2637401cdd220460a25542df478c966a5ffc5eeaf3825299",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc","010d5afec4b47ea596f6c59a25ce628fa4e31ea15fd51e73d44ca2d72a780be8","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","f5337c3ea7b8702ffe2718f56a24325a67d517c0d552ef71b8d578d9f33a99d3",{"version":"1cd9488f96f8d5657d4109a6ae188f65846e905c5b236fdf379c16362e7a60a7","signature":"612bf9cb0b0a7ce6eab9fa9c09da1b1e4e5ec8f6b94f282035bfc89f68d4f3c6"},{"version":"2dec630463aaa98bfbc039a798f1757b9d53fd8ebd1722817b05b4534133d8cb","signature":"1cc2659564153cef042b6a377a36a04d861398d678e7032ec42698d8c80ec77f"},{"version":"ad1764b2c66d631e98be0b8255b410a319857ece25c6e8ae9627a535a0241c6b","signature":"1f66808998faa0d77e425d4c5ae8f481c3234d4b8c1deff001e1af71b4b041f3"},{"version":"c99a598040f64ddf29965a42c440a61492300923e58015c9dbad51a95f245b53","signature":"2f37bd92ed3c6cbac299dbfd79abe367c5e5d72e098abdb8d3e3900badd53e88"},"f30cfcfff28ee8f87563225b47239bb07b9b11edd09dda0ea6499b18cca1a30e","0edb8a97ead1fefd337458449050857e80740e31a3f76cffa656262f4e651a50","db8e4b47dd8c22634e3a326e5a5f60aa71a8ad4a0458fc0aadb6951f1c7cdc54","5b7a6d3f5c1b1d94d6cbc6c1e113588e20ae61d583d0d0cb5ec3fd92926d3749",{"version":"57b66a49fde8cfb80495147e1e115f4d09e7d089a97bca210d7b737a9a3dfd40","signature":"7c86832b33e8881089597745da92dc33a29681874849008a13069039bd613ea6"},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","b9998d79c6cb4e43e9d812fec5ccafbedee623c589904e3e3f0439ef861e25dd","7a6f74294b8fb90f5e3832be21e25898dd81b2a1adc36dda6929813ba4135311","d25e693302c8e284b417884b40dbadffe693b0daff8999a000995114dbf74c49","a1d4ac1b15cd62c7346d976e3a01e6cbcd4f166ea6b7866907d25c5acc832d77","5d40e6a7071d0d1e6e558e17214ff786ecb3ea73e31b25a88c2cbe2435fa1252","c45242078469b9680653d6a0667b23b1b767ec908825a14bfa8bb1dde2e30dae","5dcd218cfe8eb7fd6a1e5668c1a98734ddefe888d17129f8844552dddda2a74d","0564c90e8c2577950a446d6197a3ab7ec433ad5ac98435378e8855427f4cbf24","e1712267198fc3dd7903d0b945d5049fd56d68cadaf986c0adc40235fee43488","df21f5c49d638cbd6bd322eeb5b16d8352ba14ccb88cc9b23a7d8d5c2eaaf659","f6d13788d90394a540d136fb8ba9a0a647d8baa2e51d2ae155d039b031f4717f","6af9cf238459fe6d7e2d61cd50a157a6f540905c9793718e0e6e5993ab0cd650","88de5467cd5e4c2c1384629806d56ac1215657bddf39ef9f60a0e05beee2b131","ff5820394809bfc32a7e4586ff11b3c07327a0f4c756709aef92f1cd73d6da48","bfe2af20f3ff0579331661ef4c5d2597e0c31a7a0d760e41eaff0502bf064c4d","f52a0e53f79d7fd1c1c55a3cbda59499d4cce75f3188969024cdc286b29ad3ea","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f",{"version":"9b48eef82666050e509dece807d29b825fde4909ac48c7f1cab67390973a03ec","signature":"220216e61adba5829f622fe331a5a99d4aeedcda11c983149ceff8a063d2585f"},"0eff9792dd66a9aef708b34dd51d2e46158ae518db6ab14f54c5a99e8551abe7","66336b5a5d5e897e932cbf1e306ff8ac8a9929971409a8049c8c8a249cd8b57c","a878d4c7237a7af50e96534295fcf723134d70cbb1e9bfd8365266b912aee6ec","1185e162cb22a9bc3e94b2ae2ba35ed943ee69beae5364b38680f7d8587e7d35","23b0b3d88c166dad8d63750b716b921c51053ad54b14a4e7e32fd526033566db","fbacab2238e299ccf6596c3bd404c7dcad2c5a88ecd254a8a38cf2d184a67c75",{"version":"177dfa229223890f5e22db17d46280f2d4a16ca4c9ab73e4bbff4a1fd12300b4","signature":"e8f2522c8a4cf550c9fcc6154869253bd9ece549be7b5aeaaa7b20f73fb5cd83"},{"version":"e82bddfda890f3c83d1ece8c1df0ce57769a2a82b0ff81aff1409b329a460fc2","signature":"3f39c6ba0e49842fc434134519c30a89d3ec16da9701cf4d1113abf2f2ccfa17"},{"version":"a9ed6ff8aa6f2ea797e06d0f8bb03a4f43ab73a8adf133166140ca1ea208b520","signature":"b73dc3c92a3cdfe4144eafad3b73c13787c5cffe4ec5b35cd0467e9a3ede9ec1"},{"version":"b55e067a9546ac1c237571f938f04ae6593e138a2c1a645ed9171dbc36ee764e","signature":"f30884bec83e02740b8a410ecba62ba558f571a554e1b377ac4b83dff125b57e"},"4de66b5983d6286bfe3606cf155a5b21043111389d0b4c7b23d3f4282099f7d4","3968eed4d327e075c2386fad0b39b5ad2fe1892f6409a3bb46660c46f58300a6",{"version":"36be103794251feb6152dd2c8ec5d0e5f841a189c920881bccfe27f7459f54ed","signature":"0cae8a9a58a4d4836626ea63c8e3e699e7bcdab24c31ef39009abaf97c704b1c"},"b1129d7c114eba7c7b155dc809d6371ef86a0738f7ca93b3efef9b796d6168d9","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6","ffff3307a2c3797cdc04d7493e94245c13a646194c87f5bf5d2432995b834cc3","a87bc62d9a6be405f53f883a422efd557775224cd2b6688440cd333aaac27169","3d08777d7a3f5c1899a21dc2bd9f0ca80cfe0badba576cae22f5b47b7f81b3eb","bbbfe3163d9421b837e4e203c24243344be38e4359b6fc15426943454d8949b6","8cf4dc652e929c4de69ce5079b98a0683757b2dde66a7cee93edcb5aa08d5c48","f74d877f1fc949fb61197bf32a41829a83ee6aea528787dc2788378baaaa0ecf","a62a02c433e6fee26404825310ad462433320ef2e9f80fa7b9156135fd975f8f","22f15ae5c80b3e795da92636aa03d8f981811d067d82bff01ca54093c0535ec0","b56d4bc83ec01834829979ad57de59b4947cd62f71b102ab0040b6960d5bdc81","a10213415bf98670b026b77a90c7933594f0b5c34bde5b74e80134fdf0331bba","00cd454fa42dca69cdea08d4cb9698e679ba9a31762c23d905e45ba92269ac3a","58765e8e715155b2940e868ab1534b1bfac7087f6b42f7810ef94cc077d62981","f1c4e4db3e1dd83c3749f174e662de845e1217017ead0c15074e3ba00db67b6e","5aaea3d4b3af0c8339006c30af04eafdeb21b0a1bba2f1d32540ade412ee80a7","eb72bbe04857681ebd08a48d3b0869969c335445c31de53a85f76b4a42b97c92","c8cc38cbba80bfd5719c1b9d7efcd76fc90d4497e8a9aa715db426993274f0ae","49b6ff487f2d72569e361f077397214fea20839712527f5fb9ed8bb877dd7db8","d3043c37eeeb10d8a5c0c2a3b9d72e23a5fed2e9a367c5b4154bc8d9283601f3","58ff317d61b47e8fc6688bd50e6770311691202553f119d1e1d79b64d864e200","cde49e6e1ab8a2b4202958e3267e898489b737198a0599c7d251f94d9dea658b","3c3ca314a2b01902ef19b499be6e052925a849f14e2d9185afb323df3d3a72b6","b4b4af7820e7888cf67beeb95d0d6144b3d854370a7b78a598e80dc268e74249","1e7146a407bf85762b80681cd4aa3b544000e30c9b24d04685dfa69f82a48fd9","a3c42863fed9b49c35144d60aa0b2865b5fede65ea0050a28f45381af6dae035",{"version":"d898e165d52d3df19f98e46a53df138c8e28b1ec7224e75140d419f7bc60c7f0","signature":"8db42cde9161c917ae86f075cb21c16d1fab5965db0c4f4b372b4e7a0276f82e"},{"version":"f2f278cd3ffe7eb472b5daaec63622a32623cdf0d71395dfe60895363af42dc7","signature":"a03bc49af672574771ede656f9c35be60c2ba44f45655aed449e7f9e5efae6aa"},{"version":"19e0cd3c787b3570a7e8c20aa0718062bfb65e97391bd700bf37612569f3fc68","signature":"39c164f8cfdeb33577063044cf89c43c19bb4f79fae41960e0a17c6de26272c5"},{"version":"d416db55d180900dcf6c3eb98c776c85f3b4f9c4a0907cb8ffdb505500136f18","signature":"7115ea7b230353fe5e5d9436fe7f5b8863dea85c1b7c030c58a75bdb9e844b91"},{"version":"699246380aaa11f56f67ba8a5583f035e79f3de9d5837fe1979c579bafc32156","signature":"4110b29391d0835f9b88a4c69cb7e1cdddbac43ca9ee86393ebc15567c271b4d"},{"version":"aaa8702650fe4efdb8e82d41231add24a0b809b17f55d52009dc469c8ee0b011","signature":"f2dc190b33c1e842552ab4117c29cc960edd8ce2327a22254ec47cbcbdbb91f7"},{"version":"96db0fd5e766faa06d7b4f3ccc7e3b7df29a4c1aa4f116eaec55e5936e321325","signature":"0017550b13ae859f43d4b435fdab5e5035b0d6f7b7959458f30f67e859882d4d"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","e9fd0c57db08c441b0f044449b651e5d9910fa6c7871dbcb4d266b9cd357e2ed",{"version":"bf471b46fd0e07028f318e408bc578f4a3e125333bb545445175e6ba50791ffe","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2","81c6dd936bf342efbb1b1a5440a4300db5d39d70a6ad49ebc91ca7033ae9ce79",{"version":"13acb84a8fa8264d596433ae541c83b13d226a9592e6a26b165002c38132b97a","signature":"e307a4efa11c7f907b4e98ebb9496837e1901f13a19d8b0ed8c51205b09d528f"},{"version":"303ae53a3993e592fa9602ec5c83bac6d5c074f6e73fca8b2007f6db3ecf25f8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","c8031a5db82b240f801a5684ab693e95e1e06dc76958894fe42d35acbd446f28","1633b84fd3346ad6500a88e7a119ac778bb6f6b2746a3b7b8164c5ef2721822f","37fa00014a0f86b91526c4fde9b31af33d3e3bd5892c0519aa0d96d7935de484","5c9d5e0cd18c905ee6f6bc6f85b02c4d5b6f64ad08e1181f63785fae04823db3","5abd603c11eeb815a1746ff003233ae03c8f4f34fcf7835742c30fff038d4100","df54eaa5ea53c6bb3a9548bc5d2f6fb22583ea3e8b936a4e8ec5acfd90422ff3","be8d072f400254824429edab10acbe595299b702c97b99cc47f8e8018b7102ff","1a319786bea64c944ba8dd33331090034468efbab9c2fb96552850033d62d8d8","33174450482b921bbf093e3d52f501f7f93b5fd612311aa86e7339f2800162aa","03e385ae2125c9aa9dead008b42a0ab20d0812c26c19ee210d84c2666113f867","688c9dfd2b7114f5f01022abb5b179659f990d5af5924f185c2644ca99fe7b77","932cade1c5802123b5831f332ad8a6297f0f7d14d0ee04f5a774408f393e2200","925a8770415572378b7b62dcd714e744b7ffed86de59bdbe1d25c68d9d1f7f51","38fc2c990835686053591402bd73803ef28e117fa49427763e62636fd16c76ad","85489033e86eba49bfef2ad7330f8bb57cf7ef6aeb341c00ae1a3e5b19a02f4f","d4936633d5453e441ad5ab182efad46a0e1285fe5f9f5c2948cad3e71b7c2c23","a1b60bd2328318dcbec30bdf529dad31a13315ff2df60c8bd71630c58a575b06","e7ad5aa8eb177708949df3abbfe5ccbe7b75c920fb3bdd89426c38c61f239da6","8cc6a35806cd10d448b0f2ab01fe0b6194ca57fdaced2d71781b68e83c55bd88","8f364fec0ef20506aa9cf00b5cd8b620c1c0389687b11a3a32b0b5d4716ad894","5d11703e2c5d4dbe00bbe79f3bc864d178cf8d6ebccc2d1448ea29e93654f029","f4e82c91aac3b61f3ad04f11a44c5b79f724ff8a09281d0afa24a6624633ff25","ed849d616865076f44a41c87f27698f7cdf230290c44bafc71d7c2bc6919b202","7b8b9017156ef8bf3bbe42785fac8956e5c9869f4a494536d7f548a7c1c7d98a","eb2f08ae9c540a5fb60a5edddc0860ca3dad54ec842301ca73441d9e54534af0","763bb8df872cbb8783e29e19bd7a1dea0f88f7fd7398343af38be8509a65df82","687ce021a76c91c0e0b08fa5b828de2916e1b1aa9a23394e8ebc4dd96b8ee776","c286b410193495d067668bcdbd13ea3f3a39001edff02edee248babf2652e563","ba1405da509cc84896a588978efc45400d4f9844ee738d750b59868b1ad1618a","83a1426ac1a9cf144141dfe10d71a68629623a7c28245c9ca0e0352bead501fd","2726c0a6a4a87fad11e6846e6b0b40b8924fbe66340adc512093c4273bc53e4e","c888daaa99fdf6c5712d98605fdcf21cbbaab756a629661a44cac44ede464d37","e044f60686dc70015a3b7e7c64ad0ac5ec5ec101a0aede0782ec077e136b6a65","a232f867897bbecfebf68df575a417af1afd9b5dd3d83fb4d59e0a133a0de93d","228dbc8825b7a45af7d416dee95c0a2162d7cf73ffddfd52357b7e548882bdaa","602baeb62ccf84672ba7afacb5a21b675171282397513cac8f06d3a8634f840c","8970ab047d89c71edf9973609dd62f61bb366abeabbff36a1200103b6c1c605b","36d756189d9295e3a964e5cd45cb8ac965d5d2ada53ed848e08608426c146d69","8bdb5c16e8b9ba625ec08d8189879a6fb47b2c3c458a5d43ebd53a8763b5712e","93597e08900c3ac5ec730c16c4fbe425f7342e1f0420967b2afd90d67a2abee1","af89ab13b40dd28cd91818fc6329914d2b9663591831f032ff0f0cb4a028d4a5","6e6733927ade923e34b243d6fbec1465cfc8ed6edf62c6e09ed00c529f0d93de","83b3a9e85f7967509436fcdfa9be9bd543fb54003a9233c5c0af087e4a2c11c8","dc92d6eccf12395aa1d47afb765d5e4a1cd2639a385db0e3e88e9937ad2b63a3","ffb6e0556a4b5323c8bdf12727d000e8a3633f0552fffc4b779ae88546be2770","1242141c87ba3396bead6f379f6d6778bd38d02017f243aa448d1454a5fdc90e","17a4105ddae0308e19ee8532bdeb76278efa9dc644366060ca644541d3fd831c","913ffa031f7455c53e99c75ae130a046612d2ee0e716ed92707e996cbd3952ea","44e897d02326bf4d8169ea9638fe0a4c53b8f85cc48ae2fcbbb67b2f72c1d805","288fb1b9df77067c3c2675bde87d23d4a3f01bb6f929f854f11bdb68662968ff","b43b5156bc2831b46f6226777e292ff1646b3651ce190708b6228a078d42da4a","c3e77c4aa1097a38dcf4a20a093ce65033a16f3a48dab0ae3c5f6661bc39b11c","93acb99d30b8a22b443bfefb333d15d6310af7bd76a832f9559f7af9535ed2ae","3053e413471eef0274bc90318db14072e6164fbcc77765ab9557a769370382b2","32cbe201bfe8ed7f4c323fb8a3fcfdfb451f22e84d3c49da33ceda2fbf9230be","50d536e2e8bdbb4234b6ade05992aa4227fbf0401aba24922734c3ddb4a3ff11","4e152867a5b1bea2dc6a2921c0196f877630fc144369f8c7b9a69905caa62741","445c1751941d390dedf7667ab0fef01d468089576c07eba15810bf69485e4589","7f2cc72a16a663ab9f8d99bd5658e583251ce0c003bf80a948973e15a7ef9596","6af42c3c33c7123e7b056a6fd272d470914f382fad5e99689fa4991ff610e757","60f7cf25a65631bcfc27276a9b7b584ad13c2a37f871376d5d02e2133bc5fef9","e1c0439c8c796ddfdd08206dfd2cf7a7defec9d83f7b1e873d908489bda18af4","27679e96d1bd38c5938178aaf4abe8627493090b63d6bae2ce8436e6a87ebe4d","a77fbecee25688f568e18b43f8f54195d6c278a2a9a687ada5ab3d2f726524eb","e29f2b3a93ca3392fe29fa8e7b93985e854b44fe28e2b5c113f08296095bd6b7","d27956c8b392088a06d882e1edb58aab4d5cf5ab1229b73f99329ab21f352147","d643518d0b08b3d8d6e7f1fa884bca57ef95caaa1c312abbd9e1d4ed0d51c370","8c15566043b036c0720caf51ca343754e84e34fbaaf4a58d8080cf4ab2d93734","d8c8d41b25ef1827daaff9d84db43593995ce075551e7f4d8f10e316261e86f0","22fcf82dcbb4743dc846e838434ad1c2843cd18476e534dd3b37f85ece99ac73","40924f439552f559ffa4e41d300a411646ac9f3b53e578a012f7c439d36c6a30","7a34c06f5ed61c8108b2b82b7834655f1933d6ead3c9f6ff9d12efee4cb4bcaf","ee24d63f039e5745a279243916c7bb2c3d405bc0158912c0f37471381b467087","459c0ca522af7a412ef771447fe2c558c9a4640cffa4f53bacac05d0378a3ae7","acd5d501223e3a7cdd229b501fce5fb071937b72bd05fa33e543eb21c8ee0aba","f196d5ed4194259ffb797a34001a5edb7a165cd110dc3e4d8f03f11e3531fe9b","683889752b7c95fffd073b82ea76d36b3fe548ef3bb9887eb903676eabd676ff","a439ff9443c77478bb024ea2d96fbc088bccc915adf6bb8aeb9ab21fd737a071","b40afc6ff175241970202125bc1b5996cf5783b2f755977691f8c6522ace9f14","8bfc11f55ca063b10f0335922693ca70885d8f59b20607dd501250d1b1e960db","a884051a029dc34c400dc1dbad39a878935d37ebbea62d357d17b25f0076b578",{"version":"1b1ca1d97df4268847d5c387b1a89c01ec2fdc2062def1216442c8f040dcb660","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"6e0011406961ab3d469f2a7c3fddc41a5c9fb6d9452c47b5389124da846ab07a","df1bbd333631040027035b56cb31093015e59ce977a590500ed09feab109939b","a4f27ea63e3ff26a94b6681967a5276a2df9ddb80ae990df1ad03c0fffb34eca","18418f70457cee30da01c21bc26869ceb1ae65564784136f7fe2f7f2ff8f740f","3d2ec84143e6462a786b5d9ecf06f4f6f67a59a1f16c5a3a5e41721ba8478b7f","892f412f701d356f85cd3cb7d48b87ffecc0d4f85a2005c1d53e5e08414df8b1",{"version":"14261c0d2da587df791a696c8272003a3c5c1d7dd3a91f459092a8ab99759ca3","signature":"23d9dffba690dd7b1cc3986e0d592011a8660f0cb7632037b83b157b659c1510"},{"version":"1bcee41416ce15644b7e0eb66c2bb9df82007068fc83675d48927495cde7bd57","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"28ff2e0cd9350ef52ad5d6a77ddf2650d0505bd3d8cb1db66e1e5abf798d0c92","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"86b69f4f564965d8fd203354ebfcc235e37958a8195b600161deb5b9982a4dde","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a","4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","852bcf5d92d819abdf34ba0759c311b61d5dac7b9963a6c3cc4f23b025dee8f3","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[61,62,73,[185,188],193,220,[227,230],233,[260,266],269,280,281,364,[371,374]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[164,236],[164,236,237],[164,237,238,239,240],[164,237],[164],[164,242,244],[164,243],[79,164,172,175,226,292,295,296,297,298,300,308,309,310,311,316,317],[164,295,297],[164,294,295],[164,293],[164,292,295,297,299],[164,301,303],[164,299,301,307],[164,305],[164,297,300,301,302,303,304,306],[164,297],[64,164,183],[164,297,300],[79,82,164,210,292,295],[164,226],[164,180,284,287],[64,164,179,180,182,282,283,284,286],[64,164,182,283,284,285],[164,211,366,367,368,369],[164,203],[164,201],[164,204],[164,202,205,206,207,208,209,210],[64,71,164],[64,78,79,82,83,164,179,289,290],[64,164,179],[82,164,182,183,289,318,327],[164,184,267],[82,164],[79,82,164,182,183,315],[164,178,183],[82,164,181,183],[164,358,362],[164,361,362],[164,361],[164,358,359,360],[64,79,164,179,183],[79,82,164,183],[64,79,82,164,179,182],[78,83,164,182],[134,164,171],[79,82,83,84,164,172,173,174,175,176,177,178,181,183],[164,183],[83,164,172],[76,78,164],[79,82,164],[79,83,164,182],[64,79,164,172,183,282],[64,164,179,182,183],[79,164,183],[82,164,172,180,182,183],[164,334],[164,291,329,330,331,332,333],[78,79,83,164,172,173,175,182,316,317,321,322,323,324,326],[79,164,176,201,321],[64,164,325],[79,164,210,321],[79,164],[164,312,313,314],[79,164,210],[74,76,78,79,164],[79,82,164,172,175,182,321],[82,164,173,181,335],[82,164,172,173,181,183,336],[80,81,164],[164,247],[164,250],[164,249,250,251],[164,249,251,252,253,254],[164,256],[164,256,258],[134,137,163,164,171,375,376,377],[164,270],[164,379],[164,405],[164,390],[164,394,395,396],[164,393],[164,395],[164,385,391,392,397,400,402,403,404],[164,392,398,399,405],[164,398,401],[164,392,393,398,405],[164,392,405],[164,407],[164,386,387,388,389],[85,164],[121,164],[122,127,155,164],[123,134,135,142,152,163,164],[123,124,134,142,164],[125,164],[126,127,135,143,164],[127,152,160,164],[128,130,134,142,164],[129,164],[130,131,164],[134,164],[132,134,164],[121,134,164],[134,135,136,152,163,164],[134,135,136,149,152,155,164],[119,164,168],[130,134,137,142,152,163,164],[134,135,137,138,142,152,160,163,164],[137,139,152,160,163,164],[85,86,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170],[134,140,164],[141,163,164,168],[130,134,142,152,164],[143,164],[144,164],[121,145,164],[146,162,164,168],[147,164],[148,164],[134,149,150,164],[149,151,164,166],[122,134,152,153,154,155,164],[122,152,154,164],[152,153,164],[155,164],[156,164],[121,152,164],[134,158,159,164],[158,159,164],[127,142,152,160,164],[161,164],[142,162,164],[122,137,148,163,164],[127,164],[152,164,165],[141,164,166],[164,167],[122,127,134,136,145,152,163,164,166,168],[152,164,169],[137,152,164,171],[164,415,454],[164,415,439,454],[164,454],[164,415],[164,415,440,454],[164,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453],[164,440,454],[164,277],[164,458],[134,152,164,171],[164,270,271,272,273,274,275],[164,270,271],[122,123,152,164],[164,319,320],[164,223],[64,164,179,192,231],[64,164,179,190,192],[64,164,179,192],[64,164,189,191],[164,179],[79,82,164,172,175,182,339],[79,84,164,172,173,174,175,176,181,182,183,316,317,321,323,339,341],[164,172,175,176,182,316],[82,164,172,175,182,316],[79,82,164,173,175,182,183,315,339,341,349],[79,82,164,172,173,175,176,182,183,315,316,339,341,343,344,350],[79,84,164,173,174,180,181,182,183,184,321,340,341,342,351,352,353,354,355],[82,164,172,173,176,181,182,183,323,339],[74,164],[164,201,214,215,216],[77,78,164],[77,164],[75,164],[164,195],[76,164],[76,164,197],[78,164,196,197,198,199,200],[74,75,76,77,164,195],[74,75,76,164],[164,345,346,347,348],[164,346],[164,346,347],[71,164],[63,164],[63,71,164],[63,64,164],[63,65,66,67,68,69,70,164],[164,218],[164,213,218,219,221,222,223,224],[164,201,217],[96,100,163,164],[96,152,163,164],[91,164],[93,96,160,163,164],[142,160,164],[164,171],[91,164,171],[93,96,142,163,164],[88,89,92,95,122,134,152,163,164],[88,94,164],[92,96,122,155,163,164,171],[122,164,171],[112,122,164,171],[90,91,164,171],[96,164],[90,91,92,93,94,95,96,97,98,100,101,102,103,104,105,106,107,108,109,110,111,113,114,115,116,117,118,164],[96,103,104,164],[94,96,104,105,164],[95,164],[88,91,96,164],[96,100,104,105,164],[100,164],[94,96,99,163,164],[88,93,94,96,100,103,164],[122,152,164],[91,96,112,122,164,168,171],[62,73,79,164,187],[62,164,185,186],[62,73,164,184],[62,164,185,187],[164,260],[127,164,185,188,241,245,246,260],[62,164,185,187,188,248,255,257,259],[61,64,164,179,193,230,262],[62,64,72,164,187,192],[62,72,73,79,164,185,187,188,193,194,220,227,229,230,232],[62,72,164,186,187,188,213,222,225,227],[62,72,164,185,187,220,228],[73,164,184,188,260,264],[61,164,185,187,223,226],[164,173],[61,62,64,72,73,79,164,173,179,183,184,185,188,192,193,220,230,232,233,234,235,261,262,263],[62,72,164],[64,71,72,164],[62,73,79,164,211,212,213,219],[164,264,268],[79,164,279],[122,164,185,187,220,222,223,229,260,276,371],[64,164,173,219,232,234,264,265,276,278,280],[82,135,164,211,212,226,265,288,291,328,334,336,337,338,356,357,363],[61,64,79,122,164,193,219,220,222,223,229,231,232,233,234,260,264,276,278,280,365,371],[79,164,185,210,370],[79,122,164,220,222,232,233,234,261,276,280],[62,73,79,187],[62,185,186],[62,73,184],[62,185,187],[265],[188],[64,179,230,262],[62,64,187,192],[62,73,79,185,187,188,229,230,232],[62,186,187,188],[62,185,187,228],[73,184,188,260,264],[185,187,226],[173],[62,64,73,79,173,179,183,184,185,188],[62],[64,71],[62,73,79],[79],[79,185,210]],"referencedMap":[[240,1],[238,2],[241,3],[239,4],[236,5],[237,5],[242,5],[245,6],[244,7],[243,5],[311,5],[318,8],[298,9],[296,10],[295,11],[300,12],[304,13],[308,14],[306,15],[301,5],[299,5],[307,16],[303,17],[309,18],[310,19],[297,20],[302,5],[283,21],[284,5],[288,22],[287,23],[286,24],[366,5],[367,5],[370,25],[204,26],[202,27],[205,28],[211,29],[203,5],[206,26],[207,30],[208,27],[209,27],[368,5],[369,5],[291,31],[289,30],[290,32],[328,33],[268,34],[267,5],[323,35],[316,36],[317,37],[339,38],[363,39],[359,5],[360,40],[362,41],[358,5],[361,42],[184,43],[341,44],[183,45],[84,46],[194,5],[172,47],[182,48],[210,5],[173,49],[353,50],[79,51],[83,52],[174,53],[175,52],[292,54],[176,5],[177,49],[180,55],[285,5],[178,56],[181,57],[329,58],[330,58],[334,59],[331,58],[332,58],[333,58],[327,60],[322,61],[326,62],[325,30],[354,63],[226,64],[315,65],[314,64],[312,64],[313,64],[279,66],[212,67],[355,68],[336,69],[335,70],[81,35],[82,71],[80,35],[248,72],[247,5],[251,73],[252,74],[253,74],[250,5],[254,5],[249,5],[255,75],[258,76],[257,76],[259,77],[256,5],[378,78],[271,79],[275,79],[273,79],[270,5],[380,80],[376,5],[381,5],[382,5],[383,5],[384,47],[385,5],[406,81],[391,82],[397,83],[395,5],[394,84],[396,85],[405,86],[400,87],[402,88],[403,89],[404,90],[398,5],[399,90],[401,90],[393,90],[392,5],[408,91],[387,5],[386,5],[389,82],[390,92],[388,82],[409,5],[410,5],[411,5],[379,5],[85,93],[86,93],[121,94],[122,95],[123,96],[124,97],[125,98],[126,99],[127,100],[128,101],[129,102],[130,103],[131,103],[133,104],[132,105],[134,106],[135,107],[136,108],[120,109],[170,5],[137,110],[138,111],[139,112],[171,113],[140,114],[141,115],[142,116],[143,117],[144,118],[145,119],[146,120],[147,121],[148,122],[149,123],[150,123],[151,124],[152,125],[154,126],[153,127],[155,128],[156,129],[157,130],[158,131],[159,132],[160,133],[161,134],[162,135],[163,136],[164,137],[165,138],[166,139],[167,140],[168,141],[169,142],[412,5],[413,5],[377,143],[414,5],[439,144],[440,145],[415,146],[418,146],[437,144],[438,144],[428,144],[427,147],[425,144],[420,144],[433,144],[431,144],[435,144],[419,144],[432,144],[436,144],[421,144],[422,144],[434,144],[416,144],[423,144],[424,144],[426,144],[430,144],[441,148],[429,144],[417,144],[454,149],[453,5],[448,148],[450,150],[449,148],[442,148],[443,148],[445,148],[447,148],[451,150],[452,150],[444,150],[446,150],[278,151],[277,5],[455,5],[456,5],[457,5],[407,5],[458,5],[459,152],[460,153],[276,154],[87,5],[274,79],[272,155],[305,5],[345,5],[337,156],[338,5],[321,157],[319,158],[320,5],[365,5],[231,32],[232,159],[191,160],[189,161],[192,162],[234,163],[235,163],[282,5],[190,32],[179,5],[375,104],[340,164],[342,165],[343,166],[344,167],[350,168],[351,169],[356,170],[352,171],[216,172],[74,5],[217,173],[75,174],[200,5],[78,175],[195,176],[215,177],[214,177],[197,178],[198,179],[76,5],[201,180],[196,181],[77,182],[199,5],[357,5],[349,183],[347,184],[348,185],[346,5],[324,5],[293,5],[294,11],[63,186],[67,187],[68,188],[65,189],[66,187],[71,190],[69,30],[70,186],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[64,5],[72,5],[221,5],[213,5],[222,5],[219,191],[225,192],[223,191],[218,193],[224,5],[103,194],[110,195],[102,194],[117,196],[94,197],[93,198],[116,199],[111,200],[114,201],[96,202],[95,203],[91,204],[90,205],[113,206],[92,207],[97,208],[98,5],[101,208],[88,5],[119,209],[118,208],[105,210],[106,211],[108,212],[104,213],[107,214],[112,199],[99,215],[100,216],[109,217],[89,218],[115,219],[246,5],[62,5],[230,220],[187,221],[185,222],[61,5],[188,223],[266,224],[261,225],[260,226],[263,227],[193,228],[233,229],[228,230],[229,231],[265,232],[227,233],[262,234],[264,235],[186,236],[73,237],[220,238],[269,239],[280,240],[374,241],[281,242],[364,243],[372,244],[371,245],[373,246]],"exportedModulesMap":[[240,1],[238,2],[241,3],[239,4],[236,5],[237,5],[242,5],[245,6],[244,7],[243,5],[311,5],[318,8],[298,9],[296,10],[295,11],[300,12],[304,13],[308,14],[306,15],[301,5],[299,5],[307,16],[303,17],[309,18],[310,19],[297,20],[302,5],[283,21],[284,5],[288,22],[287,23],[286,24],[366,5],[367,5],[370,25],[204,26],[202,27],[205,28],[211,29],[203,5],[206,26],[207,30],[208,27],[209,27],[368,5],[369,5],[291,31],[289,30],[290,32],[328,33],[268,34],[267,5],[323,35],[316,36],[317,37],[339,38],[363,39],[359,5],[360,40],[362,41],[358,5],[361,42],[184,43],[341,44],[183,45],[84,46],[194,5],[172,47],[182,48],[210,5],[173,49],[353,50],[79,51],[83,52],[174,53],[175,52],[292,54],[176,5],[177,49],[180,55],[285,5],[178,56],[181,57],[329,58],[330,58],[334,59],[331,58],[332,58],[333,58],[327,60],[322,61],[326,62],[325,30],[354,63],[226,64],[315,65],[314,64],[312,64],[313,64],[279,66],[212,67],[355,68],[336,69],[335,70],[81,35],[82,71],[80,35],[248,72],[247,5],[251,73],[252,74],[253,74],[250,5],[254,5],[249,5],[255,75],[258,76],[257,76],[259,77],[256,5],[378,78],[271,79],[275,79],[273,79],[270,5],[380,80],[376,5],[381,5],[382,5],[383,5],[384,47],[385,5],[406,81],[391,82],[397,83],[395,5],[394,84],[396,85],[405,86],[400,87],[402,88],[403,89],[404,90],[398,5],[399,90],[401,90],[393,90],[392,5],[408,91],[387,5],[386,5],[389,82],[390,92],[388,82],[409,5],[410,5],[411,5],[379,5],[85,93],[86,93],[121,94],[122,95],[123,96],[124,97],[125,98],[126,99],[127,100],[128,101],[129,102],[130,103],[131,103],[133,104],[132,105],[134,106],[135,107],[136,108],[120,109],[170,5],[137,110],[138,111],[139,112],[171,113],[140,114],[141,115],[142,116],[143,117],[144,118],[145,119],[146,120],[147,121],[148,122],[149,123],[150,123],[151,124],[152,125],[154,126],[153,127],[155,128],[156,129],[157,130],[158,131],[159,132],[160,133],[161,134],[162,135],[163,136],[164,137],[165,138],[166,139],[167,140],[168,141],[169,142],[412,5],[413,5],[377,143],[414,5],[439,144],[440,145],[415,146],[418,146],[437,144],[438,144],[428,144],[427,147],[425,144],[420,144],[433,144],[431,144],[435,144],[419,144],[432,144],[436,144],[421,144],[422,144],[434,144],[416,144],[423,144],[424,144],[426,144],[430,144],[441,148],[429,144],[417,144],[454,149],[453,5],[448,148],[450,150],[449,148],[442,148],[443,148],[445,148],[447,148],[451,150],[452,150],[444,150],[446,150],[278,151],[277,5],[455,5],[456,5],[457,5],[407,5],[458,5],[459,152],[460,153],[276,154],[87,5],[274,79],[272,155],[305,5],[345,5],[337,156],[338,5],[321,157],[319,158],[320,5],[365,5],[231,32],[232,159],[191,160],[189,161],[192,162],[234,163],[235,163],[282,5],[190,32],[179,5],[375,104],[340,164],[342,165],[343,166],[344,167],[350,168],[351,169],[356,170],[352,171],[216,172],[74,5],[217,173],[75,174],[200,5],[78,175],[195,176],[215,177],[214,177],[197,178],[198,179],[76,5],[201,180],[196,181],[77,182],[199,5],[357,5],[349,183],[347,184],[348,185],[346,5],[324,5],[293,5],[294,11],[63,186],[67,187],[68,188],[65,189],[66,187],[71,190],[69,30],[70,186],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[64,5],[72,5],[221,5],[213,5],[222,5],[219,191],[225,192],[223,191],[218,193],[224,5],[103,194],[110,195],[102,194],[117,196],[94,197],[93,198],[116,199],[111,200],[114,201],[96,202],[95,203],[91,204],[90,205],[113,206],[92,207],[97,208],[98,5],[101,208],[88,5],[119,209],[118,208],[105,210],[106,211],[108,212],[104,213],[107,214],[112,199],[99,215],[100,216],[109,217],[89,218],[115,219],[246,5],[230,247],[187,248],[185,249],[188,250],[266,251],[261,252],[260,252],[263,253],[193,254],[233,255],[228,256],[229,257],[265,258],[227,259],[262,260],[264,261],[186,262],[73,263],[220,264],[280,265],[371,266]],"semanticDiagnosticsPerFile":[240,238,241,239,236,237,242,245,244,243,311,318,298,296,295,300,304,308,306,301,299,307,303,309,310,297,302,283,284,288,287,286,366,367,370,204,202,205,211,203,206,207,208,209,368,369,291,289,290,328,268,267,323,316,317,339,363,359,360,362,358,361,184,341,183,84,194,172,182,210,173,353,79,83,174,175,292,176,177,180,285,178,181,329,330,334,331,332,333,327,322,326,325,354,226,315,314,312,313,279,212,355,336,335,81,82,80,248,247,251,252,253,250,254,249,255,258,257,259,256,378,271,275,273,270,380,376,381,382,383,384,385,406,391,397,395,394,396,405,400,402,403,404,398,399,401,393,392,408,387,386,389,390,388,409,410,411,379,85,86,121,122,123,124,125,126,127,128,129,130,131,133,132,134,135,136,120,170,137,138,139,171,140,141,142,143,144,145,146,147,148,149,150,151,152,154,153,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,412,413,377,414,439,440,415,418,437,438,428,427,425,420,433,431,435,419,432,436,421,422,434,416,423,424,426,430,441,429,417,454,453,448,450,449,442,443,445,447,451,452,444,446,278,277,455,456,457,407,458,459,460,276,87,274,272,305,345,337,338,321,319,320,365,231,232,191,189,192,234,235,282,190,179,375,340,342,343,344,350,351,356,352,216,74,217,75,200,78,195,215,214,197,198,76,201,196,77,199,357,349,347,348,346,324,293,294,63,67,68,65,66,71,69,70,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,64,72,221,213,222,219,225,223,218,224,103,110,102,117,94,93,116,111,114,96,95,91,90,113,92,97,98,101,88,119,118,105,106,108,104,107,112,99,100,109,89,115,246,62,230,187,185,61,188,266,261,260,263,193,233,228,229,265,227,262,264,186,73,220,269,280,374,281,364,372,371,373],"latestChangedDtsFile":"./test/handshakes/xx.spec.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/package.json deleted file mode 100644 index f57d80eba..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/package.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "name": "@chainsafe/libp2p-noise", - "version": "13.0.3", - "author": "ChainSafe ", - "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/ChainSafe/js-libp2p-noise#readme", - "repository": { - "type": "git", - "url": "git+https://github.com/ChainSafe/js-libp2p-noise.git" - }, - "bugs": { - "url": "https://github.com/ChainSafe/js-libp2p-noise/issues" - }, - "keywords": [ - "crypto", - "libp2p", - "noise" - ], - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - }, - "type": "module", - "types": "./dist/src/index.d.ts", - "files": [ - "src", - "dist", - "!dist/test", - "!**/*.tsbuildinfo" - ], - "exports": { - ".": { - "types": "./dist/src/index.d.ts", - "import": "./dist/src/index.js" - } - }, - "eslintConfig": { - "extends": "ipfs", - "parserOptions": { - "sourceType": "module" - }, - "rules": { - "@typescript-eslint/no-unused-vars": "error", - "@typescript-eslint/explicit-function-return-type": "warn", - "@typescript-eslint/strict-boolean-expressions": "off" - }, - "ignorePatterns": [ - "src/proto/payload.js", - "src/proto/payload.d.ts", - "test/fixtures/node-globals.js" - ] - }, - "scripts": { - "bench": "node benchmarks/benchmark.js", - "clean": "aegir clean", - "dep-check": "aegir dep-check", - "build": "aegir build", - "lint": "aegir lint", - "lint:fix": "aegir lint --fix", - "test": "aegir test", - "test:node": "aegir test -t node", - "test:browser": "aegir test -t browser -t webworker", - "test:electron-main": "aegir test -t electron-main", - "test:interop": "aegir test -t node -f dist/test/interop.js", - "docs": "aegir docs", - "proto:gen": "protons ./src/proto/payload.proto", - "prepublish": "npm run build" - }, - "dependencies": { - "@chainsafe/as-chacha20poly1305": "^0.1.0", - "@chainsafe/as-sha256": "^0.4.1", - "@libp2p/crypto": "^2.0.0", - "@libp2p/interface": "^0.1.0", - "@libp2p/logger": "^3.0.0", - "@libp2p/peer-id": "^3.0.0", - "@noble/ciphers": "^0.4.0", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "it-byte-stream": "^1.0.0", - "it-length-prefixed": "^9.0.1", - "it-length-prefixed-stream": "^1.0.0", - "it-pair": "^2.0.6", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.4", - "wherearewe": "^2.0.1" - }, - "devDependencies": { - "@chainsafe/libp2p-yamux": "^5.0.0", - "@libp2p/daemon-client": "^7.0.0", - "@libp2p/daemon-server": "^6.0.0", - "@libp2p/interface-compliance-tests": "^4.0.0", - "@libp2p/interface-peer-id": "^2.0.2", - "@libp2p/interop": "^9.0.0", - "@libp2p/peer-id-factory": "^3.0.0", - "@libp2p/tcp": "^8.0.0", - "@multiformats/multiaddr": "^12.1.0", - "@types/sinon": "^17.0.1", - "aegir": "^40.0.8", - "benchmark": "^2.1.4", - "execa": "^8.0.1", - "go-libp2p": "^1.0.3", - "iso-random-stream": "^2.0.2", - "libp2p": "^0.46.0", - "mkdirp": "^3.0.0", - "p-defer": "^4.0.0", - "protons": "^7.0.0", - "sinon": "^17.0.1" - }, - "browser": { - "./dist/src/crypto/index.js": "./dist/src/crypto/index.browser.js", - "util": false - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/@types/basic.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/@types/basic.ts deleted file mode 100644 index 364d1f89e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/@types/basic.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type bytes = Uint8Array -export type bytes32 = Uint8Array -export type bytes16 = Uint8Array - -export type uint64 = number diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/@types/handshake-interface.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/@types/handshake-interface.ts deleted file mode 100644 index 9b402b1fd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/@types/handshake-interface.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { bytes } from './basic.js' -import type { NoiseSession } from './handshake.js' -import type { NoiseExtensions } from '../proto/payload.js' -import type { PeerId } from '@libp2p/interface/peer-id' - -export interface IHandshake { - session: NoiseSession - remotePeer: PeerId - remoteExtensions: NoiseExtensions - encrypt: (plaintext: bytes, session: NoiseSession) => bytes - decrypt: (ciphertext: bytes, session: NoiseSession, dst?: Uint8Array) => { plaintext: bytes, valid: boolean } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/@types/handshake.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/@types/handshake.ts deleted file mode 100644 index ec333b703..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/@types/handshake.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { bytes, bytes32, uint64 } from './basic.js' -import type { KeyPair } from './libp2p.js' -import type { Nonce } from '../nonce.js' - -export type Hkdf = [bytes, bytes, bytes] - -export interface MessageBuffer { - ne: bytes32 - ns: bytes - ciphertext: bytes -} - -export interface CipherState { - k: bytes32 - // For performance reasons, the nonce is represented as a Nonce object - // The nonce is treated as a uint64, even though the underlying `number` only has 52 safely-available bits. - n: Nonce -} - -export interface SymmetricState { - cs: CipherState - ck: bytes32 // chaining key - h: bytes32 // handshake hash -} - -export interface HandshakeState { - ss: SymmetricState - s: KeyPair - e?: KeyPair - rs: bytes32 - re: bytes32 - psk: bytes32 -} - -export interface NoiseSession { - hs: HandshakeState - h?: bytes32 - cs1?: CipherState - cs2?: CipherState - mc: uint64 - i: boolean -} - -export interface INoisePayload { - identityKey: bytes - identitySig: bytes - data: bytes -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/@types/libp2p.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/@types/libp2p.ts deleted file mode 100644 index c20fe9395..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/@types/libp2p.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { bytes32 } from './basic.js' -import type { NoiseExtensions } from '../proto/payload.js' -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter' - -export interface KeyPair { - publicKey: bytes32 - privateKey: bytes32 -} - -export interface INoiseConnection extends ConnectionEncrypter {} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/constants.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/constants.ts deleted file mode 100644 index 7e8105c47..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/constants.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const NOISE_MSG_MAX_LENGTH_BYTES = 65535 -export const NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG = NOISE_MSG_MAX_LENGTH_BYTES - 16 - -export const DUMP_SESSION_KEYS = Boolean(globalThis.process?.env?.DUMP_SESSION_KEYS) diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/crypto.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/crypto.ts deleted file mode 100644 index 108dfee1c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/crypto.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { bytes32, bytes } from './@types/basic.js' -import type { Hkdf } from './@types/handshake.js' -import type { KeyPair } from './@types/libp2p.js' - -export interface ICryptoInterface { - hashSHA256: (data: Uint8Array) => Uint8Array - - getHKDF: (ck: bytes32, ikm: Uint8Array) => Hkdf - - generateX25519KeyPair: () => KeyPair - generateX25519KeyPairFromSeed: (seed: Uint8Array) => KeyPair - generateX25519SharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Uint8Array - - chaCha20Poly1305Encrypt: (plaintext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32) => bytes - chaCha20Poly1305Decrypt: (ciphertext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array) => bytes | null -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/crypto/index.browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/crypto/index.browser.ts deleted file mode 100644 index f691a85c5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/crypto/index.browser.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { pureJsCrypto } from './js' - -export const defaultCrypto = pureJsCrypto diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/crypto/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/crypto/index.ts deleted file mode 100644 index 946799c9b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/crypto/index.ts +++ /dev/null @@ -1,151 +0,0 @@ -import crypto from 'node:crypto' -import { newInstance, ChaCha20Poly1305 } from '@chainsafe/as-chacha20poly1305' -import { digest } from '@chainsafe/as-sha256' -import { isElectronMain } from 'wherearewe' -import { pureJsCrypto } from './js.js' -import type { KeyPair } from '../@types/libp2p.js' -import type { ICryptoInterface } from '../crypto.js' - -const ctx = newInstance() -const asImpl = new ChaCha20Poly1305(ctx) -const CHACHA_POLY1305 = 'chacha20-poly1305' -const PKCS8_PREFIX = Buffer.from([0x30, 0x2e, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x04, 0x22, 0x04, 0x20]) -const X25519_PREFIX = Buffer.from([0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x03, 0x21, 0x00]) -const nodeCrypto: Pick = { - hashSHA256 (data) { - return crypto.createHash('sha256').update(data).digest() - }, - - chaCha20Poly1305Encrypt (plaintext, nonce, ad, k) { - const cipher = crypto.createCipheriv(CHACHA_POLY1305, k, nonce, { - authTagLength: 16 - }) - cipher.setAAD(ad, { plaintextLength: plaintext.byteLength }) - const updated = cipher.update(plaintext) - const final = cipher.final() - const tag = cipher.getAuthTag() - - const encrypted = Buffer.concat([updated, tag, final], updated.byteLength + tag.byteLength + final.byteLength) - return encrypted - }, - - chaCha20Poly1305Decrypt (ciphertext, nonce, ad, k, _dst) { - const authTag = ciphertext.subarray(ciphertext.length - 16) - const text = ciphertext.subarray(0, ciphertext.length - 16) - const decipher = crypto.createDecipheriv(CHACHA_POLY1305, k, nonce, { - authTagLength: 16 - }) - decipher.setAAD(ad, { - plaintextLength: text.byteLength - }) - decipher.setAuthTag(authTag) - const updated = decipher.update(text) - const final = decipher.final() - if (final.byteLength > 0) { - return Buffer.concat([updated, final], updated.byteLength + final.byteLength) - } - return updated - } -} - -const asCrypto: Pick = { - hashSHA256 (data) { - return digest(data) - }, - chaCha20Poly1305Encrypt (plaintext, nonce, ad, k) { - return asImpl.seal(k, nonce, plaintext, ad) - }, - chaCha20Poly1305Decrypt (ciphertext, nonce, ad, k, dst) { - return asImpl.open(k, nonce, ciphertext, ad, dst) - } -} - -// benchmarks show that for chacha20poly1305 -// the as implementation is faster for smaller payloads(<1200) -// and the node implementation is faster for larger payloads -export const defaultCrypto: ICryptoInterface = { - ...pureJsCrypto, - hashSHA256 (data) { - return nodeCrypto.hashSHA256(data) - }, - chaCha20Poly1305Encrypt (plaintext, nonce, ad, k) { - if (plaintext.length < 1200) { - return asCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) - } - return nodeCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) - }, - chaCha20Poly1305Decrypt (ciphertext, nonce, ad, k, dst) { - if (ciphertext.length < 1200) { - return asCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) - } - return nodeCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) - }, - generateX25519KeyPair (): KeyPair { - const { publicKey, privateKey } = crypto.generateKeyPairSync('x25519', { - publicKeyEncoding: { - type: 'spki', - format: 'der' - }, - privateKeyEncoding: { - type: 'pkcs8', - format: 'der' - } - }) - - return { - publicKey: publicKey.subarray(X25519_PREFIX.length), - privateKey: privateKey.subarray(PKCS8_PREFIX.length) - } - }, - generateX25519KeyPairFromSeed (seed: Uint8Array): KeyPair { - const privateKey = crypto.createPrivateKey({ - key: Buffer.concat([ - PKCS8_PREFIX, - seed - ], PKCS8_PREFIX.byteLength + seed.byteLength), - type: 'pkcs8', - format: 'der' - }) - - const publicKey = crypto.createPublicKey(privateKey) - .export({ - type: 'spki', - format: 'der' - }).subarray(X25519_PREFIX.length) - - return { - publicKey, - privateKey: seed - } - }, - generateX25519SharedKey (privateKey: Uint8Array, publicKey: Uint8Array): Uint8Array { - publicKey = Buffer.concat([ - X25519_PREFIX, - publicKey - ], X25519_PREFIX.byteLength + publicKey.byteLength) - - privateKey = Buffer.concat([ - PKCS8_PREFIX, - privateKey - ], PKCS8_PREFIX.byteLength + privateKey.byteLength) - - return crypto.diffieHellman({ - publicKey: crypto.createPublicKey({ - key: Buffer.from(publicKey, publicKey.byteOffset, publicKey.byteLength), - type: 'spki', - format: 'der' - }), - privateKey: crypto.createPrivateKey({ - key: Buffer.from(privateKey, privateKey.byteOffset, privateKey.byteLength), - type: 'pkcs8', - format: 'der' - }) - }) - } -} - -// no chacha20-poly1305 in electron https://github.com/electron/electron/issues/24024 -if (isElectronMain) { - defaultCrypto.chaCha20Poly1305Encrypt = asCrypto.chaCha20Poly1305Encrypt - defaultCrypto.chaCha20Poly1305Decrypt = asCrypto.chaCha20Poly1305Decrypt -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/crypto/js.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/crypto/js.ts deleted file mode 100644 index e47d4761b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/crypto/js.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { chacha20poly1305 } from '@noble/ciphers/chacha' -import { x25519 } from '@noble/curves/ed25519' -import { extract, expand } from '@noble/hashes/hkdf' -import { sha256 } from '@noble/hashes/sha256' -import type { bytes, bytes32 } from '../@types/basic.js' -import type { Hkdf } from '../@types/handshake.js' -import type { KeyPair } from '../@types/libp2p.js' -import type { ICryptoInterface } from '../crypto.js' - -export const pureJsCrypto: ICryptoInterface = { - hashSHA256 (data: Uint8Array): Uint8Array { - return sha256(data) - }, - - getHKDF (ck: bytes32, ikm: Uint8Array): Hkdf { - const prk = extract(sha256, ikm, ck) - const okmU8Array = expand(sha256, prk, undefined, 96) - const okm = okmU8Array - - const k1 = okm.subarray(0, 32) - const k2 = okm.subarray(32, 64) - const k3 = okm.subarray(64, 96) - - return [k1, k2, k3] - }, - - generateX25519KeyPair (): KeyPair { - const secretKey = x25519.utils.randomPrivateKey() - const publicKey = x25519.getPublicKey(secretKey) - - return { - publicKey, - privateKey: secretKey - } - }, - - generateX25519KeyPairFromSeed (seed: Uint8Array): KeyPair { - const publicKey = x25519.getPublicKey(seed) - - return { - publicKey, - privateKey: seed - } - }, - - generateX25519SharedKey (privateKey: Uint8Array, publicKey: Uint8Array): Uint8Array { - return x25519.getSharedSecret(privateKey, publicKey) - }, - - chaCha20Poly1305Encrypt (plaintext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32): bytes { - return chacha20poly1305(k, nonce, ad).encrypt(plaintext) - }, - - chaCha20Poly1305Decrypt (ciphertext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array): bytes | null { - return chacha20poly1305(k, nonce, ad).decrypt(ciphertext, dst) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/crypto/streaming.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/crypto/streaming.ts deleted file mode 100644 index c3bebff18..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/crypto/streaming.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist' -import { NOISE_MSG_MAX_LENGTH_BYTES, NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG } from '../constants.js' -import { uint16BEEncode } from '../encoder.js' -import type { IHandshake } from '../@types/handshake-interface.js' -import type { MetricsRegistry } from '../metrics.js' -import type { Transform } from 'it-stream-types' - -const CHACHA_TAG_LENGTH = 16 - -// Returns generator that encrypts payload from the user -export function encryptStream (handshake: IHandshake, metrics?: MetricsRegistry): Transform> { - return async function * (source) { - for await (const chunk of source) { - for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG) { - let end = i + NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG - if (end > chunk.length) { - end = chunk.length - } - - const data = handshake.encrypt(chunk.subarray(i, end), handshake.session) - metrics?.encryptedPackets.increment() - - yield new Uint8ArrayList(uint16BEEncode(data.byteLength), data) - } - } - } -} - -// Decrypt received payload to the user -export function decryptStream (handshake: IHandshake, metrics?: MetricsRegistry): Transform, AsyncGenerator> { - return async function * (source) { - for await (const chunk of source) { - for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES) { - let end = i + NOISE_MSG_MAX_LENGTH_BYTES - if (end > chunk.length) { - end = chunk.length - } - - if (end - CHACHA_TAG_LENGTH < i) { - throw new Error('Invalid chunk') - } - const encrypted = chunk.subarray(i, end) - // memory allocation is not cheap so reuse the encrypted Uint8Array - // see https://github.com/ChainSafe/js-libp2p-noise/pull/242#issue-1422126164 - // this is ok because chacha20 reads bytes one by one and don't reread after that - // it's also tested in https://github.com/ChainSafe/as-chacha20poly1305/pull/1/files#diff-25252846b58979dcaf4e41d47b3eadd7e4f335e7fb98da6c049b1f9cd011f381R48 - const dst = chunk.subarray(i, end - CHACHA_TAG_LENGTH) - const { plaintext: decrypted, valid } = handshake.decrypt(encrypted, handshake.session, dst) - if (!valid) { - metrics?.decryptErrors.increment() - throw new Error('Failed to validate decrypted chunk') - } - metrics?.decryptedPackets.increment() - yield decrypted - } - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/encoder.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/encoder.ts deleted file mode 100644 index 8c4d203d4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/encoder.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist' -import { alloc as uint8ArrayAlloc, allocUnsafe as uint8ArrayAllocUnsafe } from 'uint8arrays/alloc' -import type { bytes } from './@types/basic.js' -import type { MessageBuffer } from './@types/handshake.js' -import type { LengthDecoderFunction } from 'it-length-prefixed' - -export const uint16BEEncode = (value: number): Uint8Array => { - const target = uint8ArrayAllocUnsafe(2) - new DataView(target.buffer, target.byteOffset, target.byteLength).setUint16(0, value, false) - return target -} -uint16BEEncode.bytes = 2 - -export const uint16BEDecode: LengthDecoderFunction = (data: Uint8Array | Uint8ArrayList): number => { - if (data.length < 2) throw RangeError('Could not decode int16BE') - - if (data instanceof Uint8Array) { - return new DataView(data.buffer, data.byteOffset, data.byteLength).getUint16(0, false) - } - - return data.getUint16(0) -} -uint16BEDecode.bytes = 2 - -// Note: IK and XX encoder usage is opposite (XX uses in stages encode0 where IK uses encode1) - -export function encode0 (message: MessageBuffer): Uint8ArrayList { - return new Uint8ArrayList(message.ne, message.ciphertext) -} - -export function encode1 (message: MessageBuffer): Uint8ArrayList { - return new Uint8ArrayList(message.ne, message.ns, message.ciphertext) -} - -export function encode2 (message: MessageBuffer): Uint8ArrayList { - return new Uint8ArrayList(message.ns, message.ciphertext) -} - -export function decode0 (input: bytes): MessageBuffer { - if (input.length < 32) { - throw new Error('Cannot decode stage 0 MessageBuffer: length less than 32 bytes.') - } - - return { - ne: input.subarray(0, 32), - ciphertext: input.subarray(32, input.length), - ns: uint8ArrayAlloc(0) - } -} - -export function decode1 (input: bytes): MessageBuffer { - if (input.length < 80) { - throw new Error('Cannot decode stage 1 MessageBuffer: length less than 80 bytes.') - } - - return { - ne: input.subarray(0, 32), - ns: input.subarray(32, 80), - ciphertext: input.subarray(80, input.length) - } -} - -export function decode2 (input: bytes): MessageBuffer { - if (input.length < 48) { - throw new Error('Cannot decode stage 2 MessageBuffer: length less than 48 bytes.') - } - - return { - ne: uint8ArrayAlloc(0), - ns: input.subarray(0, 48), - ciphertext: input.subarray(48, input.length) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/handshake-xx.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/handshake-xx.ts deleted file mode 100644 index 3b547dc03..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/handshake-xx.ts +++ /dev/null @@ -1,178 +0,0 @@ -import { InvalidCryptoExchangeError, UnexpectedPeerError } from '@libp2p/interface/errors' -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { decode0, decode1, decode2, encode0, encode1, encode2 } from './encoder.js' -import { XX } from './handshakes/xx.js' -import { - logger, - logLocalStaticKeys, - logLocalEphemeralKeys, - logRemoteEphemeralKey, - logRemoteStaticKey, - logCipherState -} from './logger.js' -import { - decodePayload, - getPeerIdFromPayload, - verifySignedPayload -} from './utils.js' -import type { bytes, bytes32 } from './@types/basic.js' -import type { IHandshake } from './@types/handshake-interface.js' -import type { CipherState, NoiseSession } from './@types/handshake.js' -import type { KeyPair } from './@types/libp2p.js' -import type { ICryptoInterface } from './crypto.js' -import type { NoiseExtensions } from './proto/payload.js' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { LengthPrefixedStream } from 'it-length-prefixed-stream' - -export class XXHandshake implements IHandshake { - public isInitiator: boolean - public session: NoiseSession - public remotePeer!: PeerId - public remoteExtensions: NoiseExtensions = { webtransportCerthashes: [] } - - protected payload: bytes - protected connection: LengthPrefixedStream - protected xx: XX - protected staticKeypair: KeyPair - - private readonly prologue: bytes32 - - constructor ( - isInitiator: boolean, - payload: bytes, - prologue: bytes32, - crypto: ICryptoInterface, - staticKeypair: KeyPair, - connection: LengthPrefixedStream, - remotePeer?: PeerId, - handshake?: XX - ) { - this.isInitiator = isInitiator - this.payload = payload - this.prologue = prologue - this.staticKeypair = staticKeypair - this.connection = connection - if (remotePeer) { - this.remotePeer = remotePeer - } - this.xx = handshake ?? new XX(crypto) - this.session = this.xx.initSession(this.isInitiator, this.prologue, this.staticKeypair) - } - - // stage 0 - public async propose (): Promise { - logLocalStaticKeys(this.session.hs.s) - if (this.isInitiator) { - logger.trace('Stage 0 - Initiator starting to send first message.') - const messageBuffer = this.xx.sendMessage(this.session, uint8ArrayAlloc(0)) - await this.connection.write(encode0(messageBuffer)) - logger.trace('Stage 0 - Initiator finished sending first message.') - logLocalEphemeralKeys(this.session.hs.e) - } else { - logger.trace('Stage 0 - Responder waiting to receive first message...') - const receivedMessageBuffer = decode0((await this.connection.read()).subarray()) - const { valid } = this.xx.recvMessage(this.session, receivedMessageBuffer) - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 0 validation fail') - } - logger.trace('Stage 0 - Responder received first message.') - logRemoteEphemeralKey(this.session.hs.re) - } - } - - // stage 1 - public async exchange (): Promise { - if (this.isInitiator) { - logger.trace('Stage 1 - Initiator waiting to receive first message from responder...') - const receivedMessageBuffer = decode1((await this.connection.read()).subarray()) - const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer) - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 1 validation fail') - } - logger.trace('Stage 1 - Initiator received the message.') - logRemoteEphemeralKey(this.session.hs.re) - logRemoteStaticKey(this.session.hs.rs) - - logger.trace("Initiator going to check remote's signature...") - try { - const decodedPayload = decodePayload(plaintext) - this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload) - await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer) - this.setRemoteNoiseExtension(decodedPayload.extensions) - } catch (e) { - const err = e as Error - throw new UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`) - } - logger.trace('All good with the signature!') - } else { - logger.trace('Stage 1 - Responder sending out first message with signed payload and static key.') - const messageBuffer = this.xx.sendMessage(this.session, this.payload) - await this.connection.write(encode1(messageBuffer)) - logger.trace('Stage 1 - Responder sent the second handshake message with signed payload.') - logLocalEphemeralKeys(this.session.hs.e) - } - } - - // stage 2 - public async finish (): Promise { - if (this.isInitiator) { - logger.trace('Stage 2 - Initiator sending third handshake message.') - const messageBuffer = this.xx.sendMessage(this.session, this.payload) - await this.connection.write(encode2(messageBuffer)) - logger.trace('Stage 2 - Initiator sent message with signed payload.') - } else { - logger.trace('Stage 2 - Responder waiting for third handshake message...') - const receivedMessageBuffer = decode2((await this.connection.read()).subarray()) - const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer) - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 2 validation fail') - } - logger.trace('Stage 2 - Responder received the message, finished handshake.') - - try { - const decodedPayload = decodePayload(plaintext) - this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload) - await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer) - this.setRemoteNoiseExtension(decodedPayload.extensions) - } catch (e) { - const err = e as Error - throw new UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`) - } - } - logCipherState(this.session) - } - - public encrypt (plaintext: Uint8Array, session: NoiseSession): bytes { - const cs = this.getCS(session) - - return this.xx.encryptWithAd(cs, uint8ArrayAlloc(0), plaintext) - } - - public decrypt (ciphertext: Uint8Array, session: NoiseSession, dst?: Uint8Array): { plaintext: bytes, valid: boolean } { - const cs = this.getCS(session, false) - - return this.xx.decryptWithAd(cs, uint8ArrayAlloc(0), ciphertext, dst) - } - - public getRemoteStaticKey (): bytes { - return this.session.hs.rs - } - - private getCS (session: NoiseSession, encryption = true): CipherState { - if (!session.cs1 || !session.cs2) { - throw new InvalidCryptoExchangeError('Handshake not completed properly, cipher state does not exist.') - } - - if (this.isInitiator) { - return encryption ? session.cs1 : session.cs2 - } else { - return encryption ? session.cs2 : session.cs1 - } - } - - protected setRemoteNoiseExtension (e: NoiseExtensions | null | undefined): void { - if (e) { - this.remoteExtensions = e - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/handshakes/abstract-handshake.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/handshakes/abstract-handshake.ts deleted file mode 100644 index 308d298c5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/handshakes/abstract-handshake.ts +++ /dev/null @@ -1,181 +0,0 @@ -import { fromString as uint8ArrayFromString } from 'uint8arrays' -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { concat as uint8ArrayConcat } from 'uint8arrays/concat' -import { equals as uint8ArrayEquals } from 'uint8arrays/equals' -import { logger } from '../logger.js' -import { Nonce } from '../nonce.js' -import type { bytes, bytes32 } from '../@types/basic.js' -import type { CipherState, MessageBuffer, SymmetricState } from '../@types/handshake.js' -import type { ICryptoInterface } from '../crypto.js' - -export interface DecryptedResult { - plaintext: bytes - valid: boolean -} - -export interface SplitState { - cs1: CipherState - cs2: CipherState -} - -export abstract class AbstractHandshake { - public crypto: ICryptoInterface - - constructor (crypto: ICryptoInterface) { - this.crypto = crypto - } - - public encryptWithAd (cs: CipherState, ad: Uint8Array, plaintext: Uint8Array): bytes { - const e = this.encrypt(cs.k, cs.n, ad, plaintext) - cs.n.increment() - - return e - } - - public decryptWithAd (cs: CipherState, ad: Uint8Array, ciphertext: Uint8Array, dst?: Uint8Array): DecryptedResult { - const { plaintext, valid } = this.decrypt(cs.k, cs.n, ad, ciphertext, dst) - if (valid) cs.n.increment() - - return { plaintext, valid } - } - - // Cipher state related - protected hasKey (cs: CipherState): boolean { - return !this.isEmptyKey(cs.k) - } - - protected createEmptyKey (): bytes32 { - return uint8ArrayAlloc(32) - } - - protected isEmptyKey (k: bytes32): boolean { - const emptyKey = this.createEmptyKey() - return uint8ArrayEquals(emptyKey, k) - } - - protected encrypt (k: bytes32, n: Nonce, ad: Uint8Array, plaintext: Uint8Array): bytes { - n.assertValue() - - return this.crypto.chaCha20Poly1305Encrypt(plaintext, n.getBytes(), ad, k) - } - - protected encryptAndHash (ss: SymmetricState, plaintext: bytes): bytes { - let ciphertext - if (this.hasKey(ss.cs)) { - ciphertext = this.encryptWithAd(ss.cs, ss.h, plaintext) - } else { - ciphertext = plaintext - } - - this.mixHash(ss, ciphertext) - return ciphertext - } - - protected decrypt (k: bytes32, n: Nonce, ad: bytes, ciphertext: bytes, dst?: Uint8Array): DecryptedResult { - n.assertValue() - - const encryptedMessage = this.crypto.chaCha20Poly1305Decrypt(ciphertext, n.getBytes(), ad, k, dst) - - if (encryptedMessage) { - return { - plaintext: encryptedMessage, - valid: true - } - } else { - return { - plaintext: uint8ArrayAlloc(0), - valid: false - } - } - } - - protected decryptAndHash (ss: SymmetricState, ciphertext: bytes): DecryptedResult { - let plaintext: bytes; let valid = true - if (this.hasKey(ss.cs)) { - ({ plaintext, valid } = this.decryptWithAd(ss.cs, ss.h, ciphertext)) - } else { - plaintext = ciphertext - } - - this.mixHash(ss, ciphertext) - return { plaintext, valid } - } - - protected dh (privateKey: bytes32, publicKey: bytes32): bytes32 { - try { - const derivedU8 = this.crypto.generateX25519SharedKey(privateKey, publicKey) - - if (derivedU8.length === 32) { - return derivedU8 - } - - return derivedU8.subarray(0, 32) - } catch (e) { - const err = e as Error - logger.error(err) - return uint8ArrayAlloc(32) - } - } - - protected mixHash (ss: SymmetricState, data: bytes): void { - ss.h = this.getHash(ss.h, data) - } - - protected getHash (a: Uint8Array, b: Uint8Array): bytes32 { - const u = this.crypto.hashSHA256(uint8ArrayConcat([a, b], a.length + b.length)) - return u - } - - protected mixKey (ss: SymmetricState, ikm: bytes32): void { - const [ck, tempK] = this.crypto.getHKDF(ss.ck, ikm) - ss.cs = this.initializeKey(tempK) - ss.ck = ck - } - - protected initializeKey (k: bytes32): CipherState { - return { k, n: new Nonce() } - } - - // Symmetric state related - - protected initializeSymmetric (protocolName: string): SymmetricState { - const protocolNameBytes = uint8ArrayFromString(protocolName, 'utf-8') - const h = this.hashProtocolName(protocolNameBytes) - - const ck = h - const key = this.createEmptyKey() - const cs: CipherState = this.initializeKey(key) - - return { cs, ck, h } - } - - protected hashProtocolName (protocolName: Uint8Array): bytes32 { - if (protocolName.length <= 32) { - const h = uint8ArrayAlloc(32) - h.set(protocolName) - return h - } else { - return this.getHash(protocolName, uint8ArrayAlloc(0)) - } - } - - protected split (ss: SymmetricState): SplitState { - const [tempk1, tempk2] = this.crypto.getHKDF(ss.ck, uint8ArrayAlloc(0)) - const cs1 = this.initializeKey(tempk1) - const cs2 = this.initializeKey(tempk2) - - return { cs1, cs2 } - } - - protected writeMessageRegular (cs: CipherState, payload: bytes): MessageBuffer { - const ciphertext = this.encryptWithAd(cs, uint8ArrayAlloc(0), payload) - const ne = this.createEmptyKey() - const ns = uint8ArrayAlloc(0) - - return { ne, ns, ciphertext } - } - - protected readMessageRegular (cs: CipherState, message: MessageBuffer): DecryptedResult { - return this.decryptWithAd(cs, uint8ArrayAlloc(0), message.ciphertext) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/handshakes/xx.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/handshakes/xx.ts deleted file mode 100644 index 61077388f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/handshakes/xx.ts +++ /dev/null @@ -1,185 +0,0 @@ -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { isValidPublicKey } from '../utils.js' -import { AbstractHandshake, type DecryptedResult } from './abstract-handshake.js' -import type { bytes32, bytes } from '../@types/basic.js' -import type { CipherState, HandshakeState, MessageBuffer, NoiseSession } from '../@types/handshake.js' -import type { KeyPair } from '../@types/libp2p.js' - -export class XX extends AbstractHandshake { - private initializeInitiator (prologue: bytes32, s: KeyPair, rs: bytes32, psk: bytes32): HandshakeState { - const name = 'Noise_XX_25519_ChaChaPoly_SHA256' - const ss = this.initializeSymmetric(name) - this.mixHash(ss, prologue) - const re = uint8ArrayAlloc(32) - - return { ss, s, rs, psk, re } - } - - private initializeResponder (prologue: bytes32, s: KeyPair, rs: bytes32, psk: bytes32): HandshakeState { - const name = 'Noise_XX_25519_ChaChaPoly_SHA256' - const ss = this.initializeSymmetric(name) - this.mixHash(ss, prologue) - const re = uint8ArrayAlloc(32) - - return { ss, s, rs, psk, re } - } - - private writeMessageA (hs: HandshakeState, payload: bytes, e?: KeyPair): MessageBuffer { - const ns = uint8ArrayAlloc(0) - - if (e !== undefined) { - hs.e = e - } else { - hs.e = this.crypto.generateX25519KeyPair() - } - - const ne = hs.e.publicKey - - this.mixHash(hs.ss, ne) - const ciphertext = this.encryptAndHash(hs.ss, payload) - - return { ne, ns, ciphertext } - } - - private writeMessageB (hs: HandshakeState, payload: bytes): MessageBuffer { - hs.e = this.crypto.generateX25519KeyPair() - const ne = hs.e.publicKey - this.mixHash(hs.ss, ne) - - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re)) - const spk = hs.s.publicKey - const ns = this.encryptAndHash(hs.ss, spk) - - this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re)) - const ciphertext = this.encryptAndHash(hs.ss, payload) - - return { ne, ns, ciphertext } - } - - private writeMessageC (hs: HandshakeState, payload: bytes): { messageBuffer: MessageBuffer, cs1: CipherState, cs2: CipherState, h: bytes } { - const spk = hs.s.publicKey - const ns = this.encryptAndHash(hs.ss, spk) - this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re)) - const ciphertext = this.encryptAndHash(hs.ss, payload) - const ne = this.createEmptyKey() - const messageBuffer: MessageBuffer = { ne, ns, ciphertext } - const { cs1, cs2 } = this.split(hs.ss) - - return { h: hs.ss.h, messageBuffer, cs1, cs2 } - } - - private readMessageA (hs: HandshakeState, message: MessageBuffer): DecryptedResult { - if (isValidPublicKey(message.ne)) { - hs.re = message.ne - } - - this.mixHash(hs.ss, hs.re) - return this.decryptAndHash(hs.ss, message.ciphertext) - } - - private readMessageB (hs: HandshakeState, message: MessageBuffer): DecryptedResult { - if (isValidPublicKey(message.ne)) { - hs.re = message.ne - } - - this.mixHash(hs.ss, hs.re) - if (!hs.e) { - throw new Error('Handshake state `e` param is missing.') - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re)) - const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns) - if (valid1 && isValidPublicKey(ns)) { - hs.rs = ns - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs)) - const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext) - return { plaintext, valid: (valid1 && valid2) } - } - - private readMessageC (hs: HandshakeState, message: MessageBuffer): { h: bytes, plaintext: bytes, valid: boolean, cs1: CipherState, cs2: CipherState } { - const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns) - if (valid1 && isValidPublicKey(ns)) { - hs.rs = ns - } - if (!hs.e) { - throw new Error('Handshake state `e` param is missing.') - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs)) - - const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext) - const { cs1, cs2 } = this.split(hs.ss) - - return { h: hs.ss.h, plaintext, valid: (valid1 && valid2), cs1, cs2 } - } - - public initSession (initiator: boolean, prologue: bytes32, s: KeyPair): NoiseSession { - const psk = this.createEmptyKey() - const rs = uint8ArrayAlloc(32) // no static key yet - let hs - - if (initiator) { - hs = this.initializeInitiator(prologue, s, rs, psk) - } else { - hs = this.initializeResponder(prologue, s, rs, psk) - } - - return { - hs, - i: initiator, - mc: 0 - } - } - - public sendMessage (session: NoiseSession, message: bytes, ephemeral?: KeyPair): MessageBuffer { - let messageBuffer: MessageBuffer - if (session.mc === 0) { - messageBuffer = this.writeMessageA(session.hs, message, ephemeral) - } else if (session.mc === 1) { - messageBuffer = this.writeMessageB(session.hs, message) - } else if (session.mc === 2) { - const { h, messageBuffer: resultingBuffer, cs1, cs2 } = this.writeMessageC(session.hs, message) - messageBuffer = resultingBuffer - session.h = h - session.cs1 = cs1 - session.cs2 = cs2 - } else if (session.mc > 2) { - if (session.i) { - if (!session.cs1) { - throw new Error('CS1 (cipher state) is not defined') - } - - messageBuffer = this.writeMessageRegular(session.cs1, message) - } else { - if (!session.cs2) { - throw new Error('CS2 (cipher state) is not defined') - } - - messageBuffer = this.writeMessageRegular(session.cs2, message) - } - } else { - throw new Error('Session invalid.') - } - - session.mc++ - return messageBuffer - } - - public recvMessage (session: NoiseSession, message: MessageBuffer): DecryptedResult { - let plaintext: bytes = uint8ArrayAlloc(0) - let valid = false - if (session.mc === 0) { - ({ plaintext, valid } = this.readMessageA(session.hs, message)) - } else if (session.mc === 1) { - ({ plaintext, valid } = this.readMessageB(session.hs, message)) - } else if (session.mc === 2) { - const { h, plaintext: resultingPlaintext, valid: resultingValid, cs1, cs2 } = this.readMessageC(session.hs, message) - plaintext = resultingPlaintext - valid = resultingValid - session.h = h - session.cs1 = cs1 - session.cs2 = cs2 - } - session.mc++ - return { plaintext, valid } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/index.ts deleted file mode 100644 index 3a42c8972..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Noise } from './noise.js' -import type { NoiseInit } from './noise.js' -import type { NoiseExtensions } from './proto/payload.js' -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter' -export type { ICryptoInterface } from './crypto.js' -export { pureJsCrypto } from './crypto/js.js' - -export function noise (init: NoiseInit = {}): () => ConnectionEncrypter { - return () => new Noise(init) -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/logger.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/logger.ts deleted file mode 100644 index b44ca7b42..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/logger.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { type Logger, logger } from '@libp2p/logger' -import { toString as uint8ArrayToString } from 'uint8arrays/to-string' -import { DUMP_SESSION_KEYS } from './constants.js' -import type { NoiseSession } from './@types/handshake.js' -import type { KeyPair } from './@types/libp2p.js' - -const log = logger('libp2p:noise') - -export { log as logger } - -let keyLogger: Logger -if (DUMP_SESSION_KEYS) { - keyLogger = log -} else { - keyLogger = Object.assign(() => { /* do nothing */ }, { - enabled: false, - trace: () => {}, - error: () => {} - }) -} - -export function logLocalStaticKeys (s: KeyPair): void { - keyLogger(`LOCAL_STATIC_PUBLIC_KEY ${uint8ArrayToString(s.publicKey, 'hex')}`) - keyLogger(`LOCAL_STATIC_PRIVATE_KEY ${uint8ArrayToString(s.privateKey, 'hex')}`) -} - -export function logLocalEphemeralKeys (e: KeyPair | undefined): void { - if (e) { - keyLogger(`LOCAL_PUBLIC_EPHEMERAL_KEY ${uint8ArrayToString(e.publicKey, 'hex')}`) - keyLogger(`LOCAL_PRIVATE_EPHEMERAL_KEY ${uint8ArrayToString(e.privateKey, 'hex')}`) - } else { - keyLogger('Missing local ephemeral keys.') - } -} - -export function logRemoteStaticKey (rs: Uint8Array): void { - keyLogger(`REMOTE_STATIC_PUBLIC_KEY ${uint8ArrayToString(rs, 'hex')}`) -} - -export function logRemoteEphemeralKey (re: Uint8Array): void { - keyLogger(`REMOTE_EPHEMERAL_PUBLIC_KEY ${uint8ArrayToString(re, 'hex')}`) -} - -export function logCipherState (session: NoiseSession): void { - if (session.cs1 && session.cs2) { - keyLogger(`CIPHER_STATE_1 ${session.cs1.n.getUint64()} ${uint8ArrayToString(session.cs1.k, 'hex')}`) - keyLogger(`CIPHER_STATE_2 ${session.cs2.n.getUint64()} ${uint8ArrayToString(session.cs2.k, 'hex')}`) - } else { - keyLogger('Missing cipher state.') - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/metrics.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/metrics.ts deleted file mode 100644 index 8d0b3a4e7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/metrics.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { Counter, Metrics } from '@libp2p/interface/metrics' - -export type MetricsRegistry = Record - -export function registerMetrics (metrics: Metrics): MetricsRegistry { - return { - xxHandshakeSuccesses: metrics.registerCounter( - 'libp2p_noise_xxhandshake_successes_total', { - help: 'Total count of noise xxHandshakes successes_' - }), - - xxHandshakeErrors: metrics.registerCounter( - 'libp2p_noise_xxhandshake_error_total', { - help: 'Total count of noise xxHandshakes errors' - }), - - encryptedPackets: metrics.registerCounter( - 'libp2p_noise_encrypted_packets_total', { - help: 'Total count of noise encrypted packets successfully' - }), - - decryptedPackets: metrics.registerCounter( - 'libp2p_noise_decrypted_packets_total', { - help: 'Total count of noise decrypted packets' - }), - - decryptErrors: metrics.registerCounter( - 'libp2p_noise_decrypt_errors_total', { - help: 'Total count of noise decrypt errors' - }) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/noise.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/noise.ts deleted file mode 100644 index 7996ef225..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/noise.ts +++ /dev/null @@ -1,201 +0,0 @@ -import { decode } from 'it-length-prefixed' -import { lpStream, type LengthPrefixedStream } from 'it-length-prefixed-stream' -import { duplexPair } from 'it-pair/duplex' -import { pipe } from 'it-pipe' -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { NOISE_MSG_MAX_LENGTH_BYTES } from './constants.js' -import { defaultCrypto } from './crypto/index.js' -import { decryptStream, encryptStream } from './crypto/streaming.js' -import { uint16BEDecode, uint16BEEncode } from './encoder.js' -import { XXHandshake } from './handshake-xx.js' -import { type MetricsRegistry, registerMetrics } from './metrics.js' -import { getPayload } from './utils.js' -import type { bytes } from './@types/basic.js' -import type { IHandshake } from './@types/handshake-interface.js' -import type { INoiseConnection, KeyPair } from './@types/libp2p.js' -import type { ICryptoInterface } from './crypto.js' -import type { NoiseExtensions } from './proto/payload.js' -import type { MultiaddrConnection } from '@libp2p/interface/connection' -import type { SecuredConnection } from '@libp2p/interface/connection-encrypter' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { Duplex } from 'it-stream-types' -import type { Uint8ArrayList } from 'uint8arraylist' - -interface HandshakeParams { - connection: LengthPrefixedStream - isInitiator: boolean - localPeer: PeerId - remotePeer?: PeerId -} - -export interface NoiseInit { - /** - * x25519 private key, reuse for faster handshakes - */ - staticNoiseKey?: bytes - extensions?: NoiseExtensions - crypto?: ICryptoInterface - prologueBytes?: Uint8Array - metrics?: Metrics -} - -export class Noise implements INoiseConnection { - public protocol = '/noise' - public crypto: ICryptoInterface - - private readonly prologue: Uint8Array - private readonly staticKeys: KeyPair - private readonly extensions?: NoiseExtensions - private readonly metrics?: MetricsRegistry - - constructor (init: NoiseInit = {}) { - const { staticNoiseKey, extensions, crypto, prologueBytes, metrics } = init - - this.crypto = crypto ?? defaultCrypto - this.extensions = extensions - this.metrics = metrics ? registerMetrics(metrics) : undefined - - if (staticNoiseKey) { - // accepts x25519 private key of length 32 - this.staticKeys = this.crypto.generateX25519KeyPairFromSeed(staticNoiseKey) - } else { - this.staticKeys = this.crypto.generateX25519KeyPair() - } - this.prologue = prologueBytes ?? uint8ArrayAlloc(0) - } - - /** - * Encrypt outgoing data to the remote party (handshake as initiator) - * - * @param {PeerId} localPeer - PeerId of the receiving peer - * @param {Stream} connection - streaming iterable duplex that will be encrypted - * @param {PeerId} remotePeer - PeerId of the remote peer. Used to validate the integrity of the remote peer. - * @returns {Promise>} - */ - public async secureOutbound > = MultiaddrConnection> (localPeer: PeerId, connection: Stream, remotePeer?: PeerId): Promise> { - const wrappedConnection = lpStream( - connection, - { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - } - ) - const handshake = await this.performHandshake({ - connection: wrappedConnection, - isInitiator: true, - localPeer, - remotePeer - }) - const conn = await this.createSecureConnection(wrappedConnection, handshake) - - connection.source = conn.source - connection.sink = conn.sink - - return { - conn: connection, - remoteExtensions: handshake.remoteExtensions, - remotePeer: handshake.remotePeer - } - } - - /** - * Decrypt incoming data (handshake as responder). - * - * @param {PeerId} localPeer - PeerId of the receiving peer. - * @param {Stream} connection - streaming iterable duplex that will be encrypted. - * @param {PeerId} remotePeer - optional PeerId of the initiating peer, if known. This may only exist during transport upgrades. - * @returns {Promise>} - */ - public async secureInbound > = MultiaddrConnection> (localPeer: PeerId, connection: Stream, remotePeer?: PeerId): Promise> { - const wrappedConnection = lpStream( - connection, - { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - } - ) - const handshake = await this.performHandshake({ - connection: wrappedConnection, - isInitiator: false, - localPeer, - remotePeer - }) - const conn = await this.createSecureConnection(wrappedConnection, handshake) - - connection.source = conn.source - connection.sink = conn.sink - - return { - conn: connection, - remotePeer: handshake.remotePeer, - remoteExtensions: handshake.remoteExtensions - } - } - - /** - * If Noise pipes supported, tries IK handshake first with XX as fallback if it fails. - * If noise pipes disabled or remote peer static key is unknown, use XX. - * - * @param {HandshakeParams} params - */ - private async performHandshake (params: HandshakeParams): Promise { - const payload = await getPayload(params.localPeer, this.staticKeys.publicKey, this.extensions) - - // run XX handshake - return this.performXXHandshake(params, payload) - } - - private async performXXHandshake ( - params: HandshakeParams, - payload: bytes - ): Promise { - const { isInitiator, remotePeer, connection } = params - const handshake = new XXHandshake( - isInitiator, - payload, - this.prologue, - this.crypto, - this.staticKeys, - connection, - remotePeer - ) - - try { - await handshake.propose() - await handshake.exchange() - await handshake.finish() - this.metrics?.xxHandshakeSuccesses.increment() - } catch (e: unknown) { - this.metrics?.xxHandshakeErrors.increment() - if (e instanceof Error) { - e.message = `Error occurred during XX handshake: ${e.message}` - throw e - } - } - - return handshake - } - - private async createSecureConnection ( - connection: LengthPrefixedStream>>, - handshake: IHandshake - ): Promise>> { - // Create encryption box/unbox wrapper - const [secure, user] = duplexPair() - const network = connection.unwrap() - - await pipe( - secure, // write to wrapper - encryptStream(handshake, this.metrics), // encrypt data + prefix with message length - network, // send to the remote peer - (source) => decode(source, { lengthDecoder: uint16BEDecode }), // read message length prefix - decryptStream(handshake, this.metrics), // decrypt the incoming data - secure // pipe to the wrapper - ) - - return user - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/nonce.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/nonce.ts deleted file mode 100644 index e19183dd8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/nonce.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import type { bytes, uint64 } from './@types/basic.js' - -export const MIN_NONCE = 0 -// For performance reasons, the nonce is represented as a JS `number` -// Although JS `number` can safely represent integers up to 2 ** 53 - 1, we choose to only use -// 4 bytes to store the data for performance reason. -// This is a slight deviation from the noise spec, which describes the max nonce as 2 ** 64 - 2 -// The effect is that this implementation will need a new handshake to be performed after fewer messages are exchanged than other implementations with full uint64 nonces. -// this MAX_NONCE is still a large number of messages, so the practical effect of this is negligible. -export const MAX_NONCE = 0xffffffff - -const ERR_MAX_NONCE = 'Cipherstate has reached maximum n, a new handshake must be performed' - -/** - * The nonce is an uint that's increased over time. - * Maintaining different representations help improve performance. - */ -export class Nonce { - private n: uint64 - private readonly bytes: bytes - private readonly view: DataView - - constructor (n = MIN_NONCE) { - this.n = n - this.bytes = uint8ArrayAlloc(12) - this.view = new DataView(this.bytes.buffer, this.bytes.byteOffset, this.bytes.byteLength) - this.view.setUint32(4, n, true) - } - - increment (): void { - this.n++ - // Even though we're treating the nonce as 8 bytes, RFC7539 specifies 12 bytes for a nonce. - this.view.setUint32(4, this.n, true) - } - - getBytes (): bytes { - return this.bytes - } - - getUint64 (): uint64 { - return this.n - } - - assertValue (): void { - if (this.n > MAX_NONCE) { - throw new Error(ERR_MAX_NONCE) - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/proto/payload.proto b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/proto/payload.proto deleted file mode 100644 index cdb2383cb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/proto/payload.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; - -message NoiseExtensions { - repeated bytes webtransport_certhashes = 1; -} - -message NoiseHandshakePayload { - bytes identity_key = 1; - bytes identity_sig = 2; - optional NoiseExtensions extensions = 4; -} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/proto/payload.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/proto/payload.ts deleted file mode 100644 index 5f8d5100f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/proto/payload.ts +++ /dev/null @@ -1,152 +0,0 @@ -/* eslint-disable import/export */ -/* eslint-disable complexity */ -/* eslint-disable @typescript-eslint/no-namespace */ -/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ -/* eslint-disable @typescript-eslint/no-empty-interface */ - -import { type Codec, decodeMessage, encodeMessage, message } from 'protons-runtime' -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import type { Uint8ArrayList } from 'uint8arraylist' - -export interface NoiseExtensions { - webtransportCerthashes: Uint8Array[] -} - -export namespace NoiseExtensions { - let _codec: Codec - - export const codec = (): Codec => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork() - } - - if (obj.webtransportCerthashes != null) { - for (const value of obj.webtransportCerthashes) { - w.uint32(10) - w.bytes(value) - } - } - - if (opts.lengthDelimited !== false) { - w.ldelim() - } - }, (reader, length) => { - const obj: any = { - webtransportCerthashes: [] - } - - const end = length == null ? reader.len : reader.pos + length - - while (reader.pos < end) { - const tag = reader.uint32() - - switch (tag >>> 3) { - case 1: { - obj.webtransportCerthashes.push(reader.bytes()) - break - } - default: { - reader.skipType(tag & 7) - break - } - } - } - - return obj - }) - } - - return _codec - } - - export const encode = (obj: Partial): Uint8Array => { - return encodeMessage(obj, NoiseExtensions.codec()) - } - - export const decode = (buf: Uint8Array | Uint8ArrayList): NoiseExtensions => { - return decodeMessage(buf, NoiseExtensions.codec()) - } -} - -export interface NoiseHandshakePayload { - identityKey: Uint8Array - identitySig: Uint8Array - extensions?: NoiseExtensions -} - -export namespace NoiseHandshakePayload { - let _codec: Codec - - export const codec = (): Codec => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork() - } - - if ((obj.identityKey != null && obj.identityKey.byteLength > 0)) { - w.uint32(10) - w.bytes(obj.identityKey) - } - - if ((obj.identitySig != null && obj.identitySig.byteLength > 0)) { - w.uint32(18) - w.bytes(obj.identitySig) - } - - if (obj.extensions != null) { - w.uint32(34) - NoiseExtensions.codec().encode(obj.extensions, w) - } - - if (opts.lengthDelimited !== false) { - w.ldelim() - } - }, (reader, length) => { - const obj: any = { - identityKey: uint8ArrayAlloc(0), - identitySig: uint8ArrayAlloc(0) - } - - const end = length == null ? reader.len : reader.pos + length - - while (reader.pos < end) { - const tag = reader.uint32() - - switch (tag >>> 3) { - case 1: { - obj.identityKey = reader.bytes() - break - } - case 2: { - obj.identitySig = reader.bytes() - break - } - case 4: { - obj.extensions = NoiseExtensions.codec().decode(reader, reader.uint32()) - break - } - default: { - reader.skipType(tag & 7) - break - } - } - } - - return obj - }) - } - - return _codec - } - - export const encode = (obj: Partial): Uint8Array => { - return encodeMessage(obj, NoiseHandshakePayload.codec()) - } - - export const decode = (buf: Uint8Array | Uint8ArrayList): NoiseHandshakePayload => { - return decodeMessage(buf, NoiseHandshakePayload.codec()) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/utils.ts deleted file mode 100644 index 993c9628c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/noise/src/utils.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { unmarshalPublicKey, unmarshalPrivateKey } from '@libp2p/crypto/keys' -import { peerIdFromKeys } from '@libp2p/peer-id' -import { concat as uint8ArrayConcat } from 'uint8arrays/concat' -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' -import { type NoiseExtensions, NoiseHandshakePayload } from './proto/payload.js' -import type { bytes } from './@types/basic.js' -import type { PeerId } from '@libp2p/interface/peer-id' - -export async function getPayload ( - localPeer: PeerId, - staticPublicKey: bytes, - extensions?: NoiseExtensions -): Promise { - const signedPayload = await signPayload(localPeer, getHandshakePayload(staticPublicKey)) - - if (localPeer.publicKey == null) { - throw new Error('PublicKey was missing from local PeerId') - } - - return createHandshakePayload( - localPeer.publicKey, - signedPayload, - extensions - ) -} - -export function createHandshakePayload ( - libp2pPublicKey: Uint8Array, - signedPayload: Uint8Array, - extensions?: NoiseExtensions -): bytes { - return NoiseHandshakePayload.encode({ - identityKey: libp2pPublicKey, - identitySig: signedPayload, - extensions: extensions ?? { webtransportCerthashes: [] } - }).subarray() -} - -export async function signPayload (peerId: PeerId, payload: bytes): Promise { - if (peerId.privateKey == null) { - throw new Error('PrivateKey was missing from PeerId') - } - - const privateKey = await unmarshalPrivateKey(peerId.privateKey) - - return privateKey.sign(payload) -} - -export async function getPeerIdFromPayload (payload: NoiseHandshakePayload): Promise { - return peerIdFromKeys(payload.identityKey) -} - -export function decodePayload (payload: bytes | Uint8Array): NoiseHandshakePayload { - return NoiseHandshakePayload.decode(payload) -} - -export function getHandshakePayload (publicKey: bytes): bytes { - const prefix = uint8ArrayFromString('noise-libp2p-static-key:') - return uint8ArrayConcat([prefix, publicKey], prefix.length + publicKey.length) -} - -/** - * Verifies signed payload, throws on any irregularities. - * - * @param {bytes} noiseStaticKey - owner's noise static key - * @param {bytes} payload - decoded payload - * @param {PeerId} remotePeer - owner's libp2p peer ID - * @returns {Promise} - peer ID of payload owner - */ -export async function verifySignedPayload ( - noiseStaticKey: bytes, - payload: NoiseHandshakePayload, - remotePeer: PeerId -): Promise { - // Unmarshaling from PublicKey protobuf - const payloadPeerId = await peerIdFromKeys(payload.identityKey) - if (!payloadPeerId.equals(remotePeer)) { - throw new Error(`Payload identity key ${payloadPeerId.toString()} does not match expected remote peer ${remotePeer.toString()}`) - } - const generatedPayload = getHandshakePayload(noiseStaticKey) - - if (payloadPeerId.publicKey == null) { - throw new Error('PublicKey was missing from PeerId') - } - - if (payload.identitySig == null) { - throw new Error('Signature was missing from message') - } - - const publicKey = unmarshalPublicKey(payloadPeerId.publicKey) - - const valid = await publicKey.verify(generatedPayload, payload.identitySig) - - if (!valid) { - throw new Error("Static key doesn't match to peer that signed payload!") - } - - return payloadPeerId -} - -export function isValidPublicKey (pk: bytes): boolean { - if (!(pk instanceof Uint8Array)) { - return false - } - - if (pk.length !== 32) { - return false - } - - return true -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/package-lock.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/package-lock.json deleted file mode 100644 index 7f8503d48..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/package-lock.json +++ /dev/null @@ -1,1143 +0,0 @@ -{ - "name": "@libp2p/perf-js-libp2p-1-0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@libp2p/perf-js-libp2p-1-0", - "dependencies": { - "@chainsafe/libp2p-noise": "^13.0.3", - "@chainsafe/libp2p-yamux": "^5.0.3", - "@libp2p/perf": "next", - "@libp2p/tcp": "next", - "libp2p": "next" - } - }, - "node_modules/@chainsafe/as-chacha20poly1305": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@chainsafe/as-chacha20poly1305/-/as-chacha20poly1305-0.1.0.tgz", - "integrity": "sha512-BpNcL8/lji/GM3+vZ/bgRWqJ1q5kwvTFmGPk7pxm/QQZDbaMI98waOHjEymTjq2JmdD/INdNBFOVSyJofXg7ew==" - }, - "node_modules/@chainsafe/as-sha256": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.4.1.tgz", - "integrity": "sha512-IqeeGwQihK6Y2EYLFofqs2eY2ep1I2MvQXHzOAI+5iQN51OZlUkrLgyAugu2x86xZewDk5xas7lNczkzFzF62w==" - }, - "node_modules/@chainsafe/is-ip": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@chainsafe/is-ip/-/is-ip-2.0.2.tgz", - "integrity": "sha512-ndGqEMG1W5WkGagaqOZHpPU172AGdxr+LD15sv3WIUvT5oCFUrG1Y0CW/v2Egwj4JXEvSibaIIIqImsm98y1nA==" - }, - "node_modules/@chainsafe/libp2p-noise": { - "version": "13.0.3", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-13.0.3.tgz", - "integrity": "sha512-hzfhKUEx5XHDaC21wgROhTUFelaeYojH3DFYhCvqFnhRPUjmz+WJh2jweKaUlysKTTrEHv+JJob/TDY/IS6fRw==", - "dependencies": { - "@chainsafe/as-chacha20poly1305": "^0.1.0", - "@chainsafe/as-sha256": "^0.4.1", - "@libp2p/crypto": "^2.0.0", - "@libp2p/interface": "^0.1.0", - "@libp2p/logger": "^3.0.0", - "@libp2p/peer-id": "^3.0.0", - "@noble/ciphers": "^0.4.0", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "it-byte-stream": "^1.0.0", - "it-length-prefixed": "^9.0.1", - "it-length-prefixed-stream": "^1.0.0", - "it-pair": "^2.0.6", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.4", - "wherearewe": "^2.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@chainsafe/libp2p-yamux": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-yamux/-/libp2p-yamux-5.0.3.tgz", - "integrity": "sha512-I2g8eJFm4xvyrD9Z8+8RvqpCBqHiFtcOGrl4sQXPkktw0cY5hvXf0knIjOLacoNOdAPKG9MNscT4Vojp+sb6cw==", - "dependencies": { - "@libp2p/interface": "^0.1.0", - "@libp2p/logger": "^3.0.0", - "get-iterator": "^2.0.1", - "it-foreach": "^2.0.3", - "it-pipe": "^3.0.1", - "it-pushable": "^3.2.0", - "uint8arraylist": "^2.4.3" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@chainsafe/netmask": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@chainsafe/netmask/-/netmask-2.0.0.tgz", - "integrity": "sha512-I3Z+6SWUoaljh3TBzCnCxjlUyN8tA+NAk5L6m9IxvCf1BENQTePzPMis97CoN/iMW1St3WN+AWCCRp+TTBRiDg==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.1" - } - }, - "node_modules/@libp2p/crypto": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8.tgz", - "integrity": "sha512-8e5fh6bsJNpSjhrggtlm8QF+BERjelJswIjRS69aKgxp24R4z2kDM4pRYPkfQjXJDLNDtqWtKNmePgX23+QJsA==", - "dependencies": { - "@libp2p/interface": "^0.1.6", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.0.1", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/interface": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6.tgz", - "integrity": "sha512-Lzc5cS/hXuoXhuAbVIxJIHLCYmfPcbU0vVgrpMoiP1Qb2Q3ETU4A46GB8s8mWXgSU6tr9RcqerUqzFYD6+OAag==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.5", - "abortable-iterator": "^5.0.1", - "it-pushable": "^3.2.0", - "it-stream-types": "^2.0.1", - "multiformats": "^12.0.1", - "p-defer": "^4.0.0", - "race-signal": "^1.0.0", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/interface-internal": { - "version": "0.1.9-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-0.1.9-0b4a2ee79.tgz", - "integrity": "sha512-IGrEs9QsJdYYsSOhniUEQzHVtgB7WNyRqMF8g6iVGn/rM1bJd8MM4syczPn7OQQbkAKqoLQL32XzGN2JgzAvZQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-collections": "4.0.8-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/interface-internal/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/logger": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-3.1.0.tgz", - "integrity": "sha512-qJbJBAhxHVsRBtQSOIkSLi0lskUSFjzE+zm0QvoyxzZKSz+mX41mZLbnofPIVOVauoDQ40dXpe7WDUOq8AbiQQ==", - "dependencies": { - "@libp2p/interface": "^0.1.6", - "@multiformats/multiaddr": "^12.1.5", - "debug": "^4.3.4", - "interface-datastore": "^8.2.0", - "multiformats": "^12.0.1" - } - }, - "node_modules/@libp2p/multistream-select": { - "version": "4.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/multistream-select/-/multistream-select-4.0.6-0b4a2ee79.tgz", - "integrity": "sha512-ylXXuNgeizJ8ALRCp3V1eXbfzibt+cJUYyZvrO2GK7sGYDGlRh7T3rNMCHaU7tuXKN92xrD7Owwnk9rNjFtA+g==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "it-length-prefixed": "^9.0.3", - "it-length-prefixed-stream": "^1.1.1", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "p-defer": "^4.0.0", - "uint8-varint": "^2.0.2", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/multistream-select/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-collections": { - "version": "4.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-4.0.8-0b4a2ee79.tgz", - "integrity": "sha512-LYLTIlAWNLsDGlK7dhZ9azqkr9vpq5NbvuqTWAKEv02pFbJlmgIMUtPL6XJeyk2BLiZQtgp/nP6cpdFSPZTrBw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79" - } - }, - "node_modules/@libp2p/peer-collections/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-collections/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-id": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6.tgz", - "integrity": "sha512-iN1Ia5gH2U1V/GOVRmLHmVY6fblxzrOPUoZrMYjHl/K4s+AiI7ym/527WDeQvhQpD7j3TfDwcAYforD2dLGpLw==", - "dependencies": { - "@libp2p/interface": "^0.1.6", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-id-factory": { - "version": "3.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id-factory/-/peer-id-factory-3.0.8-0b4a2ee79.tgz", - "integrity": "sha512-y7JrbVT4+ZAy7KDqwwfoBFHPjR5cBZI8+ySwbuyI1MApVxXjPenJdJZRInxQbUDjqWnQHP8dOa75lXhMowjxVg==", - "dependencies": { - "@libp2p/crypto": "2.0.8-0b4a2ee79", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "multiformats": "^12.1.3", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/crypto": { - "version": "2.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8-0b4a2ee79.tgz", - "integrity": "sha512-k6elAUnxMquhQYpCnlLmuU8NpfVU12XU0hFELsgC4TqKkC1PO7EuagngbjHilzyo1wpSAfaYGjAIjlQfjB50iw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.1.3", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-record": { - "version": "6.0.9-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-6.0.9-0b4a2ee79.tgz", - "integrity": "sha512-oZ7a2TidrdmpQuduqdgsZWPQbUPsGN87RTVg2+pgonSnzBtVV5ezHw9KRdhT/qJV4APlBPlRDv3uQU5/oFnqvA==", - "dependencies": { - "@libp2p/crypto": "2.0.8-0b4a2ee79", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "@libp2p/utils": "4.0.7-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "protons-runtime": "^5.0.0", - "uint8-varint": "^2.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-record/node_modules/@libp2p/crypto": { - "version": "2.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8-0b4a2ee79.tgz", - "integrity": "sha512-k6elAUnxMquhQYpCnlLmuU8NpfVU12XU0hFELsgC4TqKkC1PO7EuagngbjHilzyo1wpSAfaYGjAIjlQfjB50iw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.1.3", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-record/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-record/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-store": { - "version": "9.0.9-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-9.0.9-0b4a2ee79.tgz", - "integrity": "sha512-uiUsWo6RdOSgnmplpmcEWnETKp4SXeKAfEcwURgwpEAXsJhPx9UfY9kXMb4xov6ssfHWF8FnTPhlWSrLmCuO4A==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-collections": "4.0.8-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "@libp2p/peer-id-factory": "3.0.8-0b4a2ee79", - "@libp2p/peer-record": "6.0.9-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "interface-datastore": "^8.2.0", - "it-all": "^3.0.2", - "mortice": "^3.0.1", - "multiformats": "^12.1.3", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-store/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-store/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/perf": { - "version": "2.0.1-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/perf/-/perf-2.0.1-0b4a2ee79.tgz", - "integrity": "sha512-B3pDbyEQ6z0yWkh8vkEZE6HbMabS63BH8Gm3kDHCaZm3n40KoFxqwoBL0Iy82nxk0/20Mc3D/bprqzEj2YUlVw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/interface-internal": "0.1.9-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.3" - } - }, - "node_modules/@libp2p/perf/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/tcp": { - "version": "8.0.13-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/tcp/-/tcp-8.0.13-0b4a2ee79.tgz", - "integrity": "sha512-/KuO1ivDV/L4/lLL4gmvq5vXz/xgK2vt9eV8nuwgwOUqWsJEeMkQbdOwKKajrIc0tnk1OFzXb5Kpua2bML++jQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/utils": "4.0.7-0b4a2ee79", - "@multiformats/mafmt": "^12.1.6", - "@multiformats/multiaddr": "^12.1.10", - "@types/sinon": "^17.0.0", - "stream-to-it": "^0.2.2" - } - }, - "node_modules/@libp2p/tcp/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/utils": { - "version": "4.0.7-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-4.0.7-0b4a2ee79.tgz", - "integrity": "sha512-ZHjjlDvG5j+SDtcYNJUhONflbcHNbwdHZsHZlpjwaYyHb74ZvKzd9O5YJTXoAZyJgN2v0cJ814Pc2ObrjrqpTw==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.2", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "@multiformats/multiaddr-matcher": "^1.1.0", - "get-iterator": "^2.0.1", - "is-loopback-addr": "^2.0.1", - "it-pushable": "^3.2.2", - "it-stream-types": "^2.0.1", - "p-queue": "^7.4.1", - "private-ip": "^3.0.1", - "race-signal": "^1.0.1", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/utils/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@multiformats/mafmt": { - "version": "12.1.6", - "resolved": "https://registry.npmjs.org/@multiformats/mafmt/-/mafmt-12.1.6.tgz", - "integrity": "sha512-tlJRfL21X+AKn9b5i5VnaTD6bNttpSpcqwKVmDmSHLwxoz97fAHaepqFOk/l1fIu94nImIXneNbhsJx/RQNIww==", - "dependencies": { - "@multiformats/multiaddr": "^12.0.0" - } - }, - "node_modules/@multiformats/multiaddr": { - "version": "12.1.10", - "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-12.1.10.tgz", - "integrity": "sha512-Bi3nJ/SE17+te40OLxFOpr9CvRodusZZLYZb3e5a0w9RzQcHzfKnnlfqdysLXZ2W5vXgxCUL/Uhndl51Ff2S+Q==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.1", - "@chainsafe/netmask": "^2.0.0", - "@libp2p/interface": "^0.1.1", - "dns-over-http-resolver": "3.0.0", - "multiformats": "^12.0.1", - "uint8-varint": "^2.0.1", - "uint8arrays": "^4.0.2" - } - }, - "node_modules/@multiformats/multiaddr-matcher": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@multiformats/multiaddr-matcher/-/multiaddr-matcher-1.1.0.tgz", - "integrity": "sha512-B/QbKpAxaHYVXFnbTdTgYqPDxmqoF2RYffwYoOv1MWfi2vBCZLdzmEKUBKv6fQr6s+LJFSHn2j2vczmwMFCQIA==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.1", - "@multiformats/multiaddr": "^12.0.0", - "multiformats": "^12.0.1" - } - }, - "node_modules/@noble/ciphers": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.4.0.tgz", - "integrity": "sha512-xaUaUUDWbHIFSxaQ/pIe+33VG2mfJp6N/KxKLmZr5biWdNznCAmfu24QRhX10BbVAuqOahAoyp0S4M9md6GPDw==", - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/curves": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", - "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", - "dependencies": { - "@noble/hashes": "1.3.2" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/hashes": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", - "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@types/sinon": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.2.tgz", - "integrity": "sha512-Zt6heIGsdqERkxctIpvN5Pv3edgBrhoeb3yHyxffd4InN0AX2SVNKSrhdDZKGQICVOxWP/q4DyhpfPNMSrpIiA==", - "dependencies": { - "@types/sinonjs__fake-timers": "*" - } - }, - "node_modules/@types/sinonjs__fake-timers": { - "version": "8.1.5", - "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz", - "integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==" - }, - "node_modules/abortable-iterator": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/abortable-iterator/-/abortable-iterator-5.0.1.tgz", - "integrity": "sha512-hlZ5Z8UwqrKsJcelVPEqDduZowJPBQJ9ZhBC2FXpja3lXy8X6MoI5uMzIgmrA8+3jcVnp8TF/tx+IBBqYJNUrg==", - "dependencies": { - "get-iterator": "^2.0.0", - "it-stream-types": "^2.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/any-signal": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/any-signal/-/any-signal-4.1.1.tgz", - "integrity": "sha512-iADenERppdC+A2YKbOXXB2WUeABLaM6qnpZ70kZbPZ1cZMMJ7eF+3CaYm+/PhBizgkzlvssC7QuHS30oOiQYWA==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/datastore-core": { - "version": "9.2.3", - "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-9.2.3.tgz", - "integrity": "sha512-jcvrVDt+jp7lUp2WhMXXgX/hoi3VcJebN+z/ZXbIRKOVfNOF4bl8cvr7sQ1y9qITikgC2coXFYd79Wzt/n13ZQ==", - "dependencies": { - "@libp2p/logger": "^3.0.0", - "err-code": "^3.0.1", - "interface-store": "^5.0.0", - "it-all": "^3.0.1", - "it-drain": "^3.0.1", - "it-filter": "^3.0.0", - "it-map": "^3.0.1", - "it-merge": "^3.0.1", - "it-pipe": "^3.0.0", - "it-pushable": "^3.0.0", - "it-sort": "^3.0.1", - "it-take": "^3.0.1", - "uint8arrays": "^4.0.2" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/delay": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/delay/-/delay-6.0.0.tgz", - "integrity": "sha512-2NJozoOHQ4NuZuVIr5CWd0iiLVIRSDepakaovIN+9eIDHEhdCAEvSy2cuf1DCrPPQLvHmbqTHODlhHg8UCy4zw==", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/dns-over-http-resolver": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/dns-over-http-resolver/-/dns-over-http-resolver-3.0.0.tgz", - "integrity": "sha512-5+BI+B7n8LKhNaEZBYErr+CBd9t5nYtjunByLhrLGtZ+i3TRgiU8yE87pCjEBu2KOwNsD9ljpSXEbZ4S8xih5g==", - "dependencies": { - "debug": "^4.3.4", - "receptacle": "^1.3.2" - } - }, - "node_modules/err-code": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" - }, - "node_modules/eventemitter3": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" - }, - "node_modules/get-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-2.0.1.tgz", - "integrity": "sha512-7HuY/hebu4gryTDT7O/XY/fvY9wRByEGdK6QOa4of8npTcv0+NS6frFKABcf6S9EBAsveTuKTsZQQBFMMNILIg==" - }, - "node_modules/interface-datastore": { - "version": "8.2.5", - "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-8.2.5.tgz", - "integrity": "sha512-kvLGJMz3RPoJF/g5DbEvfWWempIiSBLVMf63b0PBsziVcSkj0ofzHYI86v8vqpGedkQ81DtPCUKyvX9W7zWvrQ==", - "dependencies": { - "interface-store": "^5.0.0", - "nanoid": "^4.0.0", - "uint8arrays": "^4.0.2" - } - }, - "node_modules/interface-store": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/interface-store/-/interface-store-5.1.4.tgz", - "integrity": "sha512-SI2co5IAxAybBc9egRM2bXvHOa1RPh5SQQkO6di6t/aX92RbtzP4t8raB0l3GTzQmJADaBbzz8Tfa1QLgfMdGQ==" - }, - "node_modules/ip-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-5.0.0.tgz", - "integrity": "sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ipaddr.js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz", - "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==", - "engines": { - "node": ">= 10" - } - }, - "node_modules/is-electron": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.2.2.tgz", - "integrity": "sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg==" - }, - "node_modules/is-loopback-addr": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-2.0.2.tgz", - "integrity": "sha512-26POf2KRCno/KTNL5Q0b/9TYnL00xEsSaLfiFRmjM7m7Lw7ZMmFybzzuX4CcsLAluZGd+niLUiMRxEooVE3aqg==" - }, - "node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/it-all": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-all/-/it-all-3.0.4.tgz", - "integrity": "sha512-UMiy0i9DqCHBdWvMbzdYvVGa5/w4t1cc4nchpbnjdLhklglv8mQeEYnii0gvKESJuL1zV32Cqdb33R6/GPfxpQ==" - }, - "node_modules/it-byte-stream": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/it-byte-stream/-/it-byte-stream-1.0.5.tgz", - "integrity": "sha512-wGHbXPE0ZiU0poJTgCNOW06+mh9yyCwdF8bVv0zxchgql6CMQd/2NEXXtmwWE+N65st8bi/KWUWcMU2pJU2fEw==", - "dependencies": { - "it-stream-types": "^2.0.1", - "p-defer": "^4.0.0", - "race-signal": "^1.0.1", - "uint8arraylist": "^2.4.1" - } - }, - "node_modules/it-drain": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/it-drain/-/it-drain-3.0.5.tgz", - "integrity": "sha512-qYFe4SWdvs9oJGUY5bSjvmiLUMLzFEODNOQUdYdCIkuIgQF+AUB2INhM4yQ09buJ2rhHKDFxvTD/+yUq6qg0XA==" - }, - "node_modules/it-filter": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-filter/-/it-filter-3.0.4.tgz", - "integrity": "sha512-e0sz+st4sudK/zH6GZ/gRTRP8A/ADuJFCYDmRgMbZvR79y5+v4ZXav850bBZk5wL9zXaYZFxS1v/6Qi+Vjwh5g==", - "dependencies": { - "it-peekable": "^3.0.0" - } - }, - "node_modules/it-first": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-first/-/it-first-3.0.4.tgz", - "integrity": "sha512-FtQl84iTNxN5EItP/JgL28V2rzNMkCzTUlNoj41eVdfix2z1DBuLnBqZ0hzYhGGa1rMpbQf0M7CQSA2adlrLJg==" - }, - "node_modules/it-foreach": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/it-foreach/-/it-foreach-2.0.6.tgz", - "integrity": "sha512-OVosBHJsdXpAyeFlCbe3IGZia+65UykyAznakNsKXK+b99dbhuu/mOnXxTadDEo1GWhKx+WA8RNanKkMf07zQw==", - "dependencies": { - "it-peekable": "^3.0.0" - } - }, - "node_modules/it-length-prefixed": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-9.0.3.tgz", - "integrity": "sha512-YAu424ceYpXctxtjcLOqn7vJq082CaoP8J646ZusYISfQc3bpzQErgTUqMFj81V262KG2W9/YMBHsy6A/4yvmg==", - "dependencies": { - "err-code": "^3.0.1", - "it-reader": "^6.0.1", - "it-stream-types": "^2.0.1", - "uint8-varint": "^2.0.1", - "uint8arraylist": "^2.0.0", - "uint8arrays": "^4.0.2" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-length-prefixed-stream": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/it-length-prefixed-stream/-/it-length-prefixed-stream-1.1.4.tgz", - "integrity": "sha512-6YcQ5jsaYnuXBqF+oSGjSdSY9jF7HWl7yh+dxYytXxbE2GcdiOpn6pLM7m6AlIID9MCzQqMY5nOzaiatQ8A3/A==", - "dependencies": { - "it-byte-stream": "^1.0.0", - "it-length-prefixed": "^9.0.1", - "it-stream-types": "^2.0.1", - "uint8-varint": "^2.0.1", - "uint8arraylist": "^2.4.1" - } - }, - "node_modules/it-map": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/it-map/-/it-map-3.0.5.tgz", - "integrity": "sha512-hB0TDXo/h4KSJJDSRLgAPmDroiXP6Fx1ck4Bzl3US9hHfZweTKsuiP0y4gXuTMcJlS6vj0bb+f70rhkD47ZA3w==", - "dependencies": { - "it-peekable": "^3.0.0" - } - }, - "node_modules/it-merge": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/it-merge/-/it-merge-3.0.3.tgz", - "integrity": "sha512-FYVU15KC5pb/GQX1Ims+lee8d4pdqGVCpWr0lkNj8o4xuNo7jY71k6GuEiWdP+T7W1bJqewSxX5yoTy5yZpRVA==", - "dependencies": { - "it-pushable": "^3.2.0" - } - }, - "node_modules/it-pair": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/it-pair/-/it-pair-2.0.6.tgz", - "integrity": "sha512-5M0t5RAcYEQYNG5BV7d7cqbdwbCAp5yLdzvkxsZmkuZsLbTdZzah6MQySYfaAQjNDCq6PUnDt0hqBZ4NwMfW6g==", - "dependencies": { - "it-stream-types": "^2.0.1", - "p-defer": "^4.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-peekable": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/it-peekable/-/it-peekable-3.0.3.tgz", - "integrity": "sha512-Wx21JX/rMzTEl9flx3DGHuPV1KQFGOl8uoKfQtmZHgPQtGb89eQ6RyVd82h3HuP9Ghpt0WgBDlmmdWeHXqyx7w==" - }, - "node_modules/it-pipe": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/it-pipe/-/it-pipe-3.0.1.tgz", - "integrity": "sha512-sIoNrQl1qSRg2seYSBH/3QxWhJFn9PKYvOf/bHdtCBF0bnghey44VyASsWzn5dAx0DCDDABq1hZIuzKmtBZmKA==", - "dependencies": { - "it-merge": "^3.0.0", - "it-pushable": "^3.1.2", - "it-stream-types": "^2.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-pushable": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-3.2.3.tgz", - "integrity": "sha512-gzYnXYK8Y5t5b/BnJUr7glfQLO4U5vyb05gPx/TyTw+4Bv1zM9gFk4YsOrnulWefMewlphCjKkakFvj1y99Tcg==", - "dependencies": { - "p-defer": "^4.0.0" - } - }, - "node_modules/it-reader": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/it-reader/-/it-reader-6.0.4.tgz", - "integrity": "sha512-XCWifEcNFFjjBHtor4Sfaj8rcpt+FkY0L6WdhD578SCDhV4VUm7fCkF3dv5a+fTcfQqvN9BsxBTvWbYO6iCjTg==", - "dependencies": { - "it-stream-types": "^2.0.1", - "uint8arraylist": "^2.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-sort": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-sort/-/it-sort-3.0.4.tgz", - "integrity": "sha512-tvnC93JZZWjX4UxALy0asow0dzXabkoaRbrPJKClTKhNCqw4gzHr+H5axf1gohcthedRRkqd/ae+wl7WqoxFhw==", - "dependencies": { - "it-all": "^3.0.0" - } - }, - "node_modules/it-stream-types": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/it-stream-types/-/it-stream-types-2.0.1.tgz", - "integrity": "sha512-6DmOs5r7ERDbvS4q8yLKENcj6Yecr7QQTqWApbZdfAUTEC947d+PEha7PCqhm//9oxaLYL7TWRekwhoXl2s6fg==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-take": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-take/-/it-take-3.0.4.tgz", - "integrity": "sha512-RG8HDjAZlvkzz5Nav4xq6gK5zNT+Ff1UTIf+CrSJW8nIl6N1FpBH5e7clUshiCn+MmmMoSdIEpw4UaTolszxhA==" - }, - "node_modules/libp2p": { - "version": "0.46.21-0b4a2ee79", - "resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.46.21-0b4a2ee79.tgz", - "integrity": "sha512-WLThU38PZfc2nYzKCZdVgsuWALtkWavwSXQy4pNhSf8fAzbRTjRdY1EqR/O3G2tI6CybdHVj1dCxMnvvM/YXuA==", - "dependencies": { - "@libp2p/crypto": "2.0.8-0b4a2ee79", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/interface-internal": "0.1.9-0b4a2ee79", - "@libp2p/logger": "3.1.0-0b4a2ee79", - "@libp2p/multistream-select": "4.0.6-0b4a2ee79", - "@libp2p/peer-collections": "4.0.8-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "@libp2p/peer-id-factory": "3.0.8-0b4a2ee79", - "@libp2p/peer-store": "9.0.9-0b4a2ee79", - "@libp2p/utils": "4.0.7-0b4a2ee79", - "@multiformats/mafmt": "^12.1.6", - "@multiformats/multiaddr": "^12.1.10", - "@multiformats/multiaddr-matcher": "^1.1.0", - "any-signal": "^4.1.1", - "datastore-core": "^9.0.1", - "delay": "^6.0.0", - "interface-datastore": "^8.2.0", - "it-all": "^3.0.2", - "it-drain": "^3.0.2", - "it-filter": "^3.0.1", - "it-first": "^3.0.3", - "it-map": "^3.0.4", - "it-merge": "^3.0.0", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "merge-options": "^3.0.4", - "multiformats": "^12.1.3", - "p-defer": "^4.0.0", - "p-queue": "^7.4.1", - "private-ip": "^3.0.1", - "rate-limiter-flexible": "^3.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/libp2p/node_modules/@libp2p/crypto": { - "version": "2.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8-0b4a2ee79.tgz", - "integrity": "sha512-k6elAUnxMquhQYpCnlLmuU8NpfVU12XU0hFELsgC4TqKkC1PO7EuagngbjHilzyo1wpSAfaYGjAIjlQfjB50iw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.1.3", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/libp2p/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/libp2p/node_modules/@libp2p/logger": { - "version": "3.1.0-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-3.1.0-0b4a2ee79.tgz", - "integrity": "sha512-haeXJplYP29dYTkwLlGI/dc7nQuRTbRte7GeMcNwrmCeODM3uo3D0O7+qS6RulmRDbvWqs3muCxZyRFSU4oB+A==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "debug": "^4.3.4", - "interface-datastore": "^8.2.0", - "multiformats": "^12.1.3" - } - }, - "node_modules/libp2p/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/merge-options": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", - "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", - "dependencies": { - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mortice": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mortice/-/mortice-3.0.1.tgz", - "integrity": "sha512-eyDUsl1nCR9+JtNksKnaESLP9MgAXCA4w1LTtsmOSQNsThnv++f36rrBu5fC/fdGIwTJZmbiaR/QewptH93pYA==", - "dependencies": { - "nanoid": "^4.0.0", - "observable-webworkers": "^2.0.1", - "p-queue": "^7.2.0", - "p-timeout": "^6.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/multiformats": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.3.tgz", - "integrity": "sha512-eajQ/ZH7qXZQR2AgtfpmSMizQzmyYVmCql7pdhldPuYQi4atACekbJaQplk6dWyIi10jCaFnd6pqvcEFXjbaJw==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/nanoid": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.2.tgz", - "integrity": "sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.js" - }, - "engines": { - "node": "^14 || ^16 || >=18" - } - }, - "node_modules/netmask": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", - "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/node-forge": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", - "engines": { - "node": ">= 6.13.0" - } - }, - "node_modules/observable-webworkers": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/observable-webworkers/-/observable-webworkers-2.0.1.tgz", - "integrity": "sha512-JI1vB0u3pZjoQKOK1ROWzp0ygxSi7Yb0iR+7UNsw4/Zn4cQ0P3R7XL38zac/Dy2tEA7Lg88/wIJTjF8vYXZ0uw==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/p-defer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-4.0.0.tgz", - "integrity": "sha512-Vb3QRvQ0Y5XnF40ZUWW7JfLogicVh/EnA5gBIvKDJoYpeI82+1E3AlB9yOcKFS0AhHrWVnAQO39fbR0G99IVEQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-queue": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.4.1.tgz", - "integrity": "sha512-vRpMXmIkYF2/1hLBKisKeVYJZ8S2tZ0zEAmIJgdVKP2nq0nh4qCdf8bgw+ZgKrkh71AOCaqzwbJJk1WtdcF3VA==", - "dependencies": { - "eventemitter3": "^5.0.1", - "p-timeout": "^5.0.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-queue/node_modules/p-timeout": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", - "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-timeout": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", - "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/private-ip": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/private-ip/-/private-ip-3.0.1.tgz", - "integrity": "sha512-Ezc16ANuhSHmWAE6lbXUKburNzGpR0J5X0Zh5Um/PZ/s57Fp+HYqYe6BYPH2QbqKr/5WebfzJQ1jq6Kj5dbRmA==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.1", - "ip-regex": "^5.0.0", - "ipaddr.js": "^2.1.0", - "netmask": "^2.0.2" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/protons-runtime": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-5.2.0.tgz", - "integrity": "sha512-jL3VSbXllgm17zurKQ/z+Ath0w+4BknJ+l/NLocfjAB8hbeASOZTNtb7zK3nDsKq2pHK9YFumNQvpkZ6gFfWhA==", - "dependencies": { - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/race-signal": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/race-signal/-/race-signal-1.0.2.tgz", - "integrity": "sha512-o3xNv0iTcIDQCXFlF6fPAMEBRjFxssgGoRqLbg06m+AdzEXXLUmoNOoUHTVz2NoBI8hHwKFKoC6IqyNtWr2bww==" - }, - "node_modules/rate-limiter-flexible": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/rate-limiter-flexible/-/rate-limiter-flexible-3.0.4.tgz", - "integrity": "sha512-LFrdT9Pl/TRxG143frHBPyESXHvS2tstLfAUM6shBbJ3M6YssT2cIUWFwAWVAU9Vl4Z2gUN7ZE7tSdQh/0aqcA==" - }, - "node_modules/receptacle": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/receptacle/-/receptacle-1.3.2.tgz", - "integrity": "sha512-HrsFvqZZheusncQRiEE7GatOAETrARKV/lnfYicIm8lbvp/JQOdADOfhjBd2DajvoszEyxSM6RlAAIZgEoeu/A==", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/stream-to-it": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/stream-to-it/-/stream-to-it-0.2.4.tgz", - "integrity": "sha512-4vEbkSs83OahpmBybNJXlJd7d6/RxzkkSdT3I0mnGt79Xd2Kk+e1JqbvAvsQfCeKj3aKb0QIWkyK3/n0j506vQ==", - "dependencies": { - "get-iterator": "^1.0.2" - } - }, - "node_modules/stream-to-it/node_modules/get-iterator": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-1.0.2.tgz", - "integrity": "sha512-v+dm9bNVfOYsY1OrhaCrmyOcYoSeVvbt+hHZ0Au+T+p1y+0Uyj9aMaGIeUTT6xdpRbWzDeYKvfOslPhggQMcsg==" - }, - "node_modules/uint8-varint": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/uint8-varint/-/uint8-varint-2.0.2.tgz", - "integrity": "sha512-LZXmBT0jiHR7J4oKM1GUhtdLFW1yPauzI8NjJlotXn92TprO9u8VMvEVR4QMk8xhUVUd+2fqfU2/kGbVHYSSWw==", - "dependencies": { - "uint8arraylist": "^2.0.0", - "uint8arrays": "^4.0.2" - } - }, - "node_modules/uint8arraylist": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-2.4.3.tgz", - "integrity": "sha512-oEVZr4/GrH87K0kjNce6z8pSCzLEPqHNLNR5sj8cJOySrTP8Vb/pMIbZKLJGhQKxm1TiZ31atNrpn820Pyqpow==", - "dependencies": { - "uint8arrays": "^4.0.2" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/uint8arrays": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.6.tgz", - "integrity": "sha512-4ZesjQhqOU2Ip6GPReIwN60wRxIupavL8T0Iy36BBHr2qyMrNxsPJvr7vpS4eFt8F8kSguWUPad6ZM9izs/vyw==", - "dependencies": { - "multiformats": "^12.0.1" - } - }, - "node_modules/wherearewe": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/wherearewe/-/wherearewe-2.0.1.tgz", - "integrity": "sha512-XUguZbDxCA2wBn2LoFtcEhXL6AXo+hVjGonwhSTTTU9SzbWG8Xu3onNIpzf9j/mYUcJQ0f+m37SzG77G851uFw==", - "dependencies": { - "is-electron": "^2.2.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/package.json deleted file mode 100644 index dc78f0d62..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "@libp2p/perf-js-libp2p-1-0", - "private": true, - "main": "index.js", - "type": "module", - "dependencies": { - "@chainsafe/libp2p-noise": "^13.0.3", - "@chainsafe/libp2p-yamux": "^5.0.3", - "@libp2p/perf": "next", - "@libp2p/tcp": "next", - "libp2p": "next" - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/perf b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/perf deleted file mode 100755 index 1a3e19c51..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/perf +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# In case this script is `kill`ed, `kill` its child process, namely the `node` -# process below. -cleanup() { - kill $node_pid -} -trap cleanup EXIT TERM - -# Find the path to the Node.js executable -node_path=$(which node) - -run_server=false -server_address="" -upload_bytes=0 -download_bytes=0 -transport="" - -# Parse named parameters manually -for ((i = 1; i <= $#; i++)); do - if [ "${!i}" == "--server-address" ]; then - server_address="${@:i+1:1}" - fi - if [ "${!i}" == "--upload-bytes" ]; then - upload_bytes="${@:i+1:1}" - fi - if [ "${!i}" == "--download-bytes" ]; then - download_bytes="${@:i+1:1}" - fi - if [ "${!i}" == "--transport" ]; then - transport="${@:i+1:1}" - fi - if [ "${!i}" == "--run-server" ]; then - run_server=true - fi -done - -# Run perf -node $(dirname "$0")/index.js --run-server=$run_server --server-address=$server_address --upload-bytes=$upload_bytes --download-bytes=$download_bytes --transport=$transport & - -node_pid=$! - -# Wait for `node_pid` to finish, or for it to be `kill`ed by the above -# `cleanup`. -wait $node_pid diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/index.min.js deleted file mode 100644 index 4e7453106..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/index.min.js +++ /dev/null @@ -1,3 +0,0 @@ -(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PTcp = factory()}(typeof self !== 'undefined' ? self : this, function () { -"use strict";var Libp2PTcp=(()=>{var Or=Object.create;var bt=Object.defineProperty;var Lr=Object.getOwnPropertyDescriptor;var Vr=Object.getOwnPropertyNames;var Fr=Object.getPrototypeOf,$r=Object.prototype.hasOwnProperty;var Y=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var Z=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),R=(r,t)=>{for(var e in t)bt(r,e,{get:t[e],enumerable:!0})},Ne=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vr(t))!$r.call(r,o)&&o!==e&&bt(r,o,{get:()=>t[o],enumerable:!(n=Lr(t,o))||n.enumerable});return r};var tt=(r,t,e)=>(e=r!=null?Or(Fr(r)):{},Ne(t||!r||!r.__esModule?bt(e,"default",{value:r,enumerable:!0}):e,r)),zr=r=>Ne(bt({},"__esModule",{value:!0}),r);var Dt=Z((Sc,Ir)=>{Ir.exports=r=>{if(r[Symbol.asyncIterator])return r;if(r.getReader)return async function*(){let t=r.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)return;yield n}}finally{t.releaseLock()}}();throw new Error("unknown stream")}});var Sr=Z((Tc,Cr)=>{Cr.exports=function(t){if(t){if(typeof t[Symbol.iterator]=="function")return t[Symbol.iterator]();if(typeof t[Symbol.asyncIterator]=="function")return t[Symbol.asyncIterator]();if(typeof t.next=="function")return t}throw new Error("argument is not an iterator or iterable")}});var Ae=Z((Pc,Tr)=>{var Mo=Sr();Tr.exports=r=>async t=>{t=Mo(t);let e=w=>{typeof w.return=="function"&&w.return()},n=null,o=null,s=w=>{n=w,o&&o(w),e(t)},i=null,a=!1,p=()=>{a=!0,i&&i()},f=null,m=!1,v=()=>{m=!0,f&&f()},x=null,u=()=>{x&&x()},d=()=>new Promise((w,S)=>{i=x=w,o=S,r.once("drain",u)}),E=()=>(e(t),new Promise((w,S)=>{if(a||m||n)return w();f=i=w,o=S})),N=()=>{r.removeListener("error",s),r.removeListener("close",p),r.removeListener("finish",v),r.removeListener("drain",u)};r.once("error",s),r.once("close",p),r.once("finish",v);try{for await(let w of t){if(!r.writable||r.destroyed||n)break;r.write(w)===!1&&await d()}}catch(w){n||r.destroy(),n=w}try{if(r.writable&&r.end(),await E(),n)throw n}finally{N()}}});var Ie=Z((Rc,Pr)=>{var Uo=Ae(),_o=Dt();Pr.exports=r=>({sink:Uo(r),source:_o(r)})});var Nr=Z((Nc,Rr)=>{var ko=Ie();Rr.exports=r=>async function*(t){let e=ko(r),n;if(e.sink(t).catch(o=>{n=o}),yield*e.source,n)throw n}});var Dr=Z((Dc,pt)=>{pt.exports=Dt();pt.exports.source=Dt();pt.exports.sink=Ae();pt.exports.transform=Nr();pt.exports.duplex=Ie()});var Go={};R(Go,{tcp:()=>jo});var kr=tt(Y("net"),1);var et=class r extends Error{code;type;constructor(t="The operation was aborted"){super(t),this.code=r.code,this.type=r.type}static code="ABORT_ERR";static type="aborted"},I=class extends Error{code;props;constructor(t,e,n){super(t),this.code=e,this.name=n?.name??"CodeError",this.props=n??{}}};var Me=Symbol.for("@libp2p/transport");var De;(function(r){r[r.FATAL_ALL=0]="FATAL_ALL",r[r.NO_FATAL=1]="NO_FATAL"})(De||(De={}));var Vt={};R(Vt,{base58btc:()=>T,base58flickr:()=>Xr});function Br(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n>>0,D=new Uint8Array(k);w!==S;){for(var O=d[w],B=0,_=k-1;(O!==0||B>>0,D[_]=O%a>>>0,O=O/a>>>0;if(O!==0)throw new Error("Non-zero carry");N=B,w++}for(var V=k-N;V!==k&&D[V]===0;)V++;for(var xt=p.repeat(E);V>>0,k=new Uint8Array(S);d[E];){var D=e[d.charCodeAt(E)];if(D===255)return;for(var O=0,B=S-1;(D!==0||O>>0,k[B]=D%256>>>0,D=D/256>>>0;if(D!==0)throw new Error("Non-zero carry");w=O,E++}if(d[E]!==" "){for(var _=S-w;_!==S&&k[_]===0;)_++;for(var V=new Uint8Array(N+(S-_)),xt=N;_!==S;)V[xt++]=k[_++];return V}}}function u(d){var E=x(d);if(E)return E;throw new Error(`Non-${t} character`)}return{encode:v,decodeUnsafe:x,decode:u}}var qr=Br,jr=qr,Ue=jr;var Qo=new Uint8Array(0);var _e=(r,t)=>{if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var ke=r=>new TextEncoder().encode(r),Oe=r=>new TextDecoder().decode(r);var _t=class{constructor(t,e,n){this.name=t,this.prefix=e,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},kt=class{constructor(t,e,n){if(this.name=t,this.prefix=e,e.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Ve(this,t)}},Ot=class{constructor(t){this.decoders=t}or(t){return Ve(this,t)}decode(t){let e=t[0],n=this.decoders[e];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Ve=(r,t)=>new Ot({...r.decoders||{[r.prefix]:r},...t.decoders||{[t.prefix]:t}}),Lt=class{constructor(t,e,n,o){this.name=t,this.prefix=e,this.baseEncode=n,this.baseDecode=o,this.encoder=new _t(t,e,n),this.decoder=new kt(t,e,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},rt=({name:r,prefix:t,encode:e,decode:n})=>new Lt(r,t,e,n),q=({prefix:r,name:t,alphabet:e})=>{let{encode:n,decode:o}=Ue(e,t);return rt({prefix:r,name:t,encode:n,decode:s=>M(o(s))})},Gr=(r,t,e,n)=>{let o={};for(let m=0;m=8&&(a-=8,i[f++]=255&p>>a)}if(a>=e||255&p<<8-a)throw new SyntaxError("Unexpected end of data");return i},Wr=(r,t,e)=>{let n=t[t.length-1]==="=",o=(1<e;)i-=e,s+=t[o&a>>i];if(i&&(s+=t[o&a<rt({prefix:t,name:r,encode(o){return Wr(o,n,e)},decode(o){return Gr(o,n,e,r)}});var T=q({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Xr=q({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Ft={};R(Ft,{base32:()=>F,base32hex:()=>Kr,base32hexpad:()=>Zr,base32hexpadupper:()=>tn,base32hexupper:()=>Yr,base32pad:()=>Jr,base32padupper:()=>Qr,base32upper:()=>Hr,base32z:()=>en});var F=b({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Hr=b({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Jr=b({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Qr=b({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Kr=b({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Yr=b({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Zr=b({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),tn=b({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),en=b({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var rn=ze,Fe=128,nn=127,on=~nn,sn=Math.pow(2,31);function ze(r,t,e){t=t||[],e=e||0;for(var n=e;r>=sn;)t[e++]=r&255|Fe,r/=128;for(;r&on;)t[e++]=r&255|Fe,r>>>=7;return t[e]=r|0,ze.bytes=e-n+1,t}var cn=$t,an=128,$e=127;function $t(r,n){var e=0,n=n||0,o=0,s=n,i,a=r.length;do{if(s>=a)throw $t.bytes=0,new RangeError("Could not decode varint");i=r[s++],e+=o<28?(i&$e)<=an);return $t.bytes=s-n,e}var ln=Math.pow(2,7),dn=Math.pow(2,14),un=Math.pow(2,21),pn=Math.pow(2,28),fn=Math.pow(2,35),hn=Math.pow(2,42),mn=Math.pow(2,49),gn=Math.pow(2,56),wn=Math.pow(2,63),xn=function(r){return r[ht.decode(r,t),ht.decode.bytes],nt=(r,t,e=0)=>(ht.encode(r,t,e),t),ot=r=>ht.encodingLength(r);var X=(r,t)=>{let e=t.byteLength,n=ot(r),o=n+ot(e),s=new Uint8Array(o+e);return nt(r,s,0),nt(e,s,n),s.set(t,o),new st(r,e,t,s)},vt=r=>{let t=M(r),[e,n]=mt(t),[o,s]=mt(t.subarray(n)),i=t.subarray(n+s);if(i.byteLength!==o)throw new Error("Incorrect length");return new st(e,o,i,t)},Be=(r,t)=>{if(r===t)return!0;{let e=t;return r.code===e.code&&r.size===e.size&&e.bytes instanceof Uint8Array&&_e(r.bytes,e.bytes)}},st=class{constructor(t,e,n,o){this.code=t,this.size=e,this.digest=n,this.bytes=o}};var qe=(r,t)=>{let{bytes:e,version:n}=r;switch(n){case 0:return En(e,zt(r),t||T.encoder);default:return An(e,zt(r),t||F.encoder)}};var je=new WeakMap,zt=r=>{let t=je.get(r);if(t==null){let e=new Map;return je.set(r,e),e}return t},j=class r{constructor(t,e,n,o){this.code=e,this.version=t,this.multihash=n,this.bytes=o,this["/"]=o}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:e}=this;if(t!==gt)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==In)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(e)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:e}=this.multihash,n=X(t,e);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return r.equals(this,t)}static equals(t,e){let n=e;return n&&t.code===n.code&&t.version===n.version&&Be(t.multihash,n.multihash)}toString(t){return qe(this,t)}toJSON(){return{"/":qe(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let e=t;if(e instanceof r)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){let{version:n,code:o,multihash:s,bytes:i}=e;return new r(n,o,s,i||Ge(n,o,s.bytes))}else if(e[Cn]===!0){let{version:n,multihash:o,code:s}=e,i=vt(o);return r.create(n,s,i)}else return null}static create(t,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(e!==gt)throw new Error(`Version 0 CID must use dag-pb (code: ${gt}) block encoding`);return new r(t,e,n,n.bytes)}case 1:{let o=Ge(t,e,n.bytes);return new r(t,e,n,o)}default:throw new Error("Invalid version")}}static createV0(t){return r.create(0,gt,t)}static createV1(t,e){return r.create(1,t,e)}static decode(t){let[e,n]=r.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return e}static decodeFirst(t){let e=r.inspectBytes(t),n=e.size-e.multihashSize,o=M(t.subarray(n,n+e.multihashSize));if(o.byteLength!==e.multihashSize)throw new Error("Incorrect length");let s=o.subarray(e.multihashSize-e.digestSize),i=new st(e.multihashCode,e.digestSize,s,o);return[e.version===0?r.createV0(i):r.createV1(e.codec,i),t.subarray(e.size)]}static inspectBytes(t){let e=0,n=()=>{let[v,x]=mt(t.subarray(e));return e+=x,v},o=n(),s=gt;if(o===18?(o=0,e=0):s=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let i=e,a=n(),p=n(),f=e+p,m=f-i;return{version:o,codec:s,multihashCode:a,digestSize:p,multihashSize:m,size:f}}static parse(t,e){let[n,o]=vn(t,e),s=r.decode(o);if(s.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return zt(s).set(n,t),s}},vn=(r,t)=>{switch(r[0]){case"Q":{let e=t||T;return[T.prefix,e.decode(`${T.prefix}${r}`)]}case T.prefix:{let e=t||T;return[T.prefix,e.decode(r)]}case F.prefix:{let e=t||F;return[F.prefix,e.decode(r)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],t.decode(r)]}}},En=(r,t,e)=>{let{prefix:n}=e;if(n!==T.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let o=t.get(n);if(o==null){let s=e.encode(r).slice(1);return t.set(n,s),s}else return o},An=(r,t,e)=>{let{prefix:n}=e,o=t.get(n);if(o==null){let s=e.encode(r);return t.set(n,s),s}else return o},gt=112,In=18,Ge=(r,t,e)=>{let n=ot(r),o=n+ot(t),s=new Uint8Array(o+e.byteLength);return nt(r,s,0),nt(t,s,n),s.set(e,o),s},Cn=Symbol.for("@ipld/js-cid/CID");function We(r,t){if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;eSn});var Sn=q({prefix:"9",name:"base10",alphabet:"0123456789"});var qt={};R(qt,{base16:()=>Tn,base16upper:()=>Pn});var Tn=b({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Pn=b({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var jt={};R(jt,{base2:()=>Rn});var Rn=b({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Gt={};R(Gt,{base256emoji:()=>_n});var Xe=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Nn=Xe.reduce((r,t,e)=>(r[e]=t,r),[]),Dn=Xe.reduce((r,t,e)=>(r[t.codePointAt(0)]=e,r),[]);function Mn(r){return r.reduce((t,e)=>(t+=Nn[e],t),"")}function Un(r){let t=[];for(let e of r){let n=Dn[e.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${e}`);t.push(n)}return new Uint8Array(t)}var _n=rt({prefix:"\u{1F680}",name:"base256emoji",encode:Mn,decode:Un});var Wt={};R(Wt,{base36:()=>kn,base36upper:()=>On});var kn=q({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),On=q({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Xt={};R(Xt,{base64:()=>Ln,base64pad:()=>Vn,base64url:()=>Fn,base64urlpad:()=>$n});var Ln=b({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Vn=b({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Fn=b({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),$n=b({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Ht={};R(Ht,{base8:()=>zn});var zn=b({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Jt={};R(Jt,{identity:()=>Bn});var Bn=rt({prefix:"\0",name:"identity",encode:r=>Oe(r),decode:r=>ke(r)});var ys=new TextEncoder,vs=new TextDecoder;var Qt={};R(Qt,{identity:()=>Xn});var He=0,Gn="identity",Je=M,Wn=r=>X(He,Je(r)),Xn={code:He,name:Gn,encode:Je,digest:Wn};var te={};R(te,{sha256:()=>Hn,sha512:()=>Jn});var Zt=tt(Y("crypto"),1);var Yt=({name:r,code:t,encode:e})=>new Kt(r,t,e),Kt=class{constructor(t,e,n){this.name=t,this.code=e,this.encode=n}digest(t){if(t instanceof Uint8Array){let e=this.encode(t);return e instanceof Uint8Array?X(this.code,e):e.then(n=>X(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Hn=Yt({name:"sha2-256",code:18,encode:r=>M(Zt.default.createHash("sha256").update(r).digest())}),Jn=Yt({name:"sha2-512",code:19,encode:r=>M(Zt.default.createHash("sha512").update(r).digest())});var wt={...Jt,...jt,...Ht,...Bt,...qt,...Ft,...Wt,...Vt,...Xt,...Gt},Ns={...te,...Qt};function ct(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function at(r=0){return globalThis.Buffer?.allocUnsafe!=null?ct(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function Ye(r,t,e,n){return{name:r,prefix:t,encoder:{name:r,prefix:t,encode:e},decoder:{decode:n}}}var Ke=Ye("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),ee=Ye("ascii","a",r=>{let t="a";for(let e=0;e{r=r.substring(1);let t=at(r.length);for(let e=0;eNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function to(r,t,e=0){switch(L(r)){case 8:t[e++]=r&255|h,r/=128;case 7:t[e++]=r&255|h,r/=128;case 6:t[e++]=r&255|h,r/=128;case 5:t[e++]=r&255|h,r/=128;case 4:t[e++]=r&255|h,r>>>=7;case 3:t[e++]=r&255|h,r>>>=7;case 2:t[e++]=r&255|h,r>>>=7;case 1:{t[e++]=r&255,r>>>=7;break}default:throw new Error("unreachable")}return t}function eo(r,t,e=0){switch(L(r)){case 8:t.set(e++,r&255|h),r/=128;case 7:t.set(e++,r&255|h),r/=128;case 6:t.set(e++,r&255|h),r/=128;case 5:t.set(e++,r&255|h),r/=128;case 4:t.set(e++,r&255|h),r>>>=7;case 3:t.set(e++,r&255|h),r>>>=7;case 2:t.set(e++,r&255|h),r>>>=7;case 1:{t.set(e++,r&255),r>>>=7;break}default:throw new Error("unreachable")}return t}function ro(r,t){let e=r[t],n=0;if(n+=e&C,eo+s.length,0));let e=at(t),n=0;for(let o of r)e.set(o,n),n+=o.length;return ct(e)}var At=class{index=0;input="";new(t){return this.index=0,this.input=t,this}readAtomically(t){let e=this.index,n=t();return n===void 0&&(this.index=e),n}parseWith(t){let e=t();if(this.index===this.input.length)return e}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(t){return this.readAtomically(()=>{let e=this.readChar();if(e===t)return e})}readSeparator(t,e,n){return this.readAtomically(()=>{if(!(e>0&&this.readGivenChar(t)===void 0))return n()})}readNumber(t,e,n,o){return this.readAtomically(()=>{let s=0,i=0,a=this.peekChar();if(a===void 0)return;let p=a==="0",f=2**(8*o)-1;for(;;){let m=this.readAtomically(()=>{let v=this.readChar();if(v===void 0)return;let x=Number.parseInt(v,t);if(!Number.isNaN(x))return x});if(m===void 0)break;if(s*=t,s+=m,s>f||(i+=1,e!==void 0&&i>e))return}if(i!==0)return!n&&p&&i>1?void 0:s})}readIPv4Addr(){return this.readAtomically(()=>{let t=new Uint8Array(4);for(let e=0;ethis.readNumber(10,3,!1,1));if(n===void 0)return;t[e]=n}return t})}readIPv6Addr(){let t=e=>{for(let n=0;nthis.readIPv4Addr());if(i!==void 0)return e[o]=i[0],e[o+1]=i[1],e[o+2]=i[2],e[o+3]=i[3],[o+4,!0]}let s=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(s===void 0)return[o,!1];e[o]=s>>8,e[o+1]=s&255}return[e.length,!1]};return this.readAtomically(()=>{let e=new Uint8Array(16),[n,o]=t(e);if(n===16)return e;if(o||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let s=new Uint8Array(14),i=16-(n+2),[a]=t(s.subarray(0,i));return e.set(s.subarray(0,a),16-a),e})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var Ws=new At;var ti=parseInt("0xFFFF",16),ei=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function ie(r,t="utf8"){let e=Et[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?ct(globalThis.Buffer.from(r,"utf-8")):e.decoder.decode(`${e.prefix}${r}`)}var U=Y("node:net");function It(r){return!!(0,U.isIP)(r)}var rr=U.isIPv4,lo=U.isIPv6,ce=function(r){let t=0;if(r=r.toString().trim(),rr(r)){let e=new Uint8Array(t+4);return r.split(/\./g).forEach(n=>{e[t++]=parseInt(n,10)&255}),e}if(lo(r)){let e=r.split(":",8),n;for(n=0;n0;n--)s.push("0");e.splice.apply(e,s)}let o=new Uint8Array(t+16);for(n=0;n>8&255,o[t++]=s&255}return o}throw new Error("invalid ip address")},nr=function(r,t=0,e){t=~~t,e=e??r.length-t;let n=new DataView(r.buffer);if(e===4){let o=[];for(let s=0;s{let t=fo(...r);ae[t.code]=t,dt[t.name]=t});function fo(r,t,e,n,o){return{code:r,size:t,name:e,resolvable:!!n,path:!!o}}function g(r){if(typeof r=="number"){if(ae[r]!=null)return ae[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(dt[r]!=null)return dt[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var Bi=g("ip4"),qi=g("ip6"),ji=g("ipcidr");function de(r,t){switch(g(r).code){case 4:case 41:return mo(t);case 42:return ir(t);case 6:case 273:case 33:case 132:return ar(t).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return ir(t);case 421:return bo(t);case 444:return cr(t);case 445:return cr(t);case 466:return xo(t);default:return P(t,"base16")}}function ue(r,t){switch(g(r).code){case 4:return or(t);case 41:return or(t);case 42:return sr(t);case 6:case 273:case 33:case 132:return pe(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return sr(t);case 421:return go(t);case 444:return yo(t);case 445:return vo(t);case 466:return wo(t);default:return ie(t,"base16")}}var le=Object.values(wt).map(r=>r.decoder),ho=function(){let r=le[0].or(le[1]);return le.slice(2).forEach(t=>r=r.or(t)),r}();function or(r){if(!It(r))throw new Error("invalid ip address");return ce(r)}function mo(r){let t=nr(r,0,r.length);if(t==null)throw new Error("ipBuff is required");if(!It(t))throw new Error("invalid ip address");return t}function pe(r){let t=new ArrayBuffer(2);return new DataView(t).setUint16(0,r),new Uint8Array(t)}function ar(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function sr(r){let t=ie(r),e=Uint8Array.from(lt(t.length));return $([e,t],e.length+t.length)}function ir(r){let t=H(r);if(r=r.slice(L(t)),r.length!==t)throw new Error("inconsistent lengths");return P(r)}function go(r){let t;r[0]==="Q"||r[0]==="1"?t=vt(T.decode(`z${r}`)).bytes:t=j.parse(r).multihash.bytes;let e=Uint8Array.from(lt(t.length));return $([e,t],e.length+t.length)}function wo(r){let t=ho.decode(r),e=Uint8Array.from(lt(t.length));return $([e,t],e.length+t.length)}function xo(r){let t=H(r),e=r.slice(L(t));if(e.length!==t)throw new Error("inconsistent lengths");return"u"+P(e,"base64url")}function bo(r){let t=H(r),e=r.slice(L(t));if(e.length!==t)throw new Error("inconsistent lengths");return P(e,"base58btc")}function yo(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==16)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion address.`);let e=F.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let o=pe(n);return $([e,o],e.length+o.length)}function vo(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==56)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion3 address.`);let e=F.decode(`b${t[0]}`),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let o=pe(n);return $([e,o],e.length+o.length)}function cr(r){let t=r.slice(0,r.length-2),e=r.slice(r.length-2),n=P(t,"base32"),o=ar(e);return`${n}:${o}`}function lr(r){r=fe(r);let t=[],e=[],n=null,o=r.split("/").slice(1);if(o.length===1&&o[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let s=0;s=o.length)throw ur("invalid address: "+r);if(a.path===!0){n=fe(o.slice(s).join("/")),t.push([a.code,ue(a.code,n)]),e.push([a.code,n]);break}let p=ue(a.code,o[s]);t.push([a.code,p]),e.push([a.code,de(a.code,p)])}return{string:dr(e),bytes:me(t),tuples:t,stringTuples:e,path:n}}function he(r){let t=[],e=[],n=null,o=0;for(;or.length)throw ur("Invalid address Uint8Array: "+P(r,"base16"));t.push([s,f]);let m=de(s,f);if(e.push([s,m]),a.path===!0){n=m;break}}return{bytes:Uint8Array.from(r),string:dr(e),tuples:t,stringTuples:e,path:n}}function dr(r){let t=[];return r.map(e=>{let n=g(e[0]);return t.push(n.name),e.length>1&&e[1]!=null&&t.push(e[1]),null}),fe(t.join("/"))}function me(r){return $(r.map(t=>{let e=g(t[0]),n=Uint8Array.from(lt(e.code));return t.length>1&&t[1]!=null&&(n=$([n,t[1]])),n}))}function Eo(r,t){if(r.size>0)return r.size/8;if(r.size===0)return 0;{let e=H(t instanceof Uint8Array?t:Uint8Array.from(t));return e+L(e)}}function fe(r){return"/"+r.trim().split("/").filter(t=>t).join("/")}function ur(r){return new Error("Error parsing address: "+r)}var Ao=Symbol.for("nodejs.util.inspect.custom"),ge=Symbol.for("@multiformats/js-multiaddr/multiaddr"),Io=[g("dns").code,g("dns4").code,g("dns6").code,g("dnsaddr").code],Ct=class r{bytes;#t;#e;#r;#n;[ge]=!0;constructor(t){t==null&&(t="");let e;if(t instanceof Uint8Array)e=he(t);else if(typeof t=="string"){if(t.length>0&&t.charAt(0)!=="/")throw new Error(`multiaddr "${t}" must start with a "/"`);e=lr(t)}else if(fr(t))e=he(t.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=e.bytes,this.#t=e.string,this.#e=e.tuples,this.#r=e.stringTuples,this.#n=e.path}toString(){return this.#t}toJSON(){return this.toString()}toOptions(){let t,e,n,o,s="",i=g("tcp"),a=g("udp"),p=g("ip4"),f=g("ip6"),m=g("dns6"),v=g("ip6zone");for(let[u,d]of this.stringTuples())u===v.code&&(s=`%${d??""}`),Io.includes(u)&&(e=i.name,o=443,n=`${d??""}${s}`,t=u===m.code?6:4),(u===i.code||u===a.code)&&(e=g(u).name,o=parseInt(d??"")),(u===p.code||u===f.code)&&(e=g(u).name,n=`${d??""}${s}`,t=u===f.code?6:4);if(t==null||e==null||n==null||o==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:t,host:n,transport:e,port:o}}protos(){return this.#e.map(([t])=>Object.assign({},g(t)))}protoCodes(){return this.#e.map(([t])=>t)}protoNames(){return this.#e.map(([t])=>g(t).name)}tuples(){return this.#e}stringTuples(){return this.#r}encapsulate(t){return t=new r(t),new r(this.toString()+t.toString())}decapsulate(t){let e=t.toString(),n=this.toString(),o=n.lastIndexOf(e);if(o<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${t.toString()}`);return new r(n.slice(0,o))}decapsulateCode(t){let e=this.tuples();for(let n=e.length-1;n>=0;n--)if(e[n][0]===t)return new r(me(e.slice(0,n)));return this}getPeerId(){try{let t=[];this.stringTuples().forEach(([n,o])=>{n===dt.p2p.code&&t.push([n,o]),n===dt["p2p-circuit"].code&&(t=[])});let e=t.pop();if(e?.[1]!=null){let n=e[1];return n[0]==="Q"||n[0]==="1"?P(T.decode(`z${n}`),"base58btc"):P(j.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#n}equals(t){return We(this.bytes,t.bytes)}async resolve(t){let e=this.protos().find(s=>s.resolvable);if(e==null)return[this];let n=pr.get(e.name);if(n==null)throw new I(`no available resolver for ${e.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,t)).map(s=>new r(s))}nodeAddress(){let t=this.toOptions();if(t.transport!=="tcp"&&t.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${t.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:t.family,address:t.host,port:t.port}}isThinWaistAddress(t){let e=(t??this).protos();return!(e.length!==2||e[0].code!==4&&e[0].code!==41||e[1].code!==6&&e[1].code!==273)}[Ao](){return`Multiaddr(${this.#t})`}};var pr=new Map;function fr(r){return!!r?.[ge]}function z(r){return new Ct(r)}var Co=c("dns4"),So=c("dns6"),To=c("dnsaddr"),Q=y(c("dns"),To,Co,So),Pt=y(c("ip4"),c("ip6")),W=y(l(Pt,c("tcp")),l(Q,c("tcp"))),Rt=l(Pt,c("udp")),Po=l(Rt,c("utp")),Ro=l(Rt,c("quic")),No=l(Rt,c("quic-v1")),we=y(l(W,c("ws")),l(Q,c("ws"))),St=y(l(we,c("p2p")),we),xe=y(l(W,c("wss")),l(Q,c("wss")),l(W,c("tls"),c("ws")),l(Q,c("tls"),c("ws"))),Tt=y(l(xe,c("p2p")),xe),be=y(l(W,c("http")),l(Pt,c("http")),l(Q,c("http"))),ye=y(l(W,c("https")),l(Pt,c("https")),l(Q,c("https"))),hr=l(Rt,c("webrtc-direct"),c("certhash")),wr=y(l(hr,c("p2p")),hr),mr=l(No,c("webtransport"),c("certhash"),c("certhash")),xr=y(l(mr,c("p2p")),mr),br=y(l(St,c("p2p-webrtc-star"),c("p2p")),l(Tt,c("p2p-webrtc-star"),c("p2p")),l(St,c("p2p-webrtc-star")),l(Tt,c("p2p-webrtc-star"))),gc=y(l(St,c("p2p-websocket-star"),c("p2p")),l(Tt,c("p2p-websocket-star"),c("p2p")),l(St,c("p2p-websocket-star")),l(Tt,c("p2p-websocket-star"))),yr=y(l(be,c("p2p-webrtc-direct"),c("p2p")),l(ye,c("p2p-webrtc-direct"),c("p2p")),l(be,c("p2p-webrtc-direct")),l(ye,c("p2p-webrtc-direct"))),K=y(we,xe,be,ye,br,yr,W,Po,Ro,Q,wr,xr),wc=y(l(K,c("p2p-stardust"),c("p2p")),l(K,c("p2p-stardust"))),G=y(l(K,c("p2p")),br,yr,wr,xr,c("p2p")),gr=y(l(G,c("p2p-circuit"),G),l(G,c("p2p-circuit")),l(c("p2p-circuit"),G),l(K,c("p2p-circuit")),l(c("p2p-circuit"),K),c("p2p-circuit")),vr=()=>y(l(gr,vr),gr),J=vr(),xc=y(l(J,G,J),l(G,J),l(J,G),J,G);var bc=y(l(J,c("webrtc"),c("p2p")),l(J,c("webrtc")),l(K,c("webrtc"),c("p2p")),l(K,c("webrtc")),c("webrtc"));function Er(r){function t(e){let n;try{n=z(e)}catch{return!1}let o=r(n.protoNames());return o===null?!1:o===!0||o===!1?o:o.length===0}return t}function l(...r){function t(e){if(e.length(n=typeof o=="function"?o().partialMatch(e):o.partialMatch(e),Array.isArray(n)&&(e=n),n===null)),n}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:Er(t),partialMatch:t}}function y(...r){function t(n){let o=null;return r.some(s=>{let i=typeof s=="function"?s().partialMatch(n):s.partialMatch(n);return i!=null?(o=i,!0):!1}),o}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:Er(t),partialMatch:t}}function c(r){let t=r;function e(o){let s;try{s=z(o)}catch{return!1}let i=s.protoNames();return i.length===1&&i[0]===t}function n(o){return o.length===0?null:o[0]===t?o.slice(1):null}return{toString:function(){return t},matches:e,partialMatch:n}}var _r=tt(Y("net"),1);var Nt=class extends EventTarget{#t=new Map;listenerCount(t){let e=this.#t.get(t);return e==null?0:e.length}addEventListener(t,e,n){super.addEventListener(t,e,n);let o=this.#t.get(t);o==null&&(o=[],this.#t.set(t,o)),o.push({callback:e,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(t,e,n){super.removeEventListener(t.toString(),e??null,n);let o=this.#t.get(t);o!=null&&(o=o.filter(({callback:s})=>s!==e),this.#t.set(t,o))}dispatchEvent(t){let e=super.dispatchEvent(t),n=this.#t.get(t.type);return n==null||(n=n.filter(({once:o})=>!o),this.#t.set(t.type,n)),e}safeDispatchEvent(t,e){return this.dispatchEvent(new ut(t,e))}},ve=class extends Event{detail;constructor(t,e){super(t,e),this.detail=e?.detail}},ut=globalThis.CustomEvent??ve;var Ee={ERR_INVALID_IP_PARAMETER:"ERR_INVALID_IP_PARAMETER",ERR_INVALID_PORT_PARAMETER:"ERR_INVALID_PORT_PARAMETER",ERR_INVALID_IP:"ERR_INVALID_IP"};function Ar(r,t){if(typeof r!="string")throw new I(`invalid ip provided: ${r}`,Ee.ERR_INVALID_IP_PARAMETER);if(typeof t=="string"&&(t=parseInt(t)),isNaN(t))throw new I(`invalid port provided: ${t}`,Ee.ERR_INVALID_PORT_PARAMETER);if((0,U.isIPv4)(r))return z(`/ip4/${r}/tcp/${t}`);if((0,U.isIPv6)(r))return z(`/ip6/${r}/tcp/${t}`);throw new I(`invalid ip:port for creating a multiaddr: ${r}:${t}`,Ee.ERR_INVALID_IP)}var Ur=tt(Dr(),1);var Ce=tt(Y("os"),1),Mr=tt(Y("path"),1);var Oo={ip4:"IPv4",ip6:"IPv6"};function ft(r,t={}){let e=r.getPath();return e!=null?Ce.default.platform()==="win32"?{path:Mr.default.join("\\\\.\\pipe\\",e)}:{path:e}:{...t,...r.toOptions()}}function Se(r,t,e){let n=o=>z(`/${r}/${o}/tcp/${e}`);return(Lo(t)?Fo(Oo[r]):[t]).map(n)}function Lo(r){return["0.0.0.0","::"].includes(r)}var Vo=Ce.default.networkInterfaces();function Fo(r){let t=[];for(let[,e]of Object.entries(Vo))if(e!=null)for(let n of e)n.family===r&&t.push(n.address);return t}var Mt=(r,t)=>{let e=t.logger.forComponent("libp2p:tcp:socket"),n=t.metrics,o=t.metricPrefix??"",s=t.socketInactivityTimeout??3e5,i=t.socketCloseTimeout??500;t.listeningAddr?.getPath()!=null&&(t.remoteAddr=t.listeningAddr),t.remoteAddr?.getPath()!=null&&(t.localAddr=t.remoteAddr);let a;if(t.remoteAddr!=null)a=t.remoteAddr;else{if(r.remoteAddress==null||r.remotePort==null)throw new I("Could not determine remote address or port","ERR_NO_REMOTE_ADDRESS");a=Ar(r.remoteAddress,r.remotePort)}let p=ft(a),f=p.path??`${p.host??""}:${p.port??""}`,{sink:m,source:v}=Ur.default.duplex(r);r.setTimeout(s,()=>{e("%s socket read timeout",f),n?.increment({[`${o}timeout`]:!0});let u;r.readable&&(u=new I("Socket read timeout","ERR_SOCKET_READ_TIMEOUT")),r.destroy(u)}),r.once("close",()=>{e("%s socket close",f),n?.increment({[`${o}close`]:!0}),x.timeline.close==null&&(x.timeline.close=Date.now())}),r.once("end",()=>{e("%s socket end",f),n?.increment({[`${o}end`]:!0})});let x={async sink(u){try{await m(async function*(){for await(let d of u)d instanceof Uint8Array?yield d:yield d.subarray()}())}catch(d){d.type!=="aborted"&&e(d)}r.end()},source:v,remoteAddr:a,timeline:{open:Date.now()},async close(u={}){if(r.destroyed){e("%s socket was already destroyed when trying to close",f);return}if(u.signal==null){let d=AbortSignal.timeout(i);u={...u,signal:d}}try{e("%s closing socket",f),await new Promise((d,E)=>{r.once("close",()=>{e("%s socket closed",f),d()}),r.once("error",N=>{e("%s socket error",f,N),x.timeline.close==null&&(x.timeline.close=Date.now()),E(N)}),r.setTimeout(i),r.end(),r.writableLength>0?r.once("drain",()=>{e("%s socket drained",f),r.destroy()}):r.destroy()})}catch(d){this.abort(d)}},abort:u=>{e("%s socket abort due to error",f,u),r.destroy(u)},log:e};return x};async function Te(r,t){try{await r.close()}catch(e){t.log.error("an error occurred closing the connection",e)}}var A;(function(r){r[r.INACTIVE=0]="INACTIVE",r[r.ACTIVE=1]="ACTIVE",r[r.PAUSED=2]="PAUSED"})(A||(A={}));var Ut=class extends Nt{context;server;connections=new Set;status={code:A.INACTIVE};metrics;addr;log;constructor(t){if(super(),this.context=t,t.keepAlive=t.keepAlive??!0,t.noDelay=t.noDelay??!0,this.log=t.logger.forComponent("libp2p:tcp:listener"),this.addr="unknown",this.server=_r.default.createServer(t,this.onSocket.bind(this)),t.maxConnections!==void 0&&(this.server.maxConnections=t.maxConnections),t.closeServerOnMaxConnections!=null&&t.closeServerOnMaxConnections.closeAbove= listenBelow","ERROR_CONNECTION_LIMITS");this.server.on("listening",()=>{if(t.metrics!=null){let e=this.server.address();e==null?this.addr="unknown":typeof e=="string"?this.addr=e:this.addr=`${e.address}:${e.port}`,t.metrics?.registerMetricGroup("libp2p_tcp_inbound_connections_total",{label:"address",help:"Current active connections in TCP listener",calculate:()=>({[this.addr]:this.connections.size})}),this.metrics={status:t.metrics.registerMetricGroup("libp2p_tcp_listener_status_info",{label:"address",help:"Current status of the TCP listener socket"}),errors:t.metrics.registerMetricGroup("libp2p_tcp_listener_errors_total",{label:"address",help:"Total count of TCP listener errors by type"}),events:t.metrics.registerMetricGroup("libp2p_tcp_listener_events_total",{label:"address",help:"Total count of TCP listener events by type"})},this.metrics?.status.update({[this.addr]:A.ACTIVE})}this.dispatchEvent(new ut("listening"))}).on("error",e=>{this.metrics?.errors.increment({[`${this.addr} listen_error`]:!0}),this.dispatchEvent(new ut("error",{detail:e}))}).on("close",()=>{this.metrics?.status.update({[this.addr]:this.status.code}),this.status.code!==A.PAUSED&&this.dispatchEvent(new ut("close"))})}onSocket(t){if(this.status.code!==A.ACTIVE)throw new I("Server is is not listening yet","ERR_SERVER_NOT_RUNNING");t.on("error",n=>{this.log("socket error",n),this.metrics?.events.increment({[`${this.addr} error`]:!0})});let e;try{e=Mt(t,{listeningAddr:this.status.listeningAddr,socketInactivityTimeout:this.context.socketInactivityTimeout,socketCloseTimeout:this.context.socketCloseTimeout,metrics:this.metrics?.events,metricPrefix:`${this.addr} `,logger:this.context.logger})}catch(n){this.log.error("inbound connection failed",n),this.metrics?.errors.increment({[`${this.addr} inbound_to_connection`]:!0});return}this.log("new inbound connection %s",e.remoteAddr);try{this.context.upgrader.upgradeInbound(e).then(n=>{this.log("inbound connection upgraded %s",e.remoteAddr),this.connections.add(e),t.once("close",()=>{this.connections.delete(e),this.context.closeServerOnMaxConnections!=null&&this.connections.size{this.log.error("error attempting to listen server once connection count under limit",o),this.context.closeServerOnMaxConnections?.onListenError?.(o)})}),this.context.handler!=null&&this.context.handler(n),this.context.closeServerOnMaxConnections!=null&&this.connections.size>=this.context.closeServerOnMaxConnections.closeAbove&&this.pause(!1).catch(o=>{this.log.error("error attempting to close server once connection count over limit",o)}),this.dispatchEvent(new ut("connection",{detail:n}))}).catch(async n=>{this.log.error("inbound connection failed",n),this.metrics?.errors.increment({[`${this.addr} inbound_upgrade`]:!0}),await Te(e,{log:this.log})}).catch(n=>{this.log.error("closing inbound connection failed",n)})}catch(n){this.log.error("inbound connection failed",n),Te(e,{log:this.log}).catch(o=>{this.log.error("closing inbound connection failed",o),this.metrics?.errors.increment({[`${this.addr} inbound_closing_failed`]:!0})})}}getAddrs(){if(this.status.code===A.INACTIVE)return[];let t=[],e=this.server.address(),{listeningAddr:n,peerId:o}=this.status;if(e==null)return[];if(typeof e=="string")t=[n];else try{n.toString().startsWith("/ip4")?t=t.concat(Se("ip4",e.address,e.port)):e.family==="IPv6"&&(t=t.concat(Se("ip6",e.address,e.port)))}catch(s){this.log.error("could not turn %s:%s into multiaddr",e.address,e.port,s)}return t.map(s=>o!=null?s.encapsulate(`/p2p/${o}`):s)}async listen(t){if(this.status.code===A.ACTIVE||this.status.code===A.PAUSED)throw new I("server is already listening","ERR_SERVER_ALREADY_LISTENING");let e=t.getPeerId(),n=e==null?t.decapsulateCode(421):t,{backlog:o}=this.context;try{this.status={code:A.ACTIVE,listeningAddr:n,peerId:e,netConfig:ft(n,{backlog:o})},await this.resume()}catch(s){throw this.status={code:A.INACTIVE},s}}async close(){await Promise.all([Promise.all(Array.from(this.connections.values()).map(async t=>Te(t,{log:this.log}))),this.pause(!0).catch(t=>{this.log.error("error attempting to close server once connection count over limit",t)})])}async resume(){if(this.server.listening||this.status.code===A.INACTIVE)return;let t=this.status.netConfig;await new Promise((e,n)=>{this.server.once("error",n),this.server.listen(t,e)}),this.status={...this.status,code:A.ACTIVE},this.log("Listening on %s",this.server.address())}async pause(t){if(!this.server.listening&&this.status.code===A.PAUSED&&t){this.status={code:A.INACTIVE};return}!this.server.listening||this.status.code!==A.ACTIVE||(this.log("Closing server on %s",this.server.address()),this.status=t?{code:A.INACTIVE}:{...this.status,code:A.PAUSED},await new Promise((e,n)=>{this.server.close(o=>{o!=null?n(o):e()})}))}};var Re=class{opts;metrics;components;log;constructor(t,e={}){this.log=t.logger.forComponent("libp2p:tcp"),this.opts=e,this.components=t,t.metrics!=null&&(this.metrics={dialerEvents:t.metrics.registerCounterGroup("libp2p_tcp_dialer_events_total",{label:"event",help:"Total count of TCP dialer events by type"})})}[Me]=!0;[Symbol.toStringTag]="@libp2p/tcp";async dial(t,e){e.keepAlive=e.keepAlive??!0,e.noDelay=e.noDelay??!0;let n=await this._connect(t,e);n.on("error",a=>{this.log("socket error",a)});let o=Mt(n,{remoteAddr:t,socketInactivityTimeout:this.opts.outboundSocketInactivityTimeout,socketCloseTimeout:this.opts.socketCloseTimeout,metrics:this.metrics?.dialerEvents,logger:this.components.logger}),s=()=>{o.close().catch(a=>{this.log.error("Error closing maConn after abort",a)})};e.signal?.addEventListener("abort",s,{once:!0}),this.log("new outbound connection %s",o.remoteAddr);let i=await e.upgrader.upgradeOutbound(o);if(this.log("outbound connection %s upgraded",o.remoteAddr),e.signal?.removeEventListener("abort",s),e.signal?.aborted===!0)throw i.close().catch(a=>{this.log.error("Error closing conn after abort",a)}),new et;return i}async _connect(t,e){if(e.signal?.aborted===!0)throw new et;return new Promise((n,o)=>{let s=Date.now(),i=ft(t,{...this.opts.dialOpts??{},...e});this.log("dialing %a",t);let a=kr.default.connect(i),p=u=>{let d=i.path??`${i.host??""}:${i.port}`;u.message=`connection error ${d}: ${u.message}`,this.metrics?.dialerEvents.increment({error:!0}),x(u)},f=()=>{this.log("connection timeout %a",t),this.metrics?.dialerEvents.increment({timeout:!0});let u=new I(`connection timeout after ${Date.now()-s}ms`,"ERR_CONNECT_TIMEOUT");a.emit("error",u)},m=()=>{this.log("connection opened %a",t),this.metrics?.dialerEvents.increment({connect:!0}),x()},v=()=>{this.log("connection aborted %a",t),this.metrics?.dialerEvents.increment({abort:!0}),a.destroy(),x(new et)},x=u=>{if(a.removeListener("error",p),a.removeListener("timeout",f),a.removeListener("connect",m),e.signal!=null&&e.signal.removeEventListener("abort",v),u!=null){o(u);return}n(a)};a.on("error",p),a.on("timeout",f),a.on("connect",m),e.signal!=null&&e.signal.addEventListener("abort",v)})}createListener(t){return new Ut({...this.opts.listenOpts??{},...t,maxConnections:this.opts.maxConnections,backlog:this.opts.backlog,closeServerOnMaxConnections:this.opts.closeServerOnMaxConnections,socketInactivityTimeout:this.opts.inboundSocketInactivityTimeout,socketCloseTimeout:this.opts.socketCloseTimeout,metrics:this.components.metrics,logger:this.components.logger})}filter(t){return t=Array.isArray(t)?t:[t],t.filter(e=>e.protoCodes().includes(290)?!1:e.protoCodes().includes(400)?!0:W.matches(e.decapsulateCode(421)))}};function jo(r={}){return t=>new Re(t,r)}return zr(Go);})(); -return Libp2PTcp})); diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/constants.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/constants.d.ts deleted file mode 100644 index f30b4f260..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/constants.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare const CODE_P2P = 421; -export declare const CODE_CIRCUIT = 290; -export declare const CODE_UNIX = 400; -export declare const CLOSE_TIMEOUT = 500; -export declare const SOCKET_TIMEOUT: number; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/constants.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/constants.d.ts.map deleted file mode 100644 index c31c9fd50..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,QAAQ,MAAM,CAAA;AAC3B,eAAO,MAAM,YAAY,MAAM,CAAA;AAC/B,eAAO,MAAM,SAAS,MAAM,CAAA;AAG5B,eAAO,MAAM,aAAa,MAAM,CAAA;AAGhC,eAAO,MAAM,cAAc,QAAY,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/constants.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/constants.js deleted file mode 100644 index 271d393f3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/constants.js +++ /dev/null @@ -1,9 +0,0 @@ -// p2p multi-address code -export const CODE_P2P = 421; -export const CODE_CIRCUIT = 290; -export const CODE_UNIX = 400; -// Time to wait for a connection to close gracefully before destroying it manually -export const CLOSE_TIMEOUT = 500; -// Close the socket if there is no activity after this long in ms -export const SOCKET_TIMEOUT = 5 * 60000; // 5 mins -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/constants.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/constants.js.map deleted file mode 100644 index f2a3aba59..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAA;AAC3B,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA;AAC/B,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAA;AAE5B,kFAAkF;AAClF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;AAEhC,iEAAiE;AACjE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,KAAK,CAAA,CAAC,SAAS"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/index.d.ts deleted file mode 100644 index c9fef833a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/index.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -/** - * @packageDocumentation - * - * A [libp2p transport](https://docs.libp2p.io/concepts/transports/overview/) based on the TCP networking stack. - * - * @example - * - * ```js - * import { tcp } from '@libp2p/tcp' - * import { multiaddr } from '@multiformats/multiaddr' - * import { pipe } from 'it-pipe' - * import all from 'it-all' - * - * // A simple upgrader that just returns the MultiaddrConnection - * const upgrader = { - * upgradeInbound: async maConn => maConn, - * upgradeOutbound: async maConn => maConn - * } - * - * const transport = tcp()() - * - * const listener = transport.createListener({ - * upgrader, - * handler: (socket) => { - * console.this.log('new connection opened') - * pipe( - * ['hello', ' ', 'World!'], - * socket - * ) - * } - * }) - * - * const addr = multiaddr('/ip4/127.0.0.1/tcp/9090') - * await listener.listen(addr) - * console.this.log('listening') - * - * const socket = await transport.dial(addr, { upgrader }) - * const values = await pipe( - * socket, - * all - * ) - * console.this.log(`Value: ${values.toString()}`) - * - * // Close connection after reading - * await listener.close() - * ``` - * - * Outputs: - * - * ```sh - * listening - * new connection opened - * Value: hello World! - * ``` - */ -import { type CreateListenerOptions, type DialOptions, type Transport } from '@libp2p/interface/transport'; -import { type CloseServerOnMaxConnectionsOpts } from './listener.js'; -import type { ComponentLogger } from '@libp2p/interface'; -import type { CounterGroup, Metrics } from '@libp2p/interface/metrics'; -import type { AbortOptions } from '@multiformats/multiaddr'; -export interface TCPOptions { - /** - * An optional number in ms that is used as an inactivity timeout after which the socket will be closed - */ - inboundSocketInactivityTimeout?: number; - /** - * An optional number in ms that is used as an inactivity timeout after which the socket will be closed - */ - outboundSocketInactivityTimeout?: number; - /** - * When closing a socket, wait this long for it to close gracefully before it is closed more forcibly - */ - socketCloseTimeout?: number; - /** - * Set this property to reject connections when the server's connection count gets high. - * https://nodejs.org/api/net.html#servermaxconnections - */ - maxConnections?: number; - /** - * Parameter to specify the maximum length of the queue of pending connections - * https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - backlog?: number; - /** - * Close server (stop listening for new connections) if connections exceed a limit. - * Open server (start listening for new connections) if connections fall below a limit. - */ - closeServerOnMaxConnections?: CloseServerOnMaxConnectionsOpts; - /** - * Options passed to `net.connect` for every opened TCP socket - */ - dialOpts?: TCPSocketOptions; - /** - * Options passed to every `net.createServer` for every TCP server - */ - listenOpts?: TCPSocketOptions; -} -/** - * Expose a subset of net.connect options - */ -export interface TCPSocketOptions extends AbortOptions { - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - noDelay?: boolean; - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - keepAlive?: boolean; - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - keepAliveInitialDelay?: number; - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#new-netsocketoptions - */ - allowHalfOpen?: boolean; -} -export interface TCPDialOptions extends DialOptions, TCPSocketOptions { -} -export interface TCPCreateListenerOptions extends CreateListenerOptions, TCPSocketOptions { -} -export interface TCPComponents { - metrics?: Metrics; - logger: ComponentLogger; -} -export interface TCPMetrics { - dialerEvents: CounterGroup; -} -export declare function tcp(init?: TCPOptions): (components: TCPComponents) => Transport; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/index.d.ts.map deleted file mode 100644 index 0a2362083..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAIH,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,WAAW,EAAU,KAAK,SAAS,EAAiB,MAAM,6BAA6B,CAAA;AAGjI,OAAO,EAAE,KAAK,+BAA+B,EAAe,MAAM,eAAe,CAAA;AAGjF,OAAO,KAAK,EAAE,eAAe,EAAU,MAAM,mBAAmB,CAAA;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACtE,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,yBAAyB,CAAA;AAGtE,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAA;IAEvC;;OAEG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAA;IAExC;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;OAGG;IACH,2BAA2B,CAAC,EAAE,+BAA+B,CAAA;IAE7D;;OAEG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAE3B;;OAEG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAE9B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,MAAM,WAAW,cAAe,SAAQ,WAAW,EAAE,gBAAgB;CAEpE;AAED,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB,EAAE,gBAAgB;CAExF;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,eAAe,CAAA;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,YAAY,CAAA;CAC3B;AAqLD,wBAAgB,GAAG,CAAE,IAAI,GAAE,UAAe,GAAG,CAAC,UAAU,EAAE,aAAa,KAAK,SAAS,CAIpF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/index.js deleted file mode 100644 index 31b4fa02f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/index.js +++ /dev/null @@ -1,213 +0,0 @@ -/** - * @packageDocumentation - * - * A [libp2p transport](https://docs.libp2p.io/concepts/transports/overview/) based on the TCP networking stack. - * - * @example - * - * ```js - * import { tcp } from '@libp2p/tcp' - * import { multiaddr } from '@multiformats/multiaddr' - * import { pipe } from 'it-pipe' - * import all from 'it-all' - * - * // A simple upgrader that just returns the MultiaddrConnection - * const upgrader = { - * upgradeInbound: async maConn => maConn, - * upgradeOutbound: async maConn => maConn - * } - * - * const transport = tcp()() - * - * const listener = transport.createListener({ - * upgrader, - * handler: (socket) => { - * console.this.log('new connection opened') - * pipe( - * ['hello', ' ', 'World!'], - * socket - * ) - * } - * }) - * - * const addr = multiaddr('/ip4/127.0.0.1/tcp/9090') - * await listener.listen(addr) - * console.this.log('listening') - * - * const socket = await transport.dial(addr, { upgrader }) - * const values = await pipe( - * socket, - * all - * ) - * console.this.log(`Value: ${values.toString()}`) - * - * // Close connection after reading - * await listener.close() - * ``` - * - * Outputs: - * - * ```sh - * listening - * new connection opened - * Value: hello World! - * ``` - */ -import net from 'net'; -import { AbortError, CodeError } from '@libp2p/interface/errors'; -import { symbol } from '@libp2p/interface/transport'; -import * as mafmt from '@multiformats/mafmt'; -import { CODE_CIRCUIT, CODE_P2P, CODE_UNIX } from './constants.js'; -import { TCPListener } from './listener.js'; -import { toMultiaddrConnection } from './socket-to-conn.js'; -import { multiaddrToNetConfig } from './utils.js'; -class TCP { - opts; - metrics; - components; - log; - constructor(components, options = {}) { - this.log = components.logger.forComponent('libp2p:tcp'); - this.opts = options; - this.components = components; - if (components.metrics != null) { - this.metrics = { - dialerEvents: components.metrics.registerCounterGroup('libp2p_tcp_dialer_events_total', { - label: 'event', - help: 'Total count of TCP dialer events by type' - }) - }; - } - } - [symbol] = true; - [Symbol.toStringTag] = '@libp2p/tcp'; - async dial(ma, options) { - options.keepAlive = options.keepAlive ?? true; - // options.signal destroys the socket before 'connect' event - const socket = await this._connect(ma, options); - // Avoid uncaught errors caused by unstable connections - socket.on('error', err => { - this.log('socket error', err); - }); - const maConn = toMultiaddrConnection(socket, { - remoteAddr: ma, - socketInactivityTimeout: this.opts.outboundSocketInactivityTimeout, - socketCloseTimeout: this.opts.socketCloseTimeout, - metrics: this.metrics?.dialerEvents, - logger: this.components.logger - }); - const onAbort = () => { - maConn.close().catch(err => { - this.log.error('Error closing maConn after abort', err); - }); - }; - options.signal?.addEventListener('abort', onAbort, { once: true }); - this.log('new outbound connection %s', maConn.remoteAddr); - const conn = await options.upgrader.upgradeOutbound(maConn); - this.log('outbound connection %s upgraded', maConn.remoteAddr); - options.signal?.removeEventListener('abort', onAbort); - if (options.signal?.aborted === true) { - conn.close().catch(err => { - this.log.error('Error closing conn after abort', err); - }); - throw new AbortError(); - } - return conn; - } - async _connect(ma, options) { - if (options.signal?.aborted === true) { - throw new AbortError(); - } - return new Promise((resolve, reject) => { - const start = Date.now(); - const cOpts = multiaddrToNetConfig(ma, { - ...(this.opts.dialOpts ?? {}), - ...options - }); - this.log('dialing %a', ma); - const rawSocket = net.connect(cOpts); - const onError = (err) => { - const cOptsStr = cOpts.path ?? `${cOpts.host ?? ''}:${cOpts.port}`; - err.message = `connection error ${cOptsStr}: ${err.message}`; - this.metrics?.dialerEvents.increment({ error: true }); - done(err); - }; - const onTimeout = () => { - this.log('connection timeout %a', ma); - this.metrics?.dialerEvents.increment({ timeout: true }); - const err = new CodeError(`connection timeout after ${Date.now() - start}ms`, 'ERR_CONNECT_TIMEOUT'); - // Note: this will result in onError() being called - rawSocket.emit('error', err); - }; - const onConnect = () => { - this.log('connection opened %a', ma); - this.metrics?.dialerEvents.increment({ connect: true }); - done(); - }; - const onAbort = () => { - this.log('connection aborted %a', ma); - this.metrics?.dialerEvents.increment({ abort: true }); - rawSocket.destroy(); - done(new AbortError()); - }; - const done = (err) => { - rawSocket.removeListener('error', onError); - rawSocket.removeListener('timeout', onTimeout); - rawSocket.removeListener('connect', onConnect); - if (options.signal != null) { - options.signal.removeEventListener('abort', onAbort); - } - if (err != null) { - reject(err); - return; - } - resolve(rawSocket); - }; - rawSocket.on('error', onError); - rawSocket.on('timeout', onTimeout); - rawSocket.on('connect', onConnect); - if (options.signal != null) { - options.signal.addEventListener('abort', onAbort); - } - }); - } - /** - * Creates a TCP listener. The provided `handler` function will be called - * anytime a new incoming Connection has been successfully upgraded via - * `upgrader.upgradeInbound`. - */ - createListener(options) { - return new TCPListener({ - ...(this.opts.listenOpts ?? {}), - ...options, - maxConnections: this.opts.maxConnections, - backlog: this.opts.backlog, - closeServerOnMaxConnections: this.opts.closeServerOnMaxConnections, - socketInactivityTimeout: this.opts.inboundSocketInactivityTimeout, - socketCloseTimeout: this.opts.socketCloseTimeout, - metrics: this.components.metrics, - logger: this.components.logger - }); - } - /** - * Takes a list of `Multiaddr`s and returns only valid TCP addresses - */ - filter(multiaddrs) { - multiaddrs = Array.isArray(multiaddrs) ? multiaddrs : [multiaddrs]; - return multiaddrs.filter(ma => { - if (ma.protoCodes().includes(CODE_CIRCUIT)) { - return false; - } - if (ma.protoCodes().includes(CODE_UNIX)) { - return true; - } - return mafmt.TCP.matches(ma.decapsulateCode(CODE_P2P)); - }); - } -} -export function tcp(init = {}) { - return (components) => { - return new TCP(components, init); - }; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/index.js.map deleted file mode 100644 index 820bf53ee..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,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CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;QAElE,OAAO,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;YAC5B,IAAI,EAAE,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE;gBAC1C,OAAO,KAAK,CAAA;aACb;YAED,IAAI,EAAE,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;gBACvC,OAAO,IAAI,CAAA;aACZ;YAED,OAAO,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAA;QACxD,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AAED,MAAM,UAAU,GAAG,CAAE,OAAmB,EAAE;IACxC,OAAO,CAAC,UAAyB,EAAE,EAAE;QACnC,OAAO,IAAI,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/listener.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/listener.d.ts deleted file mode 100644 index 7ed8b5b06..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/listener.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import type { TCPCreateListenerOptions } from './index.js'; -import type { ComponentLogger } from '@libp2p/interface'; -import type { Connection } from '@libp2p/interface/connection'; -import type { CounterGroup, MetricGroup, Metrics } from '@libp2p/interface/metrics'; -import type { Listener, ListenerEvents, Upgrader } from '@libp2p/interface/transport'; -import type { Multiaddr } from '@multiformats/multiaddr'; -export interface CloseServerOnMaxConnectionsOpts { - /** Server listens once connection count is less than `listenBelow` */ - listenBelow: number; - /** Close server once connection count is greater than or equal to `closeAbove` */ - closeAbove: number; - onListenError?(err: Error): void; -} -interface Context extends TCPCreateListenerOptions { - handler?(conn: Connection): void; - upgrader: Upgrader; - socketInactivityTimeout?: number; - socketCloseTimeout?: number; - maxConnections?: number; - backlog?: number; - metrics?: Metrics; - closeServerOnMaxConnections?: CloseServerOnMaxConnectionsOpts; - logger: ComponentLogger; -} -export interface TCPListenerMetrics { - status: MetricGroup; - errors: CounterGroup; - events: CounterGroup; -} -export declare class TCPListener extends TypedEventEmitter implements Listener { - private readonly context; - private readonly server; - /** Keep track of open connections to destroy in case of timeout */ - private readonly connections; - private status; - private metrics?; - private addr; - private readonly log; - constructor(context: Context); - private onSocket; - getAddrs(): Multiaddr[]; - listen(ma: Multiaddr): Promise; - close(): Promise; - /** - * Can resume a stopped or start an inert server - */ - private resume; - private pause; -} -export {}; -//# sourceMappingURL=listener.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/listener.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/listener.d.ts.map deleted file mode 100644 index d81a9c284..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/listener.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../../src/listener.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAe,MAAM,0BAA0B,CAAA;AAQzE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAyB,MAAM,mBAAmB,CAAA;AAC/E,OAAO,KAAK,EAAuB,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACnF,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnF,OAAO,KAAK,EAAE,QA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AAK,SAAS,EAAE;IAgClB,MAAM,CAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBrC,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;IAY7B;;OAEG;YACW,MAAM;YAiBN,KAAK;CAgCpB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/listener.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/listener.js deleted file mode 100644 index d7f6962da..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/listener.js +++ /dev/null @@ -1,301 +0,0 @@ -import net from 'net'; -import { CodeError } from '@libp2p/interface/errors'; -import { TypedEventEmitter, CustomEvent } from '@libp2p/interface/events'; -import { CODE_P2P } from './constants.js'; -import { toMultiaddrConnection } from './socket-to-conn.js'; -import { getMultiaddrs, multiaddrToNetConfig } from './utils.js'; -/** - * Attempts to close the given maConn. If a failure occurs, it will be logged - */ -async function attemptClose(maConn, options) { - try { - await maConn.close(); - } - catch (err) { - options.log.error('an error occurred closing the connection', err); - } -} -var TCPListenerStatusCode; -(function (TCPListenerStatusCode) { - /** - * When server object is initialized but we don't know the listening address yet or - * the server object is stopped manually, can be resumed only by calling listen() - **/ - TCPListenerStatusCode[TCPListenerStatusCode["INACTIVE"] = 0] = "INACTIVE"; - TCPListenerStatusCode[TCPListenerStatusCode["ACTIVE"] = 1] = "ACTIVE"; - /* During the connection limits */ - TCPListenerStatusCode[TCPListenerStatusCode["PAUSED"] = 2] = "PAUSED"; -})(TCPListenerStatusCode || (TCPListenerStatusCode = {})); -export class TCPListener extends TypedEventEmitter { - context; - server; - /** Keep track of open connections to destroy in case of timeout */ - connections = new Set(); - status = { code: TCPListenerStatusCode.INACTIVE }; - metrics; - addr; - log; - constructor(context) { - super(); - this.context = context; - context.keepAlive = context.keepAlive ?? true; - this.log = context.logger.forComponent('libp2p:tcp:listener'); - this.addr = 'unknown'; - this.server = net.createServer(context, this.onSocket.bind(this)); - // https://nodejs.org/api/net.html#servermaxconnections - // If set reject connections when the server's connection count gets high - // Useful to prevent too resource exhaustion via many open connections on high bursts of activity - if (context.maxConnections !== undefined) { - this.server.maxConnections = context.maxConnections; - } - if (context.closeServerOnMaxConnections != null) { - // Sanity check options - if (context.closeServerOnMaxConnections.closeAbove < context.closeServerOnMaxConnections.listenBelow) { - throw new CodeError('closeAbove must be >= listenBelow', 'ERROR_CONNECTION_LIMITS'); - } - } - this.server - .on('listening', () => { - if (context.metrics != null) { - // we are listening, register metrics for our port - const address = this.server.address(); - if (address == null) { - this.addr = 'unknown'; - } - else if (typeof address === 'string') { - // unix socket - this.addr = address; - } - else { - this.addr = `${address.address}:${address.port}`; - } - context.metrics?.registerMetricGroup('libp2p_tcp_inbound_connections_total', { - label: 'address', - help: 'Current active connections in TCP listener', - calculate: () => { - return { - [this.addr]: this.connections.size - }; - } - }); - this.metrics = { - status: context.metrics.registerMetricGroup('libp2p_tcp_listener_status_info', { - label: 'address', - help: 'Current status of the TCP listener socket' - }), - errors: context.metrics.registerMetricGroup('libp2p_tcp_listener_errors_total', { - label: 'address', - help: 'Total count of TCP listener errors by type' - }), - events: context.metrics.registerMetricGroup('libp2p_tcp_listener_events_total', { - label: 'address', - help: 'Total count of TCP listener events by type' - }) - }; - this.metrics?.status.update({ - [this.addr]: TCPListenerStatusCode.ACTIVE - }); - } - this.dispatchEvent(new CustomEvent('listening')); - }) - .on('error', err => { - this.metrics?.errors.increment({ [`${this.addr} listen_error`]: true }); - this.dispatchEvent(new CustomEvent('error', { detail: err })); - }) - .on('close', () => { - this.metrics?.status.update({ - [this.addr]: this.status.code - }); - // If this event is emitted, the transport manager will remove the listener from it's cache - // in the meanwhile if the connections are dropped then listener will start listening again - // and the transport manager will not be able to close the server - if (this.status.code !== TCPListenerStatusCode.PAUSED) { - this.dispatchEvent(new CustomEvent('close')); - } - }); - } - onSocket(socket) { - if (this.status.code !== TCPListenerStatusCode.ACTIVE) { - throw new CodeError('Server is is not listening yet', 'ERR_SERVER_NOT_RUNNING'); - } - // Avoid uncaught errors caused by unstable connections - socket.on('error', err => { - this.log('socket error', err); - this.metrics?.events.increment({ [`${this.addr} error`]: true }); - }); - let maConn; - try { - maConn = toMultiaddrConnection(socket, { - listeningAddr: this.status.listeningAddr, - socketInactivityTimeout: this.context.socketInactivityTimeout, - socketCloseTimeout: this.context.socketCloseTimeout, - metrics: this.metrics?.events, - metricPrefix: `${this.addr} `, - logger: this.context.logger - }); - } - catch (err) { - this.log.error('inbound connection failed', err); - this.metrics?.errors.increment({ [`${this.addr} inbound_to_connection`]: true }); - return; - } - this.log('new inbound connection %s', maConn.remoteAddr); - try { - this.context.upgrader.upgradeInbound(maConn) - .then((conn) => { - this.log('inbound connection upgraded %s', maConn.remoteAddr); - this.connections.add(maConn); - socket.once('close', () => { - this.connections.delete(maConn); - if (this.context.closeServerOnMaxConnections != null && - this.connections.size < this.context.closeServerOnMaxConnections.listenBelow) { - // The most likely case of error is if the port taken by this application is binded by - // another process during the time the server if closed. In that case there's not much - // we can do. resume() will be called again every time a connection is dropped, which - // acts as an eventual retry mechanism. onListenError allows the consumer act on this. - this.resume().catch(e => { - this.log.error('error attempting to listen server once connection count under limit', e); - this.context.closeServerOnMaxConnections?.onListenError?.(e); - }); - } - }); - if (this.context.handler != null) { - this.context.handler(conn); - } - if (this.context.closeServerOnMaxConnections != null && - this.connections.size >= this.context.closeServerOnMaxConnections.closeAbove) { - this.pause(false).catch(e => { - this.log.error('error attempting to close server once connection count over limit', e); - }); - } - this.dispatchEvent(new CustomEvent('connection', { detail: conn })); - }) - .catch(async (err) => { - this.log.error('inbound connection failed', err); - this.metrics?.errors.increment({ [`${this.addr} inbound_upgrade`]: true }); - await attemptClose(maConn, { - log: this.log - }); - }) - .catch(err => { - this.log.error('closing inbound connection failed', err); - }); - } - catch (err) { - this.log.error('inbound connection failed', err); - attemptClose(maConn, { - log: this.log - }) - .catch(err => { - this.log.error('closing inbound connection failed', err); - this.metrics?.errors.increment({ [`${this.addr} inbound_closing_failed`]: true }); - }); - } - } - getAddrs() { - if (this.status.code === TCPListenerStatusCode.INACTIVE) { - return []; - } - let addrs = []; - const address = this.server.address(); - const { listeningAddr, peerId } = this.status; - if (address == null) { - return []; - } - if (typeof address === 'string') { - addrs = [listeningAddr]; - } - else { - try { - // Because TCP will only return the IPv6 version - // we need to capture from the passed multiaddr - if (listeningAddr.toString().startsWith('/ip4')) { - addrs = addrs.concat(getMultiaddrs('ip4', address.address, address.port)); - } - else if (address.family === 'IPv6') { - addrs = addrs.concat(getMultiaddrs('ip6', address.address, address.port)); - } - } - catch (err) { - this.log.error('could not turn %s:%s into multiaddr', address.address, address.port, err); - } - } - return addrs.map(ma => peerId != null ? ma.encapsulate(`/p2p/${peerId}`) : ma); - } - async listen(ma) { - if (this.status.code === TCPListenerStatusCode.ACTIVE || this.status.code === TCPListenerStatusCode.PAUSED) { - throw new CodeError('server is already listening', 'ERR_SERVER_ALREADY_LISTENING'); - } - const peerId = ma.getPeerId(); - const listeningAddr = peerId == null ? ma.decapsulateCode(CODE_P2P) : ma; - const { backlog } = this.context; - try { - this.status = { - code: TCPListenerStatusCode.ACTIVE, - listeningAddr, - peerId, - netConfig: multiaddrToNetConfig(listeningAddr, { backlog }) - }; - await this.resume(); - } - catch (err) { - this.status = { code: TCPListenerStatusCode.INACTIVE }; - throw err; - } - } - async close() { - // Close connections and server the same time to avoid any race condition - await Promise.all([ - Promise.all(Array.from(this.connections.values()).map(async (maConn) => attemptClose(maConn, { - log: this.log - }))), - this.pause(true).catch(e => { - this.log.error('error attempting to close server once connection count over limit', e); - }) - ]); - } - /** - * Can resume a stopped or start an inert server - */ - async resume() { - if (this.server.listening || this.status.code === TCPListenerStatusCode.INACTIVE) { - return; - } - const netConfig = this.status.netConfig; - await new Promise((resolve, reject) => { - // NOTE: 'listening' event is only fired on success. Any error such as port already binded, is emitted via 'error' - this.server.once('error', reject); - this.server.listen(netConfig, resolve); - }); - this.status = { ...this.status, code: TCPListenerStatusCode.ACTIVE }; - this.log('Listening on %s', this.server.address()); - } - async pause(permanent) { - if (!this.server.listening && this.status.code === TCPListenerStatusCode.PAUSED && permanent) { - this.status = { code: TCPListenerStatusCode.INACTIVE }; - return; - } - if (!this.server.listening || this.status.code !== TCPListenerStatusCode.ACTIVE) { - return; - } - this.log('Closing server on %s', this.server.address()); - // NodeJS implementation tracks listening status with `this._handle` property. - // - Server.close() sets this._handle to null immediately. If this._handle is null, ERR_SERVER_NOT_RUNNING is thrown - // - Server.listening returns `this._handle !== null` https://github.com/nodejs/node/blob/386d761943bb1b217fba27d6b80b658c23009e60/lib/net.js#L1675 - // - Server.listen() if `this._handle !== null` throws ERR_SERVER_ALREADY_LISTEN - // - // NOTE: Both listen and close are technically not async actions, so it's not necessary to track - // states 'pending-close' or 'pending-listen' - // From docs https://nodejs.org/api/net.html#serverclosecallback - // Stops the server from accepting new connections and keeps existing connections. - // 'close' event is emitted only emitted when all connections are ended. - // The optional callback will be called once the 'close' event occurs. - // We need to set this status before closing server, so other procedures are aware - // during the time the server is closing - this.status = permanent ? { code: TCPListenerStatusCode.INACTIVE } : { ...this.status, code: TCPListenerStatusCode.PAUSED }; - await new Promise((resolve, reject) => { - this.server.close(err => { (err != null) ? reject(err) : resolve(); }); - }); - } -} -//# sourceMappingURL=listener.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/listener.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/listener.js.map deleted file mode 100644 index 2e89d00b6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/listener.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listener.js","sourceRoot":"","sources":["../../src/listener.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB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AAC,MAAM,IAAI,SAAS,EAAE;YAC5F,IAAI,CAAC,MAAM,GAAG,EAAE,IAAI,EAAE,qBAAqB,CAAC,QAAQ,EAAE,CAAA;YACtD,OAAM;SACP;QAED,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,qBAAqB,CAAC,MAAM,EAAE;YAC/E,OAAM;SACP;QAED,IAAI,CAAC,GAAG,CAAC,sBAAsB,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;QAEvD,8EAA8E;QAC9E,oHAAoH;QACpH,mJAAmJ;QACnJ,gFAAgF;QAChF,EAAE;QACF,gGAAgG;QAChG,6CAA6C;QAE7C,gEAAgE;QAChE,kFAAkF;QAClF,wEAAwE;QACxE,sEAAsE;QAEtE,kFAAkF;QAClF,wCAAwC;QACxC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,qBAAqB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,qBAAqB,CAAC,MAAM,EAAE,CAAA;QAC3H,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA,CAAC,CAAC,CAAC,CAAA;QACvE,CAAC,CAAC,CAAA;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/socket-to-conn.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/socket-to-conn.d.ts deleted file mode 100644 index af459c198..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/socket-to-conn.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { ComponentLogger } from '@libp2p/interface'; -import type { MultiaddrConnection } from '@libp2p/interface/connection'; -import type { CounterGroup } from '@libp2p/interface/metrics'; -import type { Multiaddr } from '@multiformats/multiaddr'; -import type { Socket } from 'net'; -interface ToConnectionOptions { - listeningAddr?: Multiaddr; - remoteAddr?: Multiaddr; - localAddr?: Multiaddr; - socketInactivityTimeout?: number; - socketCloseTimeout?: number; - metrics?: CounterGroup; - metricPrefix?: string; - logger: ComponentLogger; -} -/** - * Convert a socket into a MultiaddrConnection - * https://github.com/libp2p/interface-transport#multiaddrconnection - */ -export declare const toMultiaddrConnection: (socket: Socket, options: ToConnectionOptions) => MultiaddrConnection; -export {}; -//# sourceMappingURL=socket-to-conn.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/socket-to-conn.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/socket-to-conn.d.ts.map deleted file mode 100644 index 36979c82f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/socket-to-conn.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"socket-to-conn.d.ts","sourceRoot":"","sources":["../../src/socket-to-conn.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAEjC,UAAU,mBAAmB;IAC3B,aAAa,CAAC,EAAE,SAAS,CAAA;IACzB,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE,eAAe,CAAA;CACxB;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,WAAY,MAAM,WAAW,mBAAmB,KAAG,mBA4KpF,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/socket-to-conn.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/socket-to-conn.js deleted file mode 100644 index 869e9d556..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/socket-to-conn.js +++ /dev/null @@ -1,158 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { ipPortToMultiaddr as toMultiaddr } from '@libp2p/utils/ip-port-to-multiaddr'; -// @ts-expect-error no types -import toIterable from 'stream-to-it'; -import { CLOSE_TIMEOUT, SOCKET_TIMEOUT } from './constants.js'; -import { multiaddrToNetConfig } from './utils.js'; -/** - * Convert a socket into a MultiaddrConnection - * https://github.com/libp2p/interface-transport#multiaddrconnection - */ -export const toMultiaddrConnection = (socket, options) => { - const log = options.logger.forComponent('libp2p:tcp:socket'); - const metrics = options.metrics; - const metricPrefix = options.metricPrefix ?? ''; - const inactivityTimeout = options.socketInactivityTimeout ?? SOCKET_TIMEOUT; - const closeTimeout = options.socketCloseTimeout ?? CLOSE_TIMEOUT; - // Check if we are connected on a unix path - if (options.listeningAddr?.getPath() != null) { - options.remoteAddr = options.listeningAddr; - } - if (options.remoteAddr?.getPath() != null) { - options.localAddr = options.remoteAddr; - } - let remoteAddr; - if (options.remoteAddr != null) { - remoteAddr = options.remoteAddr; - } - else { - if (socket.remoteAddress == null || socket.remotePort == null) { - // this can be undefined if the socket is destroyed (for example, if the client disconnected) - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#socketremoteaddress - throw new CodeError('Could not determine remote address or port', 'ERR_NO_REMOTE_ADDRESS'); - } - remoteAddr = toMultiaddr(socket.remoteAddress, socket.remotePort); - } - const lOpts = multiaddrToNetConfig(remoteAddr); - const lOptsStr = lOpts.path ?? `${lOpts.host ?? ''}:${lOpts.port ?? ''}`; - const { sink, source } = toIterable.duplex(socket); - // by default there is no timeout - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#socketsettimeouttimeout-callback - socket.setTimeout(inactivityTimeout, () => { - log('%s socket read timeout', lOptsStr); - metrics?.increment({ [`${metricPrefix}timeout`]: true }); - // only destroy with an error if the remote has not sent the FIN message - let err; - if (socket.readable) { - err = new CodeError('Socket read timeout', 'ERR_SOCKET_READ_TIMEOUT'); - } - // if the socket times out due to inactivity we must manually close the connection - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#event-timeout - socket.destroy(err); - }); - socket.once('close', () => { - log('%s socket close', lOptsStr); - metrics?.increment({ [`${metricPrefix}close`]: true }); - // In instances where `close` was not explicitly called, - // such as an iterable stream ending, ensure we have set the close - // timeline - if (maConn.timeline.close == null) { - maConn.timeline.close = Date.now(); - } - }); - socket.once('end', () => { - // the remote sent a FIN packet which means no more data will be sent - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#event-end - log('%s socket end', lOptsStr); - metrics?.increment({ [`${metricPrefix}end`]: true }); - }); - const maConn = { - async sink(source) { - try { - await sink((async function* () { - for await (const buf of source) { - if (buf instanceof Uint8Array) { - yield buf; - } - else { - // is it faster to yield all the buffers or just one big buffer? - yield * buf; - } - } - })()); - } - catch (err) { - // If aborted we can safely ignore - if (err.type !== 'aborted') { - // If the source errored the socket will already have been destroyed by - // toIterable.duplex(). If the socket errored it will already be - // destroyed. There's nothing to do here except log the error & return. - log(err); - } - } - // we have finished writing, send the FIN message - socket.end(); - }, - source, - // If the remote address was passed, use it - it may have the peer ID encapsulated - remoteAddr, - timeline: { open: Date.now() }, - async close(options = {}) { - if (socket.destroyed) { - log('%s socket was already destroyed when trying to close', lOptsStr); - return; - } - if (options.signal == null) { - const signal = AbortSignal.timeout(closeTimeout); - options = { - ...options, - signal - }; - } - try { - log('%s closing socket', lOptsStr); - await new Promise((resolve, reject) => { - socket.once('close', () => { - // socket completely closed - log('%s socket closed', lOptsStr); - resolve(); - }); - socket.once('error', (err) => { - log('%s socket error', lOptsStr, err); - // error closing socket - if (maConn.timeline.close == null) { - maConn.timeline.close = Date.now(); - } - reject(err); - }); - // shorten inactivity timeout - socket.setTimeout(closeTimeout); - // close writable end of the socket - socket.end(); - if (socket.writableLength > 0) { - // there are outgoing bytes waiting to be sent - socket.once('drain', () => { - log('%s socket drained', lOptsStr); - // all bytes have been sent we can destroy the socket (maybe) before the timeout - socket.destroy(); - }); - } - else { - // nothing to send, destroy immediately, no need for the timeout - socket.destroy(); - } - }); - } - catch (err) { - this.abort(err); - } - }, - abort: (err) => { - log('%s socket abort due to error', lOptsStr, err); - socket.destroy(err); - }, - log - }; - return maConn; -}; -//# sourceMappingURL=socket-to-conn.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/socket-to-conn.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/socket-to-conn.js.map deleted file mode 100644 index 0814b79a2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/socket-to-conn.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"socket-to-conn.js","sourceRoot":"","sources":["../../src/socket-to-conn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,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OAAO,GAAQ,EAAE;gBACjB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;aAChB;QACH,CAAC;QAED,KAAK,EAAE,CAAC,GAAU,EAAE,EAAE;YACpB,GAAG,CAAC,8BAA8B,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAA;YAElD,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QACrB,CAAC;QAED,GAAG;KACJ,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/utils.d.ts deleted file mode 100644 index fcaacb7f9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/utils.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// -import type { Multiaddr } from '@multiformats/multiaddr'; -import type { ListenOptions, IpcSocketConnectOpts, TcpSocketConnectOpts } from 'net'; -export type NetConfig = ListenOptions | (IpcSocketConnectOpts & TcpSocketConnectOpts); -export declare function multiaddrToNetConfig(addr: Multiaddr, config?: NetConfig): NetConfig; -export declare function getMultiaddrs(proto: 'ip4' | 'ip6', ip: string, port: number): Multiaddr[]; -export declare function isAnyAddr(ip: string): boolean; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/utils.d.ts.map deleted file mode 100644 index c29db63f2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,KAAK,CAAA;AAIpF,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,CAAC,oBAAoB,GAAG,oBAAoB,CAAC,CAAA;AAErF,wBAAgB,oBAAoB,CAAE,IAAI,EAAE,SAAS,EAAE,MAAM,GAAE,SAAc,GAAG,SAAS,CAexF;AAED,wBAAgB,aAAa,CAAE,KAAK,EAAE,KAAK,GAAG,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CAG1F;AAED,wBAAgB,SAAS,CAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAE9C"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/utils.js deleted file mode 100644 index 6516cfd6d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/utils.js +++ /dev/null @@ -1,41 +0,0 @@ -import os from 'os'; -import path from 'path'; -import { multiaddr } from '@multiformats/multiaddr'; -const ProtoFamily = { ip4: 'IPv4', ip6: 'IPv6' }; -export function multiaddrToNetConfig(addr, config = {}) { - const listenPath = addr.getPath(); - // unix socket listening - if (listenPath != null) { - if (os.platform() === 'win32') { - // Use named pipes on Windows systems. - return { path: path.join('\\\\.\\pipe\\', listenPath) }; - } - else { - return { path: listenPath }; - } - } - // tcp listening - return { ...config, ...addr.toOptions() }; -} -export function getMultiaddrs(proto, ip, port) { - const toMa = (ip) => multiaddr(`/${proto}/${ip}/tcp/${port}`); - return (isAnyAddr(ip) ? getNetworkAddrs(ProtoFamily[proto]) : [ip]).map(toMa); -} -export function isAnyAddr(ip) { - return ['0.0.0.0', '::'].includes(ip); -} -const networks = os.networkInterfaces(); -function getNetworkAddrs(family) { - const addresses = []; - for (const [, netAddrs] of Object.entries(networks)) { - if (netAddrs != null) { - for (const netAddr of netAddrs) { - if (netAddr.family === family) { - addresses.push(netAddr.address); - } - } - } - } - return addresses; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/utils.js.map deleted file mode 100644 index 882084ffd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/src/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAInD,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,CAAA;AAIhD,MAAM,UAAU,oBAAoB,CAAE,IAAe,EAAE,SAAoB,EAAE;IAC3E,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,CAAA;IAEjC,wBAAwB;IACxB,IAAI,UAAU,IAAI,IAAI,EAAE;QACtB,IAAI,EAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,EAAE;YAC7B,sCAAsC;YACtC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,EAAE,CAAA;SACxD;aAAM;YACL,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAA;SAC5B;KACF;IAED,gBAAgB;IAChB,OAAO,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,EAAE,CAAA;AAC3C,CAAC;AAED,MAAM,UAAU,aAAa,CAAE,KAAoB,EAAE,EAAU,EAAE,IAAY;IAC3E,MAAM,IAAI,GAAG,CAAC,EAAU,EAAa,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,IAAI,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAA;IAChF,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAC/E,CAAC;AAED,MAAM,UAAU,SAAS,CAAE,EAAU;IACnC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;AACvC,CAAC;AAED,MAAM,QAAQ,GAAG,EAAE,CAAC,iBAAiB,EAAE,CAAA;AAEvC,SAAS,eAAe,CAAE,MAAc;IACtC,MAAM,SAAS,GAAa,EAAE,CAAA;IAE9B,KAAK,MAAM,CAAC,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QACnD,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;gBAC9B,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE;oBAC7B,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;iBAChC;aACF;SACF;KACF;IAED,OAAO,SAAS,CAAA;AAClB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/compliance.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/compliance.spec.d.ts deleted file mode 100644 index dac08d9d2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/compliance.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=compliance.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/compliance.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/compliance.spec.d.ts.map deleted file mode 100644 index dc9e71995..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/compliance.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.d.ts","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/compliance.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/compliance.spec.js deleted file mode 100644 index a9a426d73..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/compliance.spec.js +++ /dev/null @@ -1,43 +0,0 @@ -import net from 'net'; -import tests from '@libp2p/interface-compliance-tests/transport'; -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import sinon from 'sinon'; -import { tcp } from '../src/index.js'; -describe('interface-transport compliance', () => { - tests({ - async setup() { - const transport = tcp()({ - logger: defaultLogger() - }); - const addrs = [ - multiaddr('/ip4/127.0.0.1/tcp/9091'), - multiaddr('/ip4/127.0.0.1/tcp/9092'), - multiaddr('/ip4/127.0.0.1/tcp/9093'), - multiaddr('/ip6/::/tcp/9094') - ]; - // Used by the dial tests to simulate a delayed connect - const connector = { - delay(delayMs) { - const netConnect = net.connect; - sinon.replace(net, 'connect', (opts) => { - const socket = netConnect(opts); - const socketEmit = socket.emit.bind(socket); - sinon.replace(socket, 'emit', (...args) => { - const time = args[0] === 'connect' ? delayMs : 0; - setTimeout(() => socketEmit(...args), time); - return true; - }); - return socket; - }); - }, - restore() { - sinon.restore(); - } - }; - return { transport, addrs, connector }; - }, - async teardown() { } - }); -}); -//# sourceMappingURL=compliance.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/compliance.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/compliance.spec.js.map deleted file mode 100644 index 1f1b3b2ef..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/compliance.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.js","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,KAAK,MAAM,8CAA8C,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAErC,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,KAAK,CAAC;QACJ,KAAK,CAAC,KAAK;YACT,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC;gBACtB,MAAM,EAAE,aAAa,EAAE;aACxB,CAAC,CAAA;YACF,MAAM,KAAK,GAAG;gBACZ,SAAS,CAAC,yBAAyB,CAAC;gBACpC,SAAS,CAAC,yBAAyB,CAAC;gBACpC,SAAS,CAAC,yBAAyB,CAAC;gBACpC,SAAS,CAAC,kBAAkB,CAAC;aAC9B,CAAA;YAED,uDAAuD;YACvD,MAAM,SAAS,GAAG;gBAChB,KAAK,CAAE,OAAe;oBACpB,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAA;oBAC9B,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC,IAAS,EAAE,EAAE;wBAC1C,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;wBAC/B,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;wBAC3C,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,IAAc,EAAE,EAAE;4BAClD,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;4BAChD,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;4BAC3C,OAAO,IAAI,CAAA;wBACb,CAAC,CAAC,CAAA;wBACF,OAAO,MAAM,CAAA;oBACf,CAAC,CAAC,CAAA;gBACJ,CAAC;gBACD,OAAO;oBACL,KAAK,CAAC,OAAO,EAAE,CAAA;gBACjB,CAAC;aACF,CAAA;YAED,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAA;QACxC,CAAC;QACD,KAAK,CAAC,QAAQ,KAAK,CAAC;KACrB,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection-limits.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection-limits.spec.d.ts deleted file mode 100644 index 502dc4ab3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection-limits.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=connection-limits.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection-limits.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection-limits.spec.d.ts.map deleted file mode 100644 index 4512df906..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection-limits.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-limits.spec.d.ts","sourceRoot":"","sources":["../../test/connection-limits.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection-limits.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection-limits.spec.js deleted file mode 100644 index 577c74dfd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection-limits.spec.js +++ /dev/null @@ -1,188 +0,0 @@ -import net from 'node:net'; -import { promisify } from 'util'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { tcp } from '../src/index.js'; -const buildSocketAssertions = (port, closeCallbacks) => { - function createSocket(i) { - const socket = net.connect({ host: '127.0.0.1', port }); - closeCallbacks.unshift(async function closeHandler() { - if (!socket.destroyed) { - socket.destroy(); - await new Promise((resolve) => socket.on('close', resolve)); - } - }); - return socket; - } - async function assertConnectedSocket(i) { - const socket = createSocket(i); - await new Promise((resolve, reject) => { - socket.once('connect', () => { - resolve(); - }); - socket.once('error', (err) => { - err.message = `Socket[${i}] ${err.message}`; - reject(err); - }); - }); - return socket; - } - async function assertRefusedSocket(i) { - const socket = createSocket(i); - await new Promise((resolve, reject) => { - socket.once('connect', () => { - reject(Error(`Socket[${i}] connected but was expected to reject`)); - }); - socket.once('error', (err) => { - if (err.message.includes('ECONNREFUSED')) { - resolve(); - } - else { - err.message = `Socket[${i}] unexpected error ${err.message}`; - reject(err); - } - }); - }); - return socket; - } - return { assertConnectedSocket, assertRefusedSocket }; -}; -async function assertServerConnections(listener, connections) { - // Expect server connections but allow time for sockets to connect or disconnect - for (let i = 0; i < 100; i++) { - // eslint-disable-next-line @typescript-eslint/dot-notation - if (listener['connections'].size === connections) { - return; - } - else { - await promisify(setTimeout)(10); - } - } - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(listener['connections'].size).equals(connections, 'invalid amount of server connections'); -} -describe('closeAbove/listenBelow', () => { - const afterEachCallbacks = []; - afterEach(async () => { - await Promise.all(afterEachCallbacks.map(fn => fn())); - afterEachCallbacks.length = 0; - }); - it('reject dial of connection above closeAbove', async () => { - const listenBelow = 2; - const closeAbove = 3; - const port = 9900; - const trasnport = tcp({ closeServerOnMaxConnections: { listenBelow, closeAbove } })({ - logger: defaultLogger() - }); - const upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - const listener = trasnport.createListener({ upgrader }); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.push(() => listener.close()); - await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`)); - const { assertConnectedSocket, assertRefusedSocket } = buildSocketAssertions(port, afterEachCallbacks); - await assertConnectedSocket(1); - await assertConnectedSocket(2); - await assertConnectedSocket(3); - await assertServerConnections(listener, 3); - // Limit reached, server should be closed here - await assertRefusedSocket(4); - await assertRefusedSocket(5); - await assertServerConnections(listener, 3); - }); - it('accepts dial of connection when connection drop listenBelow limit', async () => { - const listenBelow = 2; - const closeAbove = 3; - const port = 9900; - const trasnport = tcp({ closeServerOnMaxConnections: { listenBelow, closeAbove } })({ - logger: defaultLogger() - }); - const upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - const listener = trasnport.createListener({ upgrader }); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.push(() => listener.close()); - await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`)); - const { assertConnectedSocket } = buildSocketAssertions(port, afterEachCallbacks); - const socket1 = await assertConnectedSocket(1); - const socket2 = await assertConnectedSocket(2); - await assertConnectedSocket(3); - await assertServerConnections(listener, 3); - // Destroy sockets to be have connections < listenBelow - socket1.destroy(); - socket2.destroy(); - // After destroying 2 sockets connections will be below "listenBelow" limit - await assertServerConnections(listener, 1); - // Now it should be able to accept new connections - await assertConnectedSocket(4); - await assertConnectedSocket(5); - // 2 connections dropped and 2 new connections accepted - await assertServerConnections(listener, 3); - }); - it('should not emit "close" event when server is stopped due to "closeAbove" limit', async () => { - const listenBelow = 2; - const closeAbove = 3; - const port = 9900; - const trasnport = tcp({ closeServerOnMaxConnections: { listenBelow, closeAbove } })({ - logger: defaultLogger() - }); - const upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - const listener = trasnport.createListener({ upgrader }); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.push(() => listener.close()); - let closeEventCallCount = 0; - listener.addEventListener('close', () => { - closeEventCallCount += 1; - }); - await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`)); - const { assertConnectedSocket } = buildSocketAssertions(port, afterEachCallbacks); - await assertConnectedSocket(1); - await assertConnectedSocket(2); - await assertConnectedSocket(3); - await assertServerConnections(listener, 3); - // Limit reached, server should be closed but should not emit "close" event - expect(closeEventCallCount).equals(0); - }); - it('should emit "listening" event when server is resumed due to "listenBelow" limit', async () => { - const listenBelow = 2; - const closeAbove = 3; - const port = 9900; - const trasnport = tcp({ closeServerOnMaxConnections: { listenBelow, closeAbove } })({ - logger: defaultLogger() - }); - const upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - const listener = trasnport.createListener({ upgrader }); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.push(() => listener.close()); - let listeningEventCallCount = 0; - listener.addEventListener('listening', () => { - listeningEventCallCount += 1; - }); - await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`)); - const { assertConnectedSocket } = buildSocketAssertions(port, afterEachCallbacks); - // Server should be listening now - expect(listeningEventCallCount).equals(1); - const socket1 = await assertConnectedSocket(1); - const socket2 = await assertConnectedSocket(2); - await assertConnectedSocket(3); - // Limit reached, server should be closed now - await assertServerConnections(listener, 3); - // Close some sockets to resume listening - socket1.destroy(); - socket2.destroy(); - // Wait for listener to emit event - await promisify(setTimeout)(50); - // Server should emit the "listening" event again - expect(listeningEventCallCount).equals(2); - }); -}); -//# sourceMappingURL=connection-limits.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection-limits.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection-limits.spec.js.map deleted file mode 100644 index 801ffd48b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection-limits.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-limits.spec.js","sourceRoot":"","sources":["../../test/connection-limits.spec.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAA;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAGrC,MAAM,qBAAqB,GAAG,CAAC,IAAY,EAAE,cAA+C,EAAkH,EAAE;IAC9M,SAAS,YAAY,CAAE,CAAS;QAC9B,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI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AM,uBAAuB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;QAE1C,yCAAyC;QACzC,OAAO,CAAC,OAAO,EAAE,CAAA;QACjB,OAAO,CAAC,OAAO,EAAE,CAAA;QAEjB,kCAAkC;QAClC,MAAM,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAA;QAE/B,iDAAiD;QACjD,MAAM,CAAC,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection.spec.d.ts deleted file mode 100644 index 91628ea6f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=connection.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection.spec.d.ts.map deleted file mode 100644 index a6153fade..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection.spec.d.ts","sourceRoot":"","sources":["../../test/connection.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection.spec.js deleted file mode 100644 index d4bed18d2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection.spec.js +++ /dev/null @@ -1,73 +0,0 @@ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { tcp } from '../src/index.js'; -describe('valid localAddr and remoteAddr', () => { - let transport; - let upgrader; - beforeEach(() => { - transport = tcp()({ - logger: defaultLogger() - }); - upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - }); - const ma = multiaddr('/ip4/127.0.0.1/tcp/0'); - it('should resolve port 0', async () => { - // Create a Promise that resolves when a connection is handled - let handled; - const handlerPromise = new Promise(resolve => { handled = resolve; }); - const handler = (conn) => { handled(conn); }; - // Create a listener with the handler - const listener = transport.createListener({ - handler, - upgrader - }); - // Listen on the multi-address - await listener.listen(ma); - const localAddrs = listener.getAddrs(); - expect(localAddrs.length).to.equal(1); - // Dial to that address - await transport.dial(localAddrs[0], { - upgrader - }); - // Wait for the incoming dial to be handled - await handlerPromise; - // Close the listener - await listener.close(); - }); - it('should handle multiple simultaneous closes', async () => { - // Create a Promise that resolves when a connection is handled - let handled; - const handlerPromise = new Promise(resolve => { handled = resolve; }); - const handler = (conn) => { handled(conn); }; - // Create a listener with the handler - const listener = transport.createListener({ - handler, - upgrader - }); - // Listen on the multi-address - await listener.listen(ma); - const localAddrs = listener.getAddrs(); - expect(localAddrs.length).to.equal(1); - // Dial to that address - const dialerConn = await transport.dial(localAddrs[0], { - upgrader - }); - // Wait for the incoming dial to be handled - await handlerPromise; - // Close the dialer with two simultaneous calls to `close` - await Promise.race([ - new Promise((resolve, reject) => setTimeout(() => { reject(new Error('Timed out waiting for connection close')); }, 500)), - await Promise.all([ - dialerConn.close(), - dialerConn.close() - ]) - ]); - await listener.close(); - }); -}); -//# sourceMappingURL=connection.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection.spec.js.map deleted file mode 100644 index 7dc8f31d7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/connection.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection.spec.js","sourceRoot":"","sources":["../../test/connection.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAIrC,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,IAAI,SAAoB,CAAA;IACxB,IAAI,QAAkB,CAAA;IAEtB,UAAU,CAAC,GAAG,EAAE;QACd,SAAS,GAAG,GAAG,EAAE,CAAC;YAChB,MAAM,EAAE,aAAa,EAAE;SACxB,CAAC,CAAA;QACF,QAAQ,GAAG,YAAY,CAAC;YACtB,MAAM,EAAE,IAAI,iBAAiB,EAAE;SAChC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,MAAM,EAAE,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAA;IAE5C,EAAE,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE;QACrC,8DAA8D;QAC9D,IAAI,OAAmC,CAAA;QACvC,MAAM,cAAc,GAAG,IAAI,OAAO,CAAa,OAAO,CAAC,EAAE,GAAG,OAAO,GAAG,OAAO,CAAA,CAAC,CAAC,CAAC,CAAA;QAEhF,MAAM,OAAO,GAAG,CAAC,I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,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAErC,uBAAuB;QACvB,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;YACrD,QAAQ;SACT,CAAC,CAAA;QAEF,2CAA2C;QAC3C,MAAM,cAAc,CAAA;QAEpB,0DAA0D;QAC1D,MAAM,OAAO,CAAC,IAAI,CAAC;YACjB,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC,CAAA,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YACxH,MAAM,OAAO,CAAC,GAAG,CAAC;gBAChB,UAAU,CAAC,KAAK,EAAE;gBAClB,UAAU,CAAC,KAAK,EAAE;aACnB,CAAC;SACH,CAAC,CAAA;QAEF,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAA;IACxB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/filter.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/filter.spec.d.ts deleted file mode 100644 index ab805424d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/filter.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=filter.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/filter.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/filter.spec.d.ts.map deleted file mode 100644 index cdd7b3f4c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/filter.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"filter.spec.d.ts","sourceRoot":"","sources":["../../test/filter.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/filter.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/filter.spec.js deleted file mode 100644 index 944a2d63c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/filter.spec.js +++ /dev/null @@ -1,38 +0,0 @@ -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { tcp } from '../src/index.js'; -describe('filter addrs', () => { - const base = '/ip4/127.0.0.1'; - const ipfs = '/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'; - const unix = '/tmp/some/file.sock'; - let transport; - before(() => { - transport = tcp()({ - logger: defaultLogger() - }); - }); - it('filter valid addrs for this transport', () => { - const ma1 = multiaddr(base + '/tcp/9090'); - const ma2 = multiaddr(base + '/udp/9090'); - const ma3 = multiaddr(base + '/tcp/9090/http'); - const ma4 = multiaddr(base + '/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'); - const ma5 = multiaddr(base + '/tcp/9090/http' + ipfs); - const ma6 = multiaddr('/ip4/127.0.0.1/tcp/9090/p2p-circuit' + ipfs); - const ma7 = multiaddr('/dns4/libp2p.io/tcp/9090'); - const ma8 = multiaddr('/dnsaddr/libp2p.io/tcp/9090'); - const ma9 = multiaddr('/unix' + unix); - const valid = transport.filter([ma1, ma2, ma3, ma4, ma5, ma6, ma7, ma8, ma9]); - expect(valid.length).to.equal(5); - expect(valid[0]).to.deep.equal(ma1); - expect(valid[1]).to.deep.equal(ma4); - expect(valid[4]).to.deep.equal(ma9); - }); - it('filter a single addr for this transport', () => { - const ma1 = multiaddr(base + '/tcp/9090'); - const valid = transport.filter([ma1]); - expect(valid.length).to.equal(1); - expect(valid[0]).to.eql(ma1); - }); -}); -//# sourceMappingURL=filter.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/filter.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/filter.spec.js.map deleted file mode 100644 index 6ffefe6d8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/filter.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"filter.spec.js","sourceRoot":"","sources":["../../test/filter.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAGrC,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,MAAM,IAAI,GAAG,gBAAgB,CAAA;IAC7B,MAAM,IAAI,GAAG,sDAAsD,CAAA;IACnE,MAAM,IAAI,GAAG,qBAAqB,CAAA;IAElC,IAAI,SAAoB,CAAA;IAExB,MAAM,CAAC,GAAG,EAAE;QACV,SAAS,GAAG,GAAG,EAAE,CAAC;YAChB,MAAM,EAAE,aAAa,EAAE;SACxB,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,GAAG,WAAW,CAAC,CAAA;QACzC,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,GAAG,WAAW,CAAC,CAAA;QACzC,MAAM,GAAG,GAAG,SAAS,CAAC,I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AA;QACrC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAChC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC9B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/listen-dial.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/listen-dial.spec.d.ts deleted file mode 100644 index a90db0054..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/listen-dial.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=listen-dial.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/listen-dial.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/listen-dial.spec.d.ts.map deleted file mode 100644 index e2e65e44e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/listen-dial.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listen-dial.spec.d.ts","sourceRoot":"","sources":["../../test/listen-dial.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/listen-dial.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/listen-dial.spec.js deleted file mode 100644 index db2b02346..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/listen-dial.spec.js +++ /dev/null @@ -1,308 +0,0 @@ -import os from 'os'; -import path from 'path'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockRegistrar, mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import all from 'it-all'; -import { pipe } from 'it-pipe'; -import pDefer from 'p-defer'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { tcp } from '../src/index.js'; -const isCI = process.env.CI; -describe('listen', () => { - let transport; - let listener; - let upgrader; - beforeEach(() => { - transport = tcp()({ - logger: defaultLogger() - }); - upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - }); - afterEach(async () => { - try { - if (listener != null) { - await listener.close(); - } - } - catch { - // some tests close the listener so ignore errors - } - }); - it('listen on path', async () => { - const mh = multiaddr(`/unix/${path.resolve(os.tmpdir(), `/tmp/p2pd-${Date.now()}.sock`)}`); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - }); - it('listen on port 0', async () => { - const mh = multiaddr('/ip4/127.0.0.1/tcp/0'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - }); - it('errors when listening on busy port', async () => { - const mh = multiaddr('/ip4/127.0.0.1/tcp/0'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const listener2 = transport.createListener({ - upgrader - }); - const mh2 = listener.getAddrs()[0]; - await expect(listener2.listen(mh2)).to.eventually.be.rejected() - .with.property('code', 'EADDRINUSE'); - }); - it('listen on IPv6 addr', async () => { - if (isCI != null) { - return; - } - const mh = multiaddr('/ip6/::/tcp/9090'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - }); - it('listen on any Interface', async () => { - const mh = multiaddr('/ip4/0.0.0.0/tcp/9090'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - }); - it('getAddrs', async () => { - const mh = multiaddr('/ip4/127.0.0.1/tcp/9090'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length).to.equal(1); - expect(multiaddrs[0]).to.deep.equal(mh); - }); - it('getAddrs on port 0 listen', async () => { - const mh = multiaddr('/ip4/127.0.0.1/tcp/0'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length).to.equal(1); - }); - it('getAddrs from listening on 0.0.0.0', async () => { - const mh = multiaddr('/ip4/0.0.0.0/tcp/9090'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length > 0).to.equal(true); - expect(multiaddrs[0].toString().indexOf('0.0.0.0')).to.equal(-1); - }); - it('getAddrs from listening on 0.0.0.0 and port 0', async () => { - const mh = multiaddr('/ip4/0.0.0.0/tcp/0'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length > 0).to.equal(true); - expect(multiaddrs[0].toString().indexOf('0.0.0.0')).to.equal(-1); - }); - it('getAddrs from listening on ip6 \'::\'', async () => { - const mh = multiaddr('/ip6/::/tcp/9090'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length > 0).to.equal(true); - expect(multiaddrs[0].toOptions().host).to.not.equal('::'); - }); - it('getAddrs preserves IPFS Id', async () => { - const mh = multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length).to.equal(1); - expect(multiaddrs[0]).to.deep.equal(mh); - }); -}); -describe('dial', () => { - const protocol = '/echo/1.0.0'; - let transport; - let upgrader; - beforeEach(async () => { - const registrar = mockRegistrar(); - void registrar.handle(protocol, (evt) => { - void pipe(evt.stream, evt.stream); - }); - upgrader = mockUpgrader({ - registrar, - events: new TypedEventEmitter() - }); - transport = tcp()({ - logger: defaultLogger() - }); - }); - it('dial on IPv4', async () => { - const ma = multiaddr('/ip4/127.0.0.1/tcp/9090'); - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const conn = await transport.dial(ma, { - upgrader - }); - const stream = await conn.newStream([protocol]); - const values = await pipe([uint8ArrayFromString('hey')], stream, async (source) => all(source)); - expect(values[0].subarray()).to.equalBytes(uint8ArrayFromString('hey')); - await conn.close(); - await listener.close(); - }); - it('dial on IPv6', async () => { - if (isCI != null) { - return; - } - const ma = multiaddr('/ip6/::/tcp/9090'); - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const conn = await transport.dial(ma, { - upgrader - }); - const stream = await conn.newStream([protocol]); - const values = await pipe([uint8ArrayFromString('hey')], stream, async (source) => all(source)); - expect(values[0].subarray()).to.equalBytes(uint8ArrayFromString('hey')); - await conn.close(); - await listener.close(); - }); - it('dial on path', async () => { - const ma = multiaddr(`/unix/${path.resolve(os.tmpdir(), `/tmp/p2pd-${Date.now()}.sock`)}`); - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const conn = await transport.dial(ma, { - upgrader - }); - const stream = await conn.newStream([protocol]); - const values = await pipe([uint8ArrayFromString('hey')], stream, async (source) => all(source)); - expect(values[0].subarray()).to.equalBytes(uint8ArrayFromString('hey')); - await conn.close(); - await listener.close(); - }); - it('dial and destroy on listener', async () => { - let handled; - const handledPromise = new Promise(resolve => { handled = resolve; }); - const ma = multiaddr('/ip6/::/tcp/9090'); - const listener = transport.createListener({ - handler: (conn) => { - // let multistream select finish before closing - setTimeout(() => { - void conn.close() - .then(() => { handled(); }); - }, 100); - }, - upgrader - }); - await listener.listen(ma); - const addrs = listener.getAddrs(); - const conn = await transport.dial(addrs[0], { - upgrader - }); - const stream = await conn.newStream([protocol]); - pipe(stream); - await handledPromise; - await conn.close(); - await listener.close(); - }); - it('dial and destroy on dialer', async () => { - if (isCI != null) { - return; - } - let handled; - const handledPromise = new Promise(resolve => { handled = resolve; }); - const ma = multiaddr('/ip6/::/tcp/9090'); - const listener = transport.createListener({ - handler: () => { - handled(); - }, - upgrader - }); - await listener.listen(ma); - const addrs = listener.getAddrs(); - const conn = await transport.dial(addrs[0], { - upgrader - }); - await conn.close(); - await handledPromise; - await listener.close(); - }); - it('dials on IPv4 with IPFS Id', async () => { - const ma = multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'); - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const conn = await transport.dial(ma, { - upgrader - }); - const stream = await conn.newStream([protocol]); - const values = await pipe([uint8ArrayFromString('hey')], stream, async (source) => all(source)); - expect(values[0].subarray()).to.equalBytes(uint8ArrayFromString('hey')); - await conn.close(); - await listener.close(); - }); - it('aborts during dial', async () => { - const ma = multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'); - const maConnPromise = pDefer(); - // @ts-expect-error missing return value - upgrader.upgradeOutbound = async (maConn) => { - maConnPromise.resolve(maConn); - // take a long time to give us time to abort the dial - await new Promise((resolve) => { - setTimeout(() => { resolve(); }, 100); - }); - }; - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const abortController = new AbortController(); - // abort once the upgrade process has started - void maConnPromise.promise.then(() => { abortController.abort(); }); - await expect(transport.dial(ma, { - upgrader, - signal: abortController.signal - })).to.eventually.be.rejected('The operation was aborted'); - await expect(maConnPromise.promise).to.eventually.have.nested.property('timeline.close') - .that.is.ok('did not gracefully close maConn'); - await listener.close(); - }); - it('aborts before dial', async () => { - const ma = multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'); - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const abortController = new AbortController(); - abortController.abort(); - await expect(transport.dial(ma, { - upgrader, - signal: abortController.signal - })).to.eventually.be.rejected('The operation was aborted'); - await listener.close(); - }); -}); -//# sourceMappingURL=listen-dial.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/listen-dial.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/listen-dial.spec.js.map deleted file mode 100644 index a83699924..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/listen-dial.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listen-dial.spec.js","sourceRoot":"","sources":["../../test/listen-dial.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,GAAG,MAAM,QAAQ,CAAA;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAIrC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAA;AAE3B,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,IAAI,SAAoB,CAAA;IACxB,IAAI,QAAa,CAAA;IACjB,IAAI,QAAkB,CAAA;IAEtB,UAAU,CAAC,GAAG,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C,CAAA;QAE1D,MAAM,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC;aACrF,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,iCAAiC,CAAC,CAAA;QAEhD,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAA;IACxB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;QAClC,MAAM,EAAE,GAAG,SAAS,CAAC,6EAA6E,CAAC,CAAA;QACnG,MAAM,QAAQ,GAAG,SAAS,CAAC,cAAc,CAAC;YACxC,QAAQ;SACT,CAAC,CAAA;QACF,MAAM,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QAEzB,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAA;QAC7C,eAAe,CAAC,KAAK,EAAE,CAAA;QAEvB,MAAM,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE;YAC9B,QAAQ;YACR,MAAM,EAAE,eAAe,CAAC,MAAM;SAC/B,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAA;QAE1D,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAA;IACxB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/max-connections.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/max-connections.spec.d.ts deleted file mode 100644 index 72a08e916..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/max-connections.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=max-connections.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/max-connections.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/max-connections.spec.d.ts.map deleted file mode 100644 index ab2ee9d2f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/max-connections.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"max-connections.spec.d.ts","sourceRoot":"","sources":["../../test/max-connections.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/max-connections.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/max-connections.spec.js deleted file mode 100644 index ab083765e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/max-connections.spec.js +++ /dev/null @@ -1,73 +0,0 @@ -import net from 'node:net'; -import { promisify } from 'node:util'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { tcp } from '../src/index.js'; -describe('maxConnections', () => { - const afterEachCallbacks = []; - afterEach(async () => { - await Promise.all(afterEachCallbacks.map(fn => fn())); - afterEachCallbacks.length = 0; - }); - it('reject dial of connection above maxConnections', async () => { - const maxConnections = 2; - const socketCount = 4; - const port = 9900; - const seenRemoteConnections = new Set(); - const transport = tcp({ maxConnections })({ - logger: defaultLogger() - }); - const upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - const listener = transport.createListener({ upgrader }); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.push(() => listener.close()); - await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`)); - listener.addEventListener('connection', (conn) => { - seenRemoteConnections.add(conn.detail.remoteAddr.toString()); - }); - const sockets = []; - for (let i = 0; i < socketCount; i++) { - const socket = net.connect({ host: '127.0.0.1', port }); - sockets.push(socket); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.unshift(async () => { - if (!socket.destroyed) { - socket.destroy(); - await new Promise((resolve) => socket.on('close', resolve)); - } - }); - // Wait for connection so the order of sockets is stable, sockets expected to be alive are always [0,1] - await new Promise((resolve, reject) => { - socket.on('connect', () => { - resolve(); - }); - socket.on('error', (err) => { - reject(err); - }); - }); - } - // With server.maxConnections the TCP socket is created and the initial handshake is completed - // Then in the server handler NodeJS javascript code will call socket.emit('drop') if over the limit - // https://github.com/nodejs/node/blob/fddc701d3c0eb4520f2af570876cc987ae6b4ba2/lib/net.js#L1706 - // Wait for some time for server to drop all sockets above limit - await promisify(setTimeout)(250); - expect(seenRemoteConnections.size).equals(maxConnections, 'wrong serverConnections'); - for (let i = 0; i < socketCount; i++) { - const socket = sockets[i]; - if (i < maxConnections) { - // Assert socket connected - expect(socket.destroyed).equals(false, `socket ${i} under limit must not be destroyed`); - } - else { - // Assert socket ended - expect(socket.destroyed).equals(true, `socket ${i} above limit must be destroyed`); - } - } - }); -}); -//# sourceMappingURL=max-connections.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/max-connections.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/max-connections.spec.js.map deleted file mode 100644 index 232ec408b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/max-connections.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"max-connections.spec.js","sourceRoot":"","sources":["../../test/max-connections.spec.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAA;AAC1B,OAAO,EAAE,SAAS,E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oG;QACpG,gGAAgG;QAEhG,gEAAgE;QAChE,MAAM,SAAS,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAA;QAEhC,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,yBAAyB,CAAC,CAAA;QAEpF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,CAAC,EAAE,EAAE;YACpC,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;YAEzB,IAAI,CAAC,GAAG,cAAc,EAAE;gBACtB,0BAA0B;gBAC1B,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,oCAAoC,CAAC,CAAA;aACxF;iBAAM;gBACL,sBAAsB;gBACtB,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,gCAAgC,CAAC,CAAA;aACnF;SACF;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/socket-to-conn.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/socket-to-conn.spec.d.ts deleted file mode 100644 index ca7834908..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/socket-to-conn.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=socket-to-conn.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/socket-to-conn.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/socket-to-conn.spec.d.ts.map deleted file mode 100644 index a1baee8e2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/socket-to-conn.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"socket-to-conn.spec.d.ts","sourceRoot":"","sources":["../../test/socket-to-conn.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/socket-to-conn.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/socket-to-conn.spec.js deleted file mode 100644 index bbd6a547f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/socket-to-conn.spec.js +++ /dev/null @@ -1,326 +0,0 @@ -import { createServer, Socket } from 'net'; -import os from 'os'; -import { defaultLogger } from '@libp2p/logger'; -import { expect } from 'aegir/chai'; -import defer from 'p-defer'; -import { toMultiaddrConnection } from '../src/socket-to-conn.js'; -async function setup(opts) { - const serverListening = defer(); - const server = createServer(opts?.server); - server.listen(0, () => { - serverListening.resolve(); - }); - await serverListening.promise; - const serverSocket = defer(); - const clientSocket = defer(); - server.once('connection', (socket) => { - serverSocket.resolve(socket); - }); - const address = server.address(); - if (address == null || typeof address === 'string') { - throw new Error('Wrong socket type'); - } - const client = new Socket(opts?.client); - client.once('connect', () => { - clientSocket.resolve(client); - }); - client.connect(address.port, address.address); - return { - server, - serverSocket: await serverSocket.promise, - clientSocket: await clientSocket.promise - }; -} -describe('socket-to-conn', () => { - let server; - let clientSocket; - let serverSocket; - afterEach(async () => { - if (serverSocket != null) { - serverSocket.destroy(); - } - if (clientSocket != null) { - clientSocket.destroy(); - } - if (server != null) { - server.close(); - } - }); - it('should destroy a socket that is closed by the client', async () => { - ({ server, clientSocket, serverSocket } = await setup()); - // promise that is resolved when client socket is closed - const clientClosed = defer(); - // promise that is resolved when client socket errors - const clientErrored = defer(); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - // promise that is resolved when our outgoing socket errors - const serverErrored = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - clientSocket.once('close', () => { - clientClosed.resolve(true); - }); - clientSocket.once('error', err => { - clientErrored.resolve(err); - }); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - serverSocket.once('error', err => { - serverErrored.resolve(err); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - // close the client for writing - clientSocket.end(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket that is forcibly closed by the client', async () => { - ({ server, clientSocket, serverSocket } = await setup()); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - // promise that is resolved when our outgoing socket errors - const serverErrored = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - serverSocket.once('error', err => { - serverErrored.resolve(err); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - // close the client for reading and writing immediately - clientSocket.destroy(); - // client closed the connection - error code is platform specific - if (os.platform() === 'linux') { - await expect(serverErrored.promise).to.eventually.have.property('code', 'ERR_SOCKET_READ_TIMEOUT'); - } - else { - await expect(serverErrored.promise).to.eventually.have.property('code', 'ECONNRESET'); - } - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket that is half-closed by the client', async () => { - ({ server, clientSocket, serverSocket } = await setup({ - client: { - allowHalfOpen: true - } - })); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - // promise that is resolved when our outgoing socket errors - const serverErrored = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - serverSocket.once('error', err => { - serverErrored.resolve(err); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - // close the client for writing - clientSocket.end(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // remote stopped sending us data - await expect(serverErrored.promise).to.eventually.have.property('code', 'ERR_SOCKET_READ_TIMEOUT'); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket after sinking', async () => { - ({ server, clientSocket, serverSocket } = await setup()); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - // promise that is resolved when our outgoing socket errors - const serverErrored = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - serverSocket.once('error', err => { - serverErrored.resolve(err); - }); - // send some data between the client and server - await inboundMaConn.sink(async function* () { - yield Uint8Array.from([0, 1, 2, 3]); - }()); - // server socket should no longer be writable - expect(serverSocket.writable).to.be.false(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // remote didn't send us any data - await expect(serverErrored.promise).to.eventually.have.property('code', 'ERR_SOCKET_READ_TIMEOUT'); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket when containing MultiaddrConnection is closed', async () => { - ({ server, clientSocket, serverSocket } = await setup()); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - socketCloseTimeout: 10, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - clientSocket.once('error', () => { }); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - await inboundMaConn.close(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket by timeout when containing MultiaddrConnection is closed', async () => { - ({ server, clientSocket, serverSocket } = await setup({ - server: { - allowHalfOpen: true - } - })); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - socketCloseTimeout: 10, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - clientSocket.once('error', () => { }); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - await inboundMaConn.close(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket by timeout when containing MultiaddrConnection is closed but remote keeps sending data', async () => { - ({ server, clientSocket, serverSocket } = await setup({ - server: { - allowHalfOpen: true - } - })); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 500, - socketCloseTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - clientSocket.once('error', () => { }); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - setInterval(() => { - clientSocket.write(`some data ${Date.now()}`); - }, 10).unref(); - await inboundMaConn.close(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket by timeout when containing MultiaddrConnection is closed but closing remote times out', async () => { - ({ server, clientSocket, serverSocket } = await setup()); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - // promise that is resolved when our outgoing socket errors - const serverErrored = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - socketCloseTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - clientSocket.once('error', () => { }); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - serverSocket.once('error', err => { - serverErrored.resolve(err); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - // stop reading data - clientSocket.pause(); - // have to write enough data quickly enough to overwhelm the client - while (serverSocket.writableLength < 1024) { - serverSocket.write('goodbyeeeeeeeeeeeeee'); - } - await inboundMaConn.close(); - // server socket should no longer be writable - expect(serverSocket.writable).to.be.false(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // remote didn't read our data - await expect(serverErrored.promise).to.eventually.have.property('code', 'ERR_SOCKET_READ_TIMEOUT'); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); -}); -//# sourceMappingURL=socket-to-conn.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/socket-to-conn.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/socket-to-conn.spec.js.map deleted file mode 100644 index be1c043ad..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/test/socket-to-conn.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"socket-to-conn.spec.js","sourceRoot":"","sources":["../../test/socket-to-conn.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAA4D,MAAM,KAAK,CAAA;AACpG,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,KAAK,UAAU,KAAK,CAAE,IAA8D;IAClF,MAAM,eAAe,GAAG,KAAK,EAAE,CAAA;IAE/B,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACzC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE;QACpB,eAAe,CAAC,OAAO,EAAE,CAAA;IAC3B,CAAC,CAAC,CAAA;IAEF,MAAM,eAAe,CAAC,OAAO,CAAA;IAE7B,MAAM,YAAY,GAAG,KAAK,EAAU,CAAA;IACpC,MAAM,YAAY,GAAG,KAAK,EAAU,CAAA;IAEpC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE;QACnC,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAC9B,CAAC,CAA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AAE,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;QAE3C,mDAAmD;QACnD,MAAM,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QAE1D,8BAA8B;QAC9B,MAAM,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAA;QAElG,sCAAsC;QACtC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;QAEtD,6BAA6B;QAC7B,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;IAC7C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/tsconfig.tsbuildinfo deleted file mode 100644 index 5ad19c0e0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/constants.ts","../../interface/dist/src/errors.d.ts","../../../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../../../node_modules/multiformats/dist/types/src/block/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../../../node_modules/multiformats/dist/types/src/link/interface.d.ts","../../../node_modules/multiformats/dist/types/src/cid.d.ts","../../interface/dist/src/peer-id/index.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../../interface/dist/src/peer-info/index.d.ts","../../interface/dist/src/content-routing/index.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../interface/dist/src/events.d.ts","../../interface/dist/src/metrics/index.d.ts","../../interface/dist/src/peer-routing/index.d.ts","../../interface/dist/src/peer-store/index.d.ts","../../interface/dist/src/startable.d.ts","../../interface/dist/src/stream-handler/index.d.ts","../../interface/dist/src/topology/index.d.ts","../../interface/dist/src/index.d.ts","../../../node_modules/it-stream-types/dist/src/index.d.ts","../../../node_modules/uint8arraylist/dist/src/index.d.ts","../../interface/dist/src/connection/index.d.ts","../../interface/dist/src/stream-muxer/index.d.ts","../../interface/dist/src/transport/index.d.ts","../../../node_modules/@multiformats/mafmt/dist/src/index.d.ts","../../utils/dist/src/ip-port-to-multiaddr.d.ts","../src/utils.ts","../src/socket-to-conn.ts","../src/listener.ts","../src/index.ts","../../interface-compliance-tests/dist/src/index.d.ts","../../interface-compliance-tests/dist/src/transport/index.d.ts","../../logger/dist/src/index.d.ts","../../../node_modules/@types/sinonjs__fake-timers/index.d.ts","../../../node_modules/@types/sinon/index.d.ts","../test/compliance.spec.ts","../../interface/dist/src/connection-gater/index.d.ts","../../interface-compliance-tests/dist/src/mocks/connection-gater.d.ts","../../../node_modules/it-pushable/dist/src/index.d.ts","../../interface/dist/src/pubsub/index.d.ts","../../peer-collections/dist/src/map.d.ts","../../peer-collections/dist/src/set.d.ts","../../peer-collections/dist/src/list.d.ts","../../peer-collections/dist/src/index.d.ts","../../interface-internal/dist/src/connection-manager/index.d.ts","../../interface-internal/dist/src/registrar/index.d.ts","../../interface-compliance-tests/dist/src/mocks/connection-manager.d.ts","../../interface-compliance-tests/dist/src/mocks/connection.d.ts","../../interface-compliance-tests/dist/src/mocks/multiaddr-connection.d.ts","../../utils/dist/src/abstract-stream.d.ts","../../interface-compliance-tests/dist/src/mocks/muxer.d.ts","../../interface-compliance-tests/dist/src/mocks/registrar.d.ts","../../interface-compliance-tests/dist/src/mocks/upgrader.d.ts","../../interface-compliance-tests/dist/src/mocks/duplex.d.ts","../../interface-compliance-tests/dist/src/mocks/metrics.d.ts","../../interface-compliance-tests/dist/src/mocks/index.d.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/@types/chai-as-promised/index.d.ts","../../../node_modules/chai-parentheses/index.d.ts","../../../node_modules/@types/chai-subset/index.d.ts","../../../node_modules/chai-bites/index.d.ts","../../../node_modules/@types/chai-string/index.d.ts","../../../node_modules/aegir/dist/utils/chai.d.ts","../test/connection-limits.spec.ts","../test/connection.spec.ts","../test/filter.spec.ts","../../../node_modules/it-all/dist/src/index.d.ts","../../../node_modules/it-pipe/dist/src/index.d.ts","../../../node_modules/p-defer/index.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../../../node_modules/multiformats/dist/types/src/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../../../node_modules/multiformats/dist/types/src/varint.d.ts","../../../node_modules/multiformats/dist/types/src/bytes.d.ts","../../../node_modules/multiformats/dist/types/src/index.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/raw.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/json.d.ts","../../../node_modules/multiformats/dist/types/src/bases/base.d.ts","../../../node_modules/multiformats/dist/types/src/basics.d.ts","../../../node_modules/uint8arrays/dist/src/util/bases.d.ts","../../../node_modules/uint8arrays/dist/src/from-string.d.ts","../test/listen-dial.spec.ts","../test/max-connections.spec.ts","../test/socket-to-conn.spec.ts","../../../node_modules/keyv/src/index.d.ts","../../../node_modules/@types/http-cache-semantics/index.d.ts","../../../node_modules/@types/responselike/index.d.ts","../../../node_modules/@types/cacheable-request/index.d.ts","../../../node_modules/@types/ms/index.d.ts","../../../node_modules/@types/debug/index.d.ts","../../../node_modules/@types/dns-packet/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/keyv/index.d.ts","../../../node_modules/@types/linkify-it/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/lodash.random/index.d.ts","../../../node_modules/@types/lodash.range/index.d.ts","../../../node_modules/@types/mdurl/encode.d.ts","../../../node_modules/@types/mdurl/decode.d.ts","../../../node_modules/@types/mdurl/parse.d.ts","../../../node_modules/@types/mdurl/format.d.ts","../../../node_modules/@types/mdurl/index.d.ts","../../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../../node_modules/@types/markdown-it/lib/token.d.ts","../../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../../node_modules/@types/markdown-it/lib/index.d.ts","../../../node_modules/@types/markdown-it/index.d.ts","../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/mdast/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/minimist/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/multicast-dns/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/retry/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/sinon-chai/index.d.ts","../../../node_modules/@types/strip-bom/index.d.ts","../../../node_modules/@types/strip-json-comments/index.d.ts","../../../node_modules/@types/which/index.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/@types/xsalsa20/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts","../../../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"de0ba34d2384a38c30f38e87b31bd91833c69a5982ab32ec668fd7424af46849","signature":"659e694bc8a9bb4b7f9e88bb9ed5e468553bb79655be46073907782c0a230cdd"},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","4369b27ca2716a04200930b5f24fa87a6ed62d8c70f80a83270956b6b23c32ae","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"8d6138a264ddc6f94f16e99d4e117a2d6eb31b217891cf091b6437a2f114d561","affectsGlobalScope":true},"a882b74c4ba115c6e86371f3592a3accb2c50874b6fcd92a4f83d17a4d6993af","4a8722c7d7a4dac1616db1f41ad0113998ccbbbcd37af43def3fbe6b41208c83","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"0b3868d3f87c95ea73bdfab380e536843ec3573aa76233b97aac40518494ea24","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","30c2ec6abf6aaa60eb4f32fb1235531506b7961c6d1bdc7430711aec8fd85295","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"d48009cbe8a30a504031cc82e1286f78fed33b7a42abf7602c23b5547b382563","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"24ba151e213906027e2b1f5223d33575a3612b0234a0e2b56119520bbe0e594b","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","28c1fc8505da2181ee74c9fe902fac964159cfae266c4413905d50eaecea8a19","84b8cc86ad19115f2637401cdd220460a25542df478c966a5ffc5eeaf3825299",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc","176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","1bf687d978bdd6d5aff10b9eb0ff0695179f8594d4446946fd0182d6d25fa433","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","5a16be1c0b59a91ed8de2c5699b7dad5e026d0315995eb75dcdd238be68b4be5","3d0fc7bb7dd39dc9df952e0fb97874ab25fd491392a4453fa7f4e65aef307ac9",{"version":"110cfb9b1e9ee74e80ba30f09f11c2ac736d8d22f7c218bcf499d1f22cb9665f","signature":"5cf5473735a956c4a6139812db63553581775fe34d14ab097c5fcd7ca03e84f0"},{"version":"ebd480a71e66942107907a4ad6e4f1a761f0ffbbdf1fb5ef6e5a4ed85140ee81","signature":"7ca4969ce0e2c0b679f9ce44846a7a8f78f6be7c1c0199143c053fc78061d09a"},{"version":"b1c33efa61ca3b6a2af1122a4c826a20fbada9e444d5a4000d419c30865b5b9f","signature":"0d6e9983d87ca882bd160af191909bce5c1d9b22f4bcb247d914b572cbddc076"},{"version":"fb1e831d934e1434623be095caedfc37eddf0b3fa2b12c284fd3ddce3572a44a","signature":"590815e7bd28778a71732b03b4852917e18bf42670cc1931e4f95ebe99157838"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","1dd1851e9ff4cfabdaa0aabb8db2b47de6b83aeda8413b7b09be3fc47654da49","cb4b40f34fe4b1d87c530a0f3c2c1e043e338829fab8cf5cbd92a91c8c1374b8","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2",{"version":"5b9845922dbc80d6b991193a227ab78001c9fb3ba2ae2c0fe4745f1e504c97de","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"7f2cc72a16a663ab9f8d99bd5658e583251ce0c003bf80a948973e15a7ef9596","f6e125b70d7118004733e6856a90163bbeb01a4633316fc2a2aaccbfca6ded6f","fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","03e385ae2125c9aa9dead008b42a0ab20d0812c26c19ee210d84c2666113f867","83a1426ac1a9cf144141dfe10d71a68629623a7c28245c9ca0e0352bead501fd","2726c0a6a4a87fad11e6846e6b0b40b8924fbe66340adc512093c4273bc53e4e","c888daaa99fdf6c5712d98605fdcf21cbbaab756a629661a44cac44ede464d37","e044f60686dc70015a3b7e7c64ad0ac5ec5ec101a0aede0782ec077e136b6a65","a232f867897bbecfebf68df575a417af1afd9b5dd3d83fb4d59e0a133a0de93d","228dbc8825b7a45af7d416dee95c0a2162d7cf73ffddfd52357b7e548882bdaa","46507ca157c8093e9b90b1c62be468ccb4aa693eaacae464b3935f6f24ccc9ff","af9a54fd33c9b0b2c05e433a71994ae07b75a3c4adbe82bdf6de863ce0f0e340","818068f6c587f5540e5cdc7b0f2ea6c04a0b9fe11745ca60f031bf349c17ba5c","75e0c62536016dac8cc0d825742ff7cc4c0455ebc86923e47edcc19edac0997c","d5840c8f2acfef007839d4e252ad45bf87219021c81de7de5cc98646f5d99d0d","f2601f76cd8ebb45e274730c33b44897fdea4bc742cb83fd98586754f08a3398","054dda98b75dec317926dddfb103939b99cccfc8ade63d7e6a2ef2f3343d37f9","a3f9f52ce73700565c8d9ba2aa75823ab8fc8e7258a27ecb828cd4257b8f918d","ad3490364b6442ca8694fc6cd364b63a5d807651a514837cc22ef29df624bb9d","4b5603a1ccca455500cfb39517d41ec011f31ba84bb6de44473344a237d89168",{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d",{"version":"4983ba4cc9c6d768887bfe5fd618ff2954bb68206282fa4a29e7eb4d0c1df478","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"1545b3a3656685251aa8b56ae4e8ecbbd4df62284dc2874e1e5ee7bb1d6f80ff","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"2a5f80090adbdc4a135707e558af382310da2c7051c88a1c9e639577a08946e6","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"5ccc3c7f73ef48c223635cd4506f21133560de7abc4c09c623327bb1b54386dc","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6","acd5d501223e3a7cdd229b501fce5fb071937b72bd05fa33e543eb21c8ee0aba","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","88de5467cd5e4c2c1384629806d56ac1215657bddf39ef9f60a0e05beee2b131","ff5820394809bfc32a7e4586ff11b3c07327a0f4c756709aef92f1cd73d6da48","bfe2af20f3ff0579331661ef4c5d2597e0c31a7a0d760e41eaff0502bf064c4d","f52a0e53f79d7fd1c1c55a3cbda59499d4cce75f3188969024cdc286b29ad3ea","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f",{"version":"2a9a98f0db379de58db189447b3c83fb4bcf617d837690a4f69c93dd5de62f9c","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"74ed4845b57c014f3d1642ba796be1d7c2afac634325949d242d764cb2b9e6e9","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"2827c4a7415fc665be3289cfefac6a0dc9c48135bc0b63bbcc2f05d27519e134","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","5bfd23a4c8765d347e296639b75f50f4dfca445d2eb41ea0892e68b8976a0cdf","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","b8442e9db28157344d1bc5d8a5a256f1692de213f0c0ddeb84359834015a008c","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","da2b6356b84a40111aaecb18304ea4e4fcb43d70efb1c13ca7d7a906445ee0d3","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","6f294731b495c65ecf46a5694f0082954b961cf05463bea823f8014098eaffa0","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","68a0d0c508e1b6d8d23a519a8a0a3303dc5baa4849ca049f21e5bad41945e3fc","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","b03afe4bec768ae333582915146f48b161e567a81b5ebc31c4d78af089770ac9","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","4f6a12044ee6f458db11964153830abbc499e73d065c51c329ec97407f4b13dd","13e834b958fe7e9010d2161497f98916974a0618be7a773281a253a948da8b0d","dae5c8e0ca15779492744cb4071c5b3c94c2121940fbaefb43ca9a045557a0c9","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"62a8effc4dd17bbc2c05927b4ca5f67e73fdb458e203b128c041d0d70ffa6b55","22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a",{"version":"525b52b38b44420fb1758c0917e7b67cf379f7f9477d2ba7343f3d5f50a44258","affectsGlobalScope":true},"4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","dc5fa6012f710446a9ed04156d986bd81d9119c93ecb63d85c6a9d493264b5dc","f7163a5d37d21f636f6a5cd1c064ce95fada21917859a64b6cc49a8b6fd5c1a8","5aac5efd20619b522faeeb0badf250834850c605ad8c5fb91c6502a54057f413","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[61,[176,179],185,[213,215],[232,234]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[71,153],[69,70,153],[123,126,152,153,160,235,236,237],[153,206],[153],[153,239],[153,160],[123,153,160],[153,259],[153,247,249,250,251,252,253,254,255,256,257,258,259],[153,247,248,250,251,252,253,254,255,256,257,258,259],[153,248,249,250,251,252,253,254,255,256,257,258,259],[153,247,248,249,251,252,253,254,255,256,257,258,259],[153,247,248,249,250,252,253,254,255,256,257,258,259],[153,247,248,249,250,251,253,254,255,256,257,258,259],[153,247,248,249,250,251,252,254,255,256,257,258,259],[153,247,248,249,250,251,252,253,255,256,257,258,259],[153,247,248,249,250,251,252,253,254,256,257,258,259],[153,247,248,249,250,251,252,253,254,255,257,258,259],[153,247,248,249,250,251,252,253,254,255,256,258,259],[153,247,248,249,250,251,252,253,254,255,256,257,259],[153,247,248,249,250,251,252,253,254,255,256,257,258],[153,281],[153,266],[153,270,271,272],[153,269],[153,271],[153,246,267,268,273,276,278,279,280],[153,268,274,275,281],[153,274,277],[153,268,269,274,281],[153,268,281],[153,283],[153,262,263,264,265],[117,123,153,160,241],[74,153],[110,153],[111,116,144,153],[112,123,124,131,141,152,153],[112,113,123,131,153],[114,153],[115,116,124,132,153],[116,141,149,153],[117,119,123,131,153],[118,153],[119,120,153],[123,153],[121,123,153],[110,123,153],[123,124,125,141,152,153],[123,124,125,138,141,144,153],[108,153,157],[119,123,126,131,141,152,153],[123,124,126,127,131,141,149,152,153],[126,128,141,149,152,153],[74,75,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159],[123,129,153],[130,152,153,157],[119,123,131,141,153],[132,153],[133,153],[110,134,153],[135,151,153,157],[136,153],[137,153],[123,138,139,153],[138,140,153,155],[111,123,141,142,143,144,153],[111,141,143,153],[141,142,153],[144,153],[145,153],[110,141,153],[123,147,148,153],[147,148,153],[116,131,141,149,153],[150,153],[131,151,153],[111,126,137,152,153],[116,153],[141,153,154],[130,153,155],[153,156],[111,116,123,125,134,141,152,153,155,157],[141,153,158],[126,141,153,160],[153,292,331],[153,292,316,331],[153,331],[153,292],[153,292,317,331],[153,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330],[153,317,331],[153,184,206],[153,183],[123,126,128,141,149,152,153,158,160],[153,338],[123,141,153,160],[153,206,207,208,209,210,211],[153,206,207],[153,169],[63,153],[153,225,226,227,228],[66,67,153],[66,153],[64,153],[153,219],[65,153],[65,153,221],[67,153,220,221,222,223,224],[63,64,65,66,153,219],[63,64,65,153],[153,230],[153,225,229],[85,89,152,153],[85,141,152,153],[80,153],[82,85,149,152,153],[131,149,153],[80,153,160],[82,85,131,152,153],[77,78,81,84,111,123,141,152,153],[77,83,153],[81,85,111,144,152,153,160],[111,153,160],[101,111,153,160],[79,80,153,160],[85,153],[79,80,81,82,83,84,85,86,87,89,90,91,92,93,94,95,96,97,98,99,100,102,103,104,105,106,107,153],[85,92,93,153],[83,85,93,94,153],[84,153],[77,80,85,153],[85,89,93,94,153],[89,153],[83,85,88,152,153],[77,82,83,85,89,92,153],[111,141,153],[80,85,101,111,153,157,160],[153,186],[68,71,153,161,168,189,194,195],[68,153,168,169,170,171,172,195],[153,169,170],[153,187,196,197,198,200,201,202,203,204],[153,162],[68,71,153,169,170,171],[153,171,172,188,199],[68,153,167,171,195],[153,161,168,173,195],[71,153,173,180],[68,71,153,168,171,193],[153,167,171],[68,71,153,171],[68,71,153,168,169,170],[67,72,153,168],[68,71,72,73,153,161,162,163,164,165,166,167,171,173],[153,171],[65,67,153],[68,71,153],[68,72,153,168],[68,153,161,170,171,188],[153,168,169,170,171],[68,153,171],[71,153,161,168,171,172],[68,153],[153,190,191,192],[61,62,71,131,153,162,168,171,173,174,176,177,178],[61,62,71,131,153,161,162,168,171,173,176,177,179],[61,62,71,131,153,162,168,171,175,176],[71,131,132,133,153],[71,131,153,179,181,182,184],[71,131,153,161,178,179,182,205,212],[71,153,161,171,173,179,182,205,212],[71,153,173,179,182,212],[71,132,133,153,161,171,173,179,182,205,212,216,217,218,231],[71,131,153,161,179,182,205,212],[131,132,153,177,182,212,218],[153,168,169,170,171,182],[71,162,168,173,178],[71,161,162,168,171,173,179],[71,131,162,168,171],[71,131]],"referencedMap":[[174,1],[70,1],[71,2],[69,1],[238,3],[207,4],[211,4],[209,4],[206,5],[240,6],[241,7],[236,5],[242,5],[243,5],[244,5],[245,8],[246,5],[260,9],[261,9],[248,10],[249,11],[247,12],[250,13],[251,14],[252,15],[253,16],[254,17],[255,18],[256,19],[257,20],[258,21],[259,22],[282,23],[267,24],[273,25],[271,5],[270,26],[272,27],[281,28],[276,29],[278,30],[279,31],[280,32],[274,5],[275,32],[277,32],[269,32],[268,5],[284,33],[263,5],[262,5],[265,24],[266,34],[264,24],[285,5],[286,5],[287,5],[239,5],[288,35],[74,36],[75,36],[110,37],[111,38],[112,39],[113,40],[114,41],[115,42],[116,43],[117,44],[118,45],[119,46],[120,46],[122,47],[121,48],[123,49],[124,50],[125,51],[109,52],[159,5],[126,53],[127,54],[128,55],[160,56],[129,57],[130,58],[131,59],[132,60],[133,61],[134,62],[135,63],[136,64],[137,65],[138,66],[139,66],[140,67],[141,68],[143,69],[142,70],[144,71],[145,72],[146,73],[147,74],[148,75],[149,76],[150,77],[151,78],[152,79],[153,80],[154,81],[155,82],[156,83],[157,84],[158,85],[289,5],[290,5],[237,86],[291,5],[316,87],[317,88],[292,89],[295,89],[314,87],[315,87],[305,87],[304,90],[302,87],[297,87],[310,87],[308,87],[312,87],[296,87],[309,87],[313,87],[298,87],[299,87],[311,87],[293,87],[300,87],[301,87],[303,87],[307,87],[318,91],[306,87],[294,87],[331,92],[330,5],[325,91],[327,93],[326,91],[319,91],[320,91],[322,91],[324,91],[328,93],[329,93],[321,93],[323,93],[332,94],[184,95],[183,5],[333,5],[334,5],[283,5],[335,5],[336,96],[337,7],[338,5],[339,97],[340,98],[212,99],[76,5],[210,4],[208,100],[216,5],[217,101],[188,5],[169,5],[235,47],[228,102],[63,5],[229,103],[64,104],[224,5],[67,105],[219,106],[227,107],[226,107],[221,108],[222,109],[65,5],[225,110],[220,111],[66,112],[223,5],[218,5],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[170,5],[231,113],[230,114],[92,115],[99,116],[91,115],[106,117],[83,118],[82,119],[105,7],[100,120],[103,121],[85,122],[84,123],[80,124],[79,125],[102,126],[81,127],[86,128],[87,5],[90,128],[77,5],[108,129],[107,128],[94,130],[95,131],[97,132],[93,133],[96,134],[101,7],[88,135],[89,136],[98,137],[78,138],[104,139],[180,5],[187,140],[196,141],[197,142],[203,143],[205,144],[204,145],[198,146],[200,147],[201,148],[202,149],[181,150],[194,151],[195,152],[186,153],[171,154],[73,155],[62,5],[161,8],[168,156],[162,157],[68,158],[72,159],[163,160],[164,159],[189,161],[165,5],[166,157],[172,162],[167,163],[173,164],[182,165],[193,166],[192,165],[190,165],[191,165],[61,5],[179,167],[178,168],[177,169],[176,170],[185,171],[213,172],[214,173],[215,174],[232,175],[233,176],[234,177],[199,178],[175,1]],"exportedModulesMap":[[174,1],[70,1],[71,2],[69,1],[238,3],[207,4],[211,4],[209,4],[206,5],[240,6],[241,7],[236,5],[242,5],[243,5],[244,5],[245,8],[246,5],[260,9],[261,9],[248,10],[249,11],[247,12],[250,13],[251,14],[252,15],[253,16],[254,17],[255,18],[256,19],[257,20],[258,21],[259,22],[282,23],[267,24],[273,25],[271,5],[270,26],[272,27],[281,28],[276,29],[278,30],[279,31],[280,32],[274,5],[275,32],[277,32],[269,32],[268,5],[284,33],[263,5],[262,5],[265,24],[266,34],[264,24],[285,5],[286,5],[287,5],[239,5],[288,35],[74,36],[75,36],[110,37],[111,38],[112,39],[113,40],[114,41],[115,42],[116,43],[117,44],[118,45],[119,46],[120,46],[122,47],[121,48],[123,49],[124,50],[125,51],[109,52],[159,5],[126,53],[127,54],[128,55],[160,56],[129,57],[130,58],[131,59],[132,60],[133,61],[134,62],[135,63],[136,64],[137,65],[138,66],[139,66],[140,67],[141,68],[143,69],[142,70],[144,71],[145,72],[146,73],[147,74],[148,75],[149,76],[150,77],[151,78],[152,79],[153,80],[154,81],[155,82],[156,83],[157,84],[158,85],[289,5],[290,5],[237,86],[291,5],[316,87],[317,88],[292,89],[295,89],[314,87],[315,87],[305,87],[304,90],[302,87],[297,87],[310,87],[308,87],[312,87],[296,87],[309,87],[313,87],[298,87],[299,87],[311,87],[293,87],[300,87],[301,87],[303,87],[307,87],[318,91],[306,87],[294,87],[331,92],[330,5],[325,91],[327,93],[326,91],[319,91],[320,91],[322,91],[324,91],[328,93],[329,93],[321,93],[323,93],[332,94],[184,95],[183,5],[333,5],[334,5],[283,5],[335,5],[336,96],[337,7],[338,5],[339,97],[340,98],[212,99],[76,5],[210,4],[208,100],[216,5],[217,101],[188,5],[169,5],[235,47],[228,102],[63,5],[229,103],[64,104],[224,5],[67,105],[219,106],[227,107],[226,107],[221,108],[222,109],[65,5],[225,110],[220,111],[66,112],[223,5],[218,5],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[170,5],[231,113],[230,114],[92,115],[99,116],[91,115],[106,117],[83,118],[82,119],[105,7],[100,120],[103,121],[85,122],[84,123],[80,124],[79,125],[102,126],[81,127],[86,128],[87,5],[90,128],[77,5],[108,129],[107,128],[94,130],[95,131],[97,132],[93,133],[96,134],[101,7],[88,135],[89,136],[98,137],[78,138],[104,139],[180,5],[187,140],[196,141],[197,142],[203,143],[205,144],[204,145],[198,146],[200,147],[201,148],[202,149],[181,150],[194,151],[195,152],[186,153],[171,154],[73,155],[62,5],[161,8],[168,156],[162,157],[68,158],[72,159],[163,160],[164,159],[189,161],[165,5],[166,157],[172,162],[167,163],[173,164],[182,165],[193,166],[192,165],[190,165],[191,165],[179,179],[178,180],[177,181],[176,182],[199,178],[175,1]],"semanticDiagnosticsPerFile":[174,70,71,69,238,207,211,209,206,240,241,236,242,243,244,245,246,260,261,248,249,247,250,251,252,253,254,255,256,257,258,259,282,267,273,271,270,272,281,276,278,279,280,274,275,277,269,268,284,263,262,265,266,264,285,286,287,239,288,74,75,110,111,112,113,114,115,116,117,118,119,120,122,121,123,124,125,109,159,126,127,128,160,129,130,131,132,133,134,135,136,137,138,139,140,141,143,142,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,289,290,237,291,316,317,292,295,314,315,305,304,302,297,310,308,312,296,309,313,298,299,311,293,300,301,303,307,318,306,294,331,330,325,327,326,319,320,322,324,328,329,321,323,332,184,183,333,334,283,335,336,337,338,339,340,212,76,210,208,216,217,188,169,235,228,63,229,64,224,67,219,227,226,221,222,65,225,220,66,223,218,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,170,231,230,92,99,91,106,83,82,105,100,103,85,84,80,79,102,81,86,87,90,77,108,107,94,95,97,93,96,101,88,89,98,78,104,180,187,196,197,203,205,204,198,200,201,202,181,194,195,186,171,73,62,161,168,162,68,72,163,164,189,165,166,172,167,173,182,193,192,190,191,61,179,178,177,176,185,213,214,215,232,233,234,199,175],"latestChangedDtsFile":"./test/socket-to-conn.spec.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/package.json deleted file mode 100644 index b39367234..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "@libp2p/tcp", - "version": "8.0.13", - "description": "A TCP transport for libp2p", - "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-tcp#readme", - "repository": { - "type": "git", - "url": "git+https://github.com/libp2p/js-libp2p.git" - }, - "bugs": { - "url": "https://github.com/libp2p/js-libp2p/issues" - }, - "keywords": [ - "IPFS", - "TCP", - "libp2p", - "network", - "p2p", - "peer", - "peer-to-peer" - ], - "type": "module", - "types": "./dist/src/index.d.ts", - "files": [ - "src", - "dist", - "!dist/test", - "!**/*.tsbuildinfo" - ], - "exports": { - ".": { - "types": "./dist/src/index.d.ts", - "import": "./dist/src/index.js" - } - }, - "eslintConfig": { - "extends": "ipfs", - "parserOptions": { - "project": true, - "sourceType": "module" - } - }, - "scripts": { - "clean": "aegir clean", - "lint": "aegir lint", - "dep-check": "aegir dep-check", - "build": "aegir build", - "test": "aegir test -t node -t electron-main", - "test:node": "aegir test -t node --cov", - "test:electron-main": "aegir test -t electron-main" - }, - "dependencies": { - "@libp2p/interface": "^0.1.6", - "@libp2p/utils": "^4.0.7", - "@multiformats/mafmt": "^12.1.6", - "@multiformats/multiaddr": "^12.1.10", - "@types/sinon": "^17.0.0", - "stream-to-it": "^0.2.2" - }, - "devDependencies": { - "@libp2p/interface-compliance-tests": "^4.1.5", - "@libp2p/logger": "^3.1.0", - "aegir": "^41.0.2", - "it-all": "^3.0.3", - "it-pipe": "^3.0.1", - "p-defer": "^4.0.0", - "sinon": "^17.0.0", - "uint8arrays": "^4.0.6" - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/src/constants.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/src/constants.ts deleted file mode 100644 index 650150074..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/src/constants.ts +++ /dev/null @@ -1,10 +0,0 @@ -// p2p multi-address code -export const CODE_P2P = 421 -export const CODE_CIRCUIT = 290 -export const CODE_UNIX = 400 - -// Time to wait for a connection to close gracefully before destroying it manually -export const CLOSE_TIMEOUT = 500 - -// Close the socket if there is no activity after this long in ms -export const SOCKET_TIMEOUT = 5 * 60000 // 5 mins diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/src/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/src/index.ts deleted file mode 100644 index 108c97441..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/src/index.ts +++ /dev/null @@ -1,341 +0,0 @@ -/** - * @packageDocumentation - * - * A [libp2p transport](https://docs.libp2p.io/concepts/transports/overview/) based on the TCP networking stack. - * - * @example - * - * ```js - * import { tcp } from '@libp2p/tcp' - * import { multiaddr } from '@multiformats/multiaddr' - * import { pipe } from 'it-pipe' - * import all from 'it-all' - * - * // A simple upgrader that just returns the MultiaddrConnection - * const upgrader = { - * upgradeInbound: async maConn => maConn, - * upgradeOutbound: async maConn => maConn - * } - * - * const transport = tcp()() - * - * const listener = transport.createListener({ - * upgrader, - * handler: (socket) => { - * console.this.log('new connection opened') - * pipe( - * ['hello', ' ', 'World!'], - * socket - * ) - * } - * }) - * - * const addr = multiaddr('/ip4/127.0.0.1/tcp/9090') - * await listener.listen(addr) - * console.this.log('listening') - * - * const socket = await transport.dial(addr, { upgrader }) - * const values = await pipe( - * socket, - * all - * ) - * console.this.log(`Value: ${values.toString()}`) - * - * // Close connection after reading - * await listener.close() - * ``` - * - * Outputs: - * - * ```sh - * listening - * new connection opened - * Value: hello World! - * ``` - */ - -import net from 'net' -import { AbortError, CodeError } from '@libp2p/interface/errors' -import { type CreateListenerOptions, type DialOptions, symbol, type Transport, type Listener } from '@libp2p/interface/transport' -import * as mafmt from '@multiformats/mafmt' -import { CODE_CIRCUIT, CODE_P2P, CODE_UNIX } from './constants.js' -import { type CloseServerOnMaxConnectionsOpts, TCPListener } from './listener.js' -import { toMultiaddrConnection } from './socket-to-conn.js' -import { multiaddrToNetConfig } from './utils.js' -import type { ComponentLogger, Logger } from '@libp2p/interface' -import type { Connection } from '@libp2p/interface/connection' -import type { CounterGroup, Metrics } from '@libp2p/interface/metrics' -import type { AbortOptions, Multiaddr } from '@multiformats/multiaddr' -import type { Socket, IpcSocketConnectOpts, TcpSocketConnectOpts } from 'net' - -export interface TCPOptions { - /** - * An optional number in ms that is used as an inactivity timeout after which the socket will be closed - */ - inboundSocketInactivityTimeout?: number - - /** - * An optional number in ms that is used as an inactivity timeout after which the socket will be closed - */ - outboundSocketInactivityTimeout?: number - - /** - * When closing a socket, wait this long for it to close gracefully before it is closed more forcibly - */ - socketCloseTimeout?: number - - /** - * Set this property to reject connections when the server's connection count gets high. - * https://nodejs.org/api/net.html#servermaxconnections - */ - maxConnections?: number - - /** - * Parameter to specify the maximum length of the queue of pending connections - * https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - backlog?: number - - /** - * Close server (stop listening for new connections) if connections exceed a limit. - * Open server (start listening for new connections) if connections fall below a limit. - */ - closeServerOnMaxConnections?: CloseServerOnMaxConnectionsOpts - - /** - * Options passed to `net.connect` for every opened TCP socket - */ - dialOpts?: TCPSocketOptions - - /** - * Options passed to every `net.createServer` for every TCP server - */ - listenOpts?: TCPSocketOptions -} - -/** - * Expose a subset of net.connect options - */ -export interface TCPSocketOptions extends AbortOptions { - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - noDelay?: boolean - - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - keepAlive?: boolean - - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - keepAliveInitialDelay?: number - - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#new-netsocketoptions - */ - allowHalfOpen?: boolean -} - -export interface TCPDialOptions extends DialOptions, TCPSocketOptions { - -} - -export interface TCPCreateListenerOptions extends CreateListenerOptions, TCPSocketOptions { - -} - -export interface TCPComponents { - metrics?: Metrics - logger: ComponentLogger -} - -export interface TCPMetrics { - dialerEvents: CounterGroup -} - -class TCP implements Transport { - private readonly opts: TCPOptions - private readonly metrics?: TCPMetrics - private readonly components: TCPComponents - private readonly log: Logger - - constructor (components: TCPComponents, options: TCPOptions = {}) { - this.log = components.logger.forComponent('libp2p:tcp') - this.opts = options - this.components = components - - if (components.metrics != null) { - this.metrics = { - dialerEvents: components.metrics.registerCounterGroup('libp2p_tcp_dialer_events_total', { - label: 'event', - help: 'Total count of TCP dialer events by type' - }) - } - } - } - - readonly [symbol] = true - - readonly [Symbol.toStringTag] = '@libp2p/tcp' - - async dial (ma: Multiaddr, options: TCPDialOptions): Promise { - options.keepAlive = options.keepAlive ?? true - options.noDelay = options.noDelay ?? true - - // options.signal destroys the socket before 'connect' event - const socket = await this._connect(ma, options) - - // Avoid uncaught errors caused by unstable connections - socket.on('error', err => { - this.log('socket error', err) - }) - - const maConn = toMultiaddrConnection(socket, { - remoteAddr: ma, - socketInactivityTimeout: this.opts.outboundSocketInactivityTimeout, - socketCloseTimeout: this.opts.socketCloseTimeout, - metrics: this.metrics?.dialerEvents, - logger: this.components.logger - }) - - const onAbort = (): void => { - maConn.close().catch(err => { - this.log.error('Error closing maConn after abort', err) - }) - } - options.signal?.addEventListener('abort', onAbort, { once: true }) - - this.log('new outbound connection %s', maConn.remoteAddr) - const conn = await options.upgrader.upgradeOutbound(maConn) - this.log('outbound connection %s upgraded', maConn.remoteAddr) - - options.signal?.removeEventListener('abort', onAbort) - - if (options.signal?.aborted === true) { - conn.close().catch(err => { - this.log.error('Error closing conn after abort', err) - }) - - throw new AbortError() - } - - return conn - } - - async _connect (ma: Multiaddr, options: TCPDialOptions): Promise { - if (options.signal?.aborted === true) { - throw new AbortError() - } - - return new Promise((resolve, reject) => { - const start = Date.now() - const cOpts = multiaddrToNetConfig(ma, { - ...(this.opts.dialOpts ?? {}), - ...options - }) as (IpcSocketConnectOpts & TcpSocketConnectOpts) - - this.log('dialing %a', ma) - const rawSocket = net.connect(cOpts) - - const onError = (err: Error): void => { - const cOptsStr = cOpts.path ?? `${cOpts.host ?? ''}:${cOpts.port}` - err.message = `connection error ${cOptsStr}: ${err.message}` - this.metrics?.dialerEvents.increment({ error: true }) - - done(err) - } - - const onTimeout = (): void => { - this.log('connection timeout %a', ma) - this.metrics?.dialerEvents.increment({ timeout: true }) - - const err = new CodeError(`connection timeout after ${Date.now() - start}ms`, 'ERR_CONNECT_TIMEOUT') - // Note: this will result in onError() being called - rawSocket.emit('error', err) - } - - const onConnect = (): void => { - this.log('connection opened %a', ma) - this.metrics?.dialerEvents.increment({ connect: true }) - done() - } - - const onAbort = (): void => { - this.log('connection aborted %a', ma) - this.metrics?.dialerEvents.increment({ abort: true }) - rawSocket.destroy() - done(new AbortError()) - } - - const done = (err?: any): void => { - rawSocket.removeListener('error', onError) - rawSocket.removeListener('timeout', onTimeout) - rawSocket.removeListener('connect', onConnect) - - if (options.signal != null) { - options.signal.removeEventListener('abort', onAbort) - } - - if (err != null) { - reject(err); return - } - - resolve(rawSocket) - } - - rawSocket.on('error', onError) - rawSocket.on('timeout', onTimeout) - rawSocket.on('connect', onConnect) - - if (options.signal != null) { - options.signal.addEventListener('abort', onAbort) - } - }) - } - - /** - * Creates a TCP listener. The provided `handler` function will be called - * anytime a new incoming Connection has been successfully upgraded via - * `upgrader.upgradeInbound`. - */ - createListener (options: TCPCreateListenerOptions): Listener { - return new TCPListener({ - ...(this.opts.listenOpts ?? {}), - ...options, - maxConnections: this.opts.maxConnections, - backlog: this.opts.backlog, - closeServerOnMaxConnections: this.opts.closeServerOnMaxConnections, - socketInactivityTimeout: this.opts.inboundSocketInactivityTimeout, - socketCloseTimeout: this.opts.socketCloseTimeout, - metrics: this.components.metrics, - logger: this.components.logger - }) - } - - /** - * Takes a list of `Multiaddr`s and returns only valid TCP addresses - */ - filter (multiaddrs: Multiaddr[]): Multiaddr[] { - multiaddrs = Array.isArray(multiaddrs) ? multiaddrs : [multiaddrs] - - return multiaddrs.filter(ma => { - if (ma.protoCodes().includes(CODE_CIRCUIT)) { - return false - } - - if (ma.protoCodes().includes(CODE_UNIX)) { - return true - } - - return mafmt.TCP.matches(ma.decapsulateCode(CODE_P2P)) - }) - } -} - -export function tcp (init: TCPOptions = {}): (components: TCPComponents) => Transport { - return (components: TCPComponents) => { - return new TCP(components, init) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/src/listener.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/src/listener.ts deleted file mode 100644 index 40ffcaf87..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/src/listener.ts +++ /dev/null @@ -1,381 +0,0 @@ -import net from 'net' -import { CodeError } from '@libp2p/interface/errors' -import { TypedEventEmitter, CustomEvent } from '@libp2p/interface/events' -import { CODE_P2P } from './constants.js' -import { toMultiaddrConnection } from './socket-to-conn.js' -import { - getMultiaddrs, - multiaddrToNetConfig, - type NetConfig -} from './utils.js' -import type { TCPCreateListenerOptions } from './index.js' -import type { ComponentLogger, Logger, LoggerOptions } from '@libp2p/interface' -import type { MultiaddrConnection, Connection } from '@libp2p/interface/connection' -import type { CounterGroup, MetricGroup, Metrics } from '@libp2p/interface/metrics' -import type { Listener, ListenerEvents, Upgrader } from '@libp2p/interface/transport' -import type { Multiaddr } from '@multiformats/multiaddr' - -/** - * Attempts to close the given maConn. If a failure occurs, it will be logged - */ -async function attemptClose (maConn: MultiaddrConnection, options: LoggerOptions): Promise { - try { - await maConn.close() - } catch (err) { - options.log.error('an error occurred closing the connection', err) - } -} - -export interface CloseServerOnMaxConnectionsOpts { - /** Server listens once connection count is less than `listenBelow` */ - listenBelow: number - /** Close server once connection count is greater than or equal to `closeAbove` */ - closeAbove: number - onListenError?(err: Error): void -} - -interface Context extends TCPCreateListenerOptions { - handler?(conn: Connection): void - upgrader: Upgrader - socketInactivityTimeout?: number - socketCloseTimeout?: number - maxConnections?: number - backlog?: number - metrics?: Metrics - closeServerOnMaxConnections?: CloseServerOnMaxConnectionsOpts - logger: ComponentLogger -} - -export interface TCPListenerMetrics { - status: MetricGroup - errors: CounterGroup - events: CounterGroup -} - -enum TCPListenerStatusCode { - /** - * When server object is initialized but we don't know the listening address yet or - * the server object is stopped manually, can be resumed only by calling listen() - **/ - INACTIVE = 0, - ACTIVE = 1, - /* During the connection limits */ - PAUSED = 2, -} - -type Status = { code: TCPListenerStatusCode.INACTIVE } | { - code: Exclude - listeningAddr: Multiaddr - peerId: string | null - netConfig: NetConfig -} - -export class TCPListener extends TypedEventEmitter implements Listener { - private readonly server: net.Server - /** Keep track of open connections to destroy in case of timeout */ - private readonly connections = new Set() - private status: Status = { code: TCPListenerStatusCode.INACTIVE } - private metrics?: TCPListenerMetrics - private addr: string - private readonly log: Logger - - constructor (private readonly context: Context) { - super() - - context.keepAlive = context.keepAlive ?? true - context.noDelay = context.noDelay ?? true - - this.log = context.logger.forComponent('libp2p:tcp:listener') - this.addr = 'unknown' - this.server = net.createServer(context, this.onSocket.bind(this)) - - // https://nodejs.org/api/net.html#servermaxconnections - // If set reject connections when the server's connection count gets high - // Useful to prevent too resource exhaustion via many open connections on high bursts of activity - if (context.maxConnections !== undefined) { - this.server.maxConnections = context.maxConnections - } - - if (context.closeServerOnMaxConnections != null) { - // Sanity check options - if (context.closeServerOnMaxConnections.closeAbove < context.closeServerOnMaxConnections.listenBelow) { - throw new CodeError('closeAbove must be >= listenBelow', 'ERROR_CONNECTION_LIMITS') - } - } - - this.server - .on('listening', () => { - if (context.metrics != null) { - // we are listening, register metrics for our port - const address = this.server.address() - - if (address == null) { - this.addr = 'unknown' - } else if (typeof address === 'string') { - // unix socket - this.addr = address - } else { - this.addr = `${address.address}:${address.port}` - } - - context.metrics?.registerMetricGroup('libp2p_tcp_inbound_connections_total', { - label: 'address', - help: 'Current active connections in TCP listener', - calculate: () => { - return { - [this.addr]: this.connections.size - } - } - }) - - this.metrics = { - status: context.metrics.registerMetricGroup('libp2p_tcp_listener_status_info', { - label: 'address', - help: 'Current status of the TCP listener socket' - }), - errors: context.metrics.registerMetricGroup('libp2p_tcp_listener_errors_total', { - label: 'address', - help: 'Total count of TCP listener errors by type' - }), - events: context.metrics.registerMetricGroup('libp2p_tcp_listener_events_total', { - label: 'address', - help: 'Total count of TCP listener events by type' - }) - } - - this.metrics?.status.update({ - [this.addr]: TCPListenerStatusCode.ACTIVE - }) - } - - this.dispatchEvent(new CustomEvent('listening')) - }) - .on('error', err => { - this.metrics?.errors.increment({ [`${this.addr} listen_error`]: true }) - this.dispatchEvent(new CustomEvent('error', { detail: err })) - }) - .on('close', () => { - this.metrics?.status.update({ - [this.addr]: this.status.code - }) - - // If this event is emitted, the transport manager will remove the listener from it's cache - // in the meanwhile if the connections are dropped then listener will start listening again - // and the transport manager will not be able to close the server - if (this.status.code !== TCPListenerStatusCode.PAUSED) { - this.dispatchEvent(new CustomEvent('close')) - } - }) - } - - private onSocket (socket: net.Socket): void { - if (this.status.code !== TCPListenerStatusCode.ACTIVE) { - throw new CodeError('Server is is not listening yet', 'ERR_SERVER_NOT_RUNNING') - } - // Avoid uncaught errors caused by unstable connections - socket.on('error', err => { - this.log('socket error', err) - this.metrics?.events.increment({ [`${this.addr} error`]: true }) - }) - - let maConn: MultiaddrConnection - try { - maConn = toMultiaddrConnection(socket, { - listeningAddr: this.status.listeningAddr, - socketInactivityTimeout: this.context.socketInactivityTimeout, - socketCloseTimeout: this.context.socketCloseTimeout, - metrics: this.metrics?.events, - metricPrefix: `${this.addr} `, - logger: this.context.logger - }) - } catch (err) { - this.log.error('inbound connection failed', err) - this.metrics?.errors.increment({ [`${this.addr} inbound_to_connection`]: true }) - return - } - - this.log('new inbound connection %s', maConn.remoteAddr) - try { - this.context.upgrader.upgradeInbound(maConn) - .then((conn) => { - this.log('inbound connection upgraded %s', maConn.remoteAddr) - this.connections.add(maConn) - - socket.once('close', () => { - this.connections.delete(maConn) - - if ( - this.context.closeServerOnMaxConnections != null && - this.connections.size < this.context.closeServerOnMaxConnections.listenBelow - ) { - // The most likely case of error is if the port taken by this application is binded by - // another process during the time the server if closed. In that case there's not much - // we can do. resume() will be called again every time a connection is dropped, which - // acts as an eventual retry mechanism. onListenError allows the consumer act on this. - this.resume().catch(e => { - this.log.error('error attempting to listen server once connection count under limit', e) - this.context.closeServerOnMaxConnections?.onListenError?.(e as Error) - }) - } - }) - - if (this.context.handler != null) { - this.context.handler(conn) - } - - if ( - this.context.closeServerOnMaxConnections != null && - this.connections.size >= this.context.closeServerOnMaxConnections.closeAbove - ) { - this.pause(false).catch(e => { - this.log.error('error attempting to close server once connection count over limit', e) - }) - } - - this.dispatchEvent(new CustomEvent('connection', { detail: conn })) - }) - .catch(async err => { - this.log.error('inbound connection failed', err) - this.metrics?.errors.increment({ [`${this.addr} inbound_upgrade`]: true }) - - await attemptClose(maConn, { - log: this.log - }) - }) - .catch(err => { - this.log.error('closing inbound connection failed', err) - }) - } catch (err) { - this.log.error('inbound connection failed', err) - - attemptClose(maConn, { - log: this.log - }) - .catch(err => { - this.log.error('closing inbound connection failed', err) - this.metrics?.errors.increment({ [`${this.addr} inbound_closing_failed`]: true }) - }) - } - } - - getAddrs (): Multiaddr[] { - if (this.status.code === TCPListenerStatusCode.INACTIVE) { - return [] - } - - let addrs: Multiaddr[] = [] - const address = this.server.address() - const { listeningAddr, peerId } = this.status - - if (address == null) { - return [] - } - - if (typeof address === 'string') { - addrs = [listeningAddr] - } else { - try { - // Because TCP will only return the IPv6 version - // we need to capture from the passed multiaddr - if (listeningAddr.toString().startsWith('/ip4')) { - addrs = addrs.concat(getMultiaddrs('ip4', address.address, address.port)) - } else if (address.family === 'IPv6') { - addrs = addrs.concat(getMultiaddrs('ip6', address.address, address.port)) - } - } catch (err) { - this.log.error('could not turn %s:%s into multiaddr', address.address, address.port, err) - } - } - - return addrs.map(ma => peerId != null ? ma.encapsulate(`/p2p/${peerId}`) : ma) - } - - async listen (ma: Multiaddr): Promise { - if (this.status.code === TCPListenerStatusCode.ACTIVE || this.status.code === TCPListenerStatusCode.PAUSED) { - throw new CodeError('server is already listening', 'ERR_SERVER_ALREADY_LISTENING') - } - - const peerId = ma.getPeerId() - const listeningAddr = peerId == null ? ma.decapsulateCode(CODE_P2P) : ma - const { backlog } = this.context - - try { - this.status = { - code: TCPListenerStatusCode.ACTIVE, - listeningAddr, - peerId, - netConfig: multiaddrToNetConfig(listeningAddr, { backlog }) - } - - await this.resume() - } catch (err) { - this.status = { code: TCPListenerStatusCode.INACTIVE } - throw err - } - } - - async close (): Promise { - // Close connections and server the same time to avoid any race condition - await Promise.all([ - Promise.all(Array.from(this.connections.values()).map(async maConn => attemptClose(maConn, { - log: this.log - }))), - this.pause(true).catch(e => { - this.log.error('error attempting to close server once connection count over limit', e) - }) - ]) - } - - /** - * Can resume a stopped or start an inert server - */ - private async resume (): Promise { - if (this.server.listening || this.status.code === TCPListenerStatusCode.INACTIVE) { - return - } - - const netConfig = this.status.netConfig - - await new Promise((resolve, reject) => { - // NOTE: 'listening' event is only fired on success. Any error such as port already binded, is emitted via 'error' - this.server.once('error', reject) - this.server.listen(netConfig, resolve) - }) - - this.status = { ...this.status, code: TCPListenerStatusCode.ACTIVE } - this.log('Listening on %s', this.server.address()) - } - - private async pause (permanent: boolean): Promise { - if (!this.server.listening && this.status.code === TCPListenerStatusCode.PAUSED && permanent) { - this.status = { code: TCPListenerStatusCode.INACTIVE } - return - } - - if (!this.server.listening || this.status.code !== TCPListenerStatusCode.ACTIVE) { - return - } - - this.log('Closing server on %s', this.server.address()) - - // NodeJS implementation tracks listening status with `this._handle` property. - // - Server.close() sets this._handle to null immediately. If this._handle is null, ERR_SERVER_NOT_RUNNING is thrown - // - Server.listening returns `this._handle !== null` https://github.com/nodejs/node/blob/386d761943bb1b217fba27d6b80b658c23009e60/lib/net.js#L1675 - // - Server.listen() if `this._handle !== null` throws ERR_SERVER_ALREADY_LISTEN - // - // NOTE: Both listen and close are technically not async actions, so it's not necessary to track - // states 'pending-close' or 'pending-listen' - - // From docs https://nodejs.org/api/net.html#serverclosecallback - // Stops the server from accepting new connections and keeps existing connections. - // 'close' event is emitted only emitted when all connections are ended. - // The optional callback will be called once the 'close' event occurs. - - // We need to set this status before closing server, so other procedures are aware - // during the time the server is closing - this.status = permanent ? { code: TCPListenerStatusCode.INACTIVE } : { ...this.status, code: TCPListenerStatusCode.PAUSED } - await new Promise((resolve, reject) => { - this.server.close(err => { (err != null) ? reject(err) : resolve() }) - }) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/src/socket-to-conn.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/src/socket-to-conn.ts deleted file mode 100644 index a24b126d5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/src/socket-to-conn.ts +++ /dev/null @@ -1,200 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { ipPortToMultiaddr as toMultiaddr } from '@libp2p/utils/ip-port-to-multiaddr' -// @ts-expect-error no types -import toIterable from 'stream-to-it' -import { CLOSE_TIMEOUT, SOCKET_TIMEOUT } from './constants.js' -import { multiaddrToNetConfig } from './utils.js' -import type { ComponentLogger } from '@libp2p/interface' -import type { MultiaddrConnection } from '@libp2p/interface/connection' -import type { CounterGroup } from '@libp2p/interface/metrics' -import type { AbortOptions, Multiaddr } from '@multiformats/multiaddr' -import type { Socket } from 'net' - -interface ToConnectionOptions { - listeningAddr?: Multiaddr - remoteAddr?: Multiaddr - localAddr?: Multiaddr - socketInactivityTimeout?: number - socketCloseTimeout?: number - metrics?: CounterGroup - metricPrefix?: string - logger: ComponentLogger -} - -/** - * Convert a socket into a MultiaddrConnection - * https://github.com/libp2p/interface-transport#multiaddrconnection - */ -export const toMultiaddrConnection = (socket: Socket, options: ToConnectionOptions): MultiaddrConnection => { - const log = options.logger.forComponent('libp2p:tcp:socket') - const metrics = options.metrics - const metricPrefix = options.metricPrefix ?? '' - const inactivityTimeout = options.socketInactivityTimeout ?? SOCKET_TIMEOUT - const closeTimeout = options.socketCloseTimeout ?? CLOSE_TIMEOUT - - // Check if we are connected on a unix path - if (options.listeningAddr?.getPath() != null) { - options.remoteAddr = options.listeningAddr - } - - if (options.remoteAddr?.getPath() != null) { - options.localAddr = options.remoteAddr - } - - let remoteAddr: Multiaddr - - if (options.remoteAddr != null) { - remoteAddr = options.remoteAddr - } else { - if (socket.remoteAddress == null || socket.remotePort == null) { - // this can be undefined if the socket is destroyed (for example, if the client disconnected) - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#socketremoteaddress - throw new CodeError('Could not determine remote address or port', 'ERR_NO_REMOTE_ADDRESS') - } - - remoteAddr = toMultiaddr(socket.remoteAddress, socket.remotePort) - } - - const lOpts = multiaddrToNetConfig(remoteAddr) - const lOptsStr = lOpts.path ?? `${lOpts.host ?? ''}:${lOpts.port ?? ''}` - const { sink, source } = toIterable.duplex(socket) - - // by default there is no timeout - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#socketsettimeouttimeout-callback - socket.setTimeout(inactivityTimeout, () => { - log('%s socket read timeout', lOptsStr) - metrics?.increment({ [`${metricPrefix}timeout`]: true }) - - // only destroy with an error if the remote has not sent the FIN message - let err: Error | undefined - if (socket.readable) { - err = new CodeError('Socket read timeout', 'ERR_SOCKET_READ_TIMEOUT') - } - - // if the socket times out due to inactivity we must manually close the connection - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#event-timeout - socket.destroy(err) - }) - - socket.once('close', () => { - log('%s socket close', lOptsStr) - metrics?.increment({ [`${metricPrefix}close`]: true }) - - // In instances where `close` was not explicitly called, - // such as an iterable stream ending, ensure we have set the close - // timeline - if (maConn.timeline.close == null) { - maConn.timeline.close = Date.now() - } - }) - - socket.once('end', () => { - // the remote sent a FIN packet which means no more data will be sent - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#event-end - log('%s socket end', lOptsStr) - metrics?.increment({ [`${metricPrefix}end`]: true }) - }) - - const maConn: MultiaddrConnection = { - async sink (source) { - try { - await sink((async function * () { - for await (const buf of source) { - if (buf instanceof Uint8Array) { - yield buf - } else { - // is it faster to yield all the buffers or just one big buffer? - yield buf.subarray() - } - } - })()) - } catch (err: any) { - // If aborted we can safely ignore - if (err.type !== 'aborted') { - // If the source errored the socket will already have been destroyed by - // toIterable.duplex(). If the socket errored it will already be - // destroyed. There's nothing to do here except log the error & return. - log(err) - } - } - - // we have finished writing, send the FIN message - socket.end() - }, - - source, - - // If the remote address was passed, use it - it may have the peer ID encapsulated - remoteAddr, - - timeline: { open: Date.now() }, - - async close (options: AbortOptions = {}) { - if (socket.destroyed) { - log('%s socket was already destroyed when trying to close', lOptsStr) - return - } - - if (options.signal == null) { - const signal = AbortSignal.timeout(closeTimeout) - - options = { - ...options, - signal - } - } - - try { - log('%s closing socket', lOptsStr) - await new Promise((resolve, reject) => { - socket.once('close', () => { - // socket completely closed - log('%s socket closed', lOptsStr) - resolve() - }) - socket.once('error', (err: Error) => { - log('%s socket error', lOptsStr, err) - - // error closing socket - if (maConn.timeline.close == null) { - maConn.timeline.close = Date.now() - } - - reject(err) - }) - - // shorten inactivity timeout - socket.setTimeout(closeTimeout) - - // close writable end of the socket - socket.end() - - if (socket.writableLength > 0) { - // there are outgoing bytes waiting to be sent - socket.once('drain', () => { - log('%s socket drained', lOptsStr) - - // all bytes have been sent we can destroy the socket (maybe) before the timeout - socket.destroy() - }) - } else { - // nothing to send, destroy immediately, no need for the timeout - socket.destroy() - } - }) - } catch (err: any) { - this.abort(err) - } - }, - - abort: (err: Error) => { - log('%s socket abort due to error', lOptsStr, err) - - socket.destroy(err) - }, - - log - } - - return maConn -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/src/utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/src/utils.ts deleted file mode 100644 index 7a44af4fa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/tcp/src/utils.ts +++ /dev/null @@ -1,53 +0,0 @@ -import os from 'os' -import path from 'path' -import { multiaddr } from '@multiformats/multiaddr' -import type { Multiaddr } from '@multiformats/multiaddr' -import type { ListenOptions, IpcSocketConnectOpts, TcpSocketConnectOpts } from 'net' - -const ProtoFamily = { ip4: 'IPv4', ip6: 'IPv6' } - -export type NetConfig = ListenOptions | (IpcSocketConnectOpts & TcpSocketConnectOpts) - -export function multiaddrToNetConfig (addr: Multiaddr, config: NetConfig = {}): NetConfig { - const listenPath = addr.getPath() - - // unix socket listening - if (listenPath != null) { - if (os.platform() === 'win32') { - // Use named pipes on Windows systems. - return { path: path.join('\\\\.\\pipe\\', listenPath) } - } else { - return { path: listenPath } - } - } - - // tcp listening - return { ...config, ...addr.toOptions() } -} - -export function getMultiaddrs (proto: 'ip4' | 'ip6', ip: string, port: number): Multiaddr[] { - const toMa = (ip: string): Multiaddr => multiaddr(`/${proto}/${ip}/tcp/${port}`) - return (isAnyAddr(ip) ? getNetworkAddrs(ProtoFamily[proto]) : [ip]).map(toMa) -} - -export function isAnyAddr (ip: string): boolean { - return ['0.0.0.0', '::'].includes(ip) -} - -const networks = os.networkInterfaces() - -function getNetworkAddrs (family: string): string[] { - const addresses: string[] = [] - - for (const [, netAddrs] of Object.entries(networks)) { - if (netAddrs != null) { - for (const netAddr of netAddrs) { - if (netAddr.family === family) { - addresses.push(netAddr.address) - } - } - } - } - - return addresses -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/index.min.js deleted file mode 100644 index 605add25f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/index.min.js +++ /dev/null @@ -1,3 +0,0 @@ -(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.ChainsafeLibp2PYamux = factory()}(typeof self !== 'undefined' ? self : this, function () { -"use strict";var ChainsafeLibp2PYamux=(()=>{var ot=Object.create;var H=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var lt=Object.getOwnPropertyNames;var ut=Object.getPrototypeOf,ct=Object.prototype.hasOwnProperty;var ue=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ht=(r,e)=>{for(var t in e)H(r,t,{get:e[t],enumerable:!0})},De=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of lt(e))!ct.call(r,s)&&s!==t&&H(r,s,{get:()=>e[s],enumerable:!(n=at(e,s))||n.enumerable});return r};var ft=(r,e,t)=>(t=r!=null?ot(ut(r)):{},De(e||!r||!r.__esModule?H(t,"default",{value:r,enumerable:!0}):t,r)),dt=r=>De(H({},"__esModule",{value:!0}),r);var Te=ue((Qt,Le)=>{var W=1e3,V=W*60,G=V*60,k=G*24,mt=k*7,pt=k*365.25;Le.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return gt(r);if(t==="number"&&isFinite(r))return e.long?bt(r):wt(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function gt(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*pt;case"weeks":case"week":case"w":return t*mt;case"days":case"day":case"d":return t*k;case"hours":case"hour":case"hrs":case"hr":case"h":return t*G;case"minutes":case"minute":case"mins":case"min":case"m":return t*V;case"seconds":case"second":case"secs":case"sec":case"s":return t*W;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function wt(r){var e=Math.abs(r);return e>=k?Math.round(r/k)+"d":e>=G?Math.round(r/G)+"h":e>=V?Math.round(r/V)+"m":e>=W?Math.round(r/W)+"s":r+"ms"}function bt(r){var e=Math.abs(r);return e>=k?j(r,e,k,"day"):e>=G?j(r,e,G,"hour"):e>=V?j(r,e,V,"minute"):e>=W?j(r,e,W,"second"):r+" ms"}function j(r,e,t,n){var s=e>=t*1.5;return Math.round(r/t)+" "+n+(s?"s":"")}});var Fe=ue((Zt,Ne)=>{function yt(r){t.debug=t,t.default=t,t.coerce=f,t.disable=i,t.enable=s,t.enabled=a,t.humanize=Te(),t.destroy=R,Object.keys(r).forEach(o=>{t[o]=r[o]}),t.names=[],t.skips=[],t.formatters={};function e(o){let l=0;for(let d=0;d{if(D==="%%")return"%";S++;let L=t.formatters[_];if(typeof L=="function"){let P=c[S];D=L.call(g,P),c.splice(S,1),S--}return D}),t.formatArgs.call(g,c),(g.log||t.log).apply(g,c)}return m.namespace=o,m.useColors=t.useColors(),m.color=t.selectColor(o),m.extend=n,m.destroy=t.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(N!==t.namespaces&&(N=t.namespaces,p=t.enabled(o)),p),set:c=>{d=c}}),typeof t.init=="function"&&t.init(m),m}function n(o,l){let d=t(this.namespace+(typeof l>"u"?":":l)+o);return d.log=this.log,d}function s(o){t.save(o),t.namespaces=o,t.names=[],t.skips=[];let l,d=(typeof o=="string"?o:"").split(/[\s,]+/),N=d.length;for(l=0;l"-"+l)].join(",");return t.enable(""),o}function a(o){if(o[o.length-1]==="*")return!0;let l,d;for(l=0,d=t.skips.length;l{v.formatArgs=St;v.save=Ct;v.load=Rt;v.useColors=Et;v.storage=xt();v.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();v.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Et(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function St(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+K.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,n=0;r[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(n=t))}),r.splice(n,0,e)}v.log=console.debug||console.log||(()=>{});function Ct(r){try{r?v.storage.setItem("debug",r):v.storage.removeItem("debug")}catch{}}function Rt(){let r;try{r=v.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function xt(){try{return localStorage}catch{}}K.exports=Fe()(v);var{formatters:_t}=K.exports;_t.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Xt={};ht(Xt,{GoAwayCode:()=>I,yamux:()=>zt});var h=class extends Error{code;props;constructor(e,t,n){super(e),this.code=t,this.name=n?.name??"CodeError",this.props=n??{}}};var ce=class extends Event{detail;constructor(e,t){super(e,t),this.detail=t?.detail}},Kt=globalThis.CustomEvent??ce;var he=(r,...e)=>{try{[...e]}catch{}};var A=ft(Ue(),1);function vt(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n>>0,S=new Uint8Array(E);g!==y;){for(var x=p[g],D=0,_=E-1;(x!==0||D>>0,S[_]=x%u>>>0,x=x/u>>>0;if(x!==0)throw new Error("Non-zero carry");c=D,g++}for(var L=E-c;L!==E&&S[L]===0;)L++;for(var P=f.repeat(m);L>>0,E=new Uint8Array(y);p[m];){var S=t[p.charCodeAt(m)];if(S===255)return;for(var x=0,D=y-1;(S!==0||x>>0,E[D]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");g=x,m++}if(p[m]!==" "){for(var _=y-g;_!==y&&E[_]===0;)_++;for(var L=new Uint8Array(c+(y-_)),P=c;_!==y;)L[P++]=E[_++];return L}}}function N(p){var m=d(p);if(m)return m;throw new Error(`Non-${e} character`)}return{encode:l,decodeUnsafe:d,decode:N}}var At=vt,It=At,Oe=It;var tr=new Uint8Array(0);var ke=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var fe=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},de=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Me(this,e)}},me=class{constructor(e){this.decoders=e}or(e){return Me(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Me=(r,e)=>new me({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),pe=class{constructor(e,t,n,s){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=s,this.encoder=new fe(e,t,n),this.decoder=new de(e,t,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Pe=({name:r,prefix:e,encode:t,decode:n})=>new pe(r,e,t,n),ge=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:s}=Oe(t,e);return Pe({prefix:r,name:e,encode:n,decode:i=>ke(s(i))})},Dt=(r,e,t,n)=>{let s={};for(let o=0;o=8&&(u-=8,a[R++]=255&f>>u)}if(u>=t||255&f<<8-u)throw new SyntaxError("Unexpected end of data");return a},Lt=(r,e,t)=>{let n=e[e.length-1]==="=",s=(1<t;)a-=t,i+=e[s&u>>a];if(a&&(i+=e[s&u<Pe({prefix:e,name:r,encode(s){return Lt(s,n,t)},decode(s){return Dt(s,n,t,r)}});var We=C({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ar=C({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),lr=C({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),ur=C({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),cr=C({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),hr=C({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),fr=C({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),dr=C({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),mr=C({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ve=ge({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),wr=ge({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Ge=C({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Er=C({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Sr=C({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Cr=C({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});A.default.formatters.b=r=>r==null?"undefined":Ve.baseEncode(r);A.default.formatters.t=r=>r==null?"undefined":We.baseEncode(r);A.default.formatters.m=r=>r==null?"undefined":Ge.baseEncode(r);A.default.formatters.p=r=>r==null?"undefined":r.toString();A.default.formatters.c=r=>r==null?"undefined":r.toString();A.default.formatters.k=r=>r==null?"undefined":r.toString();A.default.formatters.a=r=>r==null?"undefined":r.toString();function Tt(r){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=r,e.destroy=()=>!0,e.extend=()=>e,e}function J(r){let e=Tt(`${r}:trace`);return A.default.enabled(`${r}:trace`)&&A.default.names.map(t=>t.toString()).find(t=>t.includes(":trace"))!=null&&(e=(0,A.default)(`${r}:trace`)),Object.assign((0,A.default)(r),{error:(0,A.default)(`${r}:error`),trace:e})}function Q(r){if(r!=null){if(typeof r[Symbol.iterator]=="function")return r[Symbol.iterator]();if(typeof r[Symbol.asyncIterator]=="function")return r[Symbol.asyncIterator]();if(typeof r.next=="function")return r}throw new Error("argument is not an iterator or iterable")}function M(){let r={};return r.promise=new Promise((e,t)=>{r.resolve=e,r.reject=t}),r}var Z=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},B=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new Z(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let t=this.head;this.head=t.next=new Z(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let t=this.tail.next;this.tail.next=null,this.tail=t,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var we=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.code=t??"ABORT_ERR"}};function ee(r={}){return Nt(t=>{let n=t.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},r)}function Nt(r,e){e=e??{};let t=e.onEnd,n=new B,s,i,a,u=M(),f=async()=>{try{return n.isEmpty()?a?{done:!0}:await new Promise((c,g)=>{i=y=>{i=null,n.push(y);try{c(r(n))}catch(E){g(E)}return s}}):r(n)}finally{n.isEmpty()&&queueMicrotask(()=>{u.resolve(),u=M()})}},R=c=>i!=null?i(c):(n.push(c),s),o=c=>(n=new B,i!=null?i({error:c}):(n.push({error:c}),s)),l=c=>{if(a)return s;if(e?.objectMode!==!0&&c?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return R({done:!1,value:c})},d=c=>a?s:(a=!0,c!=null?o(c):R({done:!0})),N=()=>(n=new B,d(),{done:!0}),p=c=>(d(c),{done:!0});if(s={[Symbol.asyncIterator](){return this},next:f,return:N,throw:p,push:l,end:d,get readableLength(){return n.size},onEmpty:async c=>{let g=c?.signal;if(g?.throwIfAborted(),n.isEmpty())return;let y,E;g!=null&&(y=new Promise((S,x)=>{E=()=>{x(new we)},g.addEventListener("abort",E)}));try{await Promise.race([u.promise,y])}finally{E!=null&&g!=null&&g?.removeEventListener("abort",E)}}},t==null)return s;let m=s;return s={[Symbol.asyncIterator](){return this},next(){return m.next()},throw(c){return m.throw(c),t!=null&&(t(c),t=void 0),{done:!0}},return(){return m.return(),t!=null&&(t(),t=void 0),{done:!0}},push:l,end(c){return m.end(c),t!=null&&(t(c),t=void 0),s},get readableLength(){return m.readableLength},onEmpty:c=>m.onEmpty(c)},s}var z="ERR_INVALID_FRAME",be="ERR_UNREQUESTED_PING",ye="ERR_NOT_MATCHING_PING",Ee="ERR_STREAM_ALREADY_EXISTS",Se="ERR_DECODE_INVALID_VERSION",Ce="ERR_BOTH_CLIENTS",Re="ERR_RECV_WINDOW_EXCEEDED",Be=new Set([z,be,ye,Ee,Se,Ce,Re]),U="ERR_INVALID_CONFIG",te="ERR_MUXER_LOCAL_CLOSED",xe="ERR_MUXER_REMOTE_CLOSED";var ze="ERR_STREAM_ABORT",Xe="ERROR_MAX_OUTBOUND_STREAMS_EXCEEDED",Ye="ERR_DECODE_IN_PROGRESS",Y=256*1024,qe=16*1024*1024;var $e={log:J("libp2p:yamux"),enableKeepAlive:!0,keepAliveInterval:3e4,maxInboundStreams:1e3,maxOutboundStreams:1e3,initialStreamWindowSize:Y,maxStreamWindowSize:qe,maxMessageSize:64*1024};function He(r){if(r.keepAliveInterval<=0)throw new h("keep-alive interval must be positive",U);if(r.maxInboundStreams<0)throw new h("max inbound streams must be larger or equal 0",U);if(r.maxOutboundStreams<0)throw new h("max outbound streams must be larger or equal 0",U);if(r.initialStreamWindowSize2**32-1)throw new h("MaxStreamWindowSize must be less than equal MAX_UINT32",U);if(r.maxMessageSize<1024)throw new h("MaxMessageSize must be greater than a kilobyte",U)}function q(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function F(r=0){return globalThis.Buffer?.alloc!=null?q(globalThis.Buffer.alloc(r)):new Uint8Array(r)}function $(r=0){return globalThis.Buffer?.allocUnsafe!=null?q(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function _e(r,e){e==null&&(e=r.reduce((s,i)=>s+i.length,0));let t=$(e),n=0;for(let s of r)t.set(s,n),n+=s.length;return q(t)}function je(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let t=0;for(let n of e)if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.push(n);else if(re(n))t+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}prepend(...e){this.prependAll(e)}prependAll(e){let t=0;for(let n of e.reverse())if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.unshift(n);else if(re(n))t+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=Ke(this.bufs,e);return t.buf[t.index]}set(e,t){let n=Ke(this.bufs,e);n.buf[n.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let n=0;n0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,t){let{bufs:n,length:s}=this._subList(e,t);return _e(n,s)}subarray(e,t){let{bufs:n,length:s}=this._subList(e,t);return n.length===1?n[0]:_e(n,s)}sublist(e,t){let{bufs:n,length:s}=this._subList(e,t),i=new r;return i.length=s,i.bufs=n,i}_subList(e,t){if(e=e??0,t=t??this.length,e<0&&(e=this.length+e),t<0&&(t=this.length+t),e<0||t>this.length)throw new RangeError("index is out of bounds");if(e===t)return{bufs:[],length:0};if(e===0&&t===this.length)return{bufs:[...this.bufs],length:this.length};let n=[],s=0;for(let i=0;i=f)continue;let R=e>=u&&eu&&t<=f;if(R&&o){if(e===u&&t===f){n.push(a);break}let l=e-u;n.push(a.subarray(l,l+(t-e)));break}if(R){if(e===0){n.push(a);continue}n.push(a.subarray(e-u));continue}if(o){if(t===f){n.push(a);break}n.push(a.subarray(0,t-u));break}n.push(a)}return{bufs:n,length:t-e}}indexOf(e,t=0){if(!re(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(t=Number(t??0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),e.length===0)return t>this.length?this.length:t;let s=n.byteLength;if(s===0)throw new TypeError("search must be at least 1 byte long");let i=256,a=new Int32Array(i);for(let l=0;l=0;d--){let N=this.get(l+d);if(n[d]!==N){o=Math.max(1,d-u[N]);break}}if(o===0)return l}return-1}getInt8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}setInt8(e,t){let n=$(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,t),this.write(n,e)}getInt16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,t)}setInt16(e,t,n){let s=F(2);new DataView(s.buffer,s.byteOffset,s.byteLength).setInt16(0,t,n),this.write(s,e)}getInt32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,t)}setInt32(e,t,n){let s=F(4);new DataView(s.buffer,s.byteOffset,s.byteLength).setInt32(0,t,n),this.write(s,e)}getBigInt64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,t)}setBigInt64(e,t,n){let s=F(8);new DataView(s.buffer,s.byteOffset,s.byteLength).setBigInt64(0,t,n),this.write(s,e)}getUint8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}setUint8(e,t){let n=$(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,t),this.write(n,e)}getUint16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,t)}setUint16(e,t,n){let s=F(2);new DataView(s.buffer,s.byteOffset,s.byteLength).setUint16(0,t,n),this.write(s,e)}getUint32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,t)}setUint32(e,t,n){let s=F(4);new DataView(s.buffer,s.byteOffset,s.byteLength).setUint32(0,t,n),this.write(s,e)}getBigUint64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,t)}setBigUint64(e,t,n){let s=F(8);new DataView(s.buffer,s.byteOffset,s.byteLength).setBigUint64(0,t,n),this.write(s,e)}getFloat32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,t)}setFloat32(e,t,n){let s=F(4);new DataView(s.buffer,s.byteOffset,s.byteLength).setFloat32(0,t,n),this.write(s,e)}getFloat64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,t)}setFloat64(e,t,n){let s=F(8);new DataView(s.buffer,s.byteOffset,s.byteLength).setFloat64(0,t,n),this.write(s,e)}equals(e){if(e==null||!(e instanceof r)||e.bufs.length!==this.bufs.length)return!1;for(let t=0;ts+i.byteLength,0)),n.length=t,n}};var b;(function(r){r[r.Data=0]="Data",r[r.WindowUpdate=1]="WindowUpdate",r[r.Ping=2]="Ping",r[r.GoAway=3]="GoAway"})(b||(b={}));var w;(function(r){r[r.SYN=1]="SYN",r[r.ACK=2]="ACK",r[r.FIN=4]="FIN",r[r.RST=8]="RST"})(w||(w={}));var Zr=Object.values(w).filter(r=>typeof r!="string"),Qe=0,I;(function(r){r[r.NormalTermination=0]="NormalTermination",r[r.ProtocolError=1]="ProtocolError",r[r.InternalError=2]="InternalError"})(I||(I={}));var O=12;var Ze=2**24;function Ft(r){if(r[0]!==Qe)throw new h("Invalid frame version",Se);return{type:r[1],flag:(r[2]<<8)+r[3],streamID:r[4]*Ze+(r[5]<<16)+(r[6]<<8)+r[7],length:r[8]*Ze+(r[9]<<16)+(r[10]<<8)+r[11]}}var ne=class{source;buffer;frameInProgress;constructor(e){this.source=Ut(e),this.buffer=new X,this.frameInProgress=!1}async*emitFrames(){for await(let e of this.source)for(this.buffer.append(e);;){let t=this.readHeader();if(t===void 0)break;let{type:n,length:s}=t;n===b.Data?(this.frameInProgress=!0,yield{header:t,readData:this.readBytes.bind(this,s)}):yield{header:t}}}readHeader(){if(this.frameInProgress)throw new h("decoding frame already in progress",Ye);if(this.buffer.length=e)break}let t=this.buffer.sublist(0,e);return this.buffer.consume(e),this.frameInProgress=!1,t}};function Ut(r){if(r[Symbol.iterator]!==void 0){let e=r[Symbol.iterator]();return e.return=void 0,{[Symbol.iterator](){return e}}}else if(r[Symbol.asyncIterator]!==void 0){let e=r[Symbol.asyncIterator]();return e.return=void 0,{[Symbol.asyncIterator](){return e}}}else throw new Error("a source must be either an iterable or an async iterable")}function ve(r){let e=new Uint8Array(O);return e[1]=r.type,e[2]=r.flag>>>8,e[3]=r.flag,e[4]=r.streamID>>>24,e[5]=r.streamID>>>16,e[6]=r.streamID>>>8,e[7]=r.streamID,e[8]=r.length>>>24,e[9]=r.length>>>16,e[10]=r.length>>>8,e[11]=r.length,e}var se=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=t??"ABORT_ERR"}};async function ie(r,e,t){if(e==null)return r;if(e.aborted)return Promise.reject(new se(t?.errorMessage,t?.errorCode));let n,s=new se(t?.errorMessage,t?.errorCode);try{return await Promise.race([r,new Promise((i,a)=>{n=()=>{a(s)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}function et(r){return r==null?!1:typeof r.then=="function"&&typeof r.catch=="function"&&typeof r.finally=="function"}function tt(r,e){let t=Q(r).return?.();et(t)&&t.catch(n=>{e.error("could not cause iterator to return",n)})}var Ot="ERR_STREAM_RESET",kt="ERR_SINK_INVALID_STATE",Mt=5e3;function Ae(r){return r==null?!1:typeof r.then=="function"&&typeof r.catch=="function"&&typeof r.finally=="function"}var oe=class{id;direction;timeline;protocol;metadata;source;status;readStatus;writeStatus;log;sinkController;sinkEnd;closed;endErr;streamSource;onEnd;onCloseRead;onCloseWrite;onReset;onAbort;sendCloseWriteTimeout;constructor(e){this.sinkController=new AbortController,this.sinkEnd=M(),this.closed=M(),this.log=e.log,this.status="open",this.readStatus="ready",this.writeStatus="ready",this.id=e.id,this.metadata=e.metadata??{},this.direction=e.direction,this.timeline={open:Date.now()},this.sendCloseWriteTimeout=e.sendCloseWriteTimeout??Mt,this.onEnd=e.onEnd,this.onCloseRead=e?.onCloseRead,this.onCloseWrite=e?.onCloseWrite,this.onReset=e?.onReset,this.onAbort=e?.onAbort,this.source=this.streamSource=ee({onEnd:t=>{t!=null?this.log.trace("source ended with error",t):this.log.trace("source ended"),this.onSourceEnd(t)}}),this.sink=this.sink.bind(this)}async sink(e){if(this.writeStatus!=="ready")throw new h(`writable end state is "${this.writeStatus}" not "ready"`,kt);try{this.writeStatus="writing";let t={signal:this.sinkController.signal};if(this.direction==="outbound"){let s=this.sendNewStream(t);Ae(s)&&await s}let n=()=>{tt(e,this.log)};try{this.sinkController.signal.addEventListener("abort",n),this.log.trace("sink reading from source");for await(let s of e){s=s instanceof Uint8Array?new X(s):s;let i=this.sendData(s,t);Ae(i)&&await i}}finally{this.sinkController.signal.removeEventListener("abort",n)}this.log.trace('sink finished reading from source, write status is "%s"',this.writeStatus),this.writeStatus==="writing"&&(this.writeStatus="closing",this.log.trace("send close write to remote"),await this.sendCloseWrite({signal:AbortSignal.timeout(this.sendCloseWriteTimeout)}),this.writeStatus="closed"),this.onSinkEnd()}catch(t){throw this.log.trace("sink ended with error, calling abort with error",t),this.abort(t),t}finally{this.log.trace("resolve sink end"),this.sinkEnd.resolve()}}onSourceEnd(e){this.timeline.closeRead==null&&(this.timeline.closeRead=Date.now(),this.readStatus="closed",e!=null&&this.endErr==null&&(this.endErr=e),this.onCloseRead?.(),this.timeline.closeWrite!=null?(this.log.trace("source and sink ended"),this.timeline.close=Date.now(),this.status!=="aborted"&&this.status!=="reset"&&(this.status="closed"),this.onEnd!=null&&this.onEnd(this.endErr),this.closed.resolve()):this.log.trace("source ended, waiting for sink to end"))}onSinkEnd(e){this.timeline.closeWrite==null&&(this.timeline.closeWrite=Date.now(),this.writeStatus="closed",e!=null&&this.endErr==null&&(this.endErr=e),this.onCloseWrite?.(),this.timeline.closeRead!=null?(this.log.trace("sink and source ended"),this.timeline.close=Date.now(),this.status!=="aborted"&&this.status!=="reset"&&(this.status="closed"),this.onEnd!=null&&this.onEnd(this.endErr),this.closed.resolve()):this.log.trace("sink ended, waiting for source to end"))}async close(e){this.log.trace("closing gracefully"),this.status="closing",await Promise.all([this.closeRead(e),this.closeWrite(e)]),await ie(this.closed.promise,e?.signal),this.status="closed",this.log.trace("closed gracefully")}async closeRead(e={}){if(this.readStatus==="closing"||this.readStatus==="closed")return;this.log.trace('closing readable end of stream with starting read status "%s"',this.readStatus);let t=this.readStatus;this.readStatus="closing",this.status!=="reset"&&this.status!=="aborted"&&this.timeline.closeRead==null&&(this.log.trace("send close read to remote"),await this.sendCloseRead(e)),t==="ready"&&(this.log.trace("ending internal source queue with %d queued bytes",this.streamSource.readableLength),this.streamSource.end()),this.log.trace("closed readable end of stream")}async closeWrite(e={}){this.writeStatus==="closing"||this.writeStatus==="closed"||(this.log.trace('closing writable end of stream with starting write status "%s"',this.writeStatus),this.writeStatus==="ready"&&(this.log.trace("sink was never sunk, sink an empty array"),await ie(this.sink([]),e.signal)),this.writeStatus==="writing"&&await new Promise((t,n)=>{queueMicrotask(()=>{this.log.trace("aborting source passed to .sink"),this.sinkController.abort(),ie(this.sinkEnd.promise,e.signal).then(t,n)})}),this.writeStatus="closed",this.log.trace("closed writable end of stream"))}abort(e){if(this.status==="closed"||this.status==="aborted"||this.status==="reset")return;this.log("abort with error",e),this.log("try to send reset to remote");let t=this.sendReset();Ae(t)&&t.catch(n=>{this.log.error("error sending reset message",n)}),this.status="aborted",this.timeline.abort=Date.now(),this._closeSinkAndSource(e),this.onAbort?.(e)}reset(){if(this.status==="closed"||this.status==="aborted"||this.status==="reset")return;let e=new h("stream reset",Ot);this.status="reset",this.timeline.reset=Date.now(),this._closeSinkAndSource(e),this.onReset?.()}_closeSinkAndSource(e){this._closeSink(e),this._closeSource(e)}_closeSink(e){this.writeStatus==="writing"&&(this.log.trace("end sink source"),this.sinkController.abort()),this.onSinkEnd(e)}_closeSource(e){this.readStatus!=="closing"&&this.readStatus!=="closed"&&(this.log.trace("ending source with %d bytes to be read by consumer",this.streamSource.readableLength),this.readStatus="closing",this.streamSource.end(e))}remoteCloseWrite(){if(this.readStatus==="closing"||this.readStatus==="closed"){this.log("received remote close write but local source is already closed");return}this.log.trace("remote close write"),this._closeSource()}remoteCloseRead(){if(this.writeStatus==="closing"||this.writeStatus==="closed"){this.log("received remote close read but local sink is already closed");return}this.log.trace("remote close read"),this._closeSink()}destroy(){if(this.status==="closed"||this.status==="aborted"||this.status==="reset"){this.log("received destroy but we are already closed");return}this.log.trace("stream destroyed"),this._closeSinkAndSource()}sourcePush(e){this.streamSource.push(e)}sourceReadableLength(){return this.streamSource.readableLength}};function Pt(r){let[e,t]=r[Symbol.asyncIterator]!=null?[r[Symbol.asyncIterator](),Symbol.asyncIterator]:[r[Symbol.iterator](),Symbol.iterator],n=[];return{peek:()=>e.next(),push:s=>{n.push(s)},next:()=>n.length>0?{done:!1,value:n.shift()}:e.next(),[t](){return this}}}var rt=Pt;function Wt(r){return r[Symbol.asyncIterator]!=null}function nt(r){return r?.then!=null}function Vt(r,e){if(Wt(r))return async function*(){for await(let u of r){let f=e(u);nt(f)&&await f,yield u}}();let t=rt(r),{value:n,done:s}=t.next();if(s===!0)return function*(){}();if(typeof e(n)?.then=="function")return async function*(){yield n;for await(let u of t){let f=e(u);nt(f)&&await f,yield u}}();let a=e;return function*(){yield n;for(let u of t)a(u),yield u}()}var st=Vt;var T;(function(r){r[r.Init=0]="Init",r[r.SYNSent=1]="SYNSent",r[r.SYNReceived=2]="SYNReceived",r[r.Established=3]="Established",r[r.Finished=4]="Finished"})(T||(T={}));var ae=class extends oe{name;state;config;_id;sendWindowCapacity;sendWindowCapacityUpdate;recvWindow;recvWindowCapacity;epochStart;getRTT;sendFrame;constructor(e){super({...e,onEnd:t=>{this.state=T.Finished,e.onEnd?.(t)}}),this.config=e.config,this._id=parseInt(e.id,10),this.name=e.name,this.state=e.state,this.sendWindowCapacity=Y,this.recvWindow=this.config.initialStreamWindowSize,this.recvWindowCapacity=this.recvWindow,this.epochStart=Date.now(),this.getRTT=e.getRTT,this.sendFrame=e.sendFrame,this.source=st(this.source,()=>{this.sendWindowUpdate()})}async sendNewStream(){}async sendData(e,t={}){for(e=e.sublist();e.byteLength!==0;){if(this.sendWindowCapacity===0&&await this.waitForSendWindowCapacity(t),this.status!=="open")return;let n=Math.min(this.sendWindowCapacity,this.config.maxMessageSize-O,e.length),s=this.getSendFlags();this.sendFrame({type:b.Data,flag:s,streamID:this._id,length:n},e.sublist(0,n)),this.sendWindowCapacity-=n,e.consume(n)}}async sendReset(){this.sendFrame({type:b.WindowUpdate,flag:w.RST,streamID:this._id,length:0})}async sendCloseWrite(){let e=this.getSendFlags()|w.FIN;this.sendFrame({type:b.WindowUpdate,flag:e,streamID:this._id,length:0})}async sendCloseRead(){}async waitForSendWindowCapacity(e={}){if(this.sendWindowCapacity>0)return;let t,n,s=()=>{this.status==="open"?n(new h("stream aborted",ze)):t()};e.signal?.addEventListener("abort",s);try{await new Promise((i,a)=>{this.sendWindowCapacityUpdate=()=>{i()},n=a,t=i})}finally{e.signal?.removeEventListener("abort",s)}}handleWindowUpdate(e){this.log?.trace("stream received window update id=%s",this._id),this.processFlags(e.flag);let t=this.sendWindowCapacity;this.sendWindowCapacity+=e.length,t===0&&e.length>0&&this.sendWindowCapacityUpdate?.()}async handleData(e,t){if(this.log?.trace("stream received data id=%s",this._id),this.processFlags(e.flag),this.recvWindowCapacity-1&&t-this.epochStart=this.recvWindow&&e===0)return;let s=this.recvWindow-this.recvWindowCapacity;this.recvWindowCapacity=this.recvWindow,this.epochStart=t,this.sendFrame({type:b.WindowUpdate,flag:e,streamID:this._id,length:s})}};var it="/yamux/1.0.0",Gt=500,le=class{protocol=it;_init;constructor(e={}){this._init=e}createStreamMuxer(e){return new Ie({...this._init,...e})}},Ie=class{protocol=it;source;sink;config;log;closeController;nextStreamID;_streams;nextPingID;activePing;rtt;client;localGoAway;remoteGoAway;numInboundStreams;numOutboundStreams;onIncomingStream;onStreamEnd;constructor(e){this.client=e.direction==="outbound",this.config={...$e,...e},this.log=this.config.log,He(this.config),this.closeController=new AbortController,he(1/0,this.closeController.signal),this.onIncomingStream=e.onIncomingStream,this.onStreamEnd=e.onStreamEnd,this._streams=new Map,this.source=ee({onEnd:()=>{this.log?.trace("muxer source ended"),this._streams.forEach(t=>{t.destroy()})}}),this.sink=async t=>{let n=()=>{let a=Q(t);if(a.return!=null){let u=a.return();Bt(u)&&u.catch(f=>{this.log?.("could not cause sink source to return",f)})}},s,i;try{let a=new ne(t);try{this.closeController.signal.addEventListener("abort",n);for await(let u of a.emitFrames())await this.handleFrame(u.header,u.readData)}finally{this.closeController.signal.removeEventListener("abort",n)}s=I.NormalTermination}catch(a){let u=a.code;Be.has(u)?(this.log?.error("protocol error in sink",a),s=I.ProtocolError):(this.log?.error("internal error in sink",a),s=I.InternalError),i=a}this.log?.trace("muxer sink ended"),i!=null?this.abort(i,s):await this.close({reason:s})},this.numInboundStreams=0,this.numOutboundStreams=0,this.nextStreamID=this.client?1:2,this.nextPingID=0,this.rtt=-1,this.log?.trace("muxer created"),this.config.enableKeepAlive&&this.keepAliveLoop().catch(t=>this.log?.error("keepalive error: %s",t)),this.ping().catch(t=>this.log?.error("ping error: %s",t))}get streams(){return Array.from(this._streams.values())}newStream(e){if(this.remoteGoAway!==void 0)throw new h("muxer closed remotely",xe);if(this.localGoAway!==void 0)throw new h("muxer closed locally",te);let t=this.nextStreamID;if(this.nextStreamID+=2,this.numOutboundStreams>=this.config.maxOutboundStreams)throw new h("max outbound streams exceeded",Xe);this.log?.trace("new outgoing stream id=%s",t);let n=this._newStream(t,e,T.Init,"outbound");return this._streams.set(t,n),this.numOutboundStreams++,n.sendWindowUpdate(),n}async ping(){if(this.remoteGoAway!==void 0)throw new h("muxer closed remotely",xe);if(this.localGoAway!==void 0)throw new h("muxer closed locally",te);if(this.activePing===void 0){let e=()=>{};this.activePing={id:this.nextPingID++,promise:new Promise((s,i)=>{let a=()=>{i(new h("muxer closed locally",te))};this.closeController.signal.addEventListener("abort",a,{once:!0}),e=()=>{this.closeController.signal.removeEventListener("abort",a),s()}}),resolve:e};let t=Date.now();this.sendPing(this.activePing.id);try{await this.activePing.promise}finally{delete this.activePing}let n=Date.now();this.rtt=n-t}else await this.activePing.promise;return this.rtt}getRTT(){return this.rtt}async close(e={}){if(this.closeController.signal.aborted)return;let t=e?.reason??I.NormalTermination;if(this.log?.trace("muxer close reason=%s",t),e.signal==null){let n=AbortSignal.timeout(Gt);he(1/0,n),e={...e,signal:n}}try{await Promise.all([...this._streams.values()].map(async n=>n.close(e))),this.sendGoAway(t),this._closeMuxer()}catch(n){this.abort(n)}}abort(e,t){if(!this.closeController.signal.aborted){t=t??I.InternalError,this.log?.error("muxer abort reason=%s error=%s",t,e);for(let n of this._streams.values())n.abort(e);this.sendGoAway(t),this._closeMuxer()}}isClosed(){return this.closeController.signal.aborted}_closeMuxer(){this.closeController.abort(),this.source.end()}_newStream(e,t,n,s){if(this._streams.get(e)!=null)throw new h("Stream already exists",Ee,{id:e});let i=new ae({id:e.toString(),name:t,state:n,direction:s,sendFrame:this.sendFrame.bind(this),onEnd:()=>{this.closeStream(e),this.onStreamEnd?.(i)},log:J(`libp2p:yamux:${s}:${e}`),config:this.config,getRTT:this.getRTT.bind(this)});return i}closeStream(e){this.client===(e%2===0)?this.numInboundStreams--:this.numOutboundStreams--,this._streams.delete(e)}async keepAliveLoop(){let e=new Promise((t,n)=>{this.closeController.signal.addEventListener("abort",n,{once:!0})});for(this.log?.trace("muxer keepalive enabled interval=%s",this.config.keepAliveInterval);;){let t;try{await Promise.race([e,new Promise(n=>{t=setTimeout(n,this.config.keepAliveInterval)})]),this.ping().catch(n=>this.log?.error("ping error: %s",n))}catch{clearInterval(t);return}}}async handleFrame(e,t){let{streamID:n,type:s,length:i}=e;if(this.log?.trace("received frame %o",e),n===0)switch(s){case b.Ping:{this.handlePing(e);return}case b.GoAway:{this.handleGoAway(i);return}default:throw new h("Invalid frame type",z,{header:e})}else switch(e.type){case b.Data:case b.WindowUpdate:{await this.handleStreamMessage(e,t);return}default:throw new h("Invalid frame type",z,{header:e})}}handlePing(e){if(e.flag===w.SYN)this.log?.trace("received ping request pingId=%s",e.length),this.sendPing(e.length,w.ACK);else if(e.flag===w.ACK)this.log?.trace("received ping response pingId=%s",e.length),this.handlePingResponse(e.length);else throw new h("Invalid frame flag",z,{header:e})}handlePingResponse(e){if(this.activePing===void 0)throw new h("ping not requested",be);if(this.activePing.id!==e)throw new h("ping doesn't match our id",ye);this.activePing.resolve()}handleGoAway(e){this.log?.trace("received GoAway reason=%s",I[e]??"unknown"),this.remoteGoAway=e;for(let t of this._streams.values())t.reset();this._closeMuxer()}async handleStreamMessage(e,t){let{streamID:n,flag:s,type:i}=e;(s&w.SYN)===w.SYN&&this.incomingStream(n);let a=this._streams.get(n);if(a===void 0){if(i===b.Data){if(this.log?.("discarding data for stream id=%s",n),t===void 0)throw new Error("unreachable");await t()}else this.log?.("frame for missing stream id=%s",n);return}switch(i){case b.WindowUpdate:{a.handleWindowUpdate(e);return}case b.Data:{if(t===void 0)throw new Error("unreachable");await a.handleData(e,t);return}default:throw new Error("unreachable")}}incomingStream(e){if(this.client!==(e%2===0))throw new h("both endpoints are clients",Ce);if(this._streams.has(e))return;if(this.log?.trace("new incoming stream id=%s",e),this.localGoAway!==void 0){this.sendFrame({type:b.WindowUpdate,flag:w.RST,streamID:e,length:0});return}if(this.numInboundStreams>=this.config.maxInboundStreams){this.log?.("maxIncomingStreams exceeded, forcing stream reset"),this.sendFrame({type:b.WindowUpdate,flag:w.RST,streamID:e,length:0});return}let t=this._newStream(e,void 0,T.SYNReceived,"inbound");this.numInboundStreams++,this._streams.set(e,t),this.onIncomingStream?.(t)}sendFrame(e,t){if(this.log?.trace("sending frame %o",e),e.type===b.Data){if(t===void 0)throw new h("invalid frame",z);this.source.push(ve(e)),this.source.push(t)}else this.source.push(ve(e))}sendPing(e,t=w.SYN){t===w.SYN?this.log?.trace("sending ping request pingId=%s",e):this.log?.trace("sending ping response pingId=%s",e),this.sendFrame({type:b.Ping,flag:t,streamID:0,length:e})}sendGoAway(e=I.NormalTermination){this.log?.("sending GoAway reason=%s",I[e]),this.localGoAway=e,this.sendFrame({type:b.GoAway,flag:0,streamID:0,length:e})}};function Bt(r){return r!=null&&typeof r.then=="function"}function zt(r={}){return()=>new le(r)}return dt(Xt);})(); -return ChainsafeLibp2PYamux})); diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/config.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/config.d.ts deleted file mode 100644 index ff55522e1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/config.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { type Logger } from '@libp2p/logger'; -export interface Config { - /** - * Used to control the log destination - * - * It can be disabled by explicitly setting to `undefined` - */ - log?: Logger; - /** - * Used to do periodic keep alive messages using a ping. - */ - enableKeepAlive: boolean; - /** - * How often to perform the keep alive - * - * measured in milliseconds - */ - keepAliveInterval: number; - /** - * Maximum number of concurrent inbound streams that we accept. - * If the peer tries to open more streams, those will be reset immediately. - */ - maxInboundStreams: number; - /** - * Maximum number of concurrent outbound streams that we accept. - * If the application tries to open more streams, the call to `newStream` will throw - */ - maxOutboundStreams: number; - /** - * Used to control the initial window size that we allow for a stream. - * - * measured in bytes - */ - initialStreamWindowSize: number; - /** - * Used to control the maximum window size that we allow for a stream. - */ - maxStreamWindowSize: number; - /** - * Maximum size of a message that we'll send on a stream. - * This ensures that a single stream doesn't hog a connection. - */ - maxMessageSize: number; -} -export declare const defaultConfig: Config; -export declare function verifyConfig(config: Config): void; -//# sourceMappingURL=config.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/config.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/config.d.ts.map deleted file mode 100644 index f936d2ec5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/config.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAIpD,MAAM,WAAW,MAAM;IACrB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,eAAe,EAAE,OAAO,CAAA;IAExB;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAA;IAE1B;;;;OAIG;IACH,uBAAuB,EAAE,MAAM,CAAA;IAE/B;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAA;IAE3B;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,aAAa,EAAE,MAS3B,CAAA;AAED,wBAAgB,YAAY,CAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAsBlD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/config.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/config.js deleted file mode 100644 index b3f7ac179..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/config.js +++ /dev/null @@ -1,37 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { logger } from '@libp2p/logger'; -import { ERR_INVALID_CONFIG, INITIAL_STREAM_WINDOW, MAX_STREAM_WINDOW } from './constants.js'; -export const defaultConfig = { - log: logger('libp2p:yamux'), - enableKeepAlive: true, - keepAliveInterval: 30000, - maxInboundStreams: 1000, - maxOutboundStreams: 1000, - initialStreamWindowSize: INITIAL_STREAM_WINDOW, - maxStreamWindowSize: MAX_STREAM_WINDOW, - maxMessageSize: 64 * 1024 -}; -export function verifyConfig(config) { - if (config.keepAliveInterval <= 0) { - throw new CodeError('keep-alive interval must be positive', ERR_INVALID_CONFIG); - } - if (config.maxInboundStreams < 0) { - throw new CodeError('max inbound streams must be larger or equal 0', ERR_INVALID_CONFIG); - } - if (config.maxOutboundStreams < 0) { - throw new CodeError('max outbound streams must be larger or equal 0', ERR_INVALID_CONFIG); - } - if (config.initialStreamWindowSize < INITIAL_STREAM_WINDOW) { - throw new CodeError('InitialStreamWindowSize must be larger or equal 256 kB', ERR_INVALID_CONFIG); - } - if (config.maxStreamWindowSize < config.initialStreamWindowSize) { - throw new CodeError('MaxStreamWindowSize must be larger than the InitialStreamWindowSize', ERR_INVALID_CONFIG); - } - if (config.maxStreamWindowSize > 2 ** 32 - 1) { - throw new CodeError('MaxStreamWindowSize must be less than equal MAX_UINT32', ERR_INVALID_CONFIG); - } - if (config.maxMessageSize < 1024) { - throw new CodeError('MaxMessageSize must be greater than a kilobyte', ERR_INVALID_CONFIG); - } -} -//# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/config.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/config.js.map deleted file mode 100644 index 1f9fe8cb1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,MAAM,EAAe,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAsD7F,MAAM,CAAC,MAAM,aAAa,GAAW;IACnC,GAAG,EAAE,MAAM,CAAC,cAAc,CAAC;IAC3B,eAAe,EAAE,IAAI;IACrB,iBAAiB,EAAE,KAAM;IACzB,iBAAiB,EAAE,IAAK;IACxB,kBAAkB,EAAE,IAAK;IACzB,uBAAuB,EAAE,qBAAqB;IAC9C,mBAAmB,EAAE,iBAAiB;IACtC,cAAc,EAAE,EAAE,GAAG,IAAI;CAC1B,CAAA;AAED,MAAM,UAAU,YAAY,CAAE,MAAc;IAC1C,IAAI,MAAM,CAAC,iBAAiB,IAAI,CAAC,EAAE;QACjC,MAAM,IAAI,SAAS,CAAC,sCAAsC,EAAE,kBAAkB,CAAC,CAAA;KAChF;IACD,IAAI,MAAM,CAAC,iBAAiB,GAAG,CAAC,EAAE;QAChC,MAAM,IAAI,SAAS,CAAC,+CAA+C,EAAE,kBAAkB,CAAC,CAAA;KACzF;IACD,IAAI,MAAM,CAAC,kBAAkB,GAAG,CAAC,EAAE;QACjC,MAAM,IAAI,SAAS,CAAC,gDAAgD,EAAE,kBAAkB,CAAC,CAAA;KAC1F;IACD,IAAI,MAAM,CAAC,uBAAuB,GAAG,qBAAqB,EAAE;QAC1D,MAAM,IAAI,SAAS,CAAC,wDAAwD,EAAE,kBAAkB,CAAC,CAAA;KAClG;IACD,IAAI,MAAM,CAAC,mBAAmB,GAAG,MAAM,CAAC,uBAAuB,EAAE;QAC/D,MAAM,IAAI,SAAS,CAAC,qEAAqE,EAAE,kBAAkB,CAAC,CAAA;KAC/G;IACD,IAAI,MAAM,CAAC,mBAAmB,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE;QAC5C,MAAM,IAAI,SAAS,CAAC,wDAAwD,EAAE,kBAAkB,CAAC,CAAA;KAClG;IACD,IAAI,MAAM,CAAC,cAAc,GAAG,IAAI,EAAE;QAChC,MAAM,IAAI,SAAS,CAAC,gDAAgD,EAAE,kBAAkB,CAAC,CAAA;KAC1F;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/constants.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/constants.d.ts deleted file mode 100644 index a9ad1e4d6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/constants.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -export declare const ERR_INVALID_FRAME = "ERR_INVALID_FRAME"; -export declare const ERR_UNREQUESTED_PING = "ERR_UNREQUESTED_PING"; -export declare const ERR_NOT_MATCHING_PING = "ERR_NOT_MATCHING_PING"; -export declare const ERR_STREAM_ALREADY_EXISTS = "ERR_STREAM_ALREADY_EXISTS"; -export declare const ERR_DECODE_INVALID_VERSION = "ERR_DECODE_INVALID_VERSION"; -export declare const ERR_BOTH_CLIENTS = "ERR_BOTH_CLIENTS"; -export declare const ERR_RECV_WINDOW_EXCEEDED = "ERR_RECV_WINDOW_EXCEEDED"; -export declare const PROTOCOL_ERRORS: Set; -export declare const ERR_INVALID_CONFIG = "ERR_INVALID_CONFIG"; -export declare const ERR_MUXER_LOCAL_CLOSED = "ERR_MUXER_LOCAL_CLOSED"; -export declare const ERR_MUXER_REMOTE_CLOSED = "ERR_MUXER_REMOTE_CLOSED"; -export declare const ERR_STREAM_RESET = "ERR_STREAM_RESET"; -export declare const ERR_STREAM_ABORT = "ERR_STREAM_ABORT"; -export declare const ERR_MAX_OUTBOUND_STREAMS_EXCEEDED = "ERROR_MAX_OUTBOUND_STREAMS_EXCEEDED"; -export declare const ERR_DECODE_IN_PROGRESS = "ERR_DECODE_IN_PROGRESS"; -/** - * INITIAL_STREAM_WINDOW is the initial stream window size. - * - * Not an implementation choice, this is defined in the specification - */ -export declare const INITIAL_STREAM_WINDOW: number; -/** - * Default max stream window - */ -export declare const MAX_STREAM_WINDOW: number; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/constants.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/constants.d.ts.map deleted file mode 100644 index 81d5aa8ae..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,sBAAsB,CAAA;AACpD,eAAO,MAAM,oBAAoB,yBAAyB,CAAA;AAC1D,eAAO,MAAM,qBAAqB,0BAA0B,CAAA;AAC5D,eAAO,MAAM,yBAAyB,8BAA8B,CAAA;AACpE,eAAO,MAAM,0BAA0B,+BAA+B,CAAA;AACtE,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAClD,eAAO,MAAM,wBAAwB,6BAA6B,CAAA;AAElE,eAAO,MAAM,eAAe,aAQ1B,CAAA;AAIF,eAAO,MAAM,kBAAkB,uBAAuB,CAAA;AACtD,eAAO,MAAM,sBAAsB,2BAA2B,CAAA;AAC9D,eAAO,MAAM,uBAAuB,4BAA4B,CAAA;AAChE,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAClD,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAClD,eAAO,MAAM,iCAAiC,wCAAwC,CAAA;AACtF,eAAO,MAAM,sBAAsB,2BAA2B,CAAA;AAE9D;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAa,CAAA;AAE/C;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAmB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/constants.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/constants.js deleted file mode 100644 index ddc95641a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/constants.js +++ /dev/null @@ -1,36 +0,0 @@ -// Protocol violation errors -export const ERR_INVALID_FRAME = 'ERR_INVALID_FRAME'; -export const ERR_UNREQUESTED_PING = 'ERR_UNREQUESTED_PING'; -export const ERR_NOT_MATCHING_PING = 'ERR_NOT_MATCHING_PING'; -export const ERR_STREAM_ALREADY_EXISTS = 'ERR_STREAM_ALREADY_EXISTS'; -export const ERR_DECODE_INVALID_VERSION = 'ERR_DECODE_INVALID_VERSION'; -export const ERR_BOTH_CLIENTS = 'ERR_BOTH_CLIENTS'; -export const ERR_RECV_WINDOW_EXCEEDED = 'ERR_RECV_WINDOW_EXCEEDED'; -export const PROTOCOL_ERRORS = new Set([ - ERR_INVALID_FRAME, - ERR_UNREQUESTED_PING, - ERR_NOT_MATCHING_PING, - ERR_STREAM_ALREADY_EXISTS, - ERR_DECODE_INVALID_VERSION, - ERR_BOTH_CLIENTS, - ERR_RECV_WINDOW_EXCEEDED -]); -// local errors -export const ERR_INVALID_CONFIG = 'ERR_INVALID_CONFIG'; -export const ERR_MUXER_LOCAL_CLOSED = 'ERR_MUXER_LOCAL_CLOSED'; -export const ERR_MUXER_REMOTE_CLOSED = 'ERR_MUXER_REMOTE_CLOSED'; -export const ERR_STREAM_RESET = 'ERR_STREAM_RESET'; -export const ERR_STREAM_ABORT = 'ERR_STREAM_ABORT'; -export const ERR_MAX_OUTBOUND_STREAMS_EXCEEDED = 'ERROR_MAX_OUTBOUND_STREAMS_EXCEEDED'; -export const ERR_DECODE_IN_PROGRESS = 'ERR_DECODE_IN_PROGRESS'; -/** - * INITIAL_STREAM_WINDOW is the initial stream window size. - * - * Not an implementation choice, this is defined in the specification - */ -export const INITIAL_STREAM_WINDOW = 256 * 1024; -/** - * Default max stream window - */ -export const MAX_STREAM_WINDOW = 16 * 1024 * 1024; -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/constants.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/constants.js.map deleted file mode 100644 index 6995fa29b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAE5B,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAA;AACpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAA;AAC1D,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAA;AAC5D,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAA;AACpE,MAAM,CAAC,MAAM,0BAA0B,GAAG,4BAA4B,CAAA;AACtE,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAA;AAClD,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAA;AAElE,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IACrC,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,yBAAyB;IACzB,0BAA0B;IAC1B,gBAAgB;IAChB,wBAAwB;CACzB,CAAC,CAAA;AAEF,eAAe;AAEf,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAA;AACtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAA;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAA;AAClD,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAA;AAClD,MAAM,CAAC,MAAM,iCAAiC,GAAG,qCAAqC,CAAA;AACtF,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAE9D;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,GAAG,IAAI,CAAA;AAE/C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/decode.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/decode.d.ts deleted file mode 100644 index 213b19340..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/decode.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import { type FrameHeader } from './frame.js'; -import type { Source } from 'it-stream-types'; -/** - * Decode a header from the front of a buffer - * - * @param data - Assumed to have enough bytes for a header - */ -export declare function decodeHeader(data: Uint8Array): FrameHeader; -/** - * Decodes yamux frames from a source - */ -export declare class Decoder { - private readonly source; - /** Buffer for in-progress frames */ - private readonly buffer; - /** Used to sanity check against decoding while in an inconsistent state */ - private frameInProgress; - constructor(source: Source); - /** - * Emits frames from the decoder source. - * - * Note: If `readData` is emitted, it _must_ be called before the next iteration - * Otherwise an error is thrown - */ - emitFrames(): AsyncGenerator<{ - header: FrameHeader; - readData?: () => Promise; - }>; - private readHeader; - private readBytes; -} -/** - * Strip the `return` method from a `Source` - */ -export declare function returnlessSource(source: Source): Source; -//# sourceMappingURL=decode.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/decode.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/decode.d.ts.map deleted file mode 100644 index e5734d620..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/decode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../src/decode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,EAAE,KAAK,WAAW,EAA2C,MAAM,YAAY,CAAA;AACtF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAM7C;;;;GAIG;AACH,wBAAgB,YAAY,CAAE,IAAI,EAAE,UAAU,GAAG,WAAW,CAU3D;AAED;;GAEG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;IAC5D,oCAAoC;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;IACvC,2EAA2E;IAC3E,OAAO,CAAC,eAAe,CAAS;gBAEnB,MAAM,EAAE,MAAM,CAAC,UAAU,GAAG,cAAc,CAAC;IAcxD;;;;;OAKG;IACK,UAAU,IAAK,cAAc,CAAC;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,CAAA;KAAE,CAAC;IA4BxG,OAAO,CAAC,UAAU;YAiBJ,SAAS;CAoBxB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAG,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAgBjE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/decode.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/decode.js deleted file mode 100644 index aaf020d66..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/decode.js +++ /dev/null @@ -1,131 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { Uint8ArrayList } from 'uint8arraylist'; -import { ERR_DECODE_INVALID_VERSION, ERR_DECODE_IN_PROGRESS } from './constants.js'; -import { FrameType, HEADER_LENGTH, YAMUX_VERSION } from './frame.js'; -// used to bitshift in decoding -// native bitshift can overflow into a negative number, so we bitshift by multiplying by a power of 2 -const twoPow24 = 2 ** 24; -/** - * Decode a header from the front of a buffer - * - * @param data - Assumed to have enough bytes for a header - */ -export function decodeHeader(data) { - if (data[0] !== YAMUX_VERSION) { - throw new CodeError('Invalid frame version', ERR_DECODE_INVALID_VERSION); - } - return { - type: data[1], - flag: (data[2] << 8) + data[3], - streamID: (data[4] * twoPow24) + (data[5] << 16) + (data[6] << 8) + data[7], - length: (data[8] * twoPow24) + (data[9] << 16) + (data[10] << 8) + data[11] - }; -} -/** - * Decodes yamux frames from a source - */ -export class Decoder { - source; - /** Buffer for in-progress frames */ - buffer; - /** Used to sanity check against decoding while in an inconsistent state */ - frameInProgress; - constructor(source) { - // Normally, when entering a for-await loop with an iterable/async iterable, the only ways to exit the loop are: - // 1. exhaust the iterable - // 2. throw an error - slow, undesirable if there's not actually an error - // 3. break or return - calls the iterable's `return` method, finalizing the iterable, no more iteration possible - // - // In this case, we want to enter (and exit) a for-await loop per chunked data frame and continue processing the iterable. - // To do this, we strip the `return` method from the iterator and can now `break` early and continue iterating. - // Exiting the main for-await is still possible via 1. and 2. - this.source = returnlessSource(source); - this.buffer = new Uint8ArrayList(); - this.frameInProgress = false; - } - /** - * Emits frames from the decoder source. - * - * Note: If `readData` is emitted, it _must_ be called before the next iteration - * Otherwise an error is thrown - */ - async *emitFrames() { - for await (const chunk of this.source) { - this.buffer.append(chunk); - // Loop to consume as many bytes from the buffer as possible - // Eg: when a single chunk contains several frames - while (true) { - const header = this.readHeader(); - if (header === undefined) { - break; - } - const { type, length } = header; - if (type === FrameType.Data) { - // This is a data frame, the frame body must still be read - // `readData` must be called before the next iteration here - this.frameInProgress = true; - yield { - header, - readData: this.readBytes.bind(this, length) - }; - } - else { - yield { header }; - } - } - } - } - readHeader() { - // Sanity check to ensure a header isn't read when another frame is partially decoded - // In practice this shouldn't happen - if (this.frameInProgress) { - throw new CodeError('decoding frame already in progress', ERR_DECODE_IN_PROGRESS); - } - if (this.buffer.length < HEADER_LENGTH) { - // not enough data yet - return; - } - const header = decodeHeader(this.buffer.subarray(0, HEADER_LENGTH)); - this.buffer.consume(HEADER_LENGTH); - return header; - } - async readBytes(length) { - if (this.buffer.length < length) { - for await (const chunk of this.source) { - this.buffer.append(chunk); - if (this.buffer.length >= length) { - // see note above, the iterator is not `return`ed here - break; - } - } - } - const out = this.buffer.sublist(0, length); - this.buffer.consume(length); - // The next frame can now be decoded - this.frameInProgress = false; - return out; - } -} -/** - * Strip the `return` method from a `Source` - */ -export function returnlessSource(source) { - if (source[Symbol.iterator] !== undefined) { - const iterator = source[Symbol.iterator](); - iterator.return = undefined; - return { - [Symbol.iterator]() { return iterator; } - }; - } - else if (source[Symbol.asyncIterator] !== undefined) { - const iterator = source[Symbol.asyncIterator](); - iterator.return = undefined; - return { - [Symbol.asyncIterator]() { return iterator; } - }; - } - else { - throw new Error('a source must be either an iterable or an async iterable'); - } -} -//# sourceMappingURL=decode.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/decode.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/decode.js.map deleted file mode 100644 index 4f017a489..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/decode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode.js","sourceRoot":"","sources":["../../src/decode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AACnF,OAAO,EAAoB,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAGtF,+BAA+B;AAC/B,qGAAqG;AACrG,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAA;AAExB;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAE,IAAgB;IAC5C,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,aAAa,EAAE;QAC7B,MAAM,IAAI,SAAS,CAAC,uBAAuB,EAAE,0BAA0B,CAA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,IAAI,MAAM,EAAE;oBAChC,sDAAsD;oBACtD,MAAK;iBACN;aACF;SACF;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;QAC1C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAE3B,oCAAoC;QACpC,IAAI,CAAC,eAAe,GAAG,KAAK,CAAA;QAE5B,OAAO,GAAG,CAAA;IACZ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAK,MAAiB;IACpD,IAAK,MAAsB,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE;QAC1D,MAAM,QAAQ,GAAI,MAAsB,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAA;QAC3D,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAA;QAC3B,OAAO;YACL,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAM,OAAO,QAAQ,CAAA,CAAC,CAAC;SACzC,CAAA;KACF;SAAM,IAAK,MAA2B,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,SAAS,EAAE;QAC3E,MAAM,QAAQ,GAAI,MAA2B,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAA;QACrE,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAA;QAC3B,OAAO;YACL,CAAC,MAAM,CAAC,aAAa,CAAC,KAAM,OAAO,QAAQ,CAAA,CAAC,CAAC;SAC9C,CAAA;KACF;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAA;KAC5E;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/encode.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/encode.d.ts deleted file mode 100644 index 22cda8ff5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/encode.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FrameHeader } from './frame.js'; -export declare function encodeHeader(header: FrameHeader): Uint8Array; -//# sourceMappingURL=encode.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/encode.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/encode.d.ts.map deleted file mode 100644 index 663e060f6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/encode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../src/encode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C,wBAAgB,YAAY,CAAE,MAAM,EAAE,WAAW,GAAG,UAAU,CAsB7D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/encode.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/encode.js deleted file mode 100644 index ef322918e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/encode.js +++ /dev/null @@ -1,19 +0,0 @@ -import { HEADER_LENGTH } from './frame.js'; -export function encodeHeader(header) { - const frame = new Uint8Array(HEADER_LENGTH); - // always assume version 0 - // frameView.setUint8(0, header.version) - frame[1] = header.type; - frame[2] = header.flag >>> 8; - frame[3] = header.flag; - frame[4] = header.streamID >>> 24; - frame[5] = header.streamID >>> 16; - frame[6] = header.streamID >>> 8; - frame[7] = header.streamID; - frame[8] = header.length >>> 24; - frame[9] = header.length >>> 16; - frame[10] = header.length >>> 8; - frame[11] = header.length; - return frame; -} -//# sourceMappingURL=encode.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/encode.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/encode.js.map deleted file mode 100644 index 2c3e44e75..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/encode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode.js","sourceRoot":"","sources":["../../src/encode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG1C,MAAM,UAAU,YAAY,CAAE,MAAmB;IAC/C,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,aAAa,CAAC,CAAA;IAE3C,0BAA0B;IAC1B,wCAAwC;IAExC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAA;IAEtB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,KAAK,CAAC,CAAA;IAC5B,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAA;IAEtB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,KAAK,EAAE,CAAA;IACjC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,KAAK,EAAE,CAAA;IACjC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAA;IAChC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAA;IAE1B,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,EAAE,CAAA;IAC/B,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,EAAE,CAAA;IAC/B,KAAK,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,CAAC,CAAA;IAC/B,KAAK,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,CAAA;IAEzB,OAAO,KAAK,CAAA;AACd,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/frame.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/frame.d.ts deleted file mode 100644 index 2ca65226f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/frame.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -export declare enum FrameType { - /** Used to transmit data. May transmit zero length payloads depending on the flags. */ - Data = 0, - /** Used to updated the senders receive window size. This is used to implement per-session flow control. */ - WindowUpdate = 1, - /** Used to measure RTT. It can also be used to heart-beat and do keep-alives over TCP. */ - Ping = 2, - /** Used to close a session. */ - GoAway = 3 -} -export declare enum Flag { - /** Signals the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate outbound. */ - SYN = 1, - /** Acknowledges the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate response. */ - ACK = 2, - /** Performs a half-close of a stream. May be sent with a data message or window update. */ - FIN = 4, - /** Reset a stream immediately. May be sent with a data or window update message. */ - RST = 8 -} -export declare const YAMUX_VERSION = 0; -export declare enum GoAwayCode { - NormalTermination = 0, - ProtocolError = 1, - InternalError = 2 -} -export declare const HEADER_LENGTH = 12; -export interface FrameHeader { - /** - * The version field is used for future backward compatibility. - * At the current time, the field is always set to 0, to indicate the initial version. - */ - version?: number; - /** The type field is used to switch the frame message type. */ - type: FrameType; - /** The flags field is used to provide additional information related to the message type. */ - flag: number; - /** - * The StreamID field is used to identify the logical stream the frame is addressing. - * The client side should use odd ID's, and the server even. - * This prevents any collisions. Additionally, the 0 ID is reserved to represent the session. - */ - streamID: number; - /** - * The meaning of the length field depends on the message type: - * * Data - provides the length of bytes following the header - * * Window update - provides a delta update to the window size - * * Ping - Contains an opaque value, echoed back - * * Go Away - Contains an error code - */ - length: number; -} -export declare function stringifyHeader(header: FrameHeader): string; -//# sourceMappingURL=frame.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/frame.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/frame.d.ts.map deleted file mode 100644 index eed8a553b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/frame.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../src/frame.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,uFAAuF;IACvF,IAAI,IAAM;IACV,2GAA2G;IAC3G,YAAY,IAAM;IAClB,0FAA0F;IAC1F,IAAI,IAAM;IACV,+BAA+B;IAC/B,MAAM,IAAM;CACb;AAED,oBAAY,IAAI;IACd,uIAAuI;IACvI,GAAG,IAAM;IACT,4IAA4I;IAC5I,GAAG,IAAM;IACT,2FAA2F;IAC3F,GAAG,IAAM;IACT,oFAAoF;IACpF,GAAG,IAAM;CACV;AAID,eAAO,MAAM,aAAa,IAAI,CAAA;AAE9B,oBAAY,UAAU;IACpB,iBAAiB,IAAM;IACvB,aAAa,IAAM;IACnB,aAAa,IAAM;CACpB;AAED,eAAO,MAAM,aAAa,KAAK,CAAA;AAE/B,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,+DAA+D;IAC/D,IAAI,EAAE,SAAS,CAAA;IACf,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,eAAe,CAAE,MAAM,EAAE,WAAW,GAAG,MAAM,CAG5D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/frame.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/frame.js deleted file mode 100644 index de1f1c83d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/frame.js +++ /dev/null @@ -1,36 +0,0 @@ -export var FrameType; -(function (FrameType) { - /** Used to transmit data. May transmit zero length payloads depending on the flags. */ - FrameType[FrameType["Data"] = 0] = "Data"; - /** Used to updated the senders receive window size. This is used to implement per-session flow control. */ - FrameType[FrameType["WindowUpdate"] = 1] = "WindowUpdate"; - /** Used to measure RTT. It can also be used to heart-beat and do keep-alives over TCP. */ - FrameType[FrameType["Ping"] = 2] = "Ping"; - /** Used to close a session. */ - FrameType[FrameType["GoAway"] = 3] = "GoAway"; -})(FrameType || (FrameType = {})); -export var Flag; -(function (Flag) { - /** Signals the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate outbound. */ - Flag[Flag["SYN"] = 1] = "SYN"; - /** Acknowledges the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate response. */ - Flag[Flag["ACK"] = 2] = "ACK"; - /** Performs a half-close of a stream. May be sent with a data message or window update. */ - Flag[Flag["FIN"] = 4] = "FIN"; - /** Reset a stream immediately. May be sent with a data or window update message. */ - Flag[Flag["RST"] = 8] = "RST"; -})(Flag || (Flag = {})); -const flagCodes = Object.values(Flag).filter((x) => typeof x !== 'string'); -export const YAMUX_VERSION = 0; -export var GoAwayCode; -(function (GoAwayCode) { - GoAwayCode[GoAwayCode["NormalTermination"] = 0] = "NormalTermination"; - GoAwayCode[GoAwayCode["ProtocolError"] = 1] = "ProtocolError"; - GoAwayCode[GoAwayCode["InternalError"] = 2] = "InternalError"; -})(GoAwayCode || (GoAwayCode = {})); -export const HEADER_LENGTH = 12; -export function stringifyHeader(header) { - const flags = flagCodes.filter(f => (header.flag & f) === f).map(f => Flag[f]).join('|'); - return `streamID=${header.streamID} type=${FrameType[header.type]} flag=${flags} length=${header.length}`; -} -//# sourceMappingURL=frame.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/frame.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/frame.js.map deleted file mode 100644 index 96ab043f8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/frame.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"frame.js","sourceRoot":"","sources":["../../src/frame.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,SASX;AATD,WAAY,SAAS;IACnB,uFAAuF;IACvF,yCAAU,CAAA;IACV,2GAA2G;IAC3G,yDAAkB,CAAA;IAClB,0FAA0F;IAC1F,yCAAU,CAAA;IACV,+BAA+B;IAC/B,6CAAY,CAAA;AACd,CAAC,EATW,SAAS,KAAT,SAAS,QASpB;AAED,MAAM,CAAN,IAAY,IASX;AATD,WAAY,IAAI;IACd,uIAAuI;IACvI,6BAAS,CAAA;IACT,4IAA4I;IAC5I,6BAAS,CAAA;IACT,2FAA2F;IAC3F,6BAAS,CAAA;IACT,oFAAoF;IACpF,6BAAS,CAAA;AACX,CAAC,EATW,IAAI,KAAJ,IAAI,QASf;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAW,CAAA;AAEpF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAA;AAE9B,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,qEAAuB,CAAA;IACvB,6DAAmB,CAAA;IACnB,6DAAmB,CAAA;AACrB,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAA;AA4B/B,MAAM,UAAU,eAAe,CAAE,MAAmB;IAClD,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACxF,OAAO,YAAY,MAAM,CAAC,QAAQ,SAAS,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,KAAK,WAAW,MAAM,CAAC,MAAM,EAAE,CAAA;AAC3G,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/index.d.ts deleted file mode 100644 index 53e2e5cb6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { YamuxMuxerInit } from './muxer.js'; -import type { StreamMuxerFactory } from '@libp2p/interface/stream-muxer'; -export { GoAwayCode } from './frame.js'; -export declare function yamux(init?: YamuxMuxerInit): () => StreamMuxerFactory; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/index.d.ts.map deleted file mode 100644 index e74ad16c9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,wBAAgB,KAAK,CAAE,IAAI,GAAE,cAAmB,GAAG,MAAM,kBAAkB,CAE1E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/index.js deleted file mode 100644 index 9bb750727..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import { Yamux } from './muxer.js'; -export { GoAwayCode } from './frame.js'; -export function yamux(init = {}) { - return () => new Yamux(init); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/index.js.map deleted file mode 100644 index a572a9651..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,MAAM,UAAU,KAAK,CAAE,OAAuB,EAAE;IAC9C,OAAO,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/muxer.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/muxer.d.ts deleted file mode 100644 index 15b2d6221..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/muxer.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { type Pushable } from 'it-pushable'; -import { type Config } from './config.js'; -import { GoAwayCode } from './frame.js'; -import { YamuxStream } from './stream.js'; -import type { AbortOptions } from '@libp2p/interface'; -import type { StreamMuxer, StreamMuxerFactory, StreamMuxerInit } from '@libp2p/interface/stream-muxer'; -import type { Sink, Source } from 'it-stream-types'; -import type { Uint8ArrayList } from 'uint8arraylist'; -export interface YamuxMuxerInit extends StreamMuxerInit, Partial { -} -export declare class Yamux implements StreamMuxerFactory { - protocol: string; - private readonly _init; - constructor(init?: YamuxMuxerInit); - createStreamMuxer(init?: YamuxMuxerInit): YamuxMuxer; -} -export interface CloseOptions extends AbortOptions { - reason?: GoAwayCode; -} -export declare class YamuxMuxer implements StreamMuxer { - protocol: string; - source: Pushable; - sink: Sink, Promise>; - private readonly config; - private readonly log?; - /** Used to close the muxer from either the sink or source */ - private readonly closeController; - /** The next stream id to be used when initiating a new stream */ - private nextStreamID; - /** Primary stream mapping, streamID => stream */ - private readonly _streams; - /** The next ping id to be used when pinging */ - private nextPingID; - /** Tracking info for the currently active ping */ - private activePing?; - /** Round trip time */ - private rtt; - /** True if client, false if server */ - private readonly client; - private localGoAway?; - private remoteGoAway?; - /** Number of tracked inbound streams */ - private numInboundStreams; - /** Number of tracked outbound streams */ - private numOutboundStreams; - private readonly onIncomingStream?; - private readonly onStreamEnd?; - constructor(init: YamuxMuxerInit); - get streams(): YamuxStream[]; - newStream(name?: string | undefined): YamuxStream; - /** - * Initiate a ping and wait for a response - * - * Note: only a single ping will be initiated at a time. - * If a ping is already in progress, a new ping will not be initiated. - * - * @returns the round-trip-time in milliseconds - */ - ping(): Promise; - /** - * Get the ping round trip time - * - * Note: Will return 0 if no successful ping has yet been completed - * - * @returns the round-trip-time in milliseconds - */ - getRTT(): number; - /** - * Close the muxer - */ - close(options?: CloseOptions): Promise; - abort(err: Error, reason?: GoAwayCode): void; - isClosed(): boolean; - /** - * Called when either the local or remote shuts down the muxer - */ - private _closeMuxer; - /** Create a new stream */ - private _newStream; - /** - * closeStream is used to close a stream once both sides have - * issued a close. - */ - private closeStream; - private keepAliveLoop; - private handleFrame; - private handlePing; - private handlePingResponse; - private handleGoAway; - private handleStreamMessage; - private incomingStream; - private sendFrame; - private sendPing; - private sendGoAway; -} -//# sourceMappingURL=muxer.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/muxer.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/muxer.d.ts.map deleted file mode 100644 index 7170c54fe..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/muxer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"muxer.d.ts","sourceRoot":"","sources":["../../src/muxer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,KAAK,MAAM,EAA+B,MAAM,aAAa,CAAA;AAItE,OAAO,EAAqC,UAAU,EAAE,MAAM,YAAY,CAAA;AAC1E,OAAO,EAAe,WAAW,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AACtG,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAKpD,MAAM,WAAW,cAAe,SAAQ,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC;CACvE;AAED,qBAAa,KAAM,YAAW,kBAAkB;IAC9C,QAAQ,SAAoB;IAC5B,OAAO,CA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AAE,CAE5B;IAED,SAAS,CAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW;IA6BlD;;;;;;;OAOG;IACG,IAAI,IAAK,OAAO,CAAC,MAAM,CAAC;IA+C9B;;;;;;OAMG;IACH,MAAM,IAAK,MAAM;IAIjB;;OAEG;IACG,KAAK,CAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAkCvD,KAAK,CAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI;IAsB7C,QAAQ,IAAK,OAAO;IAIpB;;OAEG;IACH,OAAO,CAAC,WAAW;IAQnB,0BAA0B;IAC1B,OAAO,CAAC,UAAU;IAuBlB;;;OAGG;IACH,OAAO,CAAC,WAAW;YASL,aAAa;YAqBb,WAAW;IA8BzB,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,YAAY;YAaN,mBAAmB;IAqCjC,OAAO,CAAC,cAAc;IAyCtB,OAAO,CAAC,SAAS;IAajB,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,UAAU;CAUnB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/muxer.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/muxer.js deleted file mode 100644 index ed71ec8f6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/muxer.js +++ /dev/null @@ -1,516 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { setMaxListeners } from '@libp2p/interface/events'; -import { logger } from '@libp2p/logger'; -import { getIterator } from 'get-iterator'; -import { pushable } from 'it-pushable'; -import { defaultConfig, verifyConfig } from './config.js'; -import { ERR_BOTH_CLIENTS, ERR_INVALID_FRAME, ERR_MAX_OUTBOUND_STREAMS_EXCEEDED, ERR_MUXER_LOCAL_CLOSED, ERR_MUXER_REMOTE_CLOSED, ERR_NOT_MATCHING_PING, ERR_STREAM_ALREADY_EXISTS, ERR_UNREQUESTED_PING, PROTOCOL_ERRORS } from './constants.js'; -import { Decoder } from './decode.js'; -import { encodeHeader } from './encode.js'; -import { Flag, FrameType, GoAwayCode } from './frame.js'; -import { StreamState, YamuxStream } from './stream.js'; -const YAMUX_PROTOCOL_ID = '/yamux/1.0.0'; -const CLOSE_TIMEOUT = 500; -export class Yamux { - protocol = YAMUX_PROTOCOL_ID; - _init; - constructor(init = {}) { - this._init = init; - } - createStreamMuxer(init) { - return new YamuxMuxer({ - ...this._init, - ...init - }); - } -} -export class YamuxMuxer { - protocol = YAMUX_PROTOCOL_ID; - source; - sink; - config; - log; - /** Used to close the muxer from either the sink or source */ - closeController; - /** The next stream id to be used when initiating a new stream */ - nextStreamID; - /** Primary stream mapping, streamID => stream */ - _streams; - /** The next ping id to be used when pinging */ - nextPingID; - /** Tracking info for the currently active ping */ - activePing; - /** Round trip time */ - rtt; - /** True if client, false if server */ - client; - localGoAway; - remoteGoAway; - /** Number of tracked inbound streams */ - numInboundStreams; - /** Number of tracked outbound streams */ - numOutboundStreams; - onIncomingStream; - onStreamEnd; - constructor(init) { - this.client = init.direction === 'outbound'; - this.config = { ...defaultConfig, ...init }; - this.log = this.config.log; - verifyConfig(this.config); - this.closeController = new AbortController(); - setMaxListeners(Infinity, this.closeController.signal); - this.onIncomingStream = init.onIncomingStream; - this.onStreamEnd = init.onStreamEnd; - this._streams = new Map(); - this.source = pushable({ - onEnd: () => { - this.log?.trace('muxer source ended'); - this._streams.forEach(stream => { - stream.destroy(); - }); - } - }); - this.sink = async (source) => { - const shutDownListener = () => { - const iterator = getIterator(source); - if (iterator.return != null) { - const res = iterator.return(); - if (isPromise(res)) { - res.catch(err => { - this.log?.('could not cause sink source to return', err); - }); - } - } - }; - let reason, error; - try { - const decoder = new Decoder(source); - try { - this.closeController.signal.addEventListener('abort', shutDownListener); - for await (const frame of decoder.emitFrames()) { - await this.handleFrame(frame.header, frame.readData); - } - } - finally { - this.closeController.signal.removeEventListener('abort', shutDownListener); - } - reason = GoAwayCode.NormalTermination; - } - catch (err) { - // either a protocol or internal error - const errCode = err.code; - if (PROTOCOL_ERRORS.has(errCode)) { - this.log?.error('protocol error in sink', err); - reason = GoAwayCode.ProtocolError; - } - else { - this.log?.error('internal error in sink', err); - reason = GoAwayCode.InternalError; - } - error = err; - } - this.log?.trace('muxer sink ended'); - if (error != null) { - this.abort(error, reason); - } - else { - await this.close({ reason }); - } - }; - this.numInboundStreams = 0; - this.numOutboundStreams = 0; - // client uses odd streamIDs, server uses even streamIDs - this.nextStreamID = this.client ? 1 : 2; - this.nextPingID = 0; - this.rtt = -1; - this.log?.trace('muxer created'); - if (this.config.enableKeepAlive) { - this.keepAliveLoop().catch(e => this.log?.error('keepalive error: %s', e)); - } - // send an initial ping to establish RTT - this.ping().catch(e => this.log?.error('ping error: %s', e)); - } - get streams() { - return Array.from(this._streams.values()); - } - newStream(name) { - if (this.remoteGoAway !== undefined) { - throw new CodeError('muxer closed remotely', ERR_MUXER_REMOTE_CLOSED); - } - if (this.localGoAway !== undefined) { - throw new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED); - } - const id = this.nextStreamID; - this.nextStreamID += 2; - // check against our configured maximum number of outbound streams - if (this.numOutboundStreams >= this.config.maxOutboundStreams) { - throw new CodeError('max outbound streams exceeded', ERR_MAX_OUTBOUND_STREAMS_EXCEEDED); - } - this.log?.trace('new outgoing stream id=%s', id); - const stream = this._newStream(id, name, StreamState.Init, 'outbound'); - this._streams.set(id, stream); - this.numOutboundStreams++; - // send a window update to open the stream on the receiver end - stream.sendWindowUpdate(); - return stream; - } - /** - * Initiate a ping and wait for a response - * - * Note: only a single ping will be initiated at a time. - * If a ping is already in progress, a new ping will not be initiated. - * - * @returns the round-trip-time in milliseconds - */ - async ping() { - if (this.remoteGoAway !== undefined) { - throw new CodeError('muxer closed remotely', ERR_MUXER_REMOTE_CLOSED); - } - if (this.localGoAway !== undefined) { - throw new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED); - } - // An active ping does not yet exist, handle the process here - if (this.activePing === undefined) { - // create active ping - let _resolve = () => { }; - this.activePing = { - id: this.nextPingID++, - // this promise awaits resolution or the close controller aborting - promise: new Promise((resolve, reject) => { - const closed = () => { - reject(new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED)); - }; - this.closeController.signal.addEventListener('abort', closed, { once: true }); - _resolve = () => { - this.closeController.signal.removeEventListener('abort', closed); - resolve(); - }; - }), - resolve: _resolve - }; - // send ping - const start = Date.now(); - this.sendPing(this.activePing.id); - // await pong - try { - await this.activePing.promise; - } - finally { - // clean-up active ping - delete this.activePing; - } - // update rtt - const end = Date.now(); - this.rtt = end - start; - } - else { - // an active ping is already in progress, piggyback off that - await this.activePing.promise; - } - return this.rtt; - } - /** - * Get the ping round trip time - * - * Note: Will return 0 if no successful ping has yet been completed - * - * @returns the round-trip-time in milliseconds - */ - getRTT() { - return this.rtt; - } - /** - * Close the muxer - */ - async close(options = {}) { - if (this.closeController.signal.aborted) { - // already closed - return; - } - const reason = options?.reason ?? GoAwayCode.NormalTermination; - this.log?.trace('muxer close reason=%s', reason); - if (options.signal == null) { - const signal = AbortSignal.timeout(CLOSE_TIMEOUT); - setMaxListeners(Infinity, signal); - options = { - ...options, - signal - }; - } - try { - await Promise.all([...this._streams.values()].map(async (s) => s.close(options))); - // send reason to the other side, allow the other side to close gracefully - this.sendGoAway(reason); - this._closeMuxer(); - } - catch (err) { - this.abort(err); - } - } - abort(err, reason) { - if (this.closeController.signal.aborted) { - // already closed - return; - } - reason = reason ?? GoAwayCode.InternalError; - // If reason was provided, use that, otherwise use the presence of `err` to determine the reason - this.log?.error('muxer abort reason=%s error=%s', reason, err); - // Abort all underlying streams - for (const stream of this._streams.values()) { - stream.abort(err); - } - // send reason to the other side, allow the other side to close gracefully - this.sendGoAway(reason); - this._closeMuxer(); - } - isClosed() { - return this.closeController.signal.aborted; - } - /** - * Called when either the local or remote shuts down the muxer - */ - _closeMuxer() { - // stop the sink and any other processes - this.closeController.abort(); - // stop the source - this.source.end(); - } - /** Create a new stream */ - _newStream(id, name, state, direction) { - if (this._streams.get(id) != null) { - throw new CodeError('Stream already exists', ERR_STREAM_ALREADY_EXISTS, { id }); - } - const stream = new YamuxStream({ - id: id.toString(), - name, - state, - direction, - sendFrame: this.sendFrame.bind(this), - onEnd: () => { - this.closeStream(id); - this.onStreamEnd?.(stream); - }, - log: logger(`libp2p:yamux:${direction}:${id}`), - config: this.config, - getRTT: this.getRTT.bind(this) - }); - return stream; - } - /** - * closeStream is used to close a stream once both sides have - * issued a close. - */ - closeStream(id) { - if (this.client === (id % 2 === 0)) { - this.numInboundStreams--; - } - else { - this.numOutboundStreams--; - } - this._streams.delete(id); - } - async keepAliveLoop() { - const abortPromise = new Promise((_resolve, reject) => { this.closeController.signal.addEventListener('abort', reject, { once: true }); }); - this.log?.trace('muxer keepalive enabled interval=%s', this.config.keepAliveInterval); - while (true) { - let timeoutId; - try { - await Promise.race([ - abortPromise, - new Promise((resolve) => { - timeoutId = setTimeout(resolve, this.config.keepAliveInterval); - }) - ]); - this.ping().catch(e => this.log?.error('ping error: %s', e)); - } - catch (e) { - // closed - clearInterval(timeoutId); - return; - } - } - } - async handleFrame(header, readData) { - const { streamID, type, length } = header; - this.log?.trace('received frame %o', header); - if (streamID === 0) { - switch (type) { - case FrameType.Ping: - { - this.handlePing(header); - return; - } - case FrameType.GoAway: - { - this.handleGoAway(length); - return; - } - default: - // Invalid state - throw new CodeError('Invalid frame type', ERR_INVALID_FRAME, { header }); - } - } - else { - switch (header.type) { - case FrameType.Data: - case FrameType.WindowUpdate: - { - await this.handleStreamMessage(header, readData); - return; - } - default: - // Invalid state - throw new CodeError('Invalid frame type', ERR_INVALID_FRAME, { header }); - } - } - } - handlePing(header) { - // If the ping is initiated by the sender, send a response - if (header.flag === Flag.SYN) { - this.log?.trace('received ping request pingId=%s', header.length); - this.sendPing(header.length, Flag.ACK); - } - else if (header.flag === Flag.ACK) { - this.log?.trace('received ping response pingId=%s', header.length); - this.handlePingResponse(header.length); - } - else { - // Invalid state - throw new CodeError('Invalid frame flag', ERR_INVALID_FRAME, { header }); - } - } - handlePingResponse(pingId) { - if (this.activePing === undefined) { - // this ping was not requested - throw new CodeError('ping not requested', ERR_UNREQUESTED_PING); - } - if (this.activePing.id !== pingId) { - // this ping doesn't match our active ping request - throw new CodeError('ping doesn\'t match our id', ERR_NOT_MATCHING_PING); - } - // valid ping response - this.activePing.resolve(); - } - handleGoAway(reason) { - this.log?.trace('received GoAway reason=%s', GoAwayCode[reason] ?? 'unknown'); - this.remoteGoAway = reason; - // If the other side is friendly, they would have already closed all streams before sending a GoAway - // In case they weren't, reset all streams - for (const stream of this._streams.values()) { - stream.reset(); - } - this._closeMuxer(); - } - async handleStreamMessage(header, readData) { - const { streamID, flag, type } = header; - if ((flag & Flag.SYN) === Flag.SYN) { - this.incomingStream(streamID); - } - const stream = this._streams.get(streamID); - if (stream === undefined) { - if (type === FrameType.Data) { - this.log?.('discarding data for stream id=%s', streamID); - if (readData === undefined) { - throw new Error('unreachable'); - } - await readData(); - } - else { - this.log?.('frame for missing stream id=%s', streamID); - } - return; - } - switch (type) { - case FrameType.WindowUpdate: { - stream.handleWindowUpdate(header); - return; - } - case FrameType.Data: { - if (readData === undefined) { - throw new Error('unreachable'); - } - await stream.handleData(header, readData); - return; - } - default: - throw new Error('unreachable'); - } - } - incomingStream(id) { - if (this.client !== (id % 2 === 0)) { - throw new CodeError('both endpoints are clients', ERR_BOTH_CLIENTS); - } - if (this._streams.has(id)) { - return; - } - this.log?.trace('new incoming stream id=%s', id); - if (this.localGoAway !== undefined) { - // reject (reset) immediately if we are doing a go away - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: id, - length: 0 - }); - return; - } - // check against our configured maximum number of inbound streams - if (this.numInboundStreams >= this.config.maxInboundStreams) { - this.log?.('maxIncomingStreams exceeded, forcing stream reset'); - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: id, - length: 0 - }); - return; - } - // allocate a new stream - const stream = this._newStream(id, undefined, StreamState.SYNReceived, 'inbound'); - this.numInboundStreams++; - // the stream should now be tracked - this._streams.set(id, stream); - this.onIncomingStream?.(stream); - } - sendFrame(header, data) { - this.log?.trace('sending frame %o', header); - if (header.type === FrameType.Data) { - if (data === undefined) { - throw new CodeError('invalid frame', ERR_INVALID_FRAME); - } - this.source.push(encodeHeader(header)); - this.source.push(data); - } - else { - this.source.push(encodeHeader(header)); - } - } - sendPing(pingId, flag = Flag.SYN) { - if (flag === Flag.SYN) { - this.log?.trace('sending ping request pingId=%s', pingId); - } - else { - this.log?.trace('sending ping response pingId=%s', pingId); - } - this.sendFrame({ - type: FrameType.Ping, - flag, - streamID: 0, - length: pingId - }); - } - sendGoAway(reason = GoAwayCode.NormalTermination) { - this.log?.('sending GoAway reason=%s', GoAwayCode[reason]); - this.localGoAway = reason; - this.sendFrame({ - type: FrameType.GoAway, - flag: 0, - streamID: 0, - length: reason - }); - } -} -function isPromise(thing) { - return thing != null && typeof thing.then === 'function'; -} -//# sourceMappingURL=muxer.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/muxer.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/muxer.js.map deleted file mode 100644 index eda0e0394..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/muxer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"muxer.js","sourceRoot":"","sources":["../../src/muxer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAe,MAAM,gBAAg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F;AAED,SAAS,SAAS,CAAgB,KAAU;IAC1C,OAAO,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAA;AAC1D,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/stream.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/stream.d.ts deleted file mode 100644 index bd04f1215..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/stream.d.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { AbstractStream, type AbstractStreamInit } from '@libp2p/utils/abstract-stream'; -import { type FrameHeader } from './frame.js'; -import type { Config } from './config.js'; -import type { AbortOptions } from '@libp2p/interface'; -import type { Uint8ArrayList } from 'uint8arraylist'; -export declare enum StreamState { - Init = 0, - SYNSent = 1, - SYNReceived = 2, - Established = 3, - Finished = 4 -} -export interface YamuxStreamInit extends AbstractStreamInit { - name?: string; - sendFrame: (header: FrameHeader, body?: Uint8ArrayList) => void; - getRTT: () => number; - config: Config; - state: StreamState; -} -/** YamuxStream is used to represent a logical stream within a session */ -export declare class YamuxStream extends AbstractStream { - name?: string; - state: StreamState; - private readonly config; - private readonly _id; - /** The number of available bytes to send */ - private sendWindowCapacity; - /** Callback to notify that the sendWindowCapacity has been updated */ - private sendWindowCapacityUpdate?; - /** The number of bytes available to receive in a full window */ - private recvWindow; - /** The number of available bytes to receive */ - private recvWindowCapacity; - /** - * An 'epoch' is the time it takes to process and read data - * - * Used in conjunction with RTT to determine whether to increase the recvWindow - */ - private epochStart; - private readonly getRTT; - private readonly sendFrame; - constructor(init: YamuxStreamInit); - /** - * Send a message to the remote muxer informing them a new stream is being - * opened. - * - * This is a noop for Yamux because the first window update is sent when - * .newStream is called on the muxer which opens the stream on the remote. - */ - sendNewStream(): Promise; - /** - * Send a data message to the remote muxer - */ - sendData(buf: Uint8ArrayList, options?: AbortOptions): Promise; - /** - * Send a reset message to the remote muxer - */ - sendReset(): Promise; - /** - * Send a message to the remote muxer, informing them no more data messages - * will be sent by this end of the stream - */ - sendCloseWrite(): Promise; - /** - * Send a message to the remote muxer, informing them no more data messages - * will be read by this end of the stream - */ - sendCloseRead(): Promise; - /** - * Wait for the send window to be non-zero - * - * Will throw with ERR_STREAM_ABORT if the stream gets aborted - */ - waitForSendWindowCapacity(options?: AbortOptions): Promise; - /** - * handleWindowUpdate is called when the stream receives a window update frame - */ - handleWindowUpdate(header: FrameHeader): void; - /** - * handleData is called when the stream receives a data frame - */ - handleData(header: FrameHeader, readData: () => Promise): Promise; - /** - * processFlags is used to update the state of the stream based on set flags, if any. - */ - private processFlags; - /** - * getSendFlags determines any flags that are appropriate - * based on the current stream state. - * - * The state is updated as a side-effect. - */ - private getSendFlags; - /** - * potentially sends a window update enabling further writes to take place. - */ - sendWindowUpdate(): void; -} -//# sourceMappingURL=stream.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/stream.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/stream.d.ts.map deleted file mode 100644 index 62a15c3fd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/stream.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/stream.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAGvF,OAAO,EAAQ,KAAK,WAAW,EAA4B,MAAM,YAAY,CAAA;AAC7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBA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C;IAUtC;;;OAGG;IACG,aAAa,IAAK,OAAO,CAAC,IAAI,CAAC;IAIrC;;;;OAIG;IACG,yBAAyB,CAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IA8B3E;;OAEG;IACH,kBAAkB,CAAE,MAAM,EAAE,WAAW,GAAG,IAAI;IAa9C;;OAEG;IACG,UAAU,CAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAe9F;;OAEG;IACH,OAAO,CAAC,YAAY;IAcpB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAapB;;OAEG;IACH,gBAAgB,IAAK,IAAI;CAkC1B"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/stream.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/stream.js deleted file mode 100644 index 4b8a1f42d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/stream.js +++ /dev/null @@ -1,254 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { AbstractStream } from '@libp2p/utils/abstract-stream'; -import each from 'it-foreach'; -import { ERR_RECV_WINDOW_EXCEEDED, ERR_STREAM_ABORT, INITIAL_STREAM_WINDOW } from './constants.js'; -import { Flag, FrameType, HEADER_LENGTH } from './frame.js'; -export var StreamState; -(function (StreamState) { - StreamState[StreamState["Init"] = 0] = "Init"; - StreamState[StreamState["SYNSent"] = 1] = "SYNSent"; - StreamState[StreamState["SYNReceived"] = 2] = "SYNReceived"; - StreamState[StreamState["Established"] = 3] = "Established"; - StreamState[StreamState["Finished"] = 4] = "Finished"; -})(StreamState || (StreamState = {})); -/** YamuxStream is used to represent a logical stream within a session */ -export class YamuxStream extends AbstractStream { - name; - state; - config; - _id; - /** The number of available bytes to send */ - sendWindowCapacity; - /** Callback to notify that the sendWindowCapacity has been updated */ - sendWindowCapacityUpdate; - /** The number of bytes available to receive in a full window */ - recvWindow; - /** The number of available bytes to receive */ - recvWindowCapacity; - /** - * An 'epoch' is the time it takes to process and read data - * - * Used in conjunction with RTT to determine whether to increase the recvWindow - */ - epochStart; - getRTT; - sendFrame; - constructor(init) { - super({ - ...init, - onEnd: (err) => { - this.state = StreamState.Finished; - init.onEnd?.(err); - } - }); - this.config = init.config; - this._id = parseInt(init.id, 10); - this.name = init.name; - this.state = init.state; - this.sendWindowCapacity = INITIAL_STREAM_WINDOW; - this.recvWindow = this.config.initialStreamWindowSize; - this.recvWindowCapacity = this.recvWindow; - this.epochStart = Date.now(); - this.getRTT = init.getRTT; - this.sendFrame = init.sendFrame; - this.source = each(this.source, () => { - this.sendWindowUpdate(); - }); - } - /** - * Send a message to the remote muxer informing them a new stream is being - * opened. - * - * This is a noop for Yamux because the first window update is sent when - * .newStream is called on the muxer which opens the stream on the remote. - */ - async sendNewStream() { - } - /** - * Send a data message to the remote muxer - */ - async sendData(buf, options = {}) { - buf = buf.sublist(); - // send in chunks, waiting for window updates - while (buf.byteLength !== 0) { - // wait for the send window to refill - if (this.sendWindowCapacity === 0) { - await this.waitForSendWindowCapacity(options); - } - // check we didn't close while waiting for send window capacity - if (this.status !== 'open') { - return; - } - // send as much as we can - const toSend = Math.min(this.sendWindowCapacity, this.config.maxMessageSize - HEADER_LENGTH, buf.length); - const flags = this.getSendFlags(); - this.sendFrame({ - type: FrameType.Data, - flag: flags, - streamID: this._id, - length: toSend - }, buf.sublist(0, toSend)); - this.sendWindowCapacity -= toSend; - buf.consume(toSend); - } - } - /** - * Send a reset message to the remote muxer - */ - async sendReset() { - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: this._id, - length: 0 - }); - } - /** - * Send a message to the remote muxer, informing them no more data messages - * will be sent by this end of the stream - */ - async sendCloseWrite() { - const flags = this.getSendFlags() | Flag.FIN; - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: flags, - streamID: this._id, - length: 0 - }); - } - /** - * Send a message to the remote muxer, informing them no more data messages - * will be read by this end of the stream - */ - async sendCloseRead() { - } - /** - * Wait for the send window to be non-zero - * - * Will throw with ERR_STREAM_ABORT if the stream gets aborted - */ - async waitForSendWindowCapacity(options = {}) { - if (this.sendWindowCapacity > 0) { - return; - } - let resolve; - let reject; - const abort = () => { - if (this.status === 'open') { - reject(new CodeError('stream aborted', ERR_STREAM_ABORT)); - } - else { - // the stream was closed already, ignore the failure to send - resolve(); - } - }; - options.signal?.addEventListener('abort', abort); - try { - await new Promise((_resolve, _reject) => { - this.sendWindowCapacityUpdate = () => { - _resolve(); - }; - reject = _reject; - resolve = _resolve; - }); - } - finally { - options.signal?.removeEventListener('abort', abort); - } - } - /** - * handleWindowUpdate is called when the stream receives a window update frame - */ - handleWindowUpdate(header) { - this.log?.trace('stream received window update id=%s', this._id); - this.processFlags(header.flag); - // increase send window - const available = this.sendWindowCapacity; - this.sendWindowCapacity += header.length; - // if the update increments a 0 availability, notify the stream that sending can resume - if (available === 0 && header.length > 0) { - this.sendWindowCapacityUpdate?.(); - } - } - /** - * handleData is called when the stream receives a data frame - */ - async handleData(header, readData) { - this.log?.trace('stream received data id=%s', this._id); - this.processFlags(header.flag); - // check that our recv window is not exceeded - if (this.recvWindowCapacity < header.length) { - throw new CodeError('receive window exceeded', ERR_RECV_WINDOW_EXCEEDED, { available: this.recvWindowCapacity, recv: header.length }); - } - const data = await readData(); - this.recvWindowCapacity -= header.length; - this.sourcePush(data); - } - /** - * processFlags is used to update the state of the stream based on set flags, if any. - */ - processFlags(flags) { - if ((flags & Flag.ACK) === Flag.ACK) { - if (this.state === StreamState.SYNSent) { - this.state = StreamState.Established; - } - } - if ((flags & Flag.FIN) === Flag.FIN) { - this.remoteCloseWrite(); - } - if ((flags & Flag.RST) === Flag.RST) { - this.reset(); - } - } - /** - * getSendFlags determines any flags that are appropriate - * based on the current stream state. - * - * The state is updated as a side-effect. - */ - getSendFlags() { - switch (this.state) { - case StreamState.Init: - this.state = StreamState.SYNSent; - return Flag.SYN; - case StreamState.SYNReceived: - this.state = StreamState.Established; - return Flag.ACK; - default: - return 0; - } - } - /** - * potentially sends a window update enabling further writes to take place. - */ - sendWindowUpdate() { - // determine the flags if any - const flags = this.getSendFlags(); - // If the stream has already been established - // and we've processed data within the time it takes for 4 round trips - // then we (up to) double the recvWindow - const now = Date.now(); - const rtt = this.getRTT(); - if (flags === 0 && rtt > -1 && now - this.epochStart < rtt * 4) { - // we've already validated that maxStreamWindowSize can't be more than MAX_UINT32 - this.recvWindow = Math.min(this.recvWindow * 2, this.config.maxStreamWindowSize); - } - if (this.recvWindowCapacity >= this.recvWindow && flags === 0) { - // a window update isn't needed - return; - } - // update the receive window - const delta = this.recvWindow - this.recvWindowCapacity; - this.recvWindowCapacity = this.recvWindow; - // update the epoch start - this.epochStart = now; - // send window update - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: flags, - streamID: this._id, - length: delta - }); - } -} -//# sourceMappingURL=stream.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/stream.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/stream.js.map deleted file mode 100644 index 855e6e8fa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/src/stream.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,cAAc,EAA2B,MAAM,+BAA+B,CAAA;AACvF,OAAO,IAAI,MAAM,YAAY,CAAA;AAC7B,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAClG,OAAO,EAAE,IAAI,EAAoB,S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zB,IAAI,KAAK,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,UAAU,GAAG,GAAG,GAAG,CAAC,EAAE;YAC9D,iFAAiF;YACjF,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAA;SACjF;QAED,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,UAAU,IAAI,KAAK,KAAK,CAAC,EAAE;YAC7D,+BAA+B;YAC/B,OAAM;SACP;QAED,4BAA4B;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAA;QACvD,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,UAAU,CAAA;QAEzC,yBAAyB;QACzB,IAAI,CAAC,UAAU,GAAG,GAAG,CAAA;QAErB,qBAAqB;QACrB,IAAI,CAAC,SAAS,CAAC;YACb,IAAI,EAAE,SAAS,CAAC,YAAY;YAC5B,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI,CAAC,GAAG;YAClB,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/codec.bench.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/codec.bench.d.ts deleted file mode 100644 index b4e5636f1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/codec.bench.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=codec.bench.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/codec.bench.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/codec.bench.d.ts.map deleted file mode 100644 index 73758eb99..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/codec.bench.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.bench.d.ts","sourceRoot":"","sources":["../../../test/bench/codec.bench.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/codec.bench.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/codec.bench.js deleted file mode 100644 index 84f5ae83d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/codec.bench.js +++ /dev/null @@ -1,46 +0,0 @@ -import { itBench } from '@dapplion/benchmark'; -import { decodeHeader } from '../../src/decode.js'; -import { encodeHeader } from '../../src/encode.js'; -import { Flag, FrameType } from '../../src/frame.js'; -import { decodeHeaderNaive, encodeHeaderNaive } from '../codec.util.js'; -describe('codec benchmark', () => { - for (const { encode, name } of [ - { encode: encodeHeader, name: 'encodeFrameHeader' }, - { encode: encodeHeaderNaive, name: 'encodeFrameHeaderNaive' } - ]) { - itBench({ - id: `frame header - ${name}`, - timeoutBench: 100000000, - beforeEach: () => { - return { - type: FrameType.WindowUpdate, - flag: Flag.ACK, - streamID: 0xffffffff, - length: 0xffffffff - }; - }, - fn: (header) => { - encode(header); - } - }); - } - for (const { decode, name } of [ - { decode: decodeHeader, name: 'decodeHeader' }, - { decode: decodeHeaderNaive, name: 'decodeHeaderNaive' } - ]) { - itBench({ - id: `frame header ${name}`, - beforeEach: () => { - const header = new Uint8Array(12); - for (let i = 1; i < 12; i++) { - header[i] = 255; - } - return header; - }, - fn: (header) => { - decode(header); - } - }); - } -}); -//# sourceMappingURL=codec.bench.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/codec.bench.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/codec.bench.js.map deleted file mode 100644 index 7721658d7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/codec.bench.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.bench.js","sourceRoot":"","sources":["../../../test/bench/codec.bench.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAoB,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEvE,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI;QAC7B,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,mBAAmB,EAAE;QACnD,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,wBAAwB,EAAE;KAC9D,EAAE;QACD,OAAO,CAAyB;YAC9B,EAAE,EAAE,kBAAkB,IAAI,EAAE;YAC5B,YAAY,EAAE,SAAS;YACvB,UAAU,EAAE,GAAG,EAAE;gBACf,OAAO;oBACL,IAAI,EAAE,SAAS,CAAC,YAAY;oBAC5B,IAAI,EAAE,IAAI,CAAC,GAAG;oBACd,QAAQ,EAAE,UAAU;oBACpB,MAAM,EAAE,UAAU;iBACnB,CAAA;YACH,CAAC;YACD,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE;gBACb,MAAM,CAAC,MAAM,CAAC,CAAA;YAChB,CAAC;SACF,CAAC,CAAA;KACH;IAED,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI;QAC7B,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE;QAC9C,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,mBAAmB,EAAE;KACzD,EAAE;QACD,OAAO,CAAwB;YAC7B,EAAE,EAAE,gBAAgB,IAAI,EAAE;YAC1B,UAAU,EAAE,GAAG,EAAE;gBACf,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAA;gBACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;oBAC3B,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;iBAChB;gBACD,OAAO,MAAM,CAAA;YACf,CAAC;YACD,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE;gBACb,MAAM,CAAC,MAAM,CAAC,CAAA;YAChB,CAAC;SACF,CAAC,CAAA;KACH;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/comparison.bench.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/comparison.bench.d.ts deleted file mode 100644 index cb9667d54..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/comparison.bench.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=comparison.bench.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/comparison.bench.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/comparison.bench.d.ts.map deleted file mode 100644 index c29eccddc..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/comparison.bench.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"comparison.bench.d.ts","sourceRoot":"","sources":["../../../test/bench/comparison.bench.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/comparison.bench.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/comparison.bench.js deleted file mode 100644 index 19512e4b7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/comparison.bench.js +++ /dev/null @@ -1,36 +0,0 @@ -import { itBench } from '@dapplion/benchmark'; -import drain from 'it-drain'; -import { pipe } from 'it-pipe'; -import { testClientServer as testMplexClientServer } from '../mplex.util.js'; -import { testClientServer as testYamuxClientServer } from '../util.js'; -describe('comparison benchmark', () => { - for (const { impl, name } of [ - { impl: testYamuxClientServer, name: 'yamux' }, - { impl: testMplexClientServer, name: 'mplex' } - ]) { - for (const { numMessages, msgSize } of [ - { numMessages: 1, msgSize: 2 ** 6 }, - { numMessages: 1, msgSize: 2 ** 10 }, - { numMessages: 1, msgSize: 2 ** 16 }, - { numMessages: 1, msgSize: 2 ** 20 }, - { numMessages: 1000, msgSize: 2 ** 6 }, - { numMessages: 1000, msgSize: 2 ** 10 }, - { numMessages: 1000, msgSize: 2 ** 16 }, - { numMessages: 1000, msgSize: 2 ** 20 } - ]) { - itBench({ - id: `${name} send and receive ${numMessages} ${msgSize / 1024}KB chunks`, - beforeEach: () => impl({ - onIncomingStream: (stream) => { - void pipe(stream, drain).then(async () => { await stream.close(); }); - } - }), - fn: async ({ client, server }) => { - const stream = await client.newStream(); - await pipe(Array.from({ length: numMessages }, () => new Uint8Array(msgSize)), stream, drain); - } - }); - } - } -}); -//# sourceMappingURL=comparison.bench.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/comparison.bench.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/comparison.bench.js.map deleted file mode 100644 index 1c0ac643f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/bench/comparison.bench.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"comparison.bench.js","sourceRoot":"","sources":["../../../test/bench/comparison.bench.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,gBAAgB,IAAI,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,EAAE,gBAAgB,IAAI,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEtE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;QAC3B,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,OAAO,EAAE;QAC9C,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,OAAO,EAAE;KAC/C,EAAE;QACD,KAAK,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI;YACrC,EAAE,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE;YACnC,EAAE,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YACpC,EAAE,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YACpC,EAAE,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YACpC,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE;YACtC,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YACvC,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YACvC,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;SACxC,EAAE;YACD,OAAO,CAAqC;gBAC1C,EAAE,EAAE,GAAG,IAAI,qBAAqB,WAAW,IAAI,OAAO,GAAG,IAAI,WAAW;gBACxE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC;oBACrB,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE;wBAC3B,KAAK,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA,CAAC,CAAC,CAAC,CAAA;oBACrE,CAAC;iBACF,CAAC;gBACF,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE;oBAC/B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,EAAE,CAAA;oBACvC,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;gBAC/F,CAAC;aACF,CAAC,CAAA;SACH;KACF;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.spec.d.ts deleted file mode 100644 index 633c75388..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=codec.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.spec.d.ts.map deleted file mode 100644 index 964547815..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.spec.d.ts","sourceRoot":"","sources":["../../test/codec.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.spec.js deleted file mode 100644 index 4d61ce230..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.spec.js +++ /dev/null @@ -1,28 +0,0 @@ -import { expect } from 'aegir/chai'; -import { decodeHeader } from '../src/decode.js'; -import { encodeHeader } from '../src/encode.js'; -import { Flag, FrameType, GoAwayCode, stringifyHeader } from '../src/frame.js'; -import { decodeHeaderNaive, encodeHeaderNaive } from './codec.util.js'; -const frames = [ - { header: { type: FrameType.Ping, flag: Flag.SYN, streamID: 0, length: 1 } }, - { header: { type: FrameType.WindowUpdate, flag: Flag.SYN, streamID: 1, length: 1 } }, - { header: { type: FrameType.GoAway, flag: 0, streamID: 0, length: GoAwayCode.NormalTermination } }, - { header: { type: FrameType.Ping, flag: Flag.ACK, streamID: 0, length: 100 } }, - { header: { type: FrameType.WindowUpdate, flag: 0, streamID: 99, length: 1000 } }, - { header: { type: FrameType.WindowUpdate, flag: 0, streamID: 0xffffffff, length: 0xffffffff } }, - { header: { type: FrameType.GoAway, flag: 0, streamID: 0, length: GoAwayCode.ProtocolError } } -]; -describe('codec', () => { - for (const { header } of frames) { - it(`should round trip encode/decode header ${stringifyHeader(header)}`, () => { - expect(decodeHeader(encodeHeader(header))).to.deep.equal(header); - }); - } - for (const { header } of frames) { - it(`should match naive implementations of encode/decode for header ${stringifyHeader(header)}`, () => { - expect(encodeHeader(header)).to.deep.equal(encodeHeaderNaive(header)); - expect(decodeHeader(encodeHeader(header))).to.deep.equal(decodeHeaderNaive(encodeHeaderNaive(header))); - }); - } -}); -//# sourceMappingURL=codec.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.spec.js.map deleted file mode 100644 index 178430d09..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.spec.js","sourceRoot":"","sources":["../../test/codec.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAoB,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAChG,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAEtE,MAAM,MAAM,GAAsD;IAChE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE;IAC5E,EAAE,MAAM,EAAE,EAAE,IAAI,EAA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,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,MAAM,EAAE;QAC/B,EAAE,CAAC,kEAAkE,eAAe,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE;YACnG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAA;YACrE,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACxG,CAAC,CAAC,CAAA;KACH;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.util.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.util.d.ts deleted file mode 100644 index 8b9852f73..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.util.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { type FrameHeader } from '../src/frame.js'; -export declare function decodeHeaderNaive(data: Uint8Array): FrameHeader; -export declare function encodeHeaderNaive(header: FrameHeader): Uint8Array; -//# sourceMappingURL=codec.util.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.util.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.util.d.ts.map deleted file mode 100644 index 16bcea9aa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.util.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.util.d.ts","sourceRoot":"","sources":["../../test/codec.util.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAgC,MAAM,iBAAiB,CAAA;AAIhF,wBAAgB,iBAAiB,CAAE,IAAI,EAAE,UAAU,GAAG,WAAW,CAYhE;AAED,wBAAgB,iBAAiB,CAAE,MAAM,EAAE,WAAW,GAAG,UAAU,CAclE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.util.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.util.js deleted file mode 100644 index 76b3cf281..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.util.js +++ /dev/null @@ -1,28 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { ERR_DECODE_INVALID_VERSION } from '../src/constants.js'; -import { HEADER_LENGTH, YAMUX_VERSION } from '../src/frame.js'; -// Slower encode / decode functions that use dataview -export function decodeHeaderNaive(data) { - const view = new DataView(data.buffer, data.byteOffset, data.byteLength); - if (view.getUint8(0) !== YAMUX_VERSION) { - throw new CodeError('Invalid frame version', ERR_DECODE_INVALID_VERSION); - } - return { - type: view.getUint8(1), - flag: view.getUint16(2, false), - streamID: view.getUint32(4, false), - length: view.getUint32(8, false) - }; -} -export function encodeHeaderNaive(header) { - const frame = new Uint8Array(HEADER_LENGTH); - const frameView = new DataView(frame.buffer, frame.byteOffset, frame.byteLength); - // always assume version 0 - // frameView.setUint8(0, header.version) - frameView.setUint8(1, header.type); - frameView.setUint16(2, header.flag, false); - frameView.setUint32(4, header.streamID, false); - frameView.setUint32(8, header.length, false); - return frame; -} -//# sourceMappingURL=codec.util.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.util.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.util.js.map deleted file mode 100644 index a90c06419..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/codec.util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.util.js","sourceRoot":"","sources":["../../test/codec.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAoB,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEhF,qDAAqD;AAErD,MAAM,UAAU,iBAAiB,CAAE,IAAgB;IACjD,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;IAExE,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,aAAa,EAAE;QACtC,MAAM,IAAI,SAAS,CAAC,uBAAuB,EAAE,0BAA0B,CAAC,CAAA;KACzE;IACD,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QACtB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC;QAC9B,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC;QAClC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC;KACjC,CAAA;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAE,MAAmB;IACpD,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,aAAa,CAAC,CAAA;IAE3C,MAAM,SAAS,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;IAEhF,0BAA0B;IAC1B,wCAAwC;IAExC,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;IAClC,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAC1C,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAC9C,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAE5C,OAAO,KAAK,CAAA;AACd,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/compliance.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/compliance.spec.d.ts deleted file mode 100644 index dac08d9d2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/compliance.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=compliance.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/compliance.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/compliance.spec.d.ts.map deleted file mode 100644 index dc9e71995..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/compliance.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.d.ts","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/compliance.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/compliance.spec.js deleted file mode 100644 index 0b8763a42..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/compliance.spec.js +++ /dev/null @@ -1,12 +0,0 @@ -/* eslint-env mocha */ -import tests from '@libp2p/interface-compliance-tests/stream-muxer'; -import { TestYamux } from './util.js'; -describe('compliance', () => { - tests({ - async setup() { - return new TestYamux({}); - }, - async teardown() { } - }); -}); -//# sourceMappingURL=compliance.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/compliance.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/compliance.spec.js.map deleted file mode 100644 index 9a46d97f8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/compliance.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.js","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,KAAK,MAAM,iDAAiD,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,KAAK,CAAC;QACJ,KAAK,CAAC,KAAK;YACT,OAAO,IAAI,SAAS,CAAC,EAAE,CAAC,CAAA;QAC1B,CAAC;QACD,KAAK,CAAC,QAAQ,KAAK,CAAC;KACrB,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/decode.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/decode.spec.d.ts deleted file mode 100644 index 07a9f5cbd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/decode.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const randomRanges: (length: number) => number[][]; -//# sourceMappingURL=decode.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/decode.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/decode.spec.d.ts.map deleted file mode 100644 index 1dc0b444d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/decode.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode.spec.d.ts","sourceRoot":"","sources":["../../test/decode.spec.ts"],"names":[],"mappings":"AAoDA,eAAO,MAAM,YAAY,WAAY,MAAM,KAAG,MAAM,EAAE,EAUrD,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/decode.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/decode.spec.js deleted file mode 100644 index 0a9f2be6b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/decode.spec.js +++ /dev/null @@ -1,298 +0,0 @@ -/* eslint-disable @typescript-eslint/dot-notation */ -import { expect } from 'aegir/chai'; -import { pushable } from 'it-pushable'; -import { ERR_DECODE_IN_PROGRESS } from '../src/constants.js'; -import { Decoder } from '../src/decode.js'; -import { encodeHeader } from '../src/encode.js'; -import { Flag, FrameType, GoAwayCode } from '../src/frame.js'; -import { timeout } from './util.js'; -const frames = [ - { header: { type: FrameType.Ping, flag: Flag.SYN, streamID: 0, length: 1 } }, - { header: { type: FrameType.WindowUpdate, flag: Flag.SYN, streamID: 1, length: 1 } }, - { header: { type: FrameType.GoAway, flag: 0, streamID: 0, length: GoAwayCode.NormalTermination } }, - { header: { type: FrameType.Ping, flag: Flag.ACK, streamID: 0, length: 100 } }, - { header: { type: FrameType.WindowUpdate, flag: 0, streamID: 99, length: 1000 } }, - { header: { type: FrameType.GoAway, flag: 0, streamID: 0, length: GoAwayCode.ProtocolError } } -]; -const data = (length) => Uint8Array.from(Array.from({ length }), (_, i) => i); -const expectEqualBytes = (actual, expected, reason) => { - expect(actual instanceof Uint8Array ? actual : actual.subarray(), reason).to.deep.equal(expected instanceof Uint8Array ? expected : expected.subarray()); -}; -const expectEqualDataFrame = (actual, expected, reason = '') => { - expect(actual.header, reason + ' header').to.deep.equal(expected.header); - if (actual.data == null && expected.data != null) { - expect.fail('actual has no data but expected does'); - } - if (actual.data != null && expected.data == null) { - expect.fail('actual has data but expected does not'); - } - if (actual.data != null && expected.data != null) { - expectEqualBytes(actual.data, expected.data, reason + ' data?: string'); - } -}; -const expectEqualDataFrames = (actual, expected) => { - if (actual.length !== expected.length) { - expect.fail('actual'); - } - for (let i = 0; i < actual.length; i++) { - expectEqualDataFrame(actual[i], expected[i], String(i)); - } -}; -const dataFrame = (length) => ({ - header: { type: FrameType.Data, flag: 0, streamID: 1, length }, - data: data(length) -}); -export const randomRanges = (length) => { - const indices = []; - let i = 0; - let j = 0; - while (i < length) { - j = i; - i += Math.floor(Math.random() * length); - indices.push([j, i]); - } - return indices; -}; -describe('Decoder internals', () => { - describe('readHeader', () => { - const frame = frames[0]; - const p = pushable(); - const d = new Decoder(p); - afterEach(() => { - d['buffer'].consume(d['buffer'].length); - }); - it('should handle an empty buffer', async () => { - expect(d['buffer'].length, 'a freshly created decoder should have an empty buffer').to.equal(0); - expect(d['readHeader'](), 'an empty buffer should read no header').to.equal(undefined); - }); - it('should handle buffer length == header length', async () => { - d['buffer'].append(encodeHeader(frame.header)); - expect(d['readHeader'](), 'the decoded header should match the input').to.deep.equal(frame.header); - expect(d['buffer'].length, 'the buffer should be fully drained').to.equal(0); - }); - it('should handle buffer length < header length', async () => { - const upTo = 2; - d['buffer'].append(encodeHeader(frame.header).slice(0, upTo)); - expect(d['readHeader'](), 'an buffer that has insufficient bytes should read no header').to.equal(undefined); - expect(d['buffer'].length, 'a buffer that has insufficient bytes should not be consumed').to.equal(upTo); - d['buffer'].append(encodeHeader(frame.header).slice(upTo)); - expect(d['readHeader'](), 'the decoded header should match the input').to.deep.equal(frame.header); - expect(d['buffer'].length, 'the buffer should be fully drained').to.equal(0); - }); - it('should handle buffer length > header length', async () => { - const more = 10; - d['buffer'].append(encodeHeader(frame.header)); - d['buffer'].append(new Uint8Array(more)); - expect(d['readHeader'](), 'the decoded header should match the input').to.deep.equal(frame.header); - expect(d['buffer'].length, 'the buffer should be partially drained').to.equal(more); - }); - }); - describe('readBytes', () => { - const p = pushable(); - const d = new Decoder(p); - afterEach(() => { - d['buffer'].consume(d['buffer'].length); - }); - it('should handle buffer length == requested length', async () => { - const requested = 10; - d['buffer'].append(data(requested)); - let actual; - try { - actual = await Promise.race([timeout(1), d['readBytes'](requested)]); - } - catch (e) { - expect.fail('readBytes timed out'); - } - expectEqualBytes(actual, data(requested), 'read bytes should equal input'); - expect(d['buffer'].length, 'buffer should be drained').to.deep.equal(0); - }); - it('should handle buffer length > requested length', async () => { - const requested = 10; - d['buffer'].append(data(requested * 2)); - let actual; - try { - actual = await Promise.race([timeout(1), d['readBytes'](requested)]); - } - catch (e) { - expect.fail('readBytes timed out'); - } - expectEqualBytes(actual, data(requested), 'read bytes should equal input'); - expect(d['buffer'].length, 'buffer should be partially drained').to.deep.equal(requested); - }); - it('should handle buffer length < requested length, data available', async () => { - const requested = 10; - p.push(data(requested)); - let actual; - try { - actual = await Promise.race([timeout(10), d['readBytes'](requested)]); - } - catch (e) { - expect.fail('readBytes timed out'); - } - expectEqualBytes(actual, data(requested), 'read bytes should equal input'); - expect(d['buffer'].length, 'buffer should be drained').to.deep.equal(0); - }); - it('should handle buffer length < requested length, data not available', async () => { - const requested = 10; - p.push(data(requested - 1)); - try { - await Promise.race([timeout(10), d['readBytes'](requested)]); - expect.fail('readBytes should not resolve until the source + buffer have enough bytes'); - } - catch (e) { - } - }); - }); -}); -describe('Decoder', () => { - describe('emitFrames', () => { - let p; - let d; - beforeEach(() => { - p = pushable(); - d = new Decoder(p); - }); - it('should emit frames from source chunked by frame', async () => { - const expected = []; - for (const [i, frame] of frames.entries()) { - p.push(encodeHeader(frame.header)); - expected.push(frame); - // sprinkle in more data frames - if (i % 2 === 1) { - const df = dataFrame(i * 100); - p.push(encodeHeader(df.header)); - p.push(df.data); - expected.push(df); - } - } - p.end(); - const actual = []; - for await (const frame of d.emitFrames()) { - if (frame.readData === undefined) { - actual.push(frame); - } - else { - actual.push({ header: frame.header, data: await frame.readData() }); - } - } - expectEqualDataFrames(actual, expected); - }); - it('should emit frames from source chunked by partial frame', async () => { - const chunkSize = 5; - const expected = []; - for (const [i, frame] of frames.entries()) { - const encoded = encodeHeader(frame.header); - for (let i = 0; i < encoded.length; i += chunkSize) { - p.push(encoded.slice(i, i + chunkSize)); - } - expected.push(frame); - // sprinkle in more data frames - if (i % 2 === 1) { - const df = dataFrame(i * 100); - const encoded = Uint8Array.from([...encodeHeader(df.header), ...df.data]); - for (let i = 0; i < encoded.length; i += chunkSize) { - p.push(encoded.slice(i, i + chunkSize)); - } - expected.push(df); - } - } - p.end(); - const actual = []; - for await (const frame of d.emitFrames()) { - if (frame.readData === undefined) { - actual.push(frame); - } - else { - actual.push({ header: frame.header, data: await frame.readData() }); - } - } - expect(p.readableLength).to.equal(0); - expectEqualDataFrames(actual, expected); - }); - it('should emit frames from source chunked by multiple frames', async () => { - const expected = []; - for (let i = 0; i < frames.length; i++) { - const encoded1 = encodeHeader(frames[i].header); - expected.push(frames[i]); - i++; - const encoded2 = encodeHeader(frames[i].header); - expected.push(frames[i]); - // sprinkle in more data frames - const df = dataFrame(i * 100); - const encoded3 = Uint8Array.from([...encodeHeader(df.header), ...df.data]); - expected.push(df); - const encodedChunk = new Uint8Array(encoded1.length + encoded2.length + encoded3.length); - encodedChunk.set(encoded1, 0); - encodedChunk.set(encoded2, encoded1.length); - encodedChunk.set(encoded3, encoded1.length + encoded2.length); - p.push(encodedChunk); - } - p.end(); - const actual = []; - for await (const frame of d.emitFrames()) { - if (frame.readData === undefined) { - actual.push(frame); - } - else { - actual.push({ header: frame.header, data: await frame.readData() }); - } - } - expectEqualDataFrames(actual, expected); - }); - it('should emit frames from source chunked chaoticly', async () => { - const expected = []; - const encodedFrames = []; - for (const [i, frame] of frames.entries()) { - encodedFrames.push(encodeHeader(frame.header)); - expected.push(frame); - // sprinkle in more data frames - if (i % 2 === 1) { - const df = dataFrame(i * 100); - encodedFrames.push(encodeHeader(df.header)); - encodedFrames.push(df.data); - expected.push(df); - } - } - // create a single byte array of all frames to send - // so that we can chunk them chaoticly - const encoded = new Uint8Array(encodedFrames.reduce((a, b) => a + b.length, 0)); - let i = 0; - for (const e of encodedFrames) { - encoded.set(e, i); - i += e.length; - } - for (const [i, j] of randomRanges(encoded.length)) { - p.push(encoded.slice(i, j)); - } - p.end(); - const actual = []; - for await (const frame of d.emitFrames()) { - if (frame.readData === undefined) { - actual.push(frame); - } - else { - actual.push({ header: frame.header, data: await frame.readData() }); - } - } - expectEqualDataFrames(actual, expected); - }); - it('should error decoding frame while another decode is in progress', async () => { - const df1 = dataFrame(100); - p.push(encodeHeader(df1.header)); - p.push(df1.data); - const df2 = dataFrame(100); - p.push(encodeHeader(df2.header)); - p.push(df2.data); - try { - for await (const frame of d.emitFrames()) { - void frame; - } - expect.fail('decoding another frame before the first is finished should error'); - } - catch (e) { - expect(e.code).to.equal(ERR_DECODE_IN_PROGRESS); - } - }); - }); -}); -//# sourceMappingURL=decode.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/decode.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/decode.spec.js.map deleted file mode 100644 index 28dc7fcbf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/decode.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode.spec.js","sourceRoot":"","sources":["../../test/decode.spec.ts"],"names":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AAC,CAAA;YAC1B,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;YAChC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAEhB,IAAI;gBACF,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE;oBACxC,KAAK,KAAK,CAAA;iBACX;gBACD,MAAM,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAA;aAChF;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,CAAE,CAAsB,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;aACtE;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/mplex.util.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/mplex.util.d.ts deleted file mode 100644 index fb351e2b8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/mplex.util.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { StreamMuxer, StreamMuxerInit } from '@libp2p/interface/stream-muxer'; -import type { Source, Transform } from 'it-stream-types'; -export declare function testYamuxMuxer(name: string, client: boolean, conf?: StreamMuxerInit): StreamMuxer; -/** - * Create a transform that can be paused and unpaused - */ -export declare function pauseableTransform(): { - transform: Transform, AsyncGenerator>; - pause: () => void; - unpause: () => void; -}; -export declare function testClientServer(conf?: StreamMuxerInit): { - client: StreamMuxer & { - pauseRead: () => void; - unpauseRead: () => void; - pauseWrite: () => void; - unpauseWrite: () => void; - }; - server: StreamMuxer & { - pauseRead: () => void; - unpauseRead: () => void; - pauseWrite: () => void; - unpauseWrite: () => void; - }; -}; -export declare function timeout(ms: number): Promise; -export declare function sleep(ms: number): Promise; -//# sourceMappingURL=mplex.util.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/mplex.util.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/mplex.util.d.ts.map deleted file mode 100644 index 608ff7d4b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/mplex.util.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mplex.util.d.ts","sourceRoot":"","sources":["../../test/mplex.util.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAClF,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAMxD,wBAAgB,cAAc,CAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,GAAE,eAAoB,GAAG,WAAW,CAKtG;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAE,CAAC,KAAM;IAAE,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAsBxI;AAED,wBAAgB,gBAAgB,CAAE,IAAI,GAAE,eAAoB,GAAG;IAC7D,MAAM,EAAE,WAAW,GAAG;QACpB,SAAS,EAAE,MAAM,IAAI,CAAA;QACrB,WAAW,EAAE,MAAM,IAAI,CAAA;QACvB,UAAU,EAAE,MAAM,IAAI,CAAA;QACtB,YAAY,EAAE,MAAM,IAAI,CAAA;KACzB,CAAA;IACD,MAAM,EAAE,WAAW,GAAG;QACpB,SAAS,EAAE,MAAM,IAAI,CAAA;QACrB,WAAW,EAAE,MAAM,IAAI,CAAA;QACvB,UAAU,EAAE,MAAM,IAAI,CAAA;QACtB,YAAY,EAAE,MAAM,IAAI,CAAA;KACzB,CAAA;CACF,CA0BA;AAED,wBAAsB,OAAO,CAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE3D;AAED,wBAAsB,KAAK,CAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEzD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/mplex.util.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/mplex.util.js deleted file mode 100644 index e4116a596..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/mplex.util.js +++ /dev/null @@ -1,72 +0,0 @@ -import { defaultLogger } from '@libp2p/logger'; -import { mplex } from '@libp2p/mplex'; -import { duplexPair } from 'it-pair/duplex'; -import { pipe } from 'it-pipe'; -import {} from 'uint8arraylist'; -const factory = mplex()({ - logger: defaultLogger() -}); -export function testYamuxMuxer(name, client, conf = {}) { - return factory.createStreamMuxer({ - ...conf, - direction: client ? 'outbound' : 'inbound' - }); -} -/** - * Create a transform that can be paused and unpaused - */ -export function pauseableTransform() { - let resolvePausePromise; - let pausePromise; - const unpause = () => { - resolvePausePromise?.(null); - }; - const pause = () => { - pausePromise = new Promise(resolve => { - resolvePausePromise = resolve; - }); - }; - const transform = async function* (source) { - for await (const d of source) { - if (pausePromise !== undefined) { - await pausePromise; - pausePromise = undefined; - resolvePausePromise = undefined; - } - yield d; - } - }; - return { transform, pause, unpause }; -} -export function testClientServer(conf = {}) { - const pair = duplexPair(); - const client = testYamuxMuxer('libp2p:mplex:client', true, conf); - const server = testYamuxMuxer('libp2p:mplex:server', false, conf); - const clientReadTransform = pauseableTransform(); - const clientWriteTransform = pauseableTransform(); - const serverReadTransform = pauseableTransform(); - const serverWriteTransform = pauseableTransform(); - void pipe(pair[0], clientReadTransform.transform, client, clientWriteTransform.transform, pair[0]); - void pipe(pair[1], serverReadTransform.transform, server, serverWriteTransform.transform, pair[1]); - return { - client: Object.assign(client, { - pauseRead: clientReadTransform.pause, - unpauseRead: clientReadTransform.unpause, - pauseWrite: clientWriteTransform.pause, - unpauseWrite: clientWriteTransform.unpause - }), - server: Object.assign(server, { - pauseRead: serverReadTransform.pause, - unpauseRead: serverReadTransform.unpause, - pauseWrite: serverWriteTransform.pause, - unpauseWrite: serverWriteTransform.unpause - }) - }; -} -export async function timeout(ms) { - return new Promise((_resolve, reject) => setTimeout(() => { reject(new Error(`timeout after ${ms}ms`)); }, ms)); -} -export async function sleep(ms) { - return new Promise(resolve => setTimeout(() => { resolve(ms); }, ms)); -} -//# sourceMappingURL=mplex.util.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/mplex.util.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/mplex.util.js.map deleted file mode 100644 index 36f21ff9e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/mplex.util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mplex.util.js","sourceRoot":"","sources":["../../test/mplex.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAuB,MAAM,gBAAgB,CAAA;AAIpD,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACtB,MAAM,EAAE,aAAa,EAAE;CACxB,CAAC,CAAA;AAEF,MAAM,UAAU,cAAc,CAAE,IAAY,EAAE,MA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,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AACtE,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/muxer.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/muxer.spec.d.ts deleted file mode 100644 index 5855d5d5f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/muxer.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=muxer.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/muxer.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/muxer.spec.d.ts.map deleted file mode 100644 index cb814f4c4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/muxer.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"muxer.spec.d.ts","sourceRoot":"","sources":["../../test/muxer.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/muxer.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/muxer.spec.js deleted file mode 100644 index 6c38a5d23..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/muxer.spec.js +++ /dev/null @@ -1,118 +0,0 @@ -/* eslint-env mocha */ -import { expect } from 'aegir/chai'; -import { duplexPair } from 'it-pair/duplex'; -import { pipe } from 'it-pipe'; -import {} from 'uint8arraylist'; -import { ERR_MUXER_LOCAL_CLOSED } from '../src/constants.js'; -import { sleep, testClientServer, testYamuxMuxer } from './util.js'; -describe('muxer', () => { - let client; - let server; - afterEach(async () => { - if (client != null) { - await client.close(); - } - if (server != null) { - await server.close(); - } - }); - it('test repeated close', async () => { - const client1 = testYamuxMuxer('libp2p:yamux:1', true); - // inspect logs to ensure its only closed once - await client1.close(); - await client1.close(); - await client1.close(); - }); - it('test client<->client', async () => { - const pair = duplexPair(); - const client1 = testYamuxMuxer('libp2p:yamux:1', true); - const client2 = testYamuxMuxer('libp2p:yamux:2', true); - void pipe(pair[0], client1, pair[0]); - void pipe(pair[1], client2, pair[1]); - client1.newStream(); - client2.newStream(); - await sleep(20); - expect(client1.isClosed()).to.equal(true); - expect(client2.isClosed()).to.equal(true); - }); - it('test server<->server', async () => { - const pair = duplexPair(); - const client1 = testYamuxMuxer('libp2p:yamux:1', false); - const client2 = testYamuxMuxer('libp2p:yamux:2', false); - void pipe(pair[0], client1, pair[0]); - void pipe(pair[1], client2, pair[1]); - client1.newStream(); - client2.newStream(); - await sleep(20); - expect(client1.isClosed()).to.equal(true); - expect(client2.isClosed()).to.equal(true); - }); - it('test ping', async () => { - ({ client, server } = testClientServer()); - server.pauseRead(); - const clientRTT = client.ping(); - await sleep(10); - server.unpauseRead(); - expect(await clientRTT).to.not.equal(0); - server.pauseWrite(); - const serverRTT = server.ping(); - await sleep(10); - server.unpauseWrite(); - expect(await serverRTT).to.not.equal(0); - }); - it('test multiple simultaneous pings', async () => { - ({ client, server } = testClientServer()); - client.pauseWrite(); - const promise = [ - client.ping(), - client.ping(), - client.ping() - ]; - await sleep(10); - client.unpauseWrite(); - const clientRTTs = await Promise.all(promise); - expect(clientRTTs[0]).to.not.equal(0); - expect(clientRTTs[0]).to.equal(clientRTTs[1]); - expect(clientRTTs[1]).to.equal(clientRTTs[2]); - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(client['nextPingID']).to.equal(1); - await client.close(); - }); - it('test go away', async () => { - ({ client, server } = testClientServer()); - await client.close(); - expect(() => { - client.newStream(); - }).to.throw().with.property('code', ERR_MUXER_LOCAL_CLOSED, 'should not be able to open a stream after close'); - }); - it('test keep alive', async () => { - ({ client, server } = testClientServer({ enableKeepAlive: true, keepAliveInterval: 10 })); - await sleep(1000); - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(client['nextPingID']).to.be.gt(2); - await client.close(); - await server.close(); - }); - it('test max inbound streams', async () => { - ({ client, server } = testClientServer({ maxInboundStreams: 1 })); - client.newStream(); - client.newStream(); - await sleep(10); - expect(server.streams.length).to.equal(1); - expect(client.streams.length).to.equal(1); - }); - it('test max outbound streams', async () => { - ({ client, server } = testClientServer({ maxOutboundStreams: 1 })); - client.newStream(); - await sleep(10); - try { - client.newStream(); - expect.fail('stream creation should fail if exceeding maxOutboundStreams'); - } - catch (e) { - expect(server.streams.length).to.equal(1); - expect(client.streams.length).to.equal(1); - } - }); -}); -//# sourceMappingURL=muxer.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/muxer.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/muxer.spec.js.map deleted file mode 100644 index 98acb04d6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/muxer.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"muxer.spec.js","sourceRoot":"","sources":["../../test/muxer.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAuB,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAA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,MAAM,KAAK,CAAC,EAAE,CAAC,CAAA;QAEf,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACzC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,2BAA2B,EAAE,KAAK,IAAI,EAAE;QACzC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAC,EAAE,kBAAkB,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;QAElE,MAAM,CAAC,SAAS,EAAE,CAAA;QAClB,MAAM,KAAK,CAAC,EAAE,CAAC,CAAA;QAEf,IAAI;YACF,MAAM,CAAC,SAAS,EAAE,CAAA;YAClB,MAAM,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAA;SAC3E;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YACzC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;SAC1C;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/stream.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/stream.spec.d.ts deleted file mode 100644 index 2ce82973f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/stream.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=stream.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/stream.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/stream.spec.d.ts.map deleted file mode 100644 index 77bed1442..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/stream.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stream.spec.d.ts","sourceRoot":"","sources":["../../test/stream.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/stream.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/stream.spec.js deleted file mode 100644 index 7ecb7583c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/stream.spec.js +++ /dev/null @@ -1,198 +0,0 @@ -/* eslint-env mocha */ -import { expect } from 'aegir/chai'; -import { pipe } from 'it-pipe'; -import { pushable } from 'it-pushable'; -import { defaultConfig } from '../src/config.js'; -import { ERR_RECV_WINDOW_EXCEEDED } from '../src/constants.js'; -import { GoAwayCode } from '../src/frame.js'; -import { StreamState } from '../src/stream.js'; -import { sleep, testClientServer } from './util.js'; -describe('stream', () => { - let client; - let server; - afterEach(async () => { - if (client != null) { - await client.close(); - } - if (server != null) { - await server.close(); - } - }); - it('test send data - small', async () => { - ({ client, server } = testClientServer({ initialStreamWindowSize: defaultConfig.initialStreamWindowSize })); - const { default: drain } = await import('it-drain'); - const p = pushable(); - const c1 = client.newStream(); - await sleep(10); - const s1 = server.streams[0]; - const sendPipe = pipe(p, c1); - const recvPipe = pipe(s1, drain); - for (let i = 0; i < 10; i++) { - p.push(new Uint8Array(256)); - } - p.end(); - await Promise.all([sendPipe, recvPipe]); - // the window capacities should have refilled via window updates as received data was consumed - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(c1['sendWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(s1['recvWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - }); - it('test send data - large', async () => { - ({ client, server } = testClientServer({ initialStreamWindowSize: defaultConfig.initialStreamWindowSize })); - const { default: drain } = await import('it-drain'); - const p = pushable(); - const c1 = client.newStream(); - await sleep(10); - const s1 = server.streams[0]; - const sendPipe = pipe(p, c1); - const recvPipe = pipe(s1, drain); - // amount of data is greater than initial window size - // and each payload is also greater than the max message size - // this will payload chunking and also waiting for window updates before continuing to send - for (let i = 0; i < 10; i++) { - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - } - p.end(); - await Promise.all([sendPipe, recvPipe]); - // the window capacities should have refilled via window updates as received data was consumed - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(c1['sendWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(s1['recvWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - }); - it('test send data - large with increasing recv window size', async () => { - ({ client, server } = testClientServer({ initialStreamWindowSize: defaultConfig.initialStreamWindowSize })); - const { default: drain } = await import('it-drain'); - const p = pushable(); - const c1 = client.newStream(); - server.pauseWrite(); - void server.ping(); - await sleep(10); - server.unpauseWrite(); - const s1 = server.streams[0]; - const sendPipe = pipe(p, c1); - const recvPipe = pipe(s1, drain); - // amount of data is greater than initial window size - // and each payload is also greater than the max message size - // this will payload chunking and also waiting for window updates before continuing to send - for (let i = 0; i < 10; i++) { - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - } - p.end(); - await Promise.all([sendPipe, recvPipe]); - // the window capacities should have refilled via window updates as received data was consumed - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(c1['sendWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(s1['recvWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - }); - it('test many streams', async () => { - ({ client, server } = testClientServer()); - for (let i = 0; i < 1000; i++) { - client.newStream(); - } - await sleep(100); - expect(client.streams.length).to.equal(1000); - expect(server.streams.length).to.equal(1000); - }); - it('test many streams - ping pong', async () => { - ({ client, server } = testClientServer({ - // echo on incoming streams - onIncomingStream: (stream) => { void pipe(stream, stream); } - })); - const numStreams = 10; - const p = []; - for (let i = 0; i < numStreams; i++) { - client.newStream(); - p.push(pushable()); - } - await sleep(100); - for (let i = 0; i < numStreams; i++) { - const s = client.streams[i]; - void pipe(p[i], s); - p[i].push(new Uint8Array(16)); - } - await sleep(100); - expect(client.streams.length).to.equal(numStreams); - expect(server.streams.length).to.equal(numStreams); - await client.close(); - }); - it('test stream close', async () => { - ({ client, server } = testClientServer()); - const c1 = client.newStream(); - await c1.close(); - await sleep(5); - expect(c1.state).to.equal(StreamState.Finished); - const s1 = server.streams[0]; - expect(s1).to.not.be.undefined(); - expect(s1.state).to.equal(StreamState.SYNReceived); - }); - it('test stream close read', async () => { - ({ client, server } = testClientServer()); - const c1 = client.newStream(); - await c1.closeRead(); - await sleep(5); - const s1 = server.streams[0]; - expect(s1).to.not.be.undefined(); - expect(s1.readStatus).to.equal('ready'); - expect(s1.writeStatus).to.equal('ready'); - }); - it('test stream close write', async () => { - ({ client, server } = testClientServer()); - const c1 = client.newStream(); - await c1.closeWrite(); - await sleep(5); - expect(c1.readStatus).to.equal('ready'); - expect(c1.writeStatus).to.equal('closed'); - const s1 = server.streams[0]; - expect(s1).to.not.be.undefined(); - expect(s1.readStatus).to.equal('closed'); - expect(s1.writeStatus).to.equal('ready'); - }); - it('test window overflow', async () => { - ({ client, server } = testClientServer({ maxMessageSize: defaultConfig.initialStreamWindowSize, initialStreamWindowSize: defaultConfig.initialStreamWindowSize })); - const { default: drain } = await import('it-drain'); - const p = pushable(); - const c1 = client.newStream(); - await sleep(10); - const s1 = server.streams[0]; - const sendPipe = pipe(p, c1); - const c1SendData = c1.sendData.bind(c1); - c1.sendData = async (data) => { - await c1SendData(data); - // eslint-disable-next-line @typescript-eslint/dot-notation - c1['sendWindowCapacity'] = defaultConfig.initialStreamWindowSize * 10; - }; - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - await sleep(10); - const recvPipe = pipe(s1, drain); - p.end(); - try { - await Promise.all([sendPipe, recvPipe]); - } - catch (e) { - expect(e.code).to.equal(ERR_RECV_WINDOW_EXCEEDED); - } - expect(client).to.have.property('remoteGoAway', GoAwayCode.ProtocolError); - expect(server).to.have.property('localGoAway', GoAwayCode.ProtocolError); - }); - it('test stream sink error', async () => { - ({ client, server } = testClientServer()); - // don't let the server respond - server.pauseRead(); - const p = pushable(); - const c1 = client.newStream(); - const sendPipe = pipe(p, c1); - // send more data than the window size, will trigger a wait - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - await sleep(10); - // the client should close gracefully even though it was waiting to send more data - await client.close(); - p.end(); - await sendPipe; - }); -}); -//# sourceMappingURL=stream.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/stream.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/stream.spec.js.map deleted file mode 100644 index 995f83f08..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/stream.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stream.spec.js","sourceRoot":"","sources":["../../test/stream.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAiB,QAAQ,EAAE,MAAM,aAAa,CAAA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AC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,UAAU,CAAC,aAAa,CAAC,CAAA;IAC1E,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACtC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC,CAAA;QAEzC,+BAA+B;QAC/B,MAAM,CAAC,SAAS,EAAE,CAAA;QAElB,MAAM,CAAC,GAAG,QAAQ,EAAE,CAAA;QACpB,MAAM,EAAE,GAAG,MAAM,CAAC,SAAS,EAAE,CAAA;QAE7B,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;QAE5B,2DAA2D;QAC3D,CAAC,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC,CAAA;QAC7D,CAAC,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC,CAAA;QAE7D,MAAM,KAAK,CAAC,EAAE,CAAC,CAAA;QAEf,kFAAkF;QAClF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;QACpB,CAAC,CAAC,GAAG,EAAE,CAAA;QAEP,MAAM,QAAQ,CAAA;IAChB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/util.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/util.d.ts deleted file mode 100644 index 0a268c96f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/util.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Yamux, YamuxMuxer, type YamuxMuxerInit } from '../src/muxer.js'; -import type { Config } from '../src/config.js'; -import type { Source, Transform } from 'it-stream-types'; -export declare const testConf: Partial; -/** - * Yamux must be configured with a client setting `client` to true - * and a server setting `client` to falsey - * - * Since the compliance tests create a dialer and listener, - * manually alternate setting `client` to true and false - */ -export declare class TestYamux extends Yamux { - createStreamMuxer(init?: YamuxMuxerInit): YamuxMuxer; -} -export declare function testYamuxMuxer(name: string, client: boolean, conf?: YamuxMuxerInit): YamuxMuxer; -/** - * Create a transform that can be paused and unpaused - */ -export declare function pauseableTransform(): { - transform: Transform, AsyncGenerator>; - pause: () => void; - unpause: () => void; -}; -export interface YamuxFixture extends YamuxMuxer { - pauseRead: () => void; - unpauseRead: () => void; - pauseWrite: () => void; - unpauseWrite: () => void; -} -export declare function testClientServer(conf?: YamuxMuxerInit): { - client: YamuxFixture; - server: YamuxFixture; -}; -export declare function timeout(ms: number): Promise; -export declare function sleep(ms: number): Promise; -//# sourceMappingURL=util.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/util.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/util.d.ts.map deleted file mode 100644 index bd692d2c1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/util.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../test/util.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAYxD,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,MAAM,CAEpC,CAAA;AAED;;;;;;GAMG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAClC,iBAAiB,CAAE,IAAI,CAAC,EAAE,cAAc,GAAG,UAAU;CAItD;AAED,wBAAgB,cAAc,CAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,GAAE,cAAmB,GAAG,UAAU,CAOpG;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAE,CAAC,KAAM;IAAE,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAsBxI;AAED,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,YAAY,EAAE,MAAM,IAAI,CAAA;CACzB;AAED,wBAAgB,gBAAgB,CAAE,IAAI,GAAE,cAAmB,GAAG;IAC5D,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,EAAE,YAAY,CAAA;CACrB,CA0BA;AAED,wBAAsB,OAAO,CAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE3D;AAED,wBAAsB,KAAK,CAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEzD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/util.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/util.js deleted file mode 100644 index 2a3f55f27..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/util.js +++ /dev/null @@ -1,95 +0,0 @@ -import { logger } from '@libp2p/logger'; -import { duplexPair } from 'it-pair/duplex'; -import { pipe } from 'it-pipe'; -import { Yamux, YamuxMuxer } from '../src/muxer.js'; -import { Uint8ArrayList } from 'uint8arraylist'; -const isClient = (() => { - let client = false; - return () => { - const isClient = !client; - client = isClient; - return isClient; - }; -})(); -export const testConf = { - enableKeepAlive: false -}; -/** - * Yamux must be configured with a client setting `client` to true - * and a server setting `client` to falsey - * - * Since the compliance tests create a dialer and listener, - * manually alternate setting `client` to true and false - */ -export class TestYamux extends Yamux { - createStreamMuxer(init) { - const client = isClient(); - return super.createStreamMuxer({ ...testConf, ...init, direction: client ? 'outbound' : 'inbound', log: logger(`libp2p:yamux${client ? 1 : 2}`) }); - } -} -export function testYamuxMuxer(name, client, conf = {}) { - return new YamuxMuxer({ - ...testConf, - ...conf, - direction: client ? 'outbound' : 'inbound', - log: logger(name) - }); -} -/** - * Create a transform that can be paused and unpaused - */ -export function pauseableTransform() { - let resolvePausePromise; - let pausePromise; - const unpause = () => { - resolvePausePromise?.(null); - }; - const pause = () => { - pausePromise = new Promise(resolve => { - resolvePausePromise = resolve; - }); - }; - const transform = async function* (source) { - for await (const d of source) { - if (pausePromise !== undefined) { - await pausePromise; - pausePromise = undefined; - resolvePausePromise = undefined; - } - yield d; - } - }; - return { transform, pause, unpause }; -} -export function testClientServer(conf = {}) { - const pair = duplexPair(); - const client = testYamuxMuxer('libp2p:yamux:client', true, conf); - const server = testYamuxMuxer('libp2p:yamux:server', false, conf); - const clientReadTransform = pauseableTransform(); - const clientWriteTransform = pauseableTransform(); - const serverReadTransform = pauseableTransform(); - const serverWriteTransform = pauseableTransform(); - void pipe(pair[0], clientReadTransform.transform, client, clientWriteTransform.transform, pair[0]); - void pipe(pair[1], serverReadTransform.transform, server, serverWriteTransform.transform, pair[1]); - return { - client: Object.assign(client, { - pauseRead: clientReadTransform.pause, - unpauseRead: clientReadTransform.unpause, - pauseWrite: clientWriteTransform.pause, - unpauseWrite: clientWriteTransform.unpause - }), - server: Object.assign(server, { - pauseRead: serverReadTransform.pause, - unpauseRead: serverReadTransform.unpause, - pauseWrite: serverWriteTransform.pause, - unpauseWrite: serverWriteTransform.unpause - }) - }; -} -export async function timeout(ms) { - return new Promise((_resolve, reject) => setTimeout(() => { reject(new Error(`timeout after ${ms}ms`)); }, ms)); -} -export async function sleep(ms) { - return new Promise(resolve => setTimeout(() => { resolve(ms); }, ms)); -} -//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/util.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/util.js.map deleted file mode 100644 index f75486fb3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/test/util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../../test/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,UAAU,EAAuB,MAAM,iBAAiB,CAAA;AAGxE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE;IACrB,IAAI,MAAM,GAAG,KAAK,CAAA;IAClB,OAAO,GAAG,EAAE;QACV,MAAM,QAAQ,GAAG,CAAC,MAAM,CAAA;QACxB,MAAM,GAAG,QAAQ,CAAA;QACjB,OAAO,QAAQ,CAAA;IACjB,CAAC,CAAA;AACH,CAAC,CAAC,EAAE,CAAA;AAEJ,MAAM,CAAC,MAAM,QAAQ,GAAoB;IACvC,eAAe,EAAE,KAAK;CACvB,CAAA;AAED;;;;;;GAMG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAClC,iBAAiB,CAAE,IAAqB;QACtC,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAA;QACzB,OAAO,KAAK,CAAC,iBAAiB,CAAC,EAAE,GAAG,QAAQ,EAAE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AC,KAAK,UAAU,OAAO,CAAE,EAAU;IACvC,OAAO,IAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,IAAI,KAAK,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAA,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAChH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,KAAK,CAAE,EAAU;IACrC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AACtE,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/tsconfig.tsbuildinfo deleted file mode 100644 index fd5d9b451..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/@libp2p/interface/dist/src/errors.d.ts","../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface/dist/src/peer-id/index.d.ts","../node_modules/@libp2p/logger/dist/src/index.d.ts","../src/constants.ts","../src/config.ts","../node_modules/uint8arraylist/dist/src/index.d.ts","../src/frame.ts","../node_modules/it-stream-types/dist/src/index.d.ts","../src/decode.ts","../src/encode.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/buffer/index.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@libp2p/interface/dist/src/events.d.ts","../node_modules/get-iterator/dist/src/index.d.ts","../node_modules/it-pushable/dist/src/index.d.ts","../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-info/index.d.ts","../node_modules/@libp2p/interface/dist/src/content-routing/index.d.ts","../node_modules/@libp2p/interface/dist/src/metrics/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-routing/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-store/index.d.ts","../node_modules/@libp2p/interface/dist/src/startable.d.ts","../node_modules/@libp2p/interface/dist/src/stream-handler/index.d.ts","../node_modules/@libp2p/interface/dist/src/topology/index.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/index.d.ts","../node_modules/@libp2p/interface/dist/src/transport/index.d.ts","../node_modules/@libp2p/interface/dist/src/index.d.ts","../node_modules/@libp2p/utils/dist/src/abstract-stream.d.ts","../node_modules/it-foreach/dist/src/index.d.ts","../src/stream.ts","../src/muxer.ts","../src/index.ts","../node_modules/@types/chai/index.d.ts","../node_modules/@types/chai-as-promised/index.d.ts","../node_modules/chai-parentheses/index.d.ts","../node_modules/@types/chai-subset/index.d.ts","../node_modules/chai-bites/index.d.ts","../node_modules/@types/chai-string/index.d.ts","../node_modules/aegir/dist/utils/chai.d.ts","../test/codec.util.ts","../test/codec.spec.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/index.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/stream-muxer/index.d.ts","../node_modules/it-pair/dist/src/duplex.d.ts","../node_modules/it-pipe/dist/src/index.d.ts","../test/util.ts","../test/compliance.spec.ts","../test/decode.spec.ts","../node_modules/@libp2p/mplex/dist/src/message-types.d.ts","../node_modules/@libp2p/mplex/dist/src/stream.d.ts","../node_modules/@libp2p/mplex/dist/src/mplex.d.ts","../node_modules/@libp2p/mplex/dist/src/index.d.ts","../test/mplex.util.ts","../test/muxer.spec.ts","../node_modules/it-drain/dist/src/index.d.ts","../test/stream.spec.ts","../node_modules/@dapplion/benchmark/lib/utils/mochacliexports.d.ts","../node_modules/@dapplion/benchmark/lib/types.d.ts","../node_modules/@dapplion/benchmark/lib/mochaplugin/runbenchfn.d.ts","../node_modules/@dapplion/benchmark/lib/mochaplugin/index.d.ts","../node_modules/@dapplion/benchmark/lib/index.d.ts","../test/bench/codec.bench.ts","../test/bench/comparison.bench.ts","../node_modules/keyv/src/index.d.ts","../node_modules/@types/http-cache-semantics/index.d.ts","../node_modules/@types/responselike/index.d.ts","../node_modules/@types/cacheable-request/index.d.ts","../node_modules/@types/ms/index.d.ts","../node_modules/@types/debug/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/keyv/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/mdast/index.d.ts","../node_modules/@types/minimatch/index.d.ts","../node_modules/@types/minimist/index.d.ts","../node_modules/@types/mocha/index.d.ts","../node_modules/@types/node-fetch/node_modules/form-data/index.d.ts","../node_modules/@types/node-fetch/externals.d.ts","../node_modules/@types/node-fetch/index.d.ts","../node_modules/@types/normalize-package-data/index.d.ts","../node_modules/@types/parse-json/index.d.ts","../node_modules/@types/retry/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts","../node_modules/@types/strip-bom/index.d.ts","../node_modules/@types/strip-json-comments/index.d.ts","../node_modules/@types/tunnel/index.d.ts","../node_modules/@types/ungap__structured-clone/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts","../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","cb4b40f34fe4b1d87c530a0f3c2c1e043e338829fab8cf5cbd92a91c8c1374b8",{"version":"646beeaa0e97b5d4798f01ae89b23f6b865c431891809bb33aa5b789bfc0eb23","signature":"df7d1feb50bcbe0479167c592934b29c9883c99bed4c04847e497571ea25429d"},{"version":"973516e23e7bb3b05ac9e0db11801bc769bcc1ed70779b59299d6f128570a503","signature":"c8031a5db82b240f801a5684ab693e95e1e06dc76958894fe42d35acbd446f28"},"176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d",{"version":"77b3667a04dcec1bbf3d5958cdd117e58ea93543370e019d5d2f313b33475d76","signature":"1633b84fd3346ad6500a88e7a119ac778bb6f6b2746a3b7b8164c5ef2721822f"},"c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc",{"version":"0ad343b8866b3e51c60be77174d88f7e8c9e391816f329388daf36bd42c77c10","signature":"44287337e054ff7aa53fd7ccdafce53525bf3737f1258bc5c6fb7cdb94eefbf8"},{"version":"813aef3c48ba035ef86423017092460ca5cc552336f0519f71417c0e02d57c48","signature":"de47457474d7e0c031a66c92c6809813beced704dcff00b327252dbfbd735246"},"efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","285e512c7a0db217a0599e18c462d565fa35be4a5153dd7b80bee88c83e83ddf","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"7ae9dc7dbb58cd843065639707815df85c044babaa0947116f97bdb824d07204","affectsGlobalScope":true},"7aae1df2053572c2cfc2089a77847aadbb38eedbaa837a846c6a49fb37c6e5bd","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"dea4c00820d4fac5e530d4842aed2fb20d6744d75a674b95502cbd433f88bcb0","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"b7eadc0b0cba14ab854122810f330314132c5cfdb7800fceb82d521997a1f5b0","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"2225100373ca3d63bcc7f206e1177152d2e2161285a0bd83c8374db1503a0d1f","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","4a34b074b11c3597fb2ff890bc8f1484375b3b80793ab01f974534808d5777c7",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","485ae32287d8df9e74f68a9dc96c9211a7cfe8b302717043a988a40d930330d2","fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","1bf687d978bdd6d5aff10b9eb0ff0695179f8594d4446946fd0182d6d25fa433","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1","75e0c62536016dac8cc0d825742ff7cc4c0455ebc86923e47edcc19edac0997c","c66c95ed9fcebfc20ac8a59e7ea8bf41e1a3ead0e81206515102f4ca6c54272f",{"version":"cc4246e61d1268ead1c1b05994fb8a7f2ea4b3d7a5222c9747fd83e24c0d3d4b","signature":"de6afce5d1e6f2f81a5030fee9c7400a56b3c4077c5f9699cd71294c91e525cf"},{"version":"d45c99803572149f908205cdbe67a6d8a7c035ab5437876aeb0cd0863342ffc9","signature":"067ab20bf63d65f9b724398636d5083a71fb7d8cfe80a504ce2d2fe31400eab7"},{"version":"02ba3e55572e45071b1b6380d713eb8744a64e2f93d6239eea167cecb3ff0b2b","signature":"df54eaa5ea53c6bb3a9548bc5d2f6fb22583ea3e8b936a4e8ec5acfd90422ff3"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d",{"version":"2a5f6d929c1ab7dd044e4e1f27c2219138388f6ffbec5f495ce973c9682cbb4d","signature":"e0a5e1d0a21126716c6561a24e50810c24e63a549cb06d96d6cb675512c1b31c"},{"version":"8a54db2a8b7bfa3a68970b795708c982b45f76165538e8938a1fbdd7dbcd19f9","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","89020b28796eb67824a234b2d571d51ae6f9f944efa0201901df1447ff61ea87","b1129d7c114eba7c7b155dc809d6371ef86a0738f7ca93b3efef9b796d6168d9","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6",{"version":"d9dc238dc60f9f6fac4ac03ad8d1ed44774707befe91ed1b8e42f947df4ff69f","signature":"44f9c4f61b45a644c79fe6b15e09220e78c6bf3fbb46552fcae2ca0069c02e47"},{"version":"7ec913df1f630b388fb69f560287ddc7eecc83dd57587b38a20aa83353640e0f","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"68c22a33a565cfb46edaa7632c40ed3e49fdc735898e9b46fdd334ce0747cf15","signature":"d44159b9ee3018b60e80fd577633a4e1ee533c89f1b1042ceba9e41b655baaf1"},"22c980472aeac42a88c7954c9645c5cf0c511142afd048699daf516b25f9ea2d","aabcb267f8a73a9923157af617c47e2d707481760e60967dfa836613e2b7433b","52e581f4f22812920c916ebde59bad7175b5f6cdd4d33cb3f89333621a0a465f","b136dc0a448fd836eaf575f97ed9beeafe1f09752d72b75d5d71749b13815ba5",{"version":"a50419f7eb4aa63a5f3d08de48edfe781eaac9e3b4025e9dc95a2ea1068a3f08","signature":"6fbb5def100ea00a3a0eebe436f333b7d184445d2d1c1ff15ed6d9f531e005ea"},{"version":"427f54210f631b4b29e3362abddb472d04745871579d160f10a0d0b522021fc9","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"687ec53a7422d8cf80477fffa82a2db211f724039267931642befcd4907aec26",{"version":"04bc1356353c28c93ae6bbd171bd79783a74fa9cb0ac0b3dc95f2d110e3a1d55","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"4ef576c5a52f34423f6328a6834c6fc874c6683a0626c0f21d6b2209f460dffd","7b195dbf43d2194d18627fe3e190979b5bd2f0752001193260c89b01c36460e2","7350c835566c20d980134ad870a072daa93754c6b65d602a46f2bc2e2ae12165","ee9b614565fe2e96c3202c092ea4e4bc902f51d1508bf8015d8f2275686ab040","f6f278c43d4e70fe1abb2c826a0b1c1ea7c4f6ff50b272aacdda3b39c51f4d61",{"version":"507c17c9560d122d5a84b1a9c445f1dda6bab818e816490c92cae62cc85e177a","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"6fdcba0554752fe51578f0fadbbfa35ed5d3687ca9d48d533dfd49356879ea49","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"736097ddbb2903bef918bb3b5811ef1c9c5656f2a73bd39b22a91b9cc2525e50","4340936f4e937c452ae783514e7c7bbb7fc06d0c97993ff4865370d0962bb9cf","5009c081fd8ca3fcd6f3adcd071a1c79a933a400532b897822aad0943688a1f1","22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a","4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","882057f051daf834e4d01701066e1bac2d243b0c3eda702b25874402c1e0172d","852bcf5d92d819abdf34ba0759c311b61d5dac7b9963a6c3cc4f23b025dee8f3","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[69,70,72,74,75,[183,185],193,194,[199,201],206,207,209,215,216],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[155,213],[155,211,212],[155,211],[155,210],[155],[155,178,195],[67,71,73,155,168,180],[66,155,170,180],[125,155,162],[67,155,163,168,169,170,171,172,173,174,175,176,177,179],[155,169],[64,66,155],[67,155,168],[67,155,170,180],[71,73,155,169,180],[67,155,169],[155,163,168,169,178,180],[67,155],[155,178,204],[71,155],[71,73,155,169,178,180,202,203,205],[71,155,180,181,202],[68,71,73,155,169,180],[155,168],[155,166,167],[125,128,154,155,162,217,218,219],[155,186],[155,221],[155,227],[128,154,155,162,232,233],[128,143,155,162],[76,155],[112,155],[113,118,146,155],[114,125,126,133,143,154,155],[114,115,125,133,155],[116,155],[117,118,126,134,155],[118,143,151,155],[119,121,125,133,155],[120,155],[121,122,155],[125,155],[123,125,155],[112,125,155],[125,126,127,143,154,155],[125,126,127,140,143,146,155],[110,155,159],[121,125,128,133,143,154,155],[125,126,128,129,133,143,151,154,155],[128,130,143,151,154,155],[76,77,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161],[125,131,155],[132,154,155,159],[121,125,133,143,155],[134,155],[135,155],[112,136,155],[137,153,155,159],[138,155],[139,155],[125,140,141,155],[140,142,155,157],[113,125,143,144,145,146,155],[113,143,145,155],[143,144,155],[146,155],[147,155],[112,143,155],[125,149,150,155],[149,150,155],[118,133,143,151,155],[152,155],[133,153,155],[113,128,139,154,155],[118,155],[143,155,156],[132,155,157],[155,158],[113,118,125,127,136,143,154,155,157,159],[143,155,160],[155,238,277],[155,238,262,277],[155,277],[155,238],[155,238,263,277],[155,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276],[155,263,277],[128,130,155,162],[155,282],[125,143,155,162],[155,186,187,188,189,190,191],[155,186,187],[73,155],[65,66,155],[65,155],[62,63,64,155],[87,91,154,155],[87,143,154,155],[82,155],[84,87,151,154,155],[133,151,155],[155,162],[82,155,162],[84,87,133,154,155],[79,80,83,86,113,125,143,154,155],[79,85,155],[83,87,113,146,154,155,162],[113,155,162],[103,113,155,162],[81,82,155,162],[87,155],[81,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,155],[87,94,95,155],[85,87,95,96,155],[86,155],[79,82,87,155],[87,91,95,96,155],[91,155],[85,87,90,154,155],[79,84,85,87,91,94,155],[113,143,155],[82,87,103,113,155,159,162],[61,68,69,155],[61,69,71,72,73,155],[72,155],[72,155,178,184],[61,68,69,70,71,72,73,74,75,155,163,164,165,169,178,180,183],[61,69,70,71,72,155,180,181,182],[72,74,75,155,193,214],[155,198,199,206,208,214],[72,74,75,155,192,193],[61,69,72,155],[155,196,199],[69,71,72,74,75,155,165,192,199],[68,71,73,155,178,197,198,205],[69,71,155,192,197,198,199],[69,70,71,72,155,165,183,192,198,199,208],[68,70,71,73,155,184,197,198],[68],[71,72,73],[72],[72,178,184],[70,71,72,73,165,178,180,183],[70,71,72,180,181],[73,178],[70,73,184]],"referencedMap":[[214,1],[213,2],[212,3],[211,4],[210,5],[195,5],[196,6],[169,7],[171,8],[61,5],[163,9],[180,10],[172,11],[67,12],[170,13],[173,14],[174,13],[175,5],[176,11],[178,15],[177,16],[179,17],[68,18],[205,19],[202,20],[204,21],[203,22],[181,23],[167,24],[168,25],[166,24],[220,26],[187,27],[191,27],[189,27],[186,5],[222,28],[218,5],[223,5],[224,5],[225,5],[226,9],[228,29],[229,5],[230,5],[231,5],[221,5],[233,5],[234,30],[232,31],[76,32],[77,32],[112,33],[113,34],[114,35],[115,36],[116,37],[117,38],[118,39],[119,40],[120,41],[121,42],[122,42],[124,43],[123,44],[125,45],[126,46],[127,47],[111,48],[161,5],[128,49],[129,50],[130,51],[162,52],[131,53],[132,54],[133,55],[134,56],[135,57],[136,58],[137,59],[138,60],[139,61],[140,62],[141,62],[142,63],[143,64],[145,65],[144,66],[146,67],[147,68],[148,69],[149,70],[150,71],[151,72],[152,73],[153,74],[154,75],[155,76],[156,77],[157,78],[158,79],[159,80],[160,81],[235,5],[236,5],[219,31],[237,5],[262,82],[263,83],[238,84],[241,84],[260,82],[261,82],[251,82],[250,85],[248,82],[243,82],[256,82],[254,82],[258,82],[242,82],[255,82],[259,82],[244,82],[245,82],[257,82],[239,82],[246,82],[247,82],[249,82],[253,82],[264,86],[252,82],[240,82],[277,87],[276,5],[271,86],[273,88],[272,86],[265,86],[266,86],[268,86],[270,86],[274,88],[275,88],[267,88],[269,88],[278,5],[279,5],[280,89],[281,5],[227,5],[282,5],[283,90],[284,91],[192,92],[78,5],[190,27],[188,93],[164,5],[208,5],[182,5],[197,94],[198,94],[165,5],[73,5],[217,43],[62,5],[63,95],[66,96],[64,5],[65,97],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[71,5],[94,98],[101,99],[93,98],[108,100],[85,101],[84,102],[107,103],[102,104],[105,105],[87,106],[86,107],[82,108],[81,109],[104,110],[83,111],[88,112],[89,5],[92,112],[79,5],[110,113],[109,112],[96,114],[97,115],[99,116],[95,117],[98,118],[103,103],[90,119],[91,120],[100,121],[80,122],[106,123],[70,124],[69,5],[74,125],[75,126],[72,5],[185,127],[184,128],[183,129],[215,130],[216,131],[194,132],[193,133],[200,134],[201,135],[206,136],[207,137],[209,138],[199,139]],"exportedModulesMap":[[214,1],[213,2],[212,3],[211,4],[210,5],[195,5],[196,6],[169,7],[171,8],[61,5],[163,9],[180,10],[172,11],[67,12],[170,13],[173,14],[174,13],[175,5],[176,11],[178,15],[177,16],[179,17],[68,18],[205,19],[202,20],[204,21],[203,22],[181,23],[167,24],[168,25],[166,24],[220,26],[187,27],[191,27],[189,27],[186,5],[222,28],[218,5],[223,5],[224,5],[225,5],[226,9],[228,29],[229,5],[230,5],[231,5],[221,5],[233,5],[234,30],[232,31],[76,32],[77,32],[112,33],[113,34],[114,35],[115,36],[116,37],[117,38],[118,39],[119,40],[120,41],[121,42],[122,42],[124,43],[123,44],[125,45],[126,46],[127,47],[111,48],[161,5],[128,49],[129,50],[130,51],[162,52],[131,53],[132,54],[133,55],[134,56],[135,57],[136,58],[137,59],[138,60],[139,61],[140,62],[141,62],[142,63],[143,64],[145,65],[144,66],[146,67],[147,68],[148,69],[149,70],[150,71],[151,72],[152,73],[153,74],[154,75],[155,76],[156,77],[157,78],[158,79],[159,80],[160,81],[235,5],[236,5],[219,31],[237,5],[262,82],[263,83],[238,84],[241,84],[260,82],[261,82],[251,82],[250,85],[248,82],[243,82],[256,82],[254,82],[258,82],[242,82],[255,82],[259,82],[244,82],[245,82],[257,82],[239,82],[246,82],[247,82],[249,82],[253,82],[264,86],[252,82],[240,82],[277,87],[276,5],[271,86],[273,88],[272,86],[265,86],[266,86],[268,86],[270,86],[274,88],[275,88],[267,88],[269,88],[278,5],[279,5],[280,89],[281,5],[227,5],[282,5],[283,90],[284,91],[192,92],[78,5],[190,27],[188,93],[164,5],[208,5],[182,5],[197,94],[198,94],[165,5],[73,5],[217,43],[62,5],[63,95],[66,96],[64,5],[65,97],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[71,5],[94,98],[101,99],[93,98],[108,100],[85,101],[84,102],[107,103],[102,104],[105,105],[87,106],[86,107],[82,108],[81,109],[104,110],[83,111],[88,112],[89,5],[92,112],[79,5],[110,113],[109,112],[96,114],[97,115],[99,116],[95,117],[98,118],[103,103],[90,119],[91,120],[100,121],[80,122],[106,123],[70,140],[74,141],[75,142],[185,143],[184,144],[183,145],[193,142],[206,146],[199,147]],"semanticDiagnosticsPerFile":[214,213,212,211,210,195,196,169,171,61,163,180,172,67,170,173,174,175,176,178,177,179,68,205,202,204,203,181,167,168,166,220,187,191,189,186,222,218,223,224,225,226,228,229,230,231,221,233,234,232,76,77,112,113,114,115,116,117,118,119,120,121,122,124,123,125,126,127,111,161,128,129,130,162,131,132,133,134,135,136,137,138,139,140,141,142,143,145,144,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,235,236,219,237,262,263,238,241,260,261,251,250,248,243,256,254,258,242,255,259,244,245,257,239,246,247,249,253,264,252,240,277,276,271,273,272,265,266,268,270,274,275,267,269,278,279,280,281,227,282,283,284,192,78,190,188,164,208,182,197,198,165,73,217,62,63,66,64,65,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,71,94,101,93,108,85,84,107,102,105,87,86,82,81,104,83,88,89,92,79,110,109,96,97,99,95,98,103,90,91,100,80,106,70,69,74,75,72,185,184,183,215,216,194,193,200,201,206,207,209,199],"latestChangedDtsFile":"./src/stream.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/package.json deleted file mode 100644 index 9b436b752..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/package.json +++ /dev/null @@ -1,191 +0,0 @@ -{ - "name": "@chainsafe/libp2p-yamux", - "version": "5.0.3", - "description": "Yamux stream multiplexer for libp2p", - "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/ChainSafe/js-libp2p-yamux#readme", - "repository": { - "type": "git", - "url": "git+https://github.com/ChainSafe/js-libp2p-yamux.git" - }, - "bugs": { - "url": "https://github.com/ChainSafe/js-libp2p-yamux/issues" - }, - "keywords": [ - "IPFS", - "libp2p", - "multiplexer", - "muxer", - "stream" - ], - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - }, - "type": "module", - "types": "./dist/src/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "*", - "dist/*", - "dist/src/*", - "dist/src/*/index" - ], - "src/*": [ - "*", - "dist/*", - "dist/src/*", - "dist/src/*/index" - ] - } - }, - "files": [ - "src", - "dist", - "!dist/test", - "!**/*.tsbuildinfo" - ], - "exports": { - ".": { - "types": "./dist/src/index.d.ts", - "import": "./dist/src/index.js" - }, - "./config": { - "types": "./dist/src/config.d.ts", - "import": "./dist/src/config.js" - }, - "./stream": { - "types": "./dist/src/stream.d.ts", - "import": "./dist/src/stream.js" - } - }, - "eslintConfig": { - "extends": "ipfs", - "parserOptions": { - "sourceType": "module" - }, - "ignorePatterns": [ - "src/*.d.ts" - ] - }, - "release": { - "branches": [ - "master" - ], - "plugins": [ - [ - "@semantic-release/commit-analyzer", - { - "preset": "conventionalcommits", - "releaseRules": [ - { - "breaking": true, - "release": "major" - }, - { - "revert": true, - "release": "patch" - }, - { - "type": "feat", - "release": "minor" - }, - { - "type": "fix", - "release": "patch" - }, - { - "type": "docs", - "release": "patch" - }, - { - "type": "test", - "release": "patch" - }, - { - "type": "deps", - "release": "patch" - }, - { - "scope": "no-release", - "release": false - } - ] - } - ], - [ - "@semantic-release/release-notes-generator", - { - "preset": "conventionalcommits", - "presetConfig": { - "types": [ - { - "type": "feat", - "section": "Features" - }, - { - "type": "fix", - "section": "Bug Fixes" - }, - { - "type": "chore", - "section": "Trivial Changes" - }, - { - "type": "docs", - "section": "Documentation" - }, - { - "type": "deps", - "section": "Dependencies" - }, - { - "type": "test", - "section": "Tests" - } - ] - } - } - ], - "@semantic-release/changelog", - "@semantic-release/npm", - "@semantic-release/github", - "@semantic-release/git" - ] - }, - "scripts": { - "clean": "aegir clean", - "lint": "aegir lint", - "dep-check": "aegir dep-check", - "benchmark": "benchmark dist/test/bench/*.bench.js --timeout 400000", - "build": "aegir build", - "test": "aegir test", - "test:chrome": "aegir test -t browser", - "test:chrome-webworker": "aegir test -t webworker", - "test:firefox": "aegir test -t browser -- --browser firefox", - "test:firefox-webworker": "aegir test -t webworker -- --browser firefox", - "test:node": "aegir test -t node --cov", - "test:electron-main": "aegir test -t electron-main", - "release": "aegir release", - "docs": "aegir docs" - }, - "dependencies": { - "@libp2p/interface": "next", - "@libp2p/logger": "next", - "get-iterator": "^2.0.1", - "it-foreach": "^2.0.3", - "it-pipe": "^3.0.1", - "it-pushable": "^3.2.0", - "uint8arraylist": "^2.4.3" - }, - "devDependencies": { - "@dapplion/benchmark": "^0.2.4", - "@libp2p/interface-compliance-tests": "next", - "@libp2p/mplex": "next", - "aegir": "^40.0.1", - "it-drain": "^3.0.2", - "it-pair": "^2.0.6", - "it-stream-types": "^2.0.1" - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/config.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/config.ts deleted file mode 100644 index 887e461f5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/config.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { logger, type Logger } from '@libp2p/logger' -import { ERR_INVALID_CONFIG, INITIAL_STREAM_WINDOW, MAX_STREAM_WINDOW } from './constants.js' - -// TOOD use config items or delete them -export interface Config { - /** - * Used to control the log destination - * - * It can be disabled by explicitly setting to `undefined` - */ - log?: Logger - - /** - * Used to do periodic keep alive messages using a ping. - */ - enableKeepAlive: boolean - - /** - * How often to perform the keep alive - * - * measured in milliseconds - */ - keepAliveInterval: number - - /** - * Maximum number of concurrent inbound streams that we accept. - * If the peer tries to open more streams, those will be reset immediately. - */ - maxInboundStreams: number - - /** - * Maximum number of concurrent outbound streams that we accept. - * If the application tries to open more streams, the call to `newStream` will throw - */ - maxOutboundStreams: number - - /** - * Used to control the initial window size that we allow for a stream. - * - * measured in bytes - */ - initialStreamWindowSize: number - - /** - * Used to control the maximum window size that we allow for a stream. - */ - maxStreamWindowSize: number - - /** - * Maximum size of a message that we'll send on a stream. - * This ensures that a single stream doesn't hog a connection. - */ - maxMessageSize: number -} - -export const defaultConfig: Config = { - log: logger('libp2p:yamux'), - enableKeepAlive: true, - keepAliveInterval: 30_000, - maxInboundStreams: 1_000, - maxOutboundStreams: 1_000, - initialStreamWindowSize: INITIAL_STREAM_WINDOW, - maxStreamWindowSize: MAX_STREAM_WINDOW, - maxMessageSize: 64 * 1024 -} - -export function verifyConfig (config: Config): void { - if (config.keepAliveInterval <= 0) { - throw new CodeError('keep-alive interval must be positive', ERR_INVALID_CONFIG) - } - if (config.maxInboundStreams < 0) { - throw new CodeError('max inbound streams must be larger or equal 0', ERR_INVALID_CONFIG) - } - if (config.maxOutboundStreams < 0) { - throw new CodeError('max outbound streams must be larger or equal 0', ERR_INVALID_CONFIG) - } - if (config.initialStreamWindowSize < INITIAL_STREAM_WINDOW) { - throw new CodeError('InitialStreamWindowSize must be larger or equal 256 kB', ERR_INVALID_CONFIG) - } - if (config.maxStreamWindowSize < config.initialStreamWindowSize) { - throw new CodeError('MaxStreamWindowSize must be larger than the InitialStreamWindowSize', ERR_INVALID_CONFIG) - } - if (config.maxStreamWindowSize > 2 ** 32 - 1) { - throw new CodeError('MaxStreamWindowSize must be less than equal MAX_UINT32', ERR_INVALID_CONFIG) - } - if (config.maxMessageSize < 1024) { - throw new CodeError('MaxMessageSize must be greater than a kilobyte', ERR_INVALID_CONFIG) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/constants.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/constants.ts deleted file mode 100644 index d28830008..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/constants.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Protocol violation errors - -export const ERR_INVALID_FRAME = 'ERR_INVALID_FRAME' -export const ERR_UNREQUESTED_PING = 'ERR_UNREQUESTED_PING' -export const ERR_NOT_MATCHING_PING = 'ERR_NOT_MATCHING_PING' -export const ERR_STREAM_ALREADY_EXISTS = 'ERR_STREAM_ALREADY_EXISTS' -export const ERR_DECODE_INVALID_VERSION = 'ERR_DECODE_INVALID_VERSION' -export const ERR_BOTH_CLIENTS = 'ERR_BOTH_CLIENTS' -export const ERR_RECV_WINDOW_EXCEEDED = 'ERR_RECV_WINDOW_EXCEEDED' - -export const PROTOCOL_ERRORS = new Set([ - ERR_INVALID_FRAME, - ERR_UNREQUESTED_PING, - ERR_NOT_MATCHING_PING, - ERR_STREAM_ALREADY_EXISTS, - ERR_DECODE_INVALID_VERSION, - ERR_BOTH_CLIENTS, - ERR_RECV_WINDOW_EXCEEDED -]) - -// local errors - -export const ERR_INVALID_CONFIG = 'ERR_INVALID_CONFIG' -export const ERR_MUXER_LOCAL_CLOSED = 'ERR_MUXER_LOCAL_CLOSED' -export const ERR_MUXER_REMOTE_CLOSED = 'ERR_MUXER_REMOTE_CLOSED' -export const ERR_STREAM_RESET = 'ERR_STREAM_RESET' -export const ERR_STREAM_ABORT = 'ERR_STREAM_ABORT' -export const ERR_MAX_OUTBOUND_STREAMS_EXCEEDED = 'ERROR_MAX_OUTBOUND_STREAMS_EXCEEDED' -export const ERR_DECODE_IN_PROGRESS = 'ERR_DECODE_IN_PROGRESS' - -/** - * INITIAL_STREAM_WINDOW is the initial stream window size. - * - * Not an implementation choice, this is defined in the specification - */ -export const INITIAL_STREAM_WINDOW = 256 * 1024 - -/** - * Default max stream window - */ -export const MAX_STREAM_WINDOW = 16 * 1024 * 1024 diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/decode.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/decode.ts deleted file mode 100644 index 8433f8f2c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/decode.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { Uint8ArrayList } from 'uint8arraylist' -import { ERR_DECODE_INVALID_VERSION, ERR_DECODE_IN_PROGRESS } from './constants.js' -import { type FrameHeader, FrameType, HEADER_LENGTH, YAMUX_VERSION } from './frame.js' -import type { Source } from 'it-stream-types' - -// used to bitshift in decoding -// native bitshift can overflow into a negative number, so we bitshift by multiplying by a power of 2 -const twoPow24 = 2 ** 24 - -/** - * Decode a header from the front of a buffer - * - * @param data - Assumed to have enough bytes for a header - */ -export function decodeHeader (data: Uint8Array): FrameHeader { - if (data[0] !== YAMUX_VERSION) { - throw new CodeError('Invalid frame version', ERR_DECODE_INVALID_VERSION) - } - return { - type: data[1], - flag: (data[2] << 8) + data[3], - streamID: (data[4] * twoPow24) + (data[5] << 16) + (data[6] << 8) + data[7], - length: (data[8] * twoPow24) + (data[9] << 16) + (data[10] << 8) + data[11] - } -} - -/** - * Decodes yamux frames from a source - */ -export class Decoder { - private readonly source: Source - /** Buffer for in-progress frames */ - private readonly buffer: Uint8ArrayList - /** Used to sanity check against decoding while in an inconsistent state */ - private frameInProgress: boolean - - constructor (source: Source) { - // Normally, when entering a for-await loop with an iterable/async iterable, the only ways to exit the loop are: - // 1. exhaust the iterable - // 2. throw an error - slow, undesirable if there's not actually an error - // 3. break or return - calls the iterable's `return` method, finalizing the iterable, no more iteration possible - // - // In this case, we want to enter (and exit) a for-await loop per chunked data frame and continue processing the iterable. - // To do this, we strip the `return` method from the iterator and can now `break` early and continue iterating. - // Exiting the main for-await is still possible via 1. and 2. - this.source = returnlessSource(source) - this.buffer = new Uint8ArrayList() - this.frameInProgress = false - } - - /** - * Emits frames from the decoder source. - * - * Note: If `readData` is emitted, it _must_ be called before the next iteration - * Otherwise an error is thrown - */ - async * emitFrames (): AsyncGenerator<{ header: FrameHeader, readData?: () => Promise }> { - for await (const chunk of this.source) { - this.buffer.append(chunk) - - // Loop to consume as many bytes from the buffer as possible - // Eg: when a single chunk contains several frames - while (true) { - const header = this.readHeader() - if (header === undefined) { - break - } - - const { type, length } = header - if (type === FrameType.Data) { - // This is a data frame, the frame body must still be read - // `readData` must be called before the next iteration here - this.frameInProgress = true - yield { - header, - readData: this.readBytes.bind(this, length) - } - } else { - yield { header } - } - } - } - } - - private readHeader (): FrameHeader | undefined { - // Sanity check to ensure a header isn't read when another frame is partially decoded - // In practice this shouldn't happen - if (this.frameInProgress) { - throw new CodeError('decoding frame already in progress', ERR_DECODE_IN_PROGRESS) - } - - if (this.buffer.length < HEADER_LENGTH) { - // not enough data yet - return - } - - const header = decodeHeader(this.buffer.subarray(0, HEADER_LENGTH)) - this.buffer.consume(HEADER_LENGTH) - return header - } - - private async readBytes (length: number): Promise { - if (this.buffer.length < length) { - for await (const chunk of this.source) { - this.buffer.append(chunk) - - if (this.buffer.length >= length) { - // see note above, the iterator is not `return`ed here - break - } - } - } - - const out = this.buffer.sublist(0, length) - this.buffer.consume(length) - - // The next frame can now be decoded - this.frameInProgress = false - - return out - } -} - -/** - * Strip the `return` method from a `Source` - */ -export function returnlessSource (source: Source): Source { - if ((source as Iterable)[Symbol.iterator] !== undefined) { - const iterator = (source as Iterable)[Symbol.iterator]() - iterator.return = undefined - return { - [Symbol.iterator] () { return iterator } - } - } else if ((source as AsyncIterable)[Symbol.asyncIterator] !== undefined) { - const iterator = (source as AsyncIterable)[Symbol.asyncIterator]() - iterator.return = undefined - return { - [Symbol.asyncIterator] () { return iterator } - } - } else { - throw new Error('a source must be either an iterable or an async iterable') - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/encode.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/encode.ts deleted file mode 100644 index 6353c0091..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/encode.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { HEADER_LENGTH } from './frame.js' -import type { FrameHeader } from './frame.js' - -export function encodeHeader (header: FrameHeader): Uint8Array { - const frame = new Uint8Array(HEADER_LENGTH) - - // always assume version 0 - // frameView.setUint8(0, header.version) - - frame[1] = header.type - - frame[2] = header.flag >>> 8 - frame[3] = header.flag - - frame[4] = header.streamID >>> 24 - frame[5] = header.streamID >>> 16 - frame[6] = header.streamID >>> 8 - frame[7] = header.streamID - - frame[8] = header.length >>> 24 - frame[9] = header.length >>> 16 - frame[10] = header.length >>> 8 - frame[11] = header.length - - return frame -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/frame.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/frame.ts deleted file mode 100644 index b9f41289e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/frame.ts +++ /dev/null @@ -1,64 +0,0 @@ -export enum FrameType { - /** Used to transmit data. May transmit zero length payloads depending on the flags. */ - Data = 0x0, - /** Used to updated the senders receive window size. This is used to implement per-session flow control. */ - WindowUpdate = 0x1, - /** Used to measure RTT. It can also be used to heart-beat and do keep-alives over TCP. */ - Ping = 0x2, - /** Used to close a session. */ - GoAway = 0x3, -} - -export enum Flag { - /** Signals the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate outbound. */ - SYN = 0x1, - /** Acknowledges the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate response. */ - ACK = 0x2, - /** Performs a half-close of a stream. May be sent with a data message or window update. */ - FIN = 0x4, - /** Reset a stream immediately. May be sent with a data or window update message. */ - RST = 0x8, -} - -const flagCodes = Object.values(Flag).filter((x) => typeof x !== 'string') as Flag[] - -export const YAMUX_VERSION = 0 - -export enum GoAwayCode { - NormalTermination = 0x0, - ProtocolError = 0x1, - InternalError = 0x2, -} - -export const HEADER_LENGTH = 12 - -export interface FrameHeader { - /** - * The version field is used for future backward compatibility. - * At the current time, the field is always set to 0, to indicate the initial version. - */ - version?: number - /** The type field is used to switch the frame message type. */ - type: FrameType - /** The flags field is used to provide additional information related to the message type. */ - flag: number - /** - * The StreamID field is used to identify the logical stream the frame is addressing. - * The client side should use odd ID's, and the server even. - * This prevents any collisions. Additionally, the 0 ID is reserved to represent the session. - */ - streamID: number - /** - * The meaning of the length field depends on the message type: - * * Data - provides the length of bytes following the header - * * Window update - provides a delta update to the window size - * * Ping - Contains an opaque value, echoed back - * * Go Away - Contains an error code - */ - length: number -} - -export function stringifyHeader (header: FrameHeader): string { - const flags = flagCodes.filter(f => (header.flag & f) === f).map(f => Flag[f]).join('|') - return `streamID=${header.streamID} type=${FrameType[header.type]} flag=${flags} length=${header.length}` -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/index.ts deleted file mode 100644 index ade3ad883..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Yamux } from './muxer.js' -import type { YamuxMuxerInit } from './muxer.js' -import type { StreamMuxerFactory } from '@libp2p/interface/stream-muxer' -export { GoAwayCode } from './frame.js' - -export function yamux (init: YamuxMuxerInit = {}): () => StreamMuxerFactory { - return () => new Yamux(init) -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/muxer.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/muxer.ts deleted file mode 100644 index 8b4d491ed..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/muxer.ts +++ /dev/null @@ -1,598 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { setMaxListeners } from '@libp2p/interface/events' -import { logger, type Logger } from '@libp2p/logger' -import { getIterator } from 'get-iterator' -import { pushable, type Pushable } from 'it-pushable' -import { type Config, defaultConfig, verifyConfig } from './config.js' -import { ERR_BOTH_CLIENTS, ERR_INVALID_FRAME, ERR_MAX_OUTBOUND_STREAMS_EXCEEDED, ERR_MUXER_LOCAL_CLOSED, ERR_MUXER_REMOTE_CLOSED, ERR_NOT_MATCHING_PING, ERR_STREAM_ALREADY_EXISTS, ERR_UNREQUESTED_PING, PROTOCOL_ERRORS } from './constants.js' -import { Decoder } from './decode.js' -import { encodeHeader } from './encode.js' -import { Flag, type FrameHeader, FrameType, GoAwayCode } from './frame.js' -import { StreamState, YamuxStream } from './stream.js' -import type { AbortOptions } from '@libp2p/interface' -import type { Stream } from '@libp2p/interface/connection' -import type { StreamMuxer, StreamMuxerFactory, StreamMuxerInit } from '@libp2p/interface/stream-muxer' -import type { Sink, Source } from 'it-stream-types' -import type { Uint8ArrayList } from 'uint8arraylist' - -const YAMUX_PROTOCOL_ID = '/yamux/1.0.0' -const CLOSE_TIMEOUT = 500 - -export interface YamuxMuxerInit extends StreamMuxerInit, Partial { -} - -export class Yamux implements StreamMuxerFactory { - protocol = YAMUX_PROTOCOL_ID - private readonly _init: YamuxMuxerInit - - constructor (init: YamuxMuxerInit = {}) { - this._init = init - } - - createStreamMuxer (init?: YamuxMuxerInit): YamuxMuxer { - return new YamuxMuxer({ - ...this._init, - ...init - }) - } -} - -export interface CloseOptions extends AbortOptions { - reason?: GoAwayCode -} - -export class YamuxMuxer implements StreamMuxer { - protocol = YAMUX_PROTOCOL_ID - source: Pushable - sink: Sink, Promise> - - private readonly config: Config - private readonly log?: Logger - - /** Used to close the muxer from either the sink or source */ - private readonly closeController: AbortController - - /** The next stream id to be used when initiating a new stream */ - private nextStreamID: number - /** Primary stream mapping, streamID => stream */ - private readonly _streams: Map - - /** The next ping id to be used when pinging */ - private nextPingID: number - /** Tracking info for the currently active ping */ - private activePing?: { id: number, promise: Promise, resolve: () => void } - /** Round trip time */ - private rtt: number - - /** True if client, false if server */ - private readonly client: boolean - - private localGoAway?: GoAwayCode - private remoteGoAway?: GoAwayCode - - /** Number of tracked inbound streams */ - private numInboundStreams: number - /** Number of tracked outbound streams */ - private numOutboundStreams: number - - private readonly onIncomingStream?: (stream: Stream) => void - private readonly onStreamEnd?: (stream: Stream) => void - - constructor (init: YamuxMuxerInit) { - this.client = init.direction === 'outbound' - this.config = { ...defaultConfig, ...init } - this.log = this.config.log - verifyConfig(this.config) - - this.closeController = new AbortController() - setMaxListeners(Infinity, this.closeController.signal) - - this.onIncomingStream = init.onIncomingStream - this.onStreamEnd = init.onStreamEnd - - this._streams = new Map() - - this.source = pushable({ - onEnd: (): void => { - this.log?.trace('muxer source ended') - - this._streams.forEach(stream => { - stream.destroy() - }) - } - }) - - this.sink = async (source: Source): Promise => { - const shutDownListener = (): void => { - const iterator = getIterator(source) - - if (iterator.return != null) { - const res = iterator.return() - - if (isPromise(res)) { - res.catch(err => { - this.log?.('could not cause sink source to return', err) - }) - } - } - } - - let reason, error - try { - const decoder = new Decoder(source) - - try { - this.closeController.signal.addEventListener('abort', shutDownListener) - - for await (const frame of decoder.emitFrames()) { - await this.handleFrame(frame.header, frame.readData) - } - } finally { - this.closeController.signal.removeEventListener('abort', shutDownListener) - } - - reason = GoAwayCode.NormalTermination - } catch (err: unknown) { - // either a protocol or internal error - const errCode = (err as { code: string }).code - if (PROTOCOL_ERRORS.has(errCode)) { - this.log?.error('protocol error in sink', err) - reason = GoAwayCode.ProtocolError - } else { - this.log?.error('internal error in sink', err) - reason = GoAwayCode.InternalError - } - - error = err as Error - } - - this.log?.trace('muxer sink ended') - - if (error != null) { - this.abort(error, reason) - } else { - await this.close({ reason }) - } - } - - this.numInboundStreams = 0 - this.numOutboundStreams = 0 - - // client uses odd streamIDs, server uses even streamIDs - this.nextStreamID = this.client ? 1 : 2 - - this.nextPingID = 0 - this.rtt = -1 - - this.log?.trace('muxer created') - - if (this.config.enableKeepAlive) { - this.keepAliveLoop().catch(e => this.log?.error('keepalive error: %s', e)) - } - - // send an initial ping to establish RTT - this.ping().catch(e => this.log?.error('ping error: %s', e)) - } - - get streams (): YamuxStream[] { - return Array.from(this._streams.values()) - } - - newStream (name?: string | undefined): YamuxStream { - if (this.remoteGoAway !== undefined) { - throw new CodeError('muxer closed remotely', ERR_MUXER_REMOTE_CLOSED) - } - if (this.localGoAway !== undefined) { - throw new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED) - } - - const id = this.nextStreamID - this.nextStreamID += 2 - - // check against our configured maximum number of outbound streams - if (this.numOutboundStreams >= this.config.maxOutboundStreams) { - throw new CodeError('max outbound streams exceeded', ERR_MAX_OUTBOUND_STREAMS_EXCEEDED) - } - - this.log?.trace('new outgoing stream id=%s', id) - - const stream = this._newStream(id, name, StreamState.Init, 'outbound') - this._streams.set(id, stream) - - this.numOutboundStreams++ - - // send a window update to open the stream on the receiver end - stream.sendWindowUpdate() - - return stream - } - - /** - * Initiate a ping and wait for a response - * - * Note: only a single ping will be initiated at a time. - * If a ping is already in progress, a new ping will not be initiated. - * - * @returns the round-trip-time in milliseconds - */ - async ping (): Promise { - if (this.remoteGoAway !== undefined) { - throw new CodeError('muxer closed remotely', ERR_MUXER_REMOTE_CLOSED) - } - if (this.localGoAway !== undefined) { - throw new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED) - } - - // An active ping does not yet exist, handle the process here - if (this.activePing === undefined) { - // create active ping - let _resolve = (): void => {} - this.activePing = { - id: this.nextPingID++, - // this promise awaits resolution or the close controller aborting - promise: new Promise((resolve, reject) => { - const closed = (): void => { - reject(new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED)) - } - this.closeController.signal.addEventListener('abort', closed, { once: true }) - _resolve = (): void => { - this.closeController.signal.removeEventListener('abort', closed) - resolve() - } - }), - resolve: _resolve - } - // send ping - const start = Date.now() - this.sendPing(this.activePing.id) - // await pong - try { - await this.activePing.promise - } finally { - // clean-up active ping - delete this.activePing - } - // update rtt - const end = Date.now() - this.rtt = end - start - } else { - // an active ping is already in progress, piggyback off that - await this.activePing.promise - } - return this.rtt - } - - /** - * Get the ping round trip time - * - * Note: Will return 0 if no successful ping has yet been completed - * - * @returns the round-trip-time in milliseconds - */ - getRTT (): number { - return this.rtt - } - - /** - * Close the muxer - */ - async close (options: CloseOptions = {}): Promise { - if (this.closeController.signal.aborted) { - // already closed - return - } - - const reason = options?.reason ?? GoAwayCode.NormalTermination - - this.log?.trace('muxer close reason=%s', reason) - - if (options.signal == null) { - const signal = AbortSignal.timeout(CLOSE_TIMEOUT) - setMaxListeners(Infinity, signal) - - options = { - ...options, - signal - } - } - - try { - await Promise.all( - [...this._streams.values()].map(async s => s.close(options)) - ) - - // send reason to the other side, allow the other side to close gracefully - this.sendGoAway(reason) - - this._closeMuxer() - } catch (err: any) { - this.abort(err) - } - } - - abort (err: Error, reason?: GoAwayCode): void { - if (this.closeController.signal.aborted) { - // already closed - return - } - - reason = reason ?? GoAwayCode.InternalError - - // If reason was provided, use that, otherwise use the presence of `err` to determine the reason - this.log?.error('muxer abort reason=%s error=%s', reason, err) - - // Abort all underlying streams - for (const stream of this._streams.values()) { - stream.abort(err) - } - - // send reason to the other side, allow the other side to close gracefully - this.sendGoAway(reason) - - this._closeMuxer() - } - - isClosed (): boolean { - return this.closeController.signal.aborted - } - - /** - * Called when either the local or remote shuts down the muxer - */ - private _closeMuxer (): void { - // stop the sink and any other processes - this.closeController.abort() - - // stop the source - this.source.end() - } - - /** Create a new stream */ - private _newStream (id: number, name: string | undefined, state: StreamState, direction: 'inbound' | 'outbound'): YamuxStream { - if (this._streams.get(id) != null) { - throw new CodeError('Stream already exists', ERR_STREAM_ALREADY_EXISTS, { id }) - } - - const stream = new YamuxStream({ - id: id.toString(), - name, - state, - direction, - sendFrame: this.sendFrame.bind(this), - onEnd: () => { - this.closeStream(id) - this.onStreamEnd?.(stream) - }, - log: logger(`libp2p:yamux:${direction}:${id}`), - config: this.config, - getRTT: this.getRTT.bind(this) - }) - - return stream - } - - /** - * closeStream is used to close a stream once both sides have - * issued a close. - */ - private closeStream (id: number): void { - if (this.client === (id % 2 === 0)) { - this.numInboundStreams-- - } else { - this.numOutboundStreams-- - } - this._streams.delete(id) - } - - private async keepAliveLoop (): Promise { - const abortPromise = new Promise((_resolve, reject) => { this.closeController.signal.addEventListener('abort', reject, { once: true }) }) - this.log?.trace('muxer keepalive enabled interval=%s', this.config.keepAliveInterval) - while (true) { - let timeoutId - try { - await Promise.race([ - abortPromise, - new Promise((resolve) => { - timeoutId = setTimeout(resolve, this.config.keepAliveInterval) - }) - ]) - this.ping().catch(e => this.log?.error('ping error: %s', e)) - } catch (e) { - // closed - clearInterval(timeoutId) - return - } - } - } - - private async handleFrame (header: FrameHeader, readData?: () => Promise): Promise { - const { - streamID, - type, - length - } = header - this.log?.trace('received frame %o', header) - - if (streamID === 0) { - switch (type) { - case FrameType.Ping: - { this.handlePing(header); return } - case FrameType.GoAway: - { this.handleGoAway(length); return } - default: - // Invalid state - throw new CodeError('Invalid frame type', ERR_INVALID_FRAME, { header }) - } - } else { - switch (header.type) { - case FrameType.Data: - case FrameType.WindowUpdate: - { await this.handleStreamMessage(header, readData); return } - default: - // Invalid state - throw new CodeError('Invalid frame type', ERR_INVALID_FRAME, { header }) - } - } - } - - private handlePing (header: FrameHeader): void { - // If the ping is initiated by the sender, send a response - if (header.flag === Flag.SYN) { - this.log?.trace('received ping request pingId=%s', header.length) - this.sendPing(header.length, Flag.ACK) - } else if (header.flag === Flag.ACK) { - this.log?.trace('received ping response pingId=%s', header.length) - this.handlePingResponse(header.length) - } else { - // Invalid state - throw new CodeError('Invalid frame flag', ERR_INVALID_FRAME, { header }) - } - } - - private handlePingResponse (pingId: number): void { - if (this.activePing === undefined) { - // this ping was not requested - throw new CodeError('ping not requested', ERR_UNREQUESTED_PING) - } - if (this.activePing.id !== pingId) { - // this ping doesn't match our active ping request - throw new CodeError('ping doesn\'t match our id', ERR_NOT_MATCHING_PING) - } - - // valid ping response - this.activePing.resolve() - } - - private handleGoAway (reason: GoAwayCode): void { - this.log?.trace('received GoAway reason=%s', GoAwayCode[reason] ?? 'unknown') - this.remoteGoAway = reason - - // If the other side is friendly, they would have already closed all streams before sending a GoAway - // In case they weren't, reset all streams - for (const stream of this._streams.values()) { - stream.reset() - } - - this._closeMuxer() - } - - private async handleStreamMessage (header: FrameHeader, readData?: () => Promise): Promise { - const { streamID, flag, type } = header - - if ((flag & Flag.SYN) === Flag.SYN) { - this.incomingStream(streamID) - } - - const stream = this._streams.get(streamID) - if (stream === undefined) { - if (type === FrameType.Data) { - this.log?.('discarding data for stream id=%s', streamID) - if (readData === undefined) { - throw new Error('unreachable') - } - await readData() - } else { - this.log?.('frame for missing stream id=%s', streamID) - } - return - } - - switch (type) { - case FrameType.WindowUpdate: { - stream.handleWindowUpdate(header); return - } - case FrameType.Data: { - if (readData === undefined) { - throw new Error('unreachable') - } - - await stream.handleData(header, readData); return - } - default: - throw new Error('unreachable') - } - } - - private incomingStream (id: number): void { - if (this.client !== (id % 2 === 0)) { - throw new CodeError('both endpoints are clients', ERR_BOTH_CLIENTS) - } - if (this._streams.has(id)) { - return - } - - this.log?.trace('new incoming stream id=%s', id) - - if (this.localGoAway !== undefined) { - // reject (reset) immediately if we are doing a go away - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: id, - length: 0 - }); return - } - - // check against our configured maximum number of inbound streams - if (this.numInboundStreams >= this.config.maxInboundStreams) { - this.log?.('maxIncomingStreams exceeded, forcing stream reset') - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: id, - length: 0 - }); return - } - - // allocate a new stream - const stream = this._newStream(id, undefined, StreamState.SYNReceived, 'inbound') - - this.numInboundStreams++ - // the stream should now be tracked - this._streams.set(id, stream) - - this.onIncomingStream?.(stream) - } - - private sendFrame (header: FrameHeader, data?: Uint8ArrayList): void { - this.log?.trace('sending frame %o', header) - if (header.type === FrameType.Data) { - if (data === undefined) { - throw new CodeError('invalid frame', ERR_INVALID_FRAME) - } - this.source.push(encodeHeader(header)) - this.source.push(data) - } else { - this.source.push(encodeHeader(header)) - } - } - - private sendPing (pingId: number, flag: Flag = Flag.SYN): void { - if (flag === Flag.SYN) { - this.log?.trace('sending ping request pingId=%s', pingId) - } else { - this.log?.trace('sending ping response pingId=%s', pingId) - } - this.sendFrame({ - type: FrameType.Ping, - flag, - streamID: 0, - length: pingId - }) - } - - private sendGoAway (reason: GoAwayCode = GoAwayCode.NormalTermination): void { - this.log?.('sending GoAway reason=%s', GoAwayCode[reason]) - this.localGoAway = reason - this.sendFrame({ - type: FrameType.GoAway, - flag: 0, - streamID: 0, - length: reason - }) - } -} - -function isPromise (thing: any): thing is Promise { - return thing != null && typeof thing.then === 'function' -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/stream.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/stream.ts deleted file mode 100644 index a87737caa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks-nagle/yamux/src/stream.ts +++ /dev/null @@ -1,302 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { AbstractStream, type AbstractStreamInit } from '@libp2p/utils/abstract-stream' -import each from 'it-foreach' -import { ERR_RECV_WINDOW_EXCEEDED, ERR_STREAM_ABORT, INITIAL_STREAM_WINDOW } from './constants.js' -import { Flag, type FrameHeader, FrameType, HEADER_LENGTH } from './frame.js' -import type { Config } from './config.js' -import type { AbortOptions } from '@libp2p/interface' -import type { Uint8ArrayList } from 'uint8arraylist' - -export enum StreamState { - Init, - SYNSent, - SYNReceived, - Established, - Finished, -} - -export interface YamuxStreamInit extends AbstractStreamInit { - name?: string - sendFrame: (header: FrameHeader, body?: Uint8ArrayList) => void - getRTT: () => number - config: Config - state: StreamState -} - -/** YamuxStream is used to represent a logical stream within a session */ -export class YamuxStream extends AbstractStream { - name?: string - state: StreamState - - private readonly config: Config - private readonly _id: number - - /** The number of available bytes to send */ - private sendWindowCapacity: number - /** Callback to notify that the sendWindowCapacity has been updated */ - private sendWindowCapacityUpdate?: () => void - - /** The number of bytes available to receive in a full window */ - private recvWindow: number - /** The number of available bytes to receive */ - private recvWindowCapacity: number - - /** - * An 'epoch' is the time it takes to process and read data - * - * Used in conjunction with RTT to determine whether to increase the recvWindow - */ - private epochStart: number - private readonly getRTT: () => number - - private readonly sendFrame: (header: FrameHeader, body?: Uint8ArrayList) => void - - constructor (init: YamuxStreamInit) { - super({ - ...init, - onEnd: (err?: Error) => { - this.state = StreamState.Finished - init.onEnd?.(err) - } - }) - - this.config = init.config - this._id = parseInt(init.id, 10) - this.name = init.name - this.state = init.state - this.sendWindowCapacity = INITIAL_STREAM_WINDOW - this.recvWindow = this.config.initialStreamWindowSize - this.recvWindowCapacity = this.recvWindow - this.epochStart = Date.now() - this.getRTT = init.getRTT - - this.sendFrame = init.sendFrame - - this.source = each(this.source, () => { - this.sendWindowUpdate() - }) - } - - /** - * Send a message to the remote muxer informing them a new stream is being - * opened. - * - * This is a noop for Yamux because the first window update is sent when - * .newStream is called on the muxer which opens the stream on the remote. - */ - async sendNewStream (): Promise { - - } - - /** - * Send a data message to the remote muxer - */ - async sendData (buf: Uint8ArrayList, options: AbortOptions = {}): Promise { - buf = buf.sublist() - - // send in chunks, waiting for window updates - while (buf.byteLength !== 0) { - // wait for the send window to refill - if (this.sendWindowCapacity === 0) { - await this.waitForSendWindowCapacity(options) - } - - // check we didn't close while waiting for send window capacity - if (this.status !== 'open') { - return - } - - // send as much as we can - const toSend = Math.min(this.sendWindowCapacity, this.config.maxMessageSize - HEADER_LENGTH, buf.length) - const flags = this.getSendFlags() - - this.sendFrame({ - type: FrameType.Data, - flag: flags, - streamID: this._id, - length: toSend - }, buf.sublist(0, toSend)) - - this.sendWindowCapacity -= toSend - - buf.consume(toSend) - } - } - - /** - * Send a reset message to the remote muxer - */ - async sendReset (): Promise { - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: this._id, - length: 0 - }) - } - - /** - * Send a message to the remote muxer, informing them no more data messages - * will be sent by this end of the stream - */ - async sendCloseWrite (): Promise { - const flags = this.getSendFlags() | Flag.FIN - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: flags, - streamID: this._id, - length: 0 - }) - } - - /** - * Send a message to the remote muxer, informing them no more data messages - * will be read by this end of the stream - */ - async sendCloseRead (): Promise { - - } - - /** - * Wait for the send window to be non-zero - * - * Will throw with ERR_STREAM_ABORT if the stream gets aborted - */ - async waitForSendWindowCapacity (options: AbortOptions = {}): Promise { - if (this.sendWindowCapacity > 0) { - return - } - - let resolve: () => void - let reject: (err: Error) => void - const abort = (): void => { - if (this.status === 'open') { - reject(new CodeError('stream aborted', ERR_STREAM_ABORT)) - } else { - // the stream was closed already, ignore the failure to send - resolve() - } - } - options.signal?.addEventListener('abort', abort) - - try { - await new Promise((_resolve, _reject) => { - this.sendWindowCapacityUpdate = () => { - _resolve() - } - reject = _reject - resolve = _resolve - }) - } finally { - options.signal?.removeEventListener('abort', abort) - } - } - - /** - * handleWindowUpdate is called when the stream receives a window update frame - */ - handleWindowUpdate (header: FrameHeader): void { - this.log?.trace('stream received window update id=%s', this._id) - this.processFlags(header.flag) - - // increase send window - const available = this.sendWindowCapacity - this.sendWindowCapacity += header.length - // if the update increments a 0 availability, notify the stream that sending can resume - if (available === 0 && header.length > 0) { - this.sendWindowCapacityUpdate?.() - } - } - - /** - * handleData is called when the stream receives a data frame - */ - async handleData (header: FrameHeader, readData: () => Promise): Promise { - this.log?.trace('stream received data id=%s', this._id) - this.processFlags(header.flag) - - // check that our recv window is not exceeded - if (this.recvWindowCapacity < header.length) { - throw new CodeError('receive window exceeded', ERR_RECV_WINDOW_EXCEEDED, { available: this.recvWindowCapacity, recv: header.length }) - } - - const data = await readData() - this.recvWindowCapacity -= header.length - - this.sourcePush(data) - } - - /** - * processFlags is used to update the state of the stream based on set flags, if any. - */ - private processFlags (flags: number): void { - if ((flags & Flag.ACK) === Flag.ACK) { - if (this.state === StreamState.SYNSent) { - this.state = StreamState.Established - } - } - if ((flags & Flag.FIN) === Flag.FIN) { - this.remoteCloseWrite() - } - if ((flags & Flag.RST) === Flag.RST) { - this.reset() - } - } - - /** - * getSendFlags determines any flags that are appropriate - * based on the current stream state. - * - * The state is updated as a side-effect. - */ - private getSendFlags (): number { - switch (this.state) { - case StreamState.Init: - this.state = StreamState.SYNSent - return Flag.SYN - case StreamState.SYNReceived: - this.state = StreamState.Established - return Flag.ACK - default: - return 0 - } - } - - /** - * potentially sends a window update enabling further writes to take place. - */ - sendWindowUpdate (): void { - // determine the flags if any - const flags = this.getSendFlags() - - // If the stream has already been established - // and we've processed data within the time it takes for 4 round trips - // then we (up to) double the recvWindow - const now = Date.now() - const rtt = this.getRTT() - if (flags === 0 && rtt > -1 && now - this.epochStart < rtt * 4) { - // we've already validated that maxStreamWindowSize can't be more than MAX_UINT32 - this.recvWindow = Math.min(this.recvWindow * 2, this.config.maxStreamWindowSize) - } - - if (this.recvWindowCapacity >= this.recvWindow && flags === 0) { - // a window update isn't needed - return - } - - // update the receive window - const delta = this.recvWindow - this.recvWindowCapacity - this.recvWindowCapacity = this.recvWindow - - // update the epoch start - this.epochStart = now - - // send window update - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: flags, - streamID: this._id, - length: delta - }) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/Makefile b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/Makefile deleted file mode 100644 index a1e077cdc..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -DOCKER_IMAGE := node:20-alpine -DOCKER_RUN := docker run --rm -v "$(shell pwd)":/usr/src/myapp -w /usr/src/myapp $(DOCKER_IMAGE) - -all: perf - -perf: - $(DOCKER_RUN) npm ci - -clean: - rm -rf node_modules - -.PHONY: all clean perf diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/index.js deleted file mode 100644 index 8b4462ee6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/index.js +++ /dev/null @@ -1,109 +0,0 @@ -import { noise } from './noise/dist/src/index.js' -import { yamux } from './yamux/dist/src/index.js' -import { tcp } from './tcp/dist/src/index.js' -import { multiaddr } from '@multiformats/multiaddr' -import { createLibp2p } from './libp2p/dist/src/index.js' -import { perf } from '@libp2p/perf' -import { parseArgs } from 'node:util' - -const argv = parseArgs({ - options: { - 'run-server': { - type: 'string', - default: 'false' - }, - 'server-address': { - type: 'string', - default: '127.0.0.1:8000' - }, - transport: { - type: 'string', - default: 'tcp' - }, - 'upload-bytes': { - type: 'string', - default: '0' - }, - 'download-bytes': { - type: 'string', - default: '10000000000' - } - } -}) - -/** - * @param {boolean} runServer - * @param {string} serverIpAddress - * @param {string} transport - * @param {number} uploadBytes - * @param {number} downloadBytes - */ -export async function main (runServer, serverIpAddress, transport, uploadBytes, downloadBytes) { - const { host, port } = splitHostPort(serverIpAddress) - - const config = { - transports: [ - tcp() - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - noise() - ], - connectionManager: { - minConnections: 0 - }, - services: { - perf: perf() - } - } - - if (runServer) { - Object.assign(config, { - addresses: { - listen: [ - // #TODO: right now we only support tcp - `/ip4/${host}/tcp/${port}` - ] - } - }) - } - - const node = await createLibp2p(config) - - await node.start() - - if (!runServer) { - for await (const output of node.services.perf.measurePerformance(multiaddr(`/ip4/${host}/tcp/${port}`), uploadBytes, downloadBytes)) { - // eslint-disable-next-line no-console - console.log(JSON.stringify(output)) - } - - await node.stop() - } -} - -/** - * @param {string} address - * @returns { host: string, port?: string } - */ -function splitHostPort (address) { - try { - const parts = address.split(':') - const host = parts[0] - const port = parts[1] - return { - host, - port - } - } catch (error) { - throw Error('Invalid server address') - } -} - -main(argv.values['run-server'] === 'true', argv.values['server-address'], argv.values.transport, Number(argv.values['upload-bytes']), Number(argv.values['download-bytes'])).catch((err) => { - // eslint-disable-next-line no-console - console.error(err) - process.exit(1) -}) diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/index.min.js deleted file mode 100644 index 506967c5c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/index.min.js +++ /dev/null @@ -1,91 +0,0 @@ -(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2P = factory()}(typeof self !== 'undefined' ? self : this, function () { -"use strict";var Libp2P=(()=>{var eg=Object.create;var is=Object.defineProperty;var tg=Object.getOwnPropertyDescriptor;var rg=Object.getOwnPropertyNames;var ng=Object.getPrototypeOf,ig=Object.prototype.hasOwnProperty;var V=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ke=(t,e)=>{for(var r in e)is(t,r,{get:e[r],enumerable:!0})},Zl=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of rg(e))!ig.call(t,i)&&i!==r&&is(t,i,{get:()=>e[i],enumerable:!(n=tg(e,i))||n.enumerable});return t};var ve=(t,e,r)=>(r=t!=null?eg(ng(t)):{},Zl(e||!t||!t.__esModule?is(r,"default",{value:t,enumerable:!0}):r,t)),sg=t=>Zl(is({},"__esModule",{value:!0}),t);var de=V((Rv,jl)=>{jl.exports={options:{usePureJavaScript:!1}}});var tf=V((Cv,ef)=>{var da={};ef.exports=da;var Jl={};da.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=og(t,e);else{var i=0,s=e.length,o=e.charAt(0),a=[0];for(i=0;i0;)a.push(u%s),u=u/s|0}for(i=0;t[i]===0&&i=0;--i)n+=e[a[i]]}if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join(`\r -`)}return n};da.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=Jl[e];if(!r){r=Jl[e]=[];for(var n=0;n>=8;for(;u>0;)o.push(u&255),u>>=8}for(var l=0;t[l]===s&&l0;)s.push(a%n),a=a/n|0}var c="";for(r=0;t.at(r)===0&&r=0;--r)c+=e[s[r]];return c}});var Ne=V((Tv,of)=>{var rf=de(),nf=tf(),w=of.exports=rf.util=rf.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){w.nextTick=process.nextTick,typeof setImmediate=="function"?w.setImmediate=setImmediate:w.setImmediate=w.nextTick;return}if(typeof setImmediate=="function"){w.setImmediate=function(){return setImmediate.apply(void 0,arguments)},w.nextTick=function(a){return setImmediate(a)};return}if(w.setImmediate=function(a){setTimeout(a,0)},typeof window<"u"&&typeof window.postMessage=="function"){let a=function(c){if(c.source===window&&c.data===t){c.stopPropagation();var u=e.slice();e.length=0,u.forEach(function(l){l()})}};var o=a,t="forge.setImmediate",e=[];w.setImmediate=function(c){e.push(c),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",a,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,i=document.createElement("div"),e=[];new MutationObserver(function(){var c=e.slice();e.length=0,c.forEach(function(u){u()})}).observe(i,{attributes:!0});var s=w.setImmediate;w.setImmediate=function(c){Date.now()-r>15?(r=Date.now(),s(c)):(e.push(c),e.length===1&&i.setAttribute("a",n=!n))}}w.nextTick=w.setImmediate})();w.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;w.globalScope=function(){return w.isNodejs?globalThis:typeof self>"u"?window:self}();w.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};w.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};w.isArrayBufferView=function(t){return t&&w.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function hi(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}w.ByteBuffer=pa;function pa(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(w.isArrayBuffer(t)||w.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;rag&&(this.data.substr(0,1),this._constructedStringLength=0)};w.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};w.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};w.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};w.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};w.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};w.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(w.encodeUtf8(t))};w.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};w.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};w.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};w.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};w.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};w.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};w.ByteStringBuffer.prototype.putInt=function(t,e){hi(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};w.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};w.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};w.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};w.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};w.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};w.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};w.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};w.ByteStringBuffer.prototype.copy=function(){var t=w.createBuffer(this.data);return t.read=this.read,t};w.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};w.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};w.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};w.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};w.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};w.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};w.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};w.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};w.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};w.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};w.DataBuffer.prototype.putInt=function(t,e){hi(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};w.DataBuffer.prototype.putSignedInt=function(t,e){return hi(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};w.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};w.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};w.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};w.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};w.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};w.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};w.DataBuffer.prototype.copy=function(){return new w.DataBuffer(this)};w.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};w.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};w.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};w.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};w.xorBytes=function(t,e,r){for(var n="",i="",s="",o=0,a=0;r>0;--r,++o)i=t.charCodeAt(o)^e.charCodeAt(o),a>=10&&(n+=s,s="",a=0),s+=String.fromCharCode(i),++a;return n+=s,n};w.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var gr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",yr=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],sf="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";w.encode64=function(t,e){for(var r="",n="",i,s,o,a=0;a>2),r+=gr.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=gr.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":gr.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};w.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,i,s,o=0;o>4),i!==64&&(e+=String.fromCharCode((n&15)<<4|i>>2),s!==64&&(e+=String.fromCharCode((i&3)<<6|s)));return e};w.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};w.decodeUtf8=function(t){return decodeURIComponent(escape(t))};w.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:nf.encode,decode:nf.decode}};w.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};w.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s>2),r+=gr.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=gr.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":gr.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};w.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,s,o,a,c=0,u=r;c>4,o!==64&&(n[u++]=(s&15)<<4|o>>2,a!==64&&(n[u++]=(o&3)<<6|a));return e?u-r:n.subarray(0,u)};w.binary.base58.encode=function(t,e){return w.binary.baseN.encode(t,sf,e)};w.binary.base58.decode=function(t,e){return w.binary.baseN.decode(t,sf,e)};w.text={utf8:{},utf16:{}};w.text.utf8.encode=function(t,e,r){t=w.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s"u"&&(r=["web","flash"]);var i,s=!1,o=null;for(var a in r){i=r[a];try{if(i==="flash"||i==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),s=i==="flash"}(i==="web"||i==="both")&&(e[0]=localStorage,n=t.apply(this,e),s=!0)}catch(c){o=c}if(s)break}if(!s)throw o;return n};w.setItem=function(t,e,r,n,i){ss(ug,arguments,i)};w.getItem=function(t,e,r,n){return ss(lg,arguments,n)};w.removeItem=function(t,e,r,n){ss(fg,arguments,n)};w.clearItems=function(t,e,r){ss(hg,arguments,r)};w.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};w.format=function(t){for(var e=/%./g,r,n,i=0,s=[],o=0;r=e.exec(t);){n=t.substring(o,e.lastIndex-2),n.length>0&&s.push(n),o=e.lastIndex;var a=r[0][1];switch(a){case"s":case"o":i");break;case"%":s.push("%");break;default:s.push("<%"+a+"?>")}}return s.push(t.substring(o)),s.join("")};w.formatNumber=function(t,e,r,n){var i=t,s=isNaN(e=Math.abs(e))?2:e,o=r===void 0?",":r,a=n===void 0?".":n,c=i<0?"-":"",u=parseInt(i=Math.abs(+i||0).toFixed(s),10)+"",l=u.length>3?u.length%3:0;return c+(l?u.substr(0,l)+a:"")+u.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+a)+(s?o+Math.abs(i-u).toFixed(s).slice(2):"")};w.formatSize=function(t){return t>=1073741824?t=w.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=w.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=w.formatNumber(t/1024,0)+" KiB":t=w.formatNumber(t,0)+" bytes",t};w.bytesFromIP=function(t){return t.indexOf(".")!==-1?w.bytesFromIPv4(t):t.indexOf(":")!==-1?w.bytesFromIPv6(t):null};w.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=w.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1))}e.push(s)}if(r.length>0){var c=r[n];c.end-c.start>0&&(e.splice(c.start,c.end-c.start+1,""),c.start===0&&e.unshift(""),c.end===7&&e.push(""))}return e.join(":")};w.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in w&&!t.update)return e(null,w.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return w.cores=navigator.hardwareConcurrency,e(null,w.cores);if(typeof Worker>"u")return w.cores=1,e(null,w.cores);if(typeof Blob>"u")return w.cores=2,e(null,w.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(o){for(var a=Date.now(),c=a+4;Date.now()p.st&&l.stl.st&&p.st{var di=de();di.pki=di.pki||{};var ya=af.exports=di.pki.oids=di.oids=di.oids||{};function B(t,e){ya[t]=e,ya[e]=t}function ae(t,e){ya[t]=e}B("1.2.840.113549.1.1.1","rsaEncryption");B("1.2.840.113549.1.1.4","md5WithRSAEncryption");B("1.2.840.113549.1.1.5","sha1WithRSAEncryption");B("1.2.840.113549.1.1.7","RSAES-OAEP");B("1.2.840.113549.1.1.8","mgf1");B("1.2.840.113549.1.1.9","pSpecified");B("1.2.840.113549.1.1.10","RSASSA-PSS");B("1.2.840.113549.1.1.11","sha256WithRSAEncryption");B("1.2.840.113549.1.1.12","sha384WithRSAEncryption");B("1.2.840.113549.1.1.13","sha512WithRSAEncryption");B("1.3.101.112","EdDSA25519");B("1.2.840.10040.4.3","dsa-with-sha1");B("1.3.14.3.2.7","desCBC");B("1.3.14.3.2.26","sha1");B("1.3.14.3.2.29","sha1WithRSASignature");B("2.16.840.1.101.3.4.2.1","sha256");B("2.16.840.1.101.3.4.2.2","sha384");B("2.16.840.1.101.3.4.2.3","sha512");B("2.16.840.1.101.3.4.2.4","sha224");B("2.16.840.1.101.3.4.2.5","sha512-224");B("2.16.840.1.101.3.4.2.6","sha512-256");B("1.2.840.113549.2.2","md2");B("1.2.840.113549.2.5","md5");B("1.2.840.113549.1.7.1","data");B("1.2.840.113549.1.7.2","signedData");B("1.2.840.113549.1.7.3","envelopedData");B("1.2.840.113549.1.7.4","signedAndEnvelopedData");B("1.2.840.113549.1.7.5","digestedData");B("1.2.840.113549.1.7.6","encryptedData");B("1.2.840.113549.1.9.1","emailAddress");B("1.2.840.113549.1.9.2","unstructuredName");B("1.2.840.113549.1.9.3","contentType");B("1.2.840.113549.1.9.4","messageDigest");B("1.2.840.113549.1.9.5","signingTime");B("1.2.840.113549.1.9.6","counterSignature");B("1.2.840.113549.1.9.7","challengePassword");B("1.2.840.113549.1.9.8","unstructuredAddress");B("1.2.840.113549.1.9.14","extensionRequest");B("1.2.840.113549.1.9.20","friendlyName");B("1.2.840.113549.1.9.21","localKeyId");B("1.2.840.113549.1.9.22.1","x509Certificate");B("1.2.840.113549.1.12.10.1.1","keyBag");B("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");B("1.2.840.113549.1.12.10.1.3","certBag");B("1.2.840.113549.1.12.10.1.4","crlBag");B("1.2.840.113549.1.12.10.1.5","secretBag");B("1.2.840.113549.1.12.10.1.6","safeContentsBag");B("1.2.840.113549.1.5.13","pkcs5PBES2");B("1.2.840.113549.1.5.12","pkcs5PBKDF2");B("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");B("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");B("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");B("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");B("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");B("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");B("1.2.840.113549.2.7","hmacWithSHA1");B("1.2.840.113549.2.8","hmacWithSHA224");B("1.2.840.113549.2.9","hmacWithSHA256");B("1.2.840.113549.2.10","hmacWithSHA384");B("1.2.840.113549.2.11","hmacWithSHA512");B("1.2.840.113549.3.7","des-EDE3-CBC");B("2.16.840.1.101.3.4.1.2","aes128-CBC");B("2.16.840.1.101.3.4.1.22","aes192-CBC");B("2.16.840.1.101.3.4.1.42","aes256-CBC");B("2.5.4.3","commonName");B("2.5.4.4","surname");B("2.5.4.5","serialNumber");B("2.5.4.6","countryName");B("2.5.4.7","localityName");B("2.5.4.8","stateOrProvinceName");B("2.5.4.9","streetAddress");B("2.5.4.10","organizationName");B("2.5.4.11","organizationalUnitName");B("2.5.4.12","title");B("2.5.4.13","description");B("2.5.4.15","businessCategory");B("2.5.4.17","postalCode");B("2.5.4.42","givenName");B("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");B("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");B("2.16.840.1.113730.1.1","nsCertType");B("2.16.840.1.113730.1.13","nsComment");ae("2.5.29.1","authorityKeyIdentifier");ae("2.5.29.2","keyAttributes");ae("2.5.29.3","certificatePolicies");ae("2.5.29.4","keyUsageRestriction");ae("2.5.29.5","policyMapping");ae("2.5.29.6","subtreesConstraint");ae("2.5.29.7","subjectAltName");ae("2.5.29.8","issuerAltName");ae("2.5.29.9","subjectDirectoryAttributes");ae("2.5.29.10","basicConstraints");ae("2.5.29.11","nameConstraints");ae("2.5.29.12","policyConstraints");ae("2.5.29.13","basicConstraints");B("2.5.29.14","subjectKeyIdentifier");B("2.5.29.15","keyUsage");ae("2.5.29.16","privateKeyUsagePeriod");B("2.5.29.17","subjectAltName");B("2.5.29.18","issuerAltName");B("2.5.29.19","basicConstraints");ae("2.5.29.20","cRLNumber");ae("2.5.29.21","cRLReason");ae("2.5.29.22","expirationDate");ae("2.5.29.23","instructionCode");ae("2.5.29.24","invalidityDate");ae("2.5.29.25","cRLDistributionPoints");ae("2.5.29.26","issuingDistributionPoint");ae("2.5.29.27","deltaCRLIndicator");ae("2.5.29.28","issuingDistributionPoint");ae("2.5.29.29","certificateIssuer");ae("2.5.29.30","nameConstraints");B("2.5.29.31","cRLDistributionPoints");B("2.5.29.32","certificatePolicies");ae("2.5.29.33","policyMappings");ae("2.5.29.34","policyConstraints");B("2.5.29.35","authorityKeyIdentifier");ae("2.5.29.36","policyConstraints");B("2.5.29.37","extKeyUsage");ae("2.5.29.46","freshestCRL");ae("2.5.29.54","inhibitAnyPolicy");B("1.3.6.1.4.1.11129.2.4.2","timestampList");B("1.3.6.1.5.5.7.1.1","authorityInfoAccess");B("1.3.6.1.5.5.7.3.1","serverAuth");B("1.3.6.1.5.5.7.3.2","clientAuth");B("1.3.6.1.5.5.7.3.3","codeSigning");B("1.3.6.1.5.5.7.3.4","emailProtection");B("1.3.6.1.5.5.7.3.8","timeStamping")});var mi=V((Lv,uf)=>{var ge=de();Ne();os();var O=uf.exports=ge.asn1=ge.asn1||{};O.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};O.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};O.create=function(t,e,r,n,i){if(ge.util.isArray(n)){for(var s=[],o=0;oe){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}var dg=function(t,e){var r=t.getByte();if(e--,r!==128){var n,i=r&128;if(!i)n=r;else{var s=r&127;pi(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}};O.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof t=="string"&&(t=ge.util.createBuffer(t));var r=t.length(),n=as(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=r,i.remaining=t.length(),i}return n};function as(t,e,r,n){var i;pi(t,e,2);var s=t.getByte();e--;var o=s&192,a=s&31;i=t.length();var c=dg(t,e);if(e-=i-t.length(),c!==void 0&&c>e){if(n.strict){var u=new Error("Too few bytes to read ASN.1 value.");throw u.available=t.length(),u.remaining=e,u.requested=c,u}c=e}var l,f,h=(s&32)===32;if(h)if(l=[],c===void 0)for(;;){if(pi(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}i=t.length(),l.push(as(t,e,r+1,n)),e-=i-t.length()}else for(;c>0;)i=t.length(),l.push(as(t,c,r+1,n)),e-=i-t.length(),c-=i-t.length();if(l===void 0&&o===O.Class.UNIVERSAL&&a===O.Type.BITSTRING&&(f=t.bytes(c)),l===void 0&&n.decodeBitStrings&&o===O.Class.UNIVERSAL&&a===O.Type.BITSTRING&&c>1){var p=t.read,d=e,m=0;if(a===O.Type.BITSTRING&&(pi(t,e,1),m=t.getByte(),e--),m===0)try{i=t.length();var g={strict:!0,decodeBitStrings:!0},y=as(t,e,r+1,g),x=i-t.length();e-=x,a==O.Type.BITSTRING&&x++;var b=y.tagClass;x===c&&(b===O.Class.UNIVERSAL||b===O.Class.CONTEXT_SPECIFIC)&&(l=[y])}catch{}l===void 0&&(t.read=p,e=d)}if(l===void 0){if(c===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=e}if(a===O.Type.BMPSTRING)for(l="";c>0;c-=2)pi(t,e,2),l+=String.fromCharCode(t.getInt16()),e-=2;else l=t.getBytes(c),e-=c}var I=f===void 0?null:{bitStringContents:f};return O.create(o,a,h,l,I)}O.toDer=function(t){var e=ge.util.createBuffer(),r=t.tagClass|t.type,n=ge.util.createBuffer(),i=!1;if("bitStringContents"in t&&(i=!0,t.original&&(i=O.equals(t,t.original))),i)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var s=0;s1&&(t.value.charCodeAt(0)===0&&!(t.value.charCodeAt(1)&128)||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var o=n.length(),a="";do a+=String.fromCharCode(o&255),o=o>>>8;while(o>0);e.putByte(a.length|128);for(var s=a.length-1;s>=0;--s)e.putByte(a.charCodeAt(s))}return e.putBuffer(n),e};O.oidToDer=function(t){var e=t.split("."),r=ge.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,i,s,o,a=2;a>>7,n||(o|=128),i.push(o),n=!1;while(s>0);for(var c=i.length-1;c>=0;--c)r.putByte(i[c])}return r};O.derToOid=function(t){var e;typeof t=="string"&&(t=ge.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;)r=t.getByte(),n=n<<7,r&128?n+=r&127:(e+="."+(n+r),n=0);return e};O.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),s=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=0;if(t.length>11){var c=t.charAt(10),u=10;c!=="+"&&c!=="-"&&(a=parseInt(t.substr(10,2),10),u+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,0),u&&(c=t.charAt(u),c==="+"||c==="-")){var l=parseInt(t.substr(u+1,2),10),f=parseInt(t.substr(u+4,2),10),h=l*60+f;h*=6e4,c==="+"?e.setTime(+e-h):e.setTime(+e+h)}return e};O.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),o=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),c=0,u=0,l=!1;t.charAt(t.length-1)==="Z"&&(l=!0);var f=t.length-5,h=t.charAt(f);if(h==="+"||h==="-"){var p=parseInt(t.substr(f+1,2),10),d=parseInt(t.substr(f+4,2),10);u=p*60+d,u*=6e4,h==="+"&&(u*=-1),l=!0}return t.charAt(14)==="."&&(c=parseFloat(t.substr(14),10)*1e3),l?(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,c),e.setTime(+e+u)):(e.setFullYear(r,n,i),e.setHours(s,o,a,c)),e};O.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};O.derToInteger=function(t){typeof t=="string"&&(t=ge.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};O.validate=function(t,e,r,n){var i=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(i=!0,e.value&&ge.util.isArray(e.value))for(var s=0,o=0;i&&o0&&(n+=` -`);for(var i="",s=0;s1?n+="0x"+ge.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var u=t.value.charCodeAt(0);u==1?n+=" (1 unused bit shown)":u>1&&(n+=" ("+u+" unused bits shown)")}}else if(t.type===O.Type.OCTETSTRING)cf.test(t.value)||(n+="("+t.value+") "),n+="0x"+ge.util.bytesToHex(t.value);else if(t.type===O.Type.UTF8)try{n+=ge.util.decodeUtf8(t.value)}catch(l){if(l.message==="URI malformed")n+="0x"+ge.util.bytesToHex(t.value)+" (malformed UTF8)";else throw l}else t.type===O.Type.PRINTABLESTRING||t.type===O.Type.IA5String?n+=t.value:cf.test(t.value)?n+="0x"+ge.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var ba=V((Pv,lf)=>{var qe=de();Ne();lf.exports=qe.cipher=qe.cipher||{};qe.cipher.algorithms=qe.cipher.algorithms||{};qe.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=qe.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new qe.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};qe.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=qe.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new qe.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};qe.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),qe.cipher.algorithms[t]=e};qe.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in qe.cipher.algorithms?qe.cipher.algorithms[t]:null};var xa=qe.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};xa.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=qe.util.createBuffer(),this.output=t.output||qe.util.createBuffer(),this.mode.start(e)};xa.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};xa.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var Ea=V((Dv,ff)=>{var Ve=de();Ne();Ve.cipher=Ve.cipher||{};var J=ff.exports=Ve.cipher.modes=Ve.cipher.modes||{};J.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};J.ecb.prototype.start=function(t){};J.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};J.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};J.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=cs(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};J.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};J.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Ve.util.createBuffer(),this._partialBytes=0};J.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=cs(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};J.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};J.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};J.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Ve.util.createBuffer(),this._partialBytes=0};J.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=cs(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};J.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};J.ofb.prototype.decrypt=J.ofb.prototype.encrypt;J.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Ve.util.createBuffer(),this._partialBytes=0};J.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=cs(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};J.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}us(this._inBlock)};J.ctr.prototype.decrypt=J.ctr.prototype.encrypt;J.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Ve.util.createBuffer(),this._partialBytes=0,this._R=3774873600};J.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=Ve.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=Ve.util.createBuffer(t.additionalData):r=Ve.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=Ve.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(wa(n*8)))}this._inBlock=this._j0.slice(0),us(this._inBlock),this._partialBytes=0,r=Ve.util.createBuffer(r),this._aDataLength=wa(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};J.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),us(this._inBlock)};J.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),us(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};J.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=t[n]>>>(7-r%8)*4&15,s=this._m[r][i];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};J.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};J.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,s=new Array(i),o=0;o>>1,i=new Array(r);i[n]=t.slice(0);for(var s=n>>>1;s>0;)this.pow(i[2*s],i[s]=[]),s>>=1;for(s=2;s4){var r=t;t=Ve.util.createBuffer();for(var n=0;n{var me=de();ba();Ea();Ne();mf.exports=me.aes=me.aes||{};me.aes.startEncrypting=function(t,e,r,n){var i=ls({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i};me.aes.createEncryptionCipher=function(t,e){return ls({key:t,output:null,decrypt:!1,mode:e})};me.aes.startDecrypting=function(t,e,r,n){var i=ls({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i};me.aes.createDecryptionCipher=function(t,e){return ls({key:t,output:null,decrypt:!0,mode:e})};me.aes.Algorithm=function(t,e){Sa||df();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(n,i){return _a(r._w,n,i,!1)},decrypt:function(n,i){return _a(r._w,n,i,!0)}}}),r._init=!1};me.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=me.util.createBuffer(e);else if(me.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=me.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^a&255^99,ot[r]=a,va[a]=r,c=t[a],i=t[r],s=t[i],o=t[s],u=c<<24^a<<16^a<<8^(a^c),l=(i^s^o)<<24^(r^o)<<16^(r^s^o)<<8^(r^i^o);for(var f=0;f<4;++f)Vr[f][r]=u,Tt[f][a]=l,u=u<<24|u>>>8,l=l<<24|l>>>8;r===0?r=n=1:(r=i^t[t[t[i^o]]],n^=t[t[n]])}}function pf(t,e){for(var r=t.slice(0),n,i=1,s=r.length,o=s+6+1,a=_n*o,c=s;c>>16&255]<<24^ot[n>>>8&255]<<16^ot[n&255]<<8^ot[n>>>24]^hf[i]<<24,i++):s>6&&c%s===4&&(n=ot[n>>>24]<<24^ot[n>>>16&255]<<16^ot[n>>>8&255]<<8^ot[n&255]),r[c]=r[c-s]^n;if(e){var u,l=Tt[0],f=Tt[1],h=Tt[2],p=Tt[3],d=r.slice(0);a=r.length;for(var c=0,m=a-_n;c>>24]]^f[ot[u>>>16&255]]^h[ot[u>>>8&255]]^p[ot[u&255]];r=d}return r}function _a(t,e,r,n){var i=t.length/4-1,s,o,a,c,u;n?(s=Tt[0],o=Tt[1],a=Tt[2],c=Tt[3],u=va):(s=Vr[0],o=Vr[1],a=Vr[2],c=Vr[3],u=ot);var l,f,h,p,d,m,g;l=e[0]^t[0],f=e[n?3:1]^t[1],h=e[2]^t[2],p=e[n?1:3]^t[3];for(var y=3,x=1;x>>24]^o[f>>>16&255]^a[h>>>8&255]^c[p&255]^t[++y],m=s[f>>>24]^o[h>>>16&255]^a[p>>>8&255]^c[l&255]^t[++y],g=s[h>>>24]^o[p>>>16&255]^a[l>>>8&255]^c[f&255]^t[++y],p=s[p>>>24]^o[l>>>16&255]^a[f>>>8&255]^c[h&255]^t[++y],l=d,f=m,h=g;r[0]=u[l>>>24]<<24^u[f>>>16&255]<<16^u[h>>>8&255]<<8^u[p&255]^t[++y],r[n?3:1]=u[f>>>24]<<24^u[h>>>16&255]<<16^u[p>>>8&255]<<8^u[l&255]^t[++y],r[2]=u[h>>>24]<<24^u[p>>>16&255]<<16^u[l>>>8&255]<<8^u[f&255]^t[++y],r[n?1:3]=u[p>>>24]<<24^u[l>>>16&255]<<16^u[f>>>8&255]<<8^u[h&255]^t[++y]}function ls(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=me.cipher.createDecipher(r,t.key):n=me.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof me.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var xf=V((kv,yf)=>{var xe=de();ba();Ea();Ne();yf.exports=xe.des=xe.des||{};xe.des.startEncrypting=function(t,e,r,n){var i=fs({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};xe.des.createEncryptionCipher=function(t,e){return fs({key:t,output:null,decrypt:!1,mode:e})};xe.des.startDecrypting=function(t,e,r,n){var i=fs({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};xe.des.createDecryptionCipher=function(t,e){return fs({key:t,output:null,decrypt:!0,mode:e})};xe.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(n,i){return gf(r._keys,n,i,!1)},decrypt:function(n,i){return gf(r._keys,n,i,!0)}}}),r._init=!1};xe.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=xe.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=vg(e),this._init=!0}};Kt("DES-ECB",xe.cipher.modes.ecb);Kt("DES-CBC",xe.cipher.modes.cbc);Kt("DES-CFB",xe.cipher.modes.cfb);Kt("DES-OFB",xe.cipher.modes.ofb);Kt("DES-CTR",xe.cipher.modes.ctr);Kt("3DES-ECB",xe.cipher.modes.ecb);Kt("3DES-CBC",xe.cipher.modes.cbc);Kt("3DES-CFB",xe.cipher.modes.cfb);Kt("3DES-OFB",xe.cipher.modes.ofb);Kt("3DES-CTR",xe.cipher.modes.ctr);function Kt(t,e){var r=function(){return new xe.des.Algorithm(t,e)};xe.cipher.registerAlgorithm(t,r)}var pg=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],mg=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],gg=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],yg=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],xg=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],bg=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],wg=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],Eg=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function vg(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],a=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],l=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],d=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],m=t.length()>8?3:1,g=[],y=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],x=0,b,I=0;I>>4^_)&252645135,_^=b,v^=b<<4,b=(_>>>-16^v)&65535,v^=b,_^=b<<-16,b=(v>>>2^_)&858993459,_^=b,v^=b<<2,b=(_>>>-16^v)&65535,v^=b,_^=b<<-16,b=(v>>>1^_)&1431655765,_^=b,v^=b<<1,b=(_>>>8^v)&16711935,v^=b,_^=b<<8,b=(v>>>1^_)&1431655765,_^=b,v^=b<<1,b=v<<8|_>>>20&240,v=_<<24|_<<8&16711680|_>>>8&65280|_>>>24&240,_=b;for(var P=0;P>>26,_=_<<2|_>>>26):(v=v<<1|v>>>27,_=_<<1|_>>>27),v&=-15,_&=-15;var D=e[v>>>28]|r[v>>>24&15]|n[v>>>20&15]|i[v>>>16&15]|s[v>>>12&15]|o[v>>>8&15]|a[v>>>4&15],G=c[_>>>28]|u[_>>>24&15]|l[_>>>20&15]|f[_>>>16&15]|h[_>>>12&15]|p[_>>>8&15]|d[_>>>4&15];b=(G>>>16^D)&65535,g[x++]=D^b,g[x++]=G^b<<16}}return g}function gf(t,e,r,n){var i=t.length===32?3:9,s;i===3?s=n?[30,-2,-2]:[0,32,2]:s=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,a=e[0],c=e[1];o=(a>>>4^c)&252645135,c^=o,a^=o<<4,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,a=a<<1|a>>>31,c=c<<1|c>>>31;for(var u=0;u>>4|c<<28)^t[h+1];o=a,a=c,c=o^(mg[p>>>24&63]|yg[p>>>16&63]|bg[p>>>8&63]|Eg[p&63]|pg[d>>>24&63]|gg[d>>>16&63]|xg[d>>>8&63]|wg[d&63])}o=a,a=c,c=o}a=a>>>1|a<<31,c=c>>>1|c<<31,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(a>>>4^c)&252645135,c^=o,a^=o<<4,r[0]=a,r[1]=c}function fs(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=xe.cipher.createDecipher(r,t.key):n=xe.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof xe.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var $r=V((Ov,bf)=>{var hs=de();bf.exports=hs.md=hs.md||{};hs.md.algorithms=hs.md.algorithms||{}});var Ef=V((Mv,wf)=>{var er=de();$r();Ne();var _g=wf.exports=er.hmac=er.hmac||{};_g.create=function(){var t=null,e=null,r=null,n=null,i={};return i.start=function(s,o){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in er.md.algorithms)e=er.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else e=s;if(o===null)o=t;else{if(typeof o=="string")o=er.util.createBuffer(o);else if(er.util.isArray(o)){var a=o;o=er.util.createBuffer();for(var c=0;ce.blockLength&&(e.start(),e.update(o.bytes()),o=e.digest()),r=er.util.createBuffer(),n=er.util.createBuffer(),u=o.length();for(var c=0;c{});var _f=V((Kv,vf)=>{var at=de();Ef();$r();Ne();var Sg=at.pkcs5=at.pkcs5||{},tr;at.util.isNodejs&&!at.options.usePureJavaScript&&(tr=gi());vf.exports=at.pbkdf2=Sg.pbkdf2=function(t,e,r,n,i,s){if(typeof i=="function"&&(s=i,i=null),at.util.isNodejs&&!at.options.usePureJavaScript&&tr.pbkdf2&&(i===null||typeof i!="object")&&(tr.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?tr.pbkdf2Sync.length===4?tr.pbkdf2(t,e,r,n,function(b,I){if(b)return s(b);s(null,I.toString("binary"))}):tr.pbkdf2(t,e,r,n,i,function(b,I){if(b)return s(b);s(null,I.toString("binary"))}):tr.pbkdf2Sync.length===4?tr.pbkdf2Sync(t,e,r,n).toString("binary"):tr.pbkdf2Sync(t,e,r,n,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in at.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=at.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var a=new Error("Derived key is too long.");if(s)return s(a);throw a}var c=Math.ceil(n/o),u=n-(c-1)*o,l=at.hmac.create();l.start(i,t);var f="",h,p,d;if(!s){for(var m=1;m<=c;++m){l.start(null,null),l.update(e),l.update(at.util.int32ToBytes(m)),h=d=l.digest().getBytes();for(var g=2;g<=r;++g)l.start(null,null),l.update(d),p=l.digest().getBytes(),h=at.util.xorBytes(h,p,o),d=p;f+=mc)return s(null,f);l.start(null,null),l.update(e),l.update(at.util.int32ToBytes(m)),h=d=l.digest().getBytes(),g=2,x()}function x(){if(g<=r)return l.start(null,null),l.update(d),p=l.digest().getBytes(),h=at.util.xorBytes(h,p,o),d=p,++g,at.util.setImmediate(x);f+=m{var ps=de();Ne();var Sf=Af.exports=ps.pem=ps.pem||{};Sf.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r -`,n;if(t.procType&&(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=ds(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=ds(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=ds(n)),t.headers)for(var i=0;i65&&o!==-1){var a=e[o];a===","?(++o,e=e.substr(0,o)+`\r - `+e.substr(o)):e=e.substr(0,o)+`\r -`+a+e.substr(o+1),s=i-o-1,o=-1,++i}else(e[i]===" "||e[i]===" "||e[i]===",")&&(o=i);return e}function Ag(t){return t.replace(/^\s+/,"")}});var Pf=V((Vv,Lf)=>{var qt=de();$r();Ne();var Cf=Lf.exports=qt.sha256=qt.sha256||{};qt.md.sha256=qt.md.algorithms.sha256=Cf;Cf.create=function(){Tf||Ig();var t=null,e=qt.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),Rf(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=qt.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(Ia.substr(0,n.blockLength-o));for(var a,c,u=n.fullMessageLength[0]*8,l=0;l>>0,u+=c,i.putInt32(u>>>0),u=a>>>0;i.putInt32(u);var f={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};Rf(f,r,i);var h=qt.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h.putInt32(f.h5),h.putInt32(f.h6),h.putInt32(f.h7),h},n};var Ia=null,Tf=!1,Bf=null;function Ig(){Ia="\x80",Ia+=qt.util.fillString("\0",64),Bf=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Tf=!0}function Rf(t,e,r){for(var n,i,s,o,a,c,u,l,f,h,p,d,m,g,y,x=r.length();x>=64;){for(u=0;u<16;++u)e[u]=r.getInt32();for(;u<64;++u)n=e[u-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=e[u-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[u]=n+e[u-7]+i+e[u-16]|0;for(l=t.h0,f=t.h1,h=t.h2,p=t.h3,d=t.h4,m=t.h5,g=t.h6,y=t.h7,u=0;u<64;++u)o=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),a=g^d&(m^g),s=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),c=l&f|h&(l^f),n=y+o+a+Bf[u]+e[u],i=s+c,y=g,g=m,m=d,d=p+n>>>0,p=h,h=f,f=l,l=n+i>>>0;t.h0=t.h0+l|0,t.h1=t.h1+f|0,t.h2=t.h2+h|0,t.h3=t.h3+p|0,t.h4=t.h4+d|0,t.h5=t.h5+m|0,t.h6=t.h6+g|0,t.h7=t.h7+y|0,x-=64}}});var Nf=V(($v,Df)=>{var Vt=de();Ne();var ms=null;Vt.util.isNodejs&&!Vt.options.usePureJavaScript&&!process.versions["node-webkit"]&&(ms=gi());var Rg=Df.exports=Vt.prng=Vt.prng||{};Rg.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();e.pools=n,e.pool=0,e.generate=function(u,l){if(!l)return e.generateSync(u);var f=e.plugin.cipher,h=e.plugin.increment,p=e.plugin.formatKey,d=e.plugin.formatSeed,m=Vt.util.createBuffer();e.key=null,g();function g(y){if(y)return l(y);if(m.length()>=u)return l(null,m.getBytes(u));if(e.generated>1048575&&(e.key=null),e.key===null)return Vt.util.nextTick(function(){s(g)});var x=f(e.key,e.seed);e.generated+=x.length,m.putBytes(x),e.key=p(f(e.key,h(e.seed))),e.seed=d(f(e.key,e.seed)),Vt.util.setImmediate(g)}},e.generateSync=function(u){var l=e.plugin.cipher,f=e.plugin.increment,h=e.plugin.formatKey,p=e.plugin.formatSeed;e.key=null;for(var d=Vt.util.createBuffer();d.length()1048575&&(e.key=null),e.key===null&&o();var m=l(e.key,e.seed);e.generated+=m.length,d.putBytes(m),e.key=h(l(e.key,f(e.seed))),e.seed=p(l(e.key,e.seed))}return d.getBytes(u)};function s(u){if(e.pools[0].messageLength>=32)return a(),u();var l=32-e.pools[0].messageLength<<5;e.seedFile(l,function(f,h){if(f)return u(f);e.collect(h),a(),u()})}function o(){if(e.pools[0].messageLength>=32)return a();var u=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(u)),a()}function a(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var u=e.plugin.md.create();u.update(e.keyBytes);for(var l=1,f=0;f<32;++f)e.reseeds%l===0&&(u.update(e.pools[f].digest().getBytes()),e.pools[f].start()),l=l<<1;e.keyBytes=u.digest().getBytes(),u.start(),u.update(e.keyBytes);var h=u.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(h),e.generated=0}function c(u){var l=null,f=Vt.util.globalScope,h=f.crypto||f.msCrypto;h&&h.getRandomValues&&(l=function(v){return h.getRandomValues(v)});var p=Vt.util.createBuffer();if(l)for(;p.length()>16),x+=(y&32767)<<16,x+=y>>15,x=(x&2147483647)+(x>>31),I=x&4294967295;for(var g=0;g<3;++g)b=I>>>(g<<3),b^=Math.floor(Math.random()*256),p.putByte(b&255)}return p.getBytes(u)}return ms?(e.seedFile=function(u,l){ms.randomBytes(u,function(f,h){if(f)return l(f);l(null,h.toString())})},e.seedFileSync=function(u){return ms.randomBytes(u).toString()}):(e.seedFile=function(u,l){try{l(null,c(u))}catch(f){l(f)}},e.seedFileSync=c),e.collect=function(u){for(var l=u.length,f=0;f>h&255);e.collect(f)},e.registerWorker=function(u){if(u===self)e.seedFile=function(f,h){function p(d){var m=d.data;m.forge&&m.forge.prng&&(self.removeEventListener("message",p),h(m.forge.prng.err,m.forge.prng.bytes))}self.addEventListener("message",p),self.postMessage({forge:{prng:{needed:f}}})};else{var l=function(f){var h=f.data;h.forge&&h.forge.prng&&e.seedFile(h.forge.prng.needed,function(p,d){u.postMessage({forge:{prng:{err:p,bytes:d}}})})};u.addEventListener("message",l)}},e}});var yi=V((zv,Ra)=>{var $e=de();Aa();Pf();Nf();Ne();(function(){if($e.random&&$e.random.getBytes){Ra.exports=$e.random;return}(function(t){var e={},r=new Array(4),n=$e.util.createBuffer();e.formatKey=function(f){var h=$e.util.createBuffer(f);return f=new Array(4),f[0]=h.getInt32(),f[1]=h.getInt32(),f[2]=h.getInt32(),f[3]=h.getInt32(),$e.aes._expandKey(f,!1)},e.formatSeed=function(f){var h=$e.util.createBuffer(f);return f=new Array(4),f[0]=h.getInt32(),f[1]=h.getInt32(),f[2]=h.getInt32(),f[3]=h.getInt32(),f},e.cipher=function(f,h){return $e.aes._updateBlock(f,h,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(f){return++f[3],f},e.md=$e.md.sha256;function i(){var f=$e.prng.create(e);return f.getBytes=function(h,p){return f.generate(h,p)},f.getBytesSync=function(h){return f.generate(h)},f}var s=i(),o=null,a=$e.util.globalScope,c=a.crypto||a.msCrypto;if(c&&c.getRandomValues&&(o=function(f){return c.getRandomValues(f)}),$e.options.usePureJavaScript||!$e.util.isNodejs&&!o){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var u="";for(var l in navigator)try{typeof navigator[l]=="string"&&(u+=navigator[l])}catch{}s.collect(u),u=null}t&&(t().mousemove(function(f){s.collectInt(f.clientX,16),s.collectInt(f.clientY,16)}),t().keypress(function(f){s.collectInt(f.charCode,8)}))}if(!$e.random)$e.random=s;else for(var l in s)$e.random[l]=s[l];$e.random.createInstance=i,Ra.exports=$e.random})(typeof jQuery<"u"?jQuery:null)})()});var Uf=V((Hv,Mf)=>{var lt=de();Ne();var Ca=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],kf=[1,2,3,5],Cg=function(t,e){return t<>16-e},Tg=function(t,e){return(t&65535)>>e|t<<16-e&65535};Mf.exports=lt.rc2=lt.rc2||{};lt.rc2.expandKey=function(t,e){typeof t=="string"&&(t=lt.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),i=e,s=Math.ceil(i/8),o=255>>(i&7),a;for(a=n;a<128;a++)r.putByte(Ca[r.at(a-1)+r.at(a-n)&255]);for(r.setAt(128-s,Ca[r.at(128-s)&o]),a=127-s;a>=0;a--)r.setAt(a,Ca[r.at(a+1)^r.at(a+s)]);return r};var Of=function(t,e,r){var n=!1,i=null,s=null,o=null,a,c,u,l,f=[];for(t=lt.rc2.expandKey(t,e),u=0;u<64;u++)f.push(t.getInt16Le());r?(a=function(d){for(u=0;u<4;u++)d[u]+=f[l]+(d[(u+3)%4]&d[(u+2)%4])+(~d[(u+3)%4]&d[(u+1)%4]),d[u]=Cg(d[u],kf[u]),l++},c=function(d){for(u=0;u<4;u++)d[u]+=f[d[(u+3)%4]&63]}):(a=function(d){for(u=3;u>=0;u--)d[u]=Tg(d[u],kf[u]),d[u]-=f[l]+(d[(u+3)%4]&d[(u+2)%4])+(~d[(u+3)%4]&d[(u+1)%4]),l--},c=function(d){for(u=3;u>=0;u--)d[u]-=f[d[(u+3)%4]&63]});var h=function(d){var m=[];for(u=0;u<4;u++){var g=i.getInt16Le();o!==null&&(r?g^=o.getInt16Le():o.putInt16Le(g)),m.push(g&65535)}l=r?0:63;for(var y=0;y=8;)h([[5,a],[1,c],[6,a],[1,c],[5,a]])},finish:function(d){var m=!0;if(r)if(d)m=d(8,i,!r);else{var g=i.length()===8?8:8-i.length();i.fillWithByte(g,g)}if(m&&(n=!0,p.update()),!r&&(m=i.length()===0,m))if(d)m=d(8,s,!r);else{var y=s.length(),x=s.at(y-1);x>y?m=!1:s.truncate(x)}return m}},p};lt.rc2.startEncrypting=function(t,e,r){var n=lt.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};lt.rc2.createEncryptionCipher=function(t,e){return Of(t,e,!0)};lt.rc2.startDecrypting=function(t,e,r){var n=lt.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};lt.rc2.createDecryptionCipher=function(t,e){return Of(t,e,!1)}});var xs=V((Gv,Gf)=>{var Ta=de();Gf.exports=Ta.jsbn=Ta.jsbn||{};var rr,Bg=0xdeadbeefcafe,Ff=(Bg&16777215)==15715070;function C(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}Ta.jsbn.BigInteger=C;function ie(){return new C(null)}function Lg(t,e,r,n,i,s){for(;--s>=0;){var o=e*this.data[t++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=o&67108863}return i}function Pg(t,e,r,n,i,s){for(var o=e&32767,a=e>>15;--s>=0;){var c=this.data[t]&32767,u=this.data[t++]>>15,l=a*c+u*o;c=o*c+((l&32767)<<15)+r.data[n]+(i&1073741823),i=(c>>>30)+(l>>>15)+a*u+(i>>>30),r.data[n++]=c&1073741823}return i}function Kf(t,e,r,n,i,s){for(var o=e&16383,a=e>>14;--s>=0;){var c=this.data[t]&16383,u=this.data[t++]>>14,l=a*c+u*o;c=o*c+((l&16383)<<14)+r.data[n]+i,i=(c>>28)+(l>>14)+a*u,r.data[n++]=c&268435455}return i}typeof navigator>"u"?(C.prototype.am=Kf,rr=28):Ff&&navigator.appName=="Microsoft Internet Explorer"?(C.prototype.am=Pg,rr=30):Ff&&navigator.appName!="Netscape"?(C.prototype.am=Lg,rr=26):(C.prototype.am=Kf,rr=28);C.prototype.DB=rr;C.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function kg(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}function xr(t){var e=ie();return e.fromInt(t),e}function Og(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,i=!1,s=0;--n>=0;){var o=r==8?t[n]&255:Vf(t,n);if(o<0){t.charAt(n)=="-"&&(i=!0);continue}i=!1,s==0?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB)}r==8&&t[0]&128&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}function Ug(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(a>a)>0&&(i=!0,s=qf(n));o>=0;)a>(a+=this.DB-e)):(n=this.data[o]>>(a-=e)&r,a<=0&&(a+=this.DB,--o)),n>0&&(i=!0),i&&(s+=qf(n));return i?s:"0"}function Fg(){var t=ie();return C.ZERO.subTo(this,t),t}function Kg(){return this.s<0?this.negate():this}function qg(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}function ys(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function Vg(){return this.t<=0?0:this.DB*(this.t-1)+ys(this.data[this.t-1]^this.s&this.DM)}function $g(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}function zg(t,e){for(var r=t;r=0;--a)e.data[a+s+1]=this.data[a]>>n|o,o=(this.data[a]&i)<=0;--a)e.data[a]=0;e.data[s]=o,e.t=this.t+s+1,e.s=this.s,e.clamp()}function Gg(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,i=this.DB-n,s=(1<>n;for(var o=r+1;o>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}function Yg(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}function Xg(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var u=s.t,l=s.data[u-1];if(l!=0){var f=l*(1<1?s.data[u-2]>>this.F2:0),h=this.FV/f,p=(1<=0&&(r.data[r.t++]=1,r.subTo(y,r)),C.ONE.dlShiftTo(u,y),y.subTo(s,s);s.t=0;){var x=r.data[--m]==l?this.DM:Math.floor(r.data[m]*h+(r.data[m-1]+d)*p);if((r.data[m]+=s.am(0,x,r,g,0,u))0&&r.rShiftTo(c,r),o<0&&C.ZERO.subTo(r,r)}}}function Zg(t){var e=ie();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(C.ZERO)>0&&t.subTo(e,e),e}function zr(t){this.m=t}function jg(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function Jg(t){return t}function ey(t){t.divRemTo(this.m,null,t)}function ty(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function ry(t,e){t.squareTo(e),this.reduce(e)}zr.prototype.convert=jg;zr.prototype.revert=Jg;zr.prototype.reduce=ey;zr.prototype.mulTo=ty;zr.prototype.sqrTo=ry;function ny(){if(this.t<1)return 0;var t=this.data[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function Hr(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}function sy(t){var e=ie();return t.copyTo(e),this.reduce(e),e}function oy(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function ay(t,e){t.squareTo(e),this.reduce(e)}function cy(t,e,r){t.multiplyTo(e,r),this.reduce(r)}Hr.prototype.convert=iy;Hr.prototype.revert=sy;Hr.prototype.reduce=oy;Hr.prototype.mulTo=cy;Hr.prototype.sqrTo=ay;function uy(){return(this.t>0?this.data[0]&1:this.s)==0}function ly(t,e){if(t>4294967295||t<1)return C.ONE;var r=ie(),n=ie(),i=e.convert(this),s=ys(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,i,r);else{var o=r;r=n,n=o}return e.revert(r)}function fy(t,e){var r;return t<256||e.isEven()?r=new zr(e):r=new Hr(e),this.exp(t,r)}C.prototype.copyTo=Ng;C.prototype.fromInt=kg;C.prototype.fromString=Og;C.prototype.clamp=Mg;C.prototype.dlShiftTo=$g;C.prototype.drShiftTo=zg;C.prototype.lShiftTo=Hg;C.prototype.rShiftTo=Gg;C.prototype.subTo=Wg;C.prototype.multiplyTo=Yg;C.prototype.squareTo=Qg;C.prototype.divRemTo=Xg;C.prototype.invDigit=ny;C.prototype.isEven=uy;C.prototype.exp=ly;C.prototype.toString=Ug;C.prototype.negate=Fg;C.prototype.abs=Kg;C.prototype.compareTo=qg;C.prototype.bitLength=Vg;C.prototype.mod=Zg;C.prototype.modPowInt=fy;C.ZERO=xr(0);C.ONE=xr(1);function hy(){var t=ie();return this.copyTo(t),t}function dy(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}function my(){return this.t==0?this.s:this.data[0]<<16>>16}function gy(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function yy(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function xy(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=xr(r),i=ie(),s=ie(),o="";for(this.divRemTo(n,i,s);i.signum()>0;)o=(r+s.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,s);return s.intValue().toString(t)+o}function by(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,s=0,o=0,a=0;a=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(o,0)),i&&C.ZERO.subTo(this,this)}function wy(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(C.ONE.shiftLeft(t-1),La,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(C.ONE.shiftLeft(t-1),this);else{var n=new Array,i=t&7;n.length=(t>>3)+1,e.nextBytes(n),i>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function vy(t){return this.compareTo(t)==0}function _y(t){return this.compareTo(t)<0?this:t}function Sy(t){return this.compareTo(t)>0?this:t}function Ay(t,e,r){var n,i,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),t&255||(t>>=8,e+=8),t&15||(t>>=4,e+=4),t&3||(t>>=2,e+=2),t&1||++e,e}function ky(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}function zy(t){var e=ie();return this.addTo(t,e),e}function Hy(t){var e=ie();return this.subTo(t,e),e}function Gy(t){var e=ie();return this.multiplyTo(t,e),e}function Wy(t){var e=ie();return this.divRemTo(t,e,null),e}function Yy(t){var e=ie();return this.divRemTo(t,null,e),e}function Qy(t){var e=ie(),r=ie();return this.divRemTo(t,e,r),new Array(e,r)}function Xy(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Zy(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}function xi(){}function Hf(t){return t}function jy(t,e,r){t.multiplyTo(e,r)}function Jy(t,e){t.squareTo(e)}xi.prototype.convert=Hf;xi.prototype.revert=Hf;xi.prototype.mulTo=jy;xi.prototype.sqrTo=Jy;function e1(t){return this.exp(t,new xi)}function t1(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=ie();return t.copyTo(e),this.reduce(e),e}function i1(t){return t}function s1(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function o1(t,e){t.squareTo(e),this.reduce(e)}function a1(t,e,r){t.multiplyTo(e,r),this.reduce(r)}In.prototype.convert=n1;In.prototype.revert=i1;In.prototype.reduce=s1;In.prototype.mulTo=a1;In.prototype.sqrTo=o1;function c1(t,e){var r=t.bitLength(),n,i=xr(1),s;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new zr(e):e.isEven()?s=new In(e):s=new Hr(e);var o=new Array,a=3,c=n-1,u=(1<1){var l=ie();for(s.sqrTo(o[1],l);a<=u;)o[a]=ie(),s.mulTo(l,o[a-2],o[a]),a+=2}var f=t.t-1,h,p=!0,d=ie(),m;for(r=ys(t.data[f])-1;f>=0;){for(r>=c?h=t.data[f]>>r-c&u:(h=(t.data[f]&(1<0&&(h|=t.data[f-1]>>this.DB+r-c)),a=n;!(h&1);)h>>=1,--a;if((r-=a)<0&&(r+=this.DB,--f),p)o[h].copyTo(i),p=!1;else{for(;a>1;)s.sqrTo(i,d),s.sqrTo(d,i),a-=2;a>0?s.sqrTo(i,d):(m=i,i=d,d=m),s.mulTo(d,o[h],i)}for(;f>=0&&!(t.data[f]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function l1(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}function f1(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return C.ZERO;for(var r=t.clone(),n=this.clone(),i=xr(1),s=xr(0),o=xr(0),a=xr(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!i.isEven()||!s.isEven())&&(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!o.isEven()||!a.isEven())&&(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),s.subTo(a,s)):(n.subTo(r,n),e&&o.subTo(i,o),a.subTo(s,a))}if(n.compareTo(C.ONE)!=0)return C.ZERO;if(a.compareTo(t)>=0)return a.subtract(t);if(a.signum()<0)a.addTo(t,a);else return a;return a.signum()<0?a.add(t):a}var Bt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],h1=(1<<26)/Bt[Bt.length-1];function d1(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=Bt[Bt.length-1]){for(e=0;e=0);var a=s.modPow(n,this);if(a.compareTo(C.ONE)!=0&&a.compareTo(e)!=0){for(var c=1;c++{var $t=de();$r();Ne();var Yf=Xf.exports=$t.sha1=$t.sha1||{};$t.md.sha1=$t.md.algorithms.sha1=Yf;Yf.create=function(){Qf||g1();var t=null,e=$t.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),Wf(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=$t.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(Pa.substr(0,n.blockLength-o));for(var a,c,u=n.fullMessageLength[0]*8,l=0;l>>0,u+=c,i.putInt32(u>>>0),u=a>>>0;i.putInt32(u);var f={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};Wf(f,r,i);var h=$t.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h},n};var Pa=null,Qf=!1;function g1(){Pa="\x80",Pa+=$t.util.fillString("\0",64),Qf=!0}function Wf(t,e,r){for(var n,i,s,o,a,c,u,l,f=r.length();f>=64;){for(i=t.h0,s=t.h1,o=t.h2,a=t.h3,c=t.h4,l=0;l<16;++l)n=r.getInt32(),e[l]=n,u=a^s&(o^a),n=(i<<5|i>>>27)+u+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<20;++l)n=e[l-3]^e[l-8]^e[l-14]^e[l-16],n=n<<1|n>>>31,e[l]=n,u=a^s&(o^a),n=(i<<5|i>>>27)+u+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<32;++l)n=e[l-3]^e[l-8]^e[l-14]^e[l-16],n=n<<1|n>>>31,e[l]=n,u=s^o^a,n=(i<<5|i>>>27)+u+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<40;++l)n=e[l-6]^e[l-16]^e[l-28]^e[l-32],n=n<<2|n>>>30,e[l]=n,u=s^o^a,n=(i<<5|i>>>27)+u+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<60;++l)n=e[l-6]^e[l-16]^e[l-28]^e[l-32],n=n<<2|n>>>30,e[l]=n,u=s&o|a&(s^o),n=(i<<5|i>>>27)+u+c+2400959708+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<80;++l)n=e[l-6]^e[l-16]^e[l-28]^e[l-32],n=n<<2|n>>>30,e[l]=n,u=s^o^a,n=(i<<5|i>>>27)+u+c+3395469782+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+s|0,t.h2=t.h2+o|0,t.h3=t.h3+a|0,t.h4=t.h4+c|0,f-=64}}});var e0=V((Yv,Jf)=>{var zt=de();Ne();yi();Zf();var jf=Jf.exports=zt.pkcs1=zt.pkcs1||{};jf.encode_rsa_oaep=function(t,e,r){var n,i,s,o;typeof r=="string"?(n=r,i=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),s?s.start():s=zt.md.sha1.create(),o||(o=s);var a=Math.ceil(t.n.bitLength()/8),c=a-2*s.digestLength-2;if(e.length>c){var u=new Error("RSAES-OAEP input message length is too long.");throw u.length=e.length,u.maxLength=c,u}n||(n=""),s.update(n,"raw");for(var l=s.digest(),f="",h=c-e.length,p=0;p>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+o),n+=r.digest().getBytes()}return n.substring(0,e)}});var t0=V((Qv,Da)=>{var br=de();Ne();xs();yi();(function(){if(br.prime){Da.exports=br.prime;return}var t=Da.exports=br.prime=br.prime||{},e=br.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var i=function(f,h){return f|h};t.generateProbablePrime=function(f,h,p){typeof h=="function"&&(p=h,h={}),h=h||{};var d=h.algorithm||"PRIMEINC";typeof d=="string"&&(d={name:d}),d.options=d.options||{};var m=h.prng||br.random,g={nextBytes:function(y){for(var x=m.getBytesSync(y.length),b=0;bh&&(f=u(h,p)),f.isProbablePrime(m))return y(null,f);f.dAddOffset(r[d++%8],0)}while(g<0||+new Date-x"u")return o(f,h,p,d);var m=u(f,h),g=p.workers,y=p.workLoad||100,x=y*30/8,b=p.workerScript||"forge/prime.worker.js";if(g===-1)return br.util.estimateCores(function(v,_){v&&(_=2),g=_-1,I()});I();function I(){g=Math.max(1,g);for(var v=[],_=0;_f&&(m=u(f,h));var he=m.toString(16);W.target.postMessage({hex:he,workLoad:y}),m.dAddOffset(x,0)}}}}function u(f,h){var p=new e(f,h),d=f-1;return p.testBit(d)||p.bitwiseTo(e.ONE.shiftLeft(d),i,p),p.dAddOffset(31-p.mod(n).byteValue(),0),p}function l(f){return f<=100?27:f<=150?18:f<=200?15:f<=250?12:f<=300?9:f<=350?8:f<=400?7:f<=500?6:f<=600?5:f<=800?4:f<=1250?3:2}})()});var Es=V((Xv,c0)=>{var $=de();mi();xs();os();e0();t0();yi();Ne();typeof ne>"u"&&(ne=$.jsbn.BigInteger);var ne,Na=$.util.isNodejs?gi():null,E=$.asn1,At=$.util;$.pki=$.pki||{};c0.exports=$.pki.rsa=$.rsa=$.rsa||{};var Y=$.pki,y1=[6,4,2,4,2,4,6,2],x1={name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},b1={name:"RSAPrivateKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},w1={name:"RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},E1=$.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},v1={name:"DigestInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:E.Class.UNIVERSAL,type:E.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},_1=function(t){var e;if(t.algorithm in Y.oids)e=Y.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=E.oidToDer(e).getBytes(),i=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]),s=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]);s.value.push(E.create(E.Class.UNIVERSAL,E.Type.OID,!1,n)),s.value.push(E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,""));var o=E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(s),i.value.push(o),E.toDer(i).getBytes()},o0=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(ne.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(ne.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new ne($.util.bytesToHex($.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(ne.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var i=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(s)<0;)i=i.add(e.p);var o=i.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return o=o.multiply(n.modInverse(e.n)).mod(e.n),o};Y.rsa.encrypt=function(t,e,r){var n=r,i,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=a0(t,e,r)):(i=$.util.createBuffer(),i.putBytes(t));for(var o=new ne(i.toHex(),16),a=o0(o,e,n),c=a.toString(16),u=$.util.createBuffer(),l=s-Math.ceil(c.length/2);l>0;)u.putByte(0),--l;return u.putBytes($.util.hexToBytes(c)),u.getBytes()};Y.rsa.decrypt=function(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=i,s}var o=new ne($.util.createBuffer(t).toHex(),16);if(o.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var a=o0(o,e,r),c=a.toString(16),u=$.util.createBuffer(),l=i-Math.ceil(c.length/2);l>0;)u.putByte(0),--l;return u.putBytes($.util.hexToBytes(c)),n!==!1?ws(u.getBytes(),e,r):u.getBytes()};Y.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||$.random,i={nextBytes:function(a){for(var c=n.getBytesSync(a.length),u=0;u>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+s);return o};Y.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new ne(null);r.fromInt(30);for(var n=0,i=function(f,h){return f|h},s=+new Date,o,a=0;t.keys===null&&(e<=0||ac?t.pqState=0:t.num.isProbablePrime(A1(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(y1[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(ne.ONE).gcd(t.e).compareTo(ne.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(ne.ONE),t.q1=t.q.subtract(ne.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(ne.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var l=t.e.modInverse(t.phi);t.keys={privateKey:Y.rsa.setPrivateKey(t.n,t.e,l,t.p,t.q,l.mod(t.p1),l.mod(t.q1),t.q.modInverse(t.p)),publicKey:Y.rsa.setPublicKey(t.n,t.e)}}o=+new Date,a+=o-s,s=o}return t.keys!==null};Y.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!$.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(r0("generateKeyPair"))return Na.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(a,c,u){if(a)return n(a);n(null,{privateKey:Y.privateKeyFromPem(u),publicKey:Y.publicKeyFromPem(c)})});if(n0("generateKey")&&n0("exportKey"))return At.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:s0(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(a){return At.globalScope.crypto.subtle.exportKey("pkcs8",a.privateKey)}).then(void 0,function(a){n(a)}).then(function(a){if(a){var c=Y.privateKeyFromAsn1(E.fromDer($.util.createBuffer(a)));n(null,{privateKey:c,publicKey:Y.setRsaPublicKey(c.n,c.e)})}});if(i0("generateKey")&&i0("exportKey")){var i=At.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:s0(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(a){var c=a.target.result,u=At.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);u.oncomplete=function(l){var f=l.target.result,h=Y.privateKeyFromAsn1(E.fromDer($.util.createBuffer(f)));n(null,{privateKey:h,publicKey:Y.setRsaPublicKey(h.n,h.e)})},u.onerror=function(l){n(l)}},i.onerror=function(a){n(a)};return}}else if(r0("generateKeyPairSync")){var s=Na.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Y.privateKeyFromPem(s.privateKey),publicKey:Y.publicKeyFromPem(s.publicKey)}}}var o=Y.rsa.createKeyPairGenerationState(t,e,r);if(!n)return Y.rsa.stepKeyPairGenerationState(o,0),o.keys;S1(o,r,n)};Y.setRsaPublicKey=Y.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,i,s){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(a,c,u){return a0(a,c,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(a,c){return $.pkcs1.encode_rsa_oaep(c,a,s)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(a){return a}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(n,r,!0);return Y.rsa.encrypt(o,r,!0)},r.verify=function(n,i,s,o){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),s==="RSASSA-PKCS1-V1_5"?s={verify:function(c,u){u=ws(u,r,!0);var l=E.fromDer(u,{parseAllBytes:o._parseAllDigestBytes}),f={},h=[];if(!E.validate(l,v1,f,h)){var p=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw p.errors=h,p}var d=E.derToOid(f.algorithmIdentifier);if(!(d===$.oids.md2||d===$.oids.md5||d===$.oids.sha1||d===$.oids.sha224||d===$.oids.sha256||d===$.oids.sha384||d===$.oids.sha512||d===$.oids["sha512-224"]||d===$.oids["sha512-256"])){var p=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw p.oid=d,p}if((d===$.oids.md2||d===$.oids.md5)&&!("parameters"in f))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return c===f.digest}}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:function(c,u){return u=ws(u,r,!0),c===u}});var a=Y.rsa.decrypt(i,r,!0,!1);return s.verify(n,a,r.n.bitLength())},r};Y.setRsaPrivateKey=Y.rsa.setPrivateKey=function(t,e,r,n,i,s,o,a){var c={n:t,e,d:r,p:n,q:i,dP:s,dQ:o,qInv:a};return c.decrypt=function(u,l,f){typeof l=="string"?l=l.toUpperCase():l===void 0&&(l="RSAES-PKCS1-V1_5");var h=Y.rsa.decrypt(u,c,!1,!1);if(l==="RSAES-PKCS1-V1_5")l={decode:ws};else if(l==="RSA-OAEP"||l==="RSAES-OAEP")l={decode:function(p,d){return $.pkcs1.decode_rsa_oaep(d,p,f)}};else if(["RAW","NONE","NULL",null].indexOf(l)!==-1)l={decode:function(p){return p}};else throw new Error('Unsupported encryption scheme: "'+l+'".');return l.decode(h,c,!1)},c.sign=function(u,l){var f=!1;typeof l=="string"&&(l=l.toUpperCase()),l===void 0||l==="RSASSA-PKCS1-V1_5"?(l={encode:_1},f=1):(l==="NONE"||l==="NULL"||l===null)&&(l={encode:function(){return u}},f=1);var h=l.encode(u,c.n.bitLength());return Y.rsa.encrypt(h,c,f)},c};Y.wrapRsaPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Y.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,E.toDer(t).getBytes())])};Y.privateKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,x1,e,r)&&(t=E.fromDer($.util.createBuffer(e.privateKey))),e={},r=[],!E.validate(t,b1,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,s,o,a,c,u,l,f;return i=$.util.createBuffer(e.privateKeyModulus).toHex(),s=$.util.createBuffer(e.privateKeyPublicExponent).toHex(),o=$.util.createBuffer(e.privateKeyPrivateExponent).toHex(),a=$.util.createBuffer(e.privateKeyPrime1).toHex(),c=$.util.createBuffer(e.privateKeyPrime2).toHex(),u=$.util.createBuffer(e.privateKeyExponent1).toHex(),l=$.util.createBuffer(e.privateKeyExponent2).toHex(),f=$.util.createBuffer(e.privateKeyCoefficient).toHex(),Y.setRsaPrivateKey(new ne(i,16),new ne(s,16),new ne(o,16),new ne(a,16),new ne(c,16),new ne(u,16),new ne(l,16),new ne(f,16))};Y.privateKeyToAsn1=Y.privateKeyToRSAPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.e)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.d)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.p)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.q)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.dP)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.dQ)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.qInv))])};Y.publicKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,E1,e,r)){var n=E.derToOid(e.publicKeyOid);if(n!==Y.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}t=e.rsaPublicKey}if(r=[],!E.validate(t,w1,e,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var s=$.util.createBuffer(e.publicKeyModulus).toHex(),o=$.util.createBuffer(e.publicKeyExponent).toHex();return Y.setRsaPublicKey(new ne(s,16),new ne(o,16))};Y.publicKeyToAsn1=Y.publicKeyToSubjectPublicKeyInfo=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Y.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.BITSTRING,!1,[Y.publicKeyToRSAPublicKey(t)])])};Y.publicKeyToRSAPublicKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,Ht(t.e))])};function a0(t,e,r){var n=$.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=i-11,s}n.putByte(0),n.putByte(r);var o=i-3-t.length,a;if(r===0||r===1){a=r===0?0:255;for(var c=0;c0;){for(var u=0,l=$.random.getBytes(o),c=0;c"u")throw new Error("Encryption block is invalid.");var c=0;if(a===0){c=i-3-n;for(var u=0;u1;){if(s.getByte()!==255){--s.read;break}++c}else if(a===2)for(c=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++c}var l=s.getByte();if(l!==0||c!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function S1(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),i();function i(){s(t.pBits,function(a,c){if(a)return r(a);if(t.p=c,t.q!==null)return o(a,t.q);s(t.qBits,o)})}function s(a,c){$.prime.generateProbablePrime(a,n,c)}function o(a,c){if(a)return r(a);if(t.q=c,t.p.compareTo(t.q)<0){var u=t.p;t.p=t.q,t.q=u}if(t.p.subtract(ne.ONE).gcd(t.e).compareTo(ne.ONE)!==0){t.p=null,i();return}if(t.q.subtract(ne.ONE).gcd(t.e).compareTo(ne.ONE)!==0){t.q=null,s(t.qBits,o);return}if(t.p1=t.p.subtract(ne.ONE),t.q1=t.q.subtract(ne.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(ne.ONE)!==0){t.p=t.q=null,i();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,o);return}var l=t.e.modInverse(t.phi);t.keys={privateKey:Y.rsa.setPrivateKey(t.n,t.e,l,t.p,t.q,l.mod(t.p1),l.mod(t.q1),t.q.modInverse(t.p)),publicKey:Y.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function Ht(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=$.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function A1(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function r0(t){return $.util.isNodejs&&typeof Na[t]=="function"}function n0(t){return typeof At.globalScope<"u"&&typeof At.globalScope.crypto=="object"&&typeof At.globalScope.crypto.subtle=="object"&&typeof At.globalScope.crypto.subtle[t]=="function"}function i0(t){return typeof At.globalScope<"u"&&typeof At.globalScope.msCrypto=="object"&&typeof At.globalScope.msCrypto.subtle=="object"&&typeof At.globalScope.msCrypto.subtle[t]=="function"}function s0(t){for(var e=$.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{var M=de();Aa();mi();xf();$r();os();_f();If();yi();Uf();Es();Ne();typeof u0>"u"&&(u0=M.jsbn.BigInteger);var u0,A=M.asn1,X=M.pki=M.pki||{};d0.exports=X.pbe=M.pbe=M.pbe||{};var Gr=X.oids,I1={name:"EncryptedPrivateKeyInfo",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},R1={name:"PBES2Algorithms",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},C1={name:"pkcs-12PbeParams",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,capture:"iterations"}]};X.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=M.random.getBytesSync(r.saltSize),i=r.count,s=A.integerToDer(i),o,a,c;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var u,l,f;switch(r.algorithm){case"aes128":o=16,u=16,l=Gr["aes128-CBC"],f=M.aes.createEncryptionCipher;break;case"aes192":o=24,u=16,l=Gr["aes192-CBC"],f=M.aes.createEncryptionCipher;break;case"aes256":o=32,u=16,l=Gr["aes256-CBC"],f=M.aes.createEncryptionCipher;break;case"des":o=8,u=8,l=Gr.desCBC,f=M.des.createEncryptionCipher;break;default:var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=r.algorithm,h}var p="hmacWith"+r.prfAlgorithm.toUpperCase(),d=h0(p),m=M.pkcs5.pbkdf2(e,n,i,o,d),g=M.random.getBytesSync(u),y=f(m);y.start(g),y.update(A.toDer(t)),y.finish(),c=y.output.getBytes();var x=T1(n,s,o,p);a=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(Gr.pkcs5PBES2).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(Gr.pkcs5PBKDF2).getBytes()),x]),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(l).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,g)])])])}else if(r.algorithm==="3des"){o=24;var b=new M.util.ByteBuffer(n),m=X.pbe.generatePkcs12Key(e,b,1,i,o),g=X.pbe.generatePkcs12Key(e,b,2,i,o),y=M.des.createEncryptionCipher(m);y.start(g),y.update(A.toDer(t)),y.finish(),c=y.output.getBytes(),a=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(Gr["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,n),A.create(A.Class.UNIVERSAL,A.Type.INTEGER,!1,s.getBytes())])])}else{var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=r.algorithm,h}var I=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[a,A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,c)]);return I};X.decryptPrivateKeyInfo=function(t,e){var r=null,n={},i=[];if(!A.validate(t,I1,n,i)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=A.derToOid(n.encryptionOid),a=X.pbe.getCipher(o,n.encryptionParams,e),c=M.util.createBuffer(n.encryptedData);return a.update(c),a.finish()&&(r=A.fromDer(a.output)),r};X.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:A.toDer(t).getBytes()};return M.pem.encode(r,{maxline:e})};X.encryptedPrivateKeyFromPem=function(t){var e=M.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return A.fromDer(e.body)};X.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=X.wrapRsaPrivateKey(X.privateKeyToAsn1(t));return n=X.encryptPrivateKeyInfo(n,e,r),X.encryptedPrivateKeyToPem(n)}var i,s,o,a;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,s=M.random.getBytesSync(16),a=M.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,s=M.random.getBytesSync(16),a=M.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,s=M.random.getBytesSync(16),a=M.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,s=M.random.getBytesSync(8),a=M.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,s=M.random.getBytesSync(8),a=M.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var u=M.pbe.opensslDeriveBytes(e,s.substr(0,8),o),l=a(u);l.start(s),l.update(A.toDer(X.privateKeyToAsn1(t))),l.finish();var f={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:M.util.bytesToHex(s).toUpperCase()},body:l.output.getBytes()};return M.pem.encode(f)};X.decryptRsaPrivateKey=function(t,e){var r=null,n=M.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,o;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,o=M.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,o=M.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,o=M.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,o=M.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,o=M.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,o=function(f){return M.rc2.createDecryptionCipher(f,40)};break;case"RC2-64-CBC":s=8,o=function(f){return M.rc2.createDecryptionCipher(f,64)};break;case"RC2-128-CBC":s=16,o=function(f){return M.rc2.createDecryptionCipher(f,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var a=M.util.hexToBytes(n.dekInfo.parameters),c=M.pbe.opensslDeriveBytes(e,a.substr(0,8),s),u=o(c);if(u.start(a),u.update(M.util.createBuffer(n.body)),u.finish())r=u.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=X.decryptPrivateKeyInfo(A.fromDer(r),e):r=A.fromDer(r),r!==null&&(r=X.privateKeyFromAsn1(r)),r};X.pbe.generatePkcs12Key=function(t,e,r,n,i,s){var o,a;if(typeof s>"u"||s===null){if(!("sha1"in M.md))throw new Error('"sha1" hash algorithm unavailable.');s=M.md.sha1.create()}var c=s.digestLength,u=s.blockLength,l=new M.util.ByteBuffer,f=new M.util.ByteBuffer;if(t!=null){for(a=0;a=0;a--)ee=ee>>8,ee+=D.at(a)+z.at(a),z.setAt(a,ee&255);W.putBuffer(z)}b=W,l.putBuffer(_)}return l.truncate(l.length()-i),l};X.pbe.getCipher=function(t,e,r){switch(t){case X.oids.pkcs5PBES2:return X.pbe.getCipherForPBES2(t,e,r);case X.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case X.oids["pbewithSHAAnd40BitRC2-CBC"]:return X.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};X.pbe.getCipherForPBES2=function(t,e,r){var n={},i=[];if(!A.validate(e,R1,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}if(t=A.derToOid(n.kdfOid),t!==X.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=A.derToOid(n.encOid),t!==X.oids["aes128-CBC"]&&t!==X.oids["aes192-CBC"]&&t!==X.oids["aes256-CBC"]&&t!==X.oids["des-EDE3-CBC"]&&t!==X.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var o=n.kdfSalt,a=M.util.createBuffer(n.kdfIterationCount);a=a.getInt(a.length()<<3);var c,u;switch(X.oids[t]){case"aes128-CBC":c=16,u=M.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,u=M.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,u=M.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,u=M.des.createDecryptionCipher;break;case"desCBC":c=8,u=M.des.createDecryptionCipher;break}var l=f0(n.prfOid),f=M.pkcs5.pbkdf2(r,o,a,c,l),h=n.encIv,p=u(f);return p.start(h),p};X.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},i=[];if(!A.validate(e,C1,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=M.util.createBuffer(n.salt),a=M.util.createBuffer(n.iterations);a=a.getInt(a.length()<<3);var c,u,l;switch(t){case X.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,u=8,l=M.des.startDecrypting;break;case X.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,u=8,l=function(m,g){var y=M.rc2.createDecryptionCipher(m,40);return y.start(g,null),y};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var f=f0(n.prfOid),h=X.pbe.generatePkcs12Key(r,o,1,a,c,f);f.start();var p=X.pbe.generatePkcs12Key(r,o,2,a,u,f);return l(h,p)};X.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in M.md))throw new Error('"md5" hash algorithm unavailable.');n=M.md.md5.create()}e===null&&(e="");for(var i=[l0(n,t+e)],s=16,o=1;s{var ye=de();$r();Ne();var Ti=wh.exports=ye.sha512=ye.sha512||{};ye.md.sha512=ye.md.algorithms.sha512=Ti;var xh=ye.sha384=ye.sha512.sha384=ye.sha512.sha384||{};xh.create=function(){return Ti.create("SHA-384")};ye.md.sha384=ye.md.algorithms.sha384=xh;ye.sha512.sha256=ye.sha512.sha256||{create:function(){return Ti.create("SHA-512/256")}};ye.md["sha512/256"]=ye.md.algorithms["sha512/256"]=ye.sha512.sha256;ye.sha512.sha224=ye.sha512.sha224||{create:function(){return Ti.create("SHA-512/224")}};ye.md["sha512/224"]=ye.md.algorithms["sha512/224"]=ye.sha512.sha224;Ti.create=function(t){if(bh||j2(),typeof t>"u"&&(t="SHA-512"),!(t in rn))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=rn[t],r=null,n=ye.util.createBuffer(),i=new Array(80),s=0;s<80;++s)i[s]=new Array(2);var o=64;switch(t){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var a={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength128=[];for(var c=a.messageLengthSize/4,u=0;u>>0,l>>>0];for(var f=a.fullMessageLength.length-1;f>=0;--f)a.fullMessageLength[f]+=l[1],l[1]=l[0]+(a.fullMessageLength[f]/4294967296>>>0),a.fullMessageLength[f]=a.fullMessageLength[f]>>>0,l[0]=l[1]/4294967296>>>0;return n.putBytes(c),yh(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),a},a.digest=function(){var c=ye.util.createBuffer();c.putBytes(n.bytes());var u=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize,l=u&a.blockLength-1;c.putBytes(kc.substr(0,a.blockLength-l));for(var f,h,p=a.fullMessageLength[0]*8,d=0;d>>0,p+=h,c.putInt32(p>>>0),p=f>>>0;c.putInt32(p);for(var m=new Array(r.length),d=0;d=128;){for(T=0;T<16;++T)e[T][0]=r.getInt32()>>>0,e[T][1]=r.getInt32()>>>0;for(;T<80;++T)N=e[T-2],k=N[0],L=N[1],n=((k>>>19|L<<13)^(L>>>29|k<<3)^k>>>6)>>>0,i=((k<<13|L>>>19)^(L<<3|k>>>29)^(k<<26|L>>>6))>>>0,U=e[T-15],k=U[0],L=U[1],s=((k>>>1|L<<31)^(k>>>8|L<<24)^k>>>7)>>>0,o=((k<<31|L>>>1)^(k<<24|L>>>8)^(k<<25|L>>>7))>>>0,R=e[T-7],q=e[T-16],L=i+R[1]+o+q[1],e[T][0]=n+R[0]+s+q[0]+(L/4294967296>>>0)>>>0,e[T][1]=L>>>0;for(m=t[0][0],g=t[0][1],y=t[1][0],x=t[1][1],b=t[2][0],I=t[2][1],v=t[3][0],_=t[3][1],P=t[4][0],D=t[4][1],G=t[5][0],W=t[5][1],z=t[6][0],ee=t[6][1],he=t[7][0],He=t[7][1],T=0;T<80;++T)u=((P>>>14|D<<18)^(P>>>18|D<<14)^(D>>>9|P<<23))>>>0,l=((P<<18|D>>>14)^(P<<14|D>>>18)^(D<<23|P>>>9))>>>0,f=(z^P&(G^z))>>>0,h=(ee^D&(W^ee))>>>0,a=((m>>>28|g<<4)^(g>>>2|m<<30)^(g>>>7|m<<25))>>>0,c=((m<<4|g>>>28)^(g<<30|m>>>2)^(g<<25|m>>>7))>>>0,p=(m&y|b&(m^y))>>>0,d=(g&x|I&(g^x))>>>0,L=He+l+h+Oc[T][1]+e[T][1],n=he+u+f+Oc[T][0]+e[T][0]+(L/4294967296>>>0)>>>0,i=L>>>0,L=c+d,s=a+p+(L/4294967296>>>0)>>>0,o=L>>>0,he=z,He=ee,z=G,ee=W,G=P,W=D,L=_+i,P=v+n+(L/4294967296>>>0)>>>0,D=L>>>0,v=b,_=I,b=y,I=x,y=m,x=g,L=i+o,m=n+s+(L/4294967296>>>0)>>>0,g=L>>>0;L=t[0][1]+g,t[0][0]=t[0][0]+m+(L/4294967296>>>0)>>>0,t[0][1]=L>>>0,L=t[1][1]+x,t[1][0]=t[1][0]+y+(L/4294967296>>>0)>>>0,t[1][1]=L>>>0,L=t[2][1]+I,t[2][0]=t[2][0]+b+(L/4294967296>>>0)>>>0,t[2][1]=L>>>0,L=t[3][1]+_,t[3][0]=t[3][0]+v+(L/4294967296>>>0)>>>0,t[3][1]=L>>>0,L=t[4][1]+D,t[4][0]=t[4][0]+P+(L/4294967296>>>0)>>>0,t[4][1]=L>>>0,L=t[5][1]+W,t[5][0]=t[5][0]+G+(L/4294967296>>>0)>>>0,t[5][1]=L>>>0,L=t[6][1]+ee,t[6][0]=t[6][0]+z+(L/4294967296>>>0)>>>0,t[6][1]=L>>>0,L=t[7][1]+He,t[7][0]=t[7][0]+he+(L/4294967296>>>0)>>>0,t[7][1]=L>>>0,H-=128}}});var eu=V((g4,Yh)=>{var $n=1e3,zn=$n*60,Hn=zn*60,on=Hn*24,Ab=on*7,Ib=on*365.25;Yh.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Rb(t);if(r==="number"&&isFinite(t))return e.long?Tb(t):Cb(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Rb(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Ib;case"weeks":case"week":case"w":return r*Ab;case"days":case"day":case"d":return r*on;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Hn;case"minutes":case"minute":case"mins":case"min":case"m":return r*zn;case"seconds":case"second":case"secs":case"sec":case"s":return r*$n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Cb(t){var e=Math.abs(t);return e>=on?Math.round(t/on)+"d":e>=Hn?Math.round(t/Hn)+"h":e>=zn?Math.round(t/zn)+"m":e>=$n?Math.round(t/$n)+"s":t+"ms"}function Tb(t){var e=Math.abs(t);return e>=on?Hs(t,e,on,"day"):e>=Hn?Hs(t,e,Hn,"hour"):e>=zn?Hs(t,e,zn,"minute"):e>=$n?Hs(t,e,$n,"second"):t+" ms"}function Hs(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var Xh=V((y4,Qh)=>{function Bb(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=eu(),r.destroy=u,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h{if(_==="%%")return"%";I++;let D=r.formatters[P];if(typeof D=="function"){let G=g[I];_=D.call(y,G),g.splice(I,1),I--}return _}),r.formatArgs.call(y,g),(y.log||r.log).apply(y,g)}return m.namespace=l,m.useColors=r.useColors(),m.color=r.selectColor(l),m.extend=n,m.destroy=r.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(p!==r.namespaces&&(p=r.namespaces,d=r.enabled(l)),d),set:g=>{h=g}}),typeof r.init=="function"&&r.init(m),m}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),p=h.length;for(f=0;f"-"+f)].join(",");return r.enable(""),l}function o(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f{xt.formatArgs=Pb;xt.save=Db;xt.load=Nb;xt.useColors=Lb;xt.storage=kb();xt.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();xt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Lb(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Pb(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Gs.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}xt.log=console.debug||console.log||(()=>{});function Db(t){try{t?xt.storage.setItem("debug",t):xt.storage.removeItem("debug")}catch{}}function Nb(){let t;try{t=xt.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function kb(){try{return localStorage}catch{}}Gs.exports=Xh()(xt);var{formatters:Ob}=Gs.exports;Ob.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var vd=V((J8,_u)=>{"use strict";var yw=Object.prototype.hasOwnProperty,ct="~";function qi(){}Object.create&&(qi.prototype=Object.create(null),new qi().__proto__||(ct=!1));function xw(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function Ed(t,e,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var s=new xw(r,n||t,i),o=ct?ct+e:e;return t._events[o]?t._events[o].fn?t._events[o]=[t._events[o],s]:t._events[o].push(s):(t._events[o]=s,t._eventsCount++),t}function no(t,e){--t._eventsCount===0?t._events=new qi:delete t._events[e]}function st(){this._events=new qi,this._eventsCount=0}st.prototype.eventNames=function(){var e=[],r,n;if(this._eventsCount===0)return e;for(n in r=this._events)yw.call(r,n)&&e.push(ct?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};st.prototype.listeners=function(e){var r=ct?ct+e:e,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i{"use strict";function Vd(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function kw(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return Vd(t,r)}catch{r.message=t.message,r.stack=t.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(t)),Vd(new i,r)}}$d.exports=kw});var Qd=V(Yi=>{(function(){var t,e,r,n,i,s,o,a;a=function(c){var u,l,f,h;return u=(c&255<<24)>>>24,l=(c&255<<16)>>>16,f=(c&65280)>>>8,h=c&255,[u,l,f,h].join(".")},o=function(c){var u,l,f,h,p,d;for(u=[],f=h=0;h<=3&&c.length!==0;f=++h){if(f>0){if(c[0]!==".")throw new Error("Invalid IP");c=c.substring(1)}d=e(c),p=d[0],l=d[1],c=c.substring(l),u.push(p)}if(c.length!==0)throw new Error("Invalid IP");switch(u.length){case 1:if(u[0]>4294967295)throw new Error("Invalid IP");return u[0]>>>0;case 2:if(u[0]>255||u[1]>16777215)throw new Error("Invalid IP");return(u[0]<<24|u[1])>>>0;case 3:if(u[0]>255||u[1]>255||u[2]>65535)throw new Error("Invalid IP");return(u[0]<<24|u[1]<<16|u[2])>>>0;case 4:if(u[0]>255||u[1]>255||u[2]>255||u[3]>255)throw new Error("Invalid IP");return(u[0]<<24|u[1]<<16|u[2]<<8|u[3])>>>0;default:throw new Error("Invalid IP")}},r=function(c){return c.charCodeAt(0)},n=r("0"),s=r("a"),i=r("A"),e=function(c){var u,l,f,h,p;for(h=0,u=10,l="9",f=0,c.length>1&&c[f]==="0"&&(c[f+1]==="x"||c[f+1]==="X"?(f+=2,u=16):"0"<=c[f+1]&&c[f+1]<="9"&&(f++,u=8,l="7")),p=f;f>>0;else if(u===16)if("a"<=c[f]&&c[f]<="f")h=h*u+(10+r(c[f])-s)>>>0;else if("A"<=c[f]&&c[f]<="F")h=h*u+(10+r(c[f])-i)>>>0;else break;else break;if(h>4294967295)throw new Error("too large");f++}if(f===p)throw new Error("empty octet");return[h,f]},t=function(){function c(u,l){var f,h,p,d;if(typeof u!="string")throw new Error("Missing `net' parameter");if(l||(d=u.split("/",2),u=d[0],l=d[1]),l||(l=32),typeof l=="string"&&l.indexOf(".")>-1){try{this.maskLong=o(l)}catch(m){throw f=m,new Error("Invalid mask: "+l)}for(h=p=32;p>=0;h=--p)if(this.maskLong===4294967295<<32-h>>>0){this.bitmask=h;break}}else if(l||l===0)this.bitmask=parseInt(l,10),this.maskLong=0,this.bitmask>0&&(this.maskLong=4294967295<<32-this.bitmask>>>0);else throw new Error("Invalid mask: empty");try{this.netLong=(o(u)&this.maskLong)>>>0}catch(m){throw f=m,new Error("Invalid net address: "+u)}if(!(this.bitmask<=32))throw new Error("Invalid mask for ip4: "+l);this.size=Math.pow(2,32-this.bitmask),this.base=a(this.netLong),this.mask=a(this.maskLong),this.hostmask=a(~this.maskLong),this.first=this.bitmask<=30?a(this.netLong+1):this.base,this.last=this.bitmask<=30?a(this.netLong+this.size-2):a(this.netLong+this.size-1),this.broadcast=this.bitmask<=30?a(this.netLong+this.size-1):void 0}return c.prototype.contains=function(u){return typeof u=="string"&&(u.indexOf("/")>0||u.split(".").length!==4)&&(u=new c(u)),u instanceof c?this.contains(u.base)&&this.contains(u.broadcast||u.last):(o(u)&this.maskLong)>>>0===(this.netLong&this.maskLong)>>>0},c.prototype.next=function(u){return u==null&&(u=1),new c(a(this.netLong+this.size*u),this.mask)},c.prototype.forEach=function(u){var l,f,h;for(h=o(this.first),f=o(this.last),l=0;h<=f;)u(a(h),h,l),l++,h++},c.prototype.toString=function(){return this.base+"/"+this.bitmask},c}(),Yi.ip2long=o,Yi.long2ip=a,Yi.Netmask=t}).call(Yi)});var Jd=V((jd,Ro)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",o="(?:[0-9a-f]+::?)+",a={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${o})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${o})|(?:::)(?:${o})?)${e}\\.${e}\\.${e}\\.${e}(${s})?$`,"i")};function c(p,d){if(p.indexOf("::")!==p.lastIndexOf("::"))return null;let m=0,g=-1,y=(p.match(a.zoneIndex)||[])[0],x,b;for(y&&(y=y.substring(1),p=p.replace(/%.+$/,""));(g=p.indexOf(":",g+1))>=0;)m++;if(p.substr(0,2)==="::"&&m--,p.substr(-2,2)==="::"&&m--,m>d)return null;for(b=d-m,x=":";b--;)x+="0:";return p=p.replace("::",x),p[0]===":"&&(p=p.slice(1)),p[p.length-1]===":"&&(p=p.slice(0,-1)),d=function(){let I=p.split(":"),v=[];for(let _=0;_0;){if(x=m-g,x<0&&(x=0),p[y]>>x!==d[y]>>x)return!1;g-=m,y+=1}return!0}function l(p){if(i.test(p))return parseInt(p,16);if(p[0]==="0"&&!isNaN(parseInt(p[1],10))){if(n.test(p))return parseInt(p,8);throw new Error(`ipaddr: cannot parse ${p} as octal`)}return parseInt(p,10)}function f(p,d){for(;p.length=0;y-=1)if(x=this.octets[y],x in g){if(b=g[x],m&&b!==0)return null;b!==8&&(m=!0),d+=b}else return null;return 32-d},p.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){return this.octets.slice(0)},p.prototype.toIPv4MappedAddress=function(){return h.IPv6.parse(`::ffff:${this.toString()}`)},p.prototype.toNormalizedString=function(){return this.toString()},p.prototype.toString=function(){return this.octets.join(".")},p}(),h.IPv4.broadcastAddressFromCIDR=function(p){try{let d=this.parseCIDR(p),m=d[0].toByteArray(),g=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),y=[],x=0;for(;x<4;)y.push(parseInt(m[x],10)|parseInt(g[x],10)^255),x++;return new this(y)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.isIPv4=function(p){return this.parser(p)!==null},h.IPv4.isValid=function(p){try{return new this(this.parser(p)),!0}catch{return!1}},h.IPv4.isValidFourPartDecimal=function(p){return!!(h.IPv4.isValid(p)&&p.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},h.IPv4.networkAddressFromCIDR=function(p){let d,m,g,y,x;try{for(d=this.parseCIDR(p),g=d[0].toByteArray(),x=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),y=[],m=0;m<4;)y.push(parseInt(g[m],10)&parseInt(x[m],10)),m++;return new this(y)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.parse=function(p){let d=this.parser(p);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},h.IPv4.parseCIDR=function(p){let d;if(d=p.match(/^(.+)\/(\d+)$/)){let m=parseInt(d[2]);if(m>=0&&m<=32){let g=[this.parse(d[1]),m];return Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},h.IPv4.parser=function(p){let d,m,g;if(d=p.match(r.fourOctet))return function(){let y=d.slice(1,6),x=[];for(let b=0;b4294967295||g<0)throw new Error("ipaddr: address outside defined range");return function(){let y=[],x;for(x=0;x<=24;x+=8)y.push(g>>x&255);return y}().reverse()}else return(d=p.match(r.twoOctet))?function(){let y=d.slice(1,4),x=[];if(g=l(y[1]),g>16777215||g<0)throw new Error("ipaddr: address outside defined range");return x.push(l(y[0])),x.push(g>>16&255),x.push(g>>8&255),x.push(g&255),x}():(d=p.match(r.threeOctet))?function(){let y=d.slice(1,5),x=[];if(g=l(y[2]),g>65535||g<0)throw new Error("ipaddr: address outside defined range");return x.push(l(y[0])),x.push(l(y[1])),x.push(g>>8&255),x.push(g&255),x}():null},h.IPv4.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],m=0,g=Math.floor(p/8);for(;m=0;b-=1)if(y=this.parts[b],y in g){if(x=g[y],m&&x!==0)return null;x!==16&&(m=!0),d+=x}else return null;return 128-d},p.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){let d,m=[],g=this.parts;for(let y=0;y>8),m.push(d&255);return m},p.prototype.toFixedLengthString=function(){let d=function(){let g=[];for(let y=0;y>8,m&255,g>>8,g&255])},p.prototype.toNormalizedString=function(){let d=function(){let g=[];for(let y=0;yy&&(g=x.index,y=x[0].length);return y<0?m:`${m.substring(0,g)}::${m.substring(g+y)}`},p.prototype.toString=function(){return this.toRFC5952String()},p}(),h.IPv6.broadcastAddressFromCIDR=function(p){try{let d=this.parseCIDR(p),m=d[0].toByteArray(),g=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),y=[],x=0;for(;x<16;)y.push(parseInt(m[x],10)|parseInt(g[x],10)^255),x++;return new this(y)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},h.IPv6.isIPv6=function(p){return this.parser(p)!==null},h.IPv6.isValid=function(p){if(typeof p=="string"&&p.indexOf(":")===-1)return!1;try{let d=this.parser(p);return new this(d.parts,d.zoneId),!0}catch{return!1}},h.IPv6.networkAddressFromCIDR=function(p){let d,m,g,y,x;try{for(d=this.parseCIDR(p),g=d[0].toByteArray(),x=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),y=[],m=0;m<16;)y.push(parseInt(g[m],10)&parseInt(x[m],10)),m++;return new this(y)}catch(b){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${b})`)}},h.IPv6.parse=function(p){let d=this.parser(p);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},h.IPv6.parseCIDR=function(p){let d,m,g;if((m=p.match(/^(.+)\/(\d+)$/))&&(d=parseInt(m[2]),d>=0&&d<=128))return g=[this.parse(m[1]),d],Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},h.IPv6.parser=function(p){let d,m,g,y,x,b;if(g=p.match(a.deprecatedTransitional))return this.parser(`::ffff:${g[1]}`);if(a.native.test(p))return c(p,8);if((g=p.match(a.transitional))&&(b=g[6]||"",d=c(g[1].slice(0,-1)+b,6),d.parts)){for(x=[parseInt(g[2]),parseInt(g[3]),parseInt(g[4]),parseInt(g[5])],m=0;m128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m=0,g=Math.floor(p/8);for(;m{"use strict";mp.exports=pp;var rE=eu(),Fr=pp.prototype,nE=new Date%1e9;function iE(){return(Math.random()*1e9>>>0)+nE++}function pp(t){t=t||{},this.id=t.id||iE(),this.max=t.max||1/0,this.items=t.items||[],this._lookup={},this.size=this.items.length,this.lastModified=new Date(t.lastModified||new Date);for(var e,r,n=this.items.length;n--;)e=this.items[n],r=new Date(e.expires)-new Date,this._lookup[e.key]=e,r>0?this.expire(e.key,r):r<=0&&this.delete(e.key)}Fr.has=function(t){return t in this._lookup};Fr.get=function(t){if(!this.has(t))return null;var e=this._lookup[t];return e.refresh&&this.expire(t,e.refresh),this.items.splice(this.items.indexOf(e),1),this.items.push(e),e.value};Fr.meta=function(t){if(!this.has(t))return null;var e=this._lookup[t];return"meta"in e?e.meta:null};Fr.set=function(t,e,r){var n=this._lookup[t],i=this._lookup[t]={key:t,value:e};return this.lastModified=new Date,n?(clearTimeout(n.timeout),this.items.splice(this.items.indexOf(n),1,i)):(this.size>=this.max&&this.delete(this.items[0].key),this.items.push(i),this.size++),r&&("ttl"in r&&this.expire(t,r.ttl),"meta"in r&&(i.meta=r.meta),r.refresh&&(i.refresh=r.ttl)),this};Fr.delete=function(t){var e=this._lookup[t];return e?(this.lastModified=new Date,this.items.splice(this.items.indexOf(e),1),clearTimeout(e.timeout),delete this._lookup[t],this.size--,this):!1};Fr.expire=function(t,e){var r=e||0,n=this._lookup[t];if(!n)return this;if(typeof r=="string"&&(r=rE(e)),typeof r!="number")throw new TypeError("Expiration time must be a string or number.");return clearTimeout(n.timeout),n.timeout=setTimeout(this.delete.bind(this,n.key),r),n.expires=Number(new Date)+r,this};Fr.clear=function(){for(var t=this.items.length;t--;)this.delete(this.items[t].key);return this};Fr.toJSON=function(){for(var t=new Array(this.items.length),e,r=t.length;r--;)e=this.items[r],t[r]={key:e.key,meta:e.meta,value:e.value,expires:e.expires,refresh:e.refresh};return{id:this.id,max:isFinite(this.max)?this.max:void 0,lastModified:this.lastModified,items:t}}});var Ep=V((I3,wp)=>{"use strict";wp.exports=t=>{if(Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}});var Rp=V((Ap,Ip)=>{"use strict";var ko=Ep(),{hasOwnProperty:_p}=Object.prototype,{propertyIsEnumerable:aE}=Object,ni=(t,e,r)=>Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0}),cE=Ap,vp={concatArrays:!1,ignoreUndefined:!1},Oo=t=>{let e=[];for(let r in t)_p.call(t,r)&&e.push(r);if(Object.getOwnPropertySymbols){let r=Object.getOwnPropertySymbols(t);for(let n of r)aE.call(t,n)&&e.push(n)}return e};function ii(t){return Array.isArray(t)?uE(t):ko(t)?lE(t):t}function uE(t){let e=t.slice(0,0);return Oo(t).forEach(r=>{ni(e,r,ii(t[r]))}),e}function lE(t){let e=Object.getPrototypeOf(t)===null?Object.create(null):{};return Oo(t).forEach(r=>{ni(e,r,ii(t[r]))}),e}var Sp=(t,e,r,n)=>(r.forEach(i=>{typeof e[i]>"u"&&n.ignoreUndefined||(i in t&&t[i]!==Object.getPrototypeOf(t)?ni(t,i,ul(t[i],e[i],n)):ni(t,i,ii(e[i])))}),t),fE=(t,e,r)=>{let n=t.slice(0,0),i=0;return[t,e].forEach(s=>{let o=[];for(let a=0;a!o.includes(a)),r)}),n};function ul(t,e,r){return r.concatArrays&&Array.isArray(t)&&Array.isArray(e)?fE(t,e,r):!ko(e)||!ko(t)?ii(e):Sp(t,e,Oo(e),r)}Ip.exports=function(...t){let e=ul(ii(vp),this!==cE&&this||{},vp),r={_:{}};for(let n of t)if(n!==void 0){if(!ko(n))throw new TypeError("`"+n+"` is not an Option Object");r=ul(r,{_:n},e)}return r._}});var ji=V((U3,Lp)=>{Lp.exports=class{constructor(e={}){this.points=e.points,this.duration=e.duration,this.blockDuration=e.blockDuration,this.execEvenly=e.execEvenly,this.execEvenlyMinDelayMs=e.execEvenlyMinDelayMs,this.keyPrefix=e.keyPrefix}get points(){return this._points}set points(e){this._points=e>=0?e:4}get duration(){return this._duration}set duration(e){this._duration=typeof e>"u"?1:e}get msDuration(){return this.duration*1e3}get blockDuration(){return this._blockDuration}set blockDuration(e){this._blockDuration=typeof e>"u"?0:e}get msBlockDuration(){return this.blockDuration*1e3}get execEvenly(){return this._execEvenly}set execEvenly(e){this._execEvenly=typeof e>"u"?!1:!!e}get execEvenlyMinDelayMs(){return this._execEvenlyMinDelayMs}set execEvenlyMinDelayMs(e){this._execEvenlyMinDelayMs=typeof e>"u"?Math.ceil(this.msDuration/this.points):e}get keyPrefix(){return this._keyPrefix}set keyPrefix(e){if(typeof e>"u"&&(e="rlflx"),typeof e!="string")throw new Error("keyPrefix must be string");this._keyPrefix=e}_getKeySecDuration(e={}){return e&&e.customDuration>=0?e.customDuration:this.duration}getKey(e){return this.keyPrefix.length>0?`${this.keyPrefix}:${e}`:e}parseKey(e){return e.substring(this.keyPrefix.length)}consume(){throw new Error("You have to implement the method 'consume'!")}penalty(){throw new Error("You have to implement the method 'penalty'!")}reward(){throw new Error("You have to implement the method 'reward'!")}get(){throw new Error("You have to implement the method 'get'!")}set(){throw new Error("You have to implement the method 'set'!")}block(){throw new Error("You have to implement the method 'block'!")}delete(){throw new Error("You have to implement the method 'delete'!")}}});var Dp=V((K3,Pp)=>{Pp.exports=class{constructor(){this._keys={},this._addedKeysAmount=0}collectExpired(){let e=Date.now();Object.keys(this._keys).forEach(r=>{this._keys[r]<=e&&delete this._keys[r]}),this._addedKeysAmount=Object.keys(this._keys).length}add(e,r){this.addMs(e,r*1e3)}addMs(e,r){this._keys[e]=Date.now()+r,this._addedKeysAmount++,this._addedKeysAmount>999&&this.collectExpired()}msBeforeExpire(e){let r=this._keys[e];if(r&&r>=Date.now()){this.collectExpired();let n=Date.now();return r>=n?r-n:0}return 0}delete(e){e?delete this._keys[e]:Object.keys(this._keys).forEach(r=>{delete this._keys[r]})}}});var kp=V((q3,Np)=>{var dE=Dp();Np.exports=dE});var _t=V(($3,Op)=>{Op.exports=class{constructor(e,r,n,i){this.remainingPoints=typeof e>"u"?0:e,this.msBeforeNext=typeof r>"u"?0:r,this.consumedPoints=typeof n>"u"?0:n,this.isFirstInDuration=typeof i>"u"?!1:i}get msBeforeNext(){return this._msBeforeNext}set msBeforeNext(e){return this._msBeforeNext=e,this}get remainingPoints(){return this._remainingPoints}set remainingPoints(e){return this._remainingPoints=e,this}get consumedPoints(){return this._consumedPoints}set consumedPoints(e){return this._consumedPoints=e,this}get isFirstInDuration(){return this._isFirstInDuration}set isFirstInDuration(e){this._isFirstInDuration=!!e}_getDecoratedProperties(){return{remainingPoints:this.remainingPoints,msBeforeNext:this.msBeforeNext,consumedPoints:this.consumedPoints,isFirstInDuration:this.isFirstInDuration}}[Symbol.for("nodejs.util.inspect.custom")](){return this._getDecoratedProperties()}toString(){return JSON.stringify(this._getDecoratedProperties())}toJSON(){return this._getDecoratedProperties()}}});var si=V((H3,Up)=>{var ll=ji(),pE=kp(),Mp=_t();Up.exports=class extends ll{constructor(e={}){super(e),this.inMemoryBlockOnConsumed=e.inMemoryBlockOnConsumed,this.inMemoryBlockDuration=e.inMemoryBlockDuration,this.insuranceLimiter=e.insuranceLimiter,this._inMemoryBlockedKeys=new pE}get client(){return this._client}set client(e){if(typeof e>"u")throw new Error("storeClient is not set");this._client=e}_afterConsume(e,r,n,i,s,o={}){let a=this._getRateLimiterRes(n,i,s);if(this.inMemoryBlockOnConsumed>0&&!(this.inMemoryBlockDuration>0)&&a.consumedPoints>=this.inMemoryBlockOnConsumed)return this._inMemoryBlockedKeys.addMs(n,a.msBeforeNext),a.consumedPoints>this.points?r(a):e(a);if(a.consumedPoints>this.points){let c=Promise.resolve();this.blockDuration>0&&a.consumedPoints<=this.points+i&&(a.msBeforeNext=this.msBlockDuration,c=this._block(n,a.consumedPoints,this.msBlockDuration,o)),this.inMemoryBlockOnConsumed>0&&a.consumedPoints>=this.inMemoryBlockOnConsumed&&(this._inMemoryBlockedKeys.add(n,this.inMemoryBlockDuration),a.msBeforeNext=this.msInMemoryBlockDuration),c.then(()=>{r(a)}).catch(u=>{r(u)})}else if(this.execEvenly&&a.msBeforeNext>0&&!a.isFirstInDuration){let c=Math.ceil(a.msBeforeNext/(a.remainingPoints+2));c{n(c)}).catch(c=>{i(c)}):i(e)}getInMemoryBlockMsBeforeExpire(e){return this.inMemoryBlockOnConsumed>0?this._inMemoryBlockedKeys.msBeforeExpire(e):0}get inMemoryBlockOnConsumed(){return this._inMemoryBlockOnConsumed}set inMemoryBlockOnConsumed(e){if(this._inMemoryBlockOnConsumed=e?parseInt(e):0,this.inMemoryBlockOnConsumed>0&&this.points>this.inMemoryBlockOnConsumed)throw new Error('inMemoryBlockOnConsumed option must be greater or equal "points" option')}get inMemoryBlockDuration(){return this._inMemoryBlockDuration}set inMemoryBlockDuration(e){if(this._inMemoryBlockDuration=e?parseInt(e):0,this.inMemoryBlockDuration>0&&this.inMemoryBlockOnConsumed===0)throw new Error("inMemoryBlockOnConsumed option must be set up")}get msInMemoryBlockDuration(){return this._inMemoryBlockDuration*1e3}get insuranceLimiter(){return this._insuranceLimiter}set insuranceLimiter(e){if(typeof e<"u"&&!(e instanceof ll))throw new Error("insuranceLimiter must be instance of RateLimiterAbstract");this._insuranceLimiter=e,this._insuranceLimiter&&(this._insuranceLimiter.blockDuration=this.blockDuration,this._insuranceLimiter.execEvenly=this.execEvenly)}block(e,r,n={}){let i=r*1e3;return this._block(this.getKey(e),this.points+1,i,n)}set(e,r,n,i={}){let s=(n>=0?n:this.duration)*1e3;return this._block(this.getKey(e),r,s,i)}consume(e,r=1,n={}){return new Promise((i,s)=>{let o=this.getKey(e),a=this.getInMemoryBlockMsBeforeExpire(o);if(a>0)return s(new Mp(0,a));this._upsert(o,r,this._getKeySecDuration(n)*1e3,!1,n).then(c=>{this._afterConsume(i,s,o,r,c)}).catch(c=>{this._handleError(c,"consume",i,s,e,r,n)})})}penalty(e,r=1,n={}){let i=this.getKey(e);return new Promise((s,o)=>{this._upsert(i,r,this._getKeySecDuration(n)*1e3,!1,n).then(a=>{s(this._getRateLimiterRes(i,r,a))}).catch(a=>{this._handleError(a,"penalty",s,o,e,r,n)})})}reward(e,r=1,n={}){let i=this.getKey(e);return new Promise((s,o)=>{this._upsert(i,-r,this._getKeySecDuration(n)*1e3,!1,n).then(a=>{s(this._getRateLimiterRes(i,-r,a))}).catch(a=>{this._handleError(a,"reward",s,o,e,r,n)})})}get(e,r={}){let n=this.getKey(e);return new Promise((i,s)=>{this._get(n,r).then(o=>{i(o===null||typeof o>"u"?null:this._getRateLimiterRes(n,0,o))}).catch(o=>{this._handleError(o,"get",i,s,e,r)})})}delete(e,r={}){let n=this.getKey(e);return new Promise((i,s)=>{this._delete(n,r).then(o=>{this._inMemoryBlockedKeys.delete(n),i(o)}).catch(o=>{this._handleError(o,"delete",i,s,e,r)})})}deleteInMemoryBlockedAll(){this._inMemoryBlockedKeys.delete()}_getRateLimiterRes(e,r,n){throw new Error("You have to implement the method '_getRateLimiterRes'!")}_block(e,r,n,i={}){return new Promise((s,o)=>{this._upsert(e,r,n,!0,i).then(()=>{s(new Mp(0,n>0?n:-1,r))}).catch(a=>{this._handleError(a,"block",s,o,this.parseKey(e),n/1e3,i)})})}_get(e,r={}){throw new Error("You have to implement the method '_get'!")}_delete(e,r={}){throw new Error("You have to implement the method '_delete'!")}_upsert(e,r,n,i=!1,s={}){throw new Error("You have to implement the method '_upsert'!")}}});var Kp=V((G3,Fp)=>{var mE=si(),gE=_t(),fl="redis.call('set', KEYS[1], 0, 'EX', ARGV[2], 'NX') local consumed = redis.call('incrby', KEYS[1], ARGV[1]) local ttl = redis.call('pttl', KEYS[1]) if ttl == -1 then redis.call('expire', KEYS[1], ARGV[2]) ttl = 1000 * ARGV[2] end return {consumed, ttl} ",hl=class extends mE{constructor(e){super(e),this.client=e.storeClient,this._rejectIfRedisNotReady=!!e.rejectIfRedisNotReady,this.useRedisPackage=e.useRedisPackage||this.client.constructor.name==="Commander"||!1,this.useRedis3AndLowerPackage=e.useRedis3AndLowerPackage,typeof this.client.defineCommand=="function"&&this.client.defineCommand("rlflxIncr",{numberOfKeys:1,lua:fl})}_isRedisReady(){return this._rejectIfRedisNotReady?!(this.client.status&&this.client.status!=="ready"||typeof this.client.isReady=="function"&&!this.client.isReady()):!0}_getRateLimiterRes(e,r,n){let[i,s]=n;Array.isArray(i)&&([,i]=i,[,s]=s);let o=new gE;return o.consumedPoints=parseInt(i),o.isFirstInDuration=o.consumedPoints===r,o.remainingPoints=Math.max(this.points-o.consumedPoints,0),o.msBeforeNext=s,o}async _upsert(e,r,n,i=!1){if(!this._isRedisReady())throw new Error("Redis connection is not ready");let s=Math.floor(n/1e3),o=this.client.multi();return i?(s>0?!this.useRedisPackage&&!this.useRedis3AndLowerPackage?o.set(e,r,"EX",s):o.set(e,r,{EX:s}):o.set(e,r),!this.useRedisPackage&&!this.useRedis3AndLowerPackage?o.pttl(e).exec(!0):o.pTTL(e).exec(!0)):s>0?!this.useRedisPackage&&!this.useRedis3AndLowerPackage?this.client.rlflxIncr([e].concat([String(r),String(s)])):this.useRedis3AndLowerPackage?new Promise((a,c)=>{let u=function(l,f){return l?c(l):a(f)};typeof this.client.rlflxIncr=="function"?this.client.rlflxIncr(e,r,s,u):this.client.eval(fl,1,e,r,s,u)}):this.client.eval(fl,{keys:[e],arguments:[String(r),String(s)]}):!this.useRedisPackage&&!this.useRedis3AndLowerPackage?o.incrby(e,r).pttl(e).exec(!0):o.incrBy(e,r).pTTL(e).exec(!0)}async _get(e){if(!this._isRedisReady())throw new Error("Redis connection is not ready");return!this.useRedisPackage&&!this.useRedis3AndLowerPackage?this.client.multi().get(e).pttl(e).exec().then(r=>{let[[,n]]=r;return n===null?null:r}):this.client.multi().get(e).pTTL(e).exec(!0).then(r=>{let[n]=r;return n===null?null:r})}_delete(e){return this.client.del(e).then(r=>r>0)}};Fp.exports=hl});var $p=V((W3,Vp)=>{var yE=si(),xE=_t();function qp(t){try{let e=t.client?t.client:t,{version:r}=e.topology.s.options.metadata.driver,n=r.split(".").map(i=>parseInt(i));return{major:n[0],feature:n[1],patch:n[2]}}catch{return{major:0,feature:0,patch:0}}}var dl=class t extends yE{constructor(e){super(e),this.dbName=e.dbName,this.tableName=e.tableName,this.indexKeyPrefix=e.indexKeyPrefix,e.mongo?this.client=e.mongo:this.client=e.storeClient,typeof this.client.then=="function"?this.client.then(r=>{this.client=r,this._initCollection(),this._driverVersion=qp(this.client)}):(this._initCollection(),this._driverVersion=qp(this.client))}get dbName(){return this._dbName}set dbName(e){this._dbName=typeof e>"u"?t.getDbName():e}static getDbName(){return"node-rate-limiter-flexible"}get tableName(){return this._tableName}set tableName(e){this._tableName=typeof e>"u"?this.keyPrefix:e}get client(){return this._client}set client(e){if(typeof e>"u")throw new Error("mongo is not set");this._client=e}get indexKeyPrefix(){return this._indexKeyPrefix}set indexKeyPrefix(e){this._indexKeyPrefix=e||{}}_initCollection(){let r=(typeof this.client.db=="function"?this.client.db(this.dbName):this.client).collection(this.tableName);r.createIndex({expire:-1},{expireAfterSeconds:0}),r.createIndex(Object.assign({},this.indexKeyPrefix,{key:1}),{unique:!0}),this._collection=r}_getRateLimiterRes(e,r,n){let i=new xE,s;return typeof n.value>"u"?s=n:s=n.value,i.isFirstInDuration=s.points===r,i.consumedPoints=s.points,i.remainingPoints=Math.max(this.points-i.consumedPoints,0),i.msBeforeNext=s.expire!==null?Math.max(new Date(s.expire).getTime()-Date.now(),0):-1,i}_upsert(e,r,n,i=!1,s={}){if(!this._collection)return Promise.reject(Error("Mongo connection is not established"));let o=s.attrs||{},a,c;i?(a={key:e},a=Object.assign(a,o),c={$set:{key:e,points:r,expire:n>0?new Date(Date.now()+n):null}},c.$set=Object.assign(c.$set,o)):(a={$or:[{expire:{$gt:new Date}},{expire:{$eq:null}}],key:e},a=Object.assign(a,o),c={$setOnInsert:{key:e,expire:n>0?new Date(Date.now()+n):null},$inc:{points:r}},c.$setOnInsert=Object.assign(c.$setOnInsert,o));let u={upsert:!0};return this._driverVersion.major>=4||this._driverVersion.major===3&&this._driverVersion.feature>=7||this._driverVersion.feature>=6&&this._driverVersion.patch>=7?u.returnDocument="after":u.returnOriginal=!1,new Promise((l,f)=>{this._collection.findOneAndUpdate(a,c,u).then(h=>{l(h)}).catch(h=>{if(h&&h.code===11e3){let p=Object.assign({$or:[{expire:{$lte:new Date}},{expire:{$eq:null}}],key:e},o),d={$set:Object.assign({key:e,points:r,expire:n>0?new Date(Date.now()+n):null},o)};this._collection.findOneAndUpdate(p,d,u).then(m=>{l(m)}).catch(m=>{m&&m.code===11e3?this._upsert(e,r,n,i).then(g=>l(g)).catch(g=>f(g)):f(m)})}else f(h)})})}_get(e,r={}){if(!this._collection)return Promise.reject(Error("Mongo connection is not established"));let n=r.attrs||{},i=Object.assign({key:e,$or:[{expire:{$gt:new Date}},{expire:{$eq:null}}]},n);return this._collection.findOne(i)}_delete(e,r={}){if(!this._collection)return Promise.reject(Error("Mongo connection is not established"));let n=r.attrs||{},i=Object.assign({key:e},n);return this._collection.deleteOne(i).then(s=>s.deletedCount>0)}};Vp.exports=dl});var Hp=V((Y3,zp)=>{var bE=si(),wE=_t(),pl=class extends bE{constructor(e,r=null){super(e),this.client=e.storeClient,this.clientType=e.storeType,this.dbName=e.dbName,this.tableName=e.tableName,this.clearExpiredByTimeout=e.clearExpiredByTimeout,this.tableCreated=e.tableCreated,this.tableCreated?(this.clearExpiredByTimeout&&this._clearExpiredHourAgo(),typeof r=="function"&&r()):this._createDbAndTable().then(()=>{this.tableCreated=!0,this.clearExpiredByTimeout&&this._clearExpiredHourAgo(),typeof r=="function"&&r()}).catch(n=>{if(typeof r=="function")r(n);else throw n})}clearExpired(e){return new Promise(r=>{this._getConnection().then(n=>{n.query("DELETE FROM ??.?? WHERE expire < ?",[this.dbName,this.tableName,e],()=>{this._releaseConnection(n),r()})}).catch(()=>{r()})})}_clearExpiredHourAgo(){this._clearExpiredTimeoutId&&clearTimeout(this._clearExpiredTimeoutId),this._clearExpiredTimeoutId=setTimeout(()=>{this.clearExpired(Date.now()-36e5).then(()=>{this._clearExpiredHourAgo()})},3e5),this._clearExpiredTimeoutId.unref()}_getConnection(){switch(this.clientType){case"pool":return new Promise((e,r)=>{this.client.getConnection((n,i)=>{if(n)return r(n);e(i)})});case"sequelize":return this.client.connectionManager.getConnection();case"knex":return this.client.client.acquireConnection();default:return Promise.resolve(this.client)}}_releaseConnection(e){switch(this.clientType){case"pool":return e.release();case"sequelize":return this.client.connectionManager.releaseConnection(e);case"knex":return this.client.client.releaseConnection(e);default:return!0}}_createDbAndTable(){return new Promise((e,r)=>{this._getConnection().then(n=>{n.query(`CREATE DATABASE IF NOT EXISTS \`${this.dbName}\`;`,i=>{if(i)return this._releaseConnection(n),r(i);n.query(this._getCreateTableStmt(),s=>{if(s)return this._releaseConnection(n),r(s);this._releaseConnection(n),e()})})}).catch(n=>{r(n)})})}_getCreateTableStmt(){return`CREATE TABLE IF NOT EXISTS \`${this.dbName}\`.\`${this.tableName}\` (\`key\` VARCHAR(255) CHARACTER SET utf8 NOT NULL,\`points\` INT(9) NOT NULL default 0,\`expire\` BIGINT UNSIGNED,PRIMARY KEY (\`key\`)) ENGINE = INNODB;`}get clientType(){return this._clientType}set clientType(e){if(typeof e>"u")if(this.client.constructor.name==="Connection")e="connection";else if(this.client.constructor.name==="Pool")e="pool";else if(this.client.constructor.name==="Sequelize")e="sequelize";else throw new Error("storeType is not defined");this._clientType=e.toLowerCase()}get dbName(){return this._dbName}set dbName(e){this._dbName=typeof e>"u"?"rtlmtrflx":e}get tableName(){return this._tableName}set tableName(e){this._tableName=typeof e>"u"?this.keyPrefix:e}get tableCreated(){return this._tableCreated}set tableCreated(e){this._tableCreated=typeof e>"u"?!1:!!e}get clearExpiredByTimeout(){return this._clearExpiredByTimeout}set clearExpiredByTimeout(e){this._clearExpiredByTimeout=typeof e>"u"?!0:!!e}_getRateLimiterRes(e,r,n){let i=new wE,[s]=n;return i.isFirstInDuration=r===s.points,i.consumedPoints=i.isFirstInDuration?r:s.points,i.remainingPoints=Math.max(this.points-i.consumedPoints,0),i.msBeforeNext=s.expire?Math.max(s.expire-Date.now(),0):-1,i}_upsertTransaction(e,r,n,i,s){return new Promise((o,a)=>{e.query("BEGIN",c=>{if(c)return e.rollback(),a(c);let u=Date.now(),l=i>0?u+i:null,f,h;s?(f=`INSERT INTO ??.?? VALUES (?, ?, ?) - ON DUPLICATE KEY UPDATE - points = ?, - expire = ?;`,h=[this.dbName,this.tableName,r,n,l,n,l]):(f=`INSERT INTO ??.?? VALUES (?, ?, ?) - ON DUPLICATE KEY UPDATE - points = IF(expire <= ?, ?, points + (?)), - expire = IF(expire <= ?, ?, expire);`,h=[this.dbName,this.tableName,r,n,l,u,n,n,u,l]),e.query(f,h,p=>{if(p)return e.rollback(),a(p);e.query("SELECT points, expire FROM ??.?? WHERE `key` = ?;",[this.dbName,this.tableName,r],(d,m)=>{if(d)return e.rollback(),a(d);e.query("COMMIT",g=>{if(g)return e.rollback(),a(g);o(m)})})})})})}_upsert(e,r,n,i=!1){return this.tableCreated?new Promise((s,o)=>{this._getConnection().then(a=>{this._upsertTransaction(a,e,r,n,i).then(c=>{s(c),this._releaseConnection(a)}).catch(c=>{o(c),this._releaseConnection(a)})}).catch(a=>{o(a)})}):Promise.reject(Error("Table is not created yet"))}_get(e){return this.tableCreated?new Promise((r,n)=>{this._getConnection().then(i=>{i.query("SELECT points, expire FROM ??.?? WHERE `key` = ? AND (`expire` > ? OR `expire` IS NULL)",[this.dbName,this.tableName,e,Date.now()],(s,o)=>{s?n(s):o.length===0?r(null):r(o),this._releaseConnection(i)})}).catch(i=>{n(i)})}):Promise.reject(Error("Table is not created yet"))}_delete(e){return this.tableCreated?new Promise((r,n)=>{this._getConnection().then(i=>{i.query("DELETE FROM ??.?? WHERE `key` = ?",[this.dbName,this.tableName,e],(s,o)=>{s?n(s):r(o.affectedRows>0),this._releaseConnection(i)})}).catch(i=>{n(i)})}):Promise.reject(Error("Table is not created yet"))}};zp.exports=pl});var Wp=V((Q3,Gp)=>{var EE=si(),vE=_t(),ml=class extends EE{constructor(e,r=null){super(e),this.client=e.storeClient,this.clientType=e.storeType,this.tableName=e.tableName,this.schemaName=e.schemaName,this.clearExpiredByTimeout=e.clearExpiredByTimeout,this.tableCreated=e.tableCreated,this.tableCreated?(this.clearExpiredByTimeout&&this._clearExpiredHourAgo(),typeof r=="function"&&r()):this._createTable().then(()=>{this.tableCreated=!0,this.clearExpiredByTimeout&&this._clearExpiredHourAgo(),typeof r=="function"&&r()}).catch(n=>{if(typeof r=="function")r(n);else throw n})}_getTableIdentifier(){return this.schemaName?`"${this.schemaName}"."${this.tableName}"`:`"${this.tableName}"`}clearExpired(e){return new Promise(r=>{let n={name:"rlflx-clear-expired",text:`DELETE FROM ${this._getTableIdentifier()} WHERE expire < $1`,values:[e]};this._query(n).then(()=>{r()}).catch(()=>{r()})})}_clearExpiredHourAgo(){this._clearExpiredTimeoutId&&clearTimeout(this._clearExpiredTimeoutId),this._clearExpiredTimeoutId=setTimeout(()=>{this.clearExpired(Date.now()-36e5).then(()=>{this._clearExpiredHourAgo()})},3e5),this._clearExpiredTimeoutId.unref()}_getConnection(){switch(this.clientType){case"pool":return Promise.resolve(this.client);case"sequelize":return this.client.connectionManager.getConnection();case"knex":return this.client.client.acquireConnection();case"typeorm":return Promise.resolve(this.client.driver.master);default:return Promise.resolve(this.client)}}_releaseConnection(e){switch(this.clientType){case"pool":return!0;case"sequelize":return this.client.connectionManager.releaseConnection(e);case"knex":return this.client.client.releaseConnection(e);case"typeorm":return!0;default:return!0}}_createTable(){return new Promise((e,r)=>{this._query({text:this._getCreateTableStmt()}).then(()=>{e()}).catch(n=>{n.code==="23505"?e():r(n)})})}_getCreateTableStmt(){return`CREATE TABLE IF NOT EXISTS ${this._getTableIdentifier()} ( - key varchar(255) PRIMARY KEY, - points integer NOT NULL DEFAULT 0, - expire bigint - );`}get clientType(){return this._clientType}set clientType(e){let r=this.client.constructor.name;if(typeof e>"u")if(r==="Client")e="client";else if(r==="Pool"||r==="BoundPool")e="pool";else if(r==="Sequelize")e="sequelize";else throw new Error("storeType is not defined");this._clientType=e.toLowerCase()}get tableName(){return this._tableName}set tableName(e){this._tableName=typeof e>"u"?this.keyPrefix:e}get schemaName(){return this._schemaName}set schemaName(e){this._schemaName=e}get tableCreated(){return this._tableCreated}set tableCreated(e){this._tableCreated=typeof e>"u"?!1:!!e}get clearExpiredByTimeout(){return this._clearExpiredByTimeout}set clearExpiredByTimeout(e){this._clearExpiredByTimeout=typeof e>"u"?!0:!!e}_getRateLimiterRes(e,r,n){let i=new vE,s=n.rows[0];return i.isFirstInDuration=r===s.points,i.consumedPoints=i.isFirstInDuration?r:s.points,i.remainingPoints=Math.max(this.points-i.consumedPoints,0),i.msBeforeNext=s.expire?Math.max(s.expire-Date.now(),0):-1,i}_query(e){let n={name:`${this.tableName.toLowerCase()}:${e.name}`,text:e.text,values:e.values};return new Promise((i,s)=>{this._getConnection().then(o=>{o.query(n).then(a=>{i(a),this._releaseConnection(o)}).catch(a=>{s(a),this._releaseConnection(o)})}).catch(o=>{s(o)})})}_upsert(e,r,n,i=!1){if(!this.tableCreated)return Promise.reject(Error("Table is not created yet"));let s=n>0?Date.now()+n:null,o=i?" $3 ":` CASE - WHEN ${this._getTableIdentifier()}.expire <= $4 THEN $3 - ELSE ${this._getTableIdentifier()}.expire - END `;return this._query({name:i?"rlflx-upsert-force":"rlflx-upsert",text:` - INSERT INTO ${this._getTableIdentifier()} VALUES ($1, $2, $3) - ON CONFLICT(key) DO UPDATE SET - points = CASE - WHEN (${this._getTableIdentifier()}.expire <= $4 OR 1=${i?1:0}) THEN $2 - ELSE ${this._getTableIdentifier()}.points + ($2) - END, - expire = ${o} - RETURNING points, expire;`,values:[e,r,s,Date.now()]})}_get(e){return this.tableCreated?new Promise((r,n)=>{this._query({name:"rlflx-get",text:` - SELECT points, expire FROM ${this._getTableIdentifier()} WHERE key = $1 AND (expire > $2 OR expire IS NULL);`,values:[e,Date.now()]}).then(i=>{i.rowCount===0&&(i=null),r(i)}).catch(i=>{n(i)})}):Promise.reject(Error("Table is not created yet"))}_delete(e){return this.tableCreated?this._query({name:"rlflx-delete",text:`DELETE FROM ${this._getTableIdentifier()} WHERE key = $1`,values:[e]}).then(r=>r.rowCount>0):Promise.reject(Error("Table is not created yet"))}};Gp.exports=ml});var Yp=V(()=>{});var Xp=V((J3,Qp)=>{Qp.exports=class{constructor(e,r,n=null){this.value=e,this.expiresAt=r,this.timeoutId=n}get value(){return this._value}set value(e){this._value=parseInt(e)}get expiresAt(){return this._expiresAt}set expiresAt(e){!(e instanceof Date)&&Number.isInteger(e)&&(e=new Date(e)),this._expiresAt=e}get timeoutId(){return this._timeoutId}set timeoutId(e){this._timeoutId=e}}});var jp=V((tB,Zp)=>{var _E=Xp(),gl=_t();Zp.exports=class{constructor(){this._storage={}}incrby(e,r,n){if(this._storage[e]){let i=this._storage[e].expiresAt?this._storage[e].expiresAt.getTime()-new Date().getTime():-1;return i!==0?(this._storage[e].value=this._storage[e].value+r,new gl(0,i,this._storage[e].value,!1)):this.set(e,r,n)}return this.set(e,r,n)}set(e,r,n){let i=n*1e3;return this._storage[e]&&this._storage[e].timeoutId&&clearTimeout(this._storage[e].timeoutId),this._storage[e]=new _E(r,i>0?new Date(Date.now()+i):null),i>0&&(this._storage[e].timeoutId=setTimeout(()=>{delete this._storage[e]},i),this._storage[e].timeoutId.unref&&this._storage[e].timeoutId.unref()),new gl(0,i===0?-1:i,this._storage[e].value,!0)}get(e){if(this._storage[e]){let r=this._storage[e].expiresAt?this._storage[e].expiresAt.getTime()-new Date().getTime():-1;return new gl(0,r,this._storage[e].value,!1)}return null}delete(e){return this._storage[e]?(this._storage[e].timeoutId&&clearTimeout(this._storage[e].timeoutId),delete this._storage[e],!0):!1}}});var xl=V((rB,em)=>{var SE=ji(),AE=jp(),Jp=_t(),yl=class extends SE{constructor(e={}){super(e),this._memoryStorage=new AE}consume(e,r=1,n={}){return new Promise((i,s)=>{let o=this.getKey(e),a=this._getKeySecDuration(n),c=this._memoryStorage.incrby(o,r,a);if(c.remainingPoints=Math.max(this.points-c.consumedPoints,0),c.consumedPoints>this.points)this.blockDuration>0&&c.consumedPoints<=this.points+r&&(c=this._memoryStorage.set(o,c.consumedPoints,this.blockDuration)),s(c);else if(this.execEvenly&&c.msBeforeNext>0&&!c.isFirstInDuration){let u=Math.ceil(c.msBeforeNext/(c.remainingPoints+2));u{let o=this._getKeySecDuration(n),a=this._memoryStorage.incrby(i,r,o);a.remainingPoints=Math.max(this.points-a.consumedPoints,0),s(a)})}reward(e,r=1,n={}){let i=this.getKey(e);return new Promise(s=>{let o=this._getKeySecDuration(n),a=this._memoryStorage.incrby(i,-r,o);a.remainingPoints=Math.max(this.points-a.consumedPoints,0),s(a)})}block(e,r){let n=r*1e3,i=this.points+1;return this._memoryStorage.set(this.getKey(e),i,r),Promise.resolve(new Jp(0,n===0?-1:n,i))}set(e,r,n){let i=(n>=0?n:this.duration)*1e3;return this._memoryStorage.set(this.getKey(e),r,n),Promise.resolve(new Jp(0,i===0?-1:i,r))}get(e){let r=this._memoryStorage.get(this.getKey(e));return r!==null&&(r.remainingPoints=Math.max(this.points-r.consumedPoints,0)),Promise.resolve(r)}delete(e){return Promise.resolve(this._memoryStorage.delete(this.getKey(e)))}};em.exports=yl});var am=V((nB,om)=>{var tm=Yp(),IE=gi(),RE=ji(),nm=xl(),CE=_t(),Ct="rate_limiter_flexible",ci=null,rm=function(t,e,r,n){let i;n===null||n===!0||n===!1?i=n:i={remainingPoints:n.remainingPoints,msBeforeNext:n.msBeforeNext,consumedPoints:n.consumedPoints,isFirstInDuration:n.isFirstInDuration},t.send({channel:Ct,keyPrefix:e.keyPrefix,promiseId:e.promiseId,type:r,data:i})},im=function(t){setTimeout(()=>{this._initiated?process.send(t):typeof this._promises[t.promiseId]<"u"&&im.call(this,t)},30)},oi=function(t,e,r,n,i){let s={channel:Ct,keyPrefix:this.keyPrefix,func:t,promiseId:e,data:{key:r,arg:n,opts:i}};this._initiated?process.send(s):im.call(this,s)},sm=function(t,e){if(!e||e.channel!==Ct||typeof this._rateLimiters[e.keyPrefix]>"u")return!1;let r;switch(e.func){case"consume":r=this._rateLimiters[e.keyPrefix].consume(e.data.key,e.data.arg,e.data.opts);break;case"penalty":r=this._rateLimiters[e.keyPrefix].penalty(e.data.key,e.data.arg,e.data.opts);break;case"reward":r=this._rateLimiters[e.keyPrefix].reward(e.data.key,e.data.arg,e.data.opts);break;case"block":r=this._rateLimiters[e.keyPrefix].block(e.data.key,e.data.arg,e.data.opts);break;case"get":r=this._rateLimiters[e.keyPrefix].get(e.data.key,e.data.opts);break;case"delete":r=this._rateLimiters[e.keyPrefix].delete(e.data.key,e.data.opts);break;default:return!1}r&&r.then(n=>{rm(t,e,"resolve",n)}).catch(n=>{rm(t,e,"reject",n)})},TE=function(t){if(!t||t.channel!==Ct||t.keyPrefix!==this.keyPrefix)return!1;if(this._promises[t.promiseId]){clearTimeout(this._promises[t.promiseId].timeoutId);let e;switch(t.data===null||t.data===!0||t.data===!1?e=t.data:e=new CE(t.data.remainingPoints,t.data.msBeforeNext,t.data.consumedPoints,t.data.isFirstInDuration),t.type){case"resolve":this._promises[t.promiseId].resolve(e);break;case"reject":this._promises[t.promiseId].reject(e);break;default:throw new Error(`RateLimiterCluster: no such message type '${t.type}'`)}delete this._promises[t.promiseId]}},BE=function(){return{points:this.points,duration:this.duration,blockDuration:this.blockDuration,execEvenly:this.execEvenly,execEvenlyMinDelayMs:this.execEvenlyMinDelayMs,keyPrefix:this.keyPrefix}},ai=function(t,e){let r=process.hrtime(),n=r[0].toString()+r[1].toString();return typeof this._promises[n]<"u"&&(n+=IE.randomBytes(12).toString("base64")),this._promises[n]={resolve:t,reject:e,timeoutId:setTimeout(()=>{delete this._promises[n],e(new Error("RateLimiterCluster timeout: no answer from master in time"))},this.timeoutMs)},n},bl=class{constructor(){if(ci)return ci;this._rateLimiters={},tm.setMaxListeners(0),tm.on("message",(e,r)=>{r&&r.channel===Ct&&r.type==="init"?(typeof this._rateLimiters[r.opts.keyPrefix]>"u"&&(this._rateLimiters[r.opts.keyPrefix]=new nm(r.opts)),e.send({channel:Ct,type:"init",keyPrefix:r.opts.keyPrefix})):sm.call(this,e,r)}),ci=this}},wl=class{constructor(e){if(ci)return ci;this._rateLimiters={},e.launchBus((r,n)=>{n.on("process:msg",i=>{let s=i.raw;if(s&&s.channel===Ct&&s.type==="init")typeof this._rateLimiters[s.opts.keyPrefix]>"u"&&(this._rateLimiters[s.opts.keyPrefix]=new nm(s.opts)),e.sendDataToProcessId(i.process.pm_id,{data:{},topic:Ct,channel:Ct,type:"init",keyPrefix:s.opts.keyPrefix},(o,a)=>{o&&console.log(o,a)});else{let o={send:a=>{let c=a;c.topic=Ct,typeof c.data>"u"&&(c.data={}),e.sendDataToProcessId(i.process.pm_id,c,(u,l)=>{u&&console.log(u,l)})}};sm.call(this,o,s)}})}),ci=this}},El=class extends RE{get timeoutMs(){return this._timeoutMs}set timeoutMs(e){this._timeoutMs=typeof e>"u"?5e3:Math.abs(parseInt(e))}constructor(e={}){super(e),process.setMaxListeners(0),this.timeoutMs=e.timeoutMs,this._initiated=!1,process.on("message",r=>{r&&r.channel===Ct&&r.type==="init"&&r.keyPrefix===this.keyPrefix?this._initiated=!0:TE.call(this,r)}),process.send({channel:Ct,type:"init",opts:BE.call(this)}),this._promises={}}consume(e,r=1,n={}){return new Promise((i,s)=>{let o=ai.call(this,i,s);oi.call(this,"consume",o,e,r,n)})}penalty(e,r=1,n={}){return new Promise((i,s)=>{let o=ai.call(this,i,s);oi.call(this,"penalty",o,e,r,n)})}reward(e,r=1,n={}){return new Promise((i,s)=>{let o=ai.call(this,i,s);oi.call(this,"reward",o,e,r,n)})}block(e,r,n={}){return new Promise((i,s)=>{let o=ai.call(this,i,s);oi.call(this,"block",o,e,r,n)})}get(e,r={}){return new Promise((n,i)=>{let s=ai.call(this,n,i);oi.call(this,"get",s,e,r)})}delete(e,r={}){return new Promise((n,i)=>{let s=ai.call(this,n,i);oi.call(this,"delete",s,e,r)})}};om.exports={RateLimiterClusterMaster:bl,RateLimiterClusterMasterPM2:wl,RateLimiterCluster:El}});var um=V((iB,cm)=>{var LE=si(),PE=_t(),vl=class extends LE{constructor(e){super(e),this.client=e.storeClient}_getRateLimiterRes(e,r,n){let i=new PE;return i.consumedPoints=parseInt(n.consumedPoints),i.isFirstInDuration=n.consumedPoints===r,i.remainingPoints=Math.max(this.points-i.consumedPoints,0),i.msBeforeNext=n.msBeforeNext,i}_upsert(e,r,n,i=!1,s={}){return new Promise((o,a)=>{let c=Date.now(),u=Math.floor(n/1e3);i?this.client.set(e,r,u,l=>{l?a(l):this.client.set(`${e}_expire`,u>0?c+u*1e3:-1,u,()=>{let f={consumedPoints:r,msBeforeNext:u>0?u*1e3:-1};o(f)})}):this.client.incr(e,r,(l,f)=>{l||f===!1?this.client.add(e,r,u,(h,p)=>{if(h||!p)if(typeof s.attemptNumber>"u"||s.attemptNumber<3){let d=Object.assign({},s);d.attemptNumber=d.attemptNumber?d.attemptNumber+1:1,this._upsert(e,r,n,i,d).then(m=>o(m)).catch(m=>a(m))}else a(new Error("Can not add key"));else this.client.add(`${e}_expire`,u>0?c+u*1e3:-1,u,()=>{let d={consumedPoints:r,msBeforeNext:u>0?u*1e3:-1};o(d)})}):this.client.get(`${e}_expire`,(h,p)=>{if(h)a(h);else{let d=p===!1?0:p,m={consumedPoints:f,msBeforeNext:d>=0?Math.max(d-c,0):-1};o(m)}})})})}_get(e){return new Promise((r,n)=>{let i=Date.now();this.client.get(e,(s,o)=>{o?this.client.get(`${e}_expire`,(a,c)=>{if(a)n(a);else{let u=c===!1?0:c,l={consumedPoints:o,msBeforeNext:u>=0?Math.max(u-i,0):-1};r(l)}}):r(null)})})}_delete(e){return new Promise((r,n)=>{this.client.del(e,(i,s)=>{i?n(i):s===!1?r(s):this.client.del(`${e}_expire`,o=>{o?n(o):r(s)})})})}};cm.exports=vl});var hm=V((oB,fm)=>{var lm=_t();fm.exports=class{constructor(e={}){this.limiter=e.limiter,this.blackList=e.blackList,this.whiteList=e.whiteList,this.isBlackListed=e.isBlackListed,this.isWhiteListed=e.isWhiteListed,this.runActionAnyway=e.runActionAnyway}get limiter(){return this._limiter}set limiter(e){if(typeof e>"u")throw new Error("limiter is not set");this._limiter=e}get runActionAnyway(){return this._runActionAnyway}set runActionAnyway(e){this._runActionAnyway=typeof e>"u"?!1:e}get blackList(){return this._blackList}set blackList(e){this._blackList=Array.isArray(e)?e:[]}get isBlackListed(){return this._isBlackListed}set isBlackListed(e){if(typeof e>"u"&&(e=()=>!1),typeof e!="function")throw new Error("isBlackListed must be function");this._isBlackListed=e}get whiteList(){return this._whiteList}set whiteList(e){this._whiteList=Array.isArray(e)?e:[]}get isWhiteListed(){return this._isWhiteListed}set isWhiteListed(e){if(typeof e>"u"&&(e=()=>!1),typeof e!="function")throw new Error("isWhiteListed must be function");this._isWhiteListed=e}isBlackListedSomewhere(e){return this.blackList.indexOf(e)>=0||this.isBlackListed(e)}isWhiteListedSomewhere(e){return this.whiteList.indexOf(e)>=0||this.isWhiteListed(e)}getBlackRes(){return new lm(0,Number.MAX_SAFE_INTEGER,0,!1)}getWhiteRes(){return new lm(Number.MAX_SAFE_INTEGER,0,0,!1)}rejectBlack(){return Promise.reject(this.getBlackRes())}resolveBlack(){return Promise.resolve(this.getBlackRes())}resolveWhite(){return Promise.resolve(this.getWhiteRes())}consume(e,r=1){let n;return this.isWhiteListedSomewhere(e)?n=this.resolveWhite():this.isBlackListedSomewhere(e)&&(n=this.rejectBlack()),typeof n>"u"?this.limiter.consume(e,r):(this.runActionAnyway&&this.limiter.consume(e,r).catch(()=>{}),n)}block(e,r){let n;return this.isWhiteListedSomewhere(e)?n=this.resolveWhite():this.isBlackListedSomewhere(e)&&(n=this.resolveBlack()),typeof n>"u"?this.limiter.block(e,r):(this.runActionAnyway&&this.limiter.block(e,r).catch(()=>{}),n)}penalty(e,r){let n;return this.isWhiteListedSomewhere(e)?n=this.resolveWhite():this.isBlackListedSomewhere(e)&&(n=this.resolveBlack()),typeof n>"u"?this.limiter.penalty(e,r):(this.runActionAnyway&&this.limiter.penalty(e,r).catch(()=>{}),n)}reward(e,r){let n;return this.isWhiteListedSomewhere(e)?n=this.resolveWhite():this.isBlackListedSomewhere(e)&&(n=this.resolveBlack()),typeof n>"u"?this.limiter.reward(e,r):(this.runActionAnyway&&this.limiter.reward(e,r).catch(()=>{}),n)}get(e){let r;return this.isWhiteListedSomewhere(e)?r=this.resolveWhite():this.isBlackListedSomewhere(e)&&(r=this.resolveBlack()),typeof r>"u"||this.runActionAnyway?this.limiter.get(e):r}delete(e){return this.limiter.delete(e)}}});var pm=V((cB,dm)=>{var DE=ji();dm.exports=class{constructor(...e){if(e.length<1)throw new Error("RateLimiterUnion: at least one limiter have to be passed");e.forEach(r=>{if(!(r instanceof DE))throw new Error("RateLimiterUnion: all limiters have to be instance of RateLimiterAbstract")}),this._limiters=e}consume(e,r=1){return new Promise((n,i)=>{let s=[];this._limiters.forEach(o=>{s.push(o.consume(e,r).catch(a=>({rejected:!0,rej:a})))}),Promise.all(s).then(o=>{let a={},c=!1;o.forEach(u=>{u.rejected===!0&&(c=!0)});for(let u=0;u{mm.exports=class extends Error{constructor(e,r){super(),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="CustomError",this.message=e,r&&(this.extra=r)}}});var wm=V((hB,bm)=>{var ym=gm(),xm=4294967295,_l="limiter";bm.exports=class{constructor(e,r={maxQueueSize:xm}){this._queueLimiters={KEY_DEFAULT:new Uo(e,r)},this._limiterFlexible=e,this._maxQueueSize=r.maxQueueSize}getTokensRemaining(e=_l){return this._queueLimiters[e]?this._queueLimiters[e].getTokensRemaining():Promise.resolve(this._limiterFlexible.points)}removeTokens(e,r=_l){return this._queueLimiters[r]||(this._queueLimiters[r]=new Uo(this._limiterFlexible,{key:r,maxQueueSize:this._maxQueueSize})),this._queueLimiters[r].removeTokens(e)}};var Uo=class{constructor(e,r={maxQueueSize:xm,key:_l}){this._key=r.key,this._waitTimeout=null,this._queue=[],this._limiterFlexible=e,this._maxQueueSize=r.maxQueueSize}getTokensRemaining(){return this._limiterFlexible.get(this._key).then(e=>e!==null?e.remainingPoints:this._limiterFlexible.points)}removeTokens(e){let r=this;return new Promise((n,i)=>{if(e>r._limiterFlexible.points){i(new ym(`Requested tokens ${e} exceeds maximum ${r._limiterFlexible.points} tokens per interval`));return}r._queue.length>0?r._queueRequest.call(r,n,i,e):r._limiterFlexible.consume(r._key,e).then(s=>{n(s.remainingPoints)}).catch(s=>{s instanceof Error?i(s):(r._queueRequest.call(r,n,i,e),r._waitTimeout===null&&(r._waitTimeout=setTimeout(r._processFIFO.bind(r),s.msBeforeNext)))})})}_queueRequest(e,r,n){let i=this;i._queue.length{r.resolve(n.remainingPoints),e._processFIFO.call(e)}).catch(n=>{n instanceof Error?(r.reject(n),e._processFIFO.call(e)):(e._queue.unshift(r),e._waitTimeout===null&&(e._waitTimeout=setTimeout(e._processFIFO.bind(e),n.msBeforeNext)))})}}});var vm=V((pB,Em)=>{var Sl=_t();Em.exports=class{constructor(e,r){this._rateLimiter=e,this._burstLimiter=r}_combineRes(e,r){return e?new Sl(e.remainingPoints,Math.min(e.msBeforeNext,r?r.msBeforeNext:0),e.consumedPoints,e.isFirstInDuration):null}consume(e,r=1,n={}){return this._rateLimiter.consume(e,r,n).catch(i=>i instanceof Sl?this._burstLimiter.consume(e,r,n).then(s=>Promise.resolve(this._combineRes(i,s))).catch(s=>s instanceof Sl?Promise.reject(this._combineRes(i,s)):Promise.reject(s)):Promise.reject(i))}get(e){return Promise.all([this._rateLimiter.get(e),this._burstLimiter.get(e)]).then(([r,n])=>this._combineRes(r,n))}get points(){return this._rateLimiter.points}}});var Sm=V((mB,_m)=>{var NE=Kp(),kE=$p(),OE=Hp(),ME=Wp(),{RateLimiterClusterMaster:UE,RateLimiterClusterMasterPM2:FE,RateLimiterCluster:KE}=am(),qE=xl(),VE=um(),$E=hm(),zE=pm(),HE=wm(),GE=vm(),WE=_t();_m.exports={RateLimiterRedis:NE,RateLimiterMongo:kE,RateLimiterMySQL:OE,RateLimiterPostgres:ME,RateLimiterMemory:qE,RateLimiterMemcache:VE,RateLimiterClusterMaster:UE,RateLimiterClusterMasterPM2:FE,RateLimiterCluster:KE,RLWrapperBlackAndWhite:$E,RateLimiterUnion:zE,RateLimiterQueue:HE,BurstyRateLimiter:GE,RateLimiterRes:WE}});var Av={};Ke(Av,{createLibp2p:()=>Sv});var t4=ve(mi(),1),r4=ve(p0(),1);var Rn=class t extends Error{code;type;constructor(e="The operation was aborted"){super(e),this.code=t.code,this.type=t.type}static code="ABORT_ERR";static type="aborted"},S=class extends Error{code;props;constructor(e,r,n){super(e),this.code=r,this.name=n?.name??"CodeError",this.props=n??{}}};var vs="ERR_TIMEOUT",m0="ERR_INVALID_PARAMETERS";var Sb=ve(de(),1);function Wr(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}var Fa={};Ke(Fa,{base10:()=>k1});function B1(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,I=new Uint8Array(b);y!==x;){for(var v=d[y],_=0,P=b-1;(v!==0||_>>0,I[P]=v%a>>>0,v=v/a>>>0;if(v!==0)throw new Error("Non-zero carry");g=_,y++}for(var D=b-g;D!==b&&I[D]===0;)D++;for(var G=c.repeat(m);D>>0,b=new Uint8Array(x);d[m];){var I=r[d.charCodeAt(m)];if(I===255)return;for(var v=0,_=x-1;(I!==0||v>>0,b[_]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");y=v,m++}if(d[m]!==" "){for(var P=x-y;P!==x&&b[P]===0;)P++;for(var D=new Uint8Array(g+(x-P)),G=g;P!==x;)D[G++]=b[P++];return D}}}function p(d){var m=h(d);if(m)return m;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:h,decode:p}}var L1=B1,P1=L1,g0=P1;var t_=new Uint8Array(0);var y0=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var x0=t=>new TextEncoder().encode(t),b0=t=>new TextDecoder().decode(t);var ka=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Oa=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return E0(this,e)}},Ma=class{constructor(e){this.decoders=e}or(e){return E0(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},E0=(t,e)=>new Ma({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),Ua=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ka(e,r,n),this.decoder=new Oa(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Cn=({name:t,prefix:e,encode:r,decode:n})=>new Ua(t,e,r,n),wr=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=g0(r,e);return Cn({prefix:t,name:e,encode:n,decode:s=>nr(i(s))})},D1=(t,e,r,n)=>{let i={};for(let l=0;l=8&&(a-=8,o[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},N1=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<Cn({prefix:e,name:t,encode(i){return N1(i,n,r)},decode(i){return D1(i,n,r,t)}});var k1=wr({prefix:"9",name:"base10",alphabet:"0123456789"});var Ka={};Ke(Ka,{base16:()=>O1,base16upper:()=>M1});var O1=Re({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),M1=Re({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var qa={};Ke(qa,{base2:()=>U1});var U1=Re({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Va={};Ke(Va,{base256emoji:()=>$1});var v0=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),F1=v0.reduce((t,e,r)=>(t[r]=e,t),[]),K1=v0.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function q1(t){return t.reduce((e,r)=>(e+=F1[r],e),"")}function V1(t){let e=[];for(let r of t){let n=K1[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var $1=Cn({prefix:"\u{1F680}",name:"base256emoji",encode:q1,decode:V1});var $a={};Ke($a,{base32:()=>pt,base32hex:()=>W1,base32hexpad:()=>Q1,base32hexpadupper:()=>X1,base32hexupper:()=>Y1,base32pad:()=>H1,base32padupper:()=>G1,base32upper:()=>z1,base32z:()=>Z1});var pt=Re({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),z1=Re({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),H1=Re({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),G1=Re({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),W1=Re({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Y1=Re({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Q1=Re({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),X1=Re({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Z1=Re({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var za={};Ke(za,{base36:()=>j1,base36upper:()=>J1});var j1=wr({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),J1=wr({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Ha={};Ke(Ha,{base58btc:()=>_e,base58flickr:()=>ex});var _e=wr({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ex=wr({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Wa={};Ke(Wa,{base64:()=>Tn,base64pad:()=>tx,base64url:()=>Ga,base64urlpad:()=>rx});var Tn=Re({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),tx=Re({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ga=Re({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),rx=Re({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Ya={};Ke(Ya,{base8:()=>nx});var nx=Re({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Qa={};Ke(Qa,{identity:()=>ix});var ix=Cn({prefix:"\0",name:"identity",encode:t=>b0(t),decode:t=>x0(t)});var g_=new TextEncoder,y_=new TextDecoder;var Za={};Ke(Za,{identity:()=>Er});var ax=A0,_0=128,cx=127,ux=~cx,lx=Math.pow(2,31);function A0(t,e,r){e=e||[],r=r||0;for(var n=r;t>=lx;)e[r++]=t&255|_0,t/=128;for(;t&ux;)e[r++]=t&255|_0,t>>>=7;return e[r]=t|0,A0.bytes=r-n+1,e}var fx=Xa,hx=128,S0=127;function Xa(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw Xa.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&S0)<=hx);return Xa.bytes=s-n,r}var dx=Math.pow(2,7),px=Math.pow(2,14),mx=Math.pow(2,21),gx=Math.pow(2,28),yx=Math.pow(2,35),xx=Math.pow(2,42),bx=Math.pow(2,49),wx=Math.pow(2,56),Ex=Math.pow(2,63),vx=function(t){return t[bi.decode(t,e),bi.decode.bytes],Bn=(t,e,r=0)=>(bi.encode(t,e,r),e),Ln=t=>bi.encodingLength(t);var Gt=(t,e)=>{let r=e.byteLength,n=Ln(t),i=n+Ln(r),s=new Uint8Array(i+r);return Bn(t,s,0),Bn(r,s,n),s.set(e,i),new Pn(t,r,e,s)},Yr=t=>{let e=nr(t),[r,n]=wi(e),[i,s]=wi(e.subarray(n)),o=e.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new Pn(r,i,o,e)},I0=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&y0(t.bytes,r.bytes)}},Pn=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var R0=0,Ax="identity",C0=nr,Ix=t=>Gt(R0,C0(t)),Er={code:R0,name:Ax,encode:C0,digest:Ix};var ec={};Ke(ec,{sha256:()=>Ye,sha512:()=>Rx});var Ja=({name:t,code:e,encode:r})=>new ja(t,e,r),ja=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?Gt(this.code,r):r.then(n=>Gt(this.code,n))}else throw Error("Unknown type, must be binary type")}};var B0=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Ye=Ja({name:"sha2-256",code:18,encode:B0("SHA-256")}),Rx=Ja({name:"sha2-512",code:19,encode:B0("SHA-512")});var L0=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return Tx(r,tc(t),e||_e.encoder);default:return Bx(r,tc(t),e||pt.encoder)}};var P0=new WeakMap,tc=t=>{let e=P0.get(t);if(e==null){let r=new Map;return P0.set(t,r),r}return e},Lt=class t{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==Ei)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Lx)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=Gt(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&I0(e.multihash,n.multihash)}toString(e){return L0(this,e)}toJSON(){return{"/":L0(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new t(n,i,s,o||D0(n,i,s.bytes))}else if(r[Px]===!0){let{version:n,multihash:i,code:s}=r,o=Yr(i);return t.create(n,s,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==Ei)throw new Error(`Version 0 CID must use dag-pb (code: ${Ei}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=D0(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,Ei,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=nr(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new Pn(r.multihashCode,r.digestSize,s,i);return[r.version===0?t.createV0(o):t.createV1(r.codec,o),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[f,h]=wi(e.subarray(r));return r+=h,f},i=n(),s=Ei;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),c=n(),u=r+c,l=u-o;return{version:i,codec:s,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,r){let[n,i]=Cx(e,r),s=t.decode(i);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return tc(s).set(n,e),s}},Cx=(t,e)=>{switch(t[0]){case"Q":{let r=e||_e;return[_e.prefix,r.decode(`${_e.prefix}${t}`)]}case _e.prefix:{let r=e||_e;return[_e.prefix,r.decode(t)]}case pt.prefix:{let r=e||pt;return[pt.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},Tx=(t,e,r)=>{let{prefix:n}=r;if(n!==_e.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let s=r.encode(t).slice(1);return e.set(n,s),s}else return i},Bx=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let s=r.encode(t);return e.set(n,s),s}else return i},Ei=112,Lx=18,D0=(t,e,r)=>{let n=Ln(t),i=n+Ln(e),s=new Uint8Array(i+r.byteLength);return Bn(t,s,0),Bn(e,s,n),s.set(r,i),s},Px=Symbol.for("@ipld/js-cid/CID");var vr={...Qa,...qa,...Ya,...Fa,...Ka,...$a,...za,...Ha,...Wa,...Va},D_={...ec,...Za};function ir(t=0){return globalThis.Buffer?.alloc!=null?Wr(globalThis.Buffer.alloc(t)):new Uint8Array(t)}function tt(t=0){return globalThis.Buffer?.allocUnsafe!=null?Wr(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function k0(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var N0=k0("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),rc=k0("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);let e=tt(t.length);for(let r=0;rtn,Ed25519PublicKey:()=>Ci,generateKeyPair:()=>Y2,generateKeyPairFromSeed:()=>ph,unmarshalEd25519PrivateKey:()=>G2,unmarshalEd25519PublicKey:()=>W2});function Se(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function M0(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");O0(t.outputLen),O0(t.blockLen)}function Dn(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function U0(t,e){nc(t);let r=e.outputLen;if(t.lengtht instanceof Uint8Array;var Is=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Pt=(t,e)=>t<<32-e|t>>>e,Nx=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Nx)throw new Error("Non little-endian hardware is not supported");function ic(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function vi(t){if(typeof t=="string"&&(t=ic(t)),!F0(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function Rs(...t){let e=new Uint8Array(t.reduce((n,i)=>n+i.length,0)),r=0;return t.forEach(n=>{if(!F0(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}var Nn=class{clone(){return this._cloneInto()}},W_={}.toString;function Cs(t){let e=n=>t().update(vi(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function kn(t=32){if(As&&typeof As.getRandomValues=="function")return As.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function kx(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,u=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+u,a,n)}var On=class extends Nn{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Is(this.buffer)}update(e){Dn(this);let{view:r,buffer:n,blockLen:i}=this;e=vi(e);let s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let f=o;fl.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f>sc&Ts)}:{h:Number(t>>sc&Ts)|0,l:Number(t&Ts)|0}}function Ox(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),Ux=(t,e,r)=>t>>>r,Fx=(t,e,r)=>t<<32-r|e>>>r,Kx=(t,e,r)=>t>>>r|e<<32-r,qx=(t,e,r)=>t<<32-r|e>>>r,Vx=(t,e,r)=>t<<64-r|e>>>r-32,$x=(t,e,r)=>t>>>r-32|e<<64-r,zx=(t,e)=>e,Hx=(t,e)=>t,Gx=(t,e,r)=>t<>>32-r,Wx=(t,e,r)=>e<>>32-r,Yx=(t,e,r)=>e<>>64-r,Qx=(t,e,r)=>t<>>64-r;function Xx(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var Zx=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),jx=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,Jx=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),e2=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,t2=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),r2=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0;var n2={fromBig:K0,split:Ox,toBig:Mx,shrSH:Ux,shrSL:Fx,rotrSH:Kx,rotrSL:qx,rotrBH:Vx,rotrBL:$x,rotr32H:zx,rotr32L:Hx,rotlSH:Gx,rotlSL:Wx,rotlBH:Yx,rotlBL:Qx,add:Xx,add3L:Zx,add3H:jx,add4L:Jx,add4H:e2,add5H:r2,add5L:t2},Z=n2;var[i2,s2]=Z.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),_r=new Uint32Array(80),Sr=new Uint32Array(80),oc=class extends On{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:u,El:l,Fh:f,Fl:h,Gh:p,Gl:d,Hh:m,Hl:g}=this;return[e,r,n,i,s,o,a,c,u,l,f,h,p,d,m,g]}set(e,r,n,i,s,o,a,c,u,l,f,h,p,d,m,g){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=l|0,this.Fh=f|0,this.Fl=h|0,this.Gh=p|0,this.Gl=d|0,this.Hh=m|0,this.Hl=g|0}process(e,r){for(let b=0;b<16;b++,r+=4)_r[b]=e.getUint32(r),Sr[b]=e.getUint32(r+=4);for(let b=16;b<80;b++){let I=_r[b-15]|0,v=Sr[b-15]|0,_=Z.rotrSH(I,v,1)^Z.rotrSH(I,v,8)^Z.shrSH(I,v,7),P=Z.rotrSL(I,v,1)^Z.rotrSL(I,v,8)^Z.shrSL(I,v,7),D=_r[b-2]|0,G=Sr[b-2]|0,W=Z.rotrSH(D,G,19)^Z.rotrBH(D,G,61)^Z.shrSH(D,G,6),z=Z.rotrSL(D,G,19)^Z.rotrBL(D,G,61)^Z.shrSL(D,G,6),ee=Z.add4L(P,z,Sr[b-7],Sr[b-16]),he=Z.add4H(ee,_,W,_r[b-7],_r[b-16]);_r[b]=he|0,Sr[b]=ee|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:u,Dl:l,Eh:f,El:h,Fh:p,Fl:d,Gh:m,Gl:g,Hh:y,Hl:x}=this;for(let b=0;b<80;b++){let I=Z.rotrSH(f,h,14)^Z.rotrSH(f,h,18)^Z.rotrBH(f,h,41),v=Z.rotrSL(f,h,14)^Z.rotrSL(f,h,18)^Z.rotrBL(f,h,41),_=f&p^~f&m,P=h&d^~h&g,D=Z.add5L(x,v,P,s2[b],Sr[b]),G=Z.add5H(D,y,I,_,i2[b],_r[b]),W=D|0,z=Z.rotrSH(n,i,28)^Z.rotrBH(n,i,34)^Z.rotrBH(n,i,39),ee=Z.rotrSL(n,i,28)^Z.rotrBL(n,i,34)^Z.rotrBL(n,i,39),he=n&s^n&a^s&a,He=i&o^i&c^o&c;y=m|0,x=g|0,m=p|0,g=d|0,p=f|0,d=h|0,{h:f,l:h}=Z.add(u|0,l|0,G|0,W|0),u=a|0,l=c|0,a=s|0,c=o|0,s=n|0,o=i|0;let T=Z.add3L(W,ee,He);n=Z.add3H(T,G,z,he),i=T|0}({h:n,l:i}=Z.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=Z.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=Z.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l}=Z.add(this.Dh|0,this.Dl|0,u|0,l|0),{h:f,l:h}=Z.add(this.Eh|0,this.El|0,f|0,h|0),{h:p,l:d}=Z.add(this.Fh|0,this.Fl|0,p|0,d|0),{h:m,l:g}=Z.add(this.Gh|0,this.Gl|0,m|0,g|0),{h:y,l:x}=Z.add(this.Hh|0,this.Hl|0,y|0,x|0),this.set(n,i,s,o,a,c,u,l,f,h,p,d,m,g,y,x)}roundClean(){_r.fill(0),Sr.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var ac=Cs(()=>new oc);var Ps={};Ke(Ps,{bitGet:()=>h2,bitLen:()=>f2,bitMask:()=>_i,bitSet:()=>d2,bytesToHex:()=>sr,bytesToNumberBE:()=>or,bytesToNumberLE:()=>Ar,concatBytes:()=>ar,createHmacDrbg:()=>lc,ensureBytes:()=>Ce,equalBytes:()=>u2,hexToBytes:()=>Xr,hexToNumber:()=>uc,numberToBytesBE:()=>Ir,numberToBytesLE:()=>Zr,numberToHexUnpadded:()=>$0,numberToVarBytesBE:()=>c2,utf8ToBytes:()=>l2,validateObject:()=>Wt});var V0=BigInt(0),Bs=BigInt(1),o2=BigInt(2),Ls=t=>t instanceof Uint8Array,a2=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function sr(t){if(!Ls(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0)),r=0;return t.forEach(n=>{if(!Ls(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function u2(t,e){if(t.length!==e.length)return!1;for(let r=0;rV0;t>>=Bs,e+=1);return e}function h2(t,e){return t>>BigInt(e)&Bs}var d2=(t,e,r)=>t|(r?Bs:V0)<(o2<new Uint8Array(t),q0=t=>Uint8Array.from(t);function lc(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=cc(t),i=cc(t),s=0,o=()=>{n.fill(1),i.fill(0),s=0},a=(...f)=>r(i,n,...f),c=(f=cc())=>{i=a(q0([0]),f),n=a(),f.length!==0&&(i=a(q0([1]),f),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0,h=[];for(;f{o(),c(f);let p;for(;!(p=h(u()));)c();return o(),p}}var p2={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Wt(t,e,r={}){let n=(i,s,o)=>{let a=p2[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);let c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(let[i,s]of Object.entries(e))n(i,s,!1);for(let[i,s]of Object.entries(r))n(i,s,!0);return t}var Me=BigInt(0),be=BigInt(1),jr=BigInt(2),m2=BigInt(3),fc=BigInt(4),z0=BigInt(5),H0=BigInt(8),g2=BigInt(9),y2=BigInt(16);function pe(t,e){let r=t%e;return r>=Me?r:e+r}function x2(t,e,r){if(r<=Me||e 0");if(r===be)return Me;let n=be;for(;e>Me;)e&be&&(n=n*t%r),t=t*t%r,e>>=be;return n}function we(t,e,r){let n=t;for(;e-- >Me;)n*=n,n%=r;return n}function Ds(t,e){if(t===Me||e<=Me)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=pe(t,e),n=e,i=Me,s=be,o=be,a=Me;for(;r!==Me;){let u=n/r,l=n%r,f=i-o*u,h=s-a*u;n=r,r=l,i=o,s=a,o=f,a=h}if(n!==be)throw new Error("invert: does not exist");return pe(i,e)}function b2(t){let e=(t-be)/jr,r,n,i;for(r=t-be,n=0;r%jr===Me;r/=jr,n++);for(i=jr;i(pe(t,e)&be)===be,E2=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function hc(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=E2.reduce((n,i)=>(n[i]="function",n),e);return Wt(t,r)}function v2(t,e,r){if(r 0");if(r===Me)return t.ONE;if(r===be)return e;let n=t.ONE,i=e;for(;r>Me;)r&be&&(n=t.mul(n,i)),i=t.sqr(i),r>>=be;return n}function _2(t,e){let r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function dc(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Ns(t,e,r=!1,n={}){if(t<=Me)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:s}=dc(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=w2(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:_i(i),ZERO:Me,ONE:be,create:c=>pe(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Me<=c&&cc===Me,isOdd:c=>(c&be)===be,neg:c=>pe(-c,t),eql:(c,u)=>c===u,sqr:c=>pe(c*c,t),add:(c,u)=>pe(c+u,t),sub:(c,u)=>pe(c-u,t),mul:(c,u)=>pe(c*u,t),pow:(c,u)=>v2(a,c,u),div:(c,u)=>pe(c*Ds(u,t),t),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>Ds(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>_2(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>r?Zr(c,s):Ir(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?Ar(c):or(c)}});return Object.freeze(a)}function W0(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}function Y0(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function pc(t){let e=Y0(t);return e+Math.ceil(e/2)}function Q0(t,e,r=!1){let n=t.length,i=Y0(e),s=pc(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let o=r?or(t):Ar(t),a=pe(o,e-be)+be;return r?Zr(a,i):Ir(a,i)}var A2=BigInt(0),mc=BigInt(1);function ks(t,e){let r=(i,s)=>{let o=s.negate();return i?o:s},n=i=>{let s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>A2;)s&mc&&(o=o.add(a)),a=a.double(),s>>=mc;return o},precomputeWindow(i,s){let{windows:o,windowSize:a}=n(s),c=[],u=i,l=u;for(let f=0;f>=p,g>c&&(g-=h,o+=mc);let y=m,x=m+Math.abs(g)-1,b=d%2!==0,I=g<0;g===0?l=l.add(r(b,s[y])):u=u.add(r(I,s[x]))}return{p:u,f:l}},wNAFCached(i,s,o,a){let c=i._WINDOW_SIZE||1,u=s.get(i);return u||(u=this.precomputeWindow(i,c),c!==1&&s.set(i,a(u))),this.wNAF(c,u,o)}}}function Si(t){return hc(t.Fp),Wt(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...dc(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var Dt=BigInt(0),mt=BigInt(1),Os=BigInt(2),I2=BigInt(8),R2={zip215:!0};function C2(t){let e=Si(t);return Wt(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Ms(t){let e=C2(t),{Fp:r,n,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,u=Os<{try{return{isValid:!0,value:r.sqrt(N*r.inv(R))}}catch{return{isValid:!1,value:Dt}}}),h=e.adjustScalarBytes||(N=>N),p=e.domain||((N,R,U)=>{if(R.length||U)throw new Error("Contexts/pre-hash are not supported");return N}),d=N=>typeof N=="bigint"&&Dtd(N)&&d(R)&&NN===Dt||m(N,u);function y(N,R){if(m(N,R))return N;throw new Error(`Expected valid scalar < ${R}, got ${typeof N} ${N}`)}function x(N){return N===Dt?N:y(N,n)}let b=new Map;function I(N){if(!(N instanceof v))throw new Error("ExtendedPoint expected")}class v{constructor(R,U,q,H){if(this.ex=R,this.ey=U,this.ez=q,this.et=H,!g(R))throw new Error("x required");if(!g(U))throw new Error("y required");if(!g(q))throw new Error("z required");if(!g(H))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(R){if(R instanceof v)throw new Error("extended point not allowed");let{x:U,y:q}=R||{};if(!g(U)||!g(q))throw new Error("invalid affine point");return new v(U,q,mt,l(U*q))}static normalizeZ(R){let U=r.invertBatch(R.map(q=>q.ez));return R.map((q,H)=>q.toAffine(U[H])).map(v.fromAffine)}_setWindowSize(R){this._WINDOW_SIZE=R,b.delete(this)}assertValidity(){let{a:R,d:U}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:q,ey:H,ez:j,et:te}=this,le=l(q*q),re=l(H*H),oe=l(j*j),De=l(oe*oe),Ie=l(le*R),Ge=l(oe*l(Ie+re)),We=l(De+l(U*l(le*re)));if(Ge!==We)throw new Error("bad point: equation left != right (1)");let Oe=l(q*H),et=l(j*te);if(Oe!==et)throw new Error("bad point: equation left != right (2)")}equals(R){I(R);let{ex:U,ey:q,ez:H}=this,{ex:j,ey:te,ez:le}=R,re=l(U*le),oe=l(j*H),De=l(q*le),Ie=l(te*H);return re===oe&&De===Ie}is0(){return this.equals(v.ZERO)}negate(){return new v(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){let{a:R}=e,{ex:U,ey:q,ez:H}=this,j=l(U*U),te=l(q*q),le=l(Os*l(H*H)),re=l(R*j),oe=U+q,De=l(l(oe*oe)-j-te),Ie=re+te,Ge=Ie-le,We=re-te,Oe=l(De*Ge),et=l(Ie*We),Jt=l(De*We),qr=l(Ge*Ie);return new v(Oe,et,qr,Jt)}add(R){I(R);let{a:U,d:q}=e,{ex:H,ey:j,ez:te,et:le}=this,{ex:re,ey:oe,ez:De,et:Ie}=R;if(U===BigInt(-1)){let zl=l((j-H)*(oe+re)),Hl=l((j+H)*(oe-re)),ha=l(Hl-zl);if(ha===Dt)return this.double();let Gl=l(te*Os*Ie),Wl=l(le*Os*De),Yl=Wl+Gl,Ql=Hl+zl,Xl=Wl-Gl,Xm=l(Yl*ha),Zm=l(Ql*Xl),jm=l(Yl*Xl),Jm=l(ha*Ql);return new v(Xm,Zm,Jm,jm)}let Ge=l(H*re),We=l(j*oe),Oe=l(le*q*Ie),et=l(te*De),Jt=l((H+j)*(re+oe)-Ge-We),qr=et-Oe,fi=et+Oe,$l=l(We-U*Ge),Gm=l(Jt*qr),Wm=l(fi*$l),Ym=l(Jt*$l),Qm=l(qr*fi);return new v(Gm,Wm,Qm,Ym)}subtract(R){return this.add(R.negate())}wNAF(R){return D.wNAFCached(this,b,R,v.normalizeZ)}multiply(R){let{p:U,f:q}=this.wNAF(y(R,n));return v.normalizeZ([U,q])[0]}multiplyUnsafe(R){let U=x(R);return U===Dt?P:this.equals(P)||U===mt?this:this.equals(_)?this.wNAF(U).p:D.unsafeLadder(this,U)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return D.unsafeLadder(this,n).is0()}toAffine(R){let{ex:U,ey:q,ez:H}=this,j=this.is0();R==null&&(R=j?I2:r.inv(H));let te=l(U*R),le=l(q*R),re=l(H*R);if(j)return{x:Dt,y:mt};if(re!==mt)throw new Error("invZ was invalid");return{x:te,y:le}}clearCofactor(){let{h:R}=e;return R===mt?this:this.multiplyUnsafe(R)}static fromHex(R,U=!1){let{d:q,a:H}=e,j=r.BYTES;R=Ce("pointHex",R,j);let te=R.slice(),le=R[j-1];te[j-1]=le&-129;let re=Ar(te);re===Dt||(U?y(re,u):y(re,r.ORDER));let oe=l(re*re),De=l(oe-mt),Ie=l(q*oe-H),{isValid:Ge,value:We}=f(De,Ie);if(!Ge)throw new Error("Point.fromHex: invalid y coordinate");let Oe=(We&mt)===mt,et=(le&128)!==0;if(!U&&We===Dt&&et)throw new Error("Point.fromHex: x=0 and x_0=1");return et!==Oe&&(We=l(-We)),v.fromAffine({x:We,y:re})}static fromPrivateKey(R){return z(R).point}toRawBytes(){let{x:R,y:U}=this.toAffine(),q=Zr(U,r.BYTES);return q[q.length-1]|=R&mt?128:0,q}toHex(){return sr(this.toRawBytes())}}v.BASE=new v(e.Gx,e.Gy,mt,l(e.Gx*e.Gy)),v.ZERO=new v(Dt,mt,mt,Dt);let{BASE:_,ZERO:P}=v,D=ks(v,a*8);function G(N){return pe(N,n)}function W(N){return G(Ar(N))}function z(N){let R=a;N=Ce("private key",N,R);let U=Ce("hashed private key",s(N),2*R),q=h(U.slice(0,R)),H=U.slice(R,2*R),j=W(q),te=_.multiply(j),le=te.toRawBytes();return{head:q,prefix:H,scalar:j,point:te,pointBytes:le}}function ee(N){return z(N).pointBytes}function he(N=new Uint8Array,...R){let U=ar(...R);return W(s(p(U,Ce("context",N),!!i)))}function He(N,R,U={}){N=Ce("message",N),i&&(N=i(N));let{prefix:q,scalar:H,pointBytes:j}=z(R),te=he(U.context,q,N),le=_.multiply(te).toRawBytes(),re=he(U.context,le,j,N),oe=G(te+re*H);x(oe);let De=ar(le,Zr(oe,r.BYTES));return Ce("result",De,a*2)}let T=R2;function k(N,R,U,q=T){let{context:H,zip215:j}=q,te=r.BYTES;N=Ce("signature",N,2*te),R=Ce("message",R),i&&(R=i(R));let le=Ar(N.slice(te,2*te)),re,oe,De;try{re=v.fromHex(U,j),oe=v.fromHex(N.slice(0,te),j),De=_.multiplyUnsafe(le)}catch{return!1}if(!j&&re.isSmallOrder())return!1;let Ie=he(H,oe.toRawBytes(),re.toRawBytes(),R);return oe.add(re.multiplyUnsafe(Ie)).subtract(De).clearCofactor().equals(v.ZERO)}return _._setWindowSize(8),{CURVE:e,getPublicKey:ee,sign:He,verify:k,ExtendedPoint:v,utils:{getExtendedPublicKey:z,randomPrivateKey:()=>o(r.BYTES),precompute(N=8,R=v.BASE){return R._setWindowSize(N),R.multiply(BigInt(3)),R}}}}var yc=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),X0=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),mS=BigInt(0),T2=BigInt(1),gc=BigInt(2),B2=BigInt(5),Z0=BigInt(10),L2=BigInt(20),P2=BigInt(40),j0=BigInt(80);function D2(t){let e=yc,n=t*t%e*t%e,i=we(n,gc,e)*n%e,s=we(i,T2,e)*t%e,o=we(s,B2,e)*s%e,a=we(o,Z0,e)*o%e,c=we(a,L2,e)*a%e,u=we(c,P2,e)*c%e,l=we(u,j0,e)*u%e,f=we(l,j0,e)*u%e,h=we(f,Z0,e)*o%e;return{pow_p_5_8:we(h,gc,e)*t%e,b2:n}}function N2(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function k2(t,e){let r=yc,n=pe(e*e*e,r),i=pe(n*n*e,r),s=D2(t*i).pow_p_5_8,o=pe(t*n*s,r),a=pe(e*o*o,r),c=o,u=pe(o*X0,r),l=a===t,f=a===pe(-t,r),h=a===pe(-t*X0,r);return l&&(o=c),(f||h)&&(o=u),G0(o,r)&&(o=pe(-o,r)),{isValid:l||f,value:o}}var cr=Ns(yc,void 0,!0),xc={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:cr,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:ac,randomBytes:kn,adjustScalarBytes:N2,uvRatio:k2},Mn=Ms(xc);function J0(t,e,r){if(e.length>255)throw new Error("Context is too big");return Rs(ic("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,e.length]),e,t)}var gS=Ms({...xc,domain:J0}),yS=Ms({...xc,domain:J0,prehash:ac});var O2=(cr.ORDER+BigInt(3))/BigInt(8),xS=cr.pow(gc,O2),bS=cr.sqrt(cr.neg(cr.ONE)),wS=(cr.ORDER-BigInt(5))/BigInt(8),ES=BigInt(486662);var vS=W0(cr,cr.neg(BigInt(486664)));var _S=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),SS=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),AS=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),IS=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var RS=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Un=32,ur=64,Us=32;async function eh(){let t=Mn.utils.randomPrivateKey(),e=Mn.getPublicKey(t);return{privateKey:ih(t,e),publicKey:e}}async function th(t){if(t.length!==Us)throw new TypeError('"seed" must be 32 bytes in length.');if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');let e=t,r=Mn.getPublicKey(e);return{privateKey:ih(e,r),publicKey:r}}async function rh(t,e){let r=t.subarray(0,Us);return Mn.sign(e,r)}async function nh(t,e,r){return Mn.verify(e,r,t)}function ih(t,e){let r=new Uint8Array(ur);for(let n=0;ni+s.length,0));let r=tt(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return Wr(r)}var ft={get(t=globalThis){let e=t.crypto;if(e==null||e.subtle==null)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p/blob/main/packages/crypto/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return e}};var bc={alg:"A128GCM",ext:!0,k:"scm9jmO_4BJAgdwWGVulLg",key_ops:["encrypt","decrypt"],kty:"oct"};function wc(t){let e=t?.algorithm??"AES-GCM",r=t?.keyLength??16,n=t?.nonceLength??12,i=t?.digest??"SHA-256",s=t?.saltLength??16,o=t?.iterations??32767,a=ft.get();r*=8;async function c(f,h){let p=a.getRandomValues(new Uint8Array(s)),d=a.getRandomValues(new Uint8Array(n)),m={name:e,iv:d};typeof h=="string"&&(h=Q(h));let g;if(h.length===0){g=await a.subtle.importKey("jwk",bc,{name:"AES-GCM"},!0,["encrypt"]);try{let x={name:"PBKDF2",salt:p,iterations:o,hash:{name:i}},b=await a.subtle.importKey("raw",h,{name:"PBKDF2"},!1,["deriveKey"]);g=await a.subtle.deriveKey(x,b,{name:e,length:r},!0,["encrypt"])}catch{g=await a.subtle.importKey("jwk",bc,{name:"AES-GCM"},!0,["encrypt"])}}else{let x={name:"PBKDF2",salt:p,iterations:o,hash:{name:i}},b=await a.subtle.importKey("raw",h,{name:"PBKDF2"},!1,["deriveKey"]);g=await a.subtle.deriveKey(x,b,{name:e,length:r},!0,["encrypt"])}let y=await a.subtle.encrypt(m,g,f);return Te([p,m.iv,new Uint8Array(y)])}async function u(f,h){let p=f.subarray(0,s),d=f.subarray(s,s+n),m=f.subarray(s+n),g={name:e,iv:d};typeof h=="string"&&(h=Q(h));let y;if(h.length===0)try{let b={name:"PBKDF2",salt:p,iterations:o,hash:{name:i}},I=await a.subtle.importKey("raw",h,{name:"PBKDF2"},!1,["deriveKey"]);y=await a.subtle.deriveKey(b,I,{name:e,length:r},!0,["decrypt"])}catch{y=await a.subtle.importKey("jwk",bc,{name:"AES-GCM"},!0,["decrypt"])}else{let b={name:"PBKDF2",salt:p,iterations:o,hash:{name:i}},I=await a.subtle.importKey("raw",h,{name:"PBKDF2"},!1,["deriveKey"]);y=await a.subtle.deriveKey(b,I,{name:e,length:r},!0,["decrypt"])}let x=await a.subtle.decrypt(g,y,m);return new Uint8Array(x)}return{encrypt:c,decrypt:u}}async function Fn(t,e){let n=await wc().encrypt(t,e);return Tn.encode(n)}var Ec=new Float32Array([-0]),Rr=new Uint8Array(Ec.buffer);function oh(t,e,r){Ec[0]=t,e[r]=Rr[0],e[r+1]=Rr[1],e[r+2]=Rr[2],e[r+3]=Rr[3]}function ah(t,e){return Rr[0]=t[e],Rr[1]=t[e+1],Rr[2]=t[e+2],Rr[3]=t[e+3],Ec[0]}var vc=new Float64Array([-0]),rt=new Uint8Array(vc.buffer);function ch(t,e,r){vc[0]=t,e[r]=rt[0],e[r+1]=rt[1],e[r+2]=rt[2],e[r+3]=rt[3],e[r+4]=rt[4],e[r+5]=rt[5],e[r+6]=rt[6],e[r+7]=rt[7]}function uh(t,e){return rt[0]=t[e],rt[1]=t[e+1],rt[2]=t[e+2],rt[3]=t[e+3],rt[4]=t[e+4],rt[5]=t[e+5],rt[6]=t[e+6],rt[7]=t[e+7],vc[0]}var U2=BigInt(Number.MAX_SAFE_INTEGER),F2=BigInt(Number.MIN_SAFE_INTEGER),ht=class t{lo;hi;constructor(e,r){this.lo=e|0,this.hi=r|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return Jr;if(eF2)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,i=e-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>lh&&(i=0n,++n>lh&&(n=0n))),new t(Number(i),Number(n))}static fromNumber(e){if(e===0)return Jr;let r=e<0;r&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new t(n,i)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):Jr}},Jr=new ht(0,0);Jr.toBigInt=function(){return 0n};Jr.zzEncode=Jr.zzDecode=function(){return this};Jr.length=function(){return 1};var lh=4294967296n;function fh(t){let e=0,r=0;for(let n=0;n191&&a<224?s[o++]=(a&31)<<6|t[e++]&63:a>239&&a<365?(a=((a&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,s[o++]=55296+(a>>10),s[o++]=56320+(a&1023)):s[o++]=(a&15)<<12|(t[e++]&63)<<6|t[e++]&63,o>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,s)),o=0);return i!=null?(o>0&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))}function _c(t,e,r){let n=r,i,s;for(let o=0;o>6|192,e[r++]=i&63|128):(i&64512)===55296&&((s=t.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(s&1023),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128);return r-n}function Nt(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Fs(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var Sc=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,Nt(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw Nt(this,4);return Fs(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw Nt(this,4);return Fs(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw Nt(this,4);let e=ah(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw Nt(this,4);let e=uh(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw Nt(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return hh(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw Nt(this,e);this.pos+=e}else do if(this.pos>=this.len)throw Nt(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new ht(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw Nt(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw Nt(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw Nt(this,8);let e=Fs(this.buf,this.pos+=4),r=Fs(this.buf,this.pos+=4);return new ht(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Ac(t){return new Sc(t instanceof Uint8Array?t:t.subarray())}function Qe(t,e){let r=Ac(t);return e.decode(r)}function Ic(t){let e=t??8192,r=e>>>1,n,i=e;return function(o){if(o<1||o>r)return tt(o);i+o>e&&(n=tt(e),i=0);let a=n.subarray(i,i+=o);return i&7&&(i=(i|7)+1),a}}var en=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function Rc(){}var Tc=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},K2=Ic();function q2(t){return globalThis.Buffer!=null?tt(t):K2(t)}var Ri=class{len;head;tail;states;constructor(){this.len=0,this.head=new en(Rc,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new en(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new Bc((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(Ai,10,ht.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=ht.fromBigInt(e);return this._push(Ai,r.length(),r)}uint64Number(e){let r=ht.fromNumber(e);return this._push(Ai,r.length(),r)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=ht.fromBigInt(e).zzEncode();return this._push(Ai,r.length(),r)}sint64Number(e){let r=ht.fromNumber(e).zzEncode();return this._push(Ai,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(Cc,1,e?1:0)}fixed32(e){return this._push(Ii,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=ht.fromBigInt(e);return this._push(Ii,4,r.lo)._push(Ii,4,r.hi)}fixed64Number(e){let r=ht.fromNumber(e);return this._push(Ii,4,r.lo)._push(Ii,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(oh,4,e)}double(e){return this._push(ch,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(Cc,1,0):this.uint32(r)._push($2,r,e)}string(e){let r=fh(e);return r!==0?this.uint32(r)._push(_c,r,e):this._push(Cc,1,0)}fork(){return this.states=new Tc(this),this.head=this.tail=new en(Rc,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new en(Rc,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=q2(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function Cc(t,e,r){e[r]=t&255}function V2(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var Bc=class extends en{next;constructor(e,r){super(V2,e,r),this.next=void 0}};function Ai(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function Ii(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function $2(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(Ri.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(z2,e,t),this},Ri.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(H2,e,t),this});function z2(t,e,r){e.set(t,r)}function H2(t,e,r){t.length<40?_c(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(Q(t),r)}function Lc(){return new Ri}function Xe(t,e){let r=Lc();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var Kn;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(Kn||(Kn={}));function Ks(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function Pc(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(s,o){let a=e(s);o.int32(a)},n=function(s){let o=s.int32();return e(o)};return Ks("enum",Kn.VARINT,r,n)}function Ze(t,e){return Ks("message",Kn.LENGTH_DELIMITED,t,e)}var Ee;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.Secp256k1="Secp256k1"})(Ee||(Ee={}));var Dc;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.Secp256k1=2]="Secp256k1"})(Dc||(Dc={}));(function(t){t.codec=()=>Pc(Dc)})(Ee||(Ee={}));var Yt;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),Ee.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=Ee.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(Yt||(Yt={}));var Qt;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),Ee.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=Ee.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(Qt||(Qt={}));var Ci=class{_key;constructor(e){this._key=qn(e,Un)}async verify(e,r){return nh(this._key,r,e)}marshal(){return this._key}get bytes(){return Yt.encode({Type:Ee.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}},tn=class{_key;_publicKey;constructor(e,r){this._key=qn(e,ur),this._publicKey=qn(r,Un)}async sign(e){return rh(this._key,e)}get public(){return new Ci(this._publicKey)}marshal(){return this._key}get bytes(){return Qt.encode({Type:Ee.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}async id(){let e=Er.digest(this.public.bytes);return _e.encode(e.bytes).substring(1)}async export(e,r="libp2p-key"){if(r==="libp2p-key")return Fn(this.bytes,e);throw new S(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function G2(t){if(t.length>ur){t=qn(t,ur+Un);let n=t.subarray(0,ur),i=t.subarray(ur,t.length);return new tn(n,i)}t=qn(t,ur);let e=t.subarray(0,ur),r=t.subarray(Un);return new tn(e,r)}function W2(t){return t=qn(t,Un),new Ci(t)}async function Y2(){let{privateKey:t,publicKey:e}=await eh();return new tn(t,e)}async function ph(t){let{privateKey:e,publicKey:r}=await th(t);return new tn(e,r)}function qn(t,e){if(t=Uint8Array.from(t??[]),t.length!==e)throw new S(`Key must be a Uint8Array of length ${e}, got ${t.length}`,"ERR_INVALID_KEY_TYPE");return t}function se(t,e="utf8"){let r=Ss[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var _A=ve(Ne(),1),SA=ve(xs(),1),mh=ve(de(),1);function kt(t,e){let r=Uint8Array.from(t.abs().toByteArray());if(r=r[0]===0?r.subarray(1):r,e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Te([new Uint8Array(e-r.length),r])}return se(r,"base64url")}function gt(t){let e=gh(t);return new mh.default.jsbn.BigInteger(se(e,"base16"),16)}function gh(t,e){let r=Q(t,"base64urlpad");if(e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Te([new Uint8Array(e-r.length),r])}return r}var Q2={"P-256":256,"P-384":384,"P-521":521},X2=Object.keys(Q2),kA=X2.join(" / ");var Fc={};Ke(Fc,{MAX_KEY_SIZE:()=>Pi,RsaPrivateKey:()=>Vn,RsaPublicKey:()=>Li,fromJwk:()=>ab,generateKeyPair:()=>cb,unmarshalRsaPrivateKey:()=>sb,unmarshalRsaPublicKey:()=>ob});var Bi=ve(de(),1);var bI=ve(Eh(),1);function Vs(t){if(isNaN(t)||t<=0)throw new S("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return kn(t)}var tI=ve(Es(),1),Mc=ve(de(),1);function vh(t,e){return e.map(r=>gt(t[r]))}function _h(t){return Mc.default.pki.setRsaPrivateKey(...vh(t,["n","e","d","p","q","dp","dq","qi"]))}function Sh(t){return Mc.default.pki.setRsaPublicKey(...vh(t,["n","e"]))}var nn={};Ke(nn,{jwkToPkcs1:()=>eb,jwkToPkix:()=>rb,pkcs1ToJwk:()=>J2,pkixToJwk:()=>tb});var iI=ve(mi(),1),sI=ve(Es(),1);var lr=ve(de(),1);function J2(t){let e=lr.default.asn1.fromDer(se(t,"ascii")),r=lr.default.pki.privateKeyFromAsn1(e);return{kty:"RSA",n:kt(r.n),e:kt(r.e),d:kt(r.d),p:kt(r.p),q:kt(r.q),dp:kt(r.dP),dq:kt(r.dQ),qi:kt(r.qInv),alg:"RS256"}}function eb(t){if(t.n==null||t.e==null||t.d==null||t.p==null||t.q==null||t.dp==null||t.dq==null||t.qi==null)throw new S("JWK was missing components","ERR_INVALID_PARAMETERS");let e=lr.default.pki.privateKeyToAsn1({n:gt(t.n),e:gt(t.e),d:gt(t.d),p:gt(t.p),q:gt(t.q),dP:gt(t.dp),dQ:gt(t.dq),qInv:gt(t.qi)});return Q(lr.default.asn1.toDer(e).getBytes(),"ascii")}function tb(t){let e=lr.default.asn1.fromDer(se(t,"ascii")),r=lr.default.pki.publicKeyFromAsn1(e);return{kty:"RSA",n:kt(r.n),e:kt(r.e)}}function rb(t){if(t.n==null||t.e==null)throw new S("JWK was missing components","ERR_INVALID_PARAMETERS");let e=lr.default.pki.publicKeyToAsn1({n:gt(t.n),e:gt(t.e)});return Q(lr.default.asn1.toDer(e).getBytes(),"ascii")}async function Ah(t){let e=await ft.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await Ch(e);return{privateKey:r[0],publicKey:r[1]}}async function Uc(t){let r=[await ft.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await nb(t)],n=await Ch({privateKey:r[0],publicKey:r[1]});return{privateKey:n[0],publicKey:n[1]}}async function Ih(t,e){let r=await ft.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),n=await ft.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(e));return new Uint8Array(n,0,n.byteLength)}async function Rh(t,e,r){let n=await ft.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return ft.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},n,e,r)}async function Ch(t){if(t.privateKey==null||t.publicKey==null)throw new S("Private and public key are required","ERR_INVALID_PARAMETERS");return Promise.all([ft.get().subtle.exportKey("jwk",t.privateKey),ft.get().subtle.exportKey("jwk",t.publicKey)])}async function nb(t){return ft.get().subtle.importKey("jwk",{kty:t.kty,n:t.n,e:t.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}function Th(t,e,r,n){let i=e?Sh(t):_h(t),s=se(Uint8Array.from(r),"ascii"),o=n(s,i);return Q(o,"ascii")}function Bh(t,e){return Th(t,!0,e,(r,n)=>n.encrypt(r))}function Lh(t,e){return Th(t,!1,e,(r,n)=>n.decrypt(r))}function $s(t){if(t.kty!=="RSA")throw new S("invalid key type","ERR_INVALID_KEY_TYPE");if(t.n==null)throw new S("invalid key modulus","ERR_INVALID_KEY_MODULUS");return Q(t.n,"base64url").length*8}var Pi=8192,Li=class{_key;constructor(e){this._key=e}async verify(e,r){return Rh(this._key,r,e)}marshal(){return nn.jwkToPkix(this._key)}get bytes(){return Yt.encode({Type:Ee.RSA,Data:this.marshal()}).subarray()}encrypt(e){return Bh(this._key,e)}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}},Vn=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r}genSecret(){return Vs(16)}async sign(e){return Ih(this._key,e)}get public(){if(this._publicKey==null)throw new S("public key not provided","ERR_PUBKEY_NOT_PROVIDED");return new Li(this._publicKey)}decrypt(e){return Lh(this._key,e)}marshal(){return nn.jwkToPkcs1(this._key)}get bytes(){return Qt.encode({Type:Ee.RSA,Data:this.marshal()}).subarray()}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}async id(){let e=await this.public.hash();return se(e,"base58btc")}async export(e,r="pkcs-8"){if(r==="pkcs-8"){let n=new Bi.default.util.ByteBuffer(this.marshal()),i=Bi.default.asn1.fromDer(n),s=Bi.default.pki.privateKeyFromAsn1(i),o={algorithm:"aes256",count:1e4,saltSize:128/8,prfAlgorithm:"sha512"};return Bi.default.pki.encryptRsaPrivateKey(s,e,o)}else{if(r==="libp2p-key")return Fn(this.bytes,e);throw new S(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}}};async function sb(t){let e=nn.pkcs1ToJwk(t);if($s(e)>Pi)throw new S("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let r=await Uc(e);return new Vn(r.privateKey,r.publicKey)}function ob(t){let e=nn.pkixToJwk(t);if($s(e)>Pi)throw new S("key size is too large","ERR_KEY_SIZE_TOO_LARGE");return new Li(e)}async function ab(t){if($s(t)>Pi)throw new S("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await Uc(t);return new Vn(e.privateKey,e.publicKey)}async function cb(t){if(t>Pi)throw new S("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await Ah(t);return new Vn(e.privateKey,e.publicKey)}var Hc={};Ke(Hc,{Secp256k1PrivateKey:()=>Ni,Secp256k1PublicKey:()=>Di,generateKeyPair:()=>_b,unmarshalSecp256k1PrivateKey:()=>Eb,unmarshalSecp256k1PublicKey:()=>vb});var ub=(t,e,r)=>t&e^~t&r,lb=(t,e,r)=>t&e^t&r^e&r,fb=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Cr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Tr=new Uint32Array(64),Kc=class extends On{constructor(){super(64,32,8,!1),this.A=Cr[0]|0,this.B=Cr[1]|0,this.C=Cr[2]|0,this.D=Cr[3]|0,this.E=Cr[4]|0,this.F=Cr[5]|0,this.G=Cr[6]|0,this.H=Cr[7]|0}get(){let{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let f=0;f<16;f++,r+=4)Tr[f]=e.getUint32(r,!1);for(let f=16;f<64;f++){let h=Tr[f-15],p=Tr[f-2],d=Pt(h,7)^Pt(h,18)^h>>>3,m=Pt(p,17)^Pt(p,19)^p>>>10;Tr[f]=m+Tr[f-7]+d+Tr[f-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:u,H:l}=this;for(let f=0;f<64;f++){let h=Pt(a,6)^Pt(a,11)^Pt(a,25),p=l+h+ub(a,c,u)+fb[f]+Tr[f]|0,m=(Pt(n,2)^Pt(n,13)^Pt(n,22))+lb(n,i,s)|0;l=u,u=c,c=a,a=o+p|0,o=s,s=i,i=n,n=p+m|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,i,s,o,a,c,u,l)}roundClean(){Tr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Ph=Cs(()=>new Kc);function hb(t){let e=Si(t);Wt(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:db,hexToBytes:pb}=Ps,sn={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){let{Err:e}=sn;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:db(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=sn,r=typeof t=="string"?pb(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:s}=sn._parseInt(r.subarray(2)),{d:o,l:a}=sn._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){let e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,r=u=>{let l=u.toString(16);return l.length&1?`0${l}`:l},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},fr=BigInt(0),It=BigInt(1),CI=BigInt(2),Dh=BigInt(3),TI=BigInt(4);function mb(t){let e=hb(t),{Fp:r}=e,n=e.toBytes||((d,m,g)=>{let y=m.toAffine();return ar(Uint8Array.from([4]),r.toBytes(y.x),r.toBytes(y.y))}),i=e.fromBytes||(d=>{let m=d.subarray(1),g=r.fromBytes(m.subarray(0,r.BYTES)),y=r.fromBytes(m.subarray(r.BYTES,2*r.BYTES));return{x:g,y}});function s(d){let{a:m,b:g}=e,y=r.sqr(d),x=r.mul(y,d);return r.add(r.add(x,r.mul(d,m)),g)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(d){return typeof d=="bigint"&&frr.eql(b,r.ZERO);return x(g)&&x(y)?f.ZERO:new f(g,y,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){let g=r.invertBatch(m.map(y=>y.pz));return m.map((y,x)=>y.toAffine(g[x])).map(f.fromAffine)}static fromHex(m){let g=f.fromAffine(i(Ce("pointHex",m)));return g.assertValidity(),g}static fromPrivateKey(m){return f.BASE.multiply(c(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:m,y:g}=this.toAffine();if(!r.isValid(m)||!r.isValid(g))throw new Error("bad point: x or y not FE");let y=r.sqr(g),x=s(m);if(!r.eql(y,x))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:m}=this.toAffine();if(r.isOdd)return!r.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){l(m);let{px:g,py:y,pz:x}=this,{px:b,py:I,pz:v}=m,_=r.eql(r.mul(g,v),r.mul(b,x)),P=r.eql(r.mul(y,v),r.mul(I,x));return _&&P}negate(){return new f(this.px,r.neg(this.py),this.pz)}double(){let{a:m,b:g}=e,y=r.mul(g,Dh),{px:x,py:b,pz:I}=this,v=r.ZERO,_=r.ZERO,P=r.ZERO,D=r.mul(x,x),G=r.mul(b,b),W=r.mul(I,I),z=r.mul(x,b);return z=r.add(z,z),P=r.mul(x,I),P=r.add(P,P),v=r.mul(m,P),_=r.mul(y,W),_=r.add(v,_),v=r.sub(G,_),_=r.add(G,_),_=r.mul(v,_),v=r.mul(z,v),P=r.mul(y,P),W=r.mul(m,W),z=r.sub(D,W),z=r.mul(m,z),z=r.add(z,P),P=r.add(D,D),D=r.add(P,D),D=r.add(D,W),D=r.mul(D,z),_=r.add(_,D),W=r.mul(b,I),W=r.add(W,W),D=r.mul(W,z),v=r.sub(v,D),P=r.mul(W,G),P=r.add(P,P),P=r.add(P,P),new f(v,_,P)}add(m){l(m);let{px:g,py:y,pz:x}=this,{px:b,py:I,pz:v}=m,_=r.ZERO,P=r.ZERO,D=r.ZERO,G=e.a,W=r.mul(e.b,Dh),z=r.mul(g,b),ee=r.mul(y,I),he=r.mul(x,v),He=r.add(g,y),T=r.add(b,I);He=r.mul(He,T),T=r.add(z,ee),He=r.sub(He,T),T=r.add(g,x);let k=r.add(b,v);return T=r.mul(T,k),k=r.add(z,he),T=r.sub(T,k),k=r.add(y,x),_=r.add(I,v),k=r.mul(k,_),_=r.add(ee,he),k=r.sub(k,_),D=r.mul(G,T),_=r.mul(W,he),D=r.add(_,D),_=r.sub(ee,D),D=r.add(ee,D),P=r.mul(_,D),ee=r.add(z,z),ee=r.add(ee,z),he=r.mul(G,he),T=r.mul(W,T),ee=r.add(ee,he),he=r.sub(z,he),he=r.mul(G,he),T=r.add(T,he),z=r.mul(ee,T),P=r.add(P,z),z=r.mul(k,T),_=r.mul(He,_),_=r.sub(_,z),z=r.mul(He,ee),D=r.mul(k,D),D=r.add(D,z),new f(_,P,D)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return p.wNAFCached(this,u,m,g=>{let y=r.invertBatch(g.map(x=>x.pz));return g.map((x,b)=>x.toAffine(y[b])).map(f.fromAffine)})}multiplyUnsafe(m){let g=f.ZERO;if(m===fr)return g;if(a(m),m===It)return this;let{endo:y}=e;if(!y)return p.unsafeLadder(this,m);let{k1neg:x,k1:b,k2neg:I,k2:v}=y.splitScalar(m),_=g,P=g,D=this;for(;b>fr||v>fr;)b&It&&(_=_.add(D)),v&It&&(P=P.add(D)),D=D.double(),b>>=It,v>>=It;return x&&(_=_.negate()),I&&(P=P.negate()),P=new f(r.mul(P.px,y.beta),P.py,P.pz),_.add(P)}multiply(m){a(m);let g=m,y,x,{endo:b}=e;if(b){let{k1neg:I,k1:v,k2neg:_,k2:P}=b.splitScalar(g),{p:D,f:G}=this.wNAF(v),{p:W,f:z}=this.wNAF(P);D=p.constTimeNegate(I,D),W=p.constTimeNegate(_,W),W=new f(r.mul(W.px,b.beta),W.py,W.pz),y=D.add(W),x=G.add(z)}else{let{p:I,f:v}=this.wNAF(g);y=I,x=v}return f.normalizeZ([y,x])[0]}multiplyAndAddUnsafe(m,g,y){let x=f.BASE,b=(v,_)=>_===fr||_===It||!v.equals(x)?v.multiplyUnsafe(_):v.multiply(_),I=b(this,g).add(b(m,y));return I.is0()?void 0:I}toAffine(m){let{px:g,py:y,pz:x}=this,b=this.is0();m==null&&(m=b?r.ONE:r.inv(x));let I=r.mul(g,m),v=r.mul(y,m),_=r.mul(x,m);if(b)return{x:r.ZERO,y:r.ZERO};if(!r.eql(_,r.ONE))throw new Error("invZ was invalid");return{x:I,y:v}}isTorsionFree(){let{h:m,isTorsionFree:g}=e;if(m===It)return!0;if(g)return g(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:m,clearCofactor:g}=e;return m===It?this:g?g(f,this):this.multiplyUnsafe(e.h)}toRawBytes(m=!0){return this.assertValidity(),n(f,this,m)}toHex(m=!0){return sr(this.toRawBytes(m))}}f.BASE=new f(e.Gx,e.Gy,r.ONE),f.ZERO=new f(r.ZERO,r.ONE,r.ZERO);let h=e.nBitLength,p=ks(f,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function gb(t){let e=Si(t);return Wt(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Nh(t){let e=gb(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(T){return frsr(Ir(T,e.nByteLength));function d(T){let k=n>>It;return T>k}function m(T){return d(T)?a(-T):T}let g=(T,k,L)=>or(T.slice(k,L));class y{constructor(k,L,N){this.r=k,this.s=L,this.recovery=N,this.assertValidity()}static fromCompact(k){let L=e.nByteLength;return k=Ce("compactSignature",k,L*2),new y(g(k,0,L),g(k,L,2*L))}static fromDER(k){let{r:L,s:N}=sn.toSig(Ce("DER",k));return new y(L,N)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(k){return new y(this.r,this.s,k)}recoverPublicKey(k){let{r:L,s:N,recovery:R}=this,U=P(Ce("msgHash",k));if(R==null||![0,1,2,3].includes(R))throw new Error("recovery id invalid");let q=R===2||R===3?L+e.n:L;if(q>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let H=R&1?"03":"02",j=u.fromHex(H+p(q)),te=c(q),le=a(-U*te),re=a(N*te),oe=u.BASE.multiplyAndAddUnsafe(j,le,re);if(!oe)throw new Error("point at infinify");return oe.assertValidity(),oe}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Xr(this.toDERHex())}toDERHex(){return sn.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Xr(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}let x={isValidPrivateKey(T){try{return l(T),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{let T=pc(e.n);return Q0(e.randomBytes(T),e.n)},precompute(T=8,k=u.BASE){return k._setWindowSize(T),k.multiply(BigInt(3)),k}};function b(T,k=!0){return u.fromPrivateKey(T).toRawBytes(k)}function I(T){let k=T instanceof Uint8Array,L=typeof T=="string",N=(k||L)&&T.length;return k?N===i||N===s:L?N===2*i||N===2*s:T instanceof u}function v(T,k,L=!0){if(I(T))throw new Error("first arg must be private key");if(!I(k))throw new Error("second arg must be public key");return u.fromHex(k).multiply(l(T)).toRawBytes(L)}let _=e.bits2int||function(T){let k=or(T),L=T.length*8-e.nBitLength;return L>0?k>>BigInt(L):k},P=e.bits2int_modN||function(T){return a(_(T))},D=_i(e.nBitLength);function G(T){if(typeof T!="bigint")throw new Error("bigint expected");if(!(fr<=T&&TIe in L))throw new Error("sign() legacy options not supported");let{hash:N,randomBytes:R}=e,{lowS:U,prehash:q,extraEntropy:H}=L;U==null&&(U=!0),T=Ce("msgHash",T),q&&(T=Ce("prehashed msgHash",N(T)));let j=P(T),te=l(k),le=[G(te),G(j)];if(H!=null){let Ie=H===!0?R(r.BYTES):H;le.push(Ce("extraEntropy",Ie))}let re=ar(...le),oe=j;function De(Ie){let Ge=_(Ie);if(!h(Ge))return;let We=c(Ge),Oe=u.BASE.multiply(Ge).toAffine(),et=a(Oe.x);if(et===fr)return;let Jt=a(We*a(oe+et*te));if(Jt===fr)return;let qr=(Oe.x===et?0:2)|Number(Oe.y&It),fi=Jt;return U&&d(Jt)&&(fi=m(Jt),qr^=1),new y(et,fi,qr)}return{seed:re,k2sig:De}}let z={lowS:e.lowS,prehash:!1},ee={lowS:e.lowS,prehash:!1};function he(T,k,L=z){let{seed:N,k2sig:R}=W(T,k,L),U=e;return lc(U.hash.outputLen,U.nByteLength,U.hmac)(N,R)}u.BASE._setWindowSize(8);function He(T,k,L,N=ee){let R=T;if(k=Ce("msgHash",k),L=Ce("publicKey",L),"strict"in N)throw new Error("options.strict was renamed to lowS");let{lowS:U,prehash:q}=N,H,j;try{if(typeof R=="string"||R instanceof Uint8Array)try{H=y.fromDER(R)}catch(Oe){if(!(Oe instanceof sn.Err))throw Oe;H=y.fromCompact(R)}else if(typeof R=="object"&&typeof R.r=="bigint"&&typeof R.s=="bigint"){let{r:Oe,s:et}=R;H=new y(Oe,et)}else throw new Error("PARSE");j=u.fromHex(L)}catch(Oe){if(Oe.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(U&&H.hasHighS())return!1;q&&(k=e.hash(k));let{r:te,s:le}=H,re=P(k),oe=c(le),De=a(re*oe),Ie=a(te*oe),Ge=u.BASE.multiplyAndAddUnsafe(j,De,Ie)?.toAffine();return Ge?a(Ge.x)===te:!1}return{CURVE:e,getPublicKey:b,getSharedSecret:v,sign:he,verify:He,ProjectivePoint:u,Signature:y,utils:x}}var zs=class extends Nn{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,M0(e);let n=vi(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew zs(t,e).update(r).digest();qc.create=(t,e)=>new zs(t,e);function yb(t){return{hash:t,hmac:(e,...r)=>qc(t,e,Rs(...r)),randomBytes:kn}}function kh(t,e){let r=n=>Nh({...t,...yb(n)});return Object.freeze({...r(e),create:r})}var Uh=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Oh=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),xb=BigInt(1),Vc=BigInt(2),Mh=(t,e)=>(t+e/Vc)/e;function bb(t){let e=Uh,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=t*t*t%e,l=u*u*t%e,f=we(l,r,e)*l%e,h=we(f,r,e)*l%e,p=we(h,Vc,e)*u%e,d=we(p,i,e)*p%e,m=we(d,s,e)*d%e,g=we(m,a,e)*m%e,y=we(g,c,e)*g%e,x=we(y,a,e)*m%e,b=we(x,r,e)*l%e,I=we(b,o,e)*d%e,v=we(I,n,e)*u%e,_=we(v,Vc,e);if(!$c.eql($c.sqr(_),t))throw new Error("Cannot find square root");return _}var $c=Ns(Uh,void 0,void 0,{sqrt:bb}),hr=kh({a:BigInt(0),b:BigInt(7),Fp:$c,n:Oh,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=Oh,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-xb*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=Mh(s*t,e),c=Mh(-n*t,e),u=pe(t-a*r-c*i,e),l=pe(-a*n-c*s,e),f=u>o,h=l>o;if(f&&(u=e-u),h&&(l=e-l),u>o||l>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:u,k2neg:h,k2:l}}}},Ph),qI=BigInt(0);var VI=hr.ProjectivePoint;function Fh(){return hr.utils.randomPrivateKey()}async function Kh(t,e){let{digest:r}=await Ye.digest(e);try{return hr.sign(r,t).toDERRawBytes()}catch(n){throw new S(String(n),"ERR_INVALID_INPUT")}}async function qh(t,e,r){try{let{digest:n}=await Ye.digest(r);return hr.verify(e,n,t)}catch(n){throw new S(String(n),"ERR_INVALID_INPUT")}}function Vh(t){return hr.ProjectivePoint.fromHex(t).toRawBytes(!0)}function $h(t){try{hr.getPublicKey(t,!0)}catch(e){throw new S(String(e),"ERR_INVALID_PRIVATE_KEY")}}function zc(t){try{hr.ProjectivePoint.fromHex(t)}catch(e){throw new S(String(e),"ERR_INVALID_PUBLIC_KEY")}}function zh(t){try{return hr.getPublicKey(t,!0)}catch(e){throw new S(String(e),"ERR_INVALID_PRIVATE_KEY")}}var Di=class{_key;constructor(e){zc(e),this._key=e}async verify(e,r){return qh(this._key,r,e)}marshal(){return Vh(this._key)}get bytes(){return Yt.encode({Type:Ee.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}},Ni=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r??zh(e),$h(this._key),zc(this._publicKey)}async sign(e){return Kh(this._key,e)}get public(){return new Di(this._publicKey)}marshal(){return this._key}get bytes(){return Qt.encode({Type:Ee.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Se(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ye.digest(this.bytes);return e}async id(){let e=await this.public.hash();return se(e,"base58btc")}async export(e,r="libp2p-key"){if(r==="libp2p-key")return Fn(this.bytes,e);throw new S(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function Eb(t){return new Ni(t)}function vb(t){return new Di(t)}async function _b(){let t=Fh();return new Ni(t)}var Br={rsa:Fc,ed25519:Nc,secp256k1:Hc};function Gc(t){let e=Object.keys(Br).join(" / ");return new S(`invalid or unsupported key type ${t}. Must be ${e}`,"ERR_UNSUPPORTED_KEY_TYPE")}function Wc(t){if(t=t.toLowerCase(),t==="rsa"||t==="ed25519"||t==="secp256k1")return Br[t];throw Gc(t)}async function Hh(t,e){return Wc(t).generateKeyPair(e??2048)}function ki(t){let e=Yt.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case Ee.RSA:return Br.rsa.unmarshalRsaPublicKey(r);case Ee.Ed25519:return Br.ed25519.unmarshalEd25519PublicKey(r);case Ee.Secp256k1:return Br.secp256k1.unmarshalSecp256k1PublicKey(r);default:throw Gc(e.Type??"unknown")}}function Gh(t,e){return e=(e??"rsa").toLowerCase(),Wc(e),t.bytes}async function Yc(t){let e=Qt.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case Ee.RSA:return Br.rsa.unmarshalRsaPrivateKey(r);case Ee.Ed25519:return Br.ed25519.unmarshalEd25519PrivateKey(r);case Ee.Secp256k1:return Br.secp256k1.unmarshalSecp256k1PrivateKey(r);default:throw Gc(e.Type??"RSA")}}function Wh(t,e){return e=(e??"rsa").toLowerCase(),Wc(e),t.bytes}var Qc=Symbol.for("@libp2p/content-routing");var Oi=class extends EventTarget{#e=new Map;listenerCount(e){let r=this.#e.get(e);return r==null?0:r.length}addEventListener(e,r,n){super.addEventListener(e,r,n);let i=this.#e.get(e);i==null&&(i=[],this.#e.set(e,i)),i.push({callback:r,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(e,r,n){super.removeEventListener(e.toString(),r??null,n);let i=this.#e.get(e);i!=null&&(i=i.filter(({callback:s})=>s!==r),this.#e.set(e,i))}dispatchEvent(e){let r=super.dispatchEvent(e),n=this.#e.get(e.type);return n==null||(n=n.filter(({once:i})=>!i),this.#e.set(e.type,n)),r}safeDispatchEvent(e,r){return this.dispatchEvent(new Zc(e,r))}},Xc=class extends Event{detail;constructor(e,r){super(e,r),this.detail=r?.detail}},Zc=globalThis.CustomEvent??Xc;var yt=(t,...e)=>{try{[...e]}catch{}};var jc=Symbol.for("@libp2p/peer-discovery");var Jc=Symbol.for("@libp2p/peer-routing");var bt=ve(tu(),1);bt.default.formatters.b=t=>t==null?"undefined":_e.baseEncode(t);bt.default.formatters.t=t=>t==null?"undefined":pt.baseEncode(t);bt.default.formatters.m=t=>t==null?"undefined":Tn.baseEncode(t);bt.default.formatters.p=t=>t==null?"undefined":t.toString();bt.default.formatters.c=t=>t==null?"undefined":t.toString();bt.default.formatters.k=t=>t==null?"undefined":t.toString();bt.default.formatters.a=t=>t==null?"undefined":t.toString();function Mb(t){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=t,e.destroy=()=>!0,e.extend=()=>e,e}function Ws(){return{forComponent(t){return Ub(t)}}}function Ub(t){let e=Mb(`${t}:trace`);return bt.default.enabled(`${t}:trace`)&&bt.default.names.map(r=>r.toString()).find(r=>r.includes(":trace"))!=null&&(e=(0,bt.default)(`${t}:trace`)),Object.assign((0,bt.default)(t),{error:(0,bt.default)(`${t}:error`),trace:e})}var ru=Symbol.for("@libp2p/peer-id");function Ys(t){return t!=null&&!!t[ru]}var Fb=Symbol.for("nodejs.util.inspect.custom"),Zh=Object.values(vr).map(t=>t.decoder).reduce((t,e)=>t.or(e),vr.identity.decoder),jh=114,nu=36,iu=37,Mi=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[ru]=!0;toString(){return this.string==null&&(this.string=_e.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return Lt.createV1(jh,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return Se(this.multihash.bytes,e);if(typeof e=="string")return ce(e).equals(this);if(e?.multihash?.bytes!=null)return Se(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[Fb](){return`PeerId(${this.toString()})`}},an=class extends Mi{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},cn=class extends Mi{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},un=class extends Mi{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function Jh(t){if(t.type==="RSA")return new an(t);if(t.type==="Ed25519")return new cn(t);if(t.type==="secp256k1")return new un(t);throw new S("Not a PeerId","ERR_INVALID_PARAMETERS")}function ce(t,e){if(e=e??Zh,t.charAt(0)==="1"||t.charAt(0)==="Q"){let r=Yr(_e.decode(`z${t}`));return t.startsWith("12D")?new cn({multihash:r}):t.startsWith("16U")?new un({multihash:r}):new an({multihash:r})}return Gn(Zh.decode(t))}function Gn(t){try{let e=Yr(t);if(e.code===Er.code){if(e.digest.length===nu)return new cn({multihash:e});if(e.digest.length===iu)return new un({multihash:e})}if(e.code===Ye.code)return new an({multihash:e})}catch{return Kb(Lt.decode(t))}throw new Error("Supplied PeerID CID is invalid")}function Kb(t){if(t==null||t.multihash==null||t.version==null||t.version===1&&t.code!==jh)throw new Error("Supplied PeerID CID is invalid");let e=t.multihash;if(e.code===Ye.code)return new an({multihash:t.multihash});if(e.code===Er.code){if(e.digest.length===nu)return new cn({multihash:t.multihash});if(e.digest.length===iu)return new un({multihash:t.multihash})}throw new Error("Supplied PeerID CID is invalid")}async function Qs(t,e){return t.length===nu?new cn({multihash:Gt(Er.code,t),privateKey:e}):t.length===iu?new un({multihash:Gt(Er.code,t),privateKey:e}):new an({multihash:await Ye.digest(t),publicKey:t,privateKey:e})}function dr(t,e){let r={[Symbol.iterator]:()=>r,next:()=>{let n=t.next(),i=n.value;return n.done===!0||i==null?{done:!0,value:void 0}:{done:!1,value:e(i)}}};return r}var wt=class{map;constructor(e){if(this.map=new Map,e!=null)for(let[r,n]of e.entries())this.map.set(r.toString(),n)}[Symbol.iterator](){return this.entries()}clear(){this.map.clear()}delete(e){this.map.delete(e.toString())}entries(){return dr(this.map.entries(),e=>[ce(e[0]),e[1]])}forEach(e){this.map.forEach((r,n)=>{e(r,ce(n),this)})}get(e){return this.map.get(e.toString())}has(e){return this.map.has(e.toString())}set(e,r){this.map.set(e.toString(),r)}keys(){return dr(this.map.keys(),e=>ce(e))}values(){return this.map.values()}get size(){return this.map.size}};var ln=class t{set;constructor(e){if(this.set=new Set,e!=null)for(let r of e)this.set.add(r.toString())}get size(){return this.set.size}[Symbol.iterator](){return this.values()}add(e){this.set.add(e.toString())}clear(){this.set.clear()}delete(e){this.set.delete(e.toString())}entries(){return dr(this.set.entries(),e=>{let r=ce(e[0]);return[r,r]})}forEach(e){this.set.forEach(r=>{let n=ce(r);e(n,n,this)})}has(e){return this.set.has(e.toString())}values(){return dr(this.set.values(),e=>ce(e))}intersection(e){let r=new t;for(let n of e)this.has(n)&&r.add(n);return r}difference(e){let r=new t;for(let n of this)e.has(n)||r.add(n);return r}union(e){let r=new t;for(let n of e)r.add(n);for(let n of this)r.add(n);return r}};var su=class t{list;constructor(e){if(this.list=[],e!=null)for(let r of e)this.list.push(r.toString())}[Symbol.iterator](){return dr(this.list.entries(),e=>ce(e[1]))}concat(e){let r=new t(this);for(let n of e)r.push(n);return r}entries(){return dr(this.list.entries(),e=>[e[0],ce(e[1])])}every(e){return this.list.every((r,n)=>e(ce(r),n,this))}filter(e){let r=new t;return this.list.forEach((n,i)=>{let s=ce(n);e(s,i,this)&&r.push(s)}),r}find(e){let r=this.list.find((n,i)=>e(ce(n),i,this));if(r!=null)return ce(r)}findIndex(e){return this.list.findIndex((r,n)=>e(ce(r),n,this))}forEach(e){this.list.forEach((r,n)=>{e(ce(r),n,this)})}includes(e){return this.list.includes(e.toString())}indexOf(e){return this.list.indexOf(e.toString())}pop(){let e=this.list.pop();if(e!=null)return ce(e)}push(...e){for(let r of e)this.list.push(r.toString())}shift(){let e=this.list.shift();if(e!=null)return ce(e)}unshift(...e){let r=this.list.length;for(let n=e.length-1;n>-1;n--)r=this.list.unshift(e[n].toString());return r}get length(){return this.list.length}};var ou;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.id!=null&&(n.uint32(10),n.bytes(r.id)),r.pubKey!=null&&(n.uint32(18),n.bytes(r.pubKey)),r.privKey!=null&&(n.uint32(26),n.bytes(r.privKey)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.id=r.bytes();break;case 2:i.pubKey=r.bytes();break;case 3:i.privKey=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(ou||(ou={}));var ed=async()=>{let t=await Hh("Ed25519"),e=await qb(t);if(e.type==="Ed25519")return e;throw new Error(`Generated unexpected PeerId type "${e.type}"`)};async function qb(t){return Qs(Gh(t.public),Wh(t))}var Vb=Math.pow(2,7),$b=Math.pow(2,14),zb=Math.pow(2,21),au=Math.pow(2,28),cu=Math.pow(2,35),uu=Math.pow(2,42),lu=Math.pow(2,49),ue=128,nt=127;function it(t){if(tNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Hb(t,e,r=0){switch(it(t)){case 8:e[r++]=t&255|ue,t/=128;case 7:e[r++]=t&255|ue,t/=128;case 6:e[r++]=t&255|ue,t/=128;case 5:e[r++]=t&255|ue,t/=128;case 4:e[r++]=t&255|ue,t>>>=7;case 3:e[r++]=t&255|ue,t>>>=7;case 2:e[r++]=t&255|ue,t>>>=7;case 1:{e[r++]=t&255,t>>>=7;break}default:throw new Error("unreachable")}return e}function Gb(t,e,r=0){switch(it(t)){case 8:e.set(r++,t&255|ue),t/=128;case 7:e.set(r++,t&255|ue),t/=128;case 6:e.set(r++,t&255|ue),t/=128;case 5:e.set(r++,t&255|ue),t/=128;case 4:e.set(r++,t&255|ue),t>>>=7;case 3:e.set(r++,t&255|ue),t>>>=7;case 2:e.set(r++,t&255|ue),t>>>=7;case 1:{e.set(r++,t&255),t>>>=7;break}default:throw new Error("unreachable")}return e}function Wb(t,e){let r=t[e],n=0;if(n+=r&nt,r0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let r=0;for(let n of e)if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.push(n);else if(Xs(n))r+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}prepend(...e){this.prependAll(e)}prependAll(e){let r=0;for(let n of e.reverse())if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.unshift(n);else if(Xs(n))r+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}get(e){let r=td(this.bufs,e);return r.buf[r.index]}set(e,r){let n=td(this.bufs,e);n.buf[n.index]=r}write(e,r=0){if(e instanceof Uint8Array)for(let n=0;n0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,r){let{bufs:n,length:i}=this._subList(e,r);return Te(n,i)}subarray(e,r){let{bufs:n,length:i}=this._subList(e,r);return n.length===1?n[0]:Te(n,i)}sublist(e,r){let{bufs:n,length:i}=this._subList(e,r),s=new t;return s.length=i,s.bufs=n,s}_subList(e,r){if(e=e??0,r=r??this.length,e<0&&(e=this.length+e),r<0&&(r=this.length+r),e<0||r>this.length)throw new RangeError("index is out of bounds");if(e===r)return{bufs:[],length:0};if(e===0&&r===this.length)return{bufs:[...this.bufs],length:this.length};let n=[],i=0;for(let s=0;s=c)continue;let u=e>=a&&ea&&r<=c;if(u&&l){if(e===a&&r===c){n.push(o);break}let f=e-a;n.push(o.subarray(f,f+(r-e)));break}if(u){if(e===0){n.push(o);continue}n.push(o.subarray(e-a));continue}if(l){if(r===c){n.push(o);break}n.push(o.subarray(0,r-a));break}n.push(o)}return{bufs:n,length:r-e}}indexOf(e,r=0){if(!Xs(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(r=Number(r??0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),e.length===0)return r>this.length?this.length:r;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let s=256,o=new Int32Array(s);for(let f=0;f=0;h--){let p=this.get(f+h);if(n[h]!==p){l=Math.max(1,h-a[p]);break}}if(l===0)return f}return-1}getInt8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt8(0)}setInt8(e,r){let n=tt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,r),this.write(n,e)}getInt16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,r)}setInt16(e,r,n){let i=ir(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,r,n),this.write(i,e)}getInt32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,r)}setInt32(e,r,n){let i=ir(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,r,n),this.write(i,e)}getBigInt64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,r)}setBigInt64(e,r,n){let i=ir(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,r,n),this.write(i,e)}getUint8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint8(0)}setUint8(e,r){let n=tt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,r),this.write(n,e)}getUint16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,r)}setUint16(e,r,n){let i=ir(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,r,n),this.write(i,e)}getUint32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,r)}setUint32(e,r,n){let i=ir(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,r,n),this.write(i,e)}getBigUint64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,r)}setBigUint64(e,r,n){let i=ir(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,r,n),this.write(i,e)}getFloat32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,r)}setFloat32(e,r,n){let i=ir(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,r,n),this.write(i,e)}getFloat64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,r)}setFloat64(e,r,n){let i=ir(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,r,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof t)||e.bufs.length!==this.bufs.length)return!1;for(let r=0;ri+s.byteLength,0)),n.length=r,n}};var nd={ERR_SIGNATURE_NOT_VALID:"ERR_SIGNATURE_NOT_VALID"};var Ui;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.publicKey!=null&&r.publicKey.byteLength>0&&(n.uint32(10),n.bytes(r.publicKey)),r.payloadType!=null&&r.payloadType.byteLength>0&&(n.uint32(18),n.bytes(r.payloadType)),r.payload!=null&&r.payload.byteLength>0&&(n.uint32(26),n.bytes(r.payload)),r.signature!=null&&r.signature.byteLength>0&&(n.uint32(42),n.bytes(r.signature)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={publicKey:new Uint8Array(0),payloadType:new Uint8Array(0),payload:new Uint8Array(0),signature:new Uint8Array(0)},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.publicKey=r.bytes();break;case 2:i.payloadType=r.bytes();break;case 3:i.payload=r.bytes();break;case 5:i.signature=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(Ui||(Ui={}));var Wn=class t{static createFromProtobuf=async e=>{let r=Ui.decode(e),n=await Qs(r.publicKey);return new t({peerId:n,payloadType:r.payloadType,payload:r.payload,signature:r.signature})};static seal=async(e,r)=>{if(r.privateKey==null)throw new Error("Missing private key");let n=e.domain,i=e.codec,s=e.marshal(),o=id(n,i,s),c=await(await Yc(r.privateKey)).sign(o.subarray());return new t({peerId:r,payloadType:i,payload:s,signature:c})};static openAndCertify=async(e,r)=>{let n=await t.createFromProtobuf(e);if(!await n.validate(r))throw new S("envelope signature is not valid for the given domain",nd.ERR_SIGNATURE_NOT_VALID);return n};peerId;payloadType;payload;signature;marshaled;constructor(e){let{peerId:r,payloadType:n,payload:i,signature:s}=e;this.peerId=r,this.payloadType=n,this.payload=i,this.signature=s}marshal(){if(this.peerId.publicKey==null)throw new Error("Missing public key");return this.marshaled==null&&(this.marshaled=Ui.encode({publicKey:this.peerId.publicKey,payloadType:this.payloadType,payload:this.payload.subarray(),signature:this.signature})),this.marshaled}equals(e){return Se(this.marshal(),e.marshal())}async validate(e){let r=id(e,this.payloadType,this.payload);if(this.peerId.publicKey==null)throw new Error("Missing public key");return ki(this.peerId.publicKey).verify(r.subarray(),this.signature)}},id=(t,e,r)=>{let n=Q(t),i=dt(n.byteLength),s=dt(e.length),o=dt(r.length);return new ze(i,n,s,e,o,r)};function sd(t,e){let r=(n,i)=>n.toString().localeCompare(i.toString());return t.length!==e.length?!1:(e.sort(r),t.sort(r).every((n,i)=>e[i].equals(n)))}var Zs=class{index=0;input="";new(e){return this.index=0,this.input=e,this}readAtomically(e){let r=this.index,n=e();return n===void 0&&(this.index=r),n}parseWith(e){let r=e();if(this.index===this.input.length)return r}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(e){return this.readAtomically(()=>{let r=this.readChar();if(r===e)return r})}readSeparator(e,r,n){return this.readAtomically(()=>{if(!(r>0&&this.readGivenChar(e)===void 0))return n()})}readNumber(e,r,n,i){return this.readAtomically(()=>{let s=0,o=0,a=this.peekChar();if(a===void 0)return;let c=a==="0",u=2**(8*i)-1;for(;;){let l=this.readAtomically(()=>{let f=this.readChar();if(f===void 0)return;let h=Number.parseInt(f,e);if(!Number.isNaN(h))return h});if(l===void 0)break;if(s*=e,s+=l,s>u||(o+=1,r!==void 0&&o>r))return}if(o!==0)return!n&&c&&o>1?void 0:s})}readIPv4Addr(){return this.readAtomically(()=>{let e=new Uint8Array(4);for(let r=0;rthis.readNumber(10,3,!1,1));if(n===void 0)return;e[r]=n}return e})}readIPv6Addr(){let e=r=>{for(let n=0;nthis.readIPv4Addr());if(o!==void 0)return r[i]=o[0],r[i+1]=o[1],r[i+2]=o[2],r[i+3]=o[3],[i+4,!0]}let s=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(s===void 0)return[i,!1];r[i]=s>>8,r[i+1]=s&255}return[r.length,!1]};return this.readAtomically(()=>{let r=new Uint8Array(16),[n,i]=e(r);if(n===16)return r;if(i||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let s=new Uint8Array(14),o=16-(n+2),[a]=e(s.subarray(0,o));return r.set(s.subarray(0,a),16-a),r})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var od=45,Qb=15,Yn=new Zs;function fu(t){if(!(t.length>Qb))return Yn.new(t).parseWith(()=>Yn.readIPv4Addr())}function hu(t){if(t.includes("%")&&(t=t.split("%")[0]),!(t.length>od))return Yn.new(t).parseWith(()=>Yn.readIPv6Addr())}function js(t){if(t.includes("%")&&(t=t.split("%")[0]),!(t.length>od))return Yn.new(t).parseWith(()=>Yn.readIPAddr())}var TR=parseInt("0xFFFF",16),BR=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function Js(t){return!!fu(t)}function eo(t){return!!hu(t)}function Qn(t){return!!js(t)}var ud=Js,ew=eo,du=function(t){let e=0;if(t=t.toString().trim(),ud(t)){let r=new Uint8Array(e+4);return t.split(/\./g).forEach(n=>{r[e++]=parseInt(n,10)&255}),r}if(ew(t)){let r=t.split(":",8),n;for(n=0;n0;n--)s.push("0");r.splice.apply(r,s)}let i=new Uint8Array(e+16);for(n=0;n>8&255,i[e++]=s&255}return i}throw new Error("invalid ip address")},ld=function(t,e=0,r){e=~~e,r=r??t.length-e;let n=new DataView(t.buffer);if(r===4){let i=[];for(let s=0;s{let e=nw(...t);pu[e.code]=e,Xn[e.name]=e});function nw(t,e,r,n,i){return{code:t,size:e,name:r,resolvable:!!n,path:!!i}}function fe(t){if(typeof t=="number"){if(pu[t]!=null)return pu[t];throw new Error(`no protocol with code: ${t}`)}else if(typeof t=="string"){if(Xn[t]!=null)return Xn[t];throw new Error(`no protocol with name: ${t}`)}throw new Error(`invalid protocol id type: ${typeof t}`)}var d8=fe("ip4"),p8=fe("ip6"),m8=fe("ipcidr");function gu(t,e){switch(fe(t).code){case 4:case 41:return sw(e);case 42:return dd(e);case 6:case 273:case 33:case 132:return md(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return dd(e);case 421:return uw(e);case 444:return pd(e);case 445:return pd(e);case 466:return cw(e);default:return se(e,"base16")}}function yu(t,e){switch(fe(t).code){case 4:return fd(e);case 41:return fd(e);case 42:return hd(e);case 6:case 273:case 33:case 132:return xu(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return hd(e);case 421:return ow(e);case 444:return lw(e);case 445:return fw(e);case 466:return aw(e);default:return Q(e,"base16")}}var mu=Object.values(vr).map(t=>t.decoder),iw=function(){let t=mu[0].or(mu[1]);return mu.slice(2).forEach(e=>t=t.or(e)),t}();function fd(t){if(!Qn(t))throw new Error("invalid ip address");return du(t)}function sw(t){let e=ld(t,0,t.length);if(e==null)throw new Error("ipBuff is required");if(!Qn(e))throw new Error("invalid ip address");return e}function xu(t){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,t),new Uint8Array(e)}function md(t){return new DataView(t.buffer).getUint16(t.byteOffset)}function hd(t){let e=Q(t),r=Uint8Array.from(dt(e.length));return Te([r,e],r.length+e.length)}function dd(t){let e=Ot(t);if(t=t.slice(it(e)),t.length!==e)throw new Error("inconsistent lengths");return se(t)}function ow(t){let e;t[0]==="Q"||t[0]==="1"?e=Yr(_e.decode(`z${t}`)).bytes:e=Lt.parse(t).multihash.bytes;let r=Uint8Array.from(dt(e.length));return Te([r,e],r.length+e.length)}function aw(t){let e=iw.decode(t),r=Uint8Array.from(dt(e.length));return Te([r,e],r.length+e.length)}function cw(t){let e=Ot(t),r=t.slice(it(e));if(r.length!==e)throw new Error("inconsistent lengths");return"u"+se(r,"base64url")}function uw(t){let e=Ot(t),r=t.slice(it(e));if(r.length!==e)throw new Error("inconsistent lengths");return se(r,"base58btc")}function lw(t){let e=t.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let r=pt.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=xu(n);return Te([r,i],r.length+i.length)}function fw(t){let e=t.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let r=pt.decode(`b${e[0]}`),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=xu(n);return Te([r,i],r.length+i.length)}function pd(t){let e=t.slice(0,t.length-2),r=t.slice(t.length-2),n=se(e,"base32"),i=md(r);return`${n}:${i}`}function gd(t){t=bu(t);let e=[],r=[],n=null,i=t.split("/").slice(1);if(i.length===1&&i[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let s=0;s=i.length)throw xd("invalid address: "+t);if(a.path===!0){n=bu(i.slice(s).join("/")),e.push([a.code,yu(a.code,n)]),r.push([a.code,n]);break}let c=yu(a.code,i[s]);e.push([a.code,c]),r.push([a.code,gu(a.code,c)])}return{string:yd(r),bytes:Eu(e),tuples:e,stringTuples:r,path:n}}function wu(t){let e=[],r=[],n=null,i=0;for(;it.length)throw xd("Invalid address Uint8Array: "+se(t,"base16"));e.push([s,u]);let l=gu(s,u);if(r.push([s,l]),a.path===!0){n=l;break}}return{bytes:Uint8Array.from(t),string:yd(r),tuples:e,stringTuples:r,path:n}}function yd(t){let e=[];return t.map(r=>{let n=fe(r[0]);return e.push(n.name),r.length>1&&r[1]!=null&&e.push(r[1]),null}),bu(e.join("/"))}function Eu(t){return Te(t.map(e=>{let r=fe(e[0]),n=Uint8Array.from(dt(r.code));return e.length>1&&e[1]!=null&&(n=Te([n,e[1]])),n}))}function hw(t,e){if(t.size>0)return t.size/8;if(t.size===0)return 0;{let r=Ot(e instanceof Uint8Array?e:Uint8Array.from(e));return r+it(r)}}function bu(t){return"/"+t.trim().split("/").filter(e=>e).join("/")}function xd(t){return new Error("Error parsing address: "+t)}var dw=Symbol.for("nodejs.util.inspect.custom"),vu=Symbol.for("@multiformats/js-multiaddr/multiaddr"),pw=[fe("dns").code,fe("dns4").code,fe("dns6").code,fe("dnsaddr").code],to=class t{bytes;#e;#t;#r;#n;[vu]=!0;constructor(e){e==null&&(e="");let r;if(e instanceof Uint8Array)r=wu(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);r=gd(e)}else if(Lr(e))r=wu(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=r.bytes,this.#e=r.string,this.#t=r.tuples,this.#r=r.stringTuples,this.#n=r.path}toString(){return this.#e}toJSON(){return this.toString()}toOptions(){let e,r,n,i,s="",o=fe("tcp"),a=fe("udp"),c=fe("ip4"),u=fe("ip6"),l=fe("dns6"),f=fe("ip6zone");for(let[p,d]of this.stringTuples())p===f.code&&(s=`%${d??""}`),pw.includes(p)&&(r=o.name,i=443,n=`${d??""}${s}`,e=p===l.code?6:4),(p===o.code||p===a.code)&&(r=fe(p).name,i=parseInt(d??"")),(p===c.code||p===u.code)&&(r=fe(p).name,n=`${d??""}${s}`,e=p===u.code?6:4);if(e==null||r==null||n==null||i==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:e,host:n,transport:r,port:i}}protos(){return this.#t.map(([e])=>Object.assign({},fe(e)))}protoCodes(){return this.#t.map(([e])=>e)}protoNames(){return this.#t.map(([e])=>fe(e).name)}tuples(){return this.#t}stringTuples(){return this.#r}encapsulate(e){return e=new t(e),new t(this.toString()+e.toString())}decapsulate(e){let r=e.toString(),n=this.toString(),i=n.lastIndexOf(r);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new t(n.slice(0,i))}decapsulateCode(e){let r=this.tuples();for(let n=r.length-1;n>=0;n--)if(r[n][0]===e)return new t(Eu(r.slice(0,n)));return this}getPeerId(){try{let e=[];this.stringTuples().forEach(([n,i])=>{n===Xn.p2p.code&&e.push([n,i]),n===Xn["p2p-circuit"].code&&(e=[])});let r=e.pop();if(r?.[1]!=null){let n=r[1];return n[0]==="Q"||n[0]==="1"?se(_e.decode(`z${n}`),"base58btc"):se(Lt.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#n}equals(e){return Se(this.bytes,e.bytes)}async resolve(e){let r=this.protos().find(s=>s.resolvable);if(r==null)return[this];let n=ro.get(r.name);if(n==null)throw new S(`no available resolver for ${r.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,e)).map(s=>new t(s))}nodeAddress(){let e=this.toOptions();if(e.transport!=="tcp"&&e.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${e.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:e.family,address:e.host,port:e.port}}isThinWaistAddress(e){let r=(e??this).protos();return!(r.length!==2||r[0].code!==4&&r[0].code!==41||r[1].code!==6&&r[1].code!==273)}[dw](){return`Multiaddr(${this.#e})`}};var ro=new Map;function Lr(t){return!!t?.[vu]}function Ue(t){return new to(t)}var bd="libp2p-peer-record",wd=Uint8Array.from([3,1]);var Fi;(function(t){let e;(function(n){let i;n.codec=()=>(i==null&&(i=Ze((s,o,a={})=>{a.lengthDelimited!==!1&&o.fork(),s.multiaddr!=null&&s.multiaddr.byteLength>0&&(o.uint32(10),o.bytes(s.multiaddr)),a.lengthDelimited!==!1&&o.ldelim()},(s,o)=>{let a={multiaddr:new Uint8Array(0)},c=o==null?s.len:s.pos+o;for(;s.pos>>3){case 1:a.multiaddr=s.bytes();break;default:s.skipType(u&7);break}}return a})),i),n.encode=s=>Xe(s,n.codec()),n.decode=s=>Qe(s,n.codec())})(e=t.AddressInfo||(t.AddressInfo={}));let r;t.codec=()=>(r==null&&(r=Ze((n,i,s={})=>{if(s.lengthDelimited!==!1&&i.fork(),n.peerId!=null&&n.peerId.byteLength>0&&(i.uint32(10),i.bytes(n.peerId)),n.seq!=null&&n.seq!==0n&&(i.uint32(16),i.uint64(n.seq)),n.addresses!=null)for(let o of n.addresses)i.uint32(26),t.AddressInfo.codec().encode(o,i);s.lengthDelimited!==!1&&i.ldelim()},(n,i)=>{let s={peerId:new Uint8Array(0),seq:0n,addresses:[]},o=i==null?n.len:n.pos+i;for(;n.pos>>3){case 1:s.peerId=n.bytes();break;case 2:s.seq=n.uint64();break;case 3:s.addresses.push(t.AddressInfo.codec().decode(n,n.uint32()));break;default:n.skipType(a&7);break}}return s})),r),t.encode=n=>Xe(n,t.codec()),t.decode=n=>Qe(n,t.codec())})(Fi||(Fi={}));var hn=class t{static createFromProtobuf=e=>{let r=Fi.decode(e),n=Gn(r.peerId),i=(r.addresses??[]).map(o=>Ue(o.multiaddr)),s=r.seq;return new t({peerId:n,multiaddrs:i,seqNumber:s})};static DOMAIN=bd;static CODEC=wd;peerId;multiaddrs;seqNumber;domain=t.DOMAIN;codec=t.CODEC;marshaled;constructor(e){let{peerId:r,multiaddrs:n,seqNumber:i}=e;this.peerId=r,this.multiaddrs=n??[],this.seqNumber=i??BigInt(Date.now())}marshal(){return this.marshaled==null&&(this.marshaled=Fi.encode({peerId:this.peerId.toBytes(),seq:BigInt(this.seqNumber),addresses:this.multiaddrs.map(e=>({multiaddr:e.bytes}))})),this.marshaled}equals(e){return!(!(e instanceof t)||!this.peerId.equals(e.peerId)||this.seqNumber!==e.seqNumber||!sd(this.multiaddrs,e.multiaddrs))}};function mw(t){return t[Symbol.asyncIterator]!=null}function gw(t){if(mw(t))return(async()=>{let r=[];for await(let n of t)r.push(n);return r})();let e=[];for(let r of t)e.push(r);return e}var Ki=gw;var Su=ve(vd(),1);var Vi=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Au=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},_d=t=>globalThis.DOMException===void 0?new Au(t):new DOMException(t),Sd=t=>{let e=t.reason===void 0?_d("This operation was aborted."):t.reason;return e instanceof Error?e:_d(e)};function Iu(t,e,r,n){let i,s=new Promise((o,a)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e===Number.POSITIVE_INFINITY){o(t);return}if(n={customTimers:{setTimeout,clearTimeout},...n},n.signal){let{signal:c}=n;c.aborted&&a(Sd(c)),c.addEventListener("abort",()=>{a(Sd(c))})}i=n.customTimers.setTimeout.call(void 0,()=>{if(typeof r=="function"){try{o(r())}catch(l){a(l)}return}let c=typeof r=="string"?r:`Promise timed out after ${e} milliseconds`,u=r instanceof Error?r:new Vi(c);typeof t.cancel=="function"&&t.cancel(),a(u)},e),(async()=>{try{o(await t)}catch(c){a(c)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()});return s.clear=()=>{clearTimeout(i),i=void 0},s}function Ru(t,e,r){let n=0,i=t.length;for(;i>0;){let s=Math.trunc(i/2),o=n+s;r(t[o],e)<=0?(n=++o,i-=s+1):i=s}return n}var dn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},pr,Cu=class{constructor(){pr.set(this,[])}enqueue(e,r){r={priority:0,...r};let n={priority:r.priority,run:e};if(this.size&&dn(this,pr,"f")[this.size-1].priority>=r.priority){dn(this,pr,"f").push(n);return}let i=Ru(dn(this,pr,"f"),n,(s,o)=>o.priority-s.priority);dn(this,pr,"f").splice(i,0,n)}dequeue(){let e=dn(this,pr,"f").shift();return e?.run}filter(e){return dn(this,pr,"f").filter(r=>r.priority===e.priority).map(r=>r.run)}get size(){return dn(this,pr,"f").length}};pr=new WeakMap;var Ad=Cu;var Ae=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},K=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Be,zi,Hi,Dr,uo,Gi,io,Mt,$i,Et,so,vt,Wi,Pr,oo,Id,Rd,Bd,Cd,Td,ao,Tu,Bu,lo,Ld,co,fo=class extends Error{},Lu=class extends Su.default{constructor(e){var r,n,i,s;if(super(),Be.add(this),zi.set(this,void 0),Hi.set(this,void 0),Dr.set(this,0),uo.set(this,void 0),Gi.set(this,void 0),io.set(this,0),Mt.set(this,void 0),$i.set(this,void 0),Et.set(this,void 0),so.set(this,void 0),vt.set(this,0),Wi.set(this,void 0),Pr.set(this,void 0),oo.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Ad,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(r=e.intervalCap)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(s=(i=e.interval)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""}\` (${typeof e.interval})`);Ae(this,zi,e.carryoverConcurrencyCount,"f"),Ae(this,Hi,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),Ae(this,uo,e.intervalCap,"f"),Ae(this,Gi,e.interval,"f"),Ae(this,Et,new e.queueClass,"f"),Ae(this,so,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,Ae(this,oo,e.throwOnTimeout===!0,"f"),Ae(this,Pr,e.autoStart===!1,"f")}get concurrency(){return K(this,Wi,"f")}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);Ae(this,Wi,e,"f"),K(this,Be,"m",lo).call(this)}async add(e,r={}){return r={timeout:this.timeout,throwOnTimeout:K(this,oo,"f"),...r},new Promise((n,i)=>{K(this,Et,"f").enqueue(async()=>{var s,o,a;Ae(this,vt,(o=K(this,vt,"f"),o++,o),"f"),Ae(this,Dr,(a=K(this,Dr,"f"),a++,a),"f");try{if(!((s=r.signal)===null||s===void 0)&&s.aborted)throw new fo("The task was aborted.");let c=e({signal:r.signal});r.timeout&&(c=Iu(Promise.resolve(c),r.timeout)),r.signal&&(c=Promise.race([c,K(this,Be,"m",Ld).call(this,r.signal)]));let u=await c;n(u),this.emit("completed",u)}catch(c){if(c instanceof Vi&&!r.throwOnTimeout){n();return}i(c),this.emit("error",c)}finally{K(this,Be,"m",Bd).call(this)}},r),this.emit("add"),K(this,Be,"m",ao).call(this)})}async addAll(e,r){return Promise.all(e.map(async n=>this.add(n,r)))}start(){return K(this,Pr,"f")?(Ae(this,Pr,!1,"f"),K(this,Be,"m",lo).call(this),this):this}pause(){Ae(this,Pr,!0,"f")}clear(){Ae(this,Et,new(K(this,so,"f")),"f")}async onEmpty(){K(this,Et,"f").size!==0&&await K(this,Be,"m",co).call(this,"empty")}async onSizeLessThan(e){K(this,Et,"f").sizeK(this,Et,"f").size{K(this,Be,"m",Cd).call(this)},r),"f"),!0}return!1},ao=function(){if(K(this,Et,"f").size===0)return K(this,Mt,"f")&&clearInterval(K(this,Mt,"f")),Ae(this,Mt,void 0,"f"),this.emit("empty"),K(this,vt,"f")===0&&this.emit("idle"),!1;if(!K(this,Pr,"f")){let e=!K(this,Be,"a",Td);if(K(this,Be,"a",Id)&&K(this,Be,"a",Rd)){let r=K(this,Et,"f").dequeue();return r?(this.emit("active"),r(),e&&K(this,Be,"m",Tu).call(this),!0):!1}}return!1},Tu=function(){K(this,Hi,"f")||K(this,Mt,"f")!==void 0||(Ae(this,Mt,setInterval(()=>{K(this,Be,"m",Bu).call(this)},K(this,Gi,"f")),"f"),Ae(this,io,Date.now()+K(this,Gi,"f"),"f"))},Bu=function(){K(this,Dr,"f")===0&&K(this,vt,"f")===0&&K(this,Mt,"f")&&(clearInterval(K(this,Mt,"f")),Ae(this,Mt,void 0,"f")),Ae(this,Dr,K(this,zi,"f")?K(this,vt,"f"):0,"f"),K(this,Be,"m",lo).call(this)},lo=function(){for(;K(this,Be,"m",ao).call(this););},Ld=async function(e){return new Promise((r,n)=>{e.addEventListener("abort",()=>{n(new fo("The task was aborted."))},{once:!0})})},co=async function(e,r){return new Promise(n=>{let i=()=>{r&&!r()||(this.off(e,i),n())};this.on(e,i)})};var Nr=Lu;var Pu=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Du=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Pd=t=>globalThis.DOMException===void 0?new Du(t):new DOMException(t),Dd=t=>{let e=t.reason===void 0?Pd("This operation was aborted."):t.reason;return e instanceof Error?e:Pd(e)};function Nu(t,e){let{milliseconds:r,fallback:n,message:i,customTimers:s={setTimeout,clearTimeout}}=e,o,c=new Promise((u,l)=>{if(typeof r!="number"||Math.sign(r)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``);if(e.signal){let{signal:h}=e;h.aborted&&l(Dd(h)),h.addEventListener("abort",()=>{l(Dd(h))})}if(r===Number.POSITIVE_INFINITY){t.then(u,l);return}let f=new Pu;o=s.setTimeout.call(void 0,()=>{if(n){try{u(n())}catch(h){l(h)}return}typeof t.cancel=="function"&&t.cancel(),i===!1?u():i instanceof Error?l(i):(f.message=i??`Promise timed out after ${r} milliseconds`,l(f))},r),(async()=>{try{u(await t)}catch(h){l(h)}})()}).finally(()=>{c.clear()});return c.clear=()=>{s.clearTimeout.call(void 0,o),o=void 0},c}var ho=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),"");var ku="lock:worker:request-read",Ou="lock:worker:release-read",Mu="lock:master:grant-read",Uu="lock:worker:request-write",Fu="lock:worker:release-write",Ku="lock:master:grant-write";var kr={},Zn=t=>{t.addEventListener("message",e=>{Zn.dispatchEvent("message",t,e)}),t.port!=null&&t.port.addEventListener("message",e=>{Zn.dispatchEvent("message",t,e)})};Zn.addEventListener=(t,e)=>{kr[t]==null&&(kr[t]=[]),kr[t].push(e)};Zn.removeEventListener=(t,e)=>{kr[t]!=null&&(kr[t]=kr[t].filter(r=>r===e))};Zn.dispatchEvent=function(t,e,r){kr[t]!=null&&kr[t].forEach(n=>n(e,r))};var qu=Zn;var Nd=(t,e,r,n,i)=>(s,o)=>{if(o.data.type!==r)return;let a={type:o.data.type,name:o.data.name,identifier:o.data.identifier};t.dispatchEvent(new MessageEvent(e,{data:{name:a.name,handler:async()=>(s.postMessage({type:i,name:a.name,identifier:a.identifier}),await new Promise(c=>{let u=l=>{if(l==null||l.data==null)return;let f={type:l.data.type,name:l.data.name,identifier:l.data.identifier};f.type===n&&f.identifier===a.identifier&&(s.removeEventListener("message",u),c())};s.addEventListener("message",u)}))}}))},kd=(t,e,r,n)=>async()=>{let i=ho();return globalThis.postMessage({type:e,identifier:i,name:t}),await new Promise(s=>{let o=a=>{if(a==null||a.data==null)return;let c={type:a.data.type,identifier:a.data.identifier};c.type===r&&c.identifier===i&&(globalThis.removeEventListener("message",o),s(()=>{globalThis.postMessage({type:n,identifier:i,name:t})}))};globalThis.addEventListener("message",o)})},bw={singleProcess:!1},Od=t=>{if(t=Object.assign({},bw,t),!!globalThis.document||t.singleProcess){let r=new EventTarget;return qu.addEventListener("message",Nd(r,"requestReadLock",ku,Ou,Mu)),qu.addEventListener("message",Nd(r,"requestWriteLock",Uu,Fu,Ku)),r}return{isWorker:!0,readLock:r=>kd(r,ku,Mu,Ou),writeLock:r=>kd(r,Uu,Ku,Fu)}};var pn={},Or;async function Vu(t,e){let r,n=new Promise(i=>{r=i});return t.add(async()=>await Nu((async()=>await new Promise(i=>{r(()=>{i()})}))(),{milliseconds:e.timeout})),await n}var ww=(t,e)=>{if(Or.isWorker===!0)return{readLock:Or.readLock(t,e),writeLock:Or.writeLock(t,e)};let r=new Nr({concurrency:1}),n;return{async readLock(){if(n!=null)return await Vu(n,e);n=new Nr({concurrency:e.concurrency,autoStart:!1});let i=n,s=Vu(n,e);return r.add(async()=>(i.start(),await i.onIdle().then(()=>{n===i&&(n=null)}))),await s},async writeLock(){return n=null,await Vu(r,e)}}},Ew={name:"lock",concurrency:1/0,timeout:846e5,singleProcess:!1};function $u(t){let e=Object.assign({},Ew,t);return Or==null&&(Or=Od(e),Or.isWorker!==!0&&(Or.addEventListener("requestReadLock",r=>{pn[r.data.name]!=null&&pn[r.data.name].readLock().then(async n=>await r.data.handler().finally(()=>n()))}),Or.addEventListener("requestWriteLock",async r=>{pn[r.data.name]!=null&&pn[r.data.name].writeLock().then(async n=>await r.data.handler().finally(()=>n()))}))),pn[e.name]==null&&(pn[e.name]=ww(e.name,e)),pn[e.name]}var je={ERR_INVALID_PARAMETERS:"ERR_INVALID_PARAMETERS"};var jn;(function(t){let e;(function(i){let s;i.codec=()=>(s==null&&(s=Ze((o,a,c={})=>{c.lengthDelimited!==!1&&a.fork(),o.key!=null&&o.key!==""&&(a.uint32(10),a.string(o.key)),o.value!=null&&o.value.byteLength>0&&(a.uint32(18),a.bytes(o.value)),c.lengthDelimited!==!1&&a.ldelim()},(o,a)=>{let c={key:"",value:new Uint8Array(0)},u=a==null?o.len:o.pos+a;for(;o.pos>>3){case 1:c.key=o.string();break;case 2:c.value=o.bytes();break;default:o.skipType(l&7);break}}return c})),s),i.encode=o=>Xe(o,i.codec()),i.decode=o=>Qe(o,i.codec())})(e=t.Peer$metadataEntry||(t.Peer$metadataEntry={}));let r;(function(i){let s;i.codec=()=>(s==null&&(s=Ze((o,a,c={})=>{c.lengthDelimited!==!1&&a.fork(),o.key!=null&&o.key!==""&&(a.uint32(10),a.string(o.key)),o.value!=null&&(a.uint32(18),mo.codec().encode(o.value,a)),c.lengthDelimited!==!1&&a.ldelim()},(o,a)=>{let c={key:""},u=a==null?o.len:o.pos+a;for(;o.pos>>3){case 1:c.key=o.string();break;case 2:c.value=mo.codec().decode(o,o.uint32());break;default:o.skipType(l&7);break}}return c})),s),i.encode=o=>Xe(o,i.codec()),i.decode=o=>Qe(o,i.codec())})(r=t.Peer$tagsEntry||(t.Peer$tagsEntry={}));let n;t.codec=()=>(n==null&&(n=Ze((i,s,o={})=>{if(o.lengthDelimited!==!1&&s.fork(),i.addresses!=null)for(let a of i.addresses)s.uint32(10),po.codec().encode(a,s);if(i.protocols!=null)for(let a of i.protocols)s.uint32(18),s.string(a);if(i.publicKey!=null&&(s.uint32(34),s.bytes(i.publicKey)),i.peerRecordEnvelope!=null&&(s.uint32(42),s.bytes(i.peerRecordEnvelope)),i.metadata!=null&&i.metadata.size!==0)for(let[a,c]of i.metadata.entries())s.uint32(50),t.Peer$metadataEntry.codec().encode({key:a,value:c},s);if(i.tags!=null&&i.tags.size!==0)for(let[a,c]of i.tags.entries())s.uint32(58),t.Peer$tagsEntry.codec().encode({key:a,value:c},s);o.lengthDelimited!==!1&&s.ldelim()},(i,s)=>{let o={addresses:[],protocols:[],metadata:new Map,tags:new Map},a=s==null?i.len:i.pos+s;for(;i.pos>>3){case 1:o.addresses.push(po.codec().decode(i,i.uint32()));break;case 2:o.protocols.push(i.string());break;case 4:o.publicKey=i.bytes();break;case 5:o.peerRecordEnvelope=i.bytes();break;case 6:{let u=t.Peer$metadataEntry.codec().decode(i,i.uint32());o.metadata.set(u.key,u.value);break}case 7:{let u=t.Peer$tagsEntry.codec().decode(i,i.uint32());o.tags.set(u.key,u.value);break}default:i.skipType(c&7);break}}return o})),n),t.encode=i=>Xe(i,t.codec()),t.decode=i=>Qe(i,t.codec())})(jn||(jn={}));var po;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.multiaddr!=null&&r.multiaddr.byteLength>0&&(n.uint32(10),n.bytes(r.multiaddr)),r.isCertified!=null&&(n.uint32(16),n.bool(r.isCertified)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={multiaddr:new Uint8Array(0)},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.multiaddr=r.bytes();break;case 2:i.isCertified=r.bool();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(po||(po={}));var mo;(function(t){let e;t.codec=()=>(e==null&&(e=Ze((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.value!=null&&r.value!==0&&(n.uint32(8),n.uint32(r.value)),r.expiry!=null&&(n.uint32(16),n.uint64(r.expiry)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={value:0},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.value=r.uint32();break;case 2:i.expiry=r.uint64();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Xe(r,t.codec()),t.decode=r=>Qe(r,t.codec())})(mo||(mo={}));function Jn(t,e){let r=jn.decode(e);r.publicKey!=null&&t.publicKey==null&&(t=Jh({...t,publicKey:t.publicKey}));let n=new Map,i=BigInt(Date.now());for(let[s,o]of r.tags.entries())o.expiry!=null&&o.expiry({multiaddr:Ue(s),isCertified:o??!1})),metadata:r.metadata,peerRecordEnvelope:r.peerRecordEnvelope??void 0,tags:n}}var mr="/",Md=new TextEncoder().encode(mr),go=Md[0],mn=class t{_buf;constructor(e,r){if(typeof e=="string")this._buf=Q(e);else if(e instanceof Uint8Array)this._buf=e;else throw new Error("Invalid key, should be String of Uint8Array");if(r==null&&(r=!0),r&&this.clean(),this._buf.byteLength===0||this._buf[0]!==go)throw new Error("Invalid key")}toString(e="utf8"){return se(this._buf,e)}uint8Array(){return this._buf}get[Symbol.toStringTag](){return`Key(${this.toString()})`}static withNamespaces(e){return new t(e.join(mr))}static random(){return new t(ho().replace(/-/g,""))}static asKey(e){return e instanceof Uint8Array||typeof e=="string"?new t(e):typeof e.uint8Array=="function"?new t(e.uint8Array()):null}clean(){if((this._buf==null||this._buf.byteLength===0)&&(this._buf=Md),this._buf[0]!==go){let e=new Uint8Array(this._buf.byteLength+1);e.fill(go,0,1),e.set(this._buf,1),this._buf=e}for(;this._buf.byteLength>1&&this._buf[this._buf.byteLength-1]===go;)this._buf=this._buf.subarray(0,-1)}less(e){let r=this.list(),n=e.list();for(let i=0;io)return!1}return r.lengthr.namespaces()))])}};function vw(t){let e=t.split(":");return e.length<2?"":e.slice(0,-1).join(":")}function _w(t){let e=t.split(":");return e[e.length-1]}function Sw(t){return[].concat(...t)}var zu="/peers/";function ei(t){if(!Ys(t)||t.type==null)throw new S("Invalid PeerId",je.ERR_INVALID_PARAMETERS);let e=t.toCID().toString();return new mn(`${zu}${e}`)}async function Ud(t,e,r){let n=new Map;for(let i of r){if(i==null)continue;if(i.multiaddr instanceof Uint8Array&&(i.multiaddr=Ue(i.multiaddr)),!Lr(i.multiaddr))throw new S("Multiaddr was invalid",je.ERR_INVALID_PARAMETERS);if(!await e(t,i.multiaddr))continue;let s=i.isCertified??!1,o=i.multiaddr.toString(),a=n.get(o);a!=null?i.isCertified=a.isCertified||s:n.set(o,{multiaddr:i.multiaddr,isCertified:s})}return[...n.values()].sort((i,s)=>i.multiaddr.toString().localeCompare(s.multiaddr.toString())).map(({isCertified:i,multiaddr:s})=>({isCertified:i,multiaddr:s.bytes}))}async function xo(t,e,r,n){if(e==null)throw new S("Invalid PeerData",je.ERR_INVALID_PARAMETERS);if(e.publicKey!=null&&t.publicKey!=null&&!Se(e.publicKey,t.publicKey))throw new S("publicKey bytes do not match peer id publicKey bytes",je.ERR_INVALID_PARAMETERS);let i=n.existingPeer;if(i!=null&&!t.equals(i.id))throw new S("peer id did not match existing peer id",je.ERR_INVALID_PARAMETERS);let s=i?.addresses??[],o=new Set(i?.protocols??[]),a=i?.metadata??new Map,c=i?.tags??new Map,u=i?.peerRecordEnvelope;if(r==="patch"){if((e.multiaddrs!=null||e.addresses!=null)&&(s=[],e.multiaddrs!=null&&s.push(...e.multiaddrs.map(f=>({isCertified:!1,multiaddr:f}))),e.addresses!=null&&s.push(...e.addresses)),e.protocols!=null&&(o=new Set(e.protocols)),e.metadata!=null){let f=e.metadata instanceof Map?[...e.metadata.entries()]:Object.entries(e.metadata);a=yo(f,{validate:Fd})}if(e.tags!=null){let f=e.tags instanceof Map?[...e.tags.entries()]:Object.entries(e.tags);c=yo(f,{validate:Kd,map:qd})}e.peerRecordEnvelope!=null&&(u=e.peerRecordEnvelope)}if(r==="merge"){if(e.multiaddrs!=null&&s.push(...e.multiaddrs.map(f=>({isCertified:!1,multiaddr:f}))),e.addresses!=null&&s.push(...e.addresses),e.protocols!=null&&(o=new Set([...o,...e.protocols])),e.metadata!=null){let f=e.metadata instanceof Map?[...e.metadata.entries()]:Object.entries(e.metadata);for(let[h,p]of f)p==null?a.delete(h):a.set(h,p);a=yo([...a.entries()],{validate:Fd})}if(e.tags!=null){let f=e.tags instanceof Map?[...e.tags.entries()]:Object.entries(e.tags),h=new Map(c);for(let[p,d]of f)d==null?h.delete(p):h.set(p,d);c=yo([...h.entries()],{validate:Kd,map:qd})}e.peerRecordEnvelope!=null&&(u=e.peerRecordEnvelope)}let l={addresses:await Ud(t,n.addressFilter??(async()=>!0),s),protocols:[...o.values()].sort((f,h)=>f.localeCompare(h)),metadata:a,tags:c,publicKey:i?.id.publicKey??e.publicKey??t.publicKey,peerRecordEnvelope:u};return t.type!=="RSA"&&delete l.publicKey,l}function yo(t,e){let r=new Map;for(let[n,i]of t)i!=null&&e.validate(n,i);for(let[n,i]of t.sort(([s],[o])=>s.localeCompare(o)))i!=null&&r.set(n,e.map?.(n,i)??i);return r}function Fd(t,e){if(typeof t!="string")throw new S("Metadata key must be a string",je.ERR_INVALID_PARAMETERS);if(!(e instanceof Uint8Array))throw new S("Metadata value must be a Uint8Array",je.ERR_INVALID_PARAMETERS)}function Kd(t,e){if(typeof t!="string")throw new S("Tag name must be a string",je.ERR_INVALID_PARAMETERS);if(e.value!=null){if(parseInt(`${e.value}`,10)!==e.value)throw new S("Tag value must be an integer",je.ERR_INVALID_PARAMETERS);if(e.value<0||e.value>100)throw new S("Tag value must be between 0-100",je.ERR_INVALID_PARAMETERS)}if(e.ttl!=null){if(parseInt(`${e.ttl}`,10)!==e.ttl)throw new S("Tag ttl must be an integer",je.ERR_INVALID_PARAMETERS);if(e.ttl<0)throw new S("Tag ttl must be between greater than 0",je.ERR_INVALID_PARAMETERS)}}function qd(t,e){let r;return e.expiry!=null&&(r=e.expiry),e.ttl!=null&&(r=BigInt(Date.now()+Number(e.ttl))),{value:e.value??0,expiry:r}}function bo(t,e,r){let n=t.toString().split("/")[2],i=pt.decode(n),s=Gn(i),o=r.get(s);if(o!=null)return o;let a=Jn(s,e);return r.set(s,a),a}function Aw(t,e){return t==null?{}:{prefix:zu,filters:(t.filters??[]).map(r=>({key:n,value:i})=>r(bo(n,i,e))),orders:(t.orders??[]).map(r=>(n,i)=>r(bo(n.key,n.value,e),bo(i.key,i.value,e)))}}var wo=class{peerId;datastore;lock;addressFilter;constructor(e,r={}){this.peerId=e.peerId,this.datastore=e.datastore,this.addressFilter=r.addressFilter,this.lock=$u({name:"peer-store",singleProcess:!0})}async has(e){return this.datastore.has(ei(e))}async delete(e){if(this.peerId.equals(e))throw new S("Cannot delete self peer",je.ERR_INVALID_PARAMETERS);await this.datastore.delete(ei(e))}async load(e){let r=await this.datastore.get(ei(e));return Jn(e,r)}async save(e,r){let{existingBuf:n,existingPeer:i}=await this.#e(e),s=await xo(e,r,"patch",{addressFilter:this.addressFilter});return this.#t(e,s,n,i)}async patch(e,r){let{existingBuf:n,existingPeer:i}=await this.#e(e),s=await xo(e,r,"patch",{addressFilter:this.addressFilter,existingPeer:i});return this.#t(e,s,n,i)}async merge(e,r){let{existingBuf:n,existingPeer:i}=await this.#e(e),s=await xo(e,r,"merge",{addressFilter:this.addressFilter,existingPeer:i});return this.#t(e,s,n,i)}async*all(e){let r=new wt;for await(let{key:n,value:i}of this.datastore.query(Aw(e??{},r))){let s=bo(n,i,r);s.id.equals(this.peerId)||(yield s)}}async#e(e){try{let r=await this.datastore.get(ei(e)),n=Jn(e,r);return{existingBuf:r,existingPeer:n}}catch(r){if(r.code!=="ERR_NOT_FOUND")throw r}return{}}async#t(e,r,n,i){let s=jn.encode(r);return n!=null&&Se(s,n)?{peer:Jn(e,s),previous:i,updated:!1}:(await this.datastore.put(ei(e),s),{peer:Jn(e,s),previous:i,updated:!0})}};var Eo=class{store;events;peerId;log;constructor(e,r={}){this.log=e.logger.forComponent("libp2p:peer-store"),this.events=e.events,this.peerId=e.peerId,this.store=new wo(e,r)}async forEach(e,r){this.log.trace("forEach await read lock");let n=await this.store.lock.readLock();this.log.trace("forEach got read lock");try{for await(let i of this.store.all(r))e(i)}finally{this.log.trace("forEach release read lock"),n()}}async all(e){this.log.trace("all await read lock");let r=await this.store.lock.readLock();this.log.trace("all got read lock");try{return await Ki(this.store.all(e))}finally{this.log.trace("all release read lock"),r()}}async delete(e){this.log.trace("delete await write lock");let r=await this.store.lock.writeLock();this.log.trace("delete got write lock");try{await this.store.delete(e)}finally{this.log.trace("delete release write lock"),r()}}async has(e){this.log.trace("has await read lock");let r=await this.store.lock.readLock();this.log.trace("has got read lock");try{return await this.store.has(e)}finally{this.log.trace("has release read lock"),r()}}async get(e){this.log.trace("get await read lock");let r=await this.store.lock.readLock();this.log.trace("get got read lock");try{return await this.store.load(e)}finally{this.log.trace("get release read lock"),r()}}async save(e,r){this.log.trace("save await write lock");let n=await this.store.lock.writeLock();this.log.trace("save got write lock");try{let i=await this.store.save(e,r);return this.#e(e,i),i.peer}finally{this.log.trace("save release write lock"),n()}}async patch(e,r){this.log.trace("patch await write lock");let n=await this.store.lock.writeLock();this.log.trace("patch got write lock");try{let i=await this.store.patch(e,r);return this.#e(e,i),i.peer}finally{this.log.trace("patch release write lock"),n()}}async merge(e,r){this.log.trace("merge await write lock");let n=await this.store.lock.writeLock();this.log.trace("merge got write lock");try{let i=await this.store.merge(e,r);return this.#e(e,i),i.peer}finally{this.log.trace("merge release write lock"),n()}}async consumePeerRecord(e,r){let n=await Wn.openAndCertify(e,hn.DOMAIN);if(r?.equals(n.peerId)===!1)return this.log("envelope peer id was not the expected peer id - expected: %p received: %p",r,n.peerId),!1;let i=hn.createFromProtobuf(n.payload),s;try{s=await this.get(n.peerId)}catch(o){if(o.code!=="ERR_NOT_FOUND")throw o}if(s?.peerRecordEnvelope!=null){let o=await Wn.createFromProtobuf(s.peerRecordEnvelope),a=hn.createFromProtobuf(o.payload);if(a.seqNumber>=i.seqNumber)return this.log("sequence number was lower or equal to existing sequence number - stored: %d received: %d",a.seqNumber,i.seqNumber),!1}return await this.patch(i.peerId,{peerRecordEnvelope:e,addresses:i.multiaddrs.map(o=>({isCertified:!0,multiaddr:o}))}),!0}#e(e,r){r.updated&&(this.peerId.equals(e)?this.events.safeDispatchEvent("self:peer:update",{detail:r}):this.events.safeDispatchEvent("peer:update",{detail:r}))}};function Iw(t){return t[Symbol.asyncIterator]!=null}function Rw(t){if(Iw(t))return(async()=>{for await(let e of t);})();for(let e of t);}var Hu=Rw;function Cw(t){let[e,r]=t[Symbol.asyncIterator]!=null?[t[Symbol.asyncIterator](),Symbol.asyncIterator]:[t[Symbol.iterator](),Symbol.iterator],n=[];return{peek:()=>e.next(),push:i=>{n.push(i)},next:()=>n.length>0?{done:!1,value:n.shift()}:e.next(),[r](){return this}}}var vo=Cw;function Tw(t){return t[Symbol.asyncIterator]!=null}function Bw(t,e){if(Tw(t))return async function*(){for await(let a of t)await e(a)&&(yield a)}();let r=vo(t),{value:n,done:i}=r.next();if(i===!0)return function*(){}();let s=e(n);if(typeof s.then=="function")return async function*(){await s&&(yield n);for await(let a of r)await e(a)&&(yield a)}();let o=e;return function*(){s===!0&&(yield n);for(let a of r)o(a)&&(yield a)}()}var Ut=Bw;function Lw(t){return t[Symbol.asyncIterator]!=null}function Pw(t,e){return Lw(t)?async function*(){yield*(await Ki(t)).sort(e)}():function*(){yield*Ki(t).sort(e)}()}var Gu=Pw;function Dw(t){return t[Symbol.asyncIterator]!=null}function Nw(t,e){return Dw(t)?async function*(){let r=0;if(!(e<1)){for await(let n of t)if(yield n,r++,r===e)return}}():function*(){let r=0;if(!(e<1)){for(let n of t)if(yield n,r++,r===e)return}}()}var Wu=Nw;var _o=class{put(e,r,n){return Promise.reject(new Error(".put is not implemented"))}get(e,r){return Promise.reject(new Error(".get is not implemented"))}has(e,r){return Promise.reject(new Error(".has is not implemented"))}delete(e,r){return Promise.reject(new Error(".delete is not implemented"))}async*putMany(e,r={}){for await(let{key:n,value:i}of e)await this.put(n,i,r),yield n}async*getMany(e,r={}){for await(let n of e)yield{key:n,value:await this.get(n,r)}}async*deleteMany(e,r={}){for await(let n of e)await this.delete(n,r),yield n}batch(){let e=[],r=[];return{put(n,i){e.push({key:n,value:i})},delete(n){r.push(n)},commit:async n=>{await Hu(this.putMany(e,n)),e=[],await Hu(this.deleteMany(r,n)),r=[]}}}async*_all(e,r){throw new Error("._all is not implemented")}async*_allKeys(e,r){throw new Error("._allKeys is not implemented")}query(e,r){let n=this._all(e,r);if(e.prefix!=null){let i=e.prefix;n=Ut(n,s=>s.key.toString().startsWith(i))}if(Array.isArray(e.filters)&&(n=e.filters.reduce((i,s)=>Ut(i,s),n)),Array.isArray(e.orders)&&(n=e.orders.reduce((i,s)=>Gu(i,s),n)),e.offset!=null){let i=0,s=e.offset;n=Ut(n,()=>i++>=s)}return e.limit!=null&&(n=Wu(n,e.limit)),n}queryKeys(e,r){let n=this._allKeys(e,r);if(e.prefix!=null){let i=e.prefix;n=Ut(n,s=>s.toString().startsWith(i))}if(Array.isArray(e.filters)&&(n=e.filters.reduce((i,s)=>Ut(i,s),n)),Array.isArray(e.orders)&&(n=e.orders.reduce((i,s)=>Gu(i,s),n)),e.offset!=null){let i=e.offset,s=0;n=Ut(n,()=>s++>=i)}return e.limit!=null&&(n=Wu(n,e.limit)),n}};var zd=ve(Yu(),1);function Hd(t){return t=t??new Error("Not Found"),(0,zd.default)(t,"ERR_NOT_FOUND")}var So=class extends _o{data;constructor(){super(),this.data=new Map}put(e,r){return this.data.set(e.toString(),r),e}get(e){let r=this.data.get(e.toString());if(r==null)throw Hd();return r}has(e){return this.data.has(e.toString())}delete(e){this.data.delete(e.toString())}*_all(){for(let[e,r]of this.data.entries())yield{key:new mn(e),value:r}}*_allKeys(){for(let e of this.data.keys())yield new mn(e)}};function Gd(t,e){let r;return function(){let n=function(){r=void 0,t()};clearTimeout(r),r=setTimeout(n,e)}}var Mw=t=>t;function Qu(t,e){let r=t.getPeerId();return r!=null&&ce(r).equals(e)&&(t=t.decapsulate(Ue(`/p2p/${e.toString()}`))),t}var Ao=class{log;components;listen;announce;observed;announceFilter;constructor(e,r={}){let{listen:n=[],announce:i=[]}=r;this.components=e,this.log=e.logger.forComponent("libp2p:address-manager"),this.listen=n.map(s=>s.toString()),this.announce=new Set(i.map(s=>s.toString())),this.observed=new Map,this.announceFilter=r.announceFilter??Mw,this._updatePeerStoreAddresses=Gd(this._updatePeerStoreAddresses.bind(this),1e3),e.events.addEventListener("transport:listening",()=>{this._updatePeerStoreAddresses()}),e.events.addEventListener("transport:close",()=>{this._updatePeerStoreAddresses()})}_updatePeerStoreAddresses(){let e=this.getAnnounceAddrs().concat(this.components.transportManager.getAddrs()).concat([...this.observed.entries()].filter(([r,n])=>n.confident).map(([r])=>Ue(r))).map(r=>r.getPeerId()===this.components.peerId.toString()?r.decapsulate(`/p2p/${this.components.peerId.toString()}`):r);this.components.peerStore.patch(this.components.peerId,{multiaddrs:e}).catch(r=>{this.log.error("error updating addresses",r)})}getListenAddrs(){return Array.from(this.listen).map(e=>Ue(e))}getAnnounceAddrs(){return Array.from(this.announce).map(e=>Ue(e))}getObservedAddrs(){return Array.from(this.observed).map(([e])=>Ue(e))}addObservedAddr(e){e=Qu(e,this.components.peerId);let r=e.toString();this.observed.has(r)||this.observed.set(r,{confident:!1})}confirmObservedAddr(e){e=Qu(e,this.components.peerId);let r=e.toString(),i=(this.observed.get(r)??{confident:!1}).confident;this.observed.set(r,{confident:!0}),i||this._updatePeerStoreAddresses()}removeObservedAddr(e){e=Qu(e,this.components.peerId);let r=e.toString();this.observed.delete(r)}getAddresses(){let e=this.getAnnounceAddrs().map(n=>n.toString());e.length===0&&(e=this.components.transportManager.getAddrs().map(n=>n.toString())),e=e.concat(Array.from(this.observed).filter(([n,i])=>i.confident).map(([n])=>n));let r=new Set(e);return this.announceFilter(Array.from(r).map(n=>Ue(n))).map(n=>n.protos().pop()?.path===!0||n.getPeerId()===this.components.peerId.toString()?n:n.encapsulate(`/p2p/${this.components.peerId.toString()}`))}};function Wd(t){return t!=null&&typeof t.start=="function"&&typeof t.stop=="function"}var Xu=class{components={};_started=!1;constructor(e={}){this.components={};for(let[r,n]of Object.entries(e))this.components[r]=n;this.components.logger==null&&(this.components.logger=Ws())}isStarted(){return this._started}async _invokeStartableMethod(e){await Promise.all(Object.values(this.components).filter(r=>Wd(r)).map(async r=>{await r[e]?.()}))}async beforeStart(){await this._invokeStartableMethod("beforeStart")}async start(){await this._invokeStartableMethod("start"),this._started=!0}async afterStart(){await this._invokeStartableMethod("afterStart")}async beforeStop(){await this._invokeStartableMethod("beforeStop")}async stop(){await this._invokeStartableMethod("stop"),this._started=!1}async afterStop(){await this._invokeStartableMethod("afterStop")}},Uw=["metrics","connectionProtector"],Fw=["components","isStarted","beforeStart","start","afterStart","beforeStop","stop","afterStop","then","_invokeStartableMethod"];function Yd(t={}){let e=new Xu(t);return new Proxy(e,{get(n,i,s){if(typeof i=="string"&&!Fw.includes(i)){let o=e.components[i];if(o==null&&!Uw.includes(i))throw new S(`${i} not set`,"ERR_SERVICE_MISSING");return o}return Reflect.get(n,i,s)},set(n,i,s){return typeof i=="string"?e.components[i]=s:Reflect.set(n,i,s),!0}})}var tp=ve(Qd(),1);var Xd="[a-fA-F\\d:]",Mr=t=>t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=${Xd})|(?<=${Xd})(?=\\s|$))`:"",Ft="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",ke="[a-fA-F\\d]{1,4}",Io=` -(?: -(?:${ke}:){7}(?:${ke}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 -(?:${ke}:){6}(?:${Ft}|:${ke}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 -(?:${ke}:){5}(?::${Ft}|(?::${ke}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4 -(?:${ke}:){4}(?:(?::${ke}){0,1}:${Ft}|(?::${ke}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4 -(?:${ke}:){3}(?:(?::${ke}){0,2}:${Ft}|(?::${ke}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4 -(?:${ke}:){2}(?:(?::${ke}){0,3}:${Ft}|(?::${ke}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4 -(?:${ke}:){1}(?:(?::${ke}){0,4}:${Ft}|(?::${ke}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 -(?::(?:(?::${ke}){0,5}:${Ft}|(?::${ke}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 -)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1 -`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),Kw=new RegExp(`(?:^${Ft}$)|(?:^${Io}$)`),qw=new RegExp(`^${Ft}$`),Vw=new RegExp(`^${Io}$`),Zu=t=>t&&t.exact?Kw:new RegExp(`(?:${Mr(t)}${Ft}${Mr(t)})|(?:${Mr(t)}${Io}${Mr(t)})`,"g");Zu.v4=t=>t&&t.exact?qw:new RegExp(`${Mr(t)}${Ft}${Mr(t)}`,"g");Zu.v6=t=>t&&t.exact?Vw:new RegExp(`${Mr(t)}${Io}${Mr(t)}`,"g");var Zd=Zu;var rp=ve(Jd(),1),{isValid:$w,parse:zw}=rp.default,Hw=["0.0.0.0/8","10.0.0.0/8","100.64.0.0/10","127.0.0.0/8","169.254.0.0/16","172.16.0.0/12","192.0.0.0/24","192.0.0.0/29","192.0.0.8/32","192.0.0.9/32","192.0.0.10/32","192.0.0.170/32","192.0.0.171/32","192.0.2.0/24","192.31.196.0/24","192.52.193.0/24","192.88.99.0/24","192.168.0.0/16","192.175.48.0/24","198.18.0.0/15","198.51.100.0/24","203.0.113.0/24","240.0.0.0/4","255.255.255.255/32"],Gw=Hw.map(t=>new tp.Netmask(t));function Ww(t){for(let e of Gw)if(e.contains(t))return!0;return!1}function ep(t){return/^::$/.test(t)||/^::1$/.test(t)||/^::f{4}:([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(t)||/^::f{4}:0.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(t)||/^64:ff9b::([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(t)||/^100::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2001::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2001:2[0-9a-fA-F]:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2001:db8:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2002:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^f[c-d]([0-9a-fA-F]{2,2}):/i.test(t)||/^fe[8-9a-bA-B][0-9a-fA-F]:/i.test(t)||/^ff([0-9a-fA-F]{2,2}):/i.test(t)}var np=t=>{if($w(t)){let e=zw(t);if(e.kind()==="ipv4")return Ww(e.toNormalizedString());if(e.kind()==="ipv6")return ep(t)}else if(Qn(t)&&Zd.v6().test(t))return ep(t)};var Co=np;function ip(t={}){return{denyDialPeer:async()=>!1,denyDialMultiaddr:async e=>{let r=e.stringTuples();return r[0][0]===4||r[0][0]===41?!!Co(`${r[0][1]}`):!1},denyInboundConnection:async()=>!1,denyOutboundConnection:async()=>!1,denyInboundEncryptedConnection:async()=>!1,denyOutboundEncryptedConnection:async()=>!1,denyInboundUpgradedConnection:async()=>!1,denyOutboundUpgradedConnection:async()=>!1,filterMultiaddrForPeer:async()=>!0,...t}}var $T=Symbol.for("@libp2p/transport");var Ur;(function(t){t[t.FATAL_ALL=0]="FATAL_ALL",t[t.NO_FATAL=1]="NO_FATAL"})(Ur||(Ur={}));var Yw=t=>t.toString().split("/").slice(1),Qi=t=>({match:e=>e.length<1?!1:t(e[0])?e.slice(1):!1,pattern:"fn"}),Le=t=>({match:e=>Qi(r=>r===t).match(e),pattern:t}),Lo=()=>({match:t=>Qi(e=>typeof e=="string").match(t),pattern:"{string}"}),sp=()=>({match:t=>Qi(e=>!isNaN(parseInt(e))).match(t),pattern:"{number}"}),Rt=()=>({match:t=>{if(t.length<2||t[0]!=="p2p"&&t[0]!=="ipfs")return!1;if(t[1].startsWith("Q")||t[1].startsWith("1"))try{_e.decode(`z${t[1]}`)}catch{return!1}else return!1;return t.slice(2)},pattern:"/p2p/{peerid}"}),To=()=>({match:t=>{if(t.length<2||t[0]!=="certhash")return!1;try{Ga.decode(t[1])}catch{return!1}return t.slice(2)},pattern:"/certhash/{certhash}"}),Xt=t=>({match:e=>{let r=t.match(e);return r===!1?e:r},pattern:`optional(${t.pattern})`}),Zt=(...t)=>({match:e=>{let r;for(let n of t){let i=n.match(e);i!==!1&&(r==null||i.lengthe.pattern).join(", ")})`}),Pe=(...t)=>({match:e=>{for(let r of t){let n=r.match(e);if(n===!1)return!1;e=n}return e},pattern:`and(${t.map(e=>e.pattern).join(", ")})`});function Fe(...t){function e(i){let s=Yw(i);for(let o of t){let a=o.match(s);if(a===!1)return!1;s=a}return s}function r(i){return e(i)!==!1}function n(i){let s=e(i);return s===!1?!1:s.length===0}return{matches:r,exactMatch:n}}var Ju=Pe(Le("dns4"),Lo()),el=Pe(Le("dns6"),Lo()),tl=Pe(Le("dnsaddr"),Lo()),op=Pe(Le("dns"),Lo()),QT=Fe(Ju),XT=Fe(el),ZT=Fe(tl),jT=Fe(Zt(op,tl,Ju,el)),ap=Pe(Le("ip4"),Qi(Js)),cp=Pe(Le("ip6"),Qi(eo)),up=Zt(ap,cp),Xi=Zt(up,op,Ju,el,tl),JT=Fe(Xi),e3=Fe(ap),t3=Fe(cp),r3=Fe(up),Po=Pe(Xi,Le("tcp"),sp()),Zi=Pe(Xi,Le("udp"),sp()),Qw=Zt(Po,Zi),n3=Fe(Po),i3=Fe(Zi),rl=Pe(Zi,Le("quic")),Do=Pe(Zi,Le("quic-v1")),Xw=Zt(rl,Do),s3=Fe(rl),o3=Fe(Do),ju=Zt(Xi,Po,Zi,rl,Do),lp=Zt(Pe(ju,Le("ws"),Xt(Rt()))),a3=Fe(lp),fp=Zt(Pe(ju,Le("wss"),Xt(Rt())),Pe(ju,Le("tls"),Le("ws"),Xt(Rt()))),c3=Fe(fp),hp=Pe(Qw,Le("webrtc-direct"),To(),Xt(To()),Xt(Rt())),u3=Fe(hp),dp=Pe(Do,Le("webtransport"),To(),To(),Xt(Rt())),l3=Fe(dp),Bo=Zt(lp,fp,Pe(Po,Xt(Rt())),Pe(Xw,Xt(Rt())),Pe(Xi,Xt(Rt())),hp,dp,Rt()),f3=Fe(Bo),Zw=Pe(Bo,Le("p2p-circuit"),Rt()),nl=Fe(Zw),jw=Zt(Pe(Bo,Le("p2p-circuit"),Le("webrtc"),Rt()),Pe(Bo,Le("webrtc"),Xt(Rt())),Le("webrtc")),h3=Fe(jw);function il(t){try{let{address:e}=t.nodeAddress();return!!Co(e)}catch{return!0}}function Jw(t,e){let r=il(t.multiaddr),n=il(e.multiaddr);return r&&!n?1:!r&&n?-1:0}function eE(t,e){return t.isCertified&&!e.isCertified?-1:!t.isCertified&&e.isCertified?1:0}function tE(t,e){let r=nl.exactMatch(t.multiaddr),n=nl.exactMatch(e.multiaddr);return r&&!n?1:!r&&n?-1:0}function ti(t,e){let r=Jw(t,e);if(r!==0)return r;let n=tE(t,e);return n!==0?n:eE(t,e)}var ol=ve(tu(),1),al=ve(gp(),1);function No(t,e,r){return`${t}?name=${e}&type=${r}`}async function yp(t,e){return await(await fetch(t,{headers:new Headers({accept:"application/dns-json"}),signal:e})).json()}function gn(t,e){return`${e}_${t}`}var sl=Object.assign((0,ol.default)("dns-over-http-resolver"),{error:(0,ol.default)("dns-over-http-resolver:error")}),cl=class{_cache;_TXTcache;_servers;_request;_abortControllers;constructor(e={}){this._cache=new al.default({max:e?.maxCache??100}),this._TXTcache=new al.default({max:e?.maxCache??100}),this._servers=["https://cloudflare-dns.com/dns-query","https://dns.google/resolve"],this._request=e.request??yp,this._abortControllers=[]}cancel(){this._abortControllers.forEach(e=>{e.abort()})}getServers(){return this._servers}_getShuffledServers(){let e=[...this._servers];for(let r=e.length-1;r>0;r--){let n=Math.floor(Math.random()*r),i=e[r];e[r]=e[n],e[n]=i}return e}setServers(e){this._servers=e}async resolve(e,r="A"){switch(r){case"A":return this.resolve4(e);case"AAAA":return this.resolve6(e);case"TXT":return this.resolveTxt(e);default:throw new Error(`${r} is not supported`)}}async resolve4(e){let r="A",n=this._cache.get(gn(e,r));if(n!=null)return n;let i=!1;for(let s of this._getShuffledServers()){let o=new AbortController;this._abortControllers.push(o);try{let a=await this._request(No(s,e,r),o.signal),c=a.Answer.map(l=>l.data),u=Math.min(...a.Answer.map(l=>l.TTL));return this._cache.set(gn(e,r),c,{ttl:u}),c}catch{o.signal.aborted&&(i=!0),sl.error(`${s} could not resolve ${e} record ${r}`)}finally{this._abortControllers=this._abortControllers.filter(a=>a!==o)}}throw i?Object.assign(new Error("queryA ECANCELLED"),{code:"ECANCELLED"}):new Error(`Could not resolve ${e} record ${r}`)}async resolve6(e){let r="AAAA",n=this._cache.get(gn(e,r));if(n!=null)return n;let i=!1;for(let s of this._getShuffledServers()){let o=new AbortController;this._abortControllers.push(o);try{let a=await this._request(No(s,e,r),o.signal),c=a.Answer.map(l=>l.data),u=Math.min(...a.Answer.map(l=>l.TTL));return this._cache.set(gn(e,r),c,{ttl:u}),c}catch{o.signal.aborted&&(i=!0),sl.error(`${s} could not resolve ${e} record ${r}`)}finally{this._abortControllers=this._abortControllers.filter(a=>a!==o)}}throw i?Object.assign(new Error("queryAaaa ECANCELLED"),{code:"ECANCELLED"}):new Error(`Could not resolve ${e} record ${r}`)}async resolveTxt(e){let r="TXT",n=this._TXTcache.get(gn(e,r));if(n!=null)return n;let i=!1;for(let s of this._getShuffledServers()){let o=new AbortController;this._abortControllers.push(o);try{let a=await this._request(No(s,e,r),o.signal),c=a.Answer.map(l=>[l.data.replace(/['"]+/g,"")]),u=Math.min(...a.Answer.map(l=>l.TTL));return this._TXTcache.set(gn(e,r),c,{ttl:u}),c}catch{o.signal.aborted&&(i=!0),sl.error(`${s} could not resolve ${e} record ${r}`)}finally{this._abortControllers=this._abortControllers.filter(a=>a!==o)}}throw i?Object.assign(new Error("queryTxt ECANCELLED"),{code:"ECANCELLED"}):new Error(`Could not resolve ${e} record ${r}`)}clearCache(){this._cache.clear(),this._TXTcache.clear()}},xp=cl;var bp=xp;var{code:oE}=fe("dnsaddr");async function ri(t,e={}){let r=new bp;e.signal!=null&&e.signal.addEventListener("abort",()=>{r.cancel()});let n=t.getPeerId(),[,i]=t.stringTuples().find(([a])=>a===oE)??[];if(i==null)throw new Error("No hostname found in multiaddr");let o=(await r.resolveTxt(`_dnsaddr.${i}`)).flat().map(a=>a.split("=")[1]).filter(Boolean);return n!=null&&(o=o.filter(a=>a.includes(n))),o}var Cp=ve(Rp(),1),Mo=Cp.default;var jt;(function(t){t.NOT_STARTED_YET="The libp2p node is not started yet",t.DHT_DISABLED="DHT is not available",t.PUBSUB_DISABLED="PubSub is not available",t.CONN_ENCRYPTION_REQUIRED="At least one connection encryption module is required",t.ERR_TRANSPORTS_REQUIRED="At least one transport module is required",t.ERR_PROTECTOR_REQUIRED="Private network is enforced, but no protector was provided",t.NOT_FOUND="Not found"})(jt||(jt={}));var F;(function(t){t.DHT_DISABLED="ERR_DHT_DISABLED",t.ERR_PUBSUB_DISABLED="ERR_PUBSUB_DISABLED",t.PUBSUB_NOT_STARTED="ERR_PUBSUB_NOT_STARTED",t.DHT_NOT_STARTED="ERR_DHT_NOT_STARTED",t.CONN_ENCRYPTION_REQUIRED="ERR_CONN_ENCRYPTION_REQUIRED",t.ERR_TRANSPORTS_REQUIRED="ERR_TRANSPORTS_REQUIRED",t.ERR_PROTECTOR_REQUIRED="ERR_PROTECTOR_REQUIRED",t.ERR_PEER_DIAL_INTERCEPTED="ERR_PEER_DIAL_INTERCEPTED",t.ERR_CONNECTION_INTERCEPTED="ERR_CONNECTION_INTERCEPTED",t.ERR_INVALID_PROTOCOLS_FOR_STREAM="ERR_INVALID_PROTOCOLS_FOR_STREAM",t.ERR_CONNECTION_ENDED="ERR_CONNECTION_ENDED",t.ERR_CONNECTION_FAILED="ERR_CONNECTION_FAILED",t.ERR_NODE_NOT_STARTED="ERR_NODE_NOT_STARTED",t.ERR_ALREADY_ABORTED="ERR_ALREADY_ABORTED",t.ERR_TOO_MANY_ADDRESSES="ERR_TOO_MANY_ADDRESSES",t.ERR_NO_VALID_ADDRESSES="ERR_NO_VALID_ADDRESSES",t.ERR_RELAYED_DIAL="ERR_RELAYED_DIAL",t.ERR_DIALED_SELF="ERR_DIALED_SELF",t.ERR_DISCOVERED_SELF="ERR_DISCOVERED_SELF",t.ERR_DUPLICATE_TRANSPORT="ERR_DUPLICATE_TRANSPORT",t.ERR_ENCRYPTION_FAILED="ERR_ENCRYPTION_FAILED",t.ERR_HOP_REQUEST_FAILED="ERR_HOP_REQUEST_FAILED",t.ERR_INVALID_KEY="ERR_INVALID_KEY",t.ERR_INVALID_MESSAGE="ERR_INVALID_MESSAGE",t.ERR_INVALID_PARAMETERS="ERR_INVALID_PARAMETERS",t.ERR_INVALID_PEER="ERR_INVALID_PEER",t.ERR_MUXER_UNAVAILABLE="ERR_MUXER_UNAVAILABLE",t.ERR_NOT_FOUND="ERR_NOT_FOUND",t.ERR_TRANSPORT_UNAVAILABLE="ERR_TRANSPORT_UNAVAILABLE",t.ERR_TRANSPORT_DIAL_FAILED="ERR_TRANSPORT_DIAL_FAILED",t.ERR_UNSUPPORTED_PROTOCOL="ERR_UNSUPPORTED_PROTOCOL",t.ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED="ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED",t.ERR_INVALID_MULTIADDR="ERR_INVALID_MULTIADDR",t.ERR_SIGNATURE_NOT_VALID="ERR_SIGNATURE_NOT_VALID",t.ERR_FIND_SELF="ERR_FIND_SELF",t.ERR_NO_ROUTERS_AVAILABLE="ERR_NO_ROUTERS_AVAILABLE",t.ERR_CONNECTION_NOT_MULTIPLEXED="ERR_CONNECTION_NOT_MULTIPLEXED",t.ERR_NO_DIAL_TOKENS="ERR_NO_DIAL_TOKENS",t.ERR_INVALID_CMS="ERR_INVALID_CMS",t.ERR_MISSING_KEYS="ERR_MISSING_KEYS",t.ERR_NO_KEY="ERR_NO_KEY",t.ERR_INVALID_KEY_NAME="ERR_INVALID_KEY_NAME",t.ERR_INVALID_KEY_TYPE="ERR_INVALID_KEY_TYPE",t.ERR_KEY_ALREADY_EXISTS="ERR_KEY_ALREADY_EXISTS",t.ERR_INVALID_KEY_SIZE="ERR_INVALID_KEY_SIZE",t.ERR_KEY_NOT_FOUND="ERR_KEY_NOT_FOUND",t.ERR_OLD_KEY_NAME_INVALID="ERR_OLD_KEY_NAME_INVALID",t.ERR_NEW_KEY_NAME_INVALID="ERR_NEW_KEY_NAME_INVALID",t.ERR_PASSWORD_REQUIRED="ERR_PASSWORD_REQUIRED",t.ERR_PEM_REQUIRED="ERR_PEM_REQUIRED",t.ERR_CANNOT_READ_KEY="ERR_CANNOT_READ_KEY",t.ERR_MISSING_PRIVATE_KEY="ERR_MISSING_PRIVATE_KEY",t.ERR_MISSING_PUBLIC_KEY="ERR_MISSING_PUBLIC_KEY",t.ERR_INVALID_OLD_PASS_TYPE="ERR_INVALID_OLD_PASS_TYPE",t.ERR_INVALID_NEW_PASS_TYPE="ERR_INVALID_NEW_PASS_TYPE",t.ERR_INVALID_PASS_LENGTH="ERR_INVALID_PASS_LENGTH",t.ERR_NOT_IMPLEMENTED="ERR_NOT_IMPLEMENTED",t.ERR_WRONG_PING_ACK="ERR_WRONG_PING_ACK",t.ERR_INVALID_RECORD="ERR_INVALID_RECORD",t.ERR_ALREADY_SUCCEEDED="ERR_ALREADY_SUCCEEDED",t.ERR_NO_HANDLER_FOR_PROTOCOL="ERR_NO_HANDLER_FOR_PROTOCOL",t.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS="ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS",t.ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS="ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS",t.ERR_CONNECTION_DENIED="ERR_CONNECTION_DENIED",t.ERR_TRANSFER_LIMIT_EXCEEDED="ERR_TRANSFER_LIMIT_EXCEEDED"})(F||(F={}));var hE={addresses:{listen:[],announce:[],noAnnounce:[],announceFilter:t=>t},connectionManager:{resolvers:{dnsaddr:ri},addressSorter:ti},transportManager:{faultTolerance:Ur.FATAL_ALL}};function Tp(t){let e=Mo(hE,t);if(e.transports==null||e.transports.length<1)throw new S(jt.ERR_TRANSPORTS_REQUIRED,F.ERR_TRANSPORTS_REQUIRED);if(e.connectionProtector===null&&globalThis.process?.env?.LIBP2P_FORCE_PNET!=null)throw new S(jt.ERR_PROTECTOR_REQUIRED,F.ERR_PROTECTOR_REQUIRED);return e}var Bp="keep-alive";var Cm=ve(Sm(),1);function Fo(t){if(Ys(t))return{peerId:t,multiaddrs:[]};Array.isArray(t)||(t=[t]);let e;if(t.length>0){let r=t[0].getPeerId();e=r==null?void 0:ce(r),t.forEach(n=>{if(!Lr(n))throw new S("Invalid Multiaddr",F.ERR_INVALID_MULTIADDR);let i=n.getPeerId();if(i==null){if(e!=null)throw new S("Multiaddrs must all have the same peer id or have no peer id",F.ERR_INVALID_PARAMETERS)}else{let s=ce(i);if(e==null||!e.equals(s))throw new S("Multiaddrs must all have the same peer id or have no peer id",F.ERR_INVALID_PARAMETERS)}})}return{peerId:e,multiaddrs:t}}function YE(t,e,r){let n=0,i=t.length;for(;i>0;){let s=Math.trunc(i/2),o=n+s;r(t[o],e)<=0?(n=++o,i-=s+1):i=s}return n}var Al=class{#e=[];enqueue(e,r){let n=r?.peerId,i=r?.priority??0;if(n==null)throw new S("missing peer id",m0);let s={priority:i,peerId:n,run:e};if(this.size>0&&this.#e[this.size-1].priority>=i){this.#e.push(s);return}let o=YE(this.#e,s,(a,c)=>c.priority-a.priority);this.#e.splice(o,0,s)}dequeue(){return this.#e.shift()?.run}filter(e){if(e.peerId!=null){let r=e.peerId;return this.#e.filter(n=>r.equals(n.peerId)).map(n=>n.run)}return this.#e.filter(r=>r.priority===e.priority).map(r=>r.run)}get size(){return this.#e.length}},Ko=class extends Nr{constructor(e={}){super({...e,queueClass:Al})}hasJob(e){return this.sizeBy({peerId:e})>0}};var qo="last-dial-failure";var Vo=5,$o=100,zo=50,Am=1e3*60*7;var yn={minConnections:Vo,maxQueueLength:100,autoDialConcurrency:25,autoDialPriority:0,autoDialInterval:5e3,autoDialPeerRetryThreshold:Am,autoDialDiscoveredPeersDebounce:10},Ho=class{connectionManager;peerStore;queue;minConnections;autoDialPriority;autoDialIntervalMs;autoDialMaxQueueLength;autoDialPeerRetryThresholdMs;autoDialDiscoveredPeersDebounce;autoDialInterval;started;running;log;constructor(e,r){this.connectionManager=e.connectionManager,this.peerStore=e.peerStore,this.minConnections=r.minConnections??yn.minConnections,this.autoDialPriority=r.autoDialPriority??yn.autoDialPriority,this.autoDialIntervalMs=r.autoDialInterval??yn.autoDialInterval,this.autoDialMaxQueueLength=r.maxQueueLength??yn.maxQueueLength,this.autoDialPeerRetryThresholdMs=r.autoDialPeerRetryThreshold??yn.autoDialPeerRetryThreshold,this.autoDialDiscoveredPeersDebounce=r.autoDialDiscoveredPeersDebounce??yn.autoDialDiscoveredPeersDebounce,this.log=e.logger.forComponent("libp2p:connection-manager:auto-dial"),this.started=!1,this.running=!1,this.queue=new Ko({concurrency:r.autoDialConcurrency??yn.autoDialConcurrency}),this.queue.addListener("error",i=>{this.log.error("error during auto-dial",i)}),e.events.addEventListener("connection:close",()=>{this.autoDial().catch(i=>{this.log.error(i)})});let n;e.events.addEventListener("peer:discovery",()=>{clearTimeout(n),n=setTimeout(()=>{this.autoDial().catch(i=>{this.log.error(i)})},this.autoDialDiscoveredPeersDebounce)})}isStarted(){return this.started}start(){this.autoDialInterval=setTimeout(()=>{this.autoDial().catch(e=>{this.log.error("error while autodialing",e)})},this.autoDialIntervalMs),this.started=!0}afterStart(){this.autoDial().catch(e=>{this.log.error("error while autodialing",e)})}stop(){this.queue.clear(),clearTimeout(this.autoDialInterval),this.started=!1,this.running=!1}async autoDial(){if(!this.started)return;let e=this.connectionManager.getConnectionsMap(),r=e.size;if(r>=this.minConnections){this.minConnections>0&&this.log.trace("have enough connections %d/%d",r,this.minConnections);return}if(this.queue.size>this.autoDialMaxQueueLength){this.log("not enough connections %d/%d but auto dial queue is full",r,this.minConnections);return}if(this.running){this.log("not enough connections %d/%d - but skipping autodial as it is already running",r,this.minConnections);return}this.running=!0,this.log("not enough connections %d/%d - will dial peers to increase the number of connections",r,this.minConnections);let n=new ln(this.connectionManager.getDialQueue().map(u=>u.peerId).filter(Boolean)),i=await this.peerStore.all({filters:[u=>u.addresses.length===0?(this.log.trace("not autodialing %p because they have no addresses",u.id),!1):e.has(u.id)?(this.log.trace("not autodialing %p because they are already connected",u.id),!1):n.has(u.id)?(this.log.trace("not autodialing %p because they are already being dialed",u.id),!1):this.queue.hasJob(u.id)?(this.log.trace("not autodialing %p because they are already being autodialed",u.id),!1):!0]}),s=i.sort(()=>Math.random()>.5?1:-1),o=new wt;for(let u of s)o.has(u.id)||o.set(u.id,[...u.tags.values()].reduce((l,f)=>l+f.value,0));let c=s.sort((u,l)=>{let f=o.get(u.id)??0,h=o.get(l.id)??0;return f>h?-1:f{let l=u.metadata.get(qo);if(l==null)return!0;let f=parseInt(se(l));return isNaN(f)?!0:Date.now()-f>this.autoDialPeerRetryThresholdMs});this.log("selected %d/%d peers to dial",c.length,i.length);for(let u of c)this.queue.add(async()=>{let l=this.connectionManager.getConnectionsMap().size;if(l>=this.minConnections){this.log("got enough connections now %d/%d",l,this.minConnections),this.queue.clear();return}this.log("connecting to a peerStore stored peer %p",u.id),await this.connectionManager.openConnection(u.id,{priority:this.autoDialPriority})},{peerId:u.id}).catch(l=>{this.log.error("could not connect to peerStore stored peer",l)});this.running=!1,this.started&&(this.autoDialInterval=setTimeout(()=>{this.autoDial().catch(u=>{this.log.error("error while autodialing",u)})},this.autoDialIntervalMs))}};var Im={maxConnections:$o,allow:[]},Go=class{maxConnections;connectionManager;peerStore;allow;events;log;constructor(e,r={}){this.maxConnections=r.maxConnections??Im.maxConnections,this.allow=r.allow??Im.allow,this.connectionManager=e.connectionManager,this.peerStore=e.peerStore,this.events=e.events,this.log=e.logger.forComponent("libp2p:connection-manager:connection-pruner"),e.events.addEventListener("connection:open",()=>{this.maybePruneConnections().catch(n=>{this.log.error(n)})})}async maybePruneConnections(){let e=this.connectionManager.getConnections(),r=e.length,n=Math.max(r-this.maxConnections,0);if(this.log("checking max connections limit %d/%d",r,this.maxConnections),r<=this.maxConnections)return;this.log("max connections limit exceeded %d/%d, pruning %d connection(s)",r,this.maxConnections,n);let i=new wt;for(let a of e){let c=a.remotePeer;if(!i.has(c)){i.set(c,0);try{let u=await this.peerStore.get(c);i.set(c,[...u.tags.values()].reduce((l,f)=>l+f.value,0))}catch(u){u.code!=="ERR_NOT_FOUND"&&this.log.error("error loading peer tags",u)}}}let s=e.sort((a,c)=>{let u=i.get(a.remotePeer)??0,l=i.get(c.remotePeer)??0;if(u>l)return 1;if(uh?-1:0}),o=[];for(let a of s)if(this.log("too many connections open - closing a connection to %p",a.remotePeer),this.allow.some(u=>a.remoteAddr.toString().startsWith(u.toString()))||o.push(a),o.length===n)break;await Promise.all(o.map(async a=>{try{await a.close()}catch(c){this.log.error(c)}})),this.events.safeDispatchEvent("connection:prune",{detail:o})}};function Wo(t){let e=new globalThis.AbortController;function r(){e.abort();for(let s of t)s?.removeEventListener!=null&&s.removeEventListener("abort",r)}for(let s of t){if(s?.aborted===!0){r();break}s?.addEventListener!=null&&s.addEventListener("abort",r)}function n(){for(let s of t)s?.removeEventListener!=null&&s.removeEventListener("abort",r)}let i=e.signal;return i.clear=n,i}function ut(){let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}async function Tl(t,e){if(!t.protoNames().includes("dnsaddr"))return[t];let n=await ZE(t,e),o=(await Promise.all(n.map(async a=>Tl(a,e)))).flat().reduce((a,c)=>(a.find(u=>u.equals(c))==null&&a.push(c),a),[]);return e.log("resolved %s to",t,o.map(a=>a.toString())),o}async function ZE(t,e){try{return t=Ue(t.toString()),await t.resolve(e)}catch(r){return e.log.error(`multiaddr ${t.toString()} could not be resolved`,r),[]}}function Rm(...t){let e=[];for(let n of t)n!=null&&(yt(1/0,n),e.push(n));let r=Wo(e);return yt(1/0,r),r}var Yo={addressSorter:ti,maxParallelDials:zo,maxPeerAddrsToDial:25,dialTimeout:3e4,resolvers:{dnsaddr:ri}},Qo=class{pendingDials;queue;peerId;peerStore;connectionGater;transportManager;addressSorter;maxPeerAddrsToDial;dialTimeout;inProgressDialCount;pendingDialCount;shutDownController;connections;log;constructor(e,r={}){this.addressSorter=r.addressSorter??Yo.addressSorter,this.maxPeerAddrsToDial=r.maxPeerAddrsToDial??Yo.maxPeerAddrsToDial,this.dialTimeout=r.dialTimeout??Yo.dialTimeout,this.connections=r.connections??new wt,this.log=e.logger.forComponent("libp2p:connection-manager:dial-queue"),this.peerId=e.peerId,this.peerStore=e.peerStore,this.connectionGater=e.connectionGater,this.transportManager=e.transportManager,this.shutDownController=new AbortController,yt(1/0,this.shutDownController.signal),this.pendingDialCount=e.metrics?.registerMetric("libp2p_dial_queue_pending_dials"),this.inProgressDialCount=e.metrics?.registerMetric("libp2p_dial_queue_in_progress_dials"),this.pendingDials=[];for(let[n,i]of Object.entries(r.resolvers??{}))ro.set(n,i);this.queue=new Nr({concurrency:r.maxParallelDials??Yo.maxParallelDials}),this.queue.on("add",()=>{this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)}),this.queue.on("active",()=>{this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)}),this.queue.on("completed",()=>{this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)}),this.queue.on("error",n=>{this.log.error("error in dial queue",n),this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)}),this.queue.on("empty",()=>{this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)}),this.queue.on("idle",()=>{this.pendingDialCount?.update(this.queue.size),this.inProgressDialCount?.update(this.queue.pending)})}stop(){this.shutDownController.abort()}async dial(e,r={}){let{peerId:n,multiaddrs:i}=Fo(e),s=i.map(h=>({multiaddr:h,isCertified:!1})),o=this.createDialAbortControllers(r.signal),a;try{a=await this.calculateMultiaddrs(n,s,{...r,signal:o})}catch(h){throw o.clear(),h}let c=Array.from(this.connections.values()).flat().find(h=>r.force===!0?!1:a.find(p=>p.multiaddr.equals(h.remoteAddr)));if(c!=null)return this.log("already connected to %a",c.remoteAddr),c;let u=this.pendingDials.find(h=>!!(h.peerId!=null&&n!=null&&h.peerId.equals(n)||a.map(({multiaddr:p})=>p.toString()).join()===h.multiaddrs.map(p=>p.toString()).join()));if(u!=null)return this.log("joining existing dial target for %p",n),o.clear(),u.promise;this.log("creating dial target for",a.map(({multiaddr:h})=>h.toString()));let l={id:jE(),status:"queued",peerId:n,multiaddrs:a.map(({multiaddr:h})=>h)};l.promise=this.performDial(l,{...r,signal:o}).finally(()=>{this.pendingDials=this.pendingDials.filter(h=>h.id!==l.id),o.clear()}).catch(async h=>{if(this.log.error("dial failed to %s",l.multiaddrs.map(p=>p.toString()).join(", "),h),n!=null)try{await this.peerStore.patch(n,{metadata:{[qo]:Q(Date.now().toString())}})}catch(p){this.log.error("could not update last dial failure key for %p",n,p)}throw o.aborted?new S(h.message,vs):h}),this.pendingDials.push(l);let f=await l.promise;return c=Array.from(this.connections.values()).flat().find(h=>r.force===!0?!1:h.id!==f.id&&h.remoteAddr.equals(f.remoteAddr)),c!=null?(this.log("already connected to %a",c.remoteAddr),await f.close(),c):(this.log("connection opened to %a",f.remoteAddr),f)}createDialAbortControllers(e){let r=Wo([AbortSignal.timeout(this.dialTimeout),this.shutDownController.signal,e]);try{yt?.(1/0,r)}catch{}return r}async calculateMultiaddrs(e,r=[],n={}){if(e!=null){if(this.peerId.equals(e))throw new S("Tried to dial self",F.ERR_DIALED_SELF);if(await this.connectionGater.denyDialPeer?.(e)===!0)throw new S("The dial request is blocked by gater.allowDialPeer",F.ERR_PEER_DIAL_INTERCEPTED);if(r.length===0){this.log("loading multiaddrs for %p",e);try{let l=await this.peerStore.get(e);r.push(...l.addresses),this.log("loaded multiaddrs for %p",e,r.map(({multiaddr:f})=>f.toString()))}catch(l){if(l.code!==F.ERR_NOT_FOUND)throw l}}}let i=(await Promise.all(r.map(async l=>{let f=await Tl(l.multiaddr,{...n,log:this.log});return f.length===1&&f[0].equals(l.multiaddr)?l:f.map(h=>({multiaddr:h,isCertified:!1}))}))).flat();if(e!=null){let l=`/p2p/${e.toString()}`;i=i.map(f=>f.multiaddr.protos().pop()?.path===!0?f:f.multiaddr.getPeerId()==null?{multiaddr:f.multiaddr.encapsulate(l),isCertified:f.isCertified}:f)}let s=i.filter(l=>{if(this.transportManager.transportForMultiaddr(l.multiaddr)==null)return!1;let f=l.multiaddr.getPeerId();return e!=null&&f!=null?e.equals(f):!0}),o=new Map;for(let l of s){let f=l.multiaddr.toString(),h=o.get(f);if(h!=null){h.isCertified=h.isCertified||l.isCertified||!1;continue}o.set(f,l)}let a=[...o.values()];if((a.length===0||a.length>this.maxPeerAddrsToDial)&&(this.log("addresses for %p before filtering",e??"unknown peer",i.map(({multiaddr:l})=>l.toString())),this.log("addresses for %p after filtering",e??"unknown peer",a.map(({multiaddr:l})=>l.toString()))),a.length===0)throw new S("The dial request has no valid addresses",F.ERR_NO_VALID_ADDRESSES);if(a.length>this.maxPeerAddrsToDial)throw new S("dial with more addresses than allowed",F.ERR_TOO_MANY_ADDRESSES);let c=[];for(let l of a)this.connectionGater.denyDialMultiaddr!=null&&await this.connectionGater.denyDialMultiaddr(l.multiaddr)||c.push(l);let u=c.sort(this.addressSorter);if(u.length===0)throw new S("The connection gater denied all addresses in the dial request",F.ERR_NO_VALID_ADDRESSES);return u}async performDial(e,r={}){let n=e.multiaddrs.map(()=>new AbortController);try{let i=new Nr({concurrency:1});i.on("error",o=>{this.log.error("error dialing %s %o",e.multiaddrs,o)});let s=await Promise.any(e.multiaddrs.map(async(o,a)=>{let c=n[a];if(c==null)throw new S("dialAction did not come with an AbortController",F.ERR_INVALID_PARAMETERS);let u=Rm(c.signal,r.signal);u.addEventListener("abort",()=>{this.log("dial to %a aborted",o)});let l=ut();return await i.add(async()=>{if(u.aborted){this.log("dial to %a was aborted before reaching the head of the peer dial queue",o),l.reject(new Rn);return}await this.queue.add(async()=>{try{if(u.aborted){this.log("dial to %a was aborted before reaching the head of the dial queue",o),l.reject(new Rn);return}e.status="active";let f=await this.transportManager.dial(o,{...r,signal:u});if(c.signal.aborted){this.log("multiple dials succeeded, closing superfluous connection"),f.close().catch(h=>{this.log.error("error closing superfluous connection",h)}),l.reject(new Rn);return}n[a]=void 0,n.forEach(h=>{h!==void 0&&h.abort()}),this.log("dial to %a succeeded",o),l.resolve(f)}catch(f){this.log.error("error during dial of %a",o,f),l.reject(f)}},{...r,signal:u}).catch(f=>{l.reject(f)})},{signal:u}).catch(f=>{l.reject(f)}).finally(()=>{u.clear()}),l.promise}));if(s==null)throw new S("successful dial led to empty object returned from peer dial queue",F.ERR_TRANSPORT_DIAL_FAILED);return e.status="success",s}catch(i){throw e.status="error",e.multiaddrs.length===1&&i.name==="AggregateError"?i.errors[0]:i}}};function jE(){return`${parseInt(String(Math.random()*1e9),10).toString()}${Date.now()}`}var tv=50,xn={minConnections:Vo,maxConnections:$o,inboundConnectionThreshold:5,maxIncomingPendingConnections:10,autoDialConcurrency:25,autoDialPriority:0,autoDialMaxQueueLength:100},Xo=class{started;connections;allow;deny;maxIncomingPendingConnections;incomingPendingConnections;maxConnections;dialQueue;autoDial;connectionPruner;inboundConnectionRateLimiter;peerStore;metrics;events;log;constructor(e,r={}){this.maxConnections=r.maxConnections??xn.maxConnections;let n=r.minConnections??xn.minConnections;if(this.maxConnectionsUe(i)),this.deny=(r.deny??[]).map(i=>Ue(i)),this.incomingPendingConnections=0,this.maxIncomingPendingConnections=r.maxIncomingPendingConnections??xn.maxIncomingPendingConnections,this.inboundConnectionRateLimiter=new Cm.RateLimiterMemory({points:r.inboundConnectionThreshold??xn.inboundConnectionThreshold,duration:1}),this.autoDial=new Ho({connectionManager:this,peerStore:e.peerStore,events:e.events,logger:e.logger},{minConnections:n,autoDialConcurrency:r.autoDialConcurrency??xn.autoDialConcurrency,autoDialPriority:r.autoDialPriority??xn.autoDialPriority,maxQueueLength:r.autoDialMaxQueueLength??xn.autoDialMaxQueueLength}),this.connectionPruner=new Go({connectionManager:this,peerStore:e.peerStore,events:e.events,logger:e.logger},{maxConnections:this.maxConnections,allow:this.allow}),this.dialQueue=new Qo({peerId:e.peerId,metrics:e.metrics,peerStore:e.peerStore,transportManager:e.transportManager,connectionGater:e.connectionGater,logger:e.logger},{addressSorter:r.addressSorter??ti,maxParallelDials:r.maxParallelDials??zo,maxPeerAddrsToDial:r.maxPeerAddrsToDial??25,dialTimeout:r.dialTimeout??3e4,resolvers:r.resolvers??{dnsaddr:ri},connections:this.connections})}isStarted(){return this.started}async start(){this.metrics?.registerMetricGroup("libp2p_connection_manager_connections",{calculate:()=>{let e={inbound:0,outbound:0};for(let r of this.connections.values())for(let n of r)n.direction==="inbound"?e.inbound++:e.outbound++;return e}}),this.metrics?.registerMetricGroup("libp2p_protocol_streams_total",{label:"protocol",calculate:()=>{let e={};for(let r of this.connections.values())for(let n of r)for(let i of n.streams){let s=`${i.direction} ${i.protocol??"unnegotiated"}`;e[s]=(e[s]??0)+1}return e}}),this.metrics?.registerMetricGroup("libp2p_connection_manager_protocol_streams_per_connection_90th_percentile",{label:"protocol",calculate:()=>{let e={};for(let n of this.connections.values())for(let i of n){let s={};for(let o of i.streams){let a=`${o.direction} ${o.protocol??"unnegotiated"}`;s[a]=(s[a]??0)+1}for(let[o,a]of Object.entries(s))e[o]=e[o]??[],e[o].push(a)}let r={};for(let[n,i]of Object.entries(e)){i=i.sort((o,a)=>o-a);let s=Math.floor(i.length*.9);r[n]=i[s]}return r}}),this.autoDial.start(),this.started=!0,this.log("started")}async afterStart(){Promise.resolve().then(async()=>{let e=await this.peerStore.all({filters:[r=>r.tags.has(Bp)]});await Promise.all(e.map(async r=>{await this.openConnection(r.id).catch(n=>{this.log.error(n)})}))}).catch(e=>{this.log.error(e)}),this.autoDial.afterStart()}async stop(){this.dialQueue.stop(),this.autoDial.stop();let e=[];for(let r of this.connections.values())for(let n of r)e.push((async()=>{try{await n.close()}catch(i){this.log.error(i)}})());this.log("closing %d connections",e.length),await Promise.all(e),this.connections.clear(),this.log("stopped")}onConnect(e){this._onConnect(e).catch(r=>{this.log.error(r)})}async _onConnect(e){let{detail:r}=e;if(!this.started){await r.close();return}let n=r.remotePeer,i=this.connections.get(n),s=!1;i!=null?i.push(r):(s=!0,this.connections.set(n,[r])),n.publicKey!=null&&n.type==="RSA"&&await this.peerStore.patch(n,{publicKey:n.publicKey}),s&&this.events.safeDispatchEvent("peer:connect",{detail:r.remotePeer})}onDisconnect(e){let{detail:r}=e;if(!this.started)return;let n=r.remotePeer,i=this.connections.get(n);i!=null&&i.length>1?(i=i.filter(s=>s.id!==r.id),this.connections.set(n,i)):i!=null&&(this.connections.delete(n),this.events.safeDispatchEvent("peer:disconnect",{detail:r.remotePeer}))}getConnections(e){if(e!=null)return this.connections.get(e)??[];let r=[];for(let n of this.connections.values())r=r.concat(n);return r}getConnectionsMap(){return this.connections}async openConnection(e,r={}){if(!this.isStarted())throw new S("Not started",F.ERR_NODE_NOT_STARTED);r.signal?.throwIfAborted();let{peerId:n}=Fo(e);if(n!=null&&r.force!==!0){this.log("dial %p",n);let a=this.getConnections(n).find(c=>!c.transient);if(a!=null)return this.log("had an existing non-transient connection to %p",n),a}let i=await this.dialQueue.dial(e,{...r,priority:r.priority??tv}),s=this.connections.get(i.remotePeer);s==null&&(s=[],this.connections.set(i.remotePeer,s));let o=!1;for(let a of s)a.id===i.id&&(o=!0);return o||s.push(i),i}async closeConnections(e,r={}){let n=this.connections.get(e)??[];await Promise.all(n.map(async i=>{try{await i.close(r)}catch(s){i.abort(s)}}))}async acceptIncomingConnection(e){if(this.deny.some(i=>e.remoteAddr.toString().startsWith(i.toString())))return this.log("connection from %a refused - connection remote address was in deny list",e.remoteAddr),!1;if(this.allow.some(i=>e.remoteAddr.toString().startsWith(i.toString())))return this.incomingPendingConnections++,!0;if(this.incomingPendingConnections===this.maxIncomingPendingConnections)return this.log("connection from %a refused - incomingPendingConnections exceeded by host",e.remoteAddr),!1;if(e.remoteAddr.isThinWaistAddress()){let i=e.remoteAddr.nodeAddress().address;try{await this.inboundConnectionRateLimiter.consume(i,1)}catch{return this.log("connection from %a refused - inboundConnectionThreshold exceeded by host %s",e.remoteAddr,i),!1}}return this.getConnections().length0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},ui=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new Zo(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let r=this.head;this.head=r.next=new Zo(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var Pl=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function jo(t={}){return rv(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},t)}function rv(t,e){e=e??{};let r=e.onEnd,n=new ui,i,s,o,a=ut(),c=async()=>{try{return n.isEmpty()?o?{done:!0}:await new Promise((g,y)=>{s=x=>{s=null,n.push(x);try{g(t(n))}catch(b){y(b)}return i}}):t(n)}finally{n.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=ut()})}},u=g=>s!=null?s(g):(n.push(g),i),l=g=>(n=new ui,s!=null?s({error:g}):(n.push({error:g}),i)),f=g=>{if(o)return i;if(e?.objectMode!==!0&&g?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return u({done:!1,value:g})},h=g=>o?i:(o=!0,g!=null?l(g):u({done:!0})),p=()=>(n=new ui,h(),{done:!0}),d=g=>(h(g),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:c,return:p,throw:d,push:f,end:h,get readableLength(){return n.size},onEmpty:async g=>{let y=g?.signal;if(y?.throwIfAborted(),n.isEmpty())return;let x,b;y!=null&&(x=new Promise((I,v)=>{b=()=>{v(new Pl)},y.addEventListener("abort",b)}));try{await Promise.race([a.promise,x])}finally{b!=null&&y!=null&&y?.removeEventListener("abort",b)}}},r==null)return i;let m=i;return i={[Symbol.asyncIterator](){return this},next(){return m.next()},throw(g){return m.throw(g),r!=null&&(r(g),r=void 0),{done:!0}},return(){return m.return(),r!=null&&(r(),r=void 0),{done:!0}},push:f,end(g){return m.end(g),r!=null&&(r(g),r=void 0),i},get readableLength(){return m.readableLength},onEmpty:g=>m.onEmpty(g)},i}function nv(t){return t[Symbol.asyncIterator]!=null}function iv(...t){let e=[];for(let r of t)nv(r)||e.push(r);return e.length===t.length?function*(){for(let r of e)yield*r}():async function*(){let r=jo({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(t.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var bn=iv;function Ji(t,...e){if(t==null)throw new Error("Empty pipeline");if(Dl(t)){let n=t;t=()=>n.source}else if(Bm(t)||Tm(t)){let n=t;t=()=>n}let r=[t,...e];if(r.length>1&&Dl(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n{let e;for(;t.length>0;)e=t.shift()(e);return e},Tm=t=>t?.[Symbol.asyncIterator]!=null,Bm=t=>t?.[Symbol.iterator]!=null,Dl=t=>t==null?!1:t.sink!=null&&t.source!=null,ov=t=>e=>{let r=t.sink(e);if(r?.then!=null){let n=jo({objectMode:!0});r.then(()=>{n.end()},o=>{n.end(o)});let i,s=t.source;if(Tm(s))i=async function*(){yield*s,n.end()};else if(Bm(s))i=function*(){yield*s,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return bn(n,i())}return t.source};function av(t){return t[Symbol.asyncIterator]!=null}function cv(t,e){if(av(t))return async function*(){for await(let a of t)yield e(a)}();let r=vo(t),{value:n,done:i}=r.next();if(i===!0)return function*(){}();let s=e(n);if(typeof s.then=="function")return async function*(){yield await s;for await(let a of r)yield e(a)}();let o=e;return function*(){yield s;for(let a of r)yield o(a)}()}var Lm=cv;async function*es(t,e){yield*Lm(t,async r=>(await e.merge(r.id,{multiaddrs:r.multiaddrs}),r))}function Jo(t){let e=new Set;return Ut(t,r=>e.has(r.id.toString())?!1:(e.add(r.id.toString()),!0))}async function*ea(t,e=1){let r=0;for await(let n of t)r++,yield n;if(rn.findProviders(e,r))),n=>es(n,this.components.peerStore),n=>Jo(n),n=>ea(n))}async provide(e,r={}){if(this.routers.length===0)throw new S("No content routers available",F.ERR_NO_ROUTERS_AVAILABLE);await Promise.all(this.routers.map(async n=>{await n.provide(e,r)}))}async put(e,r,n){if(!this.isStarted())throw new S(jt.NOT_STARTED_YET,F.DHT_NOT_STARTED);await Promise.all(this.routers.map(async i=>{await i.put(e,r,n)}))}async get(e,r){if(!this.isStarted())throw new S(jt.NOT_STARTED_YET,F.DHT_NOT_STARTED);return Promise.any(this.routers.map(async n=>n.get(e,r)))}};function uv(t){return t[Symbol.asyncIterator]!=null}function lv(t){if(uv(t))return(async()=>{for await(let e of t)return e})();for(let e of t)return e}var Pm=lv;var ra=class{log;peerId;peerStore;routers;constructor(e,r){this.log=e.logger.forComponent("libp2p:peer-routing"),this.peerId=e.peerId,this.peerStore=e.peerStore,this.routers=r.routers??[]}async findPeer(e,r){if(this.routers.length===0)throw new S("No peer routers available",F.ERR_NO_ROUTERS_AVAILABLE);if(e.toString()===this.peerId.toString())throw new S("Should not try to find self",F.ERR_FIND_SELF);let n=this,i=await Ji(bn(...this.routers.map(s=>async function*(){try{yield await s.findPeer(e,r)}catch(o){n.log.error(o)}}())),s=>Ut(s,Boolean),s=>es(s,this.peerStore),async s=>Pm(s));if(i!=null)return i;throw new S(jt.NOT_FOUND,F.ERR_NOT_FOUND)}async*getClosestPeers(e,r){if(this.routers.length===0)throw new S("No peer routers available",F.ERR_NO_ROUTERS_AVAILABLE);yield*Ji(bn(...this.routers.map(n=>n.getClosestPeers(e,r))),n=>es(n,this.peerStore),n=>Jo(n),n=>ea(n))}};var Nl=32,kl=64,na=class{log;topologies;handlers;components;constructor(e){this.log=e.logger.forComponent("libp2p:registrar"),this.topologies=new Map,this.handlers=new Map,this.components=e,this._onDisconnect=this._onDisconnect.bind(this),this._onPeerUpdate=this._onPeerUpdate.bind(this),this._onPeerIdentify=this._onPeerIdentify.bind(this),this.components.events.addEventListener("peer:disconnect",this._onDisconnect),this.components.events.addEventListener("peer:update",this._onPeerUpdate),this.components.events.addEventListener("peer:identify",this._onPeerIdentify)}getProtocols(){return Array.from(new Set([...this.handlers.keys()])).sort()}getHandler(e){let r=this.handlers.get(e);if(r==null)throw new S(`No handler registered for protocol ${e}`,F.ERR_NO_HANDLER_FOR_PROTOCOL);return r}getTopologies(e){let r=this.topologies.get(e);return r==null?[]:[...r.values()]}async handle(e,r,n){if(this.handlers.has(e))throw new S(`Handler already registered for protocol ${e}`,F.ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED);let i=Mo.bind({ignoreUndefined:!0})({maxInboundStreams:Nl,maxOutboundStreams:kl},n);this.handlers.set(e,{handler:r,options:i}),await this.components.peerStore.merge(this.components.peerId,{protocols:[e]})}async unhandle(e){(Array.isArray(e)?e:[e]).forEach(n=>{this.handlers.delete(n)}),await this.components.peerStore.patch(this.components.peerId,{protocols:this.getProtocols()})}async register(e,r){if(r==null)throw new S("invalid topology",F.ERR_INVALID_PARAMETERS);let n=`${(Math.random()*1e9).toString(36)}${Date.now()}`,i=this.topologies.get(e);return i==null&&(i=new Map,this.topologies.set(e,i)),i.set(n,r),n}unregister(e){for(let[r,n]of this.topologies.entries())n.has(e)&&(n.delete(e),n.size===0&&this.topologies.delete(r))}_onDisconnect(e){let r=e.detail;this.components.peerStore.get(r).then(n=>{for(let i of n.protocols){let s=this.topologies.get(i);if(s!=null)for(let o of s.values())o.onDisconnect?.(r)}}).catch(n=>{n.code!==F.ERR_NOT_FOUND&&this.log.error("could not inform topologies of disconnecting peer %p",r,n)})}_onPeerUpdate(e){let{peer:r,previous:n}=e.detail,i=(n?.protocols??[]).filter(s=>!r.protocols.includes(s));for(let s of i){let o=this.topologies.get(s);if(o!=null)for(let a of o.values())a.onDisconnect?.(r.id)}}_onPeerIdentify(e){let r=e.detail.protocols,n=e.detail.connection,i=e.detail.peerId;for(let s of r){let o=this.topologies.get(s);if(o!=null)for(let a of o.values())n.transient&&a.notifyOnTransient!==!0||a.onConnect?.(i,n)}}};var Ol=class extends Map{metric;constructor(e){super();let{name:r,metrics:n}=e;this.metric=n.registerMetric(r),this.updateComponentMetric()}set(e,r){return super.set(e,r),this.updateComponentMetric(),this}delete(e){let r=super.delete(e);return this.updateComponentMetric(),r}clear(){super.clear(),this.updateComponentMetric()}updateComponentMetric(){this.metric.update(this.size)}};function Dm(t){let{name:e,metrics:r}=t,n;return r!=null?n=new Ol({name:e,metrics:r}):n=new Map,n}var ia=class{log;components;transports;listeners;faultTolerance;started;constructor(e,r={}){this.log=e.logger.forComponent("libp2p:transports"),this.components=e,this.started=!1,this.transports=new Map,this.listeners=Dm({name:"libp2p_transport_manager_listeners",metrics:this.components.metrics}),this.faultTolerance=r.faultTolerance??Ur.FATAL_ALL}add(e){let r=e[Symbol.toStringTag];if(r==null)throw new S("Transport must have a valid tag",F.ERR_INVALID_KEY);if(this.transports.has(r))throw new S(`There is already a transport with the tag ${r}`,F.ERR_DUPLICATE_TRANSPORT);this.log("adding transport %s",r),this.transports.set(r,e),this.listeners.has(r)||this.listeners.set(r,[])}isStarted(){return this.started}start(){this.started=!0}async afterStart(){let e=this.components.addressManager.getListenAddrs();await this.listen(e)}async stop(){let e=[];for(let[r,n]of this.listeners)for(this.log("closing listeners for %s",r);n.length>0;){let i=n.pop();i!=null&&e.push(i.close())}await Promise.all(e),this.log("all listeners closed");for(let r of this.listeners.keys())this.listeners.set(r,[]);this.started=!1}async dial(e,r){let n=this.transportForMultiaddr(e);if(n==null)throw new S(`No transport available for address ${String(e)}`,F.ERR_TRANSPORT_UNAVAILABLE);try{return await n.dial(e,{...r,upgrader:this.components.upgrader})}catch(i){throw i.code==null&&(i.code=F.ERR_TRANSPORT_DIAL_FAILED),i}}getAddrs(){let e=[];for(let r of this.listeners.values())for(let n of r)e=[...e,...n.getAddrs()];return e}getTransports(){return Array.of(...this.transports.values())}getListeners(){return Array.of(...this.listeners.values()).flat()}transportForMultiaddr(e){for(let r of this.transports.values())if(r.filter([e]).length>0)return r}async listen(e){if(!this.isStarted())throw new S("Not started",F.ERR_NODE_NOT_STARTED);if(e==null||e.length===0){this.log("no addresses were provided for listening, this node is dial only");return}let r=[];for(let[n,i]of this.transports.entries()){let s=i.filter(e),o=[];for(let u of s){this.log("creating listener for %s on %a",n,u);let l=i.createListener({upgrader:this.components.upgrader}),f=this.listeners.get(n)??[];f==null&&(f=[],this.listeners.set(n,f)),f.push(l),l.addEventListener("listening",()=>{this.components.events.safeDispatchEvent("transport:listening",{detail:l})}),l.addEventListener("close",()=>{let h=f.findIndex(p=>p===l);f.splice(h,1),this.components.events.safeDispatchEvent("transport:close",{detail:l})}),o.push(l.listen(u))}if(o.length===0){r.push(n);continue}if((await Promise.allSettled(o)).find(u=>u.status==="fulfilled")==null&&this.faultTolerance!==Ur.NO_FATAL)throw new S(`Transport (${n}) could not listen on any available address`,F.ERR_NO_VALID_ADDRESSES)}if(r.length===this.transports.size){let n=`no valid addresses were provided for transports [${r.join(", ")}]`;if(this.faultTolerance===Ur.FATAL_ALL)throw new S(n,F.ERR_NO_VALID_ADDRESSES);this.log(`libp2p in dial mode only: ${n}`)}}async remove(e){let r=this.listeners.get(e)??[];this.log.trace("removing transport %s",e);let n=[];for(this.log.trace("closing listeners for %s",e);r.length>0;){let i=r.pop();i!=null&&n.push(i.close())}await Promise.all(n),this.transports.delete(e),this.listeners.delete(e)}async removeAll(){let e=[];for(let r of this.transports.keys())e.push(this.remove(r));await Promise.all(e)}};var Je="/multistream/1.0.0";var sa=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=r??"ABORT_ERR"}};async function Nm(t,e,r){if(e==null)return t;if(e.aborted)return Promise.reject(new sa(r?.errorMessage,r?.errorCode));let n,i=new sa(r?.errorMessage,r?.errorCode);try{return await Promise.race([t,new Promise((s,o)=>{n=()=>{o(i)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var Ml=class{needNext;haveNext;ended;nextResult;constructor(){this.ended=!1,this.needNext=ut(),this.needNext.resolve(),this.haveNext=ut()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("Have next but next was undefined");let e=this.nextResult;return this.nextResult=void 0,this.needNext.resolve(),this.needNext=ut(),e}async throw(e){return this.ended=!0,e!=null&&this.haveNext.reject(e),{done:!0,value:void 0}}async return(){let e={done:!0,value:void 0};return await this._push(void 0),e}async push(e,r){await this._push(e,r)}async end(e,r){e!=null?await this.throw(e):await this._push(void 0,r)}async _push(e,r){if(e!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");this.nextResult!=null&&await this.needNext.promise,e!=null?this.nextResult={done:!1,value:e}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=ut(),await Nm(this.needNext.promise,r?.signal,r)}};function km(){return new Ml}var oa=class extends Error{code;constructor(e,r){super(e),this.code=r}},Ul=class extends oa{type;constructor(e){super(e,"ABORT_ERR"),this.type="aborted"}};function Om(t,e){let r=km();t.sink(r).catch(async o=>{await r.end(o)}),t.sink=async o=>{for await(let a of o)await r.push(a);await r.end()};let n=t.source;t.source[Symbol.iterator]!=null?n=t.source[Symbol.iterator]():t.source[Symbol.asyncIterator]!=null&&(n=t.source[Symbol.asyncIterator]());let i=new ze;return{read:async(o,a)=>{a?.signal?.throwIfAborted();let c,u=new Promise((l,f)=>{c=()=>{f(new Ul("Read aborted"))},a?.signal?.addEventListener("abort",c)});try{if(o==null){let{done:f,value:h}=await Promise.race([n.next(),u]);return f===!0?new ze:h}for(;i.byteLength{a?.signal?.throwIfAborted(),o instanceof Uint8Array?await r.push(o,a):await r.push(o.subarray(),a)},unwrap:()=>{if(i.byteLength>0){let o=t.source;t.source=async function*(){e?.yieldBytes===!1?yield i:yield*i,yield*o}()}return t},unreadBytes:()=>i.byteLength}}function aa(t){return t[Symbol.asyncIterator]!=null}var ca=t=>{let e=it(t),r=tt(e);return dt(t,r),ca.bytes=e,r};ca.bytes=0;function wn(t,e){e=e??{};let r=e.lengthEncoder??ca;function*n(i){let s=r(i.byteLength);s instanceof Uint8Array?yield s:yield*s,i instanceof Uint8Array?yield i:yield*i}return aa(t)?async function*(){for await(let i of t)yield*n(i)}():function*(){for(let i of t)yield*n(i)}()}wn.single=(t,e)=>{e=e??{};let r=e.lengthEncoder??ca;return new ze(r(t.byteLength),t)};var li=ve(Yu(),1);var fv=8,hv=1024*1024*4,En;(function(t){t[t.LENGTH=0]="LENGTH",t[t.DATA=1]="DATA"})(En||(En={}));var Kl=t=>{let e=Ot(t);return Kl.bytes=it(e),e};Kl.bytes=0;function Fl(t,e){let r=new ze,n=En.LENGTH,i=-1,s=e?.lengthDecoder??Kl,o=e?.maxLengthLength??fv,a=e?.maxDataLength??hv;function*c(){for(;r.byteLength>0;){if(n===En.LENGTH)try{if(i=s(r),i<0)throw(0,li.default)(new Error("invalid message length"),"ERR_INVALID_MSG_LENGTH");if(i>a)throw(0,li.default)(new Error("message length too long"),"ERR_MSG_DATA_TOO_LONG");let u=s.bytes;r.consume(u),e?.onLength!=null&&e.onLength(i),n=En.DATA}catch(u){if(u instanceof RangeError){if(r.byteLength>o)throw(0,li.default)(new Error("message length length too long"),"ERR_MSG_LENGTH_TOO_LONG");break}throw u}if(n===En.DATA){if(r.byteLength0)throw(0,li.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}():function*(){for(let u of t)r.append(u),yield*c();if(r.byteLength>0)throw(0,li.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}()}Fl.fromReader=(t,e)=>{let r=1,n=async function*(){for(;;)try{let{done:s,value:o}=await t.next(r);if(s===!0)return;o!=null&&(yield o)}catch(s){if(s.code==="ERR_UNDER_READ")return{done:!0,value:null};throw s}finally{r=1}}();return Fl(n,{...e??{},onLength:s=>{r=s}})};var ua=class extends Error{code;constructor(e,r){super(e),this.code=r}},Mm=t=>Ot(t);Mm.bytes=0;function ts(t,e={}){let r=Om(t,e);return e.maxDataLength!=null&&e.maxLengthLength==null&&(e.maxLengthLength=it(e.maxDataLength)),{read:async i=>{let s=-1,o=new ze,a=e?.lengthDecoder??Mm;for(;;){o.append(await r.read(1,i));try{s=a(o)}catch(c){if(c instanceof RangeError)continue;throw c}if(e?.maxLengthLength!=null&&o.byteLength>e.maxLengthLength)throw new ua("message length length too long","ERR_MSG_LENGTH_TOO_LONG");if(s>-1)break}if(e?.maxDataLength!=null&&s>e.maxDataLength)throw new ua("message length too long","ERR_MSG_DATA_TOO_LONG");return r.read(s,i)},write:async(i,s)=>{await r.write(wn.single(i,e),s)},writeV:async(i,s)=>{let o=new ze(...i.map(a=>wn.single(a,e)));await r.write(o,s)},unwrap:()=>r.unwrap(),unreadBytes:()=>r.unreadBytes()}}var pv=Q(` -`);async function vn(t,e,r){await t.write(e,r)}async function Um(t,e,r){await t.writeV(e,r)}async function mv(t,e){let r=await t.read(e);if(r.byteLength===0||r.get(r.byteLength-1)!==pv[0])throw e?.log.error("Invalid mss message - missing newline",r),new S("missing newline","ERR_INVALID_MULTISTREAM_SELECT_MESSAGE");return r.sublist(0,-1)}async function Kr(t,e){let r=await mv(t,e);return se(r.subarray())}async function rs(t,e,r){if(e=Array.isArray(e)?[...e]:[e],e.length===1)return gv(t,e[0],r);let n=ts(t,{...r,maxDataLength:1024}),i=e.shift();if(i==null)throw new Error("At least one protocol must be specified");r?.log.trace('select: write ["%s", "%s"]',Je,i);let s=Q(`${Je} -`),o=Q(`${i} -`);await Um(n,[s,o],r),r?.log.trace("select: reading multistream-select header");let a=await Kr(n,r);if(r?.log.trace('select: read "%s"',a),a===Je&&(r?.log.trace("select: reading protocol response"),a=await Kr(n,r),r?.log.trace('select: read "%s"',a)),a===i)return{stream:n.unwrap(),protocol:i};for(let c of e){r?.log.trace('select: write "%s"',c),await vn(n,Q(`${c} -`),r),r?.log.trace("select: reading protocol response");let u=await Kr(n,r);if(r?.log.trace('select: read "%s" for "%s"',u,c),u===c)return{stream:n.unwrap(),protocol:c}}throw new S("protocol selection failed","ERR_UNSUPPORTED_PROTOCOL")}function gv(t,e,r){let n=t.sink.bind(t),i=t.source,s=!1,o=!1,a=ut(),c=!1,u=!1,l=ut(),f=!1,h=!1,p=ut(),d=ts({sink:n,source:i},{...r,maxDataLength:1024});t.sink=async x=>{let{sink:b}=d.unwrap();await b(async function*(){let I=!1;for await(let v of x){if(u&&await l.promise,c)yield v;else{u=!0,r?.log.trace('optimistic: write ["%s", "%s", data(%d)] in sink',Je,e,v.byteLength);let _=`${e} -`;yield new ze(Uint8Array.from([19]),Q(`${Je} -`),dt(_.length),Q(_),v).subarray(),r?.log.trace('optimistic: wrote ["%s", "%s", data(%d)] in sink',Je,e,v.byteLength),c=!0,u=!1,l.resolve()}I=!0}I||await m()}())};async function m(){if(o){r?.log.trace("optimistic: already negotiating %s stream",e),await a.promise;return}o=!0;try{c||(r?.log.trace("optimistic: doing send protocol for %s stream",e),await g()),f||(r?.log.trace("optimistic: doing read protocol for %s stream",e),await y())}finally{o=!1,s=!0,a.resolve()}}async function g(){if(u){await l.promise;return}u=!0;try{r?.log.trace('optimistic: write ["%s", "%s", data] in source',Je,e),await d.writeV([Q(`${Je} -`),Q(`${e} -`)]),r?.log.trace('optimistic: wrote ["%s", "%s", data] in source',Je,e)}finally{c=!0,u=!1,l.resolve()}}async function y(){if(h){await p.promise;return}h=!0;try{r?.log.trace("optimistic: reading multistream select header");let x=await Kr(d,r);if(r?.log.trace('optimistic: read multistream select header "%s"',x),x===Je&&(x=await Kr(d,r)),r?.log.trace('optimistic: read protocol "%s", expecting "%s"',x,e),x!==e)throw new S("protocol selection failed","ERR_UNSUPPORTED_PROTOCOL")}finally{f=!0,h=!1,p.resolve()}}if(t.source=async function*(){await m(),r?.log.trace('optimistic: reading data from "%s" stream',e),yield*d.unwrap().source}(),t.closeRead!=null){let x=t.closeRead.bind(t);t.closeRead=async b=>{s||await m().catch(I=>{r?.log.error("could not negotiate protocol before close read",I)}),await x(b)}}if(t.closeWrite!=null){let x=t.closeWrite.bind(t);t.closeWrite=async b=>{s||await m().catch(I=>{r?.log.error("could not negotiate protocol before close write",I)}),await x(b)}}if(t.close!=null){let x=t.close.bind(t);t.close=async b=>{s||(s=!0,o=!1,a.resolve()),await x(b)}}return{stream:t,protocol:e}}async function ns(t,e,r){e=Array.isArray(e)?e:[e],r.log.trace("handle: available protocols %s",e);let n=ts(t,{...r,maxDataLength:1024,maxLengthLength:2});for(;;){r?.log.trace("handle: reading incoming string");let i=await Kr(n,r);if(r.log.trace('handle: read "%s"',i),i===Je){r.log.trace('handle: respond with "%s" for "%s"',Je,i),await vn(n,Q(`${Je} -`),r),r.log.trace('handle: responded with "%s" for "%s"',Je,i);continue}if(e.includes(i))return r.log.trace('handle: respond with "%s" for "%s"',i,i),await vn(n,Q(`${i} -`),r),r.log.trace('handle: responded with "%s" for "%s"',i,i),{stream:n.unwrap(),protocol:i};if(i==="ls"){let s=new ze(...e.map(o=>wn.single(Q(`${o} -`))),Q(` -`));r.log.trace('handle: respond with "%s" for %s',e,i),await vn(n,s,r),r.log.trace('handle: responded with "%s" for %s',e,i);continue}r.log('handle: respond with "na" for "%s"',i),await vn(n,Q(`na -`),r),r.log('handle: responded with "na" for "%s"',i)}}var Km=Symbol.for("@libp2p/connection");var xv=500,ql=class{id;remoteAddr;remotePeer;direction;timeline;multiplexer;encryption;status;transient;log;tags;_newStream;_close;_abort;_getStreams;constructor(e){let{remoteAddr:r,remotePeer:n,newStream:i,close:s,abort:o,getStreams:a}=e;this.id=`${parseInt(String(Math.random()*1e9)).toString(36)}${Date.now()}`,this.remoteAddr=r,this.remotePeer=n,this.direction=e.direction,this.status="open",this.timeline=e.timeline,this.multiplexer=e.multiplexer,this.encryption=e.encryption,this.transient=e.transient??!1,this.log=e.logger.forComponent(`libp2p:connection:${this.direction}:${this.id}`),this.remoteAddr.getPeerId()==null&&(this.remoteAddr=this.remoteAddr.encapsulate(`/p2p/${this.remotePeer}`)),this._newStream=i,this._close=s,this._abort=o,this._getStreams=a,this.tags=[]}[Symbol.toStringTag]="Connection";[Km]=!0;get streams(){return this._getStreams()}async newStream(e,r){if(this.status==="closing")throw new S("the connection is being closed","ERR_CONNECTION_BEING_CLOSED");if(this.status==="closed")throw new S("the connection is closed","ERR_CONNECTION_CLOSED");if(Array.isArray(e)||(e=[e]),this.transient&&r?.runOnTransientConnection!==!0)throw new S("Cannot open protocol stream on transient connection","ERR_TRANSIENT_CONNECTION");let n=await this._newStream(e,r);return n.direction="outbound",n}async close(e={}){if(!(this.status==="closed"||this.status==="closing")){if(this.log("closing connection to %a",this.remoteAddr),this.status="closing",e.signal==null){let r=AbortSignal.timeout(xv);yt(1/0,r),e={...e,signal:r}}try{this.log.trace("closing all streams"),await Promise.all(this.streams.map(async r=>r.close(e))),this.log.trace("closing underlying transport"),await this._close(e),this.log.trace("updating timeline with close time"),this.status="closed",this.timeline.close=Date.now()}catch(r){this.log.error("error encountered during graceful close of connection to %a",this.remoteAddr,r),this.abort(r)}}}abort(e){this.log.error("aborting connection to %a due to error",this.remoteAddr,e),this.status="closing",this.streams.forEach(r=>{r.abort(e)}),this.log.error("all streams aborted",this.streams.length),this._abort(e),this.timeline.close=Date.now(),this.status="closed"}};function qm(t){return new ql(t)}var wv=3e4;function Ev(t,e){try{let{options:r}=e.getHandler(t);return r.maxInboundStreams}catch(r){if(r.code!==F.ERR_NO_HANDLER_FOR_PROTOCOL)throw r}return Nl}function vv(t,e,r={}){try{let{options:n}=e.getHandler(t);if(n.maxOutboundStreams!=null)return n.maxOutboundStreams}catch(n){if(n.code!==F.ERR_NO_HANDLER_FOR_PROTOCOL)throw n}return r.maxOutboundStreams??kl}function Vm(t,e,r){let n=0;return r.streams.forEach(i=>{i.direction===e&&i.protocol===t&&n++}),n}var fa=class{components;connectionEncryption;muxers;inboundUpgradeTimeout;events;log;constructor(e,r){this.components=e,this.connectionEncryption=new Map,this.log=e.logger.forComponent("libp2p:upgrader"),r.connectionEncryption.forEach(n=>{this.connectionEncryption.set(n.protocol,n)}),this.muxers=new Map,r.muxers.forEach(n=>{this.muxers.set(n.protocol,n)}),this.inboundUpgradeTimeout=r.inboundUpgradeTimeout??3e4,this.events=e.events}async shouldBlockConnection(e,r,n){let i=this.components.connectionGater[n];if(i!==void 0&&await i(e,r))throw new S(`The multiaddr connection is blocked by gater.${n}`,F.ERR_CONNECTION_INTERCEPTED)}async upgradeInbound(e,r){if(!await this.components.connectionManager.acceptIncomingConnection(e))throw new S("connection denied",F.ERR_CONNECTION_DENIED);let i,s,o,a,c,u=AbortSignal.timeout(this.inboundUpgradeTimeout),l=()=>{e.abort(new S("inbound upgrade timeout",vs))};u.addEventListener("abort",l,{once:!0}),yt(1/0,u);try{if(await this.components.connectionGater.denyInboundConnection?.(e)===!0)throw new S("The multiaddr connection is blocked by gater.acceptConnection",F.ERR_CONNECTION_INTERCEPTED);this.components.metrics?.trackMultiaddrConnection(e),this.log("starting the inbound connection upgrade");let f=e;if(r?.skipProtection!==!0){let h=this.components.connectionProtector;h!=null&&(this.log("protecting the inbound connection"),f=await h.protect(e))}try{if(i=f,r?.skipEncryption!==!0){({conn:i,remotePeer:s,protocol:c}=await this._encryptInbound(f));let h={...f,...i};await this.shouldBlockConnection(s,h,"denyInboundEncryptedConnection")}else{let h=e.remoteAddr.getPeerId();if(h==null)throw new S("inbound connection that skipped encryption must have a peer id",F.ERR_INVALID_MULTIADDR);let p=ce(h);c="native",s=p}if(o=i,r?.muxerFactory!=null)a=r.muxerFactory;else if(this.muxers.size>0){let h=await this._multiplexInbound({...f,...i},this.muxers);a=h.muxerFactory,o=h.stream}}catch(h){throw this.log.error("Failed to upgrade inbound connection",h),h}return await this.shouldBlockConnection(s,e,"denyInboundUpgradedConnection"),this.log("successfully upgraded inbound connection"),this._createConnection({cryptoProtocol:c,direction:"inbound",maConn:e,upgradedConn:o,muxerFactory:a,remotePeer:s,transient:r?.transient})}finally{u.removeEventListener("abort",l),this.components.connectionManager.afterUpgradeInbound()}}async upgradeOutbound(e,r){let n=e.remoteAddr.getPeerId(),i;n!=null&&(i=ce(n),await this.shouldBlockConnection(i,e,"denyOutboundConnection"));let s,o,a,c,u;this.components.metrics?.trackMultiaddrConnection(e),this.log("Starting the outbound connection upgrade");let l=e;if(r?.skipProtection!==!0){let f=this.components.connectionProtector;f!=null&&(l=await f.protect(e))}try{if(s=l,r?.skipEncryption!==!0){({conn:s,remotePeer:o,protocol:c}=await this._encryptOutbound(l,i));let f={...l,...s};await this.shouldBlockConnection(o,f,"denyOutboundEncryptedConnection")}else{if(i==null)throw new S("Encryption was skipped but no peer id was passed",F.ERR_INVALID_PEER);c="native",o=i}if(a=s,r?.muxerFactory!=null)u=r.muxerFactory;else if(this.muxers.size>0){let f=await this._multiplexOutbound({...l,...s},this.muxers);u=f.muxerFactory,a=f.stream}}catch(f){throw this.log.error("Failed to upgrade outbound connection",f),await e.close(f),f}return await this.shouldBlockConnection(o,e,"denyOutboundUpgradedConnection"),this.log("Successfully upgraded outbound connection"),this._createConnection({cryptoProtocol:c,direction:"outbound",maConn:e,upgradedConn:a,muxerFactory:u,remotePeer:o,transient:r?.transient})}_createConnection(e){let{cryptoProtocol:r,direction:n,maConn:i,upgradedConn:s,remotePeer:o,muxerFactory:a,transient:c}=e,u,l,f;a!=null&&(u=a.createStreamMuxer({direction:n,onIncomingStream:d=>{f!=null&&Promise.resolve().then(async()=>{let m=this.components.registrar.getProtocols(),{stream:g,protocol:y}=await ns(d,m,{log:d.log,yieldBytes:!1});if(f==null)return;f.log("incoming stream opened on %s",y);let x=Ev(y,this.components.registrar);if(Vm(y,"inbound",f)===x){let I=new S(`Too many inbound protocol streams for protocol "${y}" - limit ${x}`,F.ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS);throw d.abort(I),I}d.source=g.source,d.sink=g.sink,d.protocol=y,g.closeWrite!=null&&(d.closeWrite=g.closeWrite),g.closeRead!=null&&(d.closeRead=g.closeRead),g.close!=null&&(d.close=g.close),await this.components.peerStore.merge(o,{protocols:[y]}),this.components.metrics?.trackProtocolStream(d,f),this._onStream({connection:f,stream:d,protocol:y})}).catch(async m=>{this.log.error("error handling incoming stream id %s",d.id,m.message,m.code,m.stack),d.timeline.close==null&&await d.close()})}}),l=async(d,m={})=>{if(u==null)throw new S("Stream is not multiplexed",F.ERR_MUXER_UNAVAILABLE);f.log("starting new stream for protocols %s",d);let g=await u.newStream();f.log.trace("started new stream %s for protocols %s",g.id,d);try{if(m.signal==null){this.log("No abort signal was passed while trying to negotiate protocols %s falling back to default timeout",d);let v=AbortSignal.timeout(wv);yt(1/0,v),m={...m,signal:v}}g.log.trace("selecting protocol from protocols %s",d);let{stream:y,protocol:x}=await rs(g,d,{...m,log:g.log,yieldBytes:!0});g.log("selected protocol %s",x);let b=vv(x,this.components.registrar,m);if(Vm(x,"outbound",f)>=b){let v=new S(`Too many outbound protocol streams for protocol "${x}" - limit ${b}`,F.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS);throw g.abort(v),v}return await this.components.peerStore.merge(o,{protocols:[x]}),g.source=y.source,g.sink=y.sink,g.protocol=x,y.closeWrite!=null&&(g.closeWrite=y.closeWrite),y.closeRead!=null&&(g.closeRead=y.closeRead),y.close!=null&&(g.close=y.close),this.components.metrics?.trackProtocolStream(g,f),g}catch(y){throw f.log.error("could not create new stream for protocols %s",d,y),g.timeline.close==null&&g.abort(y),y.code!=null?y:new S(String(y),F.ERR_UNSUPPORTED_PROTOCOL)}},Promise.all([u.sink(s.source),s.sink(u.source)]).catch(d=>{this.log.error(d)}));let h=i.timeline;i.timeline=new Proxy(h,{set:(...d)=>(f!=null&&d[1]==="close"&&d[2]!=null&&h.close==null&&(async()=>{try{f.status==="open"&&await f.close()}catch(m){this.log.error(m)}finally{this.events.safeDispatchEvent("connection:close",{detail:f})}})().catch(m=>{this.log.error(m)}),Reflect.set(...d))}),i.timeline.upgraded=Date.now();let p=()=>{throw new S("connection is not multiplexed",F.ERR_CONNECTION_NOT_MULTIPLEXED)};return f=qm({remoteAddr:i.remoteAddr,remotePeer:o,status:"open",direction:n,timeline:i.timeline,multiplexer:u?.protocol,encryption:r,transient:c,logger:this.components.logger,newStream:l??p,getStreams:()=>u!=null?u.streams:[],close:async d=>{u!=null&&(this.log.trace("close muxer"),await u.close(d)),this.log.trace("close maconn"),await i.close(d),this.log.trace("closed maconn")},abort:d=>{i.abort(d),u?.abort(d)}}),this.events.safeDispatchEvent("connection:open",{detail:f}),f}_onStream(e){let{connection:r,stream:n,protocol:i}=e,{handler:s,options:o}=this.components.registrar.getHandler(i);if(r.transient&&o.runOnTransientConnection!==!0)throw new S("Cannot open protocol stream on transient connection","ERR_TRANSIENT_CONNECTION");s({connection:r,stream:n})}async _encryptInbound(e){let r=Array.from(this.connectionEncryption.keys());this.log("handling inbound crypto protocol selection",r);try{let{stream:n,protocol:i}=await ns(e,r,{log:e.log}),s=this.connectionEncryption.get(i);if(s==null)throw new Error(`no crypto module found for ${i}`);return this.log("encrypting inbound connection using",i),{...await s.secureInbound(this.components.peerId,n),protocol:i}}catch(n){throw new S(String(n),F.ERR_ENCRYPTION_FAILED)}}async _encryptOutbound(e,r){let n=Array.from(this.connectionEncryption.keys());this.log("selecting outbound crypto protocol",n);try{e.log.trace("selecting encrypter from %s",n);let{stream:i,protocol:s}=await rs(e,n,{log:e.log,yieldBytes:!0}),o=this.connectionEncryption.get(s);if(o==null)throw new Error(`no crypto module found for ${s}`);return e.log("encrypting outbound connection to %p using %p",r),{...await o.secureOutbound(this.components.peerId,i,r),protocol:s}}catch(i){throw new S(String(i),F.ERR_ENCRYPTION_FAILED)}}async _multiplexOutbound(e,r){let n=Array.from(r.keys());this.log("outbound selecting muxer %s",n);try{e.log.trace("selecting stream muxer from %s",n);let{stream:i,protocol:s}=await rs(e,n,{log:e.log,yieldBytes:!0});e.log("selected %s as muxer protocol",s);let o=r.get(s);return{stream:i,muxerFactory:o}}catch(i){throw e.log.error("error multiplexing outbound stream",i),new S(String(i),F.ERR_MUXER_UNAVAILABLE)}}async _multiplexInbound(e,r){let n=Array.from(r.keys());this.log("inbound handling muxers %s",n);try{let{stream:i,protocol:s}=await ns(e,n,{log:e.log}),o=r.get(s);return{stream:i,muxerFactory:o}}catch(i){throw this.log.error("error multiplexing inbound stream",i),new S(String(i),F.ERR_MUXER_UNAVAILABLE)}}};var $m="0.0.0",zm="libp2p";var Vl=class extends Oi{peerId;peerStore;contentRouting;peerRouting;metrics;services;logger;components;#e;log;constructor(e){super();let r=new Oi,n=r.dispatchEvent.bind(r);r.dispatchEvent=a=>{let c=n(a),u=this.dispatchEvent(new Zc(a.type,{detail:a.detail}));return c||u},yt(1/0,r),this.#e=!1,this.peerId=e.peerId,this.logger=e.logger??Ws(),this.log=this.logger.forComponent("libp2p"),this.services={};let i=this.components=Yd({peerId:e.peerId,nodeInfo:e.nodeInfo??{name:zm,version:$m},logger:this.logger,events:r,datastore:e.datastore??new So,connectionGater:ip(e.connectionGater)});this.peerStore=this.configureComponent("peerStore",new Eo(i,{addressFilter:this.components.connectionGater.filterMultiaddrForPeer,...e.peerStore})),e.metrics!=null&&(this.metrics=this.configureComponent("metrics",e.metrics(this.components))),i.events.addEventListener("peer:update",a=>{if(a.detail.previous==null){let c={id:a.detail.peer.id,multiaddrs:a.detail.peer.addresses.map(u=>u.multiaddr)};i.events.safeDispatchEvent("peer:discovery",{detail:c})}}),e.connectionProtector!=null&&this.configureComponent("connectionProtector",e.connectionProtector(i)),this.components.upgrader=new fa(this.components,{connectionEncryption:(e.connectionEncryption??[]).map((a,c)=>this.configureComponent(`connection-encryption-${c}`,a(this.components))),muxers:(e.streamMuxers??[]).map((a,c)=>this.configureComponent(`stream-muxers-${c}`,a(this.components))),inboundUpgradeTimeout:e.connectionManager.inboundUpgradeTimeout}),this.configureComponent("transportManager",new ia(this.components,e.transportManager)),this.configureComponent("connectionManager",new Xo(this.components,e.connectionManager)),this.configureComponent("registrar",new na(this.components)),this.configureComponent("addressManager",new Ao(this.components,e.addresses));let s=(e.peerRouters??[]).map((a,c)=>this.configureComponent(`peer-router-${c}`,a(this.components)));this.peerRouting=this.components.peerRouting=this.configureComponent("peerRouting",new ra(this.components,{routers:s}));let o=(e.contentRouters??[]).map((a,c)=>this.configureComponent(`content-router-${c}`,a(this.components)));if(this.contentRouting=this.components.contentRouting=this.configureComponent("contentRouting",new ta(this.components,{routers:o})),(e.peerDiscovery??[]).forEach((a,c)=>{this.configureComponent(`peer-discovery-${c}`,a(this.components)).addEventListener("peer",l=>{this.#t(l)})}),e.transports.forEach((a,c)=>{this.components.transportManager.add(this.configureComponent(`transport-${c}`,a(this.components)))}),e.services!=null)for(let a of Object.keys(e.services)){let c=e.services[a],u=c(this.components);if(u==null){this.log.error("service factory %s returned null or undefined instance",a);continue}this.services[a]=u,this.configureComponent(a,u),u[Qc]!=null&&(this.log("registering service %s for content routing",a),o.push(u[Qc])),u[Jc]!=null&&(this.log("registering service %s for peer routing",a),s.push(u[Jc])),u[jc]!=null&&(this.log("registering service %s for peer discovery",a),u[jc].addEventListener("peer",l=>{this.#t(l)}))}}configureComponent(e,r){return r==null&&this.log.error("component %s was null or undefined",e),this.components[e]=r,r}async start(){if(!this.#e){this.#e=!0,this.log("libp2p is starting");try{await this.components.beforeStart?.(),await this.components.start(),await this.components.afterStart?.(),this.safeDispatchEvent("start",{detail:this}),this.log("libp2p has started")}catch(e){throw this.log.error("An error occurred starting libp2p",e),await this.stop(),e}}}async stop(){this.#e&&(this.log("libp2p is stopping"),this.#e=!1,await this.components.beforeStop?.(),await this.components.stop(),await this.components.afterStop?.(),this.safeDispatchEvent("stop",{detail:this}),this.log("libp2p has stopped"))}isStarted(){return this.#e}getConnections(e){return this.components.connectionManager.getConnections(e)}getDialQueue(){return this.components.connectionManager.getDialQueue()}getPeers(){let e=new ln;for(let r of this.components.connectionManager.getConnections())e.add(r.remotePeer);return Array.from(e)}async dial(e,r={}){return this.components.connectionManager.openConnection(e,r)}async dialProtocol(e,r,n={}){if(r==null)throw new S("no protocols were provided to open a stream",F.ERR_INVALID_PROTOCOLS_FOR_STREAM);if(r=Array.isArray(r)?r:[r],r.length===0)throw new S("no protocols were provided to open a stream",F.ERR_INVALID_PROTOCOLS_FOR_STREAM);return(await this.dial(e,n)).newStream(r,n)}getMultiaddrs(){return this.components.addressManager.getAddresses()}getProtocols(){return this.components.registrar.getProtocols()}async hangUp(e,r={}){Lr(e)&&(e=ce(e.getPeerId()??"")),await this.components.connectionManager.closeConnections(e,r)}async getPublicKey(e,r={}){if(this.log("getPublicKey %p",e),e.publicKey!=null)return e.publicKey;let n=await this.peerStore.get(e);if(n.id.publicKey!=null)return n.id.publicKey;let i=Te([Q("/pk/"),e.multihash.digest]),s=await this.contentRouting.get(i,r);return ki(s),await this.peerStore.patch(e,{publicKey:s}),s}async handle(e,r,n){Array.isArray(e)||(e=[e]),await Promise.all(e.map(async i=>{await this.components.registrar.handle(i,r,n)}))}async unhandle(e){Array.isArray(e)||(e=[e]),await Promise.all(e.map(async r=>{await this.components.registrar.unhandle(r)}))}async register(e,r){return this.components.registrar.register(e,r)}unregister(e){this.components.registrar.unregister(e)}#t(e){let{detail:r}=e;if(r.id.toString()===this.peerId.toString()){this.log.error(new Error(F.ERR_DISCOVERED_SELF));return}this.components.peerStore.merge(r.id,{multiaddrs:r.multiaddrs}).catch(n=>{this.log.error(n)})}};async function Hm(t){return t.peerId??=await ed(),new Vl(Tp(t))}async function Sv(t){let e=await Hm(t);return t.start!==!1&&await e.start(),e}return sg(Av);})(); -/*! Bundled license information: - -@noble/hashes/esm/utils.js: - (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/modular.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/curve.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/edwards.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/ed25519.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/weierstrass.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/_shortw_utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/secp256k1.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) -*/ -return Libp2P})); diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/index.d.ts deleted file mode 100644 index 5820cf0a7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/index.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -import type { ComponentLogger, Libp2pEvents } from '@libp2p/interface'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { TransportManager } from '@libp2p/interface-internal/transport-manager'; -import type { Multiaddr } from '@multiformats/multiaddr'; -export interface AddressManagerInit { - /** - * Pass an function in this field to override the list of addresses - * that are announced to the network - */ - announceFilter?: AddressFilter; - /** - * list of multiaddrs string representation to listen - */ - listen?: string[]; - /** - * list of multiaddrs string representation to announce - */ - announce?: string[]; - /** - * list of multiaddrs string representation to never announce - */ - noAnnounce?: string[]; -} -export interface DefaultAddressManagerComponents { - peerId: PeerId; - transportManager: TransportManager; - peerStore: PeerStore; - events: TypedEventTarget; - logger: ComponentLogger; -} -/** - * A function that takes a list of multiaddrs and returns a list - * to announce - */ -export interface AddressFilter { - (addrs: Multiaddr[]): Multiaddr[]; -} -export declare class DefaultAddressManager { - private readonly log; - private readonly components; - private readonly listen; - private readonly announce; - private readonly observed; - private readonly announceFilter; - /** - * Responsible for managing the peer addresses. - * Peers can specify their listen and announce addresses. - * The listen addresses will be used by the libp2p transports to listen for new connections, - * while the announce addresses will be used for the peer addresses' to other peers in the network. - */ - constructor(components: DefaultAddressManagerComponents, init?: AddressManagerInit); - _updatePeerStoreAddresses(): void; - /** - * Get peer listen multiaddrs - */ - getListenAddrs(): Multiaddr[]; - /** - * Get peer announcing multiaddrs - */ - getAnnounceAddrs(): Multiaddr[]; - /** - * Get observed multiaddrs - */ - getObservedAddrs(): Multiaddr[]; - /** - * Add peer observed addresses - */ - addObservedAddr(addr: Multiaddr): void; - confirmObservedAddr(addr: Multiaddr): void; - removeObservedAddr(addr: Multiaddr): void; - getAddresses(): Multiaddr[]; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/index.d.ts.map deleted file mode 100644 index d1ca76ee1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/address-manager/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAU,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,cAAc,CAAC,EAAE,aAAa,CAAA;IAE9B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IAEjB;;OAEG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perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/index.js deleted file mode 100644 index a8eae24b0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/index.js +++ /dev/null @@ -1,152 +0,0 @@ -import { peerIdFromString } from '@libp2p/peer-id'; -import { multiaddr } from '@multiformats/multiaddr'; -import { debounce } from './utils.js'; -const defaultAddressFilter = (addrs) => addrs; -/** - * If the passed multiaddr contains the passed peer id, remove it - */ -function stripPeerId(ma, peerId) { - const observedPeerIdStr = ma.getPeerId(); - // strip our peer id if it has been passed - if (observedPeerIdStr != null) { - const observedPeerId = peerIdFromString(observedPeerIdStr); - // use same encoding for comparison - if (observedPeerId.equals(peerId)) { - ma = ma.decapsulate(multiaddr(`/p2p/${peerId.toString()}`)); - } - } - return ma; -} -export class DefaultAddressManager { - log; - components; - // this is an array to allow for duplicates, e.g. multiples of `/ip4/0.0.0.0/tcp/0` - listen; - announce; - observed; - announceFilter; - /** - * Responsible for managing the peer addresses. - * Peers can specify their listen and announce addresses. - * The listen addresses will be used by the libp2p transports to listen for new connections, - * while the announce addresses will be used for the peer addresses' to other peers in the network. - */ - constructor(components, init = {}) { - const { listen = [], announce = [] } = init; - this.components = components; - this.log = components.logger.forComponent('libp2p:address-manager'); - this.listen = listen.map(ma => ma.toString()); - this.announce = new Set(announce.map(ma => ma.toString())); - this.observed = new Map(); - this.announceFilter = init.announceFilter ?? defaultAddressFilter; - // this method gets called repeatedly on startup when transports start listening so - // debounce it so we don't cause multiple self:peer:update events to be emitted - this._updatePeerStoreAddresses = debounce(this._updatePeerStoreAddresses.bind(this), 1000); - // update our stored addresses when new transports listen - components.events.addEventListener('transport:listening', () => { - this._updatePeerStoreAddresses(); - }); - // update our stored addresses when existing transports stop listening - components.events.addEventListener('transport:close', () => { - this._updatePeerStoreAddresses(); - }); - } - _updatePeerStoreAddresses() { - // if announce addresses have been configured, ensure they make it into our peer - // record for things like identify - const addrs = this.getAnnounceAddrs() - .concat(this.components.transportManager.getAddrs()) - .concat([...this.observed.entries()] - .filter(([_, metadata]) => metadata.confident) - .map(([str]) => multiaddr(str))).map(ma => { - // strip our peer id if it is present - if (ma.getPeerId() === this.components.peerId.toString()) { - return ma.decapsulate(`/p2p/${this.components.peerId.toString()}`); - } - return ma; - }); - this.components.peerStore.patch(this.components.peerId, { - multiaddrs: addrs - }) - .catch(err => { this.log.error('error updating addresses', err); }); - } - /** - * Get peer listen multiaddrs - */ - getListenAddrs() { - return Array.from(this.listen).map((a) => multiaddr(a)); - } - /** - * Get peer announcing multiaddrs - */ - getAnnounceAddrs() { - return Array.from(this.announce).map((a) => multiaddr(a)); - } - /** - * Get observed multiaddrs - */ - getObservedAddrs() { - return Array.from(this.observed).map(([a]) => multiaddr(a)); - } - /** - * Add peer observed addresses - */ - addObservedAddr(addr) { - addr = stripPeerId(addr, this.components.peerId); - const addrString = addr.toString(); - // do not trigger the change:addresses event if we already know about this address - if (this.observed.has(addrString)) { - return; - } - this.observed.set(addrString, { - confident: false - }); - } - confirmObservedAddr(addr) { - addr = stripPeerId(addr, this.components.peerId); - const addrString = addr.toString(); - const metadata = this.observed.get(addrString) ?? { - confident: false - }; - const startingConfidence = metadata.confident; - this.observed.set(addrString, { - confident: true - }); - // only trigger the 'self:peer:update' event if our confidence in an address has changed - if (!startingConfidence) { - this._updatePeerStoreAddresses(); - } - } - removeObservedAddr(addr) { - addr = stripPeerId(addr, this.components.peerId); - const addrString = addr.toString(); - this.observed.delete(addrString); - } - getAddresses() { - let addrs = this.getAnnounceAddrs().map(ma => ma.toString()); - if (addrs.length === 0) { - // no configured announce addrs, add configured listen addresses - addrs = this.components.transportManager.getAddrs().map(ma => ma.toString()); - } - // add observed addresses we are confident in - addrs = addrs.concat(Array.from(this.observed) - .filter(([ma, metadata]) => metadata.confident) - .map(([ma]) => ma)); - // dedupe multiaddrs - const addrSet = new Set(addrs); - // Create advertising list - return this.announceFilter(Array.from(addrSet) - .map(str => multiaddr(str))) - .map(ma => { - // do not append our peer id to a path multiaddr as it will become invalid - if (ma.protos().pop()?.path === true) { - return ma; - } - if (ma.getPeerId() === this.components.peerId.toString()) { - return ma; - } - return ma.encapsulate(`/p2p/${this.components.peerId.toString()}`); - }); - } -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/index.js.map deleted file mode 100644 index cde528318..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/address-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AA+CrC,MAAM,oBAAoB,GAAG,CAAC,KAAkB,EAAe,EAAE,CAAC,KAAK,CAAA;AAMvE;;GAEG;AACH,SAAS,WAAW,CAAE,EAAa,EAAE,MAAc;IACjD,MAAM,iBAAiB,GAAG,EAAE,CAAC,SAAS,EAAE,CAAA;IAExC,0CAA0C;IAC1C,IAAI,iBAAiB,IAAI,IAAI,EAAE;QAC7B,MAAM,cAAc,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;QAE1D,mCAAmC;QACnC,IAAI,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;YACjC,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAA;SAC5D;KACF;IAED,OAAO,EAAE,CAAA;AACX,CAAC;AAED,MAAM,OAAO,qBAAqB;IACf,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,EAAE,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,IAAI,KAAK,IAAI,EAAE;gBACpC,OAAO,EAAE,CAAA;aACV;YAED,IAAI,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE;gBACxD,OAAO,EAAE,CAAA;aACV;YAED,OAAO,EAAE,CAAC,WAAW,CAAC,QAAQ,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;QACpE,CAAC,CAAC,CAAA;IACN,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/utils.d.ts deleted file mode 100644 index 89fb3c330..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/utils.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function debounce(func: () => void, wait: number): () => void; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/utils.d.ts.map deleted file mode 100644 index d2b3e2d53..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/address-manager/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAE,IAAI,EAAE,MAAM,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,IAAI,CAYpE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/utils.js deleted file mode 100644 index a52ce5c66..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/utils.js +++ /dev/null @@ -1,12 +0,0 @@ -export function debounce(func, wait) { - let timeout; - return function () { - const later = function () { - timeout = undefined; - func(); - }; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - }; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/utils.js.map deleted file mode 100644 index 9bea1f23f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/address-manager/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/address-manager/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CAAE,IAAgB,EAAE,IAAY;IACtD,IAAI,OAAkD,CAAA;IAEtD,OAAO;QACL,MAAM,KAAK,GAAG;YACZ,OAAO,GAAG,SAAS,CAAA;YACnB,IAAI,EAAE,CAAA;QACR,CAAC,CAAA;QAED,YAAY,CAAC,OAAO,CAAC,CAAA;QACrB,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/components.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/components.d.ts deleted file mode 100644 index 725f12c52..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/components.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { type Startable } from '@libp2p/interface/startable'; -import type { Libp2pEvents, ComponentLogger, NodeInfo } from '@libp2p/interface'; -import type { ConnectionProtector } from '@libp2p/interface/connection'; -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -import type { ContentRouting } from '@libp2p/interface/content-routing'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerRouting } from '@libp2p/interface/peer-routing'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Upgrader } from '@libp2p/interface/transport'; -import type { AddressManager } from '@libp2p/interface-internal/address-manager'; -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'; -import type { Registrar } from '@libp2p/interface-internal/registrar'; -import type { TransportManager } from '@libp2p/interface-internal/transport-manager'; -import type { Datastore } from 'interface-datastore'; -export interface Components extends Record, Startable { - peerId: PeerId; - nodeInfo: NodeInfo; - logger: ComponentLogger; - events: TypedEventTarget; - addressManager: AddressManager; - peerStore: PeerStore; - upgrader: Upgrader; - registrar: Registrar; - connectionManager: ConnectionManager; - transportManager: TransportManager; - connectionGater: ConnectionGater; - contentRouting: ContentRouting; - peerRouting: PeerRouting; - datastore: Datastore; - connectionProtector?: ConnectionProtector; - metrics?: Metrics; -} -export interface ComponentsInit { - peerId?: PeerId; - nodeInfo?: NodeInfo; - logger?: ComponentLogger; - events?: TypedEventTarget; - addressManager?: AddressManager; - peerStore?: PeerStore; - upgrader?: Upgrader; - metrics?: Metrics; - registrar?: Registrar; - connectionManager?: ConnectionManager; - transportManager?: TransportManager; - connectionGater?: ConnectionGater; - contentRouting?: ContentRouting; - peerRouting?: PeerRouting; - datastore?: Datastore; - connectionProtector?: ConnectionProtector; -} -export declare function defaultComponents(init?: ComponentsInit): Components; -//# sourceMappingURL=components.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/components.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/components.d.ts.map deleted file mode 100644 index 9a716ba13..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/components.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/components.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAA;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,MAAM,WAAW,UAAW,SAAQ,MAAM,CAAC,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,wBAAgB,iBAAiB,CAAE,IAAI,GAAE,cAAmB,GAAG,UAAU,CA+BxE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/components.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/components.js deleted file mode 100644 index ca141f10f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/components.js +++ /dev/null @@ -1,89 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { isStartable } from '@libp2p/interface/startable'; -import { defaultLogger } from '@libp2p/logger'; -class DefaultComponents { - components = {}; - _started = false; - constructor(init = {}) { - this.components = {}; - for (const [key, value] of Object.entries(init)) { - this.components[key] = value; - } - if (this.components.logger == null) { - this.components.logger = defaultLogger(); - } - } - isStarted() { - return this._started; - } - async _invokeStartableMethod(methodName) { - await Promise.all(Object.values(this.components) - .filter(obj => isStartable(obj)) - .map(async (startable) => { - await startable[methodName]?.(); - })); - } - async beforeStart() { - await this._invokeStartableMethod('beforeStart'); - } - async start() { - await this._invokeStartableMethod('start'); - this._started = true; - } - async afterStart() { - await this._invokeStartableMethod('afterStart'); - } - async beforeStop() { - await this._invokeStartableMethod('beforeStop'); - } - async stop() { - await this._invokeStartableMethod('stop'); - this._started = false; - } - async afterStop() { - await this._invokeStartableMethod('afterStop'); - } -} -const OPTIONAL_SERVICES = [ - 'metrics', - 'connectionProtector' -]; -const NON_SERVICE_PROPERTIES = [ - 'components', - 'isStarted', - 'beforeStart', - 'start', - 'afterStart', - 'beforeStop', - 'stop', - 'afterStop', - 'then', - '_invokeStartableMethod' -]; -export function defaultComponents(init = {}) { - const components = new DefaultComponents(init); - const proxy = new Proxy(components, { - get(target, prop, receiver) { - if (typeof prop === 'string' && !NON_SERVICE_PROPERTIES.includes(prop)) { - const service = components.components[prop]; - if (service == null && !OPTIONAL_SERVICES.includes(prop)) { - throw new CodeError(`${prop} not set`, 'ERR_SERVICE_MISSING'); - } - return service; - } - return Reflect.get(target, prop, receiver); - }, - set(target, prop, value) { - if (typeof prop === 'string') { - components.components[prop] = value; - } - else { - Reflect.set(target, prop, value); - } - return true; - } - }); - // @ts-expect-error component keys are proxied - return proxy; -} -//# sourceMappingURL=components.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/components.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/components.js.map deleted file mode 100644 index bcda671ae..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/components.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,WAAW,EAAkB,MAAM,6BAA6B,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAuD9C,MAAM,iBAAiB;IACd,UAAU,GAAwB,EAAE,CAAA;IACnC,QAAQ,GAAG,KAAK,CAAA;IAExB,YAAa,OAAuB,EAAE;QACpC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAA;QAEpB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC/C,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;SAC7B;QAED,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,IAAI,EAAE;YAClC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,aAAa,EAAE,CAAA;SACzC;IACH,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAEO,KAAK,CAAC,sBAAsB,CAAE,UAAwF;QAC5H,MAAM,OAAO,CAAC,GAAG,CACf,MA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AM,KAAK,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE;QAClC,GAAG,CAAE,MAAM,EAAE,IAAI,EAAE,QAAQ;YACzB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBACtE,MAAM,OAAO,GAAG,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;gBAE3C,IAAI,OAAO,IAAI,IAAI,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;oBACxD,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,UAAU,EAAE,qBAAqB,CAAC,CAAA;iBAC9D;gBAED,OAAO,OAAO,CAAA;aACf;YAED,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;QAC5C,CAAC;QAED,GAAG,CAAE,MAAM,EAAE,IAAI,EAAE,KAAK;YACtB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;gBAC5B,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;aACpC;iBAAM;gBACL,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;aACjC;YAED,OAAO,IAAI,CAAA;QACb,CAAC;KACF,CAAC,CAAA;IAEF,8CAA8C;IAC9C,OAAO,KAAK,CAAA;AACd,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config.d.ts deleted file mode 100644 index ab4251ece..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Libp2pInit } from './index.js'; -import type { ServiceMap, RecursivePartial } from '@libp2p/interface'; -export declare function validateConfig>(opts: RecursivePartial>): Libp2pInit; -//# sourceMappingURL=config.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config.d.ts.map deleted file mode 100644 index 55a83bd41..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAqBrE,wBAAgB,cAAc,CAAE,CAAC,SAAS,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAG,IAAI,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAYrI"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config.js deleted file mode 100644 index e4c01621d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config.js +++ /dev/null @@ -1,34 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { FaultTolerance } from '@libp2p/interface/transport'; -import { defaultAddressSort } from '@libp2p/utils/address-sort'; -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers'; -import mergeOptions from 'merge-options'; -import { codes, messages } from './errors.js'; -const DefaultConfig = { - addresses: { - listen: [], - announce: [], - noAnnounce: [], - announceFilter: (multiaddrs) => multiaddrs - }, - connectionManager: { - resolvers: { - dnsaddr: dnsaddrResolver - }, - addressSorter: defaultAddressSort - }, - transportManager: { - faultTolerance: FaultTolerance.FATAL_ALL - } -}; -export function validateConfig(opts) { - const resultingOptions = mergeOptions(DefaultConfig, opts); - if (resultingOptions.transports == null || resultingOptions.transports.length < 1) { - throw new CodeError(messages.ERR_TRANSPORTS_REQUIRED, codes.ERR_TRANSPORTS_REQUIRED); - } - if (resultingOptions.connectionProtector === null && globalThis.process?.env?.LIBP2P_FORCE_PNET != null) { // eslint-disable-line no-undef - throw new CodeError(messages.ERR_PROTECTOR_REQUIRED, codes.ERR_PROTECTOR_REQUIRED); - } - return resultingOptions; -} -//# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config.js.map deleted file mode 100644 index e112d5382..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,YAAY,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAK7C,MAAM,aAAa,GAAwB;IACzC,SAAS,EAAE;QACT,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,cAAc,EAAE,CAAC,UAAuB,EAAE,EAAE,CAAC,UAAU;KACxD;IACD,iBAAiB,EAAE;QACjB,SAAS,EAAE;YACT,OAAO,EAAE,eAAe;SACzB;QACD,aAAa,EAAE,kBAAkB;KAClC;IACD,gBAAgB,EAAE;QAChB,cAAc,EAAE,cAAc,CAAC,SAAS;KACzC;CACF,CAAA;AAED,MAAM,UAAU,cAAc,CAAmD,IAAqC;IACpH,MAAM,gBAAgB,GAAkB,YAAY,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;IAEzE,IAAI,gBAAgB,CAAC,UAAU,IAAI,IAAI,IAAI,gBAAgB,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;QACjF,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,uBAAuB,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAA;KACrF;IAED,IAAI,gBAAgB,CAAC,mBAAmB,KAAK,IAAI,IAAI,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,iBAAiB,IAAI,IAAI,EAAE,EAAE,+BAA+B;QACxI,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAA;KACnF;IAED,OAAO,gBAAgB,CAAA;AACzB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.browser.d.ts deleted file mode 100644 index e9811302d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.browser.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -/** - * Returns a connection gater that disallows dialling private addresses by - * default. Browsers are severely limited in their resource usage so don't - * waste time trying to dial undiallable addresses. - */ -export declare function connectionGater(gater?: ConnectionGater): ConnectionGater; -//# sourceMappingURL=connection-gater.browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.browser.d.ts.map deleted file mode 100644 index 835c96980..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-gater.browser.d.ts","sourceRoot":"","sources":["../../../src/config/connection-gater.browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAGzE;;;;GAIG;AACH,wBAAgB,eAAe,CAAE,KAAK,GAAE,eAAoB,GAAG,eAAe,CAqB7E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.browser.js deleted file mode 100644 index 314f039c3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.browser.js +++ /dev/null @@ -1,27 +0,0 @@ -import isPrivate from 'private-ip'; -/** - * Returns a connection gater that disallows dialling private addresses by - * default. Browsers are severely limited in their resource usage so don't - * waste time trying to dial undiallable addresses. - */ -export function connectionGater(gater = {}) { - return { - denyDialPeer: async () => false, - denyDialMultiaddr: async (multiaddr) => { - const tuples = multiaddr.stringTuples(); - if (tuples[0][0] === 4 || tuples[0][0] === 41) { - return Boolean(isPrivate(`${tuples[0][1]}`)); - } - return false; - }, - denyInboundConnection: async () => false, - denyOutboundConnection: async () => false, - denyInboundEncryptedConnection: async () => false, - denyOutboundEncryptedConnection: async () => false, - denyInboundUpgradedConnection: async () => false, - denyOutboundUpgradedConnection: async () => false, - filterMultiaddrForPeer: async () => true, - ...gater - }; -} -//# sourceMappingURL=connection-gater.browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.browser.js.map deleted file mode 100644 index 6cc29ec56..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-gater.browser.js","sourceRoot":"","sources":["../../../src/config/connection-gater.browser.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAA;AAIlC;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAE,QAAyB,EAAE;IAC1D,OAAO;QACL,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAC/B,iBAAiB,EAAE,KAAK,EAAE,SAAoB,EAAE,EAAE;YAChD,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,EAAE,CAAA;YAEvC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC7C,OAAO,OAAO,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;aAC7C;YAED,OAAO,KAAK,CAAA;QACd,CAAC;QACD,qBAAqB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACxC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACzC,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,+BAA+B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAClD,6BAA6B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAChD,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI;QACxC,GAAG,KAAK;KACT,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.d.ts deleted file mode 100644 index e0c7d6071..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -/** - * Returns a default connection gater implementation that allows everything - */ -export declare function connectionGater(gater?: ConnectionGater): ConnectionGater; -//# sourceMappingURL=connection-gater.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.d.ts.map deleted file mode 100644 index 611e82ee3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-gater.d.ts","sourceRoot":"","sources":["../../../src/config/connection-gater.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAEzE;;GAEG;AACH,wBAAgB,eAAe,CAAE,KAAK,GAAE,eAAoB,GAAG,eAAe,CAa7E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.js deleted file mode 100644 index 8795542ce..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Returns a default connection gater implementation that allows everything - */ -export function connectionGater(gater = {}) { - return { - denyDialPeer: async () => false, - denyDialMultiaddr: async () => false, - denyInboundConnection: async () => false, - denyOutboundConnection: async () => false, - denyInboundEncryptedConnection: async () => false, - denyOutboundEncryptedConnection: async () => false, - denyInboundUpgradedConnection: async () => false, - denyOutboundUpgradedConnection: async () => false, - filterMultiaddrForPeer: async () => true, - ...gater - }; -} -//# sourceMappingURL=connection-gater.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.js.map deleted file mode 100644 index e94bddffb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/config/connection-gater.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-gater.js","sourceRoot":"","sources":["../../../src/config/connection-gater.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,eAAe,CAAE,QAAyB,EAAE;IAC1D,OAAO;QACL,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAC/B,iBAAiB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACpC,qBAAqB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACxC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACzC,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,+BAA+B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAClD,6BAA6B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAChD,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI;QACxC,GAAG,KAAK;KACT,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/auto-dial.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/auto-dial.d.ts deleted file mode 100644 index 65674c201..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/auto-dial.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { Libp2pEvents, ComponentLogger } from '@libp2p/interface'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Startable } from '@libp2p/interface/startable'; -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'; -interface AutoDialInit { - minConnections?: number; - maxQueueLength?: number; - autoDialConcurrency?: number; - autoDialPriority?: number; - autoDialInterval?: number; - autoDialPeerRetryThreshold?: number; - autoDialDiscoveredPeersDebounce?: number; -} -interface AutoDialComponents { - connectionManager: ConnectionManager; - peerStore: PeerStore; - events: TypedEventTarget; - logger: ComponentLogger; -} -export declare class AutoDial implements Startable { - private readonly connectionManager; - private readonly peerStore; - private readonly queue; - private readonly minConnections; - private readonly autoDialPriority; - private readonly autoDialIntervalMs; - private readonly autoDialMaxQueueLength; - private readonly autoDialPeerRetryThresholdMs; - private readonly autoDialDiscoveredPeersDebounce; - private autoDialInterval?; - private started; - private running; - private readonly log; - /** - * Proactively tries to connect to known peers stored in the PeerStore. - * It will keep the number of connections below the upper limit and sort - * the peers to connect based on whether we know their keys and protocols. - */ - constructor(components: AutoDialComponents, init: AutoDialInit); - isStarted(): boolean; - start(): void; - afterStart(): void; - stop(): void; - autoDial(): Promise; -} -export {}; -//# sourceMappingURL=auto-dial.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/auto-dial.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/auto-dial.d.ts.map deleted file mode 100644 index 1038109b7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/auto-dial.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auto-dial.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/auto-dial.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAU,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAA;AAEtF,UAAU,YAAY;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,0BAA0B,CAAC,EAAE,MAAM,CAAA;IACnC,+BAA+B,CAAC,EAAE,MAAM,CAAA;CACzC;AAED,UAAU,kBAAkB;IAC1B,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAA;IACtC,MAAM,EAAE,eAAe,CAAA;CACxB;AAYD,qBAAa,QAAS,YAAW,SAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IACrD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAQ;IACvC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAQ;IACzC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAQ;IAC3C,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAQ;IAC/C,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAQ;IACrD,OAAO,CAAC,QAAQ,CAAC,+BAA+B,CAAQ;IACxD,OAAO,CAAC,gBAAgB,CAAC,CAAgC;IACzD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAE5B;;;;OAIG;gBACU,UAAU,EAAE,kBAAkB,EAAE,IAAI,EAAE,YAAY;IA4C/D,SAAS,IAAK,OAAO;IAIrB,KAAK,IAAK,IAAI;IAUd,UAAU,IAAK,IAAI;IAOnB,IAAI,IAAK,IAAI;IAQP,QAAQ,IAAK,OAAO,CAAC,IAAI,CAAC;CA4JjC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/auto-dial.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/auto-dial.js deleted file mode 100644 index 801fc1e0c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/auto-dial.js +++ /dev/null @@ -1,224 +0,0 @@ -import { PeerMap, PeerSet } from '@libp2p/peer-collections'; -import { PeerJobQueue } from '@libp2p/utils/peer-job-queue'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { AUTO_DIAL_CONCURRENCY, AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE, AUTO_DIAL_INTERVAL, AUTO_DIAL_MAX_QUEUE_LENGTH, AUTO_DIAL_PEER_RETRY_THRESHOLD, AUTO_DIAL_PRIORITY, LAST_DIAL_FAILURE_KEY, MIN_CONNECTIONS } from './constants.js'; -const defaultOptions = { - minConnections: MIN_CONNECTIONS, - maxQueueLength: AUTO_DIAL_MAX_QUEUE_LENGTH, - autoDialConcurrency: AUTO_DIAL_CONCURRENCY, - autoDialPriority: AUTO_DIAL_PRIORITY, - autoDialInterval: AUTO_DIAL_INTERVAL, - autoDialPeerRetryThreshold: AUTO_DIAL_PEER_RETRY_THRESHOLD, - autoDialDiscoveredPeersDebounce: AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE -}; -export class AutoDial { - connectionManager; - peerStore; - queue; - minConnections; - autoDialPriority; - autoDialIntervalMs; - autoDialMaxQueueLength; - autoDialPeerRetryThresholdMs; - autoDialDiscoveredPeersDebounce; - autoDialInterval; - started; - running; - log; - /** - * Proactively tries to connect to known peers stored in the PeerStore. - * It will keep the number of connections below the upper limit and sort - * the peers to connect based on whether we know their keys and protocols. - */ - constructor(components, init) { - this.connectionManager = components.connectionManager; - this.peerStore = components.peerStore; - this.minConnections = init.minConnections ?? defaultOptions.minConnections; - this.autoDialPriority = init.autoDialPriority ?? defaultOptions.autoDialPriority; - this.autoDialIntervalMs = init.autoDialInterval ?? defaultOptions.autoDialInterval; - this.autoDialMaxQueueLength = init.maxQueueLength ?? defaultOptions.maxQueueLength; - this.autoDialPeerRetryThresholdMs = init.autoDialPeerRetryThreshold ?? defaultOptions.autoDialPeerRetryThreshold; - this.autoDialDiscoveredPeersDebounce = init.autoDialDiscoveredPeersDebounce ?? defaultOptions.autoDialDiscoveredPeersDebounce; - this.log = components.logger.forComponent('libp2p:connection-manager:auto-dial'); - this.started = false; - this.running = false; - this.queue = new PeerJobQueue({ - concurrency: init.autoDialConcurrency ?? defaultOptions.autoDialConcurrency - }); - this.queue.addListener('error', (err) => { - this.log.error('error during auto-dial', err); - }); - // check the min connection limit whenever a peer disconnects - components.events.addEventListener('connection:close', () => { - this.autoDial() - .catch(err => { - this.log.error(err); - }); - }); - // sometimes peers are discovered in quick succession so add a small - // debounce to ensure all eligible peers are autodialed - let debounce; - // when new peers are discovered, dial them if we don't have - // enough connections - components.events.addEventListener('peer:discovery', () => { - clearTimeout(debounce); - debounce = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error(err); - }); - }, this.autoDialDiscoveredPeersDebounce); - }); - } - isStarted() { - return this.started; - } - start() { - this.autoDialInterval = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err); - }); - }, this.autoDialIntervalMs); - this.started = true; - } - afterStart() { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err); - }); - } - stop() { - // clear the queue - this.queue.clear(); - clearTimeout(this.autoDialInterval); - this.started = false; - this.running = false; - } - async autoDial() { - if (!this.started) { - return; - } - const connections = this.connectionManager.getConnectionsMap(); - const numConnections = connections.size; - // Already has enough connections - if (numConnections >= this.minConnections) { - if (this.minConnections > 0) { - this.log.trace('have enough connections %d/%d', numConnections, this.minConnections); - } - return; - } - if (this.queue.size > this.autoDialMaxQueueLength) { - this.log('not enough connections %d/%d but auto dial queue is full', numConnections, this.minConnections); - return; - } - if (this.running) { - this.log('not enough connections %d/%d - but skipping autodial as it is already running', numConnections, this.minConnections); - return; - } - this.running = true; - this.log('not enough connections %d/%d - will dial peers to increase the number of connections', numConnections, this.minConnections); - const dialQueue = new PeerSet( - // @ts-expect-error boolean filter removes falsy peer IDs - this.connectionManager.getDialQueue() - .map(queue => queue.peerId) - .filter(Boolean)); - // Sort peers on whether we know protocols or public keys for them - const peers = await this.peerStore.all({ - filters: [ - // Remove some peers - (peer) => { - // Remove peers without addresses - if (peer.addresses.length === 0) { - this.log.trace('not autodialing %p because they have no addresses', peer.id); - return false; - } - // remove peers we are already connected to - if (connections.has(peer.id)) { - this.log.trace('not autodialing %p because they are already connected', peer.id); - return false; - } - // remove peers we are already dialling - if (dialQueue.has(peer.id)) { - this.log.trace('not autodialing %p because they are already being dialed', peer.id); - return false; - } - // remove peers already in the autodial queue - if (this.queue.hasJob(peer.id)) { - this.log.trace('not autodialing %p because they are already being autodialed', peer.id); - return false; - } - return true; - } - ] - }); - // shuffle the peers - this is so peers with the same tag values will be - // dialled in a different order each time - const shuffledPeers = peers.sort(() => Math.random() > 0.5 ? 1 : -1); - // Sort shuffled peers by tag value - const peerValues = new PeerMap(); - for (const peer of shuffledPeers) { - if (peerValues.has(peer.id)) { - continue; - } - // sum all tag values - peerValues.set(peer.id, [...peer.tags.values()].reduce((acc, curr) => { - return acc + curr.value; - }, 0)); - } - // sort by value, highest to lowest - const sortedPeers = shuffledPeers.sort((a, b) => { - const peerAValue = peerValues.get(a.id) ?? 0; - const peerBValue = peerValues.get(b.id) ?? 0; - if (peerAValue > peerBValue) { - return -1; - } - if (peerAValue < peerBValue) { - return 1; - } - return 0; - }); - const peersThatHaveNotFailed = sortedPeers.filter(peer => { - const lastDialFailure = peer.metadata.get(LAST_DIAL_FAILURE_KEY); - if (lastDialFailure == null) { - return true; - } - const lastDialFailureTimestamp = parseInt(uint8ArrayToString(lastDialFailure)); - if (isNaN(lastDialFailureTimestamp)) { - return true; - } - // only dial if the time since the last failure is above the retry threshold - return Date.now() - lastDialFailureTimestamp > this.autoDialPeerRetryThresholdMs; - }); - this.log('selected %d/%d peers to dial', peersThatHaveNotFailed.length, peers.length); - for (const peer of peersThatHaveNotFailed) { - this.queue.add(async () => { - const numConnections = this.connectionManager.getConnectionsMap().size; - // Check to see if we still need to auto dial - if (numConnections >= this.minConnections) { - this.log('got enough connections now %d/%d', numConnections, this.minConnections); - this.queue.clear(); - return; - } - this.log('connecting to a peerStore stored peer %p', peer.id); - await this.connectionManager.openConnection(peer.id, { - priority: this.autoDialPriority - }); - }, { - peerId: peer.id - }).catch(err => { - this.log.error('could not connect to peerStore stored peer', err); - }); - } - this.running = false; - if (this.started) { - this.autoDialInterval = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err); - }); - }, this.autoDialIntervalMs); - } - } -} -//# sourceMappingURL=auto-dial.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/auto-dial.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/auto-dial.js.map deleted file mode 100644 index ffc5b37a7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/auto-dial.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auto-dial.js","sourceRoot":"","sources":["../../../src/connection-manager/auto-dial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,qBAAqB,EAAE,mCAAmC,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAwBvO,MAAM,cAAc,GAAG;IACrB,cAAc,EAAE,eAAe;IAC/B,cAAc,EAAE,0BAA0B;IAC1C,mBAAmB,EAAE,qBAAqB;IAC1C,gBAAgB,EAAE,kBAAkB;IACpC,gBAAgB,EAAE,kBAAkB;IACpC,0BAA0B,EAAE,8BAA8B;IAC1D,+BAA+B,EAAE,mCAAmC;CACrE,CAAA;AAED,MAAM,OAAO,QAAQ;IACF,iBAAiB,CAAmB;IACpC,SAAS,CAAW;IACpB,KAAK,CAAc;IACnB,cAAc,CAAQ;IACtB,gBAAgB,CAAQ;IACxB,kBAAkB,CAAQ;IAC1B,sBAAsB,CAAQ;IAC9B,4BAA4B,CAAQ;IACpC,+BAA+B,CAAQ;IAChD,gBAAgB,CAAiC;IACjD,OAAO,CAAS;IAChB,OAAO,CAAS;IACP,GAAG,CAAQ;IAE5B;;;;OAIG;IACH,YAAa,UAA8B,EAAE,IAAkB;QAC7D,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAA;QACrD,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAA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AC,EAAE;oBACX,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAA;gBAChD,CAAC,CAAC,CAAA;YACN,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAA;SAC5B;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/connection-pruner.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/connection-pruner.d.ts deleted file mode 100644 index bb19797af..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/connection-pruner.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { Libp2pEvents, ComponentLogger } from '@libp2p/interface'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'; -import type { Multiaddr } from '@multiformats/multiaddr'; -interface ConnectionPrunerInit { - maxConnections?: number; - allow?: Multiaddr[]; -} -interface ConnectionPrunerComponents { - connectionManager: ConnectionManager; - peerStore: PeerStore; - events: TypedEventTarget; - logger: ComponentLogger; -} -/** - * If we go over the max connections limit, choose some connections to close - */ -export declare class ConnectionPruner { - private readonly maxConnections; - private readonly connectionManager; - private readonly peerStore; - private readonly allow; - private readonly events; - private readonly log; - constructor(components: ConnectionPrunerComponents, init?: ConnectionPrunerInit); - /** - * If we have more connections than our maximum, select some excess connections - * to prune based on peer value - */ - maybePruneConnections(): Promise; -} -export {}; -//# sourceMappingURL=connection-pruner.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/connection-pruner.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/connection-pruner.d.ts.map deleted file mode 100644 index 16cb1424a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/connection-pruner.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-pruner.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/connection-pruner.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAU,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAA;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,UAAU,oBAAoB;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;CACpB;AAED,UAAU,0BAA0B;IAClC,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAA;IACtC,MAAM,EAAE,eAAe,CAAA;CACxB;AAOD;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAQ;IACvC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IACrD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgC;IACvD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;gBAEf,UAAU,EAAE,0BAA0B,EAAE,IAAI,GAAE,oBAAyB;IAiBpF;;;OAGG;IACG,qBAAqB,IAAK,OAAO,CAAC,IAAI,CAAC;CAmG9C"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/connection-pruner.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/connection-pruner.js deleted file mode 100644 index 9993d96b0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/connection-pruner.js +++ /dev/null @@ -1,116 +0,0 @@ -import { PeerMap } from '@libp2p/peer-collections'; -import { MAX_CONNECTIONS } from './constants.js'; -const defaultOptions = { - maxConnections: MAX_CONNECTIONS, - allow: [] -}; -/** - * If we go over the max connections limit, choose some connections to close - */ -export class ConnectionPruner { - maxConnections; - connectionManager; - peerStore; - allow; - events; - log; - constructor(components, init = {}) { - this.maxConnections = init.maxConnections ?? defaultOptions.maxConnections; - this.allow = init.allow ?? defaultOptions.allow; - this.connectionManager = components.connectionManager; - this.peerStore = components.peerStore; - this.events = components.events; - this.log = components.logger.forComponent('libp2p:connection-manager:connection-pruner'); - // check the max connection limit whenever a peer connects - components.events.addEventListener('connection:open', () => { - this.maybePruneConnections() - .catch(err => { - this.log.error(err); - }); - }); - } - /** - * If we have more connections than our maximum, select some excess connections - * to prune based on peer value - */ - async maybePruneConnections() { - const connections = this.connectionManager.getConnections(); - const numConnections = connections.length; - const toPrune = Math.max(numConnections - this.maxConnections, 0); - this.log('checking max connections limit %d/%d', numConnections, this.maxConnections); - if (numConnections <= this.maxConnections) { - return; - } - this.log('max connections limit exceeded %d/%d, pruning %d connection(s)', numConnections, this.maxConnections, toPrune); - const peerValues = new PeerMap(); - // work out peer values - for (const connection of connections) { - const remotePeer = connection.remotePeer; - if (peerValues.has(remotePeer)) { - continue; - } - peerValues.set(remotePeer, 0); - try { - const peer = await this.peerStore.get(remotePeer); - // sum all tag values - peerValues.set(remotePeer, [...peer.tags.values()].reduce((acc, curr) => { - return acc + curr.value; - }, 0)); - } - catch (err) { - if (err.code !== 'ERR_NOT_FOUND') { - this.log.error('error loading peer tags', err); - } - } - } - // sort by value, lowest to highest - const sortedConnections = connections.sort((a, b) => { - const peerAValue = peerValues.get(a.remotePeer) ?? 0; - const peerBValue = peerValues.get(b.remotePeer) ?? 0; - if (peerAValue > peerBValue) { - return 1; - } - if (peerAValue < peerBValue) { - return -1; - } - // if the peers have an equal tag value then we want to close short-lived connections first - const connectionALifespan = a.timeline.open; - const connectionBLifespan = b.timeline.open; - if (connectionALifespan < connectionBLifespan) { - return 1; - } - if (connectionALifespan > connectionBLifespan) { - return -1; - } - return 0; - }); - // close some connections - const toClose = []; - for (const connection of sortedConnections) { - this.log('too many connections open - closing a connection to %p', connection.remotePeer); - // check allow list - const connectionInAllowList = this.allow.some((ma) => { - return connection.remoteAddr.toString().startsWith(ma.toString()); - }); - // Connections in the allow list should be excluded from pruning - if (!connectionInAllowList) { - toClose.push(connection); - } - if (toClose.length === toPrune) { - break; - } - } - // close connections - await Promise.all(toClose.map(async (connection) => { - try { - await connection.close(); - } - catch (err) { - this.log.error(err); - } - })); - // despatch prune event - this.events.safeDispatchEvent('connection:prune', { detail: toClose }); - } -} -//# sourceMappingURL=connection-pruner.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/connection-pruner.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/connection-pruner.js.map deleted file mode 100644 index baaa2d894..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/connection-pruner.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-pruner.js","sourceRoot":"","sources":["../../../src/connection-manager/connection-pruner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAmBhD,MAAM,cAAc,GAAG;IACrB,cAAc,EAAE,eAAe;IAC/B,KAAK,EAAE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CAAC,KAAK,EAAE,CAAA;aACzB;YAAC,OAAO,GAAG,EAAE;gBACZ,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;aACpB;QACH,CAAC,CAAC,CACH,CAAA;QAED,uBAAuB;QACvB,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;IACxE,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.browser.d.ts deleted file mode 100644 index 925afbf76..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.browser.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export * from './constants.defaults.js'; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export declare const MIN_CONNECTIONS = 5; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export declare const MAX_CONNECTIONS = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export declare const MAX_PARALLEL_DIALS = 50; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export declare const AUTO_DIAL_PEER_RETRY_THRESHOLD: number; -//# sourceMappingURL=constants.browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.browser.d.ts.map deleted file mode 100644 index 090ece33c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.browser.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/constants.browser.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC;;GAEG;AACH,eAAO,MAAM,eAAe,IAAI,CAAA;AAEhC;;GAEG;AACH,eAAO,MAAM,eAAe,MAAM,CAAA;AAElC;;GAEG;AACH,eAAO,MAAM,kBAAkB,KAAK,CAAA;AAEpC;;GAEG;AACH,eAAO,MAAM,8BAA8B,QAAgB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.browser.js deleted file mode 100644 index 1d1ac1e69..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.browser.js +++ /dev/null @@ -1,18 +0,0 @@ -export * from './constants.defaults.js'; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export const MIN_CONNECTIONS = 5; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export const MAX_CONNECTIONS = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export const MAX_PARALLEL_DIALS = 50; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export const AUTO_DIAL_PEER_RETRY_THRESHOLD = 1000 * 60 * 7; -//# sourceMappingURL=constants.browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.browser.js.map deleted file mode 100644 index e5dde1817..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.browser.js","sourceRoot":"","sources":["../../../src/connection-manager/constants.browser.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAA;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAA;AAEpC;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,GAAG,EAAE,GAAG,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.d.ts deleted file mode 100644 index 7abb2020e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export * from './constants.defaults.js'; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export declare const MIN_CONNECTIONS = 50; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export declare const MAX_CONNECTIONS = 300; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export declare const MAX_PARALLEL_DIALS = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export declare const AUTO_DIAL_PEER_RETRY_THRESHOLD: number; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.d.ts.map deleted file mode 100644 index 6e0f71505..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/constants.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC;;GAEG;AACH,eAAO,MAAM,eAAe,KAAK,CAAA;AAEjC;;GAEG;AACH,eAAO,MAAM,eAAe,MAAM,CAAA;AAElC;;GAEG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAA;AAErC;;GAEG;AACH,eAAO,MAAM,8BAA8B,QAAY,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.defaults.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.defaults.d.ts deleted file mode 100644 index 24e4c5c07..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.defaults.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#dialTimeout - */ -export declare const DIAL_TIMEOUT = 30000; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundUpgradeTimeout - */ -export declare const INBOUND_UPGRADE_TIMEOUT = 30000; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxPeerAddrsToDial - */ -export declare const MAX_PEER_ADDRS_TO_DIAL = 25; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialInterval - */ -export declare const AUTO_DIAL_INTERVAL = 5000; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialConcurrency - */ -export declare const AUTO_DIAL_CONCURRENCY = 25; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialPriority - */ -export declare const AUTO_DIAL_PRIORITY = 0; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialMaxQueueLength - */ -export declare const AUTO_DIAL_MAX_QUEUE_LENGTH = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialDiscoveredPeersDebounce - */ -export declare const AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE = 10; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundConnectionThreshold - */ -export declare const INBOUND_CONNECTION_THRESHOLD = 5; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxIncomingPendingConnections - */ -export declare const MAX_INCOMING_PENDING_CONNECTIONS = 10; -/** - * Store as part of the peer store metadata for a given peer, the value for this - * key is a timestamp of the last time a dial attempted failed with the relevant - * peer stored as a string. - * - * Used to insure we do not endlessly try to auto dial peers we have recently - * failed to dial. - */ -export declare const LAST_DIAL_FAILURE_KEY = "last-dial-failure"; -//# sourceMappingURL=constants.defaults.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.defaults.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.defaults.d.ts.map deleted file mode 100644 index 67ae45655..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.defaults.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.defaults.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/constants.defaults.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,YAAY,QAAO,CAAA;AAEhC;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAAO,CAAA;AAE3C;;GAEG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAA;AAExC;;GAEG;AACH,eAAO,MAAM,kBAAkB,OAAO,CAAA;AAEtC;;GAEG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAA;AAEvC;;GAEG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAA;AAEnC;;GAEG;AACH,eAAO,MAAM,0BAA0B,MAAM,CAAA;AAE7C;;GAEG;AACH,eAAO,MAAM,mCAAmC,KAAK,CAAA;AAErD;;GAEG;AACH,eAAO,MAAM,4BAA4B,IAAI,CAAA;AAE7C;;GAEG;AACH,eAAO,MAAM,gCAAgC,KAAK,CAAA;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,sBAAsB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.defaults.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.defaults.js deleted file mode 100644 index 8175635a8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.defaults.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#dialTimeout - */ -export const DIAL_TIMEOUT = 30e3; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundUpgradeTimeout - */ -export const INBOUND_UPGRADE_TIMEOUT = 30e3; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxPeerAddrsToDial - */ -export const MAX_PEER_ADDRS_TO_DIAL = 25; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialInterval - */ -export const AUTO_DIAL_INTERVAL = 5000; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialConcurrency - */ -export const AUTO_DIAL_CONCURRENCY = 25; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialPriority - */ -export const AUTO_DIAL_PRIORITY = 0; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialMaxQueueLength - */ -export const AUTO_DIAL_MAX_QUEUE_LENGTH = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialDiscoveredPeersDebounce - */ -export const AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE = 10; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundConnectionThreshold - */ -export const INBOUND_CONNECTION_THRESHOLD = 5; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxIncomingPendingConnections - */ -export const MAX_INCOMING_PENDING_CONNECTIONS = 10; -/** - * Store as part of the peer store metadata for a given peer, the value for this - * key is a timestamp of the last time a dial attempted failed with the relevant - * peer stored as a string. - * - * Used to insure we do not endlessly try to auto dial peers we have recently - * failed to dial. - */ -export const LAST_DIAL_FAILURE_KEY = 'last-dial-failure'; -//# sourceMappingURL=constants.defaults.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.defaults.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.defaults.js.map deleted file mode 100644 index 39ecc9b1a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.defaults.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.defaults.js","sourceRoot":"","sources":["../../../src/connection-manager/constants.defaults.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAA;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAA;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAA;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAA;AAEtC;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAA;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAA;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAA;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,EAAE,CAAA;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAA;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,CAAA;AAElD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.js deleted file mode 100644 index df9b5d654..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.js +++ /dev/null @@ -1,18 +0,0 @@ -export * from './constants.defaults.js'; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export const MIN_CONNECTIONS = 50; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export const MAX_CONNECTIONS = 300; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export const MAX_PARALLEL_DIALS = 100; -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export const AUTO_DIAL_PEER_RETRY_THRESHOLD = 1000 * 60; -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.js.map deleted file mode 100644 index 4f42256bd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/connection-manager/constants.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAA;AAEjC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAErC;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,GAAG,EAAE,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/dial-queue.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/dial-queue.d.ts deleted file mode 100644 index e297eca62..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/dial-queue.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { PeerMap } from '@libp2p/peer-collections'; -import { type Multiaddr, type Resolver } from '@multiformats/multiaddr'; -import PQueue from 'p-queue'; -import type { AddressSorter, AbortOptions, PendingDial, ComponentLogger } from '@libp2p/interface'; -import type { Connection } from '@libp2p/interface/connection'; -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { TransportManager } from '@libp2p/interface-internal/transport-manager'; -export interface PendingDialTarget { - resolve(value: any): void; - reject(err: Error): void; -} -export interface DialOptions extends AbortOptions { - priority?: number; - force?: boolean; -} -interface PendingDialInternal extends PendingDial { - promise: Promise; -} -interface DialerInit { - addressSorter?: AddressSorter; - maxParallelDials?: number; - maxPeerAddrsToDial?: number; - dialTimeout?: number; - resolvers?: Record; - connections?: PeerMap; -} -interface DialQueueComponents { - peerId: PeerId; - metrics?: Metrics; - peerStore: PeerStore; - transportManager: TransportManager; - connectionGater: ConnectionGater; - logger: ComponentLogger; -} -export declare class DialQueue { - pendingDials: PendingDialInternal[]; - queue: PQueue; - private readonly peerId; - private readonly peerStore; - private readonly connectionGater; - private readonly transportManager; - private readonly addressSorter; - private readonly maxPeerAddrsToDial; - private readonly dialTimeout; - private readonly inProgressDialCount?; - private readonly pendingDialCount?; - private readonly shutDownController; - private readonly connections; - private readonly log; - constructor(components: DialQueueComponents, init?: DialerInit); - /** - * Clears any pending dials - */ - stop(): void; - /** - * Connects to a given peer, multiaddr or list of multiaddrs. - * - * If a peer is passed, all known multiaddrs will be tried. If a multiaddr or - * multiaddrs are passed only those will be dialled. - * - * Where a list of multiaddrs is passed, if any contain a peer id then all - * multiaddrs in the list must contain the same peer id. - * - * The dial to the first address that is successfully able to upgrade a connection - * will be used, all other dials will be aborted when that happens. - */ - dial(peerIdOrMultiaddr: PeerId | Multiaddr | Multiaddr[], options?: DialOptions): Promise; - private createDialAbortControllers; - private calculateMultiaddrs; - private performDial; -} -export {}; -//# sourceMappingURL=dial-queue.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/dial-queue.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/dial-queue.d.ts.map deleted file mode 100644 index 2b96b8863..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/dial-queue.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dial-queue.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/dial-queue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAElD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAa,MAAM,yBAAyB,CAAA;AAIlF,OAAO,MAAM,MAAM,SAAS,CAAA;AAW5B,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAU,MAAM,mBAAmB,CAAA;AAC1G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,KAAK,EAAU,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAW,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AAEpF,MAAM,WA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Q,CAAC,WAAW,CAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAQ;IAC7C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAQ;IAC1C,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAiB;IACpD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuB;IACnD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;gBAEf,UAAU,EAAE,mBAAmB,EAAE,IAAI,GAAE,UAAe;IA6DnE;;OAEG;IACH,IAAI,IAAK,IAAI;IAIb;;;;;;;;;;;OAWG;IACG,IAAI,CAAE,iBAAiB,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,EAAE,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,UAAU,CAAC;IAuIhH,OAAO,CAAC,0BAA0B;YAkBpB,mBAAmB;YA0InB,WAAW;CAoH1B"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/dial-queue.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/dial-queue.js deleted file mode 100644 index 51fac6935..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/dial-queue.js +++ /dev/null @@ -1,454 +0,0 @@ -import { AbortError, CodeError } from '@libp2p/interface/errors'; -import { setMaxListeners } from '@libp2p/interface/events'; -import { PeerMap } from '@libp2p/peer-collections'; -import { defaultAddressSort } from '@libp2p/utils/address-sort'; -import { resolvers } from '@multiformats/multiaddr'; -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers'; -import { anySignal } from 'any-signal'; -import pDefer from 'p-defer'; -import PQueue from 'p-queue'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { codes } from '../errors.js'; -import { getPeerAddress } from '../get-peer.js'; -import { DIAL_TIMEOUT, MAX_PARALLEL_DIALS, MAX_PEER_ADDRS_TO_DIAL, LAST_DIAL_FAILURE_KEY } from './constants.js'; -import { combineSignals, resolveMultiaddrs } from './utils.js'; -const ERR_TIMEOUT = 'ERR_TIMEOUT'; -const defaultOptions = { - addressSorter: defaultAddressSort, - maxParallelDials: MAX_PARALLEL_DIALS, - maxPeerAddrsToDial: MAX_PEER_ADDRS_TO_DIAL, - dialTimeout: DIAL_TIMEOUT, - resolvers: { - dnsaddr: dnsaddrResolver - } -}; -export class DialQueue { - pendingDials; - queue; - peerId; - peerStore; - connectionGater; - transportManager; - addressSorter; - maxPeerAddrsToDial; - dialTimeout; - inProgressDialCount; - pendingDialCount; - shutDownController; - connections; - log; - constructor(components, init = {}) { - this.addressSorter = init.addressSorter ?? defaultOptions.addressSorter; - this.maxPeerAddrsToDial = init.maxPeerAddrsToDial ?? defaultOptions.maxPeerAddrsToDial; - this.dialTimeout = init.dialTimeout ?? defaultOptions.dialTimeout; - this.connections = init.connections ?? new PeerMap(); - this.log = components.logger.forComponent('libp2p:connection-manager:dial-queue'); - this.peerId = components.peerId; - this.peerStore = components.peerStore; - this.connectionGater = components.connectionGater; - this.transportManager = components.transportManager; - this.shutDownController = new AbortController(); - setMaxListeners(Infinity, this.shutDownController.signal); - this.pendingDialCount = components.metrics?.registerMetric('libp2p_dial_queue_pending_dials'); - this.inProgressDialCount = components.metrics?.registerMetric('libp2p_dial_queue_in_progress_dials'); - this.pendingDials = []; - for (const [key, value] of Object.entries(init.resolvers ?? {})) { - resolvers.set(key, value); - } - // controls dial concurrency - this.queue = new PQueue({ - concurrency: init.maxParallelDials ?? defaultOptions.maxParallelDials - }); - // a job was added to the queue - this.queue.on('add', () => { - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - // a queued job started - this.queue.on('active', () => { - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - // a started job completed without error - this.queue.on('completed', () => { - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - // a started job errored - this.queue.on('error', (err) => { - this.log.error('error in dial queue', err); - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - // all queued jobs have been started - this.queue.on('empty', () => { - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - // add started jobs have run and the queue is empty - this.queue.on('idle', () => { - this.pendingDialCount?.update(this.queue.size); - this.inProgressDialCount?.update(this.queue.pending); - }); - } - /** - * Clears any pending dials - */ - stop() { - this.shutDownController.abort(); - } - /** - * Connects to a given peer, multiaddr or list of multiaddrs. - * - * If a peer is passed, all known multiaddrs will be tried. If a multiaddr or - * multiaddrs are passed only those will be dialled. - * - * Where a list of multiaddrs is passed, if any contain a peer id then all - * multiaddrs in the list must contain the same peer id. - * - * The dial to the first address that is successfully able to upgrade a connection - * will be used, all other dials will be aborted when that happens. - */ - async dial(peerIdOrMultiaddr, options = {}) { - const { peerId, multiaddrs } = getPeerAddress(peerIdOrMultiaddr); - const addrs = multiaddrs.map(multiaddr => ({ - multiaddr, - isCertified: false - })); - // create abort conditions - need to do this before `calculateMultiaddrs` as we may be about to - // resolve a dns addr which can time out - const signal = this.createDialAbortControllers(options.signal); - let addrsToDial; - try { - // load addresses from address book, resolve and dnsaddrs, filter undiallables, add peer IDs, etc - addrsToDial = await this.calculateMultiaddrs(peerId, addrs, { - ...options, - signal - }); - } - catch (err) { - signal.clear(); - throw err; - } - // make sure we don't have an existing connection to any of the addresses we - // are about to dial - let existingConnection = Array.from(this.connections.values()).flat().find(conn => { - if (options.force === true) { - return false; - } - return addrsToDial.find(addr => { - return addr.multiaddr.equals(conn.remoteAddr); - }); - }); - if (existingConnection != null) { - this.log('already connected to %a', existingConnection.remoteAddr); - return existingConnection; - } - // ready to dial, all async work finished - make sure we don't have any - // pending dials in progress for this peer or set of multiaddrs - const existingDial = this.pendingDials.find(dial => { - // is the dial for the same peer id? - if (dial.peerId != null && peerId != null && dial.peerId.equals(peerId)) { - return true; - } - // is the dial for the same set of multiaddrs? - if (addrsToDial.map(({ multiaddr }) => multiaddr.toString()).join() === dial.multiaddrs.map(multiaddr => multiaddr.toString()).join()) { - return true; - } - return false; - }); - if (existingDial != null) { - this.log('joining existing dial target for %p', peerId); - signal.clear(); - return existingDial.promise; - } - this.log('creating dial target for', addrsToDial.map(({ multiaddr }) => multiaddr.toString())); - // @ts-expect-error .promise property is set below - const pendingDial = { - id: randomId(), - status: 'queued', - peerId, - multiaddrs: addrsToDial.map(({ multiaddr }) => multiaddr) - }; - pendingDial.promise = this.performDial(pendingDial, { - ...options, - signal - }) - .finally(() => { - // remove our pending dial entry - this.pendingDials = this.pendingDials.filter(p => p.id !== pendingDial.id); - // clean up abort signals/controllers - signal.clear(); - }) - .catch(async (err) => { - this.log.error('dial failed to %s', pendingDial.multiaddrs.map(ma => ma.toString()).join(', '), err); - if (peerId != null) { - // record the last failed dial - try { - await this.peerStore.patch(peerId, { - metadata: { - [LAST_DIAL_FAILURE_KEY]: uint8ArrayFromString(Date.now().toString()) - } - }); - } - catch (err) { - this.log.error('could not update last dial failure key for %p', peerId, err); - } - } - // Error is a timeout - if (signal.aborted) { - const error = new CodeError(err.message, ERR_TIMEOUT); - throw error; - } - throw err; - }); - // let other dials join this one - this.pendingDials.push(pendingDial); - const connection = await pendingDial.promise; - // we may have been dialing a multiaddr without a peer id attached but by - // this point we have upgraded the connection so the remote peer information - // should be available - check again that we don't already have a connection - // to the remote multiaddr - existingConnection = Array.from(this.connections.values()).flat().find(conn => { - if (options.force === true) { - return false; - } - return conn.id !== connection.id && conn.remoteAddr.equals(connection.remoteAddr); - }); - if (existingConnection != null) { - this.log('already connected to %a', existingConnection.remoteAddr); - await connection.close(); - return existingConnection; - } - this.log('connection opened to %a', connection.remoteAddr); - return connection; - } - createDialAbortControllers(userSignal) { - // let any signal abort the dial - const signal = anySignal([AbortSignal.timeout(this.dialTimeout), - this.shutDownController.signal, - userSignal - ]); - try { - // This emitter gets listened to a lot - setMaxListeners?.(Infinity, signal); - } - catch { } - return signal; - } - // eslint-disable-next-line complexity - async calculateMultiaddrs(peerId, addrs = [], options = {}) { - // if a peer id or multiaddr(s) with a peer id, make sure it isn't our peer id and that we are allowed to dial it - if (peerId != null) { - if (this.peerId.equals(peerId)) { - throw new CodeError('Tried to dial self', codes.ERR_DIALED_SELF); - } - if ((await this.connectionGater.denyDialPeer?.(peerId)) === true) { - throw new CodeError('The dial request is blocked by gater.allowDialPeer', codes.ERR_PEER_DIAL_INTERCEPTED); - } - // if just a peer id was passed, load available multiaddrs for this peer from the address book - if (addrs.length === 0) { - this.log('loading multiaddrs for %p', peerId); - try { - const peer = await this.peerStore.get(peerId); - addrs.push(...peer.addresses); - this.log('loaded multiaddrs for %p', peerId, addrs.map(({ multiaddr }) => multiaddr.toString())); - } - catch (err) { - if (err.code !== codes.ERR_NOT_FOUND) { - throw err; - } - } - } - } - // resolve addresses - this can result in a one-to-many translation when dnsaddrs are resolved - let resolvedAddresses = (await Promise.all(addrs.map(async (addr) => { - const result = await resolveMultiaddrs(addr.multiaddr, { - ...options, - log: this.log - }); - if (result.length === 1 && result[0].equals(addr.multiaddr)) { - return addr; - } - return result.map(multiaddr => ({ - multiaddr, - isCertified: false - })); - }))) - .flat(); - // ensure the peer id is appended to the multiaddr - if (peerId != null) { - const peerIdMultiaddr = `/p2p/${peerId.toString()}`; - resolvedAddresses = resolvedAddresses.map(addr => { - const lastProto = addr.multiaddr.protos().pop(); - // do not append peer id to path multiaddrs - if (lastProto?.path === true) { - return addr; - } - // append peer id to multiaddr if it is not already present - if (addr.multiaddr.getPeerId() == null) { - return { - multiaddr: addr.multiaddr.encapsulate(peerIdMultiaddr), - isCertified: addr.isCertified - }; - } - return addr; - }); - } - const filteredAddrs = resolvedAddresses.filter(addr => { - // filter out any multiaddrs that we do not have transports for - if (this.transportManager.transportForMultiaddr(addr.multiaddr) == null) { - return false; - } - // if the resolved multiaddr has a PeerID but it's the wrong one, ignore it - // - this can happen with addresses like bootstrap.libp2p.io that resolve - // to multiple different peers - const addrPeerId = addr.multiaddr.getPeerId(); - if (peerId != null && addrPeerId != null) { - return peerId.equals(addrPeerId); - } - return true; - }); - // deduplicate addresses - const dedupedAddrs = new Map(); - for (const addr of filteredAddrs) { - const maStr = addr.multiaddr.toString(); - const existing = dedupedAddrs.get(maStr); - if (existing != null) { - existing.isCertified = existing.isCertified || addr.isCertified || false; - continue; - } - dedupedAddrs.set(maStr, addr); - } - const dedupedMultiaddrs = [...dedupedAddrs.values()]; - if (dedupedMultiaddrs.length === 0 || dedupedMultiaddrs.length > this.maxPeerAddrsToDial) { - this.log('addresses for %p before filtering', peerId ?? 'unknown peer', resolvedAddresses.map(({ multiaddr }) => multiaddr.toString())); - this.log('addresses for %p after filtering', peerId ?? 'unknown peer', dedupedMultiaddrs.map(({ multiaddr }) => multiaddr.toString())); - } - // make sure we actually have some addresses to dial - if (dedupedMultiaddrs.length === 0) { - throw new CodeError('The dial request has no valid addresses', codes.ERR_NO_VALID_ADDRESSES); - } - // make sure we don't have too many addresses to dial - if (dedupedMultiaddrs.length > this.maxPeerAddrsToDial) { - throw new CodeError('dial with more addresses than allowed', codes.ERR_TOO_MANY_ADDRESSES); - } - const gatedAdrs = []; - for (const addr of dedupedMultiaddrs) { - if (this.connectionGater.denyDialMultiaddr != null && await this.connectionGater.denyDialMultiaddr(addr.multiaddr)) { - continue; - } - gatedAdrs.push(addr); - } - const sortedGatedAddrs = gatedAdrs.sort(this.addressSorter); - // make sure we actually have some addresses to dial - if (sortedGatedAddrs.length === 0) { - throw new CodeError('The connection gater denied all addresses in the dial request', codes.ERR_NO_VALID_ADDRESSES); - } - return sortedGatedAddrs; - } - async performDial(pendingDial, options = {}) { - const dialAbortControllers = pendingDial.multiaddrs.map(() => new AbortController()); - try { - // internal peer dial queue - only one dial per peer at a time - const peerDialQueue = new PQueue({ concurrency: 1 }); - peerDialQueue.on('error', (err) => { - this.log.error('error dialing %s %o', pendingDial.multiaddrs, err); - }); - const conn = await Promise.any(pendingDial.multiaddrs.map(async (addr, i) => { - const controller = dialAbortControllers[i]; - if (controller == null) { - throw new CodeError('dialAction did not come with an AbortController', codes.ERR_INVALID_PARAMETERS); - } - // let any signal abort the dial - const signal = combineSignals(controller.signal, options.signal); - signal.addEventListener('abort', () => { - this.log('dial to %a aborted', addr); - }); - const deferred = pDefer(); - await peerDialQueue.add(async () => { - if (signal.aborted) { - this.log('dial to %a was aborted before reaching the head of the peer dial queue', addr); - deferred.reject(new AbortError()); - return; - } - // add the individual dial to the dial queue so we don't breach maxConcurrentDials - await this.queue.add(async () => { - try { - if (signal.aborted) { - this.log('dial to %a was aborted before reaching the head of the dial queue', addr); - deferred.reject(new AbortError()); - return; - } - // update dial status - pendingDial.status = 'active'; - const conn = await this.transportManager.dial(addr, { - ...options, - signal - }); - if (controller.signal.aborted) { - // another dial succeeded faster than this one - this.log('multiple dials succeeded, closing superfluous connection'); - conn.close().catch(err => { - this.log.error('error closing superfluous connection', err); - }); - deferred.reject(new AbortError()); - return; - } - // remove the successful AbortController so it is not aborted - dialAbortControllers[i] = undefined; - // immediately abort any other dials - dialAbortControllers.forEach(c => { - if (c !== undefined) { - c.abort(); - } - }); - this.log('dial to %a succeeded', addr); - // resolve the connection promise - deferred.resolve(conn); - } - catch (err) { - // something only went wrong if our signal was not aborted - this.log.error('error during dial of %a', addr, err); - deferred.reject(err); - } - }, { - ...options, - signal - }).catch(err => { - deferred.reject(err); - }); - }, { - signal - }).catch(err => { - deferred.reject(err); - }).finally(() => { - signal.clear(); - }); - return deferred.promise; - })); - // dial succeeded or failed - if (conn == null) { - throw new CodeError('successful dial led to empty object returned from peer dial queue', codes.ERR_TRANSPORT_DIAL_FAILED); - } - pendingDial.status = 'success'; - return conn; - } - catch (err) { - pendingDial.status = 'error'; - // if we only dialled one address, unwrap the AggregateError to provide more - // useful feedback to the user - if (pendingDial.multiaddrs.length === 1 && err.name === 'AggregateError') { - throw err.errors[0]; - } - throw err; - } - } -} -/** - * Returns a random string - */ -function randomId() { - return `${(parseInt(String(Math.random() * 1e9), 10)).toString()}${Date.now()}`; -} -//# sourceMappingURL=dial-queue.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/dial-queue.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/dial-queue.js.map deleted file mode 100644 index c63182258..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/dial-queue.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dial-queue.js","sourceRoot":"","sources":["../../../src/connection-manager/dial-queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAiC,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAwB,SAAS,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,C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0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/index.d.ts deleted file mode 100644 index 7a34e63e8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/index.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { PeerMap } from '@libp2p/peer-collections'; -import { type Multiaddr, type Resolver } from '@multiformats/multiaddr'; -import { AutoDial } from './auto-dial.js'; -import { ConnectionPruner } from './connection-pruner.js'; -import { DialQueue } from './dial-queue.js'; -import type { PendingDial, AddressSorter, Libp2pEvents, AbortOptions, ComponentLogger } from '@libp2p/interface'; -import type { Connection, MultiaddrConnection } from '@libp2p/interface/connection'; -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Startable } from '@libp2p/interface/startable'; -import type { ConnectionManager, OpenConnectionOptions } from '@libp2p/interface-internal/connection-manager'; -import type { TransportManager } from '@libp2p/interface-internal/transport-manager'; -export interface ConnectionManagerInit { - /** - * The maximum number of connections libp2p is willing to have before it starts - * pruning connections to reduce resource usage. (default: 300, 100 in browsers) - */ - maxConnections?: number; - /** - * The minimum number of connections below which libp2p will start to dial peers - * from the peer book. Setting this to 0 effectively disables this behaviour. - * (default: 50, 5 in browsers) - */ - minConnections?: number; - /** - * How long to wait between attempting to keep our number of concurrent connections - * above minConnections (default: 5000) - */ - autoDialInterval?: number; - /** - * When dialling peers from the peer book to keep the number of open connections - * above `minConnections`, add dials for this many peers to the dial queue - * at once. (default: 25) - */ - autoDialConcurrency?: number; - /** - * To allow user dials to take priority over auto dials, use this value as the - * dial priority. (default: 0) - */ - autoDialPriority?: number; - /** - * Limit the maximum number of peers to dial when trying to keep the number of - * open connections above `minConnections`. (default: 100) - */ - autoDialMaxQueueLength?: number; - /** - * When we've failed to dial a peer, do not autodial them again within this - * number of ms. (default: 1 minute, 7 minutes in browsers) - */ - autoDialPeerRetryThreshold?: number; - /** - * Newly discovered peers may be auto-dialed to increase the number of open - * connections, but they can be discovered in quick succession so add a small - * delay before attempting to dial them in case more peers have been - * discovered. (default: 10ms) - */ - autoDialDiscoveredPeersDebounce?: number; - /** - * Sort the known addresses of a peer before trying to dial, By default public - * addresses will be dialled before private (e.g. loopback or LAN) addresses. - */ - addressSorter?: AddressSorter; - /** - * The maximum number of dials across all peers to execute in parallel. - * (default: 100, 50 in browsers) - */ - maxParallelDials?: number; - /** - * Maximum number of addresses allowed for a given peer - if a peer has more - * addresses than this then the dial will fail. (default: 25) - */ - maxPeerAddrsToDial?: number; - /** - * How long a dial attempt is allowed to take, including DNS resolution - * of the multiaddr, opening a socket and upgrading it to a Connection. - */ - dialTimeout?: number; - /** - * When a new inbound connection is opened, the upgrade process (e.g. protect, - * encrypt, multiplex etc) must complete within this number of ms. (default: 30s) - */ - inboundUpgradeTimeout?: number; - /** - * Multiaddr resolvers to use when dialling - */ - resolvers?: Record; - /** - * A list of multiaddrs that will always be allowed (except if they are in the - * deny list) to open connections to this node even if we've reached maxConnections - */ - allow?: string[]; - /** - * A list of multiaddrs that will never be allowed to open connections to - * this node under any circumstances - */ - deny?: string[]; - /** - * If more than this many connections are opened per second by a single - * host, reject subsequent connections. (default: 5) - */ - inboundConnectionThreshold?: number; - /** - * The maximum number of parallel incoming connections allowed that have yet to - * complete the connection upgrade - e.g. choosing connection encryption, muxer, etc. - * (default: 10) - */ - maxIncomingPendingConnections?: number; -} -export interface DefaultConnectionManagerComponents { - peerId: PeerId; - metrics?: Metrics; - peerStore: PeerStore; - transportManager: TransportManager; - connectionGater: ConnectionGater; - events: TypedEventTarget; - logger: ComponentLogger; -} -/** - * Responsible for managing known connections. - */ -export declare class DefaultConnectionManager implements ConnectionManager, Startable { - private started; - private readonly connections; - private readonly allow; - private readonly deny; - private readonly maxIncomingPendingConnections; - private incomingPendingConnections; - private readonly maxConnections; - readonly dialQueue: DialQueue; - readonly autoDial: AutoDial; - readonly connectionPruner: ConnectionPruner; - private readonly inboundConnectionRateLimiter; - private readonly peerStore; - private readonly metrics?; - private readonly events; - private readonly log; - constructor(components: DefaultConnectionManagerComponents, init?: ConnectionManagerInit); - isStarted(): boolean; - /** - * Starts the Connection Manager. If Metrics are not enabled on libp2p - * only event loop and connection limits will be monitored. - */ - start(): Promise; - afterStart(): Promise; - /** - * Stops the Connection Manager - */ - stop(): Promise; - onConnect(evt: CustomEvent): void; - /** - * Tracks the incoming connection and check the connection limit - */ - _onConnect(evt: CustomEvent): Promise; - /** - * Removes the connection from tracking - */ - onDisconnect(evt: CustomEvent): void; - getConnections(peerId?: PeerId): Connection[]; - getConnectionsMap(): PeerMap; - openConnection(peerIdOrMultiaddr: PeerId | Multiaddr | Multiaddr[], options?: OpenConnectionOptions): Promise; - closeConnections(peerId: PeerId, options?: AbortOptions): Promise; - acceptIncomingConnection(maConn: MultiaddrConnection): Promise; - afterUpgradeInbound(): void; - getDialQueue(): PendingDial[]; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/index.d.ts.map deleted file mode 100644 index 91d3a3a2b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAElD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAa,MAAM,yBAAyB,CAAA;AA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,mBAAmB,IAAK,IAAI;IAI5B,YAAY,IAAK,WAAW,EAAE;CAG/B"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/index.js deleted file mode 100644 index 2f0b460f0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/index.js +++ /dev/null @@ -1,396 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { KEEP_ALIVE } from '@libp2p/interface/peer-store/tags'; -import { PeerMap } from '@libp2p/peer-collections'; -import { defaultAddressSort } from '@libp2p/utils/address-sort'; -import { multiaddr } from '@multiformats/multiaddr'; -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers'; -import { RateLimiterMemory } from 'rate-limiter-flexible'; -import { codes } from '../errors.js'; -import { getPeerAddress } from '../get-peer.js'; -import { AutoDial } from './auto-dial.js'; -import { ConnectionPruner } from './connection-pruner.js'; -import { AUTO_DIAL_CONCURRENCY, AUTO_DIAL_MAX_QUEUE_LENGTH, AUTO_DIAL_PRIORITY, DIAL_TIMEOUT, INBOUND_CONNECTION_THRESHOLD, MAX_CONNECTIONS, MAX_INCOMING_PENDING_CONNECTIONS, MAX_PARALLEL_DIALS, MAX_PEER_ADDRS_TO_DIAL, MIN_CONNECTIONS } from './constants.js'; -import { DialQueue } from './dial-queue.js'; -const DEFAULT_DIAL_PRIORITY = 50; -const defaultOptions = { - minConnections: MIN_CONNECTIONS, - maxConnections: MAX_CONNECTIONS, - inboundConnectionThreshold: INBOUND_CONNECTION_THRESHOLD, - maxIncomingPendingConnections: MAX_INCOMING_PENDING_CONNECTIONS, - autoDialConcurrency: AUTO_DIAL_CONCURRENCY, - autoDialPriority: AUTO_DIAL_PRIORITY, - autoDialMaxQueueLength: AUTO_DIAL_MAX_QUEUE_LENGTH -}; -/** - * Responsible for managing known connections. - */ -export class DefaultConnectionManager { - started; - connections; - allow; - deny; - maxIncomingPendingConnections; - incomingPendingConnections; - maxConnections; - dialQueue; - autoDial; - connectionPruner; - inboundConnectionRateLimiter; - peerStore; - metrics; - events; - log; - constructor(components, init = {}) { - this.maxConnections = init.maxConnections ?? defaultOptions.maxConnections; - const minConnections = init.minConnections ?? defaultOptions.minConnections; - if (this.maxConnections < minConnections) { - throw new CodeError('Connection Manager maxConnections must be greater than minConnections', codes.ERR_INVALID_PARAMETERS); - } - /** - * Map of connections per peer - */ - this.connections = new PeerMap(); - this.started = false; - this.peerStore = components.peerStore; - this.metrics = components.metrics; - this.events = components.events; - this.log = components.logger.forComponent('libp2p:connection-manager'); - this.onConnect = this.onConnect.bind(this); - this.onDisconnect = this.onDisconnect.bind(this); - this.events.addEventListener('connection:open', this.onConnect); - this.events.addEventListener('connection:close', this.onDisconnect); - // allow/deny lists - this.allow = (init.allow ?? []).map(ma => multiaddr(ma)); - this.deny = (init.deny ?? []).map(ma => multiaddr(ma)); - this.incomingPendingConnections = 0; - this.maxIncomingPendingConnections = init.maxIncomingPendingConnections ?? defaultOptions.maxIncomingPendingConnections; - // controls individual peers trying to dial us too quickly - this.inboundConnectionRateLimiter = new RateLimiterMemory({ - points: init.inboundConnectionThreshold ?? defaultOptions.inboundConnectionThreshold, - duration: 1 - }); - // controls what happens when we don't have enough connections - this.autoDial = new AutoDial({ - connectionManager: this, - peerStore: components.peerStore, - events: components.events, - logger: components.logger - }, { - minConnections, - autoDialConcurrency: init.autoDialConcurrency ?? defaultOptions.autoDialConcurrency, - autoDialPriority: init.autoDialPriority ?? defaultOptions.autoDialPriority, - maxQueueLength: init.autoDialMaxQueueLength ?? defaultOptions.autoDialMaxQueueLength - }); - // controls what happens when we have too many connections - this.connectionPruner = new ConnectionPruner({ - connectionManager: this, - peerStore: components.peerStore, - events: components.events, - logger: components.logger - }, { - maxConnections: this.maxConnections, - allow: this.allow - }); - this.dialQueue = new DialQueue({ - peerId: components.peerId, - metrics: components.metrics, - peerStore: components.peerStore, - transportManager: components.transportManager, - connectionGater: components.connectionGater, - logger: components.logger - }, { - addressSorter: init.addressSorter ?? defaultAddressSort, - maxParallelDials: init.maxParallelDials ?? MAX_PARALLEL_DIALS, - maxPeerAddrsToDial: init.maxPeerAddrsToDial ?? MAX_PEER_ADDRS_TO_DIAL, - dialTimeout: init.dialTimeout ?? DIAL_TIMEOUT, - resolvers: init.resolvers ?? { - dnsaddr: dnsaddrResolver - }, - connections: this.connections - }); - } - isStarted() { - return this.started; - } - /** - * Starts the Connection Manager. If Metrics are not enabled on libp2p - * only event loop and connection limits will be monitored. - */ - async start() { - // track inbound/outbound connections - this.metrics?.registerMetricGroup('libp2p_connection_manager_connections', { - calculate: () => { - const metric = { - inbound: 0, - outbound: 0 - }; - for (const conns of this.connections.values()) { - for (const conn of conns) { - if (conn.direction === 'inbound') { - metric.inbound++; - } - else { - metric.outbound++; - } - } - } - return metric; - } - }); - // track total number of streams per protocol - this.metrics?.registerMetricGroup('libp2p_protocol_streams_total', { - label: 'protocol', - calculate: () => { - const metric = {}; - for (const conns of this.connections.values()) { - for (const conn of conns) { - for (const stream of conn.streams) { - const key = `${stream.direction} ${stream.protocol ?? 'unnegotiated'}`; - metric[key] = (metric[key] ?? 0) + 1; - } - } - } - return metric; - } - }); - // track 90th percentile of streams per protocol - this.metrics?.registerMetricGroup('libp2p_connection_manager_protocol_streams_per_connection_90th_percentile', { - label: 'protocol', - calculate: () => { - const allStreams = {}; - for (const conns of this.connections.values()) { - for (const conn of conns) { - const streams = {}; - for (const stream of conn.streams) { - const key = `${stream.direction} ${stream.protocol ?? 'unnegotiated'}`; - streams[key] = (streams[key] ?? 0) + 1; - } - for (const [protocol, count] of Object.entries(streams)) { - allStreams[protocol] = allStreams[protocol] ?? []; - allStreams[protocol].push(count); - } - } - } - const metric = {}; - for (let [protocol, counts] of Object.entries(allStreams)) { - counts = counts.sort((a, b) => a - b); - const index = Math.floor(counts.length * 0.9); - metric[protocol] = counts[index]; - } - return metric; - } - }); - this.autoDial.start(); - this.started = true; - this.log('started'); - } - async afterStart() { - // re-connect to any peers with the KEEP_ALIVE tag - void Promise.resolve() - .then(async () => { - const keepAlivePeers = await this.peerStore.all({ - filters: [(peer) => { - return peer.tags.has(KEEP_ALIVE); - }] - }); - await Promise.all(keepAlivePeers.map(async (peer) => { - await this.openConnection(peer.id) - .catch(err => { - this.log.error(err); - }); - })); - }) - .catch(err => { - this.log.error(err); - }); - this.autoDial.afterStart(); - } - /** - * Stops the Connection Manager - */ - async stop() { - this.dialQueue.stop(); - this.autoDial.stop(); - // Close all connections we're tracking - const tasks = []; - for (const connectionList of this.connections.values()) { - for (const connection of connectionList) { - tasks.push((async () => { - try { - await connection.close(); - } - catch (err) { - this.log.error(err); - } - })()); - } - } - this.log('closing %d connections', tasks.length); - await Promise.all(tasks); - this.connections.clear(); - this.log('stopped'); - } - onConnect(evt) { - void this._onConnect(evt).catch(err => { - this.log.error(err); - }); - } - /** - * Tracks the incoming connection and check the connection limit - */ - async _onConnect(evt) { - const { detail: connection } = evt; - if (!this.started) { - // This can happen when we are in the process of shutting down the node - await connection.close(); - return; - } - const peerId = connection.remotePeer; - const storedConns = this.connections.get(peerId); - let isNewPeer = false; - if (storedConns != null) { - storedConns.push(connection); - } - else { - isNewPeer = true; - this.connections.set(peerId, [connection]); - } - // only need to store RSA public keys, all other types are embedded in the peer id - if (peerId.publicKey != null && peerId.type === 'RSA') { - await this.peerStore.patch(peerId, { - publicKey: peerId.publicKey - }); - } - if (isNewPeer) { - this.events.safeDispatchEvent('peer:connect', { detail: connection.remotePeer }); - } - } - /** - * Removes the connection from tracking - */ - onDisconnect(evt) { - const { detail: connection } = evt; - if (!this.started) { - // This can happen when we are in the process of shutting down the node - return; - } - const peerId = connection.remotePeer; - let storedConn = this.connections.get(peerId); - if (storedConn != null && storedConn.length > 1) { - storedConn = storedConn.filter((conn) => conn.id !== connection.id); - this.connections.set(peerId, storedConn); - } - else if (storedConn != null) { - this.connections.delete(peerId); - this.events.safeDispatchEvent('peer:disconnect', { detail: connection.remotePeer }); - } - } - getConnections(peerId) { - if (peerId != null) { - return this.connections.get(peerId) ?? []; - } - let conns = []; - for (const c of this.connections.values()) { - conns = conns.concat(c); - } - return conns; - } - getConnectionsMap() { - return this.connections; - } - async openConnection(peerIdOrMultiaddr, options = {}) { - if (!this.isStarted()) { - throw new CodeError('Not started', codes.ERR_NODE_NOT_STARTED); - } - options.signal?.throwIfAborted(); - const { peerId } = getPeerAddress(peerIdOrMultiaddr); - if (peerId != null && options.force !== true) { - this.log('dial %p', peerId); - const existingConnection = this.getConnections(peerId) - .find(conn => !conn.transient); - if (existingConnection != null) { - this.log('had an existing non-transient connection to %p', peerId); - return existingConnection; - } - } - const connection = await this.dialQueue.dial(peerIdOrMultiaddr, { - ...options, - priority: options.priority ?? DEFAULT_DIAL_PRIORITY - }); - let peerConnections = this.connections.get(connection.remotePeer); - if (peerConnections == null) { - peerConnections = []; - this.connections.set(connection.remotePeer, peerConnections); - } - // we get notified of connections via the Upgrader emitting "connection" - // events, double check we aren't already tracking this connection before - // storing it - let trackedConnection = false; - for (const conn of peerConnections) { - if (conn.id === connection.id) { - trackedConnection = true; - } - } - if (!trackedConnection) { - peerConnections.push(connection); - } - return connection; - } - async closeConnections(peerId, options = {}) { - const connections = this.connections.get(peerId) ?? []; - await Promise.all(connections.map(async (connection) => { - try { - await connection.close(options); - } - catch (err) { - connection.abort(err); - } - })); - } - async acceptIncomingConnection(maConn) { - // check deny list - const denyConnection = this.deny.some(ma => { - return maConn.remoteAddr.toString().startsWith(ma.toString()); - }); - if (denyConnection) { - this.log('connection from %a refused - connection remote address was in deny list', maConn.remoteAddr); - return false; - } - // check allow list - const allowConnection = this.allow.some(ma => { - return maConn.remoteAddr.toString().startsWith(ma.toString()); - }); - if (allowConnection) { - this.incomingPendingConnections++; - return true; - } - // check pending connections - if (this.incomingPendingConnections === this.maxIncomingPendingConnections) { - this.log('connection from %a refused - incomingPendingConnections exceeded by host', maConn.remoteAddr); - return false; - } - if (maConn.remoteAddr.isThinWaistAddress()) { - const host = maConn.remoteAddr.nodeAddress().address; - try { - await this.inboundConnectionRateLimiter.consume(host, 1); - } - catch { - this.log('connection from %a refused - inboundConnectionThreshold exceeded by host %s', maConn.remoteAddr, host); - return false; - } - } - if (this.getConnections().length < this.maxConnections) { - this.incomingPendingConnections++; - return true; - } - this.log('connection from %a refused - maxConnections exceeded', maConn.remoteAddr); - return false; - } - afterUpgradeInbound() { - this.incomingPendingConnections--; - } - getDialQueue() { - return this.dialQueue.pendingDials; - } -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/index.js.map deleted file mode 100644 index ab7037446..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connection-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAiC,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CA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G,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,OAAO,CAAA;YAEpD,IAAI;gBACF,MAAM,IAAI,CAAC,4BAA4B,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;aACzD;YAAC,MAAM;gBACN,IAAI,CAAC,GAAG,CAAC,6EAA6E,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;gBAChH,OAAO,KAAK,CAAA;aACb;SACF;QAED,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE;YACtD,IAAI,CAAC,0BAA0B,EAAE,CAAA;YAEjC,OAAO,IAAI,CAAA;SACZ;QAED,IAAI,CAAC,GAAG,CAAC,sDAAsD,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;QACnF,OAAO,KAAK,CAAA;IACd,CAAC;IAED,mBAAmB;QACjB,IAAI,CAAC,0BAA0B,EAAE,CAAA;IACnC,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAA;IACpC,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/utils.d.ts deleted file mode 100644 index cab51c8e6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/utils.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { type AbortOptions, type Multiaddr } from '@multiformats/multiaddr'; -import { type ClearableSignal } from 'any-signal'; -import type { LoggerOptions } from '@libp2p/interface'; -/** - * Resolve multiaddr recursively - */ -export declare function resolveMultiaddrs(ma: Multiaddr, options: AbortOptions & LoggerOptions): Promise; -export declare function combineSignals(...signals: Array): ClearableSignal; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/utils.d.ts.map deleted file mode 100644 index 8b759343d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAa,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACtF,OAAO,EAAE,KAAK,eAAe,EAAa,MAAM,YAAY,CAAA;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEtD;;GAEG;AACH,wBAAsB,iBAAiB,CAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,GAAG,aAAa,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CA0BnH;AAgBD,wBAAgB,cAAc,CAAE,GAAG,OAAO,EAAE,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC,GAAG,eAAe,CAgB3F"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/utils.js deleted file mode 100644 index 308b550e9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/utils.js +++ /dev/null @@ -1,56 +0,0 @@ -import { setMaxListeners } from '@libp2p/interface/events'; -import { multiaddr } from '@multiformats/multiaddr'; -import { anySignal } from 'any-signal'; -/** - * Resolve multiaddr recursively - */ -export async function resolveMultiaddrs(ma, options) { - // TODO: recursive logic should live in multiaddr once dns4/dns6 support is in place - // Now only supporting resolve for dnsaddr - const resolvableProto = ma.protoNames().includes('dnsaddr'); - // Multiaddr is not resolvable? End recursion! - if (!resolvableProto) { - return [ma]; - } - const resolvedMultiaddrs = await resolveRecord(ma, options); - const recursiveMultiaddrs = await Promise.all(resolvedMultiaddrs.map(async (nm) => { - return resolveMultiaddrs(nm, options); - })); - const addrs = recursiveMultiaddrs.flat(); - const output = addrs.reduce((array, newM) => { - if (array.find(m => m.equals(newM)) == null) { - array.push(newM); - } - return array; - }, ([])); - options.log('resolved %s to', ma, output.map(ma => ma.toString())); - return output; -} -/** - * Resolve a given multiaddr. If this fails, an empty array will be returned - */ -async function resolveRecord(ma, options) { - try { - ma = multiaddr(ma.toString()); // Use current multiaddr module - const multiaddrs = await ma.resolve(options); - return multiaddrs; - } - catch (err) { - options.log.error(`multiaddr ${ma.toString()} could not be resolved`, err); - return []; - } -} -export function combineSignals(...signals) { - const sigs = []; - for (const sig of signals) { - if (sig != null) { - setMaxListeners(Infinity, sig); - sigs.push(sig); - } - } - // let any signal abort the dial - const signal = anySignal(sigs); - setMaxListeners(Infinity, signal); - return signal; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/utils.js.map deleted file mode 100644 index 9bc4b57e7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection-manager/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/connection-manager/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAqB,SAAS,EAAkB,MAAM,yBAAyB,CAAA;AACtF,OAAO,EAAwB,SAAS,EAAE,MAAM,YAAY,CAAA;AAG5D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAi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7D,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAC5C,OAAO,UAAU,CAAA;KAClB;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,wBAAwB,EAAE,GAAG,CAAC,CAAA;QAC1E,OAAO,EAAE,CAAA;KACV;AACH,CAAC;AAED,MAAM,UAAU,cAAc,CAAE,GAAG,OAAuC;IACxE,MAAM,IAAI,GAAkB,EAAE,CAAA;IAE9B,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;QACzB,IAAI,GAAG,IAAI,IAAI,EAAE;YACf,eAAe,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;YAC9B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;SACf;KACF;IAED,gCAAgC;IAChC,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;IAE9B,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IAEjC,OAAO,MAAM,CAAA;AACf,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection/index.d.ts deleted file mode 100644 index a246a011a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection/index.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { symbol } from '@libp2p/interface/connection'; -import type { AbortOptions, Logger, ComponentLogger } from '@libp2p/interface'; -import type { Direction, Connection, Stream, ConnectionTimeline, ConnectionStatus, NewStreamOptions } from '@libp2p/interface/connection'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { Multiaddr } from '@multiformats/multiaddr'; -interface ConnectionInit { - remoteAddr: Multiaddr; - remotePeer: PeerId; - newStream(protocols: string[], options?: AbortOptions): Promise; - close(options?: AbortOptions): Promise; - abort(err: Error): void; - getStreams(): Stream[]; - status: ConnectionStatus; - direction: Direction; - timeline: ConnectionTimeline; - multiplexer?: string; - encryption?: string; - transient?: boolean; - logger: ComponentLogger; -} -/** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ -export declare class ConnectionImpl implements Connection { - /** - * Connection identifier. - */ - readonly id: string; - /** - * Observed multiaddr of the remote peer - */ - readonly remoteAddr: Multiaddr; - /** - * Remote peer id - */ - readonly remotePeer: PeerId; - direction: Direction; - timeline: ConnectionTimeline; - multiplexer?: string; - encryption?: string; - status: ConnectionStatus; - transient: boolean; - readonly log: Logger; - /** - * User provided tags - * - */ - tags: string[]; - /** - * Reference to the new stream function of the multiplexer - */ - private readonly _newStream; - /** - * Reference to the close function of the raw connection - */ - private readonly _close; - private readonly _abort; - /** - * Reference to the getStreams function of the muxer - */ - private readonly _getStreams; - /** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ - constructor(init: ConnectionInit); - readonly [Symbol.toStringTag] = "Connection"; - readonly [symbol] = true; - /** - * Get all the streams of the muxer - */ - get streams(): Stream[]; - /** - * Create a new stream from this connection - */ - newStream(protocols: string | string[], options?: NewStreamOptions): Promise; - /** - * Close the connection - */ - close(options?: AbortOptions): Promise; - abort(err: Error): void; -} -export declare function createConnection(init: ConnectionInit): Connection; -export {}; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection/index.d.ts.map deleted file mode 100644 index 65815a36d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],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AA;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,gBAAgB,CAAA;IACxB,SAAS,EAAE,OAAO,CAAA;IACzB,SAAgB,GAAG,EAAE,MAAM,CAAA;IAE3B;;;OAGG;IACI,IAAI,EAAE,MAAM,EAAE,CAAA;IAErB;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsE;IAEjG;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;IAElE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAE7C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAgB;IAE5C;;;OAGG;gBACU,IAAI,EAAE,cAAc;IAyBjC,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAe;IAE5C,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAO;IAExB;;OAEG;IACH,IAAI,OAAO,IAAK,MAAM,EAAE,CAEvB;IAED;;OAEG;IACG,SAAS,CAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;IAwB3F;;OAEG;IACG,KAAK,CAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IA0CvD,KAAK,CAAE,GAAG,EAAE,KAAK,GAAG,IAAI;CAczB;AAED,wBAAgB,gBAAgB,CAAE,IAAI,EAAE,cAAc,GAAG,UAAU,CAElE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection/index.js deleted file mode 100644 index b9439ae39..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection/index.js +++ /dev/null @@ -1,147 +0,0 @@ -import { symbol } from '@libp2p/interface/connection'; -import { CodeError } from '@libp2p/interface/errors'; -import { setMaxListeners } from '@libp2p/interface/events'; -const CLOSE_TIMEOUT = 500; -/** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ -export class ConnectionImpl { - /** - * Connection identifier. - */ - id; - /** - * Observed multiaddr of the remote peer - */ - remoteAddr; - /** - * Remote peer id - */ - remotePeer; - direction; - timeline; - multiplexer; - encryption; - status; - transient; - log; - /** - * User provided tags - * - */ - tags; - /** - * Reference to the new stream function of the multiplexer - */ - _newStream; - /** - * Reference to the close function of the raw connection - */ - _close; - _abort; - /** - * Reference to the getStreams function of the muxer - */ - _getStreams; - /** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ - constructor(init) { - const { remoteAddr, remotePeer, newStream, close, abort, getStreams } = init; - this.id = `${(parseInt(String(Math.random() * 1e9))).toString(36)}${Date.now()}`; - this.remoteAddr = remoteAddr; - this.remotePeer = remotePeer; - this.direction = init.direction; - this.status = 'open'; - this.timeline = init.timeline; - this.multiplexer = init.multiplexer; - this.encryption = init.encryption; - this.transient = init.transient ?? false; - this.log = init.logger.forComponent(`libp2p:connection:${this.direction}:${this.id}`); - if (this.remoteAddr.getPeerId() == null) { - this.remoteAddr = this.remoteAddr.encapsulate(`/p2p/${this.remotePeer}`); - } - this._newStream = newStream; - this._close = close; - this._abort = abort; - this._getStreams = getStreams; - this.tags = []; - } - [Symbol.toStringTag] = 'Connection'; - [symbol] = true; - /** - * Get all the streams of the muxer - */ - get streams() { - return this._getStreams(); - } - /** - * Create a new stream from this connection - */ - async newStream(protocols, options) { - if (this.status === 'closing') { - throw new CodeError('the connection is being closed', 'ERR_CONNECTION_BEING_CLOSED'); - } - if (this.status === 'closed') { - throw new CodeError('the connection is closed', 'ERR_CONNECTION_CLOSED'); - } - if (!Array.isArray(protocols)) { - protocols = [protocols]; - } - if (this.transient && options?.runOnTransientConnection !== true) { - throw new CodeError('Cannot open protocol stream on transient connection', 'ERR_TRANSIENT_CONNECTION'); - } - const stream = await this._newStream(protocols, options); - stream.direction = 'outbound'; - return stream; - } - /** - * Close the connection - */ - async close(options = {}) { - if (this.status === 'closed' || this.status === 'closing') { - return; - } - this.log('closing connection to %a', this.remoteAddr); - this.status = 'closing'; - if (options.signal == null) { - const signal = AbortSignal.timeout(CLOSE_TIMEOUT); - setMaxListeners(Infinity, signal); - options = { - ...options, - signal - }; - } - try { - this.log.trace('closing all streams'); - // close all streams gracefully - this can throw if we're not multiplexed - await Promise.all(this.streams.map(async (s) => s.close(options))); - this.log.trace('closing underlying transport'); - // close raw connection - await this._close(options); - this.log.trace('updating timeline with close time'); - this.status = 'closed'; - this.timeline.close = Date.now(); - } - catch (err) { - this.log.error('error encountered during graceful close of connection to %a', this.remoteAddr, err); - this.abort(err); - } - } - abort(err) { - this.log.error('aborting connection to %a due to error', this.remoteAddr, err); - this.status = 'closing'; - this.streams.forEach(s => { s.abort(err); }); - this.log.error('all streams aborted', this.streams.length); - // Abort raw connection - this._abort(err); - this.timeline.close = Date.now(); - this.status = 'closed'; - } -} -export function createConnection(init) { - return new ConnectionImpl(init); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection/index.js.map deleted file mode 100644 index 7479dd06e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/connection/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAM1D,MAAM,a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;SACjC;QAAC,OAAO,GAAQ,EAAE;YACjB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,6DAA6D,EAAE,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;YACnG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;SAChB;IACH,CAAC;IAED,KAAK,CAAE,GAAU;QACf,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,wCAAwC,EAAE,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;QAE9E,IAAI,CAAC,MAAM,GAAG,SAAS,CAAA;QACvB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA,CAAC,CAAC,CAAC,CAAA;QAE3C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAE1D,uBAAuB;QACvB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAEhB,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAChC,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAA;IACxB,CAAC;CACF;AAED,MAAM,UAAU,gBAAgB,CAAE,IAAoB;IACpD,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/index.d.ts deleted file mode 100644 index 7a11cb38b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { AbortOptions } from '@libp2p/interface'; -import type { ContentRouting } from '@libp2p/interface/content-routing'; -import type { PeerInfo } from '@libp2p/interface/peer-info'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Startable } from '@libp2p/interface/startable'; -import type { CID } from 'multiformats/cid'; -export interface CompoundContentRoutingInit { - routers: ContentRouting[]; -} -export interface CompoundContentRoutingComponents { - peerStore: PeerStore; -} -export declare class CompoundContentRouting implements ContentRouting, Startable { - private readonly routers; - private started; - private readonly components; - constructor(components: CompoundContentRoutingComponents, init: CompoundContentRoutingInit); - isStarted(): boolean; - start(): Promise; - stop(): Promise; - /** - * Iterates over all content routers in parallel to find providers of the given key - */ - findProviders(key: CID, options?: AbortOptions): AsyncIterable; - /** - * Iterates over all content routers in parallel to notify it is - * a provider of the given key - */ - provide(key: CID, options?: AbortOptions): Promise; - /** - * Store the given key/value pair in the available content routings - */ - put(key: Uint8Array, value: Uint8Array, options?: AbortOptions): Promise; - /** - * Get the value to the given key. - * Times out after 1 minute by default. - */ - get(key: Uint8Array, options?: AbortOptions): Promise; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/index.d.ts.map deleted file mode 100644 index aa53ef816..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/content-routing/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAE3C,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,cAAc,EAAE,CAAA;CAC1B;AAED,MAAM,WAAW,gCAAgC;IAC/C,SAAS,EAAE,SAAS,CAAA;CACrB;AAED,qBAAa,sBAAuB,YAAW,cAAc,EAAE,SAAS;IACtE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkC;gBAEhD,UAAU,EAAE,gCAAgC,EAAE,IAAI,EAAE,0BAA0B;IAM3F,SAAS,IAAK,OAAO;IAIf,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;IAIvB,IAAI,IAAK,OAAO,CAAC,IAAI,CAAC;IAI5B;;OAEG;IACK,aAAa,CAAE,GAAG,EAAE,GAAG,EAAE,OAAO,GAAE,YAAiB,GAAG,aAAa,CAAC,QAAQ,CAAC;IAerF;;;OAGG;IACG,OAAO,CAAE,GAAG,EAAE,GAAG,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQnE;;OAEG;IACG,GAAG,CAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAUrF;;;OAGG;IACG,GAAG,CAAE,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC;CASzE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/index.js deleted file mode 100644 index 3eb6047c6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/index.js +++ /dev/null @@ -1,67 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import merge from 'it-merge'; -import { pipe } from 'it-pipe'; -import { codes, messages } from '../errors.js'; -import { storeAddresses, uniquePeers, requirePeers } from './utils.js'; -export class CompoundContentRouting { - routers; - started; - components; - constructor(components, init) { - this.routers = init.routers ?? []; - this.started = false; - this.components = components; - } - isStarted() { - return this.started; - } - async start() { - this.started = true; - } - async stop() { - this.started = false; - } - /** - * Iterates over all content routers in parallel to find providers of the given key - */ - async *findProviders(key, options = {}) { - if (this.routers.length === 0) { - throw new CodeError('No content routers available', codes.ERR_NO_ROUTERS_AVAILABLE); - } - yield* pipe(merge(...this.routers.map(router => router.findProviders(key, options))), (source) => storeAddresses(source, this.components.peerStore), (source) => uniquePeers(source), (source) => requirePeers(source)); - } - /** - * Iterates over all content routers in parallel to notify it is - * a provider of the given key - */ - async provide(key, options = {}) { - if (this.routers.length === 0) { - throw new CodeError('No content routers available', codes.ERR_NO_ROUTERS_AVAILABLE); - } - await Promise.all(this.routers.map(async (router) => { await router.provide(key, options); })); - } - /** - * Store the given key/value pair in the available content routings - */ - async put(key, value, options) { - if (!this.isStarted()) { - throw new CodeError(messages.NOT_STARTED_YET, codes.DHT_NOT_STARTED); - } - await Promise.all(this.routers.map(async (router) => { - await router.put(key, value, options); - })); - } - /** - * Get the value to the given key. - * Times out after 1 minute by default. - */ - async get(key, options) { - if (!this.isStarted()) { - throw new CodeError(messages.NOT_STARTED_YET, codes.DHT_NOT_STARTED); - } - return Promise.any(this.routers.map(async (router) => { - return router.get(key, options); - })); - } -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/index.js.map deleted file mode 100644 index 4511ae947..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content-routing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EACL,cAAc,EACd,WAAW,EACX,YAAY,EACb,MAAM,YAAY,CAAA;AAgBnB,MAAM,OAAO,sBAAsB;IAChB,OAAO,CAAkB;IAClC,OAAO,CAAS;IACP,UAAU,CAAkC;IAE7D,YAAa,UAA4C,EAAE,IAAgC;QACzF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAA;QACjC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACpB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;IACrB,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;IACtB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,CAAE,aAAa,CAAE,GAAQ,EAAE,UAAwB,EAAE;QACzD,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;YAC7B,MAAM,IAAI,SAAS,CAAC,8BAA8B,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAA;SACpF;QAED,KAAM,CAAC,CAAC,IAAI,CACV,KAAK,CACH,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,aAAa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SAAS,EAAE,EAAE;YACrB,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;SACrE;QAED,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACnD,OAAO,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QACjC,CAAC,CAAC,CAAC,CAAA;IACL,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/utils.d.ts deleted file mode 100644 index 8cb474c72..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/utils.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { PeerInfo } from '@libp2p/interface/peer-info'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Source } from 'it-stream-types'; -/** - * Store the multiaddrs from every peer in the passed peer store - */ -export declare function storeAddresses(source: Source, peerStore: PeerStore): AsyncIterable; -/** - * Filter peers by unique peer id - */ -export declare function uniquePeers(source: Source): AsyncIterable; -/** - * Require at least `min` peers to be yielded from `source` - */ -export declare function requirePeers(source: Source, min?: number): AsyncIterable; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/utils.d.ts.map deleted file mode 100644 index 02132d58d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/content-routing/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C;;GAEG;AACH,wBAAwB,cAAc,CAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,GAAG,aAAa,CAAC,QAAQ,CAAC,CAS/G;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC,CAc9E;AAED;;GAEG;AACH,wBAAwB,YAAY,CAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,GAAE,MAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,CAYxG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/utils.js deleted file mode 100644 index 5cd467241..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/utils.js +++ /dev/null @@ -1,44 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import filter from 'it-filter'; -import map from 'it-map'; -/** - * Store the multiaddrs from every peer in the passed peer store - */ -export async function* storeAddresses(source, peerStore) { - yield* map(source, async (peer) => { - // ensure we have the addresses for a given peer - await peerStore.merge(peer.id, { - multiaddrs: peer.multiaddrs - }); - return peer; - }); -} -/** - * Filter peers by unique peer id - */ -export function uniquePeers(source) { - /** @type Set */ - const seen = new Set(); - return filter(source, (peer) => { - // dedupe by peer id - if (seen.has(peer.id.toString())) { - return false; - } - seen.add(peer.id.toString()); - return true; - }); -} -/** - * Require at least `min` peers to be yielded from `source` - */ -export async function* requirePeers(source, min = 1) { - let seen = 0; - for await (const peer of source) { - seen++; - yield peer; - } - if (seen < min) { - throw new CodeError(`more peers required, seen: ${seen} min: ${min}`, 'NOT_FOUND'); - } -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/utils.js.map deleted file mode 100644 index d89a727c2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/content-routing/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/content-routing/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,GAAG,MAAM,QAAQ,CAAA;AAKxB;;GAEG;AACH,MAAM,CAAC,KAAK,SAAU,CAAC,CAAC,cAAc,CAAE,MAAwB,EAAE,SAAoB;IACpF,KAAM,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACjC,gDAAgD;QAChD,MAAM,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE;YAC7B,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAE,MAAwB;IACnD,wBAAwB;IACxB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAE,CAAA;IAEtB,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QAC7B,oBAAoB;QACpB,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE;YAChC,OAAO,KAAK,CAAA;SACb;QAED,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;QAE5B,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,SAAU,CAAC,CAAC,YAAY,CAAE,MAAwB,EAAE,MAAc,CAAC;IAC7E,IAAI,IAAI,GAAG,CAAC,CAAA;IAEZ,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,MAAM,EAAE;QAC/B,IAAI,EAAE,CAAA;QAEN,MAAM,IAAI,CAAA;KACX;IAED,IAAI,IAAI,GAAG,GAAG,EAAE;QACd,MAAM,IAAI,SAAS,CAAC,8BAA8B,IAAI,UAAU,GAAG,EAAE,EAAE,WAAW,CAAC,CAAA;KACpF;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/errors.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/errors.d.ts deleted file mode 100644 index 49b621f5e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/errors.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -export declare enum messages { - NOT_STARTED_YET = "The libp2p node is not started yet", - DHT_DISABLED = "DHT is not available", - PUBSUB_DISABLED = "PubSub is not available", - CONN_ENCRYPTION_REQUIRED = "At least one connection encryption module is required", - ERR_TRANSPORTS_REQUIRED = "At least one transport module is required", - ERR_PROTECTOR_REQUIRED = "Private network is enforced, but no protector was provided", - NOT_FOUND = "Not found" -} -export declare enum codes { - DHT_DISABLED = "ERR_DHT_DISABLED", - ERR_PUBSUB_DISABLED = "ERR_PUBSUB_DISABLED", - PUBSUB_NOT_STARTED = "ERR_PUBSUB_NOT_STARTED", - DHT_NOT_STARTED = "ERR_DHT_NOT_STARTED", - CONN_ENCRYPTION_REQUIRED = "ERR_CONN_ENCRYPTION_REQUIRED", - ERR_TRANSPORTS_REQUIRED = "ERR_TRANSPORTS_REQUIRED", - ERR_PROTECTOR_REQUIRED = "ERR_PROTECTOR_REQUIRED", - ERR_PEER_DIAL_INTERCEPTED = "ERR_PEER_DIAL_INTERCEPTED", - ERR_CONNECTION_INTERCEPTED = "ERR_CONNECTION_INTERCEPTED", - ERR_INVALID_PROTOCOLS_FOR_STREAM = "ERR_INVALID_PROTOCOLS_FOR_STREAM", - ERR_CONNECTION_ENDED = "ERR_CONNECTION_ENDED", - ERR_CONNECTION_FAILED = "ERR_CONNECTION_FAILED", - ERR_NODE_NOT_STARTED = "ERR_NODE_NOT_STARTED", - ERR_ALREADY_ABORTED = "ERR_ALREADY_ABORTED", - ERR_TOO_MANY_ADDRESSES = "ERR_TOO_MANY_ADDRESSES", - ERR_NO_VALID_ADDRESSES = "ERR_NO_VALID_ADDRESSES", - ERR_RELAYED_DIAL = "ERR_RELAYED_DIAL", - ERR_DIALED_SELF = "ERR_DIALED_SELF", - ERR_DISCOVERED_SELF = "ERR_DISCOVERED_SELF", - ERR_DUPLICATE_TRANSPORT = "ERR_DUPLICATE_TRANSPORT", - ERR_ENCRYPTION_FAILED = "ERR_ENCRYPTION_FAILED", - ERR_HOP_REQUEST_FAILED = "ERR_HOP_REQUEST_FAILED", - ERR_INVALID_KEY = "ERR_INVALID_KEY", - ERR_INVALID_MESSAGE = "ERR_INVALID_MESSAGE", - ERR_INVALID_PARAMETERS = "ERR_INVALID_PARAMETERS", - ERR_INVALID_PEER = "ERR_INVALID_PEER", - ERR_MUXER_UNAVAILABLE = "ERR_MUXER_UNAVAILABLE", - ERR_NOT_FOUND = "ERR_NOT_FOUND", - ERR_TRANSPORT_UNAVAILABLE = "ERR_TRANSPORT_UNAVAILABLE", - ERR_TRANSPORT_DIAL_FAILED = "ERR_TRANSPORT_DIAL_FAILED", - ERR_UNSUPPORTED_PROTOCOL = "ERR_UNSUPPORTED_PROTOCOL", - ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED = "ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED", - ERR_INVALID_MULTIADDR = "ERR_INVALID_MULTIADDR", - ERR_SIGNATURE_NOT_VALID = "ERR_SIGNATURE_NOT_VALID", - ERR_FIND_SELF = "ERR_FIND_SELF", - ERR_NO_ROUTERS_AVAILABLE = "ERR_NO_ROUTERS_AVAILABLE", - ERR_CONNECTION_NOT_MULTIPLEXED = "ERR_CONNECTION_NOT_MULTIPLEXED", - ERR_NO_DIAL_TOKENS = "ERR_NO_DIAL_TOKENS", - ERR_INVALID_CMS = "ERR_INVALID_CMS", - ERR_MISSING_KEYS = "ERR_MISSING_KEYS", - ERR_NO_KEY = "ERR_NO_KEY", - ERR_INVALID_KEY_NAME = "ERR_INVALID_KEY_NAME", - ERR_INVALID_KEY_TYPE = "ERR_INVALID_KEY_TYPE", - ERR_KEY_ALREADY_EXISTS = "ERR_KEY_ALREADY_EXISTS", - ERR_INVALID_KEY_SIZE = "ERR_INVALID_KEY_SIZE", - ERR_KEY_NOT_FOUND = "ERR_KEY_NOT_FOUND", - ERR_OLD_KEY_NAME_INVALID = "ERR_OLD_KEY_NAME_INVALID", - ERR_NEW_KEY_NAME_INVALID = "ERR_NEW_KEY_NAME_INVALID", - ERR_PASSWORD_REQUIRED = "ERR_PASSWORD_REQUIRED", - ERR_PEM_REQUIRED = "ERR_PEM_REQUIRED", - ERR_CANNOT_READ_KEY = "ERR_CANNOT_READ_KEY", - ERR_MISSING_PRIVATE_KEY = "ERR_MISSING_PRIVATE_KEY", - ERR_MISSING_PUBLIC_KEY = "ERR_MISSING_PUBLIC_KEY", - ERR_INVALID_OLD_PASS_TYPE = "ERR_INVALID_OLD_PASS_TYPE", - ERR_INVALID_NEW_PASS_TYPE = "ERR_INVALID_NEW_PASS_TYPE", - ERR_INVALID_PASS_LENGTH = "ERR_INVALID_PASS_LENGTH", - ERR_NOT_IMPLEMENTED = "ERR_NOT_IMPLEMENTED", - ERR_WRONG_PING_ACK = "ERR_WRONG_PING_ACK", - ERR_INVALID_RECORD = "ERR_INVALID_RECORD", - ERR_ALREADY_SUCCEEDED = "ERR_ALREADY_SUCCEEDED", - ERR_NO_HANDLER_FOR_PROTOCOL = "ERR_NO_HANDLER_FOR_PROTOCOL", - ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS = "ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS", - ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS = "ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS", - ERR_CONNECTION_DENIED = "ERR_CONNECTION_DENIED", - ERR_TRANSFER_LIMIT_EXCEEDED = "ERR_TRANSFER_LIMIT_EXCEEDED" -} -//# sourceMappingURL=errors.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/errors.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/errors.d.ts.map deleted file mode 100644 index 542684ed3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/errors.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,eAAe,uCAAuC;IACtD,YAAY,yBAAyB;IACrC,eAAe,4BAA4B;IAC3C,wBAAwB,0DAA0D;IAClF,uBAAuB,8CAA8C;IACrE,sBAAsB,+DAA+D;IACrF,SAAS,cAAc;CACxB;AAED,oBAAY,KAAK;IACf,YAAY,qBAAqB;IACjC,mBAAmB,wBAAwB;IAC3C,kBAAkB,2BAA2B;IAC7C,eAAe,wBAAwB;IACvC,wBAAwB,iCAAiC;IACzD,uBAAuB,4BAA4B;IACnD,sBAAsB,2BAA2B;IACjD,yBAAyB,8BAA8B;IACvD,0BAA0B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,qCAAqC,0CAA0C;IAC/E,qBAAqB,0BAA0B;IAC/C,2BAA2B,gCAAgC;CAC5D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/errors.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/errors.js deleted file mode 100644 index b8b7f6f32..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/errors.js +++ /dev/null @@ -1,79 +0,0 @@ -export var messages; -(function (messages) { - messages["NOT_STARTED_YET"] = "The libp2p node is not started yet"; - messages["DHT_DISABLED"] = "DHT is not available"; - messages["PUBSUB_DISABLED"] = "PubSub is not available"; - messages["CONN_ENCRYPTION_REQUIRED"] = "At least one connection encryption module is required"; - messages["ERR_TRANSPORTS_REQUIRED"] = "At least one transport module is required"; - messages["ERR_PROTECTOR_REQUIRED"] = "Private network is enforced, but no protector was provided"; - messages["NOT_FOUND"] = "Not found"; -})(messages || (messages = {})); -export var codes; -(function (codes) { - codes["DHT_DISABLED"] = "ERR_DHT_DISABLED"; - codes["ERR_PUBSUB_DISABLED"] = "ERR_PUBSUB_DISABLED"; - codes["PUBSUB_NOT_STARTED"] = "ERR_PUBSUB_NOT_STARTED"; - codes["DHT_NOT_STARTED"] = "ERR_DHT_NOT_STARTED"; - codes["CONN_ENCRYPTION_REQUIRED"] = "ERR_CONN_ENCRYPTION_REQUIRED"; - codes["ERR_TRANSPORTS_REQUIRED"] = "ERR_TRANSPORTS_REQUIRED"; - codes["ERR_PROTECTOR_REQUIRED"] = "ERR_PROTECTOR_REQUIRED"; - codes["ERR_PEER_DIAL_INTERCEPTED"] = "ERR_PEER_DIAL_INTERCEPTED"; - codes["ERR_CONNECTION_INTERCEPTED"] = "ERR_CONNECTION_INTERCEPTED"; - codes["ERR_INVALID_PROTOCOLS_FOR_STREAM"] = "ERR_INVALID_PROTOCOLS_FOR_STREAM"; - codes["ERR_CONNECTION_ENDED"] = "ERR_CONNECTION_ENDED"; - codes["ERR_CONNECTION_FAILED"] = "ERR_CONNECTION_FAILED"; - codes["ERR_NODE_NOT_STARTED"] = "ERR_NODE_NOT_STARTED"; - codes["ERR_ALREADY_ABORTED"] = "ERR_ALREADY_ABORTED"; - codes["ERR_TOO_MANY_ADDRESSES"] = "ERR_TOO_MANY_ADDRESSES"; - codes["ERR_NO_VALID_ADDRESSES"] = "ERR_NO_VALID_ADDRESSES"; - codes["ERR_RELAYED_DIAL"] = "ERR_RELAYED_DIAL"; - codes["ERR_DIALED_SELF"] = "ERR_DIALED_SELF"; - codes["ERR_DISCOVERED_SELF"] = "ERR_DISCOVERED_SELF"; - codes["ERR_DUPLICATE_TRANSPORT"] = "ERR_DUPLICATE_TRANSPORT"; - codes["ERR_ENCRYPTION_FAILED"] = "ERR_ENCRYPTION_FAILED"; - codes["ERR_HOP_REQUEST_FAILED"] = "ERR_HOP_REQUEST_FAILED"; - codes["ERR_INVALID_KEY"] = "ERR_INVALID_KEY"; - codes["ERR_INVALID_MESSAGE"] = "ERR_INVALID_MESSAGE"; - codes["ERR_INVALID_PARAMETERS"] = "ERR_INVALID_PARAMETERS"; - codes["ERR_INVALID_PEER"] = "ERR_INVALID_PEER"; - codes["ERR_MUXER_UNAVAILABLE"] = "ERR_MUXER_UNAVAILABLE"; - codes["ERR_NOT_FOUND"] = "ERR_NOT_FOUND"; - codes["ERR_TRANSPORT_UNAVAILABLE"] = "ERR_TRANSPORT_UNAVAILABLE"; - codes["ERR_TRANSPORT_DIAL_FAILED"] = "ERR_TRANSPORT_DIAL_FAILED"; - codes["ERR_UNSUPPORTED_PROTOCOL"] = "ERR_UNSUPPORTED_PROTOCOL"; - codes["ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED"] = "ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED"; - codes["ERR_INVALID_MULTIADDR"] = "ERR_INVALID_MULTIADDR"; - codes["ERR_SIGNATURE_NOT_VALID"] = "ERR_SIGNATURE_NOT_VALID"; - codes["ERR_FIND_SELF"] = "ERR_FIND_SELF"; - codes["ERR_NO_ROUTERS_AVAILABLE"] = "ERR_NO_ROUTERS_AVAILABLE"; - codes["ERR_CONNECTION_NOT_MULTIPLEXED"] = "ERR_CONNECTION_NOT_MULTIPLEXED"; - codes["ERR_NO_DIAL_TOKENS"] = "ERR_NO_DIAL_TOKENS"; - codes["ERR_INVALID_CMS"] = "ERR_INVALID_CMS"; - codes["ERR_MISSING_KEYS"] = "ERR_MISSING_KEYS"; - codes["ERR_NO_KEY"] = "ERR_NO_KEY"; - codes["ERR_INVALID_KEY_NAME"] = "ERR_INVALID_KEY_NAME"; - codes["ERR_INVALID_KEY_TYPE"] = "ERR_INVALID_KEY_TYPE"; - codes["ERR_KEY_ALREADY_EXISTS"] = "ERR_KEY_ALREADY_EXISTS"; - codes["ERR_INVALID_KEY_SIZE"] = "ERR_INVALID_KEY_SIZE"; - codes["ERR_KEY_NOT_FOUND"] = "ERR_KEY_NOT_FOUND"; - codes["ERR_OLD_KEY_NAME_INVALID"] = "ERR_OLD_KEY_NAME_INVALID"; - codes["ERR_NEW_KEY_NAME_INVALID"] = "ERR_NEW_KEY_NAME_INVALID"; - codes["ERR_PASSWORD_REQUIRED"] = "ERR_PASSWORD_REQUIRED"; - codes["ERR_PEM_REQUIRED"] = "ERR_PEM_REQUIRED"; - codes["ERR_CANNOT_READ_KEY"] = "ERR_CANNOT_READ_KEY"; - codes["ERR_MISSING_PRIVATE_KEY"] = "ERR_MISSING_PRIVATE_KEY"; - codes["ERR_MISSING_PUBLIC_KEY"] = "ERR_MISSING_PUBLIC_KEY"; - codes["ERR_INVALID_OLD_PASS_TYPE"] = "ERR_INVALID_OLD_PASS_TYPE"; - codes["ERR_INVALID_NEW_PASS_TYPE"] = "ERR_INVALID_NEW_PASS_TYPE"; - codes["ERR_INVALID_PASS_LENGTH"] = "ERR_INVALID_PASS_LENGTH"; - codes["ERR_NOT_IMPLEMENTED"] = "ERR_NOT_IMPLEMENTED"; - codes["ERR_WRONG_PING_ACK"] = "ERR_WRONG_PING_ACK"; - codes["ERR_INVALID_RECORD"] = "ERR_INVALID_RECORD"; - codes["ERR_ALREADY_SUCCEEDED"] = "ERR_ALREADY_SUCCEEDED"; - codes["ERR_NO_HANDLER_FOR_PROTOCOL"] = "ERR_NO_HANDLER_FOR_PROTOCOL"; - codes["ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS"] = "ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS"; - codes["ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS"] = "ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS"; - codes["ERR_CONNECTION_DENIED"] = "ERR_CONNECTION_DENIED"; - codes["ERR_TRANSFER_LIMIT_EXCEEDED"] = "ERR_TRANSFER_LIMIT_EXCEEDED"; -})(codes || (codes = {})); -//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/errors.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/errors.js.map deleted file mode 100644 index 6d105551e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAQX;AARD,WAAY,QAAQ;IAClB,kEAAsD,CAAA;IACtD,iDAAqC,CAAA;IACrC,uDAA2C,CAAA;IAC3C,8FAAkF,CAAA;IAClF,iFAAqE,CAAA;IACrE,iGAAqF,CAAA;IACrF,mCAAuB,CAAA;AACzB,CAAC,EARW,QAAQ,KAAR,QAAQ,QAQnB;AAED,MAAM,CAAN,IAAY,KAkEX;AAlED,WAAY,KAAK;IACf,0CAAiC,CAAA;IACjC,oDAA2C,CAAA;IAC3C,sDAA6C,CAAA;IAC7C,gDAAuC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AAA;IAC/E,wDAA+C,CAAA;IAC/C,oEAA2D,CAAA;AAC7D,CAAC,EAlEW,KAAK,KAAL,KAAK,QAkEhB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/get-peer.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/get-peer.d.ts deleted file mode 100644 index 57a58c30b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/get-peer.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { Multiaddr } from '@multiformats/multiaddr'; -export interface PeerAddress { - peerId?: PeerId; - multiaddrs: Multiaddr[]; -} -/** - * Extracts a PeerId and/or multiaddr from the passed PeerId or Multiaddr or an array of Multiaddrs - */ -export declare function getPeerAddress(peer: PeerId | Multiaddr | Multiaddr[]): PeerAddress; -//# sourceMappingURL=get-peer.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/get-peer.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/get-peer.d.ts.map deleted file mode 100644 index 341aabd82..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/get-peer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-peer.d.ts","sourceRoot":"","sources":["../../src/get-peer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,SAAS,EAAE,CAAA;CACxB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,EAAE,GAAG,WAAW,CAyCnF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/get-peer.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/get-peer.js deleted file mode 100644 index 1852d9607..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/get-peer.js +++ /dev/null @@ -1,44 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { isPeerId } from '@libp2p/interface/peer-id'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { isMultiaddr } from '@multiformats/multiaddr'; -import { codes } from './errors.js'; -/** - * Extracts a PeerId and/or multiaddr from the passed PeerId or Multiaddr or an array of Multiaddrs - */ -export function getPeerAddress(peer) { - if (isPeerId(peer)) { - return { peerId: peer, multiaddrs: [] }; - } - if (!Array.isArray(peer)) { - peer = [peer]; - } - let peerId; - if (peer.length > 0) { - const peerIdStr = peer[0].getPeerId(); - peerId = peerIdStr == null ? undefined : peerIdFromString(peerIdStr); - // ensure PeerId is either not set or is consistent - peer.forEach(ma => { - if (!isMultiaddr(ma)) { - throw new CodeError('Invalid Multiaddr', codes.ERR_INVALID_MULTIADDR); - } - const maPeerIdStr = ma.getPeerId(); - if (maPeerIdStr == null) { - if (peerId != null) { - throw new CodeError('Multiaddrs must all have the same peer id or have no peer id', codes.ERR_INVALID_PARAMETERS); - } - } - else { - const maPeerId = peerIdFromString(maPeerIdStr); - if (peerId == null || !peerId.equals(maPeerId)) { - throw new CodeError('Multiaddrs must all have the same peer id or have no peer id', codes.ERR_INVALID_PARAMETERS); - } - } - }); - } - return { - peerId, - multiaddrs: peer - }; -} -//# sourceMappingURL=get-peer.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/get-peer.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/get-peer.js.map deleted file mode 100644 index d77085be5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/get-peer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-peer.js","sourceRoot":"","sources":["../../src/get-peer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AASnC;;GAEG;AACH,MAAM,UAAU,cAAc,CAAE,IAAsC;IACpE,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;QAClB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,CAAA;KACxC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACxB,IAAI,GAAG,CAAC,IAAI,CAAC,CAAA;KACd;IAED,IAAI,MAA0B,CAAA;IAE9B,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;QACnB,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAA;QACrC,MAAM,GAAG,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAA;QAEpE,mDAAmD;QACnD,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;YAChB,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;gBACpB,MAAM,IAAI,SAAS,CAAC,mBAAmB,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAA;aACtE;YAED,MAAM,WAAW,GAAG,EAAE,CAAC,SAAS,EAAE,CAAA;YAElC,IAAI,WAAW,IAAI,IAAI,EAAE;gBACvB,IAAI,MAAM,IAAI,IAAI,EAAE;oBAClB,MAAM,IAAI,SAAS,CAAC,8DAA8D,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAA;iBAClH;aACF;iBAAM;gBACL,MAAM,QAAQ,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAA;gBAE9C,IAAI,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;oBAC9C,MAAM,IAAI,SAAS,CAAC,8DAA8D,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAA;iBAClH;aACF;QACH,CAAC,CAAC,CAAA;KACH;IAED,OAAO;QACL,MAAM;QACN,UAAU,EAAE,IAAI;KACjB,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/index.d.ts deleted file mode 100644 index d542548df..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/index.d.ts +++ /dev/null @@ -1,151 +0,0 @@ -/** - * @packageDocumentation - * - * Use the `createLibp2p` function to create a libp2p node. - * - * @example - * - * ```typescript - * import { createLibp2p } from 'libp2p' - * - * const node = await createLibp2p({ - * // ...other options - * }) - * ``` - */ -import type { AddressManagerInit } from './address-manager/index.js'; -import type { Components } from './components.js'; -import type { ConnectionManagerInit } from './connection-manager/index.js'; -import type { TransportManagerInit } from './transport-manager.js'; -import type { Libp2p, ServiceMap, RecursivePartial, ComponentLogger, NodeInfo } from '@libp2p/interface'; -import type { ConnectionProtector } from '@libp2p/interface/connection'; -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter'; -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -import type { ContentRouting } from '@libp2p/interface/content-routing'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerDiscovery } from '@libp2p/interface/peer-discovery'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerRouting } from '@libp2p/interface/peer-routing'; -import type { StreamMuxerFactory } from '@libp2p/interface/stream-muxer'; -import type { Transport } from '@libp2p/interface/transport'; -import type { PersistentPeerStoreInit } from '@libp2p/peer-store'; -import type { Datastore } from 'interface-datastore'; -export type ServiceFactoryMap = Record> = { - [Property in keyof T]: (components: Components) => T[Property]; -}; -/** - * For Libp2p configurations and modules details read the [Configuration Document](./CONFIGURATION.md). - */ -export interface Libp2pInit; -}> { - /** - * peerId instance (it will be created if not provided) - */ - peerId: PeerId; - /** - * Metadata about the node - implementation name, version number, etc - */ - nodeInfo: NodeInfo; - /** - * Addresses for transport listening and to advertise to the network - */ - addresses: AddressManagerInit; - /** - * libp2p Connection Manager configuration - */ - connectionManager: ConnectionManagerInit; - /** - * A connection gater can deny new connections based on user criteria - */ - connectionGater: ConnectionGater; - /** - * libp2p transport manager configuration - */ - transportManager: TransportManagerInit; - /** - * An optional datastore to persist peer information, DHT records, etc. - * - * An in-memory datastore will be used if one is not provided. - */ - datastore: Datastore; - /** - * libp2p PeerStore configuration - */ - peerStore: PersistentPeerStoreInit; - /** - * An array that must include at least 1 compliant transport - */ - transports: Array<(components: Components) => Transport>; - streamMuxers?: Array<(components: Components) => StreamMuxerFactory>; - connectionEncryption?: Array<(components: Components) => ConnectionEncrypter>; - peerDiscovery?: Array<(components: Components) => PeerDiscovery>; - peerRouters?: Array<(components: Components) => PeerRouting>; - contentRouters?: Array<(components: Components) => ContentRouting>; - /** - * A Metrics implementation can be supplied to collect metrics on this node - */ - metrics?(components: Components): Metrics; - /** - * A ConnectionProtector can be used to create a secure overlay on top of the network using pre-shared keys - */ - connectionProtector?(components: Components): ConnectionProtector; - /** - * Arbitrary libp2p modules - */ - services: ServiceFactoryMap; - /** - * An optional logging implementation that can be used to write runtime logs. - * - * Set the `DEBUG` env var or the `debug` key on LocalStorage to see logs. - * - * @example - * - * Node.js: - * - * ```console - * $ DEBUG="*libp2p:*" node myscript.js - * ``` - * - * Browsers: - * - * ```javascript - * localStorage.setItem('debug', '*libp2p:*') - * ``` - */ - logger?: ComponentLogger; -} -export type { Libp2p }; -export type Libp2pOptions> = RecursivePartial> & { - start?: boolean; -}; -/** - * Returns a new instance of the Libp2p interface, generating a new PeerId - * if one is not passed as part of the options. - * - * The node will be started unless `start: false` is passed as an option. - * - * @example - * - * ```js - * import { createLibp2p } from 'libp2p' - * import { tcp } from '@libp2p/tcp' - * import { mplex } from '@libp2p/mplex' - * import { noise } from '@chainsafe/libp2p-noise' - * import { yamux } from '@chainsafe/libp2p-yamux' - * - * // specify options - * const options = { - * transports: [tcp()], - * streamMuxers: [yamux(), mplex()], - * connectionEncryption: [noise()] - * } - * - * // create libp2p - * const libp2p = await createLibp2p(options) - * ``` - */ -export declare function createLibp2p; -}>(options: Libp2pOptions): Promise>; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/index.d.ts.map deleted file mode 100644 index fabc757a4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU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CAAC,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAEjI;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,YAAY,CAAE,CAAC,SAAS,UAAU,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,EAAG,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAQzI"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/index.js deleted file mode 100644 index afbc58dae..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/index.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @packageDocumentation - * - * Use the `createLibp2p` function to create a libp2p node. - * - * @example - * - * ```typescript - * import { createLibp2p } from 'libp2p' - * - * const node = await createLibp2p({ - * // ...other options - * }) - * ``` - */ -import { createLibp2pNode } from './libp2p.js'; -/** - * Returns a new instance of the Libp2p interface, generating a new PeerId - * if one is not passed as part of the options. - * - * The node will be started unless `start: false` is passed as an option. - * - * @example - * - * ```js - * import { createLibp2p } from 'libp2p' - * import { tcp } from '@libp2p/tcp' - * import { mplex } from '@libp2p/mplex' - * import { noise } from '@chainsafe/libp2p-noise' - * import { yamux } from '@chainsafe/libp2p-yamux' - * - * // specify options - * const options = { - * transports: [tcp()], - * streamMuxers: [yamux(), mplex()], - * connectionEncryption: [noise()] - * } - * - * // create libp2p - * const libp2p = await createLibp2p(options) - * ``` - */ -export async function createLibp2p(options) { - const node = await createLibp2pNode(options); - if (options.start !== false) { - await node.start(); - } - return node; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/index.js.map deleted file mode 100644 index 8ee9c1281..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAwH9C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAA0D,OAAyB;IACnH,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAE5C,IAAI,OAAO,CAAC,KAAK,KAAK,KAAK,EAAE;QAC3B,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;KACnB;IAED,OAAO,IAAI,CAAA;AACb,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/libp2p.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/libp2p.d.ts deleted file mode 100644 index cb492deed..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/libp2p.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { type ContentRouting } from '@libp2p/interface/content-routing'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { type PeerRouting } from '@libp2p/interface/peer-routing'; -import { type Multiaddr } from '@multiformats/multiaddr'; -import type { Components } from './components.js'; -import type { Libp2p, Libp2pInit, Libp2pOptions } from './index.js'; -import type { Libp2pEvents, PendingDial, ServiceMap, AbortOptions, ComponentLogger } from '@libp2p/interface'; -import type { Connection, NewStreamOptions, Stream } from '@libp2p/interface/connection'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Topology } from '@libp2p/interface/topology'; -import type { StreamHandler, StreamHandlerOptions } from '@libp2p/interface-internal/registrar'; -export declare class Libp2pNode> extends TypedEventEmitter implements Libp2p { - #private; - peerId: PeerId; - peerStore: PeerStore; - contentRouting: ContentRouting; - peerRouting: PeerRouting; - metrics?: Metrics; - services: T; - logger: ComponentLogger; - components: Components; - private readonly log; - constructor(init: Libp2pInit); - private configureComponent; - /** - * Starts the libp2p node and all its subsystems - */ - start(): Promise; - /** - * Stop the libp2p node by closing its listeners and open connections - */ - stop(): Promise; - isStarted(): boolean; - getConnections(peerId?: PeerId): Connection[]; - getDialQueue(): PendingDial[]; - getPeers(): PeerId[]; - dial(peer: PeerId | Multiaddr | Multiaddr[], options?: AbortOptions): Promise; - dialProtocol(peer: PeerId | Multiaddr | Multiaddr[], protocols: string | string[], options?: NewStreamOptions): Promise; - getMultiaddrs(): Multiaddr[]; - getProtocols(): string[]; - hangUp(peer: PeerId | Multiaddr, options?: AbortOptions): Promise; - /** - * Get the public key for the given peer id - */ - getPublicKey(peer: PeerId, options?: AbortOptions): Promise; - handle(protocols: string | string[], handler: StreamHandler, options?: StreamHandlerOptions): Promise; - unhandle(protocols: string[] | string): Promise; - register(protocol: string, topology: Topology): Promise; - unregister(id: string): void; -} -/** - * Returns a new Libp2pNode instance - this exposes more of the internals than the - * libp2p interface and is useful for testing and debugging. - */ -export declare function createLibp2pNode>(options: Libp2pOptions): Promise>; -//# sourceMappingURL=libp2p.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/libp2p.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/libp2p.d.ts.map deleted file mode 100644 index c2c806b62..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/libp2p.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3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GAAG,OAAO,CAAC,IAAI,CAAC;IAYtD,QAAQ,CAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAItE,UAAU,CAAE,EAAE,EAAE,MAAM,GAAG,IAAI;CAqB9B;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAE,CAAC,SAAS,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAG,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAI1I"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/libp2p.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/libp2p.js deleted file mode 100644 index 7f1e9bcf8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/libp2p.js +++ /dev/null @@ -1,310 +0,0 @@ -import { unmarshalPublicKey } from '@libp2p/crypto/keys'; -import { contentRouting } from '@libp2p/interface/content-routing'; -import { CodeError } from '@libp2p/interface/errors'; -import { TypedEventEmitter, CustomEvent, setMaxListeners } from '@libp2p/interface/events'; -import { peerDiscovery } from '@libp2p/interface/peer-discovery'; -import { peerRouting } from '@libp2p/interface/peer-routing'; -import { defaultLogger } from '@libp2p/logger'; -import { PeerSet } from '@libp2p/peer-collections'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { isMultiaddr } from '@multiformats/multiaddr'; -import { MemoryDatastore } from 'datastore-core/memory'; -import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { DefaultAddressManager } from './address-manager/index.js'; -import { defaultComponents } from './components.js'; -import { connectionGater } from './config/connection-gater.js'; -import { validateConfig } from './config.js'; -import { DefaultConnectionManager } from './connection-manager/index.js'; -import { CompoundContentRouting } from './content-routing/index.js'; -import { codes } from './errors.js'; -import { DefaultPeerRouting } from './peer-routing.js'; -import { DefaultRegistrar } from './registrar.js'; -import { DefaultTransportManager } from './transport-manager.js'; -import { DefaultUpgrader } from './upgrader.js'; -import * as pkg from './version.js'; -export class Libp2pNode extends TypedEventEmitter { - peerId; - peerStore; - contentRouting; - peerRouting; - metrics; - services; - logger; - components; - #started; - log; - constructor(init) { - super(); - // event bus - components can listen to this emitter to be notified of system events - // and also cause them to be emitted - const events = new TypedEventEmitter(); - const originalDispatch = events.dispatchEvent.bind(events); - events.dispatchEvent = (evt) => { - const internalResult = originalDispatch(evt); - const externalResult = this.dispatchEvent(new CustomEvent(evt.type, { detail: evt.detail })); - return internalResult || externalResult; - }; - // This emitter gets listened to a lot - setMaxListeners(Infinity, events); - this.#started = false; - this.peerId = init.peerId; - this.logger = init.logger ?? defaultLogger(); - this.log = this.logger.forComponent('libp2p'); - // @ts-expect-error {} may not be of type T - this.services = {}; - const components = this.components = defaultComponents({ - peerId: init.peerId, - nodeInfo: init.nodeInfo ?? { - name: pkg.name, - version: pkg.version - }, - logger: this.logger, - events, - datastore: init.datastore ?? new MemoryDatastore(), - connectionGater: connectionGater(init.connectionGater) - }); - this.peerStore = this.configureComponent('peerStore', new PersistentPeerStore(components, { - addressFilter: this.components.connectionGater.filterMultiaddrForPeer, - ...init.peerStore - })); - // Create Metrics - if (init.metrics != null) { - this.metrics = this.configureComponent('metrics', init.metrics(this.components)); - } - components.events.addEventListener('peer:update', evt => { - // if there was no peer previously in the peer store this is a new peer - if (evt.detail.previous == null) { - const peerInfo = { - id: evt.detail.peer.id, - multiaddrs: evt.detail.peer.addresses.map(a => a.multiaddr) - }; - components.events.safeDispatchEvent('peer:discovery', { detail: peerInfo }); - } - }); - // Set up connection protector if configured - if (init.connectionProtector != null) { - this.configureComponent('connectionProtector', init.connectionProtector(components)); - } - // Set up the Upgrader - this.components.upgrader = new DefaultUpgrader(this.components, { - connectionEncryption: (init.connectionEncryption ?? []).map((fn, index) => this.configureComponent(`connection-encryption-${index}`, fn(this.components))), - muxers: (init.streamMuxers ?? []).map((fn, index) => this.configureComponent(`stream-muxers-${index}`, fn(this.components))), - inboundUpgradeTimeout: init.connectionManager.inboundUpgradeTimeout - }); - // Setup the transport manager - this.configureComponent('transportManager', new DefaultTransportManager(this.components, init.transportManager)); - // Create the Connection Manager - this.configureComponent('connectionManager', new DefaultConnectionManager(this.components, init.connectionManager)); - // Create the Registrar - this.configureComponent('registrar', new DefaultRegistrar(this.components)); - // Addresses {listen, announce, noAnnounce} - this.configureComponent('addressManager', new DefaultAddressManager(this.components, init.addresses)); - // Peer routers - const peerRouters = (init.peerRouters ?? []).map((fn, index) => this.configureComponent(`peer-router-${index}`, fn(this.components))); - this.peerRouting = this.components.peerRouting = this.configureComponent('peerRouting', new DefaultPeerRouting(this.components, { - routers: peerRouters - })); - // Content routers - const contentRouters = (init.contentRouters ?? []).map((fn, index) => this.configureComponent(`content-router-${index}`, fn(this.components))); - this.contentRouting = this.components.contentRouting = this.configureComponent('contentRouting', new CompoundContentRouting(this.components, { - routers: contentRouters - })); - (init.peerDiscovery ?? []).forEach((fn, index) => { - const service = this.configureComponent(`peer-discovery-${index}`, fn(this.components)); - service.addEventListener('peer', (evt) => { - this.#onDiscoveryPeer(evt); - }); - }); - // Transport modules - init.transports.forEach((fn, index) => { - this.components.transportManager.add(this.configureComponent(`transport-${index}`, fn(this.components))); - }); - // User defined modules - if (init.services != null) { - for (const name of Object.keys(init.services)) { - const createService = init.services[name]; - const service = createService(this.components); - if (service == null) { - this.log.error('service factory %s returned null or undefined instance', name); - continue; - } - this.services[name] = service; - this.configureComponent(name, service); - if (service[contentRouting] != null) { - this.log('registering service %s for content routing', name); - contentRouters.push(service[contentRouting]); - } - if (service[peerRouting] != null) { - this.log('registering service %s for peer routing', name); - peerRouters.push(service[peerRouting]); - } - if (service[peerDiscovery] != null) { - this.log('registering service %s for peer discovery', name); - service[peerDiscovery].addEventListener('peer', (evt) => { - this.#onDiscoveryPeer(evt); - }); - } - } - } - } - configureComponent(name, component) { - if (component == null) { - this.log.error('component %s was null or undefined', name); - } - this.components[name] = component; - return component; - } - /** - * Starts the libp2p node and all its subsystems - */ - async start() { - if (this.#started) { - return; - } - this.#started = true; - this.log('libp2p is starting'); - try { - await this.components.beforeStart?.(); - await this.components.start(); - await this.components.afterStart?.(); - this.safeDispatchEvent('start', { detail: this }); - this.log('libp2p has started'); - } - catch (err) { - this.log.error('An error occurred starting libp2p', err); - await this.stop(); - throw err; - } - } - /** - * Stop the libp2p node by closing its listeners and open connections - */ - async stop() { - if (!this.#started) { - return; - } - this.log('libp2p is stopping'); - this.#started = false; - await this.components.beforeStop?.(); - await this.components.stop(); - await this.components.afterStop?.(); - this.safeDispatchEvent('stop', { detail: this }); - this.log('libp2p has stopped'); - } - isStarted() { - return this.#started; - } - getConnections(peerId) { - return this.components.connectionManager.getConnections(peerId); - } - getDialQueue() { - return this.components.connectionManager.getDialQueue(); - } - getPeers() { - const peerSet = new PeerSet(); - for (const conn of this.components.connectionManager.getConnections()) { - peerSet.add(conn.remotePeer); - } - return Array.from(peerSet); - } - async dial(peer, options = {}) { - return this.components.connectionManager.openConnection(peer, options); - } - async dialProtocol(peer, protocols, options = {}) { - if (protocols == null) { - throw new CodeError('no protocols were provided to open a stream', codes.ERR_INVALID_PROTOCOLS_FOR_STREAM); - } - protocols = Array.isArray(protocols) ? protocols : [protocols]; - if (protocols.length === 0) { - throw new CodeError('no protocols were provided to open a stream', codes.ERR_INVALID_PROTOCOLS_FOR_STREAM); - } - const connection = await this.dial(peer, options); - return connection.newStream(protocols, options); - } - getMultiaddrs() { - return this.components.addressManager.getAddresses(); - } - getProtocols() { - return this.components.registrar.getProtocols(); - } - async hangUp(peer, options = {}) { - if (isMultiaddr(peer)) { - peer = peerIdFromString(peer.getPeerId() ?? ''); - } - await this.components.connectionManager.closeConnections(peer, options); - } - /** - * Get the public key for the given peer id - */ - async getPublicKey(peer, options = {}) { - this.log('getPublicKey %p', peer); - if (peer.publicKey != null) { - return peer.publicKey; - } - const peerInfo = await this.peerStore.get(peer); - if (peerInfo.id.publicKey != null) { - return peerInfo.id.publicKey; - } - const peerKey = uint8ArrayConcat([ - uint8ArrayFromString('/pk/'), - peer.multihash.digest - ]); - // search any available content routing methods - const bytes = await this.contentRouting.get(peerKey, options); - // ensure the returned key is valid - unmarshalPublicKey(bytes); - await this.peerStore.patch(peer, { - publicKey: bytes - }); - return bytes; - } - async handle(protocols, handler, options) { - if (!Array.isArray(protocols)) { - protocols = [protocols]; - } - await Promise.all(protocols.map(async (protocol) => { - await this.components.registrar.handle(protocol, handler, options); - })); - } - async unhandle(protocols) { - if (!Array.isArray(protocols)) { - protocols = [protocols]; - } - await Promise.all(protocols.map(async (protocol) => { - await this.components.registrar.unhandle(protocol); - })); - } - async register(protocol, topology) { - return this.components.registrar.register(protocol, topology); - } - unregister(id) { - this.components.registrar.unregister(id); - } - /** - * Called whenever peer discovery services emit `peer` events and adds peers - * to the peer store. - */ - #onDiscoveryPeer(evt) { - const { detail: peer } = evt; - if (peer.id.toString() === this.peerId.toString()) { - this.log.error(new Error(codes.ERR_DISCOVERED_SELF)); - return; - } - void this.components.peerStore.merge(peer.id, { - multiaddrs: peer.multiaddrs - }) - .catch(err => { this.log.error(err); }); - } -} -/** - * Returns a new Libp2pNode instance - this exposes more of the internals than the - * libp2p interface and is useful for testing and debugging. - */ -export async function createLibp2pNode(options) { - options.peerId ??= await createEd25519PeerId(); - return new Libp2pNode(validateConfig(options)); -} -//# sourceMappingURL=libp2p.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/libp2p.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/libp2p.js.map deleted file mode 100644 index 2e6bdd3cc..000000000 --- a/perf/impl/js-libp2p/v1.0-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AC,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAA;YACpD,OAAM;SACP;QAED,KAAK,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE;YAC5C,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;aACC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA,CAAC,CAAC,CAAC,CAAA;IAC1C,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAmD,OAAyB;IAChH,OAAO,CAAC,MAAM,KAAK,MAAM,mBAAmB,EAAE,CAAA;IAE9C,OAAO,IAAI,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;AAChD,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/peer-routing.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/peer-routing.d.ts deleted file mode 100644 index c24dc1bb8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/peer-routing.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { AbortOptions } from '@libp2p/interface'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerInfo } from '@libp2p/interface/peer-info'; -import type { PeerRouting } from '@libp2p/interface/peer-routing'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { ComponentLogger } from '@libp2p/logger'; -export interface PeerRoutingInit { - routers?: PeerRouting[]; -} -export interface DefaultPeerRoutingComponents { - peerId: PeerId; - peerStore: PeerStore; - logger: ComponentLogger; -} -export declare class DefaultPeerRouting implements PeerRouting { - private readonly log; - private readonly peerId; - private readonly peerStore; - private readonly routers; - constructor(components: DefaultPeerRoutingComponents, init: PeerRoutingInit); - /** - * Iterates over all peer routers in parallel to find the given peer - */ - findPeer(id: PeerId, options?: AbortOptions): Promise; - /** - * Attempt to find the closest peers on the network to the given key - */ - getClosestPeers(key: Uint8Array, options?: AbortOptions): AsyncIterable; -} -//# sourceMappingURL=peer-routing.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/peer-routing.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/peer-routing.d.ts.map deleted file mode 100644 index 4f11ac2b3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/peer-routing.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-routing.d.ts","sourceRoot":"","sources":["../../src/peer-routing.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAU,MAAM,mBAAmB,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,WAAW,EAAE,CAAA;CACxB;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,eAAe,CAAA;CACxB;AAED,qBAAa,kBAAmB,YAAW,WAAW;IACpD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;gBAE1B,UAAU,EAAE,4BAA4B,EAAE,IAAI,EAAE,eAAe;IAO5E;;OAEG;IACG,QAAQ,CAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC;IAiCtE;;OAEG;IACK,eAAe,CAAE,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC;CAc3F"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/peer-routing.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/peer-routing.js deleted file mode 100644 index 658dc5529..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/peer-routing.js +++ /dev/null @@ -1,53 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import filter from 'it-filter'; -import first from 'it-first'; -import merge from 'it-merge'; -import { pipe } from 'it-pipe'; -import { storeAddresses, uniquePeers, requirePeers } from './content-routing/utils.js'; -import { codes, messages } from './errors.js'; -export class DefaultPeerRouting { - log; - peerId; - peerStore; - routers; - constructor(components, init) { - this.log = components.logger.forComponent('libp2p:peer-routing'); - this.peerId = components.peerId; - this.peerStore = components.peerStore; - this.routers = init.routers ?? []; - } - /** - * Iterates over all peer routers in parallel to find the given peer - */ - async findPeer(id, options) { - if (this.routers.length === 0) { - throw new CodeError('No peer routers available', codes.ERR_NO_ROUTERS_AVAILABLE); - } - if (id.toString() === this.peerId.toString()) { - throw new CodeError('Should not try to find self', codes.ERR_FIND_SELF); - } - const self = this; - const output = await pipe(merge(...this.routers.map(router => (async function* () { - try { - yield await router.findPeer(id, options); - } - catch (err) { - self.log.error(err); - } - })())), (source) => filter(source, Boolean), (source) => storeAddresses(source, this.peerStore), async (source) => first(source)); - if (output != null) { - return output; - } - throw new CodeError(messages.NOT_FOUND, codes.ERR_NOT_FOUND); - } - /** - * Attempt to find the closest peers on the network to the given key - */ - async *getClosestPeers(key, options) { - if (this.routers.length === 0) { - throw new CodeError('No peer routers available', codes.ERR_NO_ROUTERS_AVAILABLE); - } - yield* pipe(merge(...this.routers.map(router => router.getClosestPeers(key, options))), (source) => storeAddresses(source, this.peerStore), (source) => uniquePeers(source), (source) => requirePeers(source)); - } -} -//# sourceMappingURL=peer-routing.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/peer-routing.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/peer-routing.js.map deleted file mode 100644 index 8e8e8ba14..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/peer-routing.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-routing.js","sourceRoot":"","sources":["../../src/peer-routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EACL,cAAc,EACd,WAAW,EACX,YAAY,EACb,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAkB7C,MAAM,OAAO,kBAAkB;IACZ,GAAG,CAAQ;IACX,MAAM,CAAQ;IACd,SAAS,CAAW;IACpB,OAAO,CAAe;IAEvC,YAAa,UAAwC,EAAE,IAAqB;QAC1E,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAA;QAChE,IAAI,CAAC,MAAM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QAED,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;IAC9D,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,CAAE,eAAe,CAAE,GAAe,EAAE,OAAsB;QAC9D,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;YAC7B,MAAM,IAAI,SAAS,CAAC,2BAA2B,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAA;SACjF;QAED,KAAM,CAAC,CAAC,IAAI,CACV,KAAK,CACH,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CACpE,EACD,CAAC,MAAM,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EAClD,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,EAC/B,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CACjC,CAAA;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/registrar.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/registrar.d.ts deleted file mode 100644 index 82e0d7d91..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/registrar.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { IdentifyResult, Libp2pEvents, PeerUpdate } from '@libp2p/interface'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { Topology } from '@libp2p/interface/topology'; -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'; -import type { StreamHandlerOptions, StreamHandlerRecord, Registrar, StreamHandler } from '@libp2p/interface-internal/registrar'; -import type { ComponentLogger } from '@libp2p/logger'; -export declare const DEFAULT_MAX_INBOUND_STREAMS = 32; -export declare const DEFAULT_MAX_OUTBOUND_STREAMS = 64; -export interface RegistrarComponents { - peerId: PeerId; - connectionManager: ConnectionManager; - peerStore: PeerStore; - events: TypedEventTarget; - logger: ComponentLogger; -} -/** - * Responsible for notifying registered protocols of events in the network. - */ -export declare class DefaultRegistrar implements Registrar { - private readonly log; - private readonly topologies; - private readonly handlers; - private readonly components; - constructor(components: RegistrarComponents); - getProtocols(): string[]; - getHandler(protocol: string): StreamHandlerRecord; - getTopologies(protocol: string): Topology[]; - /** - * Registers the `handler` for each protocol - */ - handle(protocol: string, handler: StreamHandler, opts?: StreamHandlerOptions): Promise; - /** - * Removes the handler for each protocol. The protocol - * will no longer be supported on streams. - */ - unhandle(protocols: string | string[]): Promise; - /** - * Register handlers for a set of multicodecs given - */ - register(protocol: string, topology: Topology): Promise; - /** - * Unregister topology - */ - unregister(id: string): void; - /** - * Remove a disconnected peer from the record - */ - _onDisconnect(evt: CustomEvent): void; - /** - * When a peer is updated, if they have removed supported protocols notify any - * topologies interested in the removed protocols. - */ - _onPeerUpdate(evt: CustomEvent): void; - /** - * After identify has completed and we have received the list of supported - * protocols, notify any topologies interested in those protocols. - */ - _onPeerIdentify(evt: CustomEvent): void; -} -//# sourceMappingURL=registrar.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/registrar.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/registrar.d.ts.map deleted file mode 100644 index 3b9a68032..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/registrar.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registrar.d.ts","sourceRoot":"","sources":["../../src/registrar.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,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MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBnG;;;OAGG;IACG,QAAQ,CAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAa5D;;OAEG;IACG,QAAQ,CAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAoBtE;;OAEG;IACH,UAAU,CAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAY7B;;OAEG;IACH,aAAa,CAAE,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI;IA4B9C;;;OAGG;IACH,aAAa,CAAE,GAAG,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,IAAI;IAkBlD;;;OAGG;IACH,eAAe,CAAE,GAAG,EAAE,WAAW,CAAC,cAAc,CAAC,GAAG,IAAI;CAsBzD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/registrar.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/registrar.js deleted file mode 100644 index 3b63bfb9c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/registrar.js +++ /dev/null @@ -1,178 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import merge from 'merge-options'; -import { codes } from './errors.js'; -export const DEFAULT_MAX_INBOUND_STREAMS = 32; -export const DEFAULT_MAX_OUTBOUND_STREAMS = 64; -/** - * Responsible for notifying registered protocols of events in the network. - */ -export class DefaultRegistrar { - log; - topologies; - handlers; - components; - constructor(components) { - this.log = components.logger.forComponent('libp2p:registrar'); - this.topologies = new Map(); - this.handlers = new Map(); - this.components = components; - this._onDisconnect = this._onDisconnect.bind(this); - this._onPeerUpdate = this._onPeerUpdate.bind(this); - this._onPeerIdentify = this._onPeerIdentify.bind(this); - this.components.events.addEventListener('peer:disconnect', this._onDisconnect); - this.components.events.addEventListener('peer:update', this._onPeerUpdate); - this.components.events.addEventListener('peer:identify', this._onPeerIdentify); - } - getProtocols() { - return Array.from(new Set([ - ...this.handlers.keys() - ])).sort(); - } - getHandler(protocol) { - const handler = this.handlers.get(protocol); - if (handler == null) { - throw new CodeError(`No handler registered for protocol ${protocol}`, codes.ERR_NO_HANDLER_FOR_PROTOCOL); - } - return handler; - } - getTopologies(protocol) { - const topologies = this.topologies.get(protocol); - if (topologies == null) { - return []; - } - return [ - ...topologies.values() - ]; - } - /** - * Registers the `handler` for each protocol - */ - async handle(protocol, handler, opts) { - if (this.handlers.has(protocol)) { - throw new CodeError(`Handler already registered for protocol ${protocol}`, codes.ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED); - } - const options = merge.bind({ ignoreUndefined: true })({ - maxInboundStreams: DEFAULT_MAX_INBOUND_STREAMS, - maxOutboundStreams: DEFAULT_MAX_OUTBOUND_STREAMS - }, opts); - this.handlers.set(protocol, { - handler, - options - }); - // Add new protocol to self protocols in the peer store - await this.components.peerStore.merge(this.components.peerId, { - protocols: [protocol] - }); - } - /** - * Removes the handler for each protocol. The protocol - * will no longer be supported on streams. - */ - async unhandle(protocols) { - const protocolList = Array.isArray(protocols) ? protocols : [protocols]; - protocolList.forEach(protocol => { - this.handlers.delete(protocol); - }); - // Update self protocols in the peer store - await this.components.peerStore.patch(this.components.peerId, { - protocols: this.getProtocols() - }); - } - /** - * Register handlers for a set of multicodecs given - */ - async register(protocol, topology) { - if (topology == null) { - throw new CodeError('invalid topology', codes.ERR_INVALID_PARAMETERS); - } - // Create topology - const id = `${(Math.random() * 1e9).toString(36)}${Date.now()}`; - let topologies = this.topologies.get(protocol); - if (topologies == null) { - topologies = new Map(); - this.topologies.set(protocol, topologies); - } - topologies.set(id, topology); - return id; - } - /** - * Unregister topology - */ - unregister(id) { - for (const [protocol, topologies] of this.topologies.entries()) { - if (topologies.has(id)) { - topologies.delete(id); - if (topologies.size === 0) { - this.topologies.delete(protocol); - } - } - } - } - /** - * Remove a disconnected peer from the record - */ - _onDisconnect(evt) { - const remotePeer = evt.detail; - void this.components.peerStore.get(remotePeer) - .then(peer => { - for (const protocol of peer.protocols) { - const topologies = this.topologies.get(protocol); - if (topologies == null) { - // no topologies are interested in this protocol - continue; - } - for (const topology of topologies.values()) { - topology.onDisconnect?.(remotePeer); - } - } - }) - .catch(err => { - if (err.code === codes.ERR_NOT_FOUND) { - // peer has not completed identify so they are not in the peer store - return; - } - this.log.error('could not inform topologies of disconnecting peer %p', remotePeer, err); - }); - } - /** - * When a peer is updated, if they have removed supported protocols notify any - * topologies interested in the removed protocols. - */ - _onPeerUpdate(evt) { - const { peer, previous } = evt.detail; - const removed = (previous?.protocols ?? []).filter(protocol => !peer.protocols.includes(protocol)); - for (const protocol of removed) { - const topologies = this.topologies.get(protocol); - if (topologies == null) { - // no topologies are interested in this protocol - continue; - } - for (const topology of topologies.values()) { - topology.onDisconnect?.(peer.id); - } - } - } - /** - * After identify has completed and we have received the list of supported - * protocols, notify any topologies interested in those protocols. - */ - _onPeerIdentify(evt) { - const protocols = evt.detail.protocols; - const connection = evt.detail.connection; - const peerId = evt.detail.peerId; - for (const protocol of protocols) { - const topologies = this.topologies.get(protocol); - if (topologies == null) { - // no topologies are interested in this protocol - continue; - } - for (const topology of topologies.values()) { - if (connection.transient && topology.notifyOnTransient !== true) { - continue; - } - topology.onConnect?.(peerId, connection); - } - } - } -} -//# sourceMappingURL=registrar.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/registrar.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/registrar.js.map deleted file mode 100644 index 77af8c611..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/registrar.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registrar.js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AE;oBAC/D,SAAQ;iBACT;gBAED,QAAQ,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;aACzC;SACF;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/transport-manager.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/transport-manager.d.ts deleted file mode 100644 index 3cd9dc77c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/transport-manager.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { FaultTolerance } from '@libp2p/interface/transport'; -import type { Libp2pEvents, AbortOptions, ComponentLogger } from '@libp2p/interface'; -import type { Connection } from '@libp2p/interface/connection'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { Startable } from '@libp2p/interface/startable'; -import type { Listener, Transport, Upgrader } from '@libp2p/interface/transport'; -import type { AddressManager } from '@libp2p/interface-internal/address-manager'; -import type { TransportManager } from '@libp2p/interface-internal/transport-manager'; -import type { Multiaddr } from '@multiformats/multiaddr'; -export interface TransportManagerInit { - faultTolerance?: FaultTolerance; -} -export interface DefaultTransportManagerComponents { - metrics?: Metrics; - addressManager: AddressManager; - upgrader: Upgrader; - events: TypedEventTarget; - logger: ComponentLogger; -} -export declare class DefaultTransportManager implements TransportManager, Startable { - private readonly log; - private readonly components; - private readonly transports; - private readonly listeners; - private readonly faultTolerance; - private started; - constructor(components: DefaultTransportManagerComponents, init?: TransportManagerInit); - /** - * Adds a `Transport` to the manager - */ - add(transport: Transport): void; - isStarted(): boolean; - start(): void; - afterStart(): Promise; - /** - * Stops all listeners - */ - stop(): Promise; - /** - * Dials the given Multiaddr over it's supported transport - */ - dial(ma: Multiaddr, options?: AbortOptions): Promise; - /** - * Returns all Multiaddr's the listeners are using - */ - getAddrs(): Multiaddr[]; - /** - * Returns all the transports instances - */ - getTransports(): Transport[]; - /** - * Returns all the listener instances - */ - getListeners(): Listener[]; - /** - * Finds a transport that matches the given Multiaddr - */ - transportForMultiaddr(ma: Multiaddr): Transport | undefined; - /** - * Starts listeners for each listen Multiaddr - */ - listen(addrs: Multiaddr[]): Promise; - /** - * Removes the given transport from the manager. - * If a transport has any running listeners, they will be closed. - */ - remove(key: string): Promise; - /** - * Removes all transports from the manager. - * If any listeners are running, they will be closed. - * - * @async - */ - removeAll(): Promise; -} -//# sourceMappingURL=transport-manager.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/transport-manager.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/transport-manager.d.ts.map deleted file mode 100644 index 889428202..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/transport-manager.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.d.ts","sourceRoot":"","sources":["../../src/transport-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAE5D,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAU,MAAM,mBAAmB,CAAA;AAC5F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8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;IAU5D;;OAEG;IACG,MAAM,CAAE,KAAK,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAiFhD;;;OAGG;IACG,MAAM,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBzC;;;;;OAKG;IACG,SAAS,IAAK,OAAO,CAAC,IAAI,CAAC;CAQlC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/transport-manager.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/transport-manager.js deleted file mode 100644 index df34f9baa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/transport-manager.js +++ /dev/null @@ -1,233 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { trackedMap } from '@libp2p/interface/metrics/tracked-map'; -import { FaultTolerance } from '@libp2p/interface/transport'; -import { codes } from './errors.js'; -export class DefaultTransportManager { - log; - components; - transports; - listeners; - faultTolerance; - started; - constructor(components, init = {}) { - this.log = components.logger.forComponent('libp2p:transports'); - this.components = components; - this.started = false; - this.transports = new Map(); - this.listeners = trackedMap({ - name: 'libp2p_transport_manager_listeners', - metrics: this.components.metrics - }); - this.faultTolerance = init.faultTolerance ?? FaultTolerance.FATAL_ALL; - } - /** - * Adds a `Transport` to the manager - */ - add(transport) { - const tag = transport[Symbol.toStringTag]; - if (tag == null) { - throw new CodeError('Transport must have a valid tag', codes.ERR_INVALID_KEY); - } - if (this.transports.has(tag)) { - throw new CodeError(`There is already a transport with the tag ${tag}`, codes.ERR_DUPLICATE_TRANSPORT); - } - this.log('adding transport %s', tag); - this.transports.set(tag, transport); - if (!this.listeners.has(tag)) { - this.listeners.set(tag, []); - } - } - isStarted() { - return this.started; - } - start() { - this.started = true; - } - async afterStart() { - // Listen on the provided transports for the provided addresses - const addrs = this.components.addressManager.getListenAddrs(); - await this.listen(addrs); - } - /** - * Stops all listeners - */ - async stop() { - const tasks = []; - for (const [key, listeners] of this.listeners) { - this.log('closing listeners for %s', key); - while (listeners.length > 0) { - const listener = listeners.pop(); - if (listener == null) { - continue; - } - tasks.push(listener.close()); - } - } - await Promise.all(tasks); - this.log('all listeners closed'); - for (const key of this.listeners.keys()) { - this.listeners.set(key, []); - } - this.started = false; - } - /** - * Dials the given Multiaddr over it's supported transport - */ - async dial(ma, options) { - const transport = this.transportForMultiaddr(ma); - if (transport == null) { - throw new CodeError(`No transport available for address ${String(ma)}`, codes.ERR_TRANSPORT_UNAVAILABLE); - } - try { - return await transport.dial(ma, { - ...options, - upgrader: this.components.upgrader - }); - } - catch (err) { - if (err.code == null) { - err.code = codes.ERR_TRANSPORT_DIAL_FAILED; - } - throw err; - } - } - /** - * Returns all Multiaddr's the listeners are using - */ - getAddrs() { - let addrs = []; - for (const listeners of this.listeners.values()) { - for (const listener of listeners) { - addrs = [...addrs, ...listener.getAddrs()]; - } - } - return addrs; - } - /** - * Returns all the transports instances - */ - getTransports() { - return Array.of(...this.transports.values()); - } - /** - * Returns all the listener instances - */ - getListeners() { - return Array.of(...this.listeners.values()).flat(); - } - /** - * Finds a transport that matches the given Multiaddr - */ - transportForMultiaddr(ma) { - for (const transport of this.transports.values()) { - const addrs = transport.filter([ma]); - if (addrs.length > 0) { - return transport; - } - } - } - /** - * Starts listeners for each listen Multiaddr - */ - async listen(addrs) { - if (!this.isStarted()) { - throw new CodeError('Not started', codes.ERR_NODE_NOT_STARTED); - } - if (addrs == null || addrs.length === 0) { - this.log('no addresses were provided for listening, this node is dial only'); - return; - } - const couldNotListen = []; - for (const [key, transport] of this.transports.entries()) { - const supportedAddrs = transport.filter(addrs); - const tasks = []; - // For each supported multiaddr, create a listener - for (const addr of supportedAddrs) { - this.log('creating listener for %s on %a', key, addr); - const listener = transport.createListener({ - upgrader: this.components.upgrader - }); - let listeners = this.listeners.get(key) ?? []; - if (listeners == null) { - listeners = []; - this.listeners.set(key, listeners); - } - listeners.push(listener); - // Track listen/close events - listener.addEventListener('listening', () => { - this.components.events.safeDispatchEvent('transport:listening', { - detail: listener - }); - }); - listener.addEventListener('close', () => { - const index = listeners.findIndex(l => l === listener); - // remove the listener - listeners.splice(index, 1); - this.components.events.safeDispatchEvent('transport:close', { - detail: listener - }); - }); - // We need to attempt to listen on everything - tasks.push(listener.listen(addr)); - } - // Keep track of transports we had no addresses for - if (tasks.length === 0) { - couldNotListen.push(key); - continue; - } - const results = await Promise.allSettled(tasks); - // If we are listening on at least 1 address, succeed. - // TODO: we should look at adding a retry (`p-retry`) here to better support - // listening on remote addresses as they may be offline. We could then potentially - // just wait for any (`p-any`) listener to succeed on each transport before returning - const isListening = results.find(r => r.status === 'fulfilled'); - if ((isListening == null) && this.faultTolerance !== FaultTolerance.NO_FATAL) { - throw new CodeError(`Transport (${key}) could not listen on any available address`, codes.ERR_NO_VALID_ADDRESSES); - } - } - // If no transports were able to listen, throw an error. This likely - // means we were given addresses we do not have transports for - if (couldNotListen.length === this.transports.size) { - const message = `no valid addresses were provided for transports [${couldNotListen.join(', ')}]`; - if (this.faultTolerance === FaultTolerance.FATAL_ALL) { - throw new CodeError(message, codes.ERR_NO_VALID_ADDRESSES); - } - this.log(`libp2p in dial mode only: ${message}`); - } - } - /** - * Removes the given transport from the manager. - * If a transport has any running listeners, they will be closed. - */ - async remove(key) { - const listeners = this.listeners.get(key) ?? []; - this.log.trace('removing transport %s', key); - // Close any running listeners - const tasks = []; - this.log.trace('closing listeners for %s', key); - while (listeners.length > 0) { - const listener = listeners.pop(); - if (listener == null) { - continue; - } - tasks.push(listener.close()); - } - await Promise.all(tasks); - this.transports.delete(key); - this.listeners.delete(key); - } - /** - * Removes all transports from the manager. - * If any listeners are running, they will be closed. - * - * @async - */ - async removeAll() { - const tasks = []; - for (const key of this.transports.keys()) { - tasks.push(this.remove(key)); - } - await Promise.all(tasks); - } -} -//# sourceMappingURL=transport-manager.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/transport-manager.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/transport-manager.js.map deleted file mode 100644 index eda3a9904..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/transport-manager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.js","sourceRoot":"","sources":["../../src/transport-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAuBnC,MAAM,OAAO,uBAAuB;IACjB,GAAG,CAAQ;IACX,UAAU,CAAmC;IAC7C,UAAU,CAAwB;IAClC,SAAS,CAAyB;IAClC,cAAc,CAAgB;IACvC,OAAO,CAAS;IAExB,YAAa,UAA6C,EAAE,OAA6B,EAAE;QACzF,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAA;QAC9D,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACpB,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAqB,CAAA;QAC9C,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC;YAC1B,IAAI,EAAE,oCAAoC;YAC1C,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO;SACjC,CAAC,CAAA;QACF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,SAAS,CAAA;IACvE,CAAC;IAED;;OAEG;IACH,GAAG,CAAE,SAAoB;QACvB,MAAM,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;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KAAK,GAAG,EAAE,CAAA;QAChB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAA;QAC/C,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,EAAE,CAAA;YAEhC,IAAI,QAAQ,IAAI,IAAI,EAAE;gBACpB,SAAQ;aACT;YAED,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;SAC7B;QACD,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAExB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC3B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC5B,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS;QACb,MAAM,KAAK,GAAG,EAAE,CAAA;QAChB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE;YACxC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;SAC7B;QAED,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAC1B,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/upgrader.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/upgrader.d.ts deleted file mode 100644 index 5e75c1f1b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/upgrader.d.ts +++ /dev/null @@ -1,103 +0,0 @@ -import type { Libp2pEvents, ComponentLogger } from '@libp2p/interface'; -import type { MultiaddrConnection, Connection, Stream, ConnectionProtector } from '@libp2p/interface/connection'; -import type { ConnectionEncrypter, SecuredConnection } from '@libp2p/interface/connection-encrypter'; -import type { ConnectionGater } from '@libp2p/interface/connection-gater'; -import type { TypedEventTarget } from '@libp2p/interface/events'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { PeerStore } from '@libp2p/interface/peer-store'; -import type { StreamMuxerFactory } from '@libp2p/interface/stream-muxer'; -import type { Upgrader, UpgraderOptions } from '@libp2p/interface/transport'; -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'; -import type { Registrar } from '@libp2p/interface-internal/registrar'; -interface CreateConnectionOptions { - cryptoProtocol: string; - direction: 'inbound' | 'outbound'; - maConn: MultiaddrConnection; - upgradedConn: MultiaddrConnection; - remotePeer: PeerId; - muxerFactory?: StreamMuxerFactory; - transient?: boolean; -} -interface OnStreamOptions { - connection: Connection; - stream: Stream; - protocol: string; -} -export interface CryptoResult extends SecuredConnection { - protocol: string; -} -export interface UpgraderInit { - connectionEncryption: ConnectionEncrypter[]; - muxers: StreamMuxerFactory[]; - /** - * An amount of ms by which an inbound connection upgrade - * must complete - */ - inboundUpgradeTimeout?: number; -} -export interface DefaultUpgraderComponents { - peerId: PeerId; - metrics?: Metrics; - connectionManager: ConnectionManager; - connectionGater: ConnectionGater; - connectionProtector?: ConnectionProtector; - registrar: Registrar; - peerStore: PeerStore; - events: TypedEventTarget; - logger: ComponentLogger; -} -type ConnectionDeniedType = keyof Pick; -export declare class DefaultUpgrader implements Upgrader { - private readonly components; - private readonly connectionEncryption; - private readonly muxers; - private readonly inboundUpgradeTimeout; - private readonly events; - private readonly log; - constructor(components: DefaultUpgraderComponents, init: UpgraderInit); - shouldBlockConnection(remotePeer: PeerId, maConn: MultiaddrConnection, connectionType: ConnectionDeniedType): Promise; - /** - * Upgrades an inbound connection - */ - upgradeInbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise; - /** - * Upgrades an outbound connection - */ - upgradeOutbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise; - /** - * A convenience method for generating a new `Connection` - */ - _createConnection(opts: CreateConnectionOptions): Connection; - /** - * Routes incoming streams to the correct handler - */ - _onStream(opts: OnStreamOptions): void; - /** - * Attempts to encrypt the incoming `connection` with the provided `cryptos` - */ - _encryptInbound(connection: MultiaddrConnection): Promise; - /** - * Attempts to encrypt the given `connection` with the provided connection encrypters. - * The first `ConnectionEncrypter` module to succeed will be used - */ - _encryptOutbound(connection: MultiaddrConnection, remotePeerId?: PeerId): Promise; - /** - * Selects one of the given muxers via multistream-select. That - * muxer will be used for all future streams on the connection. - */ - _multiplexOutbound(connection: MultiaddrConnection, muxers: Map): Promise<{ - stream: MultiaddrConnection; - muxerFactory?: StreamMuxerFactory; - }>; - /** - * Registers support for one of the given muxers via multistream-select. The - * selected muxer will be used for all future streams on the connection. - */ - _multiplexInbound(connection: MultiaddrConnection, muxers: Map): Promise<{ - stream: MultiaddrConnection; - muxerFactory?: StreamMuxerFactory; - }>; -} -export {}; -//# sourceMappingURL=upgrader.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/upgrader.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/upgrader.d.ts.map deleted file mode 100644 index f6e57a5ce..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/upgrader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"upgrader.d.ts","sourceRoot":"","sources":["../../src/upgrader.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAgB,eAAe,EAAU,MAAM,mBAAmB,CAAA;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,EAAE,mBAAmB,EAAoB,MAAM,8BAA8B,CAAA;AAClI,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AACpG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM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;;OAEG;IACG,eAAe,CAAE,UAAU,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC;IAyB9E;;;OAGG;IACG,gBAAgB,CAAE,UAAU,EAAE,mBAAmB,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAgCtG;;;OAGG;IACG,kBAAkB,CAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,mBAAmB,CAAC;QAAC,YAAY,CAAC,EAAE,kBAAkB,CAAA;KAAE,CAAC;IAwBhL;;;OAGG;IACG,iBAAiB,CAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,mBAAmB,CAAC;QAAC,YAAY,CAAC,EAAE,kBAAkB,CAAA;KAAE,CAAC;CAehL"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/upgrader.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/upgrader.js deleted file mode 100644 index abbd57a49..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/upgrader.js +++ /dev/null @@ -1,567 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { setMaxListeners } from '@libp2p/interface/events'; -import * as mss from '@libp2p/multistream-select'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { createConnection } from './connection/index.js'; -import { INBOUND_UPGRADE_TIMEOUT } from './connection-manager/constants.js'; -import { codes } from './errors.js'; -import { DEFAULT_MAX_INBOUND_STREAMS, DEFAULT_MAX_OUTBOUND_STREAMS } from './registrar.js'; -const ERR_TIMEOUT = 'ERR_TIMEOUT'; -const DEFAULT_PROTOCOL_SELECT_TIMEOUT = 30000; -function findIncomingStreamLimit(protocol, registrar) { - try { - const { options } = registrar.getHandler(protocol); - return options.maxInboundStreams; - } - catch (err) { - if (err.code !== codes.ERR_NO_HANDLER_FOR_PROTOCOL) { - throw err; - } - } - return DEFAULT_MAX_INBOUND_STREAMS; -} -function findOutgoingStreamLimit(protocol, registrar, options = {}) { - try { - const { options } = registrar.getHandler(protocol); - if (options.maxOutboundStreams != null) { - return options.maxOutboundStreams; - } - } - catch (err) { - if (err.code !== codes.ERR_NO_HANDLER_FOR_PROTOCOL) { - throw err; - } - } - return options.maxOutboundStreams ?? DEFAULT_MAX_OUTBOUND_STREAMS; -} -function countStreams(protocol, direction, connection) { - let streamCount = 0; - connection.streams.forEach(stream => { - if (stream.direction === direction && stream.protocol === protocol) { - streamCount++; - } - }); - return streamCount; -} -export class DefaultUpgrader { - components; - connectionEncryption; - muxers; - inboundUpgradeTimeout; - events; - log; - constructor(components, init) { - this.components = components; - this.connectionEncryption = new Map(); - this.log = components.logger.forComponent('libp2p:upgrader'); - init.connectionEncryption.forEach(encrypter => { - this.connectionEncryption.set(encrypter.protocol, encrypter); - }); - this.muxers = new Map(); - init.muxers.forEach(muxer => { - this.muxers.set(muxer.protocol, muxer); - }); - this.inboundUpgradeTimeout = init.inboundUpgradeTimeout ?? INBOUND_UPGRADE_TIMEOUT; - this.events = components.events; - } - async shouldBlockConnection(remotePeer, maConn, connectionType) { - const connectionGater = this.components.connectionGater[connectionType]; - if (connectionGater !== undefined) { - if (await connectionGater(remotePeer, maConn)) { - throw new CodeError(`The multiaddr connection is blocked by gater.${connectionType}`, codes.ERR_CONNECTION_INTERCEPTED); - } - } - } - /** - * Upgrades an inbound connection - */ - async upgradeInbound(maConn, opts) { - const accept = await this.components.connectionManager.acceptIncomingConnection(maConn); - if (!accept) { - throw new CodeError('connection denied', codes.ERR_CONNECTION_DENIED); - } - let encryptedConn; - let remotePeer; - let upgradedConn; - let muxerFactory; - let cryptoProtocol; - const signal = AbortSignal.timeout(this.inboundUpgradeTimeout); - const onAbort = () => { - maConn.abort(new CodeError('inbound upgrade timeout', ERR_TIMEOUT)); - }; - signal.addEventListener('abort', onAbort, { once: true }); - setMaxListeners(Infinity, signal); - try { - if ((await this.components.connectionGater.denyInboundConnection?.(maConn)) === true) { - throw new CodeError('The multiaddr connection is blocked by gater.acceptConnection', codes.ERR_CONNECTION_INTERCEPTED); - } - this.components.metrics?.trackMultiaddrConnection(maConn); - this.log('starting the inbound connection upgrade'); - // Protect - let protectedConn = maConn; - if (opts?.skipProtection !== true) { - const protector = this.components.connectionProtector; - if (protector != null) { - this.log('protecting the inbound connection'); - protectedConn = await protector.protect(maConn); - } - } - try { - // Encrypt the connection - encryptedConn = protectedConn; - if (opts?.skipEncryption !== true) { - ({ - conn: encryptedConn, - remotePeer, - protocol: cryptoProtocol - } = await this._encryptInbound(protectedConn)); - const maConn = { - ...protectedConn, - ...encryptedConn - }; - await this.shouldBlockConnection(remotePeer, maConn, 'denyInboundEncryptedConnection'); - } - else { - const idStr = maConn.remoteAddr.getPeerId(); - if (idStr == null) { - throw new CodeError('inbound connection that skipped encryption must have a peer id', codes.ERR_INVALID_MULTIADDR); - } - const remotePeerId = peerIdFromString(idStr); - cryptoProtocol = 'native'; - remotePeer = remotePeerId; - } - upgradedConn = encryptedConn; - if (opts?.muxerFactory != null) { - muxerFactory = opts.muxerFactory; - } - else if (this.muxers.size > 0) { - // Multiplex the connection - const multiplexed = await this._multiplexInbound({ - ...protectedConn, - ...encryptedConn - }, this.muxers); - muxerFactory = multiplexed.muxerFactory; - upgradedConn = multiplexed.stream; - } - } - catch (err) { - this.log.error('Failed to upgrade inbound connection', err); - throw err; - } - await this.shouldBlockConnection(remotePeer, maConn, 'denyInboundUpgradedConnection'); - this.log('successfully upgraded inbound connection'); - return this._createConnection({ - cryptoProtocol, - direction: 'inbound', - maConn, - upgradedConn, - muxerFactory, - remotePeer, - transient: opts?.transient - }); - } - finally { - signal.removeEventListener('abort', onAbort); - this.components.connectionManager.afterUpgradeInbound(); - } - } - /** - * Upgrades an outbound connection - */ - async upgradeOutbound(maConn, opts) { - const idStr = maConn.remoteAddr.getPeerId(); - let remotePeerId; - if (idStr != null) { - remotePeerId = peerIdFromString(idStr); - await this.shouldBlockConnection(remotePeerId, maConn, 'denyOutboundConnection'); - } - let encryptedConn; - let remotePeer; - let upgradedConn; - let cryptoProtocol; - let muxerFactory; - this.components.metrics?.trackMultiaddrConnection(maConn); - this.log('Starting the outbound connection upgrade'); - // If the transport natively supports encryption, skip connection - // protector and encryption - // Protect - let protectedConn = maConn; - if (opts?.skipProtection !== true) { - const protector = this.components.connectionProtector; - if (protector != null) { - protectedConn = await protector.protect(maConn); - } - } - try { - // Encrypt the connection - encryptedConn = protectedConn; - if (opts?.skipEncryption !== true) { - ({ - conn: encryptedConn, - remotePeer, - protocol: cryptoProtocol - } = await this._encryptOutbound(protectedConn, remotePeerId)); - const maConn = { - ...protectedConn, - ...encryptedConn - }; - await this.shouldBlockConnection(remotePeer, maConn, 'denyOutboundEncryptedConnection'); - } - else { - if (remotePeerId == null) { - throw new CodeError('Encryption was skipped but no peer id was passed', codes.ERR_INVALID_PEER); - } - cryptoProtocol = 'native'; - remotePeer = remotePeerId; - } - upgradedConn = encryptedConn; - if (opts?.muxerFactory != null) { - muxerFactory = opts.muxerFactory; - } - else if (this.muxers.size > 0) { - // Multiplex the connection - const multiplexed = await this._multiplexOutbound({ - ...protectedConn, - ...encryptedConn - }, this.muxers); - muxerFactory = multiplexed.muxerFactory; - upgradedConn = multiplexed.stream; - } - } - catch (err) { - this.log.error('Failed to upgrade outbound connection', err); - await maConn.close(err); - throw err; - } - await this.shouldBlockConnection(remotePeer, maConn, 'denyOutboundUpgradedConnection'); - this.log('Successfully upgraded outbound connection'); - return this._createConnection({ - cryptoProtocol, - direction: 'outbound', - maConn, - upgradedConn, - muxerFactory, - remotePeer, - transient: opts?.transient - }); - } - /** - * A convenience method for generating a new `Connection` - */ - _createConnection(opts) { - const { cryptoProtocol, direction, maConn, upgradedConn, remotePeer, muxerFactory, transient } = opts; - let muxer; - let newStream; - let connection; // eslint-disable-line prefer-const - if (muxerFactory != null) { - // Create the muxer - muxer = muxerFactory.createStreamMuxer({ - direction, - // Run anytime a remote stream is created - onIncomingStream: muxedStream => { - if (connection == null) { - return; - } - void Promise.resolve() - .then(async () => { - const protocols = this.components.registrar.getProtocols(); - const { stream, protocol } = await mss.handle(muxedStream, protocols, { - log: muxedStream.log, - yieldBytes: false - }); - if (connection == null) { - return; - } - connection.log('incoming stream opened on %s', protocol); - const incomingLimit = findIncomingStreamLimit(protocol, this.components.registrar); - const streamCount = countStreams(protocol, 'inbound', connection); - if (streamCount === incomingLimit) { - const err = new CodeError(`Too many inbound protocol streams for protocol "${protocol}" - limit ${incomingLimit}`, codes.ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS); - muxedStream.abort(err); - throw err; - } - // after the handshake the returned stream can have early data so override - // the souce/sink - muxedStream.source = stream.source; - muxedStream.sink = stream.sink; - muxedStream.protocol = protocol; - // allow closing the write end of a not-yet-negotiated stream - if (stream.closeWrite != null) { - muxedStream.closeWrite = stream.closeWrite; - } - // allow closing the read end of a not-yet-negotiated stream - if (stream.closeRead != null) { - muxedStream.closeRead = stream.closeRead; - } - // make sure we don't try to negotiate a stream we are closing - if (stream.close != null) { - muxedStream.close = stream.close; - } - // If a protocol stream has been successfully negotiated and is to be passed to the application, - // the peerstore should ensure that the peer is registered with that protocol - await this.components.peerStore.merge(remotePeer, { - protocols: [protocol] - }); - this.components.metrics?.trackProtocolStream(muxedStream, connection); - this._onStream({ connection, stream: muxedStream, protocol }); - }) - .catch(async (err) => { - this.log.error('error handling incoming stream id %s', muxedStream.id, err.message, err.code, err.stack); - if (muxedStream.timeline.close == null) { - await muxedStream.close(); - } - }); - } - }); - newStream = async (protocols, options = {}) => { - if (muxer == null) { - throw new CodeError('Stream is not multiplexed', codes.ERR_MUXER_UNAVAILABLE); - } - connection.log('starting new stream for protocols %s', protocols); - const muxedStream = await muxer.newStream(); - connection.log.trace('started new stream %s for protocols %s', muxedStream.id, protocols); - try { - if (options.signal == null) { - this.log('No abort signal was passed while trying to negotiate protocols %s falling back to default timeout', protocols); - const signal = AbortSignal.timeout(DEFAULT_PROTOCOL_SELECT_TIMEOUT); - setMaxListeners(Infinity, signal); - options = { - ...options, - signal - }; - } - muxedStream.log.trace('selecting protocol from protocols %s', protocols); - const { stream, protocol } = await mss.select(muxedStream, protocols, { - ...options, - log: muxedStream.log, - yieldBytes: true - }); - muxedStream.log('selected protocol %s', protocol); - const outgoingLimit = findOutgoingStreamLimit(protocol, this.components.registrar, options); - const streamCount = countStreams(protocol, 'outbound', connection); - if (streamCount >= outgoingLimit) { - const err = new CodeError(`Too many outbound protocol streams for protocol "${protocol}" - limit ${outgoingLimit}`, codes.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS); - muxedStream.abort(err); - throw err; - } - // If a protocol stream has been successfully negotiated and is to be passed to the application, - // the peerstore should ensure that the peer is registered with that protocol - await this.components.peerStore.merge(remotePeer, { - protocols: [protocol] - }); - // after the handshake the returned stream can have early data so override - // the souce/sink - muxedStream.source = stream.source; - muxedStream.sink = stream.sink; - muxedStream.protocol = protocol; - // allow closing the write end of a not-yet-negotiated stream - if (stream.closeWrite != null) { - muxedStream.closeWrite = stream.closeWrite; - } - // allow closing the read end of a not-yet-negotiated stream - if (stream.closeRead != null) { - muxedStream.closeRead = stream.closeRead; - } - // make sure we don't try to negotiate a stream we are closing - if (stream.close != null) { - muxedStream.close = stream.close; - } - this.components.metrics?.trackProtocolStream(muxedStream, connection); - return muxedStream; - } - catch (err) { - connection.log.error('could not create new stream for protocols %s', protocols, err); - if (muxedStream.timeline.close == null) { - muxedStream.abort(err); - } - if (err.code != null) { - throw err; - } - throw new CodeError(String(err), codes.ERR_UNSUPPORTED_PROTOCOL); - } - }; - // Pipe all data through the muxer - void Promise.all([ - muxer.sink(upgradedConn.source), - upgradedConn.sink(muxer.source) - ]).catch(err => { - this.log.error(err); - }); - } - const _timeline = maConn.timeline; - maConn.timeline = new Proxy(_timeline, { - set: (...args) => { - if (connection != null && args[1] === 'close' && args[2] != null && _timeline.close == null) { - // Wait for close to finish before notifying of the closure - (async () => { - try { - if (connection.status === 'open') { - await connection.close(); - } - } - catch (err) { - this.log.error(err); - } - finally { - this.events.safeDispatchEvent('connection:close', { - detail: connection - }); - } - })().catch(err => { - this.log.error(err); - }); - } - return Reflect.set(...args); - } - }); - maConn.timeline.upgraded = Date.now(); - const errConnectionNotMultiplexed = () => { - throw new CodeError('connection is not multiplexed', codes.ERR_CONNECTION_NOT_MULTIPLEXED); - }; - // Create the connection - connection = createConnection({ - remoteAddr: maConn.remoteAddr, - remotePeer, - status: 'open', - direction, - timeline: maConn.timeline, - multiplexer: muxer?.protocol, - encryption: cryptoProtocol, - transient, - logger: this.components.logger, - newStream: newStream ?? errConnectionNotMultiplexed, - getStreams: () => { if (muxer != null) { - return muxer.streams; - } - else { - return []; - } }, - close: async (options) => { - // Ensure remaining streams are closed gracefully - if (muxer != null) { - this.log.trace('close muxer'); - await muxer.close(options); - } - this.log.trace('close maconn'); - // close the underlying transport - await maConn.close(options); - this.log.trace('closed maconn'); - }, - abort: (err) => { - maConn.abort(err); - // Ensure remaining streams are aborted - if (muxer != null) { - muxer.abort(err); - } - } - }); - this.events.safeDispatchEvent('connection:open', { - detail: connection - }); - return connection; - } - /** - * Routes incoming streams to the correct handler - */ - _onStream(opts) { - const { connection, stream, protocol } = opts; - const { handler, options } = this.components.registrar.getHandler(protocol); - if (connection.transient && options.runOnTransientConnection !== true) { - throw new CodeError('Cannot open protocol stream on transient connection', 'ERR_TRANSIENT_CONNECTION'); - } - handler({ connection, stream }); - } - /** - * Attempts to encrypt the incoming `connection` with the provided `cryptos` - */ - async _encryptInbound(connection) { - const protocols = Array.from(this.connectionEncryption.keys()); - this.log('handling inbound crypto protocol selection', protocols); - try { - const { stream, protocol } = await mss.handle(connection, protocols, { - log: connection.log - }); - const encrypter = this.connectionEncryption.get(protocol); - if (encrypter == null) { - throw new Error(`no crypto module found for ${protocol}`); - } - this.log('encrypting inbound connection using', protocol); - return { - ...await encrypter.secureInbound(this.components.peerId, stream), - protocol - }; - } - catch (err) { - throw new CodeError(String(err), codes.ERR_ENCRYPTION_FAILED); - } - } - /** - * Attempts to encrypt the given `connection` with the provided connection encrypters. - * The first `ConnectionEncrypter` module to succeed will be used - */ - async _encryptOutbound(connection, remotePeerId) { - const protocols = Array.from(this.connectionEncryption.keys()); - this.log('selecting outbound crypto protocol', protocols); - try { - connection.log.trace('selecting encrypter from %s', protocols); - const { stream, protocol } = await mss.select(connection, protocols, { - log: connection.log, - yieldBytes: true - }); - const encrypter = this.connectionEncryption.get(protocol); - if (encrypter == null) { - throw new Error(`no crypto module found for ${protocol}`); - } - connection.log('encrypting outbound connection to %p using %p', remotePeerId); - return { - ...await encrypter.secureOutbound(this.components.peerId, stream, remotePeerId), - protocol - }; - } - catch (err) { - throw new CodeError(String(err), codes.ERR_ENCRYPTION_FAILED); - } - } - /** - * Selects one of the given muxers via multistream-select. That - * muxer will be used for all future streams on the connection. - */ - async _multiplexOutbound(connection, muxers) { - const protocols = Array.from(muxers.keys()); - this.log('outbound selecting muxer %s', protocols); - try { - connection.log.trace('selecting stream muxer from %s', protocols); - const { stream, protocol } = await mss.select(connection, protocols, { - log: connection.log, - yieldBytes: true - }); - connection.log('selected %s as muxer protocol', protocol); - const muxerFactory = muxers.get(protocol); - return { stream, muxerFactory }; - } - catch (err) { - connection.log.error('error multiplexing outbound stream', err); - throw new CodeError(String(err), codes.ERR_MUXER_UNAVAILABLE); - } - } - /** - * Registers support for one of the given muxers via multistream-select. The - * selected muxer will be used for all future streams on the connection. - */ - async _multiplexInbound(connection, muxers) { - const protocols = Array.from(muxers.keys()); - this.log('inbound handling muxers %s', protocols); - try { - const { stream, protocol } = await mss.handle(connection, protocols, { - log: connection.log - }); - const muxerFactory = muxers.get(protocol); - return { stream, muxerFactory }; - } - catch (err) { - this.log.error('error multiplexing inbound stream', err); - throw new CodeError(String(err), codes.ERR_MUXER_UNAVAILABLE); - } - } -} -//# sourceMappingURL=upgrader.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/upgrader.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/upgrader.js.map deleted file mode 100644 index 5228dfbd9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/upgrader.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"upgrader.js","sourceRoot":"","sources":["../../src/upgrader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,GAAG,MAAM,4BAA4B,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAA;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAc1F,MAAM,+BAA+B,GAAG,KAAK,CAAA;AAiC7C,SAAS,uBAAuB,CAAE,QAAgB,EAAE,SAAoB;IACtE,IAAI;QACF,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;QAElD,OAAO,OAAO,CAAC,iBAAiB,CAAA;KACjC;IAAC,OAAO,GAAQ,EAAE;QACjB,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,2BAA2B,EAAE;YAClD,MAAM,GAAG,CAAA;SACV;KACF;IAED,OAAO,2BAA2B,CAAA;AACpC,CAAC;AAED,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ACjB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,mCAAmC,EAAE,GAAG,CAAC,CAAA;YACxD,MAAM,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAA;SAC9D;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/version.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/version.d.ts deleted file mode 100644 index d5e48250d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/version.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const version = "0.0.0"; -export declare const name = "libp2p"; -//# sourceMappingURL=version.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/version.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/version.d.ts.map deleted file mode 100644 index 42cde27b6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/version.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAA;AAC9B,eAAO,MAAM,IAAI,WAAW,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/version.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/version.js deleted file mode 100644 index b68fea07c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/version.js +++ /dev/null @@ -1,3 +0,0 @@ -export const version = '0.0.0'; -export const name = 'libp2p'; -//# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/version.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/version.js.map deleted file mode 100644 index 7a06ad10a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/src/version.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAA;AAC9B,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/address-manager.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/address-manager.spec.d.ts deleted file mode 100644 index 985b1d198..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/address-manager.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=address-manager.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/address-manager.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/address-manager.spec.d.ts.map deleted file mode 100644 index ac1f6fc23..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/address-manager.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address-manager.spec.d.ts","sourceRoot":"","sources":["../../../test/addresses/address-manager.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/address-manager.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/address-manager.spec.js deleted file mode 100644 index 4b06d2ddd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/address-manager.spec.js +++ /dev/null @@ -1,193 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { defaultLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import delay from 'delay'; -import Sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { DefaultAddressManager } from '../../src/address-manager/index.js'; -const listenAddresses = ['/ip4/127.0.0.1/tcp/15006/ws', '/ip4/127.0.0.1/tcp/15008/ws']; -const announceAddreses = ['/dns4/peer.io']; -describe('Address Manager', () => { - let peerId; - let peerStore; - let events; - beforeEach(async () => { - peerId = await createEd25519PeerId(); - peerStore = stubInterface({ - patch: Sinon.stub().resolves({}) - }); - events = new TypedEventEmitter(); - }); - it('should not need any addresses', () => { - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface() - }); - expect(am.getListenAddrs()).to.be.empty(); - expect(am.getAnnounceAddrs()).to.be.empty(); - }); - it('should return listen multiaddrs on get', () => { - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface(), - listen: listenAddresses - }); - expect(am.getListenAddrs()).to.have.lengthOf(listenAddresses.length); - expect(am.getAnnounceAddrs()).to.be.empty(); - const listenMultiaddrs = am.getListenAddrs(); - expect(listenMultiaddrs.length).to.equal(2); - expect(listenMultiaddrs[0].equals(multiaddr(listenAddresses[0]))).to.equal(true); - expect(listenMultiaddrs[1].equals(multiaddr(listenAddresses[1]))).to.equal(true); - }); - it('should return announce multiaddrs on get', () => { - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface(), - listen: listenAddresses, - announce: announceAddreses - }); - expect(am.getListenAddrs()).to.have.lengthOf(listenAddresses.length); - expect(am.getAnnounceAddrs()).to.have.lengthOf(announceAddreses.length); - const announceMultiaddrs = am.getAnnounceAddrs(); - expect(announceMultiaddrs.length).to.equal(1); - expect(announceMultiaddrs[0].equals(multiaddr(announceAddreses[0]))).to.equal(true); - }); - it('should add observed addresses', () => { - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface() - }); - expect(am.getObservedAddrs()).to.be.empty(); - am.addObservedAddr(multiaddr('/ip4/123.123.123.123/tcp/39201')); - expect(am.getObservedAddrs()).to.have.lengthOf(1); - }); - it('should allow duplicate listen addresses', () => { - const ma = multiaddr('/ip4/0.0.0.0/tcp/0'); - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface(), - listen: [ - ma.toString(), - ma.toString() - ] - }); - expect(am.getListenAddrs()).to.deep.equal([ - ma, - ma - ]); - }); - it('should dedupe added observed addresses', () => { - const ma = multiaddr('/ip4/123.123.123.123/tcp/39201'); - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }, { - announceFilter: stubInterface() - }); - expect(am.getObservedAddrs()).to.be.empty(); - am.addObservedAddr(ma); - am.addObservedAddr(ma); - am.addObservedAddr(ma); - expect(am.getObservedAddrs()).to.have.lengthOf(1); - expect(am.getObservedAddrs().map(ma => ma.toString())).to.include(ma.toString()); - }); - it('should only set addresses once', async () => { - const ma = '/ip4/123.123.123.123/tcp/39201'; - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface({ - getAddrs: Sinon.stub().returns([]) - }), - peerStore, - events, - logger: defaultLogger() - }); - am.confirmObservedAddr(multiaddr(ma)); - am.confirmObservedAddr(multiaddr(ma)); - am.confirmObservedAddr(multiaddr(ma)); - am.confirmObservedAddr(multiaddr(`${ma.toString()}/p2p/${peerId.toString()}`)); - // wait for address manager _updatePeerStoreAddresses debounce - await delay(1500); - expect(peerStore.patch).to.have.property('callCount', 1); - }); - it('should strip our peer address from added observed addresses', () => { - const ma = multiaddr('/ip4/123.123.123.123/tcp/39201'); - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }); - expect(am.getObservedAddrs()).to.be.empty(); - am.addObservedAddr(ma); - am.addObservedAddr(multiaddr(`${ma.toString()}/p2p/${peerId.toString()}`)); - expect(am.getObservedAddrs()).to.have.lengthOf(1); - expect(am.getObservedAddrs().map(ma => ma.toString())).to.include(ma.toString()); - }); - it('should strip our peer address from added observed addresses in difference formats', () => { - const ma = multiaddr('/ip4/123.123.123.123/tcp/39201'); - const am = new DefaultAddressManager({ - peerId, - transportManager: stubInterface(), - peerStore, - events, - logger: defaultLogger() - }); - expect(am.getObservedAddrs()).to.be.empty(); - am.addObservedAddr(ma); - am.addObservedAddr(multiaddr(`${ma.toString()}/p2p/${peerId.toString()}`)); - expect(am.getObservedAddrs()).to.have.lengthOf(1); - expect(am.getObservedAddrs().map(ma => ma.toString())).to.include(ma.toString()); - }); - it('should not add our peer id to path multiaddrs', () => { - const ma = '/unix/foo/bar/baz'; - const transportManager = stubInterface(); - const am = new DefaultAddressManager({ - peerId, - transportManager, - peerStore, - events, - logger: defaultLogger() - }, { - listen: [ma], - announce: [] - }); - transportManager.getAddrs.returns([multiaddr(ma)]); - const addrs = am.getAddresses(); - expect(addrs).to.have.lengthOf(1); - expect(addrs[0].toString()).to.not.include(`/p2p/${peerId.toString()}`); - }); -}); -//# sourceMappingURL=address-manager.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/address-manager.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/address-manager.spec.js.map deleted file mode 100644 index af28232b9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/address-manager.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address-manager.spec.js","sourceRoot":"","sources":["../../../test/addresses/address-manager.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,iBAAiB,EAAyB,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAwB,aAAa,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAsB,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAM9F,MAAM,eAAe,GAAG,CAAC,6BAA6B,EAAE,6BAA6B,CAAC,CAAA;AACtF,MAAM,gBAAgB,GAAG,CAAC,eAAe,CAAC,CAAA;AAE1C,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,IAAI,MAAc,CAAA;IAClB,IAAI,SAAqC,CAAA;IACzC,IAAI,MAAsC,CAAA;IAE1C,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,GAAG,MAAM,mBAAmB,EAAE,CAAA;QACpC,SAAS,GAAG,aAAa,CAAY;YACnC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;SACjC,CAAC,CAAA;QACF,MAAM,GAAG,IAAI,iBAAiB,EAAE,CAAA;IAClC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,MAAM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AK,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;QACjC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;IACzE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/addresses.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/addresses.node.d.ts deleted file mode 100644 index 8e88d60d9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/addresses.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=addresses.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/addresses.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/addresses.node.d.ts.map deleted file mode 100644 index de6ec2bd2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/addresses.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"addresses.node.d.ts","sourceRoot":"","sources":["../../../test/addresses/addresses.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/addresses.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/addresses.node.js deleted file mode 100644 index f263de103..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/addresses.node.js +++ /dev/null @@ -1,214 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { isLoopback } from '@libp2p/utils/multiaddr/is-loopback'; -import { webSockets } from '@libp2p/websockets'; -import { multiaddr, protocols } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { pEvent } from 'p-event'; -import sinon from 'sinon'; -import { createNode } from '../fixtures/creators/peer.js'; -import { AddressesOptions } from './utils.js'; -const listenAddresses = ['/ip4/127.0.0.1/tcp/0', '/ip4/127.0.0.1/tcp/8000/ws']; -const announceAddreses = ['/dns4/peer.io/tcp/433/p2p/12D3KooWNvSZnPi3RrhrTwEY4LuuBeB6K6facKUCJcyWG1aoDd2p']; -describe('libp2p.addressManager', () => { - let libp2p; - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('should keep listen addresses after start, even if changed', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses, - announce: announceAddreses - } - } - }); - let listenAddrs = libp2p.components.addressManager.getListenAddrs().map(ma => ma.toString()); - expect(listenAddrs).to.have.lengthOf(listenAddresses.length); - expect(listenAddrs).to.include(listenAddresses[0]); - expect(listenAddrs).to.include(listenAddresses[1]); - // Should not replace listen addresses after transport listen - // Only transportManager has visibility of the port used - await libp2p.start(); - listenAddrs = libp2p.components.addressManager.getListenAddrs().map(ma => ma.toString()); - expect(listenAddrs).to.have.lengthOf(listenAddresses.length); - expect(listenAddrs).to.include(listenAddresses[0]); - expect(listenAddrs).to.include(listenAddresses[1]); - }); - it('should announce transport listen addresses if announce addresses are not provided', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses - } - } - }); - await libp2p.start(); - const tmListen = libp2p.components.transportManager.getAddrs().map((ma) => ma.toString()); - // Announce 2 listen (transport) - const advertiseMultiaddrs = libp2p.components.addressManager.getAddresses().map((ma) => ma.decapsulateCode(protocols('p2p').code).toString()); - expect(advertiseMultiaddrs).to.have.lengthOf(2); - tmListen.forEach((m) => { - expect(advertiseMultiaddrs).to.include(m); - }); - expect(advertiseMultiaddrs).to.not.include(listenAddresses[0]); // Random Port switch - }); - it('should only announce the given announce addresses when provided', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses, - announce: announceAddreses - } - } - }); - await libp2p.start(); - const tmListen = libp2p.components.transportManager.getAddrs().map((ma) => ma.toString()); - // Announce 1 announce addr - const advertiseMultiaddrs = libp2p.components.addressManager.getAddresses().map((ma) => ma.decapsulateCode(protocols('p2p').code).toString()); - expect(advertiseMultiaddrs.length).to.equal(announceAddreses.length); - advertiseMultiaddrs.forEach((m) => { - expect(tmListen).to.not.include(m); - expect(announceAddreses).to.include(m); - }); - }); - it('can filter out loopback addresses by the announce filter', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses, - announceFilter: (multiaddrs) => multiaddrs.filter(m => !isLoopback(m)) - } - } - }); - await libp2p.start(); - expect(libp2p.components.addressManager.getAddresses()).to.have.lengthOf(0); - // Stub transportManager addresses to add a public address - const stubMa = multiaddr('/ip4/120.220.10.1/tcp/1000'); - sinon.stub(libp2p.components.transportManager, 'getAddrs').returns([ - ...listenAddresses.map((a) => multiaddr(a)), - stubMa - ]); - const multiaddrs = libp2p.components.addressManager.getAddresses(); - expect(multiaddrs.length).to.equal(1); - expect(multiaddrs[0].decapsulateCode(protocols('p2p').code).equals(stubMa)).to.eql(true); - }); - it('can filter out loopback addresses to announced by the announce filter', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses, - announce: announceAddreses, - announceFilter: (multiaddrs) => multiaddrs.filter(m => !isLoopback(m)) - } - } - }); - const listenAddrs = libp2p.components.addressManager.getListenAddrs().map((ma) => ma.toString()); - expect(listenAddrs).to.have.lengthOf(listenAddresses.length); - expect(listenAddrs).to.include(listenAddresses[0]); - expect(listenAddrs).to.include(listenAddresses[1]); - await libp2p.start(); - const loopbackAddrs = libp2p.components.addressManager.getAddresses().filter(ma => isLoopback(ma)); - expect(loopbackAddrs).to.be.empty(); - }); - it('should include observed addresses in returned multiaddrs', async () => { - libp2p = await createNode({ - started: false, - config: { - ...AddressesOptions, - addresses: { - listen: listenAddresses - } - } - }); - const ma = '/ip4/83.32.123.53/tcp/43928'; - await libp2p.start(); - expect(libp2p.components.addressManager.getAddresses()).to.have.lengthOf(listenAddresses.length); - libp2p.components.addressManager.confirmObservedAddr(multiaddr(ma)); - expect(libp2p.components.addressManager.getAddresses()).to.have.lengthOf(listenAddresses.length + 1); - expect(libp2p.components.addressManager.getAddresses().map(ma => ma.decapsulateCode(protocols('p2p').code).toString())).to.include(ma); - }); - it('should populate the AddressManager from the config', async () => { - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: listenAddresses, - announce: announceAddreses - }, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - } - }); - expect(libp2p.getMultiaddrs().map(ma => ma.decapsulateCode(protocols('p2p').code).toString())).to.have.members(announceAddreses); - expect(libp2p.getMultiaddrs().map(ma => ma.decapsulateCode(protocols('p2p').code).toString())).to.not.have.members(listenAddresses); - }); - it('should update our peer record with announce addresses on startup', async () => { - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: listenAddresses, - announce: announceAddreses - }, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - } - }); - const eventPromise = pEvent(libp2p, 'self:peer:update'); - await libp2p.start(); - const event = await eventPromise; - expect(event.detail.peer.addresses.map(({ multiaddr }) => multiaddr.toString())) - .to.include.members(announceAddreses, 'peer info did not include announce addresses'); - }); - it('should only include confirmed observed addresses in peer record', async () => { - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: listenAddresses, - announce: announceAddreses - }, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - } - }); - await libp2p.start(); - const eventPromise = pEvent(libp2p, 'self:peer:update'); - const unconfirmedAddress = multiaddr('/ip4/127.0.0.1/tcp/4010/ws'); - libp2p.components.addressManager.addObservedAddr(unconfirmedAddress); - const confirmedAddress = multiaddr('/ip4/127.0.0.1/tcp/4011/ws'); - libp2p.components.addressManager.confirmObservedAddr(confirmedAddress); - const event = await eventPromise; - expect(event.detail.peer.addresses.map(({ multiaddr }) => multiaddr.toString())) - .to.not.include(unconfirmedAddress.toString(), 'peer info included unconfirmed observed address'); - expect(event.detail.peer.addresses.map(({ multiaddr }) => multiaddr.toString())) - .to.include(confirmedAddress.toString(), 'peer info did not include confirmed observed address'); - }); -}); -//# sourceMappingURL=addresses.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/addresses.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/addresses.node.js.map deleted file mode 100644 index 7452a01a9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/addresses.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"addresses.node.js","sourceRoot":"","sources":["../../../test/addresses/addresses.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAkB,SAAS,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAI7C,MAAM,eAAe,GAAG,CAAC,sBAAs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AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/utils.d.ts deleted file mode 100644 index fe756c845..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/utils.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const AddressesOptions: import("../../src/index.js").Libp2pOptions>; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/utils.d.ts.map deleted file mode 100644 index 887bb9fda..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../test/addresses/utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,qEAK3B,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/utils.js deleted file mode 100644 index 5329e4337..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/utils.js +++ /dev/null @@ -1,10 +0,0 @@ -import { tcp } from '@libp2p/tcp'; -import { webSockets } from '@libp2p/websockets'; -import { createBaseOptions } from '../fixtures/base-options.js'; -export const AddressesOptions = createBaseOptions({ - transports: [ - tcp(), - webSockets() - ] -}); -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/utils.js.map deleted file mode 100644 index d4fc62356..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/addresses/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../test/addresses/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAE/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;IAChD,UAAU,EAAE;QACV,GAAG,EAAE;QACL,UAAU,EAAE;KACb;CACF,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts deleted file mode 100644 index ce6da4870..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=auto-dial.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts.map deleted file mode 100644 index fe1b08ef2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/auto-dial.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auto-dial.spec.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/auto-dial.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/auto-dial.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/auto-dial.spec.js deleted file mode 100644 index 721a8f1c9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/auto-dial.spec.js +++ /dev/null @@ -1,254 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { defaultLogger } from '@libp2p/logger'; -import { PeerMap } from '@libp2p/peer-collections'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core'; -import delay from 'delay'; -import pWaitFor from 'p-wait-for'; -import Sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { defaultComponents } from '../../src/components.js'; -import { AutoDial } from '../../src/connection-manager/auto-dial.js'; -import { LAST_DIAL_FAILURE_KEY } from '../../src/connection-manager/constants.js'; -import { matchPeerId } from '../fixtures/match-peer-id.js'; -describe('auto-dial', () => { - let autoDialer; - let events; - let peerStore; - let peerId; - beforeEach(async () => { - peerId = await createEd25519PeerId(); - events = new TypedEventEmitter(); - peerStore = new PersistentPeerStore({ - datastore: new MemoryDatastore(), - events, - peerId, - logger: defaultLogger() - }); - }); - afterEach(() => { - if (autoDialer != null) { - autoDialer.stop(); - } - }); - it('should not dial peers without multiaddrs', async () => { - // peers with protocols are dialled before peers without protocols - const peerWithAddress = { - id: await createEd25519PeerId(), - protocols: [ - '/foo/bar' - ], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - const peerWithoutAddress = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [], - metadata: new Map(), - tags: new Map() - }; - await peerStore.save(peerWithAddress.id, peerWithAddress); - await peerStore.save(peerWithoutAddress.id, peerWithoutAddress); - const connectionManager = stubInterface({ - getConnectionsMap: Sinon.stub().returns(new PeerMap()), - getDialQueue: Sinon.stub().returns([]) - }); - autoDialer = new AutoDial(defaultComponents({ - peerStore, - connectionManager, - events - }), { - minConnections: 10, - autoDialInterval: 10000 - }); - autoDialer.start(); - void autoDialer.autoDial(); - await pWaitFor(() => { - return connectionManager.openConnection.callCount === 1; - }); - await delay(1000); - expect(connectionManager.openConnection.callCount).to.equal(1); - expect(connectionManager.openConnection.calledWith(matchPeerId(peerWithAddress.id))).to.be.true(); - expect(connectionManager.openConnection.calledWith(matchPeerId(peerWithoutAddress.id))).to.be.false(); - }); - it('should not dial connected peers', async () => { - const connectedPeer = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - const unConnectedPeer = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4002'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - await peerStore.save(connectedPeer.id, connectedPeer); - await peerStore.save(unConnectedPeer.id, unConnectedPeer); - const connectionMap = new PeerMap(); - connectionMap.set(connectedPeer.id, [stubInterface()]); - const connectionManager = stubInterface({ - getConnectionsMap: Sinon.stub().returns(connectionMap), - getDialQueue: Sinon.stub().returns([]) - }); - autoDialer = new AutoDial(defaultComponents({ - peerStore, - connectionManager, - events - }), { - minConnections: 10 - }); - autoDialer.start(); - await autoDialer.autoDial(); - await pWaitFor(() => connectionManager.openConnection.callCount === 1); - await delay(1000); - expect(connectionManager.openConnection.callCount).to.equal(1); - expect(connectionManager.openConnection.calledWith(matchPeerId(unConnectedPeer.id))).to.be.true(); - expect(connectionManager.openConnection.calledWith(matchPeerId(connectedPeer.id))).to.be.false(); - }); - it('should not dial peers already in the dial queue', async () => { - // peers with protocols are dialled before peers without protocols - const peerInDialQueue = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - const peerNotInDialQueue = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4002'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - await peerStore.save(peerInDialQueue.id, peerInDialQueue); - await peerStore.save(peerNotInDialQueue.id, peerNotInDialQueue); - const connectionManager = stubInterface({ - getConnectionsMap: Sinon.stub().returns(new PeerMap()), - getDialQueue: Sinon.stub().returns([{ - id: 'foo', - peerId: peerInDialQueue.id, - multiaddrs: [], - status: 'queued' - }]) - }); - autoDialer = new AutoDial(defaultComponents({ - peerStore, - connectionManager, - events - }), { - minConnections: 10 - }); - autoDialer.start(); - await autoDialer.autoDial(); - await pWaitFor(() => connectionManager.openConnection.callCount === 1); - await delay(1000); - expect(connectionManager.openConnection.callCount).to.equal(1); - expect(connectionManager.openConnection.calledWith(matchPeerId(peerNotInDialQueue.id))).to.be.true(); - expect(connectionManager.openConnection.calledWith(matchPeerId(peerInDialQueue.id))).to.be.false(); - }); - it('should not start parallel autodials', async () => { - const peerStoreAllSpy = Sinon.spy(peerStore, 'all'); - const connectionManager = stubInterface({ - getConnectionsMap: Sinon.stub().returns(new PeerMap()), - getDialQueue: Sinon.stub().returns([]) - }); - autoDialer = new AutoDial(defaultComponents({ - peerStore, - connectionManager, - events - }), { - minConnections: 10, - autoDialInterval: 10000 - }); - autoDialer.start(); - // call autodial twice - await Promise.all([ - autoDialer.autoDial(), - autoDialer.autoDial() - ]); - // should only have queried peer store once - expect(peerStoreAllSpy.callCount).to.equal(1); - }); - it('should not re-dial peers we have recently failed to dial', async () => { - const peerWithAddress = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001'), - isCertified: true - }], - metadata: new Map(), - tags: new Map() - }; - const undialablePeer = { - id: await createEd25519PeerId(), - protocols: [], - addresses: [{ - multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4002'), - isCertified: true - }], - // we failed to dial them recently - metadata: new Map([[LAST_DIAL_FAILURE_KEY, uint8ArrayFromString(`${Date.now() - 10}`)]]), - tags: new Map() - }; - await peerStore.save(peerWithAddress.id, peerWithAddress); - await peerStore.save(undialablePeer.id, undialablePeer); - const connectionManager = stubInterface({ - getConnectionsMap: Sinon.stub().returns(new PeerMap()), - getDialQueue: Sinon.stub().returns([]) - }); - autoDialer = new AutoDial(defaultComponents({ - peerStore, - connectionManager, - events - }), { - minConnections: 10, - autoDialPeerRetryThreshold: 2000 - }); - autoDialer.start(); - void autoDialer.autoDial(); - await pWaitFor(() => { - return connectionManager.openConnection.callCount === 1; - }); - expect(connectionManager.openConnection.callCount).to.equal(1); - expect(connectionManager.openConnection.calledWith(matchPeerId(peerWithAddress.id))).to.be.true(); - expect(connectionManager.openConnection.calledWith(matchPeerId(undialablePeer.id))).to.be.false(); - // pass the retry threshold - await delay(2000); - // autodial again - void autoDialer.autoDial(); - await pWaitFor(() => { - return connectionManager.openConnection.callCount === 3; - }); - // should have retried the unreachable peer - expect(connectionManager.openConnection.calledWith(matchPeerId(undialablePeer.id))).to.be.true(); - }); -}); -//# sourceMappingURL=auto-dial.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/auto-dial.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/auto-dial.spec.js.map deleted file mode 100644 index 9f6f42597..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/auto-dial.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auto-dial.spec.js","sourceRoot":"","sources":["../../../test/connection-manager/auto-dial.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,iBAAiB,EAAyB,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAA;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAA;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAO1D,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,IAAI,UAAoB,CAAA;IACxB,IAAI,MAAsC,CAAA;IAC1C,IAAI,SAAoB,CAAA;IACxB,IAAI,MAAc,CAAA;IAElB,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,GAAG,MAAM,mBAAmB,EAAE,C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AAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;QAEjG,2BAA2B;QAC3B,MAAM,KAAK,CAAC,IAAI,CAAC,CAAA;QAEjB,iBAAiB;QACjB,KAAK,UAAU,CAAC,QAAQ,EAAE,CAAA;QAE1B,MAAM,QAAQ,CAAC,GAAG,EAAE;YAClB,OAAO,iBAAiB,CAAC,cAAc,CAAC,SAAS,KAAK,CAAC,CAAA;QACzD,CAAC,CAAC,CAAA;QAEF,2CAA2C;QAC3C,MAAM,CAAC,iBAAiB,CAAC,cAAc,CAAC,UAAU,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;IAClG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts deleted file mode 100644 index 9a6ef4706..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=dial-queue.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts.map deleted file mode 100644 index a7f5a2683..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/dial-queue.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dial-queue.spec.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/dial-queue.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/dial-queue.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/dial-queue.spec.js deleted file mode 100644 index 34f8adb10..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/dial-queue.spec.js +++ /dev/null @@ -1,218 +0,0 @@ -/* eslint-env mocha */ -import { mockConnection, mockDuplex, mockMultiaddrConnection } from '@libp2p/interface-compliance-tests/mocks'; -import { peerLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { multiaddr, resolvers } from '@multiformats/multiaddr'; -import { WebRTC } from '@multiformats/multiaddr-matcher'; -import { expect } from 'aegir/chai'; -import delay from 'delay'; -import pDefer from 'p-defer'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { DialQueue } from '../../src/connection-manager/dial-queue.js'; -describe('dial queue', () => { - let components; - let dialer; - beforeEach(async () => { - const peerId = await createEd25519PeerId(); - components = { - peerId, - peerStore: stubInterface(), - transportManager: stubInterface(), - connectionGater: stubInterface(), - logger: peerLogger(peerId) - }; - }); - afterEach(() => { - if (dialer != null) { - dialer.stop(); - } - sinon.reset(); - }); - it('should end when a single multiaddr dials succeeds', async () => { - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), await createEd25519PeerId())); - const deferredConn = pDefer(); - const actions = { - '/ip4/127.0.0.1/tcp/1231': async () => Promise.reject(new Error('dial failure')), - '/ip4/127.0.0.1/tcp/1232': async () => Promise.resolve(connection), - '/ip4/127.0.0.1/tcp/1233': async () => deferredConn.promise - }; - components.transportManager.transportForMultiaddr.returns(stubInterface()); - components.transportManager.dial.callsFake(async (ma) => { - const maStr = ma.toString(); - const action = actions[maStr]; - if (action != null) { - return action(); - } - throw new Error(`No action found for multiaddr ${maStr}`); - }); - dialer = new DialQueue(components, { - maxParallelDials: 2 - }); - // Make sure that dial attempt comes back before terminating last dial action - await expect(dialer.dial(Object.keys(actions).map(str => multiaddr(str)))) - .to.eventually.equal(connection); - // End third dial attempt - deferredConn.resolve(); - // prevent playwright-core error Error: Cannot find parent object page@... to create handle@... - await expect(deferredConn.promise).to.eventually.be.undefined(); - }); - it('should end when a single multiaddr dials succeeds even when a final dial fails', async () => { - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), await createEd25519PeerId())); - const deferredConn = pDefer(); - const actions = { - '/ip4/127.0.0.1/tcp/1231': async () => Promise.reject(new Error('dial failure')), - '/ip4/127.0.0.1/tcp/1232': async () => Promise.resolve(connection), - '/ip4/127.0.0.1/tcp/1233': async () => deferredConn.promise - }; - components.transportManager.transportForMultiaddr.returns(stubInterface()); - components.transportManager.dial.callsFake(async (ma) => { - const maStr = ma.toString(); - const action = actions[maStr]; - if (action != null) { - return action(); - } - throw new Error(`No action found for multiaddr ${maStr}`); - }); - dialer = new DialQueue(components, { - maxParallelDials: 2 - }); - // Make sure that dial attempt comes back before terminating last dial action - await expect(dialer.dial(Object.keys(actions).map(str => multiaddr(str)))) - .to.eventually.equal(connection); - // End third dial attempt - deferredConn.reject(new Error('Oh noes!')); - // prevent playwright-core error Error: Cannot find parent object page@... to create handle@... - await expect(deferredConn.promise).to.eventually.be.rejected(); - }); - it('should throw an AggregateError if all dials fail', async () => { - const actions = { - '/ip4/127.0.0.1/tcp/1231': async () => Promise.reject(new Error('dial failure')), - '/ip4/127.0.0.1/tcp/1232': async () => Promise.reject(new Error('dial failure')), - '/ip4/127.0.0.1/tcp/1233': async () => Promise.reject(new Error('dial failure')) - }; - dialer = new DialQueue(components, { - maxParallelDials: 2 - }); - components.transportManager.transportForMultiaddr.returns(stubInterface()); - components.transportManager.dial.callsFake(async (ma) => { - const maStr = ma.toString(); - const action = actions[maStr]; - if (action != null) { - return action(); - } - throw new Error(`No action found for multiaddr ${maStr}`); - }); - sinon.spy(actions, '/ip4/127.0.0.1/tcp/1231'); - sinon.spy(actions, '/ip4/127.0.0.1/tcp/1232'); - sinon.spy(actions, '/ip4/127.0.0.1/tcp/1233'); - try { - await dialer.dial(Object.keys(actions).map(str => multiaddr(str))); - expect.fail('Should have thrown'); - } - catch (err) { - expect(err).to.have.property('name', 'AggregateError'); - } - expect(actions['/ip4/127.0.0.1/tcp/1231']).to.have.property('callCount', 1); - expect(actions['/ip4/127.0.0.1/tcp/1232']).to.have.property('callCount', 1); - expect(actions['/ip4/127.0.0.1/tcp/1233']).to.have.property('callCount', 1); - }); - it('should handle a large number of addrs', async () => { - const reject = sinon.stub().callsFake(async () => Promise.reject(new Error('dial failure'))); - const actions = {}; - const addrs = [...new Array(25)].map((_, index) => `/ip4/127.0.0.1/tcp/12${index + 1}`); - addrs.forEach(addr => { - actions[addr] = reject; - }); - dialer = new DialQueue(components, { - maxParallelDials: 2 - }); - components.transportManager.transportForMultiaddr.returns(stubInterface()); - components.transportManager.dial.callsFake(async (ma) => { - const maStr = ma.toString(); - const action = actions[maStr]; - if (action != null) { - return action(); - } - throw new Error(`No action found for multiaddr ${maStr}`); - }); - try { - await dialer.dial(Object.keys(actions).map(str => multiaddr(str))); - expect.fail('Should have thrown'); - } - catch (err) { - expect(err).to.have.property('name', 'AggregateError'); - } - expect(reject).to.have.property('callCount', addrs.length); - }); - it('should ignore DNS addresses for other peers', async () => { - const remotePeer = await createEd25519PeerId(); - const otherRemotePeer = await createEd25519PeerId(); - const ma = multiaddr(`/dnsaddr/example.com/p2p/${remotePeer}`); - const maStr = `/ip4/123.123.123.123/tcp/2348/p2p/${remotePeer}`; - const resolvedAddresses = [ - `/ip4/234.234.234.234/tcp/4213/p2p/${otherRemotePeer}`, - maStr - ]; - let resolvedDNSAddrs = false; - let dialedBadAddress = false; - // simulate a DNSAddr that resolves to multiple different peers like - // bootstrap.libp2p.io - resolvers.set('dnsaddr', async (addr) => { - if (addr.equals(ma)) { - resolvedDNSAddrs = true; - return resolvedAddresses; - } - return []; - }); - dialer = new DialQueue(components, { - maxParallelDials: 50 - }); - components.transportManager.transportForMultiaddr.returns(stubInterface()); - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeer)); - components.transportManager.dial.callsFake(async (ma, opts = {}) => { - if (ma.toString() === maStr) { - await delay(100); - return connection; - } - dialedBadAddress = true; - throw new Error('Could not dial address'); - }); - await expect(dialer.dial(ma)).to.eventually.equal(connection); - expect(resolvedDNSAddrs).to.be.true('Did not resolve DNSAddrs'); - expect(dialedBadAddress).to.be.false('Dialed address with wrong peer id'); - resolvers.delete('dnsaddr'); - }); - it('should dial WebRTC address with peer id appended', async () => { - const remotePeer = await createEd25519PeerId(); - const relayPeer = await createEd25519PeerId(); - const ma = multiaddr(`/ip4/123.123.123.123/tcp/123/ws/p2p/${relayPeer}/p2p-circuit/webrtc`); - const maWithPeer = `${ma}/p2p/${remotePeer}`; - components.transportManager.transportForMultiaddr.callsFake(ma => { - if (WebRTC.exactMatch(ma)) { - return stubInterface(); - } - }); - components.peerStore.get.withArgs(remotePeer).resolves({ - id: remotePeer, - protocols: [], - metadata: new Map(), - tags: new Map(), - addresses: [{ - multiaddr: ma, - isCertified: true - }] - }); - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeer)); - components.transportManager.dial.callsFake(async (ma, opts = {}) => { - if (ma.toString() === maWithPeer) { - await delay(100); - return connection; - } - throw new Error('Could not dial address'); - }); - dialer = new DialQueue(components); - await expect(dialer.dial(remotePeer)).to.eventually.equal(connection); - }); -}); -//# sourceMappingURL=dial-queue.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/dial-queue.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/dial-queue.spec.js.map deleted file mode 100644 index 2b79846f3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/dial-queue.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dial-queue.spec.js","sourceRoot":"","sources":["../../../test/connection-manager/dial-queue.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAA;AAC9G,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAwB,aAAa,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAA;AAStE,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,IAAI,UAMH,CAAA;IACD,IAAI,MAAiB,CAAA;IAErB,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,MAAM,GAAG,MAAM,mBAAmB,EAAE,CAAA;QAE1C,UAAU,GAAG;YACX,MAAM;YACN,SAAS,EAAE,aAAa,EAAa;YACrC,gBAAgB,EAAE,aAAa,EAAoB;YACnD,eAAe,EAAE,aAAa,EAAmB;YACjD,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC;SAC3B,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,CAAC,IAAI,EAAE,CAAA;SACd;QAED,KAA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O,aAAa,EAAa,CAAA;aAClC;QACH,CAAC,CAAC,CAAA;QACF,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC;YACrD,EAAE,EAAE,UAAU;YACd,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,IAAI,GAAG,EAAE;YACnB,IAAI,EAAE,IAAI,GAAG,EAAE;YACf,SAAS,EAAE,CAAC;oBACV,SAAS,EAAE,EAAE;oBACb,WAAW,EAAE,IAAI;iBAClB,CAAC;SACH,CAAC,CAAA;QAEF,MAAM,UAAU,GAAG,cAAc,CAAC,uBAAuB,CAAC,UAAU,EAAE,EAAE,UAAU,CAAC,CAAC,CAAA;QAEpF,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,GAAG,EAAE,EAAE,EAAE;YACjE,IAAI,EAAE,CAAC,QAAQ,EAAE,KAAK,UAAU,EAAE;gBAChC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;gBAChB,OAAO,UAAU,CAAA;aAClB;YAED,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;QAC3C,CAAC,CAAC,CAAA;QAEF,MAAM,GAAG,IAAI,SAAS,CAAC,UAAU,CAAC,CAAA;QAClC,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;IACvE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.node.d.ts deleted file mode 100644 index bf3a5d6de..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=direct.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.node.d.ts.map deleted file mode 100644 index 2626222c7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"direct.node.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/direct.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.node.js deleted file mode 100644 index 52332f6f5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.node.js +++ /dev/null @@ -1,544 +0,0 @@ -/* eslint-env mocha */ -import fs from 'node:fs'; -import os from 'node:os'; -import path from 'node:path'; -import { yamux } from '@chainsafe/libp2p-yamux'; -import { isConnection } from '@libp2p/interface/connection'; -import { AbortError, ERR_TIMEOUT } from '@libp2p/interface/errors'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { start, stop } from '@libp2p/interface/startable'; -import { mockConnection, mockConnectionGater, mockDuplex, mockMultiaddrConnection, mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { mplex } from '@libp2p/mplex'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { plaintext } from '@libp2p/plaintext'; -import { tcp } from '@libp2p/tcp'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core/memory'; -import delay from 'delay'; -import { pipe } from 'it-pipe'; -import { pushable } from 'it-pushable'; -import pWaitFor from 'p-wait-for'; -import Sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { DefaultAddressManager } from '../../src/address-manager/index.js'; -import { defaultComponents } from '../../src/components.js'; -import { DialQueue } from '../../src/connection-manager/dial-queue.js'; -import { DefaultConnectionManager } from '../../src/connection-manager/index.js'; -import { codes as ErrorCodes } from '../../src/errors.js'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { DefaultTransportManager } from '../../src/transport-manager.js'; -import { ECHO_PROTOCOL, echo } from '../fixtures/echo-service.js'; -const listenAddr = multiaddr('/ip4/127.0.0.1/tcp/0'); -const unsupportedAddr = multiaddr('/ip4/127.0.0.1/tcp/9999/ws/p2p/QmckxVrJw1Yo8LqvmDJNUmdAsKtSbiKWmrXJFyKmUraBoN'); -describe('dialing (direct, TCP)', () => { - let remoteTM; - let localTM; - let remoteAddr; - let remoteComponents; - let localComponents; - let resolver; - beforeEach(async () => { - resolver = Sinon.stub(); - const [localPeerId, remotePeerId] = await Promise.all([ - createEd25519PeerId(), - createEd25519PeerId() - ]); - const remoteEvents = new TypedEventEmitter(); - remoteComponents = defaultComponents({ - peerId: remotePeerId, - events: remoteEvents, - datastore: new MemoryDatastore(), - upgrader: mockUpgrader({ events: remoteEvents }), - connectionGater: mockConnectionGater(), - transportManager: stubInterface({ - getAddrs: Sinon.stub().returns([]) - }) - }); - remoteComponents.peerStore = new PersistentPeerStore(remoteComponents); - remoteComponents.addressManager = new DefaultAddressManager(remoteComponents, { - listen: [ - listenAddr.toString() - ] - }); - remoteTM = remoteComponents.transportManager = new DefaultTransportManager(remoteComponents); - remoteTM.add(tcp()({ - logger: defaultLogger() - })); - const localEvents = new TypedEventEmitter(); - localComponents = defaultComponents({ - peerId: localPeerId, - events: localEvents, - datastore: new MemoryDatastore(), - upgrader: mockUpgrader({ events: localEvents }), - transportManager: stubInterface(), - connectionGater: mockConnectionGater() - }); - localComponents.peerStore = new PersistentPeerStore(localComponents); - localComponents.connectionManager = new DefaultConnectionManager(localComponents, { - maxConnections: 100, - minConnections: 50, - inboundUpgradeTimeout: 1000 - }); - localComponents.addressManager = new DefaultAddressManager(localComponents); - localTM = localComponents.transportManager = new DefaultTransportManager(localComponents); - localTM.add(tcp()({ - logger: defaultLogger() - })); - await start(localComponents); - await start(remoteComponents); - remoteAddr = remoteTM.getAddrs()[0].encapsulate(`/p2p/${remotePeerId.toString()}`); - }); - afterEach(async () => { - await stop(localComponents); - await stop(remoteComponents); - }); - afterEach(() => { - Sinon.restore(); - }); - it('should be able to connect to a remote node via its multiaddr', async () => { - const dialer = new DialQueue(localComponents); - const connection = await dialer.dial(remoteAddr); - expect(connection).to.exist(); - await connection.close(); - }); - it('should be able to connect to remote node with duplicated addresses', async () => { - const remotePeer = peerIdFromString(remoteAddr.getPeerId() ?? ''); - const dnsaddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remotePeer}`); - await localComponents.peerStore.merge(remotePeer, { - multiaddrs: [ - dnsaddr - ] - }); - const dialer = new DialQueue(localComponents, { - resolvers: { - dnsaddr: resolver - }, - maxParallelDials: 1 - }); - // Resolver stub - resolver.withArgs(dnsaddr).resolves([remoteAddr.toString()]); - const connection = await dialer.dial(remotePeer); - expect(connection).to.exist(); - await connection.close(); - }); - it('should fail to connect to an unsupported multiaddr', async () => { - const dialer = new DialQueue(localComponents); - await expect(dialer.dial(unsupportedAddr)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('should fail to connect if peer has no known addresses', async () => { - const dialer = new DialQueue(localComponents); - const peerId = await createEd25519PeerId(); - await expect(dialer.dial(peerId)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('should be able to connect to a given peer id', async () => { - await localComponents.peerStore.patch(remoteComponents.peerId, { - multiaddrs: remoteTM.getAddrs() - }); - const dialer = new DialQueue(localComponents); - const connection = await dialer.dial(remoteComponents.peerId); - expect(connection).to.exist(); - await connection.close(); - }); - it('should fail to connect to a given peer with unsupported addresses', async () => { - await localComponents.peerStore.patch(remoteComponents.peerId, { - multiaddrs: [unsupportedAddr] - }); - const dialer = new DialQueue(localComponents); - await expect(dialer.dial(remoteComponents.peerId)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('should only try to connect to addresses supported by the transports configured', async () => { - const remoteAddrs = remoteTM.getAddrs(); - const peerId = await createEd25519PeerId(); - await localComponents.peerStore.patch(peerId, { - multiaddrs: [...remoteAddrs, unsupportedAddr] - }); - const dialer = new DialQueue(localComponents); - Sinon.spy(localTM, 'dial'); - const connection = await dialer.dial(peerId); - expect(localTM.dial).to.have.property('callCount', remoteAddrs.length); - expect(connection).to.exist(); - await connection.close(); - }); - it('should abort dials on queue task timeout', async () => { - const dialer = new DialQueue(localComponents, { - dialTimeout: 50 - }); - Sinon.stub(localTM, 'dial').callsFake(async (addr, options = {}) => { - expect(options.signal).to.exist(); - expect(options.signal?.aborted).to.equal(false); - expect(addr.toString()).to.eql(remoteAddr.toString()); - await delay(60); - expect(options.signal?.aborted).to.equal(true); - throw new AbortError(); - }); - await expect(dialer.dial(remoteAddr)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.property('code', ERR_TIMEOUT); - }); - it('should only dial to the max concurrency', async () => { - const peerId1 = await createEd25519PeerId(); - const peerId2 = await createEd25519PeerId(); - const peerId3 = await createEd25519PeerId(); - const addr1 = multiaddr(`/ip4/127.0.0.1/tcp/1234/p2p/${peerId1}`); - const addr2 = multiaddr(`/ip4/127.0.12.4/tcp/3210/p2p/${peerId2}`); - const addr3 = multiaddr(`/ip4/123.3.11.1/tcp/2010/p2p/${peerId3}`); - const slowDial = async () => { - await delay(100); - return mockConnection(mockMultiaddrConnection(mockDuplex(), peerId1)); - }; - const actions = { - [addr1.toString()]: slowDial, - [addr2.toString()]: slowDial, - [addr3.toString()]: async () => mockConnection(mockMultiaddrConnection(mockDuplex(), peerId3)) - }; - const dialer = new DialQueue(localComponents, { - maxParallelDials: 2 - }); - const transportManagerDialStub = Sinon.stub(localTM, 'dial'); - transportManagerDialStub.callsFake(async (ma) => { - const maStr = ma.toString(); - const action = actions[maStr]; - if (action != null) { - return action(); - } - throw new Error(`No action found for multiaddr ${maStr}`); - }); - // dial 3 different peers - void Promise.all([ - dialer.dial(addr1), - dialer.dial(addr2), - dialer.dial(addr3) - ]); - // Let the call stack run - await delay(0); - // We should have 2 in progress, and 1 waiting - expect(transportManagerDialStub).to.have.property('callCount', 2); - // stop dials - dialer.stop(); - }); -}); -describe('libp2p.dialer (direct, TCP)', () => { - let peerId; - let remotePeerId; - let libp2p; - let remoteLibp2p; - let remoteAddr; - beforeEach(async () => { - [peerId, remotePeerId] = await Promise.all([ - createEd25519PeerId(), - createEd25519PeerId() - ]); - remoteLibp2p = await createLibp2pNode({ - peerId: remotePeerId, - addresses: { - listen: [listenAddr.toString()] - }, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - echo: echo() - } - }); - await remoteLibp2p.start(); - remoteAddr = remoteLibp2p.getMultiaddrs()[0]; - }); - afterEach(async () => { - Sinon.restore(); - if (libp2p != null) { - await libp2p.stop(); - } - if (remoteLibp2p != null) { - await remoteLibp2p.stop(); - } - }); - it('should use the dialer for connecting to a peer', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - await libp2p.peerStore.patch(remotePeerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - const connection = await libp2p.dial(remotePeerId); - expect(connection).to.exist(); - const stream = await connection.newStream(ECHO_PROTOCOL); - expect(stream).to.exist(); - expect(stream).to.have.property('protocol', ECHO_PROTOCOL); - await connection.close(); - }); - it('should close all streams when the connection closes', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - // register some stream handlers to simulate several protocols - await libp2p.handle('/stream-count/1', ({ stream }) => { - void pipe(stream, stream); - }); - await libp2p.handle('/stream-count/2', ({ stream }) => { - void pipe(stream, stream); - }); - await remoteLibp2p.handle('/stream-count/3', ({ stream }) => { - void pipe(stream, stream); - }); - await remoteLibp2p.handle('/stream-count/4', ({ stream }) => { - void pipe(stream, stream); - }); - const connection = await libp2p.dial(remoteLibp2p.getMultiaddrs()); - // Create local to remote streams - const stream = await connection.newStream([ECHO_PROTOCOL, '/other/1.0.0']); - await connection.newStream('/stream-count/3'); - await libp2p.dialProtocol(remoteLibp2p.peerId, '/stream-count/4'); - // Partially write to the echo stream - const source = pushable(); - void stream.sink(source); - source.push(uint8ArrayFromString('hello')); - // Create remote to local streams - await remoteLibp2p.dialProtocol(libp2p.peerId, ['/stream-count/1', '/other/1.0.0']); - await remoteLibp2p.dialProtocol(libp2p.peerId, ['/stream-count/2', '/other/1.0.0']); - // Verify stream count - const remoteConn = remoteLibp2p.getConnections(libp2p.peerId); - if (remoteConn == null) { - throw new Error('No remote connection found'); - } - expect(connection.streams).to.have.length(5); - expect(remoteConn).to.have.lengthOf(1); - expect(remoteConn).to.have.nested.property('[0].streams').with.lengthOf(5); - // Close the connection and verify all streams have been closed - await connection.close(); - await pWaitFor(() => connection.streams.length === 0); - await pWaitFor(() => remoteConn[0].streams.length === 0); - }); - it('should throw when using dialProtocol with no protocols', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - // @ts-expect-error invalid params - await expect(libp2p.dialProtocol(remoteAddr)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.property('code', ErrorCodes.ERR_INVALID_PROTOCOLS_FOR_STREAM); - await expect(libp2p.dialProtocol(remoteAddr, [])) - .to.eventually.be.rejectedWith(Error) - .and.to.have.property('code', ErrorCodes.ERR_INVALID_PROTOCOLS_FOR_STREAM); - }); - it('should be able to use hangup to close connections', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - const connection = await libp2p.dial(remoteAddr); - expect(connection).to.exist(); - expect(connection.timeline.close).to.not.exist(); - await libp2p.hangUp(connection.remotePeer); - expect(connection.timeline.close).to.exist(); - }); - it('should use the protectors when provided for connecting', async () => { - const protector = { - async protect(connection) { - return connection; - } - }; - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionProtector: () => protector - }); - const protectorProtectSpy = Sinon.spy(protector, 'protect'); - await libp2p.start(); - const connection = await libp2p.dial(remoteAddr); - expect(connection).to.exist(); - const stream = await connection.newStream(ECHO_PROTOCOL); - expect(stream).to.exist(); - expect(stream).to.have.property('protocol', ECHO_PROTOCOL); - await connection.close(); - expect(protectorProtectSpy.callCount).to.equal(1); - }); - it('should coalesce parallel dials to the same peer (id in multiaddr)', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - const dials = 10; - // PeerId should be in multiaddr - expect(remoteAddr.getPeerId()).to.equal(remoteLibp2p.peerId.toString()); - await libp2p.peerStore.patch(remotePeerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - const dialResults = await Promise.all([...new Array(dials)].map(async (_, index) => { - if (index % 2 === 0) - return libp2p.dial(remoteLibp2p.peerId); - return libp2p.dial(remoteAddr); - })); - // All should succeed and we should have ten results - expect(dialResults).to.have.length(10); - for (const connection of dialResults) { - expect(isConnection(connection)).to.equal(true); - } - // 1 connection, because we know the peer in the multiaddr - expect(libp2p.getConnections()).to.have.lengthOf(1); - expect(remoteLibp2p.getConnections()).to.have.lengthOf(1); - }); - it('should coalesce parallel dials to the same error on failure', async () => { - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - const dials = 10; - const error = new Error('Boom'); - Sinon.stub(libp2p.components.transportManager, 'dial').callsFake(async () => Promise.reject(error)); - await libp2p.peerStore.patch(remotePeerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - const dialResults = await Promise.allSettled([...new Array(dials)].map(async (_, index) => { - if (index % 2 === 0) - return libp2p.dial(remoteLibp2p.peerId); - return libp2p.dial(remoteAddr); - })); - // All should succeed and we should have ten results - expect(dialResults).to.have.length(10); - for (const result of dialResults) { - // All errors should be the exact same as `error` - expect(result).to.have.property('status', 'rejected'); - expect(result).to.have.property('reason', error); - } - // 1 connection, because we know the peer in the multiaddr - expect(libp2p.getConnections()).to.have.lengthOf(0); - expect(remoteLibp2p.getConnections()).to.have.lengthOf(0); - }); - it('should dial a unix socket', async () => { - if (os.platform() === 'win32') { - return; - } - if (remoteLibp2p != null) { - await remoteLibp2p.stop(); - } - const unixAddr = path.join(os.tmpdir(), `test-${Math.random()}.sock`); - const unixMultiaddr = multiaddr('/unix' + unixAddr); - remoteLibp2p = await createLibp2pNode({ - peerId: remotePeerId, - addresses: { - listen: [ - unixMultiaddr.toString() - ] - }, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await remoteLibp2p.start(); - expect(fs.existsSync(unixAddr)).to.be.true(); - libp2p = await createLibp2pNode({ - peerId, - transports: [ - tcp() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - const connection = await libp2p.dial(unixMultiaddr); - expect(connection.remotePeer.toString()).to.equal(remotePeerId.toString()); - }); -}); -//# sourceMappingURL=direct.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.node.js.map deleted file mode 100644 index e0168e929..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"direct.node.js","sourceRoot":"","sources":["../../../test/connection-manager/direct.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAA6C,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACtG,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACjJ,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,O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AAE,QAAQ,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QACrE,MAAM,aAAa,GAAG,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC,CAAA;QAEnD,YAAY,GAAG,MAAM,gBAAgB,CAAC;YACpC,MAAM,EAAE,YAAY;YACpB,SAAS,EAAE;gBACT,MAAM,EAAE;oBACN,aAAa,CAAC,QAAQ,EAAE;iBACzB;aACF;YACD,UAAU,EAAE;gBACV,GAAG,EAAE;aACN;YACD,YAAY,EAAE;gBACZ,KAAK,EAAE;gBACP,KAAK,EAAE;aACR;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAC,CAAA;QAEF,MAAM,YAAY,CAAC,KAAK,EAAE,CAAA;QAE1B,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QAE5C,MAAM,GAAG,MAAM,gBAAgB,CAAC;YAC9B,MAAM;YACN,UAAU,EAAE;gBACV,GAAG,EAAE;aACN;YACD,YAAY,EAAE;gBACZ,KAAK,EAAE;gBACP,KAAK,EAAE;aACR;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;QAEpB,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QAEnD,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC5E,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.spec.d.ts deleted file mode 100644 index bd766c5f7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=direct.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.spec.d.ts.map deleted file mode 100644 index 45ebfd5e7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"direct.spec.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/direct.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.spec.js deleted file mode 100644 index dd509b936..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.spec.js +++ /dev/null @@ -1,420 +0,0 @@ -/* eslint-env mocha */ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { identify } from '@libp2p/identify'; -import { AbortError, ERR_TIMEOUT } from '@libp2p/interface/errors'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockConnectionGater, mockDuplex, mockMultiaddrConnection, mockUpgrader, mockConnection } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { mplex } from '@libp2p/mplex'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { plaintext } from '@libp2p/plaintext'; -import { defaultAddressSort } from '@libp2p/utils/address-sort'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core/memory'; -import delay from 'delay'; -import pDefer from 'p-defer'; -import { pEvent } from 'p-event'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { defaultComponents } from '../../src/components.js'; -import { LAST_DIAL_FAILURE_KEY } from '../../src/connection-manager/constants.js'; -import { DefaultConnectionManager } from '../../src/connection-manager/index.js'; -import { codes as ErrorCodes } from '../../src/errors.js'; -import { createLibp2p } from '../../src/index.js'; -import { DefaultTransportManager } from '../../src/transport-manager.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -const unsupportedAddr = multiaddr('/ip4/127.0.0.1/tcp/9999'); -const relayMultiaddr = multiaddr(process.env.RELAY_MULTIADDR); -describe('dialing (direct, WebSockets)', () => { - let localTM; - let localComponents; - let remoteAddr; - let remoteComponents; - let connectionManager; - beforeEach(async () => { - const localEvents = new TypedEventEmitter(); - localComponents = defaultComponents({ - peerId: await createEd25519PeerId(), - datastore: new MemoryDatastore(), - upgrader: mockUpgrader({ events: localEvents }), - connectionGater: mockConnectionGater(), - transportManager: stubInterface(), - events: localEvents - }); - localComponents.peerStore = new PersistentPeerStore(localComponents, { - addressFilter: localComponents.connectionGater.filterMultiaddrForPeer - }); - localComponents.connectionManager = new DefaultConnectionManager(localComponents, { - maxConnections: 100, - minConnections: 50, - inboundUpgradeTimeout: 1000 - }); - localTM = new DefaultTransportManager(localComponents); - localTM.add(webSockets({ filter: filters.all })({ - logger: defaultLogger() - })); - localComponents.transportManager = localTM; - // this peer is spun up in .aegir.cjs - remoteAddr = relayMultiaddr; - remoteComponents = defaultComponents({ - peerId: peerIdFromString(remoteAddr.getPeerId() ?? '') - }); - }); - afterEach(async () => { - sinon.restore(); - if (connectionManager != null) { - await connectionManager.stop(); - } - }); - it('should be able to connect to a remote node via its multiaddr', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - const remotePeerId = peerIdFromString(remoteAddr.getPeerId() ?? ''); - await localComponents.peerStore.patch(remotePeerId, { - multiaddrs: [remoteAddr] - }); - const connection = await connectionManager.openConnection(remoteAddr); - expect(connection).to.exist(); - await connection.close(); - }); - it('should fail to connect to an unsupported multiaddr', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - await expect(connectionManager.openConnection(unsupportedAddr.encapsulate(`/p2p/${remoteComponents.peerId.toString()}`))) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('should mark a peer as having recently failed to connect', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - await expect(connectionManager.openConnection(multiaddr(`/ip4/127.0.0.1/tcp/12984/ws/p2p/${remoteComponents.peerId.toString()}`))) - .to.eventually.be.rejected(); - const peer = await localComponents.peerStore.get(remoteComponents.peerId); - expect(peer.metadata.has(LAST_DIAL_FAILURE_KEY)).to.be.true(); - }); - it('should be able to connect to a given peer', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - const remotePeerId = peerIdFromString(remoteAddr.getPeerId() ?? ''); - await localComponents.peerStore.patch(remotePeerId, { - multiaddrs: [remoteAddr] - }); - const connection = await connectionManager.openConnection(remotePeerId); - expect(connection).to.exist(); - await connection.close(); - }); - it('should fail to connect to a given peer with unsupported addresses', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - const remotePeerId = peerIdFromString(remoteAddr.getPeerId() ?? ''); - await localComponents.peerStore.patch(remotePeerId, { - multiaddrs: [unsupportedAddr] - }); - await expect(connectionManager.openConnection(remotePeerId)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('should abort dials on queue task timeout', async () => { - connectionManager = new DefaultConnectionManager(localComponents, { - dialTimeout: 50 - }); - await connectionManager.start(); - const remotePeerId = peerIdFromString(remoteAddr.getPeerId() ?? ''); - await localComponents.peerStore.patch(remotePeerId, { - multiaddrs: [remoteAddr] - }); - sinon.stub(localTM, 'dial').callsFake(async (addr, options) => { - expect(options.signal).to.exist(); - expect(options.signal.aborted).to.equal(false); - expect(addr.toString()).to.eql(remoteAddr.toString()); - await delay(60); - expect(options.signal.aborted).to.equal(true); - throw new AbortError(); - }); - await expect(connectionManager.openConnection(remoteAddr)) - .to.eventually.be.rejected() - .and.to.have.property('code', ERR_TIMEOUT); - }); - it('should throw when a peer advertises more than the allowed number of addresses', async () => { - connectionManager = new DefaultConnectionManager(localComponents, { - maxPeerAddrsToDial: 10 - }); - await connectionManager.start(); - const remotePeerId = peerIdFromString(remoteAddr.getPeerId() ?? ''); - await localComponents.peerStore.patch(remotePeerId, { - multiaddrs: Array.from({ length: 11 }, (_, i) => multiaddr(`/ip4/127.0.0.1/tcp/1500${i}/ws/p2p/${remotePeerId.toString()}`)) - }); - await expect(connectionManager.openConnection(remotePeerId)) - .to.eventually.be.rejected() - .and.to.have.property('code', ErrorCodes.ERR_TOO_MANY_ADDRESSES); - }); - it('should sort addresses on dial', async () => { - const peerMultiaddrs = [ - multiaddr('/ip4/127.0.0.1/tcp/15001/ws'), - multiaddr('/ip4/20.0.0.1/tcp/15001/ws'), - multiaddr('/ip4/30.0.0.1/tcp/15001/ws') - ]; - const addressesSorttSpy = sinon.spy(defaultAddressSort); - const localTMDialStub = sinon.stub(localTM, 'dial').callsFake(async (ma) => mockConnection(mockMultiaddrConnection(mockDuplex(), remoteComponents.peerId))); - connectionManager = new DefaultConnectionManager(localComponents, { - addressSorter: addressesSorttSpy, - maxParallelDials: 3 - }); - await connectionManager.start(); - // Inject data into the AddressBook - await localComponents.peerStore.merge(remoteComponents.peerId, { - multiaddrs: peerMultiaddrs - }); - // Perform 3 multiaddr dials - await connectionManager.openConnection(remoteComponents.peerId); - const sortedAddresses = peerMultiaddrs - .map((m) => ({ multiaddr: m, isCertified: false })) - .sort(defaultAddressSort); - expect(localTMDialStub.getCall(0).args[0].equals(sortedAddresses[0].multiaddr)); - }); - it('shutting down should abort pending dials', async () => { - const addrs = [ - multiaddr('/ip4/0.0.0.0/tcp/8000/ws'), - multiaddr('/ip4/0.0.0.0/tcp/8001/ws'), - multiaddr('/ip4/0.0.0.0/tcp/8002/ws') - ]; - connectionManager = new DefaultConnectionManager(localComponents, { - maxParallelDials: 2 - }); - await connectionManager.start(); - // Inject data into the AddressBook - await localComponents.peerStore.merge(remoteComponents.peerId, { - multiaddrs: addrs - }); - sinon.stub(localTM, 'dial').callsFake(async (_, options) => { - const deferredDial = pDefer(); - const onAbort = () => { - options.signal.removeEventListener('abort', onAbort); - deferredDial.reject(new AbortError()); - }; - options.signal.addEventListener('abort', onAbort); - return deferredDial.promise; - }); - // Perform 3 multiaddr dials - const dialPromise = connectionManager.openConnection(remoteComponents.peerId); - // Let the call stack run - await delay(0); - try { - await connectionManager.stop(); - await dialPromise; - expect.fail('should have failed'); - } - catch { - expect(connectionManager.getDialQueue()).to.have.lengthOf(0); // 0 dial requests - } - }); - it('should dial only the multiaddr that is passed', async () => { - const addrs = [ - multiaddr(`/ip4/0.0.0.0/tcp/8000/ws/p2p/${remoteComponents.peerId.toString()}`), - multiaddr(`/ip4/0.0.0.0/tcp/8001/ws/p2p/${remoteComponents.peerId.toString()}`), - multiaddr(`/ip4/0.0.0.0/tcp/8002/ws/p2p/${remoteComponents.peerId.toString()}`) - ]; - // Inject data into the AddressBook - await localComponents.peerStore.merge(remoteComponents.peerId, { - multiaddrs: addrs - }); - // different address not in the address book, same peer id - const dialMultiaddr = multiaddr(`/ip4/0.0.0.0/tcp/8003/ws/p2p/${remoteComponents.peerId.toString()}`); - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - const transactionManagerDialStub = sinon.stub(localTM, 'dial'); - transactionManagerDialStub.callsFake(async (ma) => mockConnection(mockMultiaddrConnection(mockDuplex(), remoteComponents.peerId))); - // Perform dial - await connectionManager.openConnection(dialMultiaddr); - expect(transactionManagerDialStub).to.have.property('callCount', 1); - expect(transactionManagerDialStub.getCall(0).args[0].toString()).to.equal(dialMultiaddr.toString()); - }); - it('should throw if dialling an empty array is attempted', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - // Perform dial - await expect(connectionManager.openConnection([])).to.eventually.rejected - .with.property('code', 'ERR_NO_VALID_ADDRESSES'); - }); - it('should throw if dialling multiaddrs with mismatched peer ids', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - // Perform dial - await expect(connectionManager.openConnection([ - multiaddr(`/ip4/0.0.0.0/tcp/8000/ws/p2p/${(await createPeerId()).toString()}`), - multiaddr(`/ip4/0.0.0.0/tcp/8001/ws/p2p/${(await createPeerId()).toString()}`) - ])).to.eventually.rejected - .with.property('code', 'ERR_INVALID_PARAMETERS'); - }); - it('should throw if dialling multiaddrs with inconsistent peer ids', async () => { - connectionManager = new DefaultConnectionManager(localComponents); - await connectionManager.start(); - // Perform dial - await expect(connectionManager.openConnection([ - multiaddr(`/ip4/0.0.0.0/tcp/8000/ws/p2p/${(await createPeerId()).toString()}`), - multiaddr('/ip4/0.0.0.0/tcp/8001/ws') - ])).to.eventually.rejected - .with.property('code', 'ERR_INVALID_PARAMETERS'); - // Perform dial - await expect(connectionManager.openConnection([ - multiaddr('/ip4/0.0.0.0/tcp/8001/ws'), - multiaddr(`/ip4/0.0.0.0/tcp/8000/ws/p2p/${(await createPeerId()).toString()}`) - ])).to.eventually.rejected - .with.property('code', 'ERR_INVALID_PARAMETERS'); - }); -}); -describe('libp2p.dialer (direct, WebSockets)', () => { - let libp2p; - let peerId; - beforeEach(async () => { - peerId = await createPeerId(); - }); - afterEach(async () => { - sinon.restore(); - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('should run identify automatically after connecting', async () => { - libp2p = await createLibp2p({ - peerId, - transports: [ - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - identify: identify() - }, - connectionGater: mockConnectionGater() - }); - if (libp2p.services.identify == null) { - throw new Error('Identify service missing'); - } - const identifySpy = sinon.spy(libp2p.services.identify, 'identify'); - const peerStorePatchSpy = sinon.spy(libp2p.peerStore, 'patch'); - const connectionPromise = pEvent(libp2p, 'connection:open'); - await libp2p.start(); - const connection = await libp2p.dial(relayMultiaddr); - expect(connection).to.exist(); - // Wait for connection event to be emitted - await connectionPromise; - expect(identifySpy.callCount).to.equal(1); - await identifySpy.firstCall.returnValue; - expect(peerStorePatchSpy.callCount).to.equal(1); - await libp2p.stop(); - }); - it('should not run identify automatically after connecting', async () => { - libp2p = await createLibp2p({ - peerId, - transports: [ - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - plaintext() - ], - services: { - identify: identify({ - runOnConnectionOpen: false - }) - }, - connectionGater: mockConnectionGater() - }); - if (libp2p.services.identify == null) { - throw new Error('Identify service missing'); - } - const identifySpy = sinon.spy(libp2p.services.identify, 'identify'); - const connectionPromise = pEvent(libp2p, 'connection:open'); - await libp2p.start(); - const connection = await libp2p.dial(relayMultiaddr); - expect(connection).to.exist(); - // Wait for connection event to be emitted - await connectionPromise; - expect(identifySpy.callCount).to.equal(0); - await libp2p.stop(); - }); - it('should be able to use hangup to close connections', async () => { - libp2p = await createLibp2p({ - peerId, - transports: [ - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }); - await libp2p.start(); - const connection = await libp2p.dial(relayMultiaddr); - expect(connection).to.exist(); - expect(connection.timeline.close).to.not.exist(); - await libp2p.hangUp(connection.remotePeer); - expect(connection.timeline.close).to.exist(); - await libp2p.stop(); - }); - it('should be able to use hangup when no connection exists', async () => { - libp2p = await createLibp2p({ - peerId, - transports: [ - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }); - await libp2p.hangUp(relayMultiaddr); - }); - it('should fail to dial self', async () => { - libp2p = await createLibp2p({ - peerId, - transports: [ - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }); - await libp2p.start(); - await expect(libp2p.dial(multiaddr(`/ip4/127.0.0.1/tcp/1234/ws/p2p/${peerId.toString()}`))) - .to.eventually.be.rejected() - .and.to.have.property('code', ErrorCodes.ERR_DIALED_SELF); - }); -}); -//# sourceMappingURL=direct.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.spec.js.map deleted file mode 100644 index 527cd2c3d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/direct.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"direct.spec.js","sourceRoot":"","sources":["../../../test/connection-manager/direct.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAiB,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,uBAAuB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAA;AACjJ,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAA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EAAE,mBAAmB,EAAE;SACvC,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;QACxC,MAAM,GAAG,MAAM,YAAY,CAAC;YAC1B,MAAM;YACN,UAAU,EAAE;gBACV,UAAU,CAAC;oBACT,MAAM,EAAE,OAAO,CAAC,GAAG;iBACpB,CAAC;aACH;YACD,YAAY,EAAE;gBACZ,KAAK,EAAE;gBACP,KAAK,EAAE;aACR;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;YACD,eAAe,EAAE,mBAAmB,EAAE;SACvC,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;QAEpB,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,kCAAkC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;aACxF,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE;aAC3B,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,eAAe,CAAC,CAAA;IAC7D,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.node.d.ts deleted file mode 100644 index 95867294f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.node.d.ts.map deleted file mode 100644 index 5b7c5c52c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/index.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.node.js deleted file mode 100644 index 7bdc7f4d0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.node.js +++ /dev/null @@ -1,540 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { start } from '@libp2p/interface/startable'; -import { mockConnection, mockDuplex, mockMultiaddrConnection } from '@libp2p/interface-compliance-tests/mocks'; -import { expect } from 'aegir/chai'; -import delay from 'delay'; -import all from 'it-all'; -import { pipe } from 'it-pipe'; -import pWaitFor from 'p-wait-for'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { defaultComponents } from '../../src/components.js'; -import { DefaultConnectionManager } from '../../src/connection-manager/index.js'; -import { codes } from '../../src/errors.js'; -import { createBaseOptions } from '../fixtures/base-options.browser.js'; -import { createNode, createPeerId } from '../fixtures/creators/peer.js'; -import { ECHO_PROTOCOL, echo } from '../fixtures/echo-service.js'; -describe('Connection Manager', () => { - let libp2p; - let peerIds; - before(async () => { - peerIds = await Promise.all([ - createPeerId(), - createPeerId() - ]); - }); - beforeEach(async () => { - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - } - }) - }); - }); - afterEach(async () => { - await libp2p.stop(); - }); - it('should filter connections on disconnect, removing the closed one', async () => { - const peerStore = stubInterface(); - const components = defaultComponents({ - peerId: peerIds[0], - peerStore, - transportManager: stubInterface(), - connectionGater: stubInterface(), - events: new TypedEventEmitter() - }); - const connectionManager = new DefaultConnectionManager(components, { - maxConnections: 1000, - minConnections: 50, - inboundUpgradeTimeout: 1000 - }); - await start(connectionManager); - const conn1 = mockConnection(mockMultiaddrConnection(mockDuplex(), peerIds[1])); - const conn2 = mockConnection(mockMultiaddrConnection(mockDuplex(), peerIds[1])); - expect(connectionManager.getConnections(peerIds[1])).to.have.lengthOf(0); - // Add connection to the connectionManager - components.events.safeDispatchEvent('connection:open', { detail: conn1 }); - components.events.safeDispatchEvent('connection:open', { detail: conn2 }); - expect(connectionManager.getConnections(peerIds[1])).to.have.lengthOf(2); - await conn2.close(); - components.events.safeDispatchEvent('connection:close', { detail: conn2 }); - expect(connectionManager.getConnections(peerIds[1])).to.have.lengthOf(1); - expect(conn1).to.have.nested.property('status', 'open'); - await connectionManager.stop(); - }); - it('should close connections on stop', async () => { - const peerStore = stubInterface(); - const components = defaultComponents({ - peerId: peerIds[0], - peerStore, - transportManager: stubInterface(), - connectionGater: stubInterface(), - events: new TypedEventEmitter() - }); - const connectionManager = new DefaultConnectionManager(components, { - maxConnections: 1000, - minConnections: 50, - inboundUpgradeTimeout: 1000 - }); - await start(connectionManager); - const conn1 = mockConnection(mockMultiaddrConnection(mockDuplex(), peerIds[1])); - const conn2 = mockConnection(mockMultiaddrConnection(mockDuplex(), peerIds[1])); - // Add connection to the connectionManager - components.events.safeDispatchEvent('connection:open', { detail: conn1 }); - components.events.safeDispatchEvent('connection:open', { detail: conn2 }); - expect(connectionManager.getConnections(peerIds[1])).to.have.lengthOf(2); - await connectionManager.stop(); - expect(connectionManager.getConnections(peerIds[1])).to.have.lengthOf(0); - }); -}); -describe('libp2p.connections', () => { - let peerIds; - let libp2p; - before(async () => { - peerIds = await Promise.all([ - createPeerId(), - createPeerId() - ]); - }); - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('libp2p.connections gets the connectionManager conns', async () => { - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/15003/ws'] - } - }) - }); - const remoteLibp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[1], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/15004/ws'] - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - const conn = await libp2p.dial(remoteLibp2p.peerId); - expect(conn).to.be.ok(); - expect(libp2p.getConnections()).to.have.lengthOf(1); - await libp2p.stop(); - await remoteLibp2p.stop(); - }); - describe('proactive connections', () => { - let libp2p; - let nodes = []; - beforeEach(async () => { - nodes = await Promise.all([ - createNode({ - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - } - } - }), - createNode({ - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - } - } - }) - ]); - }); - afterEach(async () => { - await Promise.all(nodes.map(async (node) => { await node.stop(); })); - if (libp2p != null) { - await libp2p.stop(); - } - sinon.reset(); - }); - it('should connect to all the peers stored in the PeerStore, if their number is below minConnections', async () => { - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionManager: { - minConnections: 3 - } - } - }); - // Populate PeerStore before starting - await libp2p.peerStore.patch(nodes[0].peerId, { - multiaddrs: nodes[0].getMultiaddrs() - }); - await libp2p.peerStore.patch(nodes[1].peerId, { - multiaddrs: nodes[1].getMultiaddrs() - }); - await libp2p.start(); - // Wait for peers to connect - await pWaitFor(() => libp2p.getConnections().length === 2); - await libp2p.stop(); - }); - it('should connect to all the peers stored in the PeerStore until reaching the minConnections', async () => { - const minConnections = 1; - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionManager: { - minConnections, - maxConnections: 1 - } - } - }); - // Populate PeerStore before starting - await libp2p.peerStore.patch(nodes[0].peerId, { - multiaddrs: nodes[0].getMultiaddrs() - }); - await libp2p.peerStore.patch(nodes[1].peerId, { - multiaddrs: nodes[1].getMultiaddrs() - }); - await libp2p.start(); - // Wait for peer to connect - await pWaitFor(() => libp2p.components.connectionManager.getConnections().length === minConnections); - // Wait more time to guarantee no other connection happened - await delay(200); - expect(libp2p.components.connectionManager.getConnections().length).to.eql(minConnections); - await libp2p.stop(); - }); - // flaky - it.skip('should connect to all the peers stored in the PeerStore until reaching the minConnections sorted', async () => { - const minConnections = 1; - libp2p = await createNode({ - started: false, - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionManager: { - minConnections, - maxConnections: 1 - } - } - }); - // Populate PeerStore before starting - await libp2p.peerStore.patch(nodes[0].peerId, { - multiaddrs: nodes[0].getMultiaddrs() - }); - await libp2p.peerStore.patch(nodes[1].peerId, { - multiaddrs: nodes[1].getMultiaddrs(), - protocols: ['/protocol-min-conns'] - }); - await libp2p.start(); - // Wait for peer to connect - await pWaitFor(() => libp2p.components.connectionManager.getConnections().length === minConnections); - // Should have connected to the peer with protocols - expect(libp2p.components.connectionManager.getConnections(nodes[0].peerId)).to.be.empty(); - expect(libp2p.components.connectionManager.getConnections(nodes[1].peerId)).to.not.be.empty(); - await libp2p.stop(); - }); - it('should connect to peers in the PeerStore when a peer disconnected', async () => { - const minConnections = 1; - libp2p = await createNode({ - config: { - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionManager: { - minConnections - } - } - }); - // Populate PeerStore after starting (discovery) - await libp2p.peerStore.patch(nodes[0].peerId, { - multiaddrs: nodes[0].getMultiaddrs() - }); - // Wait for peer to connect - const conn = await libp2p.dial(nodes[0].peerId); - expect(libp2p.components.connectionManager.getConnections(nodes[0].peerId)).to.not.be.empty(); - await conn.close(); - // Closed - await pWaitFor(() => libp2p.components.connectionManager.getConnections().length === 0); - // Connected - await pWaitFor(() => libp2p.components.connectionManager.getConnections().length === 1); - expect(libp2p.components.connectionManager.getConnections(nodes[0].peerId)).to.not.be.empty(); - await libp2p.stop(); - }); - it('should be closed status once immediately stopping', async () => { - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/15003/ws'] - } - }) - }); - const remoteLibp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[1], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/15004/ws'] - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - await libp2p.dial(remoteLibp2p.peerId); - const conns = libp2p.components.connectionManager.getConnections(); - expect(conns.length).to.eql(1); - const conn = conns[0]; - await libp2p.stop(); - expect(conn.status).to.eql('closed'); - await remoteLibp2p.stop(); - }); - it('should open multiple connections when forced', async () => { - libp2p = await createNode({ - config: createBaseOptions({ - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - } - }) - }); - // connect once, should have one connection - await libp2p.components.connectionManager.openConnection(nodes[0].getMultiaddrs()); - expect(libp2p.components.connectionManager.getConnections()).to.have.lengthOf(1); - // connect twice, should still only have one connection - await libp2p.components.connectionManager.openConnection(nodes[0].getMultiaddrs(), { - force: false - }); - expect(libp2p.components.connectionManager.getConnections()).to.have.lengthOf(1); - // force connection, should have two connections now - await libp2p.components.connectionManager.openConnection(nodes[0].getMultiaddrs(), { - force: true - }); - expect(libp2p.components.connectionManager.getConnections()).to.have.lengthOf(2); - }); - }); - describe('connection gater', () => { - let libp2p; - let remoteLibp2p; - beforeEach(async () => { - remoteLibp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[1], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - services: { - echo: echo() - } - }) - }); - }); - afterEach(async () => { - if (remoteLibp2p != null) { - await remoteLibp2p.stop(); - } - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('intercept peer dial', async () => { - const denyDialPeer = sinon.stub().returns(true); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyDialPeer - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - await expect(libp2p.dial(remoteLibp2p.peerId)) - .to.eventually.be.rejected().with.property('code', codes.ERR_PEER_DIAL_INTERCEPTED); - }); - it('intercept addr dial', async () => { - const denyDialMultiaddr = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyDialMultiaddr - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - await libp2p.components.connectionManager.openConnection(remoteLibp2p.peerId); - for (const multiaddr of remoteLibp2p.getMultiaddrs()) { - expect(denyDialMultiaddr.calledWith(multiaddr)).to.be.true(); - } - }); - it('intercept multiaddr store', async () => { - const filterMultiaddrForPeer = sinon.stub().returns(true); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - filterMultiaddrForPeer - } - }) - }); - const fullMultiaddr = remoteLibp2p.getMultiaddrs()[0]; - await libp2p.peerStore.merge(remoteLibp2p.peerId, { - multiaddrs: [fullMultiaddr] - }); - expect(filterMultiaddrForPeer.callCount).to.equal(1); - const args = filterMultiaddrForPeer.getCall(0).args; - expect(args[0].toString()).to.equal(remoteLibp2p.peerId.toString()); - expect(args[1].toString()).to.equal(fullMultiaddr.toString()); - }); - it('intercept accept inbound connection', async () => { - const denyInboundConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyInboundConnection - } - }) - }); - await remoteLibp2p.peerStore.patch(libp2p.peerId, { - multiaddrs: libp2p.getMultiaddrs() - }); - await remoteLibp2p.dial(libp2p.peerId); - expect(denyInboundConnection.called).to.be.true(); - }); - it('intercept accept outbound connection', async () => { - const denyOutboundConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyOutboundConnection - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - await libp2p.dial(remoteLibp2p.peerId); - expect(denyOutboundConnection.called).to.be.true(); - }); - it('intercept inbound encrypted', async () => { - const denyInboundEncryptedConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyInboundEncryptedConnection - } - }) - }); - await remoteLibp2p.peerStore.patch(libp2p.peerId, { - multiaddrs: libp2p.getMultiaddrs() - }); - await remoteLibp2p.dial(libp2p.peerId); - expect(denyInboundEncryptedConnection.called).to.be.true(); - expect(denyInboundEncryptedConnection.getCall(0)).to.have.nested.property('args[0].multihash.digest').that.equalBytes(remoteLibp2p.peerId.multihash.digest); - }); - it('intercept outbound encrypted', async () => { - const denyOutboundEncryptedConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyOutboundEncryptedConnection - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - await libp2p.dial(remoteLibp2p.peerId); - expect(denyOutboundEncryptedConnection.called).to.be.true(); - expect(denyOutboundEncryptedConnection.getCall(0)).to.have.nested.property('args[0].multihash.digest').that.equalBytes(remoteLibp2p.peerId.multihash.digest); - }); - it('intercept inbound upgraded', async () => { - const denyInboundUpgradedConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyInboundUpgradedConnection - }, - services: { - echo: echo() - } - }) - }); - await remoteLibp2p.peerStore.patch(libp2p.peerId, { - multiaddrs: libp2p.getMultiaddrs() - }); - const connection = await remoteLibp2p.dial(libp2p.peerId); - const stream = await connection.newStream(ECHO_PROTOCOL); - const input = [Uint8Array.from([0])]; - const output = await pipe(input, stream, async (source) => all(source)); - expect(denyInboundUpgradedConnection.called).to.be.true(); - expect(denyInboundUpgradedConnection.getCall(0)).to.have.nested.property('args[0].multihash.digest').that.equalBytes(remoteLibp2p.peerId.multihash.digest); - expect(output.map(b => b.subarray())).to.deep.equal(input); - }); - it('intercept outbound upgraded', async () => { - const denyOutboundUpgradedConnection = sinon.stub().returns(false); - libp2p = await createNode({ - config: createBaseOptions({ - peerId: peerIds[0], - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0/ws'] - }, - connectionGater: { - denyOutboundUpgradedConnection - } - }) - }); - await libp2p.peerStore.patch(remoteLibp2p.peerId, { - multiaddrs: remoteLibp2p.getMultiaddrs() - }); - const connection = await libp2p.dial(remoteLibp2p.peerId); - const stream = await connection.newStream(ECHO_PROTOCOL); - const input = [Uint8Array.from([0])]; - const output = await pipe(input, stream, async (source) => all(source)); - expect(denyOutboundUpgradedConnection.called).to.be.true(); - expect(denyOutboundUpgradedConnection.getCall(0)).to.have.nested.property('args[0].multihash.digest').that.equalBytes(remoteLibp2p.peerId.multihash.digest); - expect(output.map(b => b.subarray())).to.deep.equal(input); - }); - }); -}); -//# sourceMappingURL=index.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.node.js.map deleted file mode 100644 index 1d96b5d8e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.node.js","sourceRoot":"","sources":["../../../test/connection-manager/index.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAA;AAC9G,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,GAAG,MAAM,QAAQ,CAAA;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAA;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAQjE,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,IAAI,MAAc,CAAA;IAClB,IAAI,OAAiB,CAAA;IAErB,MAAM,CAAC,KAAK,IAAI,EAAE;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ACH,CAAC,CAAA;YACF,MAAM,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE;gBAChD,UAAU,EAAE,YAAY,CAAC,aAAa,EAAE;aACzC,CAAC,CAAA;YACF,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;YACzD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;YACxD,MAAM,KAAK,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACpC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;YAEvE,MAAM,CAAC,8BAA8B,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;YAC1D,MAAM,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;YAC3J,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAC5D,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.spec.d.ts deleted file mode 100644 index b37c2d278..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.spec.d.ts.map deleted file mode 100644 index 2ed10ac80..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/index.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.spec.js deleted file mode 100644 index 3a90b5750..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.spec.js +++ /dev/null @@ -1,445 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { KEEP_ALIVE } from '@libp2p/interface/peer-store/tags'; -import { mockConnection, mockDuplex, mockMultiaddrConnection, mockMetrics } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { pEvent } from 'p-event'; -import pWaitFor from 'p-wait-for'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { DefaultConnectionManager } from '../../src/connection-manager/index.js'; -import { createBaseOptions } from '../fixtures/base-options.browser.js'; -import { createNode } from '../fixtures/creators/peer.js'; -const defaultOptions = { - maxConnections: 10, - minConnections: 1, - autoDialInterval: Infinity, - inboundUpgradeTimeout: 10000 -}; -function defaultComponents(peerId) { - return { - peerId, - peerStore: stubInterface(), - transportManager: stubInterface(), - connectionGater: stubInterface(), - events: new TypedEventEmitter(), - logger: defaultLogger() - }; -} -describe('Connection Manager', () => { - let libp2p; - let connectionManager; - afterEach(async () => { - sinon.restore(); - if (connectionManager != null) { - await connectionManager.stop(); - } - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('should be able to create without metrics', async () => { - libp2p = await createNode({ - config: createBaseOptions(), - started: false - }); - const spy = sinon.spy(libp2p.components.connectionManager, 'start'); - await libp2p.start(); - expect(spy).to.have.property('callCount', 1); - expect(libp2p.metrics).to.not.exist(); - }); - it('should be able to create with metrics', async () => { - libp2p = await createNode({ - config: createBaseOptions({ - metrics: mockMetrics() - }), - started: false - }); - const spy = sinon.spy(libp2p.components.connectionManager, 'start'); - await libp2p.start(); - expect(spy).to.have.property('callCount', 1); - expect(libp2p.metrics).to.exist(); - }); - it('should close connections with low tag values first', async () => { - const max = 5; - libp2p = await createNode({ - config: createBaseOptions({ - connectionManager: { - maxConnections: max, - minConnections: 2 - } - }), - started: false - }); - await libp2p.start(); - const connectionManager = libp2p.components.connectionManager; - const connectionManagerMaybePruneConnectionsSpy = sinon.spy(connectionManager.connectionPruner, 'maybePruneConnections'); - const spies = new Map(); - // wait for prune event - const eventPromise = pEvent(libp2p, 'connection:prune'); - // Add 1 connection too many - for (let i = 0; i < max + 1; i++) { - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), await createEd25519PeerId())); - const spy = sinon.spy(connection, 'close'); - const value = i * 10; - spies.set(value, spy); - await libp2p.peerStore.merge(connection.remotePeer, { - tags: { - 'test-tag': { - value - } - } - }); - libp2p.components.events.safeDispatchEvent('connection:open', { detail: connection }); - } - await eventPromise; - // get the lowest value - const lowest = Array.from(spies.keys()).sort((a, b) => { - if (a > b) { - return 1; - } - if (a < b) { - return -1; - } - return 0; - })[0]; - const lowestSpy = spies.get(lowest); - expect(connectionManagerMaybePruneConnectionsSpy.callCount).to.equal(6); - expect(lowestSpy).to.have.property('callCount', 1); - }); - it('should close shortest-lived connection if the tag values are equal', async () => { - const max = 5; - libp2p = await createNode({ - config: createBaseOptions({ - connectionManager: { - maxConnections: max, - minConnections: 2 - } - }), - started: false - }); - await libp2p.start(); - const connectionManager = libp2p.components.connectionManager; - const connectionManagerMaybePruneConnectionsSpy = sinon.spy(connectionManager.connectionPruner, 'maybePruneConnections'); - const spies = new Map(); - const eventPromise = pEvent(libp2p, 'connection:prune'); - const createConnection = async (value, open = Date.now(), peerTag = 'test-tag') => { - // #TODO: Mock the connection timeline to simulate an older connection - const connection = mockConnection(mockMultiaddrConnection({ ...mockDuplex(), timeline: { open } }, await createEd25519PeerId())); - const spy = sinon.spy(connection, 'close'); - // The lowest tag value will have the longest connection - spies.set(peerTag, spy); - await libp2p.peerStore.merge(connection.remotePeer, { - tags: { - [peerTag]: { - value - } - } - }); - libp2p.components.events.safeDispatchEvent('connection:open', { detail: connection }); - }; - // Create one short of enough connections to initiate pruning - for (let i = 1; i < max; i++) { - const value = i * 10; - await createConnection(value); - } - const value = 0 * 10; - // Add a connection with the lowest tag value BUT the longest lived connection - await createConnection(value, 18000, 'longest'); - // Add one more connection with the lowest tag value BUT the shortest-lived connection - await createConnection(value, Date.now(), 'shortest'); - // wait for prune event - await eventPromise; - // get the lowest tagged value, but this would be also the longest lived connection - const longestLivedWithLowestTagSpy = spies.get('longest'); - // Get lowest tagged connection but with a shorter-lived connection - const shortestLivedWithLowestTagSpy = spies.get('shortest'); - expect(connectionManagerMaybePruneConnectionsSpy.callCount).to.equal(6); - expect(longestLivedWithLowestTagSpy).to.have.property('callCount', 0); - expect(shortestLivedWithLowestTagSpy).to.have.property('callCount', 1); - }); - it('should not close connection that is on the allowlist when pruning', async () => { - const max = 2; - const remoteAddr = multiaddr('/ip4/83.13.55.32/tcp/59283'); - libp2p = await createNode({ - config: createBaseOptions({ - connectionManager: { - maxConnections: max, - minConnections: 0, - allow: [ - '/ip4/83.13.55.32' - ] - } - }), - started: false - }); - await libp2p.start(); - const connectionManager = libp2p.components.connectionManager; - const connectionManagerMaybePruneConnectionsSpy = sinon.spy(connectionManager.connectionPruner, 'maybePruneConnections'); - const spies = new Map(); - const eventPromise = pEvent(libp2p, 'connection:prune'); - // Max out connections - for (let i = 0; i < max; i++) { - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), await createEd25519PeerId())); - const spy = sinon.spy(connection, 'close'); - const value = (i + 1) * 10; - spies.set(value, spy); - await libp2p.peerStore.merge(connection.remotePeer, { - tags: { - 'test-tag': { - value - } - } - }); - libp2p.components.events.safeDispatchEvent('connection:open', { detail: connection }); - } - // an outbound connection is opened from an address in the allow list - const remotePeer = await createEd25519PeerId(); - const connection = mockConnection(mockMultiaddrConnection({ - remoteAddr, - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, remotePeer)); - const value = 0; - const spy = sinon.spy(connection, 'close'); - spies.set(value, spy); - // Tag that allowed peer with lowest value - await libp2p.peerStore.merge(connection.remotePeer, { - tags: { - 'test-tag': { - value - } - } - }); - libp2p.components.events.safeDispatchEvent('connection:open', { detail: connection }); - // wait for prune event - await eventPromise; - // get the lowest value - const lowest = Array.from(spies.keys()).sort((a, b) => { - if (a > b) { - return 1; - } - if (a < b) { - return -1; - } - return 0; - })[0]; - const lowestSpy = spies.get(lowest); - expect(connectionManagerMaybePruneConnectionsSpy.callCount).to.equal(3); - // expect lowest value spy NOT to be called since the peer is in the allow list - expect(lowestSpy).to.have.property('callCount', 0); - }); - it('should close connection when the maximum connections has been reached even without tags', async () => { - const max = 5; - libp2p = await createNode({ - config: createBaseOptions({ - connectionManager: { - maxConnections: max, - minConnections: 0 - } - }), - started: false - }); - await libp2p.start(); - const connectionManager = libp2p.components.connectionManager; - const connectionManagerMaybePruneConnectionsSpy = sinon.spy(connectionManager.connectionPruner, 'maybePruneConnections'); - const eventPromise = pEvent(libp2p, 'connection:prune'); - // Add 1 too many connections - const spy = sinon.spy(); - for (let i = 0; i < max + 1; i++) { - const connection = mockConnection(mockMultiaddrConnection(mockDuplex(), await createEd25519PeerId())); - sinon.stub(connection, 'close').callsFake(async () => spy()); // eslint-disable-line - libp2p.components.events.safeDispatchEvent('connection:open', { detail: connection }); - } - // wait for prune event - await eventPromise; - expect(connectionManagerMaybePruneConnectionsSpy.callCount).to.equal(6); - expect(spy).to.have.property('callCount', 1); - }); - it('should fail if the connection manager has mismatched connection limit options', async () => { - await expect(createNode({ - config: createBaseOptions({ - connectionManager: { - maxConnections: 5, - minConnections: 6 - } - }), - started: false - })).to.eventually.rejected('maxConnections must be greater'); - }); - it('should reconnect to important peers on startup', async () => { - const peerId = await createEd25519PeerId(); - libp2p = await createNode({ - config: createBaseOptions(), - started: false - }); - const connectionManager = libp2p.components.connectionManager; - const connectionManagerOpenConnectionSpy = sinon.spy(connectionManager, 'openConnection'); - await libp2p.start(); - expect(connectionManagerOpenConnectionSpy.called).to.be.false('Attempted to connect to peers'); - await libp2p.peerStore.merge(peerId, { - tags: { - [KEEP_ALIVE]: {} - } - }); - await libp2p.stop(); - await libp2p.start(); - await pWaitFor(() => connectionManagerOpenConnectionSpy.called, { - interval: 100 - }); - expect(connectionManagerOpenConnectionSpy.called).to.be.true('Did not attempt to connect to important peer'); - expect(connectionManagerOpenConnectionSpy.getCall(0).args[0].toString()).to.equal(peerId.toString(), 'Attempted to connect to the wrong peer'); - }); - it('should deny connections from denylist multiaddrs', async () => { - const remoteAddr = multiaddr('/ip4/83.13.55.32/tcp/59283'); - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - deny: [ - '/ip4/83.13.55.32' - ] - }); - await connectionManager.start(); - const remotePeer = await createEd25519PeerId(); - const maConn = mockMultiaddrConnection({ - remoteAddr, - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, remotePeer); - await expect(connectionManager.acceptIncomingConnection(maConn)) - .to.eventually.be.false(); - }); - it('should deny connections when maxConnections is exceeded', async () => { - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - maxConnections: 1 - }); - await connectionManager.start(); - sinon.stub(connectionManager.dialQueue, 'dial').resolves(stubInterface()); - // max out the connection limit - await connectionManager.openConnection(await createEd25519PeerId()); - expect(connectionManager.getConnections()).to.have.lengthOf(1); - // an inbound connection is opened - const remotePeer = await createEd25519PeerId(); - const maConn = mockMultiaddrConnection({ - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, remotePeer); - await expect(connectionManager.acceptIncomingConnection(maConn)) - .to.eventually.be.false(); - }); - it('should deny connections from peers that connect too frequently', async () => { - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - inboundConnectionThreshold: 1 - }); - await connectionManager.start(); - sinon.stub(connectionManager.dialQueue, 'dial').resolves(stubInterface()); - // an inbound connection is opened - const remotePeer = await createEd25519PeerId(); - const maConn = mockMultiaddrConnection({ - source: (async function* () { - yield* []; - })(), - sink: async () => { }, - // has to be thin waist, which it will be since we've not done the peer id handshake - // yet in the code being exercised by this test - remoteAddr: multiaddr('/ip4/34.4.63.125/tcp/4001') - }, remotePeer); - await expect(connectionManager.acceptIncomingConnection(maConn)) - .to.eventually.be.true(); - // connect again within a second - await expect(connectionManager.acceptIncomingConnection(maConn)) - .to.eventually.be.false(); - }); - it('should allow connections from allowlist multiaddrs', async () => { - const remoteAddr = multiaddr('/ip4/83.13.55.32/tcp/59283'); - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - maxConnections: 1, - allow: [ - '/ip4/83.13.55.32' - ] - }); - await connectionManager.start(); - sinon.stub(connectionManager.dialQueue, 'dial').resolves(stubInterface()); - // max out the connection limit - await connectionManager.openConnection(await createEd25519PeerId()); - expect(connectionManager.getConnections()).to.have.lengthOf(1); - // an inbound connection is opened from an address in the allow list - const remotePeer = await createEd25519PeerId(); - const maConn = mockMultiaddrConnection({ - remoteAddr, - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, remotePeer); - await expect(connectionManager.acceptIncomingConnection(maConn)) - .to.eventually.be.true(); - }); - it('should limit the number of inbound pending connections', async () => { - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - maxIncomingPendingConnections: 1 - }); - await connectionManager.start(); - sinon.stub(connectionManager.dialQueue, 'dial').resolves(stubInterface()); - // start the upgrade - const maConn1 = mockMultiaddrConnection({ - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, await createEd25519PeerId()); - await expect(connectionManager.acceptIncomingConnection(maConn1)) - .to.eventually.be.true(); - // start the upgrade - const maConn2 = mockMultiaddrConnection({ - source: (async function* () { - yield* []; - })(), - sink: async () => { } - }, await createEd25519PeerId()); - // should be false because we have not completed the upgrade of maConn1 - await expect(connectionManager.acceptIncomingConnection(maConn2)) - .to.eventually.be.false(); - // finish the maConn1 pending upgrade - connectionManager.afterUpgradeInbound(); - // should be true because we have now completed the upgrade of maConn1 - await expect(connectionManager.acceptIncomingConnection(maConn2)) - .to.eventually.be.true(); - }); - it('should allow dialing peers when an existing transient connection exists', async () => { - connectionManager = new DefaultConnectionManager(defaultComponents(libp2p.peerId), { - ...defaultOptions, - maxIncomingPendingConnections: 1 - }); - await connectionManager.start(); - const targetPeer = await createEd25519PeerId(); - const addr = multiaddr(`/ip4/123.123.123.123/tcp/123/p2p/${targetPeer}`); - const existingConnection = stubInterface({ - transient: true - }); - const newConnection = stubInterface(); - sinon.stub(connectionManager.dialQueue, 'dial') - .withArgs(addr) - .resolves(newConnection); - // we have an existing transient connection - const map = connectionManager.getConnectionsMap(); - map.set(targetPeer, [ - existingConnection - ]); - const conn = await connectionManager.openConnection(addr); - expect(conn).to.equal(newConnection); - }); -}); -//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.spec.js.map deleted file mode 100644 index 66230badf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/index.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../test/connection-manager/index.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AAC3H,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,wBAAwB,EAA2C,MAAM,uCAAuC,CAAA;AACzH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AASzD,MAAM,cAAc,GAAG;IACrB,cAAc,EAAE,EAAE;IAClB,cAAc,EAAE,CAAC;IACjB,gBAAgB,EAAE,QAAQ;IAC1B,qBAAqB,EAAE,KAAK;CAC7B,CAAA;AAED,SAAS,iBAAiB,CAAE,MAAc;IACx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AC,CAAA;QAExE,MAAM,kBAAkB,GAAG,aAAa,CAAa;YACnD,SAAS,EAAE,IAAI;SAChB,CAAC,CAAA;QACF,MAAM,aAAa,GAAG,aAAa,EAAc,CAAA;QAEjD,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,MAAM,CAAC;aAC5C,QAAQ,CAAC,IAAI,CAAC;aACd,QAAQ,CAAC,aAAa,CAAC,CAAA;QAE1B,2CAA2C;QAC3C,MAAM,GAAG,GAAG,iBAAiB,CAAC,iBAAiB,EAAE,CAAA;QACjD,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE;YAClB,kBAAkB;SACnB,CAAC,CAAA;QAEF,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;QAEzD,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;IACtC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/resolver.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/resolver.spec.d.ts deleted file mode 100644 index f08a5bfbd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/resolver.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=resolver.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/resolver.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/resolver.spec.d.ts.map deleted file mode 100644 index 976ef1837..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/resolver.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolver.spec.d.ts","sourceRoot":"","sources":["../../../test/connection-manager/resolver.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/resolver.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/resolver.spec.js deleted file mode 100644 index 3944ab008..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/resolver.spec.js +++ /dev/null @@ -1,221 +0,0 @@ -/* eslint-env mocha */ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { RELAY_V2_HOP_CODEC } from '@libp2p/circuit-relay-v2'; -import { circuitRelayServer, circuitRelayTransport } from '@libp2p/circuit-relay-v2'; -import { mockConnection, mockConnectionGater, mockDuplex, mockMultiaddrConnection } from '@libp2p/interface-compliance-tests/mocks'; -import { mplex } from '@libp2p/mplex'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import pDefer from 'p-defer'; -import sinon from 'sinon'; -import { codes as ErrorCodes } from '../../src/errors.js'; -import { createLibp2pNode } from '../../src/libp2p.js'; -const relayAddr = multiaddr(process.env.RELAY_MULTIADDR); -const getDnsaddrStub = (peerId) => [ - `/dnsaddr/ams-1.bootstrap.libp2p.io/p2p/${peerId.toString()}`, - `/dnsaddr/ams-2.bootstrap.libp2p.io/p2p/${peerId.toString()}`, - `/dnsaddr/lon-1.bootstrap.libp2p.io/p2p/${peerId.toString()}`, - `/dnsaddr/nrt-1.bootstrap.libp2p.io/p2p/${peerId.toString()}`, - `/dnsaddr/nyc-1.bootstrap.libp2p.io/p2p/${peerId.toString()}`, - `/dnsaddr/sfo-2.bootstrap.libp2p.io/p2p/${peerId.toString()}` -]; -const relayedAddr = (peerId) => `${relayAddr.toString()}/p2p-circuit/p2p/${peerId.toString()}`; -const getDnsRelayedAddrStub = (peerId) => [ - `${relayedAddr(peerId)}` -]; -describe('dialing (resolvable addresses)', () => { - let libp2p; - let remoteLibp2p; - let resolver; - beforeEach(async () => { - resolver = sinon.stub(); - [libp2p, remoteLibp2p] = await Promise.all([ - createLibp2pNode({ - addresses: { - listen: [`${relayAddr.toString()}/p2p-circuit`] - }, - transports: [ - circuitRelayTransport(), - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionManager: { - resolvers: { - dnsaddr: resolver - } - }, - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }), - createLibp2pNode({ - addresses: { - listen: [`${relayAddr.toString()}/p2p-circuit`] - }, - transports: [ - circuitRelayTransport(), - webSockets({ - filter: filters.all - }) - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionManager: { - resolvers: { - dnsaddr: resolver - } - }, - connectionEncryption: [ - plaintext() - ], - services: { - relay: circuitRelayServer() - }, - connectionGater: mockConnectionGater() - }) - ]); - await Promise.all([ - libp2p.start(), - remoteLibp2p.start() - ]); - }); - afterEach(async () => { - sinon.restore(); - await Promise.all([libp2p, remoteLibp2p].map(async (n) => { - if (n != null) { - await n.stop(); - } - })); - }); - it('resolves dnsaddr to ws local address', async () => { - const peerId = await createEd25519PeerId(); - // ensure remote libp2p creates reservation on relay - await remoteLibp2p.peerStore.merge(peerId, { - protocols: [RELAY_V2_HOP_CODEC] - }); - const remoteId = remoteLibp2p.peerId; - const dialAddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remoteId.toString()}`); - const relayedAddrFetched = multiaddr(relayedAddr(remoteId)); - // Transport spy - const transport = getTransport(libp2p, 'libp2p/circuit-relay-v2'); - const transportDialSpy = sinon.spy(transport, 'dial'); - // Resolver stub - resolver.onCall(0).returns(Promise.resolve(getDnsRelayedAddrStub(remoteId))); - // Dial with address resolve - const connection = await libp2p.dial(dialAddr); - expect(connection).to.exist(); - expect(connection.remoteAddr.equals(relayedAddrFetched)); - const dialArgs = transportDialSpy.firstCall.args; - expect(dialArgs[0].equals(relayedAddrFetched)).to.eql(true); - }); - it('resolves a dnsaddr recursively', async () => { - const remoteId = remoteLibp2p.peerId; - const dialAddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remoteId.toString()}`); - const relayedAddrFetched = multiaddr(relayedAddr(remoteId)); - const relayId = await createEd25519PeerId(); - // ensure remote libp2p creates reservation on relay - await remoteLibp2p.peerStore.merge(relayId, { - protocols: [RELAY_V2_HOP_CODEC] - }); - // Transport spy - const transport = getTransport(libp2p, 'libp2p/circuit-relay-v2'); - const transportDialSpy = sinon.spy(transport, 'dial'); - // Resolver stub - let firstCall = false; - resolver.callsFake(async () => { - if (!firstCall) { - firstCall = true; - // Return an array of dnsaddr - return Promise.resolve(getDnsaddrStub(remoteId)); - } - return Promise.resolve(getDnsRelayedAddrStub(remoteId)); - }); - // Dial with address resolve - const connection = await libp2p.dial(dialAddr); - expect(connection).to.exist(); - expect(connection.remoteAddr.equals(relayedAddrFetched)); - const dialArgs = transportDialSpy.firstCall.args; - expect(dialArgs[0].equals(relayedAddrFetched)).to.eql(true); - }); - // TODO: Temporary solution does not resolve dns4/dns6 - // Resolver just returns the received multiaddrs - it('stops recursive resolve if finds dns4/dns6 and dials it', async () => { - const remoteId = remoteLibp2p.peerId; - const dialAddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remoteId.toString()}`); - // Stub resolver - const dnsMa = multiaddr(`/dns4/ams-1.remote.libp2p.io/tcp/443/wss/p2p/${remoteId.toString()}`); - resolver.returns(Promise.resolve([ - `${dnsMa.toString()}` - ])); - const deferred = pDefer(); - // Stub transport - const transport = getTransport(libp2p, '@libp2p/websockets'); - const stubTransport = sinon.stub(transport, 'dial'); - stubTransport.callsFake(async (multiaddr) => { - expect(multiaddr.equals(dnsMa)).to.equal(true); - deferred.resolve(); - return mockConnection(mockMultiaddrConnection(mockDuplex(), peerIdFromString(multiaddr.getPeerId() ?? ''))); - }); - void libp2p.dial(dialAddr); - await deferred.promise; - }); - it('resolves a dnsaddr recursively not failing if one address fails to resolve', async () => { - const remoteId = remoteLibp2p.peerId; - const dialAddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remoteId.toString()}`); - const relayedAddrFetched = multiaddr(relayedAddr(remoteId)); - const relayId = await createEd25519PeerId(); - // ensure remote libp2p creates reservation on relay - await remoteLibp2p.peerStore.merge(relayId, { - protocols: [RELAY_V2_HOP_CODEC] - }); - // Transport spy - const transport = getTransport(libp2p, 'libp2p/circuit-relay-v2'); - const transportDialSpy = sinon.spy(transport, 'dial'); - // Resolver stub - resolver.onCall(0).callsFake(async () => Promise.resolve(getDnsaddrStub(remoteId))); - resolver.onCall(1).callsFake(async () => Promise.reject(new Error())); - resolver.callsFake(async () => Promise.resolve(getDnsRelayedAddrStub(remoteId))); - // Dial with address resolve - const connection = await libp2p.dial(dialAddr); - expect(connection).to.exist(); - expect(connection.remoteAddr.equals(relayedAddrFetched)); - const dialArgs = transportDialSpy.firstCall.args; - expect(dialArgs[0].equals(relayedAddrFetched)).to.eql(true); - }); - it('fails to dial if resolve fails and there are no addresses to dial', async () => { - const remoteId = remoteLibp2p.peerId; - const dialAddr = multiaddr(`/dnsaddr/remote.libp2p.io/p2p/${remoteId.toString()}`); - // Stub resolver - resolver.returns(Promise.reject(new Error())); - // Stub transport - const transport = getTransport(libp2p, '@libp2p/websockets'); - const spy = sinon.spy(transport, 'dial'); - await expect(libp2p.dial(dialAddr)) - .to.eventually.be.rejectedWith(Error) - .and.to.have.nested.property('.code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - expect(spy.callCount).to.eql(0); - }); -}); -function getTransport(libp2p, tag) { - const transport = libp2p.components.transportManager.getTransports().find(t => { - return t[Symbol.toStringTag] === tag; - }); - if (transport != null) { - return transport; - } - throw new Error(`No transport found for ${tag}`); -} -//# sourceMappingURL=resolver.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/resolver.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/resolver.spec.js.map deleted file mode 100644 index 705bf09ee..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection-manager/resolver.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolver.spec.js","sourceRoot":"","sources":["../../../test/connection-manager/resolver.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAA4B,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAC9G,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAA;AACnI,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,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AAC,CAAA;AAEF,SAAS,YAAY,CAAE,MAAkB,EAAE,GAAW;IACpD,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;QAC5E,OAAO,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,GAAG,CAAA;IACtC,CAAC,CAAC,CAAA;IAEF,IAAI,SAAS,IAAI,IAAI,EAAE;QACrB,OAAO,SAAS,CAAA;KACjB;IAED,MAAM,IAAI,KAAK,CAAC,0BAA0B,GAAG,EAAE,CAAC,CAAA;AAClD,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/compliance.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/compliance.spec.d.ts deleted file mode 100644 index dac08d9d2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/compliance.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=compliance.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/compliance.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/compliance.spec.d.ts.map deleted file mode 100644 index 182587254..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/compliance.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.d.ts","sourceRoot":"","sources":["../../../test/connection/compliance.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/compliance.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/compliance.spec.js deleted file mode 100644 index f8761d588..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/compliance.spec.js +++ /dev/null @@ -1,72 +0,0 @@ -import tests from '@libp2p/interface-compliance-tests/connection'; -import peers from '@libp2p/interface-compliance-tests/peers'; -import { logger, peerLogger } from '@libp2p/logger'; -import * as PeerIdFactory from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import { createConnection } from '../../src/connection/index.js'; -import { pair } from './fixtures/pair.js'; -describe('connection compliance', () => { - tests({ - /** - * Test setup. `properties` allows the compliance test to override - * certain values for testing. - */ - async setup(properties) { - const localPeer = await PeerIdFactory.createEd25519PeerId(); - const remoteAddr = multiaddr('/ip4/127.0.0.1/tcp/8081'); - const remotePeer = await PeerIdFactory.createFromJSON(peers[0]); - let openStreams = []; - let streamId = 0; - const connection = createConnection({ - remotePeer, - remoteAddr, - timeline: { - open: Date.now() - 10, - upgraded: Date.now() - }, - direction: 'outbound', - encryption: '/secio/1.0.0', - multiplexer: '/mplex/6.7.0', - status: 'open', - logger: peerLogger(localPeer), - newStream: async (protocols) => { - const id = `${streamId++}`; - const stream = { - ...pair(), - close: async () => { - void stream.sink(async function* () { }()); - openStreams = openStreams.filter(s => s.id !== id); - }, - closeRead: async () => { }, - closeWrite: async () => { - void stream.sink(async function* () { }()); - }, - id, - abort: () => { }, - direction: 'outbound', - protocol: protocols[0], - timeline: { - open: 0 - }, - metadata: {}, - status: 'open', - writeStatus: 'ready', - readStatus: 'ready', - log: logger('test') - }; - openStreams.push(stream); - return stream; - }, - close: async () => { }, - abort: () => { }, - getStreams: () => openStreams, - ...properties - }); - return connection; - }, - async teardown() { - // cleanup resources created by setup() - } - }); -}); -//# sourceMappingURL=compliance.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/compliance.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/compliance.spec.js.map deleted file mode 100644 index 159229d1f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/compliance.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.js","sourceRoot":"","sources":["../../../test/connection/compliance.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,+CAA+C,CAAA;AACjE,OAAO,KAAK,MAAM,0CAA0C,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,aAAa,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAGzC,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,KAAK,CAAC;QACJ;;;WAGG;QACH,KAAK,CAAC,KAAK,CAAE,UAAU;YACrB,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC,mBAAmB,EAAE,CAAA;YAC3D,MAAM,UAAU,GAAG,SAAS,CAAC,yBAAyB,CAAC,CAAA;YACvD,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;YAC/D,IAAI,WAAW,GAAa,EAAE,CAAA;YAC9B,IAAI,QAAQ,GAAG,CAAC,CAAA;YAEhB,MAAM,UAAU,GAAG,gBAAgB,CAAC;gBAClC,UAAU;gBACV,UAAU;gBACV,QAAQ,EAAE;oBACR,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE;oBACrB,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE;iBACrB;gBACD,SAAS,EAAE,UAAU;gBACrB,UAAU,EAAE,cAAc;gBAC1B,WAAW,EAA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AAU;aACd,CAAC,CAAA;YACF,OAAO,UAAU,CAAA;QACnB,CAAC;QACD,KAAK,CAAC,QAAQ;YACZ,uCAAuC;QACzC,CAAC;KACF,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/fixtures/pair.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/fixtures/pair.d.ts deleted file mode 100644 index 1d866b335..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/fixtures/pair.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import type { Source, Duplex } from 'it-stream-types'; -/** - * A pair of streams where one drains from the other - */ -export declare function pair(): Duplex, Source, Promise>; -//# sourceMappingURL=pair.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/fixtures/pair.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/fixtures/pair.d.ts.map deleted file mode 100644 index b5f8d6292..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/fixtures/pair.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pair.d.ts","sourceRoot":"","sources":["../../../../test/connection/fixtures/pair.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAErD;;GAEG;AACH,wBAAgB,IAAI,IAAK,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,cAAc,GAAG,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAmBlH"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/fixtures/pair.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/fixtures/pair.js deleted file mode 100644 index e5b3f71c5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/fixtures/pair.js +++ /dev/null @@ -1,24 +0,0 @@ -import map from 'it-map'; -import defer from 'p-defer'; -import { Uint8ArrayList } from 'uint8arraylist'; -/** - * A pair of streams where one drains from the other - */ -export function pair() { - const deferred = defer(); - let piped = false; - return { - sink: async (source) => { - if (piped) { - throw new Error('already piped'); - } - piped = true; - deferred.resolve(source); - }, - source: (async function* () { - const source = await deferred.promise; - yield* map(source, (buf) => buf instanceof Uint8Array ? new Uint8ArrayList(buf) : buf); - }()) - }; -} -//# sourceMappingURL=pair.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/fixtures/pair.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/fixtures/pair.js.map deleted file mode 100644 index 0f5932345..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/fixtures/pair.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pair.js","sourceRoot":"","sources":["../../../../test/connection/fixtures/pair.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,QAAQ,CAAA;AACxB,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAG/C;;GAEG;AACH,MAAM,UAAU,IAAI;IAClB,MAAM,QAAQ,GAAG,KAAK,EAAuC,CAAA;IAC7D,IAAI,KAAK,GAAG,KAAK,CAAA;IAEjB,OAAO;QACL,IAAI,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;YACnB,IAAI,KAAK,EAAE;gBACT,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;aACjC;YAED,KAAK,GAAG,IAAI,CAAA;YACZ,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAC1B,CAAC;QACD,MAAM,EAAE,CAAC,KAAK,SAAU,CAAC;YACvB,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAA;YAErC,KAAM,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,YAAY,UAAU,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;QACzF,CAAC,EAAE,CAAC;KACL,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/index.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/index.spec.d.ts deleted file mode 100644 index b37c2d278..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/index.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/index.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/index.spec.d.ts.map deleted file mode 100644 index 99cb1ba5b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/index.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../../test/connection/index.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/index.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/index.spec.js deleted file mode 100644 index 2024f76a3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/index.spec.js +++ /dev/null @@ -1,53 +0,0 @@ -import { defaultLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import Sinon from 'sinon'; -import { createConnection } from '../../src/connection/index.js'; -function defaultConnectionInit() { - return { - timeline: { - open: Date.now() - 10, - upgraded: Date.now() - }, - direction: 'outbound', - encryption: '/secio/1.0.0', - multiplexer: '/mplex/6.7.0', - status: 'open', - newStream: Sinon.stub(), - close: Sinon.stub(), - abort: Sinon.stub(), - getStreams: Sinon.stub(), - logger: defaultLogger() - }; -} -describe('connection', () => { - it('should not require local or remote addrs', async () => { - const remotePeer = await createEd25519PeerId(); - return createConnection({ - remotePeer, - remoteAddr: multiaddr('/ip4/127.0.0.1/tcp/4002'), - ...defaultConnectionInit() - }); - }); - it('should append remote peer id to address if not already present', async () => { - const remotePeer = await createEd25519PeerId(); - const conn = createConnection({ - remotePeer, - remoteAddr: multiaddr('/ip4/127.0.0.1/tcp/4002'), - ...defaultConnectionInit() - }); - expect(conn.remoteAddr.getPeerId()).to.equal(remotePeer.toString()); - }); - it('should not append remote peer id to address if present', async () => { - const remotePeer = await createEd25519PeerId(); - const otherPeer = await createEd25519PeerId(); - const conn = createConnection({ - remotePeer, - remoteAddr: multiaddr(`/ip4/127.0.0.1/tcp/4002/p2p/${otherPeer}`), - ...defaultConnectionInit() - }); - expect(conn.remoteAddr.getPeerId()).to.equal(otherPeer.toString()); - }); -}); -//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/index.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/index.spec.js.map deleted file mode 100644 index c3e9bc2cf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/connection/index.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../test/connection/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAEhE,SAAS,qBAAqB;IAC5B,OAAO;QACL,QAAQ,EAAE;YACR,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE;YACrB,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE;SACrB;QACD,SAAS,EAAE,UAAU;QACrB,UAAU,EAAE,cAAc;QAC1B,WAAW,EAAE,cAAc;QAC3B,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,KAAK,CAAC,IAAI,EAAE;QACvB,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE;QACnB,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE;QACnB,UAAU,EAAE,KAAK,CAAC,IAAI,EAAE;QACxB,MAAM,EAAE,aAAa,EAAE;KACxB,CAAA;AACH,CAAC;AAED,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,UAAU,GAAG,MAAM,mBAAmB,EAAE,CAAA;QAE9C,OAAO,gBAAgB,CAAC;YACtB,UAAU;YACV,UAAU,EAAE,SAAS,CAAC,yBAAyB,CAAC;YAChD,GAAG,qBAAqB,EAAE;SAC3B,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gEAAgE,EAAE,KAAK,IAAI,EAAE;QAC9E,MAAM,UAAU,GAAG,MAAM,mBAAmB,EAAE,CAAA;QAE9C,MAAM,IAAI,GAAG,gBAAgB,CAAC;YAC5B,UAAU;YACV,UAAU,EAAE,SAAS,CAAC,yBAAyB,CAAC;YAChD,GAAG,qBAAqB,EAAE;SAC3B,CAAC,CAAA;QAEF,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAA;IACrE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACtE,MAAM,UAAU,GAAG,MAAM,mBAAmB,EAAE,CAAA;QAC9C,MAAM,SAAS,GAAG,MAAM,mBAAmB,EAAE,CAAA;QAE7C,MAAM,IAAI,GAAG,gBAAgB,CAAC;YAC5B,UAAU;YACV,UAAU,EAAE,SAAS,CAAC,+BAA+B,SAAS,EAAE,CAAC;YACjE,GAAG,qBAAqB,EAAE;SAC3B,CAAC,CAAA;QAEF,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAA;IACpE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/content-routing.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/content-routing.node.d.ts deleted file mode 100644 index 36e6e389e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/content-routing.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=content-routing.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/content-routing.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/content-routing.node.d.ts.map deleted file mode 100644 index e37f9e48b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/content-routing.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"content-routing.node.d.ts","sourceRoot":"","sources":["../../../test/content-routing/content-routing.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/content-routing.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/content-routing.node.js deleted file mode 100644 index f0efca1f7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/content-routing.node.js +++ /dev/null @@ -1,378 +0,0 @@ -/* eslint-env mocha */ -import { EventTypes } from '@libp2p/kad-dht'; -import { peerIdFromString } from '@libp2p/peer-id'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import all from 'it-all'; -import drain from 'it-drain'; -import { CID } from 'multiformats/cid'; -import pDefer from 'p-defer'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { createLibp2p } from '../../src/index.js'; -import { createBaseOptions } from '../fixtures/base-options.js'; -import { createNode, createPeerId, populateAddressBooks } from '../fixtures/creators/peer.js'; -import { createRoutingOptions } from './utils.js'; -describe('content-routing', () => { - describe('no routers', () => { - let node; - before(async () => { - node = await createNode({ - config: createBaseOptions() - }); - }); - after(async () => { await node.stop(); }); - it('.findProviders should return an error', async () => { - try { - // @ts-expect-error invalid params - for await (const _ of node.contentRouting.findProviders('a cid')) { } // eslint-disable-line - throw new Error('.findProviders should return an error'); - } - catch (err) { - expect(err).to.exist(); - expect(err.code).to.equal('ERR_NO_ROUTERS_AVAILABLE'); - } - }); - it('.provide should return an error', async () => { - // @ts-expect-error invalid params - await expect(node.contentRouting.provide('a cid')) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_NO_ROUTERS_AVAILABLE'); - }); - }); - describe('via dht router', () => { - const number = 5; - let nodes; - before(async () => { - nodes = await Promise.all([ - createLibp2p(createRoutingOptions()), - createLibp2p(createRoutingOptions()), - createLibp2p(createRoutingOptions()), - createLibp2p(createRoutingOptions()), - createLibp2p(createRoutingOptions()) - ]); - await populateAddressBooks(nodes); - // Ring dial - await Promise.all(nodes.map(async (peer, i) => peer.dial(nodes[(i + 1) % number].peerId))); - }); - afterEach(() => { - sinon.restore(); - }); - after(async () => Promise.all(nodes.map(async (n) => { await n.stop(); }))); - it('should use the nodes dht to provide', async () => { - const deferred = pDefer(); - if (nodes[0].services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(nodes[0].services.dht, 'provide').callsFake(async function* () { - deferred.resolve(); - }); - void nodes[0].contentRouting.provide(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB')); - return deferred.promise; - }); - it('should use the nodes dht to find providers', async () => { - const deferred = pDefer(); - if (nodes[0].services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(nodes[0].services.dht, 'findProviders').callsFake(async function* () { - yield { - from: nodes[0].peerId, - type: EventTypes.PROVIDER, - name: 'PROVIDER', - providers: [{ - id: nodes[0].peerId, - multiaddrs: [], - protocols: [] - }] - }; - deferred.resolve(); - }); - await drain(nodes[0].contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))); - return deferred.promise; - }); - }); - describe('via delegate router', () => { - let node; - let delegate; - beforeEach(async () => { - delegate = stubInterface(); - delegate.provide.returns(Promise.resolve()); - delegate.findProviders.returns(async function* () { }()); - node = await createNode({ - config: createBaseOptions({ - contentRouters: [ - () => delegate - ] - }) - }); - }); - afterEach(async () => { - if (node != null) { - await node.stop(); - } - sinon.restore(); - }); - it('should use the delegate router to provide', async () => { - const deferred = pDefer(); - delegate.provide.callsFake(async () => { - deferred.resolve(); - }); - void node.contentRouting.provide(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB')); - return deferred.promise; - }); - it('should use the delegate router to find providers', async () => { - const deferred = pDefer(); - delegate.findProviders.returns(async function* () { - yield { - id: node.peerId, - multiaddrs: [], - protocols: [] - }; - deferred.resolve(); - }()); - await drain(node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))); - return deferred.promise; - }); - it('should be able to register as a provider', async () => { - const cid = CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'); - await node.contentRouting.provide(cid); - expect(delegate.provide.calledWith(cid)).to.equal(true); - }); - it('should handle errors when registering as a provider', async () => { - const cid = CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'); - delegate.provide.withArgs(cid).throws(new Error('Could not provide')); - await expect(node.contentRouting.provide(cid)) - .to.eventually.be.rejected() - .with.property('message', 'Could not provide'); - }); - it('should be able to find providers', async () => { - const cid = CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'); - const provider = 'QmZNgCqZCvTsi3B4Vt7gsSqpkqDpE7M2Y9TDmEhbDb4ceF'; - delegate.findProviders.withArgs(cid).returns(async function* () { - yield { - id: peerIdFromString(provider), - multiaddrs: [ - multiaddr('/ip4/0.0.0.0/tcp/0') - ], - protocols: [] - }; - }()); - const providers = await all(node.contentRouting.findProviders(cid)); - expect(providers).to.have.length(1); - expect(providers[0].id.toString()).to.equal(provider); - }); - it('should handle errors when finding providers', async () => { - const cid = CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'); - delegate.findProviders.withArgs(cid).throws(new Error('Could not find providers')); - await expect(drain(node.contentRouting.findProviders(cid))) - .to.eventually.be.rejected() - .with.property('message', 'Could not find providers'); - }); - }); - describe('via dht and delegate routers', () => { - let node; - let delegate; - beforeEach(async () => { - delegate = stubInterface(); - delegate.provide.returns(Promise.resolve()); - delegate.findProviders.returns(async function* () { }()); - node = await createNode({ - config: createRoutingOptions({ - contentRouters: [ - () => delegate - ] - }) - }); - }); - afterEach(() => { - sinon.restore(); - }); - afterEach(async () => { await node.stop(); }); - it('should store the multiaddrs of a peer', async () => { - const providerPeerId = await createPeerId(); - const result = { - id: providerPeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/49320') - ] - }; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { }); - delegate.findProviders.callsFake(async function* () { - yield result; - }); - expect(await node.peerStore.has(providerPeerId)).to.not.be.ok(); - await drain(node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))); - await expect(node.peerStore.get(providerPeerId)).to.eventually.have.property('addresses').that.deep.include({ - isCertified: false, - multiaddr: result.multiaddrs[0] - }); - }); - it('should not wait for routing findProviders to finish before returning results', async () => { - const providerPeerId = await createPeerId(); - const result = { - id: providerPeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/49320') - ], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - const defer = pDefer(); - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { - await defer.promise; - }); - delegate.findProviders.callsFake(async function* () { - yield result; - await defer.promise; - }); - for await (const provider of node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))) { - expect(provider.id).to.deep.equal(providerPeerId); - defer.resolve(); - } - }); - it('should dedupe results', async () => { - const providerPeerId = await createPeerId(); - const result = { - id: providerPeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/49320') - ], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { - yield { - from: providerPeerId, - type: EventTypes.PROVIDER, - name: 'PROVIDER', - providers: [ - result - ] - }; - }); - delegate.findProviders.callsFake(async function* () { - yield result; - }); - const results = await all(node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))); - expect(results).to.be.an('array').with.lengthOf(1).that.deep.equals([result]); - }); - it('should combine multiaddrs when different addresses are returned by different content routers', async () => { - const providerPeerId = await createPeerId(); - const result1 = { - id: providerPeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/49320') - ], - protocols: [] - }; - const result2 = { - id: providerPeerId, - multiaddrs: [ - multiaddr('/ip4/213.213.213.213/tcp/2344') - ], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { - yield { - from: providerPeerId, - type: EventTypes.PROVIDER, - name: 'PROVIDER', - providers: [ - result1 - ] - }; - }); - delegate.findProviders.callsFake(async function* () { - yield result2; - }); - await drain(node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))); - await expect(node.peerStore.get(providerPeerId)).to.eventually.have.property('addresses').that.deep.include({ - isCertified: false, - multiaddr: result1.multiaddrs[0] - }).and.to.deep.include({ - isCertified: false, - multiaddr: result2.multiaddrs[0] - }); - }); - it('should use both the dht and delegate router to provide', async () => { - const dhtDeferred = pDefer(); - const delegatedDeferred = pDefer(); - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'provide').callsFake(async function* () { - dhtDeferred.resolve(); - }); - delegate.provide.callsFake(async function () { - delegatedDeferred.resolve(); - }); - await node.contentRouting.provide(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB')); - await Promise.all([ - dhtDeferred.promise, - delegatedDeferred.promise - ]); - }); - it('should use the dht if the delegate fails to find providers', async () => { - const providerPeerId = await createPeerId(); - const results = [{ - id: providerPeerId, - multiaddrs: [], - protocols: [] - }]; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { - yield { - from: providerPeerId, - type: EventTypes.PROVIDER, - name: 'PROVIDER', - providers: [ - results[0] - ] - }; - }); - delegate.findProviders.callsFake(async function* () { - }); - const providers = []; - for await (const prov of node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))) { - providers.push(prov); - } - expect(providers).to.have.length.above(0); - expect(providers).to.eql(results); - }); - it('should use the delegate if the dht fails to find providers', async () => { - const providerPeerId = await createPeerId(); - const results = [{ - id: providerPeerId, - multiaddrs: [], - protocols: [] - }]; - if (node.services.dht == null) { - throw new Error('DHT was not configured'); - } - sinon.stub(node.services.dht, 'findProviders').callsFake(async function* () { }); - delegate.findProviders.callsFake(async function* () { - yield results[0]; - }); - const providers = []; - for await (const prov of node.contentRouting.findProviders(CID.parse('QmU621oD8AhHw6t25vVyfYKmL9VV3PTgc52FngEhTGACFB'))) { - providers.push(prov); - } - expect(providers).to.have.length.above(0); - expect(providers).to.eql(results); - }); - }); -}); -//# sourceMappingURL=content-routing.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/content-routing.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/content-routing.node.js.map deleted file mode 100644 index c4d01da22..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/content-routing.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"content-routing.node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AAI,CAAC,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,SAAS,CAAC,KAAK,SAAU,CAAC,MAAK,CAAC,CAAC,CAAA;YAEhF,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,SAAU,CAAC;gBAC/C,MAAM,OAAO,CAAC,CAAC,CAAC,CAAA;YAClB,CAAC,CAAC,CAAA;YAEF,MAAM,SAAS,GAAG,EAAE,CAAA;YACpB,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC,EAAE;gBACvH,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;aACrB;YAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YACzC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QACnC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/operation.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/operation.node.d.ts deleted file mode 100644 index 1cf770100..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/operation.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=operation.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/operation.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/operation.node.d.ts.map deleted file mode 100644 index 698f65880..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/operation.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"operation.node.d.ts","sourceRoot":"","sources":["../../../../test/content-routing/dht/operation.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/operation.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/operation.node.js deleted file mode 100644 index 83b2e9daa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/operation.node.js +++ /dev/null @@ -1,119 +0,0 @@ -/* eslint-env mocha */ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { kadDHT } from '@libp2p/kad-dht'; -import { mplex } from '@libp2p/mplex'; -import { plaintext } from '@libp2p/plaintext'; -import { tcp } from '@libp2p/tcp'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import pWaitFor from 'p-wait-for'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { createLibp2p } from '../../../src/index.js'; -import { createPeerId } from '../../fixtures/creators/peer.js'; -import { subsystemMulticodecs } from './utils.js'; -const listenAddr = multiaddr('/ip4/127.0.0.1/tcp/8000'); -const remoteListenAddr = multiaddr('/ip4/127.0.0.1/tcp/8001'); -async function getRemoteAddr(remotePeerId, libp2p) { - const { addresses } = await libp2p.peerStore.get(remotePeerId); - if (addresses.length === 0) { - throw new Error('No addrs found'); - } - const addr = addresses[0]; - return addr.multiaddr.encapsulate(`/p2p/${remotePeerId.toString()}`); -} -describe('DHT subsystem operates correctly', () => { - let peerId; - let remotePeerId; - let libp2p; - let remoteLibp2p; - let remAddr; - beforeEach(async () => { - [peerId, remotePeerId] = await Promise.all([ - createPeerId(), - createPeerId() - ]); - }); - describe('dht started before connect', () => { - beforeEach(async () => { - libp2p = await createLibp2p({ - peerId, - addresses: { - listen: [listenAddr.toString()] - }, - transports: [ - tcp() - ], - connectionEncryption: [ - plaintext() - ], - streamMuxers: [ - yamux(), - mplex() - ], - services: { - dht: kadDHT({ - allowQueryWithZeroPeers: true - }) - } - }); - remoteLibp2p = await createLibp2p({ - peerId: remotePeerId, - addresses: { - listen: [remoteListenAddr.toString()] - }, - transports: [ - tcp() - ], - connectionEncryption: [ - plaintext() - ], - streamMuxers: [ - yamux(), - mplex() - ], - services: { - dht: kadDHT({ - allowQueryWithZeroPeers: true - }) - } - }); - await Promise.all([ - libp2p.start(), - remoteLibp2p.start() - ]); - await libp2p.peerStore.patch(remotePeerId, { - multiaddrs: [remoteListenAddr] - }); - remAddr = await getRemoteAddr(remotePeerId, libp2p); - }); - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - if (remoteLibp2p != null) { - await remoteLibp2p.stop(); - } - }); - it('should get notified of connected peers on dial', async () => { - const stream = await libp2p.dialProtocol(remAddr, subsystemMulticodecs); - expect(stream).to.exist(); - return Promise.all([ - pWaitFor(() => libp2p.services.dht.lan.routingTable.size === 1), - pWaitFor(() => remoteLibp2p.services.dht.lan.routingTable.size === 1) - ]); - }); - it('should put on a peer and get from the other', async () => { - const key = uint8ArrayFromString('hello'); - const value = uint8ArrayFromString('world'); - await libp2p.dialProtocol(remotePeerId, subsystemMulticodecs); - await Promise.all([ - pWaitFor(() => libp2p.services.dht.lan.routingTable.size === 1), - pWaitFor(() => remoteLibp2p.services.dht.lan.routingTable.size === 1) - ]); - await libp2p.contentRouting.put(key, value); - const fetchedValue = await remoteLibp2p.contentRouting.get(key); - expect(fetchedValue).to.equalBytes(value); - }); - }); -}); -//# sourceMappingURL=operation.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/operation.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/operation.node.js.map deleted file mode 100644 index 55800e26a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/operation.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"operation.node.js","sourceRoot":"","sources":["../../../../test/content-routing/dht/operation.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAMjD,MAAM,UAAU,GAAG,SAAS,CAAC,yBAAyB,CAAC,CAAA;AACvD,MAAM,gBAAgB,GAAG,SAAS,CAAC,yBAAyB,CAAC,CAAA;AAE7D,KAAK,UAAU,aAAa,CAAE,YAAoB,EAAE,MAAc;IAChE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IAE9D,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;QAC1B,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAA;KAClC;IAED,MAAM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J,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;YAC3D,MAAM,GAAG,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAA;YACzC,MAAM,KAAK,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAA;YAE3C,MAAM,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAA;YAC7D,MAAM,OAAO,CAAC,GAAG,CAAC;gBAChB,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,CAAC;gBAC/D,QAAQ,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,CAAC;aACtE,CAAC,CAAA;YAEF,MAAM,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;YAE3C,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YAC/D,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QAC3C,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/utils.d.ts deleted file mode 100644 index 8334a000c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/utils.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const subsystemMulticodecs: string[]; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/utils.d.ts.map deleted file mode 100644 index de0b19e10..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../test/content-routing/dht/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,UAGhC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/utils.js deleted file mode 100644 index 9cc3c44f0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/utils.js +++ /dev/null @@ -1,5 +0,0 @@ -export const subsystemMulticodecs = [ - '/ipfs/lan/kad/1.0.0', - '/other/1.0.0' -]; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/utils.js.map deleted file mode 100644 index c3b8faf94..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/dht/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../test/content-routing/dht/utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,qBAAqB;IACrB,cAAc;CACf,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/utils.d.ts deleted file mode 100644 index 3d1c83fcd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/utils.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Libp2pOptions } from '../../src/index.js'; -import type { KadDHT } from '@libp2p/kad-dht'; -export declare function createRoutingOptions(...overrides: Libp2pOptions[]): Libp2pOptions<{ - dht: KadDHT; -}>; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/utils.d.ts.map deleted file mode 100644 index 1298f0f57..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../test/content-routing/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C,wBAAgB,oBAAoB,CAAE,GAAG,SAAS,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAMnG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/utils.js deleted file mode 100644 index 62abfb2ec..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/utils.js +++ /dev/null @@ -1,10 +0,0 @@ -import { kadDHT } from '@libp2p/kad-dht'; -import { createBaseOptions } from '../fixtures/base-options.js'; -export function createRoutingOptions(...overrides) { - return createBaseOptions({ - services: { - dht: kadDHT() - } - }, ...overrides); -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/utils.js.map deleted file mode 100644 index f79b7fd0b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/content-routing/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../test/content-routing/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAI/D,MAAM,UAAU,oBAAoB,CAAE,GAAG,SAA0B;IACjE,OAAO,iBAAiB,CAAC;QACvB,QAAQ,EAAE;YACR,GAAG,EAAE,MAAM,EAAE;SACd;KACF,EAAE,GAAG,SAAS,CAAC,CAAA;AAClB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/consume-peer-record.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/consume-peer-record.spec.d.ts deleted file mode 100644 index 1f60e50d4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/consume-peer-record.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=consume-peer-record.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/consume-peer-record.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/consume-peer-record.spec.d.ts.map deleted file mode 100644 index e87be48f2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/consume-peer-record.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"consume-peer-record.spec.d.ts","sourceRoot":"","sources":["../../../test/core/consume-peer-record.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/consume-peer-record.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/consume-peer-record.spec.js deleted file mode 100644 index 54f77f66a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/consume-peer-record.spec.js +++ /dev/null @@ -1,39 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { multiaddr } from '@multiformats/multiaddr'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -describe('Consume peer record', () => { - let libp2p; - beforeEach(async () => { - const peerId = await createPeerId(); - libp2p = await createLibp2pNode({ - peerId, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - }); - }); - afterEach(async () => { - await libp2p.stop(); - }); - it('should update addresses when observed addrs are confirmed', async () => { - let done; - libp2p.peerStore.patch = async () => { - done(); - return {}; - }; - const p = new Promise(resolve => { - done = resolve; - }); - await libp2p.start(); - libp2p.components.addressManager.confirmObservedAddr(multiaddr('/ip4/123.123.123.123/tcp/3983')); - await p; - await libp2p.stop(); - }); -}); -//# sourceMappingURL=consume-peer-record.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/consume-peer-record.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/consume-peer-record.spec.js.map deleted file mode 100644 index 33b1c77ef..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/consume-peer-record.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"consume-peer-record.spec.js","sourceRoot":"","sources":["../../../test/core/consume-peer-record.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,IAAI,MAAkB,CAAA;IAEtB,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAA;QACnC,MAAM,GAAG,MAAM,gBAAgB,CAAC;YAC9B,MAAM;YACN,UAAU,EAAE;gBACV,UAAU,EAAE;aACb;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,2DAA2D,EAAE,KAAK,IAAI,EAAE;QACzE,IAAI,IAAgB,CAAA;QAEpB,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE;YAClC,IAAI,EAAE,CAAA;YACN,OAAO,EAAS,CAAA;QAClB,CAAC,CAAA;QAED,MAAM,CAAC,GAAG,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE;YACpC,IAAI,GAAG,OAAO,CAAA;QAChB,CAAC,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;QAEpB,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,mBAAmB,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAC,CAAA;QAEhG,MAAM,CAAC,CAAA;QAEP,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/encryption.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/encryption.spec.d.ts deleted file mode 100644 index 63c83cb90..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/encryption.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=encryption.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/encryption.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/encryption.spec.d.ts.map deleted file mode 100644 index 85fb6d201..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/encryption.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encryption.spec.d.ts","sourceRoot":"","sources":["../../../test/core/encryption.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/encryption.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/encryption.spec.js deleted file mode 100644 index e76a69348..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/encryption.spec.js +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { createLibp2p } from '../../src/index.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -describe('Connection encryption configuration', () => { - let peerId; - before(async () => { - peerId = await createPeerId(); - }); - it('can be created', async () => { - const config = { - peerId, - start: false, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - }; - await createLibp2p(config); - }); -}); -//# sourceMappingURL=encryption.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/encryption.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/encryption.spec.js.map deleted file mode 100644 index 9a184e96f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/encryption.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encryption.spec.js","sourceRoot":"","sources":["../../../test/core/encryption.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAsB,MAAM,oBAAoB,CAAA;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAG3D,QAAQ,CAAC,qCAAqC,EAAE,GAAG,EAAE;IACnD,IAAI,MAAc,CAAA;IAElB,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,MAAM,GAAG,MAAM,YAAY,EAAE,CAAA;IAC/B,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE;QAC9B,MAAM,MAAM,GAAkB;YAC5B,MAAM;YACN,KAAK,EAAE,KAAK;YACZ,UAAU,EAAE;gBACV,UAAU,EAAE;aACb;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAA;QACD,MAAM,YAAY,CAAC,MAAM,CAAC,CAAA;IAC5B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/events.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/events.spec.d.ts deleted file mode 100644 index 35b5a7f51..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/events.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=events.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/events.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/events.spec.d.ts.map deleted file mode 100644 index 967176175..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/events.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"events.spec.d.ts","sourceRoot":"","sources":["../../../test/core/events.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/events.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/events.spec.js deleted file mode 100644 index 0ba89d0da..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/events.spec.js +++ /dev/null @@ -1,42 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { expect } from 'aegir/chai'; -import { pEvent } from 'p-event'; -import { createLibp2p } from '../../src/index.js'; -describe('events', () => { - let node; - afterEach(async () => { - if (node != null) { - await node.stop(); - } - }); - it('should emit a start event', async () => { - node = await createLibp2p({ - start: false, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - }); - const eventPromise = pEvent(node, 'start'); - await node.start(); - await expect(eventPromise).to.eventually.have.property('detail', node); - }); - it('should emit a stop event', async () => { - node = await createLibp2p({ - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - }); - const eventPromise = pEvent(node, 'stop'); - await node.stop(); - await expect(eventPromise).to.eventually.have.property('detail', node); - }); -}); -//# sourceMappingURL=events.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/events.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/events.spec.js.map deleted file mode 100644 index 0db4e55bb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/events.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"events.spec.js","sourceRoot":"","sources":["../../../test/core/events.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGjD,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,IAAI,IAAY,CAAA;IAEhB,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,IAAI,IAAI,IAAI,IAAI,EAAE;YAChB,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;SAClB;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,2BAA2B,EAAE,KAAK,IAAI,EAAE;QACzC,IAAI,GAAG,MAAM,YAAY,CAAC;YACxB,KAAK,EAAE,KAAK;YACZ,UAAU,EAAE;gBACV,UAAU,EAAE;aACb;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAC,CAAA;QAEF,MAAM,YAAY,GAAG,MAAM,CAA+B,IAAI,EAAE,OAAO,CAAC,CAAA;QAExE,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;QAClB,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;IACxE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;QACxC,IAAI,GAAG,MAAM,YAAY,CAAC;YACxB,UAAU,EAAE;gBACV,UAAU,EAAE;aACb;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAC,CAAA;QAEF,MAAM,YAAY,GAAG,MAAM,CAA8B,IAAI,EAAE,MAAM,CAAC,CAAA;QAEtE,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;QACjB,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;IACxE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/get-public-key.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/get-public-key.spec.d.ts deleted file mode 100644 index 6dbf4bcf0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/get-public-key.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=get-public-key.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/get-public-key.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/get-public-key.spec.d.ts.map deleted file mode 100644 index 92e484a0e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/get-public-key.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-public-key.spec.d.ts","sourceRoot":"","sources":["../../../test/core/get-public-key.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/get-public-key.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/get-public-key.spec.js deleted file mode 100644 index 1ab28b1f6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/get-public-key.spec.js +++ /dev/null @@ -1,62 +0,0 @@ -/* eslint-env mocha */ -import { kadDHT } from '@libp2p/kad-dht'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { expect } from 'aegir/chai'; -import sinon from 'sinon'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -describe('getPublicKey', () => { - let libp2p; - beforeEach(async () => { - const peerId = await createPeerId(); - libp2p = await createLibp2pNode({ - peerId, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ], - services: { - dht: kadDHT() - } - }); - await libp2p.start(); - }); - afterEach(async () => { - await libp2p.stop(); - }); - it('should extract embedded public key', async () => { - const otherPeer = await createPeerId(); - const key = await libp2p.getPublicKey(otherPeer); - expect(otherPeer.publicKey).to.equalBytes(key); - }); - it('should get key from the keystore', async () => { - const otherPeer = await createPeerId({ opts: { type: 'rsa' } }); - if (otherPeer.publicKey == null) { - throw new Error('Public key was missing'); - } - await libp2p.peerStore.patch(otherPeer, { - publicKey: otherPeer.publicKey - }); - const key = await libp2p.getPublicKey(otherPeer); - expect(otherPeer.publicKey).to.equalBytes(key); - }); - it('should query the DHT when the key is not in the keystore', async () => { - const otherPeer = await createPeerId({ opts: { type: 'rsa' } }); - if (otherPeer.publicKey == null) { - throw new Error('Public key was missing'); - } - if (libp2p.services.dht == null) { - throw new Error('DHT was not configured'); - } - libp2p.services.dht.get = sinon.stub().returns([{ - name: 'VALUE', - value: otherPeer.publicKey - }]); - const key = await libp2p.getPublicKey(otherPeer); - expect(otherPeer.publicKey).to.equalBytes(key); - }); -}); -//# sourceMappingURL=get-public-key.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/get-public-key.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/get-public-key.spec.js.map deleted file mode 100644 index b9936d463..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/get-public-key.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"get-public-key.spec.js","sourceRoot":"","sources":["../../../test/core/get-public-key.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAI3D,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAI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C,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;IAChD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,0DAA0D,EAAE,KAAK,IAAI,EAAE;QACxE,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAA;QAE/D,IAAI,SAAS,CAAC,SAAS,IAAI,IAAI,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;SAC1C;QAED,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,IAAI,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;SAC1C;QAED,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC;gBAC9C,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,SAAS,CAAC,SAAS;aAC3B,CAAC,CAAC,CAAA;QAEH,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;QAEhD,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;IAChD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/listening.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/listening.node.d.ts deleted file mode 100644 index 9c74e4ee8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/listening.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=listening.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/listening.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/listening.node.d.ts.map deleted file mode 100644 index 8d6164770..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/listening.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listening.node.d.ts","sourceRoot":"","sources":["../../../test/core/listening.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/listening.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/listening.node.js deleted file mode 100644 index 81e71fe21..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/listening.node.js +++ /dev/null @@ -1,45 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { tcp } from '@libp2p/tcp'; -import { expect } from 'aegir/chai'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -const listenAddr = '/ip4/0.0.0.0/tcp/0'; -describe('Listening', () => { - let peerId; - let libp2p; - before(async () => { - peerId = await createPeerId(); - }); - after(async () => { - await libp2p.stop(); - }); - it('should replace wildcard host and port with actual host and port on startup', async () => { - libp2p = await createLibp2pNode({ - peerId, - addresses: { - listen: [listenAddr] - }, - transports: [ - tcp() - ], - connectionEncryption: [ - plaintext() - ] - }); - await libp2p.start(); - const addrs = libp2p.components.transportManager.getAddrs(); - // Should get something like: - // /ip4/127.0.0.1/tcp/50866 - // /ip4/192.168.1.2/tcp/50866 - expect(addrs.length).to.be.at.least(1); - for (const addr of addrs) { - const opts = addr.toOptions(); - expect(opts.family).to.equal(4); - expect(opts.transport).to.equal('tcp'); - expect(opts.host).to.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/); - expect(opts.port).to.be.gt(0); - } - }); -}); -//# sourceMappingURL=listening.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/listening.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/listening.node.js.map deleted file mode 100644 index 1cd4d3774..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/listening.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listening.node.js","sourceRoot":"","sources":["../../../test/core/listening.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAG3D,MAAM,UAAU,GAAG,oBAAoB,CAAA;AAEvC,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,IAAI,MAAc,CAAA;IAClB,IAAI,MAAkB,CAAA;IAEtB,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,MAAM,GAAG,MAAM,YAAY,EAAE,CAAA;IAC/B,CAAC,CAAC,CAAA;IAEF,KAAK,CAAC,KAAK,IAAI,EAAE;QACf,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,4EAA4E,EAAE,KAAK,IAAI,EAAE;QAC1F,MAAM,GAAG,MAAM,gBAAgB,CAAC;YAC9B,MAAM;YACN,SAAS,EAAE;gBACT,MAAM,EAAE,CAAC,UAAU,CAAC;aACrB;YACD,UAAU,EAAE;gBACV,GAAG,EAAE;aACN;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;QAEpB,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAA;QAE3D,6BAA6B;QAC7B,6BAA6B;QAC7B,+BAA+B;QAC/B,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACtC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE,CAAA;YAC7B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YAC/B,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YACtC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAA;YAC5D,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;SAC9B;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/peer-id.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/peer-id.spec.d.ts deleted file mode 100644 index 6a1b64052..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/peer-id.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=peer-id.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/peer-id.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/peer-id.spec.d.ts.map deleted file mode 100644 index 7d06eaac1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/peer-id.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-id.spec.d.ts","sourceRoot":"","sources":["../../../test/core/peer-id.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/peer-id.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/peer-id.spec.js deleted file mode 100644 index c9883cdb3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/peer-id.spec.js +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-env mocha */ -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { expect } from 'aegir/chai'; -import { createLibp2p } from '../../src/index.js'; -describe('peer-id', () => { - let libp2p; - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('should create a PeerId if none is passed', async () => { - libp2p = await createLibp2p({ - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ] - }); - expect(libp2p.peerId).to.be.ok(); - }); -}); -//# sourceMappingURL=peer-id.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/peer-id.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/peer-id.spec.js.map deleted file mode 100644 index da4596502..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/core/peer-id.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-id.spec.js","sourceRoot":"","sources":["../../../test/core/peer-id.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,YAAY,EAAe,MAAM,oBAAoB,CAAA;AAE9D,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,IAAI,MAAc,CAAA;IAElB,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;SACpB;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,GAAG,MAAM,YAAY,CAAC;YAC1B,UAAU,EAAE;gBACV,UAAU,EAAE;aACb;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;SACF,CAAC,CAAA;QAEF,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAA;IAClC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.browser.d.ts deleted file mode 100644 index 76a8cbd22..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.browser.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Libp2pOptions } from '../../src/index.js'; -import type { ServiceMap } from '@libp2p/interface'; -export declare function createBaseOptions>(overrides?: Libp2pOptions): Libp2pOptions; -//# sourceMappingURL=base-options.browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.browser.d.ts.map deleted file mode 100644 index de49e9388..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-options.browser.d.ts","sourceRoot":"","sources":["../../../test/fixtures/base-options.browser.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,wBAAgB,iBAAiB,CAAE,CAAC,SAAS,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAG,SAAS,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAmBlI"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.browser.js deleted file mode 100644 index cb4bf1def..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.browser.js +++ /dev/null @@ -1,27 +0,0 @@ -import { circuitRelayTransport } from '@libp2p/circuit-relay-v2'; -import { mockConnectionGater } from '@libp2p/interface-compliance-tests/mocks'; -import { mplex } from '@libp2p/mplex'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import mergeOptions from 'merge-options'; -export function createBaseOptions(overrides) { - const options = { - transports: [ - webSockets({ - filter: filters.all - }), - circuitRelayTransport() - ], - streamMuxers: [ - mplex(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }; - return mergeOptions(options, overrides); -} -//# sourceMappingURL=base-options.browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.browser.js.map deleted file mode 100644 index 9b0376976..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-options.browser.js","sourceRoot":"","sources":["../../../test/fixtures/base-options.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAA;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAA;AACrD,OAAO,YAAY,MAAM,eAAe,CAAA;AAIxC,MAAM,UAAU,iBAAiB,CAAmD,SAA4B;IAC9G,MAAM,OAAO,GAAkB;QAC7B,UAAU,EAAE;YACV,UAAU,CAAC;gBACT,MAAM,EAAE,OAAO,CAAC,GAAG;aACpB,CAAC;YACF,qBAAqB,EAAE;SACxB;QACD,YAAY,EAAE;YACZ,KAAK,EAAE;YACP,KAAK,EAAE;SACR;QACD,oBAAoB,EAAE;YACpB,SAAS,EAAE;SACZ;QACD,eAAe,EAAE,mBAAmB,EAAE;KACvC,CAAA;IAED,OAAO,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;AACzC,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.d.ts deleted file mode 100644 index d816a2472..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Libp2pOptions } from '../../src'; -import type { ServiceMap } from '@libp2p/interface'; -export declare function createBaseOptions>(...overrides: Array>): Libp2pOptions; -//# sourceMappingURL=base-options.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.d.ts.map deleted file mode 100644 index bd719bb0d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-options.d.ts","sourceRoot":"","sources":["../../../test/fixtures/base-options.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,wBAAgB,iBAAiB,CAAE,CAAC,SAAS,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAG,GAAG,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAsB3I"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.js deleted file mode 100644 index 4a20946b6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.js +++ /dev/null @@ -1,31 +0,0 @@ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { circuitRelayTransport } from '@libp2p/circuit-relay-v2'; -import { mplex } from '@libp2p/mplex'; -import { plaintext } from '@libp2p/plaintext'; -import { tcp } from '@libp2p/tcp'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import mergeOptions from 'merge-options'; -export function createBaseOptions(...overrides) { - const options = { - addresses: { - listen: [`${process.env.RELAY_MULTIADDR}/p2p-circuit`] - }, - transports: [ - tcp(), - webSockets({ - filter: filters.all - }), - circuitRelayTransport() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ] - }; - return mergeOptions(options, ...overrides); -} -//# sourceMappingURL=base-options.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.js.map deleted file mode 100644 index fb4f2fbc9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/base-options.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-options.js","sourceRoot":"","sources":["../../../test/fixtures/base-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAA;AACrD,OAAO,YAAY,MAAM,eAAe,CAAA;AAIxC,MAAM,UAAU,iBAAiB,CAAmD,GAAG,SAAkC;IACvH,MAAM,OAAO,GAAkB;QAC7B,SAAS,EAAE;YACT,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,cAAc,CAAC;SACvD;QACD,UAAU,EAAE;YACV,GAAG,EAAE;YACL,UAAU,CAAC;gBACT,MAAM,EAAE,OAAO,CAAC,GAAG;aACpB,CAAC;YACF,qBAAqB,EAAE;SACxB;QACD,YAAY,EAAE;YACZ,KAAK,EAAE;YACP,KAAK,EAAE;SACR;QACD,oBAAoB,EAAE;YACpB,SAAS,EAAE;SACZ;KACF,CAAA;IAED,OAAO,YAAY,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,CAAA;AAC5C,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/creators/peer.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/creators/peer.d.ts deleted file mode 100644 index 8fd586a6a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/creators/peer.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { type Libp2pNode } from '../../../src/libp2p.js'; -import type { Libp2pOptions } from '../../../src/index.js'; -import type { Libp2p, ServiceMap } from '@libp2p/interface'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export interface CreatePeerOptions { - /** - * number of peers (default: 1) - */ - number?: number; - /** - * nodes should start (default: true) - */ - started?: boolean; - config?: Libp2pOptions; -} -/** - * Create libp2p nodes. - */ -export declare function createNode(options?: CreatePeerOptions): Promise>; -export declare function populateAddressBooks(peers: Libp2p[]): Promise; -export interface CreatePeerIdOptions { - /** - * Options to pass to the PeerId constructor - */ - opts?: { - type?: 'rsa' | 'ed25519'; - bits?: number; - }; -} -/** - * Create Peer-id - */ -export declare function createPeerId(options?: CreatePeerIdOptions): Promise; -/** - * Create Peer-ids - */ -export declare function createPeerIds(count: number, options?: Omit): Promise; -//# sourceMappingURL=peer.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/creators/peer.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/creators/peer.d.ts.map deleted file mode 100644 index 814b7946b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/creators/peer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer.d.ts","sourceRoot":"","sources":["../../../../test/fixtures/creators/peer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAIvD,MAAM,WAAW,iBAAiB,CAAE,CAAC,SAAS,UAAU;IACtD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB,MAAM,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;CAC1B;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAE,CAAC,SAAS,UAAU,EAAG,OAAO,GAAE,iBAAiB,CAAC,CAAC,CAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CA6BnH;AAED,wBAAsB,oBAAoB,CAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAU1E;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,CAAA;QACxB,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;CACF;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAE,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CAItF;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAE,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAIzH"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/creators/peer.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/creators/peer.js deleted file mode 100644 index 194ca26ee..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/creators/peer.js +++ /dev/null @@ -1,63 +0,0 @@ -import { createEd25519PeerId, createRSAPeerId } from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import pTimes from 'p-times'; -import { createLibp2pNode } from '../../../src/libp2p.js'; -import { createBaseOptions } from '../base-options.browser.js'; -const listenAddr = multiaddr('/ip4/127.0.0.1/tcp/0'); -/** - * Create libp2p nodes. - */ -export async function createNode(options = {}) { - const started = options.started ?? true; - const config = options.config ?? {}; - const peerId = await createPeerId(); - const addresses = started - ? { - listen: [listenAddr.toString()], - announce: [], - noAnnounce: [], - announceFilter: (addrs) => addrs - } - : { - listen: [], - announce: [], - noAnnounce: [], - announceFilter: (addrs) => addrs - }; - const peer = await createLibp2pNode(createBaseOptions({ - peerId, - addresses, - start: started, - ...config - })); - if (started) { - await peer.start(); - } - return peer; -} -export async function populateAddressBooks(peers) { - for (let i = 0; i < peers.length; i++) { - for (let j = 0; j < peers.length; j++) { - if (i !== j) { - await peers[i].peerStore.patch(peers[j].peerId, { - multiaddrs: peers[j].getMultiaddrs() - }); - } - } - } -} -/** - * Create Peer-id - */ -export async function createPeerId(options = {}) { - const opts = options.opts ?? {}; - return opts.type === 'rsa' ? createRSAPeerId({ bits: opts.bits ?? 512 }) : createEd25519PeerId(); -} -/** - * Create Peer-ids - */ -export async function createPeerIds(count, options = {}) { - const opts = options.opts ?? {}; - return pTimes(count, async (i) => createPeerId({ opts })); -} -//# sourceMappingURL=peer.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/creators/peer.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/creators/peer.js.map deleted file mode 100644 index 54db26ed6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/creators/peer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer.js","sourceRoot":"","sources":["../../../../test/fixtures/creators/peer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,gBAAgB,EAAmB,MAAM,wBAAwB,CAAA;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAM9D,MAAM,UAAU,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAA;AAgBpD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAyB,UAAgC,EAAE;IACzF,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,CAAA;IACvC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,EAAE,CAAA;IACnC,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAA;IACnC,MAAM,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AAO,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,mBAAmB,EAAE,CAAA;AAClG,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAE,KAAa,EAAE,UAAgD,EAAE;IACpG,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAAA;IAE/B,OAAO,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AAC3D,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/echo-service.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/echo-service.d.ts deleted file mode 100644 index 0e7733ab2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/echo-service.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Registrar } from '@libp2p/interface-internal/registrar'; -export declare const ECHO_PROTOCOL = "/echo/1.0.0"; -export interface EchoInit { - protocol?: string; -} -export interface EchoComponents { - registrar: Registrar; -} -export declare function echo(init?: EchoInit): (components: EchoComponents) => unknown; -//# sourceMappingURL=echo-service.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/echo-service.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/echo-service.d.ts.map deleted file mode 100644 index d7f6f3d04..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/echo-service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"echo-service.d.ts","sourceRoot":"","sources":["../../../test/fixtures/echo-service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAErE,eAAO,MAAM,aAAa,gBAAgB,CAAA;AAE1C,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,SAAS,CAAA;CACrB;AAyBD,wBAAgB,IAAI,CAAE,IAAI,GAAE,QAAa,GAAG,CAAC,UAAU,EAAE,cAAc,KAAK,OAAO,CAIlF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/echo-service.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/echo-service.js deleted file mode 100644 index 2610f79bd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/echo-service.js +++ /dev/null @@ -1,27 +0,0 @@ -import { pipe } from 'it-pipe'; -export const ECHO_PROTOCOL = '/echo/1.0.0'; -class EchoService { - protocol; - registrar; - constructor(components, init = {}) { - this.protocol = init.protocol ?? ECHO_PROTOCOL; - this.registrar = components.registrar; - } - async start() { - await this.registrar.handle(this.protocol, ({ stream }) => { - void pipe(stream, stream) - // sometimes connections are closed before multistream-select finishes - // which causes an error - .catch(); - }); - } - async stop() { - await this.registrar.unhandle(this.protocol); - } -} -export function echo(init = {}) { - return (components) => { - return new EchoService(components, init); - }; -} -//# sourceMappingURL=echo-service.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/echo-service.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/echo-service.js.map deleted file mode 100644 index 6aa1a5d72..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/echo-service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"echo-service.js","sourceRoot":"","sources":["../../../test/fixtures/echo-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAI9B,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAA;AAU1C,MAAM,WAAW;IACE,QAAQ,CAAQ;IAChB,SAAS,CAAW;IAErC,YAAa,UAA0B,EAAE,OAAiB,EAAE;QAC1D,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,aAAa,CAAA;QAC9C,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAA;IACvC,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;YACxD,KAAK,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;gBACvB,sEAAsE;gBACtE,wBAAwB;iBACvB,KAAK,EAAE,CAAA;QACZ,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC9C,CAAC;CACF;AAED,MAAM,UAAU,IAAI,CAAE,OAAiB,EAAE;IACvC,OAAO,CAAC,UAAU,EAAE,EAAE;QACpB,OAAO,IAAI,WAAW,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;IAC1C,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/match-peer-id.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/match-peer-id.d.ts deleted file mode 100644 index 344fbcd01..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/match-peer-id.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import Sinon from 'sinon'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export declare function matchPeerId(peerId: PeerId): Sinon.SinonMatcher; -//# sourceMappingURL=match-peer-id.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/match-peer-id.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/match-peer-id.d.ts.map deleted file mode 100644 index 17083c74d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/match-peer-id.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"match-peer-id.d.ts","sourceRoot":"","sources":["../../../test/fixtures/match-peer-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,wBAAgB,WAAW,CAAE,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAE/D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/match-peer-id.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/match-peer-id.js deleted file mode 100644 index 699cedd88..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/match-peer-id.js +++ /dev/null @@ -1,5 +0,0 @@ -import Sinon from 'sinon'; -export function matchPeerId(peerId) { - return Sinon.match(p => p.toString() === peerId.toString()); -} -//# sourceMappingURL=match-peer-id.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/match-peer-id.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/match-peer-id.js.map deleted file mode 100644 index 0032df46f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/fixtures/match-peer-id.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"match-peer-id.js","sourceRoot":"","sources":["../../../test/fixtures/match-peer-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,UAAU,WAAW,CAAE,MAAc;IACzC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAA;AAC7D,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/interop.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/interop.d.ts deleted file mode 100644 index f160cf14e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/interop.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=interop.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/interop.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/interop.d.ts.map deleted file mode 100644 index 14efbf496..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/interop.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interop.d.ts","sourceRoot":"","sources":["../../test/interop.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/interop.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/interop.js deleted file mode 100644 index 093dd456a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/interop.js +++ /dev/null @@ -1,197 +0,0 @@ -import fs from 'fs'; -import { gossipsub } from '@chainsafe/libp2p-gossipsub'; -import { noise } from '@chainsafe/libp2p-noise'; -import { yamux } from '@chainsafe/libp2p-yamux'; -import { circuitRelayServer, circuitRelayTransport } from '@libp2p/circuit-relay-v2'; -import { unmarshalPrivateKey } from '@libp2p/crypto/keys'; -import { createClient } from '@libp2p/daemon-client'; -import { createServer } from '@libp2p/daemon-server'; -import { floodsub } from '@libp2p/floodsub'; -import { identify } from '@libp2p/identify'; -import { contentRouting } from '@libp2p/interface/content-routing'; -import { peerDiscovery } from '@libp2p/interface/peer-discovery'; -import { peerRouting } from '@libp2p/interface/peer-routing'; -import { interopTests } from '@libp2p/interop'; -import { kadDHT } from '@libp2p/kad-dht'; -import { logger } from '@libp2p/logger'; -import { mplex } from '@libp2p/mplex'; -import { peerIdFromKeys } from '@libp2p/peer-id'; -import { tcp } from '@libp2p/tcp'; -import { multiaddr } from '@multiformats/multiaddr'; -import { execa } from 'execa'; -import { path as p2pd } from 'go-libp2p'; -import pDefer from 'p-defer'; -import { createLibp2p } from '../src/index.js'; -/** - * @packageDocumentation - * - * To enable debug logging, run the tests with the following env vars: - * - * ```console - * DEBUG=libp2p*,go-libp2p:* npm run test:interop - * ``` - */ -async function createGoPeer(options) { - const controlPort = Math.floor(Math.random() * (50000 - 10000 + 1)) + 10000; - const apiAddr = multiaddr(`/ip4/127.0.0.1/tcp/${controlPort}`); - const log = logger(`go-libp2p:${controlPort}`); - const opts = [ - `-listen=${apiAddr.toString()}` - ]; - if (options.noListen === true) { - opts.push('-noListenAddrs'); - } - else { - opts.push('-hostAddrs=/ip4/127.0.0.1/tcp/0'); - } - if (options.noise === true) { - opts.push('-noise=true'); - } - if (options.dht === true) { - opts.push('-dhtServer'); - } - if (options.relay === true) { - opts.push('-relay'); - } - if (options.pubsub === true) { - opts.push('-pubsub'); - } - if (options.pubsubRouter != null) { - opts.push(`-pubsubRouter=${options.pubsubRouter}`); - } - if (options.key != null) { - opts.push(`-id=${options.key}`); - } - if (options.muxer === 'mplex') { - opts.push('-muxer=mplex'); - } - else { - opts.push('-muxer=yamux'); - } - const deferred = pDefer(); - const proc = execa(p2pd(), opts, { - env: { - GOLOG_LOG_LEVEL: 'debug' - } - }); - proc.stdout?.on('data', (buf) => { - const str = buf.toString(); - log(str); - // daemon has started - if (str.includes('Control socket:')) { - deferred.resolve(); - } - }); - proc.stderr?.on('data', (buf) => { - log.error(buf.toString()); - }); - await deferred.promise; - return { - client: createClient(apiAddr), - stop: async () => { - proc.kill(); - } - }; -} -async function createJsPeer(options) { - let peerId; - if (options.key != null) { - const keyFile = fs.readFileSync(options.key); - const privateKey = await unmarshalPrivateKey(keyFile); - peerId = await peerIdFromKeys(privateKey.public.bytes, privateKey.bytes); - } - const opts = { - peerId, - addresses: { - listen: options.noListen === true ? [] : ['/ip4/127.0.0.1/tcp/0'] - }, - transports: [tcp(), circuitRelayTransport()], - streamMuxers: [], - connectionEncryption: [noise()], - connectionManager: { - minConnections: 0 - } - }; - const services = { - identify: identify() - }; - if (options.muxer === 'mplex') { - opts.streamMuxers?.push(mplex()); - } - else { - opts.streamMuxers?.push(yamux()); - } - if (options.pubsub === true) { - if (options.pubsubRouter === 'floodsub') { - services.pubsub = floodsub(); - } - else { - services.pubsub = gossipsub(); - } - } - if (options.relay === true) { - services.relay = circuitRelayServer(); - } - if (options.dht === true) { - services.dht = (components) => { - const dht = kadDHT({ - clientMode: false - })(components); - // go-libp2p-daemon only has the older single-table DHT instead of the dual - // lan/wan version found in recent go-ipfs versions. unfortunately it's been - // abandoned so here we simulate the older config with the js implementation - const lan = dht.lan; - const protocol = '/ipfs/kad/1.0.0'; - lan.protocol = protocol; - lan.network.protocol = protocol; - lan.topologyListener.protocol = protocol; - Object.defineProperties(lan, { - [contentRouting]: { - get() { - return dht[contentRouting]; - } - }, - [peerRouting]: { - get() { - return dht[peerRouting]; - } - }, - [peerDiscovery]: { - get() { - return dht[peerDiscovery]; - } - } - }); - return lan; - }; - } - const node = await createLibp2p({ - ...opts, - services - }); - const server = createServer(multiaddr('/ip4/0.0.0.0/tcp/0'), node); - await server.start(); - return { - client: createClient(server.getMultiaddr()), - stop: async () => { - await server.stop(); - await node.stop(); - } - }; -} -async function main() { - const factory = { - async spawn(options) { - if (options.type === 'go') { - return createGoPeer(options); - } - return createJsPeer(options); - } - }; - await interopTests(factory); -} -main().catch(err => { - console.error(err); // eslint-disable-line no-console - process.exit(1); -}); -//# sourceMappingURL=interop.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/interop.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/interop.js.map deleted file mode 100644 index bb68e4de3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/interop.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interop.js","sourceRoot":"","sources":["../../test/interop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBA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line at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.node.d.ts deleted file mode 100644 index 95867294f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.node.d.ts.map deleted file mode 100644 index d01c584d3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../../test/peer-discovery/index.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.node.js deleted file mode 100644 index 5ebb0631a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.node.js +++ /dev/null @@ -1,185 +0,0 @@ -/* eslint-env mocha */ -import { bootstrap } from '@libp2p/bootstrap'; -import { randomBytes } from '@libp2p/crypto'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { peerDiscovery } from '@libp2p/interface/peer-discovery'; -import { kadDHT } from '@libp2p/kad-dht'; -import { mdns } from '@libp2p/mdns'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import defer from 'p-defer'; -import sinon from 'sinon'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { createLibp2p } from '../../src/index.js'; -import { createBaseOptions } from '../fixtures/base-options.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -const listenAddr = multiaddr('/ip4/127.0.0.1/tcp/0'); -class TestPeerDiscovery extends TypedEventEmitter { - get [peerDiscovery]() { - return this; - } - [Symbol.toStringTag] = '@libp2p/test-peer-discovery'; -} -describe('peer discovery scenarios', () => { - let peerId; - let remotePeerId1; - let remotePeerId2; - let libp2p; - beforeEach(async () => { - [peerId, remotePeerId1, remotePeerId2] = await Promise.all([ - createPeerId(), - createPeerId(), - createPeerId() - ]); - }); - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('should ignore self on discovery', async () => { - const discovery = new TestPeerDiscovery(); - libp2p = await createLibp2p(createBaseOptions({ - peerId, - peerDiscovery: [ - () => discovery - ] - })); - await libp2p.start(); - const discoverySpy = sinon.spy(); - libp2p.addEventListener('peer:discovery', discoverySpy); - discovery.safeDispatchEvent('peer', { - detail: { - id: libp2p.peerId, - multiaddrs: [], - protocols: [] - } - }); - expect(discoverySpy.called).to.eql(false); - }); - it('bootstrap should discover all peers in the list', async () => { - const deferred = defer(); - const bootstrappers = [ - `${listenAddr.toString()}/p2p/${remotePeerId1.toString()}`, - `${listenAddr.toString()}/p2p/${remotePeerId2.toString()}` - ]; - libp2p = await createLibp2p(createBaseOptions({ - peerId, - addresses: { - listen: [ - listenAddr.toString() - ] - }, - peerDiscovery: [ - bootstrap({ - list: bootstrappers - }) - ] - })); - const expectedPeers = new Set([ - remotePeerId1.toString(), - remotePeerId2.toString() - ]); - libp2p.addEventListener('peer:discovery', (evt) => { - const { id } = evt.detail; - expectedPeers.delete(id.toString()); - if (expectedPeers.size === 0) { - libp2p.removeEventListener('peer:discovery'); - deferred.resolve(); - } - }); - await libp2p.start(); - return deferred.promise; - }); - it('MulticastDNS should discover all peers on the local network', async () => { - const deferred = defer(); - // use a random tag to prevent CI collision - const serviceTag = `libp2p-test-${uint8ArrayToString(randomBytes(4), 'base16')}.local`; - const getConfig = (peerId) => createBaseOptions({ - peerId, - addresses: { - listen: [ - listenAddr.toString() - ] - }, - peerDiscovery: [ - mdns({ - interval: 200, - serviceTag - }) - ] - }); - libp2p = await createLibp2p(getConfig(peerId)); - const remoteLibp2p1 = await createLibp2p(getConfig(remotePeerId1)); - const remoteLibp2p2 = await createLibp2p(getConfig(remotePeerId2)); - const expectedPeers = new Set([ - remotePeerId1.toString(), - remotePeerId2.toString() - ]); - libp2p.addEventListener('peer:discovery', (evt) => { - const { id } = evt.detail; - expectedPeers.delete(id.toString()); - if (expectedPeers.size === 0) { - libp2p.removeEventListener('peer:discovery'); - deferred.resolve(); - } - }); - await Promise.all([ - remoteLibp2p1.start(), - remoteLibp2p2.start(), - libp2p.start() - ]); - await deferred.promise; - await remoteLibp2p1.stop(); - await remoteLibp2p2.stop(); - }); - it('kad-dht should discover other peers', async () => { - const deferred = defer(); - const getConfig = (peerId) => createBaseOptions({ - peerId, - addresses: { - listen: [ - listenAddr.toString() - ] - }, - services: { - dht: kadDHT() - } - }); - const localConfig = getConfig(peerId); - libp2p = await createLibp2p(localConfig); - const remoteLibp2p1 = await createLibp2p(getConfig(remotePeerId1)); - const remoteLibp2p2 = await createLibp2p(getConfig(remotePeerId2)); - libp2p.addEventListener('peer:discovery', (evt) => { - const { id } = evt.detail; - if (id.equals(remotePeerId1)) { - libp2p.removeEventListener('peer:discovery'); - deferred.resolve(); - } - }); - await Promise.all([ - libp2p.start(), - remoteLibp2p1.start(), - remoteLibp2p2.start() - ]); - await libp2p.peerStore.patch(remotePeerId1, { - multiaddrs: remoteLibp2p1.getMultiaddrs() - }); - await remoteLibp2p2.peerStore.patch(remotePeerId1, { - multiaddrs: remoteLibp2p1.getMultiaddrs() - }); - // Topology: - // A -> B - // C -> B - await Promise.all([ - libp2p.dial(remotePeerId1), - remoteLibp2p2.dial(remotePeerId1) - ]); - await deferred.promise; - return Promise.all([ - remoteLibp2p1.stop(), - remoteLibp2p2.stop() - ]); - }); -}); -//# sourceMappingURL=index.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.node.js.map deleted file mode 100644 index 3a2b8982b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.node.js","sourceRoot":"","sources":["../../../test/peer-discovery/index.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAO3D,MAAM,UAAU,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAA;AAEpD,MAAM,iBAAkB,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aAAa,CAAC,KAAK,EAAE;YACrB,aAAa,CAAC,KAAK,EAAE;SACtB,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,EAAE;YAC1C,UAAU,EAAE,aAAa,CAAC,aAAa,EAAE;SAC1C,CAAC,CAAA;QACF,MAAM,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,EAAE;YACjD,UAAU,EAAE,aAAa,CAAC,aAAa,EAAE;SAC1C,CAAC,CAAA;QAEF,YAAY;QACZ,SAAS;QACT,SAAS;QACT,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;YAC1B,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC;SAClC,CAAC,CAAA;QAEF,MAAM,QAAQ,CAAC,OAAO,CAAA;QACtB,OAAO,OAAO,CAAC,GAAG,CAAC;YACjB,aAAa,CAAC,IAAI,EAAE;YACpB,aAAa,CAAC,IAAI,EAAE;SACrB,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.spec.d.ts deleted file mode 100644 index b37c2d278..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.spec.d.ts.map deleted file mode 100644 index ddc4c2518..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../../test/peer-discovery/index.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.spec.js deleted file mode 100644 index 96db53097..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.spec.js +++ /dev/null @@ -1,38 +0,0 @@ -/* eslint-env mocha */ -import { expect } from 'aegir/chai'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { createBaseOptions } from '../fixtures/base-options.browser.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -describe('peer discovery', () => { - describe('basic functions', () => { - let peerId; - let libp2p; - before(async () => { - peerId = await createPeerId(); - }); - afterEach(async () => { - if (libp2p != null) { - await libp2p.stop(); - } - sinon.reset(); - }); - it('should start/stop startable discovery on libp2p start/stop', async () => { - const discovery = stubInterface(); - libp2p = await createLibp2pNode(createBaseOptions({ - peerId, - peerDiscovery: [ - () => discovery - ] - })); - await libp2p.start(); - expect(discovery.start.calledOnce).to.be.true(); - expect(discovery.stop.called).to.be.false(); - await libp2p.stop(); - expect(discovery.start.calledOnce).to.be.true(); - expect(discovery.stop.calledOnce).to.be.true(); - }); - }); -}); -//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.spec.js.map deleted file mode 100644 index 262766661..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-discovery/index.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../test/peer-discovery/index.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAK3D,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;QAC/B,IAAI,MAAc,CAAA;QAClB,IAAI,MAAkB,CAAA;QAEtB,MAAM,CAAC,KAAK,IAAI,EAAE;YAChB,MAAM,GAAG,MAAM,YAAY,EAAE,CAAA;QAC/B,CAAC,CAAC,CAAA;QAEF,SAAS,CAAC,KAAK,IAAI,EAAE;YACnB,IAAI,MAAM,IAAI,IAAI,EAAE;gBAClB,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;aACpB;YAED,KAAK,CAAC,KAAK,EAAE,CAAA;QACf,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,4DAA4D,EAAE,KAAK,IAAI,EAAE;YAC1E,MAAM,SAAS,GAAG,aAAa,EAA6B,CAAA;YAE5D,MAAM,GAAG,MAAM,gBAAgB,CAAC,iBAAiB,CAAC;gBAChD,MAAM;gBACN,aAAa,EAAE;oBACb,GAAG,EAAE,CAAC,SAAS;iBAChB;aACF,CAAC,CAAC,CAAA;YAEH,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;YACpB,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;YAC/C,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;YAE3C,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;YACnB,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;YAC/C,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QAChD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/peer-routing.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/peer-routing.node.d.ts deleted file mode 100644 index 9f5c2bfd9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/peer-routing.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=peer-routing.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/peer-routing.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/peer-routing.node.d.ts.map deleted file mode 100644 index 6b4f26365..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/peer-routing.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-routing.node.d.ts","sourceRoot":"","sources":["../../../test/peer-routing/peer-routing.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/peer-routing.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/peer-routing.node.js deleted file mode 100644 index 52cd620c5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/peer-routing.node.js +++ /dev/null @@ -1,449 +0,0 @@ -/* eslint-env mocha */ -import { EventTypes, MessageType } from '@libp2p/kad-dht'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import delay from 'delay'; -import all from 'it-all'; -import drain from 'it-drain'; -import pDefer from 'p-defer'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { createBaseOptions } from '../fixtures/base-options.js'; -import { createNode, createPeerId, populateAddressBooks } from '../fixtures/creators/peer.js'; -import { createRoutingOptions } from './utils.js'; -describe('peer-routing', () => { - let peerId; - beforeEach(async () => { - peerId = await createEd25519PeerId(); - }); - describe('no routers', () => { - let node; - before(async () => { - node = await createNode({ - config: createBaseOptions() - }); - }); - after(async () => { await node.stop(); }); - it('.findPeer should return an error', async () => { - await expect(node.peerRouting.findPeer(peerId)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_NO_ROUTERS_AVAILABLE'); - }); - it('.getClosestPeers should return an error', async () => { - try { - for await (const _ of node.peerRouting.getClosestPeers(peerId.toBytes())) { } // eslint-disable-line - throw new Error('.getClosestPeers should return an error'); - } - catch (err) { - expect(err).to.exist(); - expect(err.code).to.equal('ERR_NO_ROUTERS_AVAILABLE'); - } - }); - }); - describe('via dht router', () => { - let nodes; - before(async () => { - nodes = await Promise.all([ - createNode({ config: createRoutingOptions() }), - createNode({ config: createRoutingOptions() }), - createNode({ config: createRoutingOptions() }), - createNode({ config: createRoutingOptions() }), - createNode({ config: createRoutingOptions() }) - ]); - await populateAddressBooks(nodes); - // Ring dial - await Promise.all(nodes.map(async (peer, i) => peer.dial(nodes[(i + 1) % nodes.length].peerId))); - }); - after(() => { - sinon.restore(); - }); - after(async () => Promise.all(nodes.map(async (n) => { await n.stop(); }))); - it('should use the nodes dht', async () => { - if (nodes[0].services.dht == null) { - throw new Error('DHT not configured'); - } - const dhtFindPeerStub = sinon.stub(nodes[0].services.dht, 'findPeer').callsFake(async function* () { - yield { - from: nodes[2].peerId, - type: EventTypes.FINAL_PEER, - name: 'FINAL_PEER', - peer: { - id: nodes[1].peerId, - multiaddrs: [], - protocols: [] - } - }; - }); - expect(dhtFindPeerStub.called).to.be.false(); - await nodes[0].peerRouting.findPeer(nodes[1].peerId); - expect(dhtFindPeerStub.called).to.be.true(); - dhtFindPeerStub.restore(); - }); - it('should use the nodes dht to get the closest peers', async () => { - if (nodes[0].services.dht == null) { - throw new Error('DHT not configured'); - } - const dhtGetClosestPeersStub = sinon.stub(nodes[0].services.dht, 'getClosestPeers').callsFake(async function* () { - yield { - from: nodes[2].peerId, - type: EventTypes.FINAL_PEER, - name: 'FINAL_PEER', - messageName: 'FIND_NODE', - messageType: MessageType.FIND_NODE, - peer: { - id: nodes[1].peerId, - multiaddrs: [], - protocols: [] - } - }; - }); - expect(dhtGetClosestPeersStub.called).to.be.false(); - await drain(nodes[0].peerRouting.getClosestPeers(nodes[1].peerId.toBytes())); - expect(dhtGetClosestPeersStub.called).to.be.true(); - dhtGetClosestPeersStub.restore(); - }); - it('should error when peer tries to find itself', async () => { - await expect(nodes[0].peerRouting.findPeer(nodes[0].peerId)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_FIND_SELF'); - }); - it('should handle error thrown synchronously during find peer', async () => { - const unknownPeer = await createPeerId(); - // @ts-expect-error private field - nodes[0].peerRouting.routers = [{ - findPeer() { - throw new Error('Thrown sync'); - } - }]; - await expect(nodes[0].peerRouting.findPeer(unknownPeer)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_NOT_FOUND'); - }); - it('should handle error thrown asynchronously during find peer', async () => { - const unknownPeer = await createPeerId(); - // @ts-expect-error private field - nodes[0].peerRouting.routers = [{ - async findPeer() { - throw new Error('Thrown async'); - } - }]; - await expect(nodes[0].peerRouting.findPeer(unknownPeer)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_NOT_FOUND'); - }); - it('should handle error thrown asynchronously after delay during find peer', async () => { - const unknownPeer = await createPeerId(); - // @ts-expect-error private field - nodes[0].peerRouting.routers = [{ - async findPeer() { - await delay(100); - throw new Error('Thrown async after delay'); - } - }]; - await expect(nodes[0].peerRouting.findPeer(unknownPeer)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_NOT_FOUND'); - }); - it('should return value when one router errors synchronously and another returns a value', async () => { - const peer = await createPeerId(); - // @ts-expect-error private field - nodes[0].peerRouting.routers = [{ - findPeer() { - throw new Error('Thrown sync'); - } - }, { - async findPeer() { - return Promise.resolve({ - id: peer, - multiaddrs: [] - }); - } - }]; - await expect(nodes[0].peerRouting.findPeer(peer)) - .to.eventually.deep.equal({ - id: peer, - multiaddrs: [] - }); - }); - it('should return value when one router errors asynchronously and another returns a value', async () => { - const peer = await createPeerId(); - // @ts-expect-error private field - nodes[0].peerRouting.routers = [{ - async findPeer() { - throw new Error('Thrown sync'); - } - }, { - async findPeer() { - return Promise.resolve({ - id: peer, - multiaddrs: [] - }); - } - }]; - await expect(nodes[0].peerRouting.findPeer(peer)) - .to.eventually.deep.equal({ - id: peer, - multiaddrs: [] - }); - }); - }); - describe('via delegate router', () => { - let node; - let delegate; - beforeEach(async () => { - delegate = stubInterface(); - delegate.findPeer.rejects(new Error('Could not find peer')); - delegate.getClosestPeers.returns(async function* () { }()); - node = await createNode({ - config: createBaseOptions({ - peerRouters: [ - () => delegate - ] - }) - }); - }); - afterEach(() => { - sinon.restore(); - }); - afterEach(async () => { await node.stop(); }); - it('should only have one router', () => { - // @ts-expect-error private field - expect(node.peerRouting.routers).to.have.lengthOf(1); - }); - it('should use the delegate router to find peers', async () => { - const remotePeerId = await createPeerId(); - delegate.findPeer.callsFake(async function () { - return { - id: remotePeerId, - multiaddrs: [], - protocols: [] - }; - }); - expect(delegate.findPeer.called).to.be.false(); - await node.peerRouting.findPeer(remotePeerId); - expect(delegate.findPeer.called).to.be.true(); - }); - it('should use the delegate router to get the closest peers', async () => { - const remotePeerId = await createPeerId(); - delegate.getClosestPeers.callsFake(async function* () { - yield { - id: remotePeerId, - multiaddrs: [], - protocols: [] - }; - }); - expect(delegate.getClosestPeers.called).to.be.false(); - await drain(node.peerRouting.getClosestPeers(remotePeerId.toBytes())); - expect(delegate.getClosestPeers.called).to.be.true(); - }); - it('should error when peer tries to find itself', async () => { - await expect(node.peerRouting.findPeer(node.peerId)) - .to.eventually.be.rejected() - .and.to.have.property('code', 'ERR_FIND_SELF'); - }); - it('should handle errors from the delegate when finding closest peers', async () => { - const remotePeerId = await createPeerId(); - delegate.getClosestPeers.callsFake(async function* () { - throw new Error('Could not find closer peers'); - }); - expect(delegate.getClosestPeers.called).to.be.false(); - await expect(drain(node.peerRouting.getClosestPeers(remotePeerId.toBytes()))) - .to.eventually.be.rejectedWith('Could not find closer peers'); - }); - }); - describe('via dht and delegate routers', () => { - let node; - let delegate; - beforeEach(async () => { - delegate = stubInterface(); - delegate.findPeer.throws(new Error('Could not find peer')); - delegate.getClosestPeers.returns(async function* () { }()); - node = await createNode({ - config: createRoutingOptions({ - peerRouters: [ - () => delegate - ] - }) - }); - }); - afterEach(() => { - sinon.restore(); - }); - afterEach(async () => { await node.stop(); }); - it('should use the delegate if the dht fails to find the peer', async () => { - const remotePeerId = await createPeerId(); - const results = { - id: remotePeerId, - multiaddrs: [], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - sinon.stub(node.services.dht, 'findPeer').callsFake(async function* () { }); - delegate.findPeer.reset(); - delegate.findPeer.callsFake(async () => { - return results; - }); - const peer = await node.peerRouting.findPeer(remotePeerId); - expect(peer).to.eql(results); - }); - it('should not wait for the dht to return if the delegate does first', async () => { - const remotePeerId = await createPeerId(); - const results = { - id: remotePeerId, - multiaddrs: [], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - const defer = pDefer(); - sinon.stub(node.services.dht, 'findPeer').callsFake(async function* () { - yield { - name: 'SEND_QUERY', - type: EventTypes.SEND_QUERY, - to: remotePeerId, - messageName: 'FIND_NODE', - messageType: MessageType.FIND_NODE - }; - await defer.promise; - }); - delegate.findPeer.reset(); - delegate.findPeer.callsFake(async () => { - return results; - }); - const peer = await node.peerRouting.findPeer(remotePeerId); - expect(peer).to.eql(results); - defer.resolve(); - }); - it('should not wait for the delegate to return if the dht does first', async () => { - const remotePeerId = await createPeerId(); - const result = { - id: remotePeerId, - multiaddrs: [], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - const defer = pDefer(); - sinon.stub(node.services.dht, 'findPeer').callsFake(async function* () { - yield { - from: remotePeerId, - name: 'FINAL_PEER', - type: EventTypes.FINAL_PEER, - peer: result - }; - }); - delegate.findPeer.reset(); - delegate.findPeer.callsFake(async () => { - return defer.promise; - }); - const peer = await node.peerRouting.findPeer(remotePeerId); - expect(peer).to.eql(result); - defer.resolve(result); - }); - it('should store the addresses of the found peer', async () => { - const remotePeerId = await createPeerId(); - const result = { - id: remotePeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/38982') - ], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - const spy = sinon.spy(node.peerStore, 'merge'); - sinon.stub(node.services.dht, 'findPeer').callsFake(async function* () { - yield { - from: remotePeerId, - name: 'FINAL_PEER', - type: EventTypes.FINAL_PEER, - peer: result - }; - }); - delegate.findPeer.reset(); - delegate.findPeer.callsFake(async () => { - const deferred = pDefer(); - return deferred.promise; - }); - await node.peerRouting.findPeer(remotePeerId); - expect(spy.calledWith(result.id, { - multiaddrs: result.multiaddrs - })).to.be.true(); - }); - it('should use the delegate if the dht fails to get the closest peer', async () => { - const remotePeerId = await createPeerId(); - const results = [{ - id: remotePeerId, - multiaddrs: [], - protocols: [] - }]; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - sinon.stub(node.services.dht, 'getClosestPeers').callsFake(async function* () { }); - delegate.getClosestPeers.callsFake(async function* () { - yield results[0]; - }); - const closest = await all(node.peerRouting.getClosestPeers(remotePeerId.toBytes())); - expect(closest).to.have.length.above(0); - expect(closest).to.eql(results); - }); - it('should store the addresses of the closest peer', async () => { - const remotePeerId = await createPeerId(); - const result = { - id: remotePeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/38982') - ], - protocols: [] - }; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - const spy = sinon.spy(node.peerStore, 'merge'); - sinon.stub(node.services.dht, 'getClosestPeers').callsFake(async function* () { }); - delegate.getClosestPeers.callsFake(async function* () { - yield result; - }); - await drain(node.peerRouting.getClosestPeers(remotePeerId.toBytes())); - expect(spy.calledWith(result.id, { - multiaddrs: result.multiaddrs - })).to.be.true(); - }); - it('should dedupe closest peers', async () => { - const remotePeerId = await createPeerId(); - const results = [{ - id: remotePeerId, - multiaddrs: [ - multiaddr('/ip4/123.123.123.123/tcp/38982') - ], - protocols: [] - }]; - if (node.services.dht == null) { - throw new Error('DHT not configured'); - } - sinon.stub(node.services.dht, 'getClosestPeers').callsFake(async function* () { - for (const peer of results) { - yield { - from: remotePeerId, - name: 'FINAL_PEER', - type: EventTypes.FINAL_PEER, - peer - }; - } - }); - delegate.getClosestPeers.callsFake(async function* () { - yield* results; - }); - const peers = await all(node.peerRouting.getClosestPeers(remotePeerId.toBytes())); - expect(peers).to.be.an('array').with.a.lengthOf(1).that.deep.equals(results); - }); - }); -}); -//# sourceMappingURL=peer-routing.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/peer-routing.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/peer-routing.node.js.map deleted file mode 100644 index fccc46d67..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/peer-routing.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer-routing.node.js","sourceRoot":"","sources":["../../../test/peer-routing/peer-routing.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAe,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,GAAG,MAAM,QAAQ,CAAA;AACxB,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAwB,aAAa,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAOjD,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAI,MAAc,CAAA;IAElB,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,GAAG,MAAM,mBAAmB,EAAE,CAAA;IACtC,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;QAC1B,IAAI,IAAgB,CAAA;QAEpB,MAAM,CAAC,KAAK,IAAI,EAAE;YAChB,IAAI,GAAG,MAAM,UAAU,CAAC;gBACtB,MAAM,EAAE,iBAAiB,EAAE;aAC5B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AC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAC9E,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/utils.d.ts deleted file mode 100644 index 3d1c83fcd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/utils.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Libp2pOptions } from '../../src/index.js'; -import type { KadDHT } from '@libp2p/kad-dht'; -export declare function createRoutingOptions(...overrides: Libp2pOptions[]): Libp2pOptions<{ - dht: KadDHT; -}>; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/utils.d.ts.map deleted file mode 100644 index 405f5d650..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../test/peer-routing/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C,wBAAgB,oBAAoB,CAAE,GAAG,SAAS,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAMnG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/utils.js deleted file mode 100644 index 62abfb2ec..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/utils.js +++ /dev/null @@ -1,10 +0,0 @@ -import { kadDHT } from '@libp2p/kad-dht'; -import { createBaseOptions } from '../fixtures/base-options.js'; -export function createRoutingOptions(...overrides) { - return createBaseOptions({ - services: { - dht: kadDHT() - } - }, ...overrides); -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/utils.js.map deleted file mode 100644 index d527ca63f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/peer-routing/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../test/peer-routing/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAI/D,MAAM,UAAU,oBAAoB,CAAE,GAAG,SAA0B;IACjE,OAAO,iBAAiB,CAAC;QACvB,QAAQ,EAAE;YACR,GAAG,EAAE,MAAM,EAAE;SACd;KACF,EAAE,GAAG,SAAS,CAAC,CAAA;AAClB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/registrar/registrar.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/registrar/registrar.spec.d.ts deleted file mode 100644 index 49a866882..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/registrar/registrar.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=registrar.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/registrar/registrar.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/registrar/registrar.spec.d.ts.map deleted file mode 100644 index 222915a66..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/registrar/registrar.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registrar.spec.d.ts","sourceRoot":"","sources":["../../../test/registrar/registrar.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/registrar/registrar.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/registrar/registrar.spec.js deleted file mode 100644 index 10e85a47c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/registrar/registrar.spec.js +++ /dev/null @@ -1,360 +0,0 @@ -/* eslint-env mocha */ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockDuplex, mockMultiaddrConnection, mockUpgrader, mockConnection } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { mplex } from '@libp2p/mplex'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core/memory'; -import pDefer from 'p-defer'; -import { stubInterface } from 'sinon-ts'; -import { defaultComponents } from '../../src/components.js'; -import { DefaultConnectionManager } from '../../src/connection-manager/index.js'; -import { createLibp2pNode } from '../../src/libp2p.js'; -import { DefaultRegistrar } from '../../src/registrar.js'; -import { createPeerId } from '../fixtures/creators/peer.js'; -import { matchPeerId } from '../fixtures/match-peer-id.js'; -const protocol = '/test/1.0.0'; -describe('registrar', () => { - let components; - let registrar; - let peerId; - let libp2p; - before(async () => { - peerId = await createPeerId(); - }); - describe('errors', () => { - beforeEach(() => { - const events = new TypedEventEmitter(); - components = defaultComponents({ - peerId, - events, - datastore: new MemoryDatastore(), - upgrader: mockUpgrader({ events }), - transportManager: stubInterface(), - connectionGater: stubInterface() - }); - components.peerStore = new PersistentPeerStore(components); - components.connectionManager = new DefaultConnectionManager(components, { - minConnections: 50, - maxConnections: 1000, - inboundUpgradeTimeout: 1000 - }); - registrar = new DefaultRegistrar(components); - }); - it('should fail to register a protocol if no multicodec is provided', () => { - // @ts-expect-error invalid parameters - return expect(registrar.register()).to.eventually.be.rejected(); - }); - it('should fail to register a protocol if an invalid topology is provided', () => { - const fakeTopology = { - random: 1 - }; - // @ts-expect-error invalid parameters - return expect(registrar.register(fakeTopology)).to.eventually.be.rejected(); - }); - }); - describe('registration', () => { - let registrar; - let peerId; - let connectionManager; - let peerStore; - let events; - beforeEach(async () => { - peerId = await createEd25519PeerId(); - connectionManager = stubInterface(); - peerStore = stubInterface(); - events = new TypedEventEmitter(); - registrar = new DefaultRegistrar({ - peerId, - connectionManager, - peerStore, - events, - logger: defaultLogger() - }); - }); - it('should be able to register a protocol', async () => { - const topology = { - onConnect: () => { }, - onDisconnect: () => { } - }; - expect(registrar.getTopologies(protocol)).to.have.lengthOf(0); - const identifier = await registrar.register(protocol, topology); - expect(identifier).to.exist(); - expect(registrar.getTopologies(protocol)).to.have.lengthOf(1); - }); - it('should be able to unregister a protocol', async () => { - const topology = { - onConnect: () => { }, - onDisconnect: () => { } - }; - expect(registrar.getTopologies(protocol)).to.have.lengthOf(0); - const identifier = await registrar.register(protocol, topology); - expect(registrar.getTopologies(protocol)).to.have.lengthOf(1); - registrar.unregister(identifier); - expect(registrar.getTopologies(protocol)).to.have.lengthOf(0); - }); - it('should not error if unregistering unregistered topology handler', () => { - registrar.unregister('bad-identifier'); - }); - it('should call onConnect handler for connected peers after register', async () => { - const onConnectDefer = pDefer(); - const onDisconnectDefer = pDefer(); - // Setup connections before registrar - const remotePeerId = await createEd25519PeerId(); - const conn = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - // return connection from connection manager - connectionManager.getConnections.withArgs(remotePeerId).returns([conn]); - const topology = { - onConnect: (peerId, connection) => { - expect(peerId.equals(remotePeerId)).to.be.true(); - expect(connection.id).to.eql(conn.id); - onConnectDefer.resolve(); - }, - onDisconnect: (peerId) => { - expect(peerId.equals(remotePeerId)).to.be.true(); - onDisconnectDefer.resolve(); - } - }; - // Register protocol - await registrar.register(protocol, topology); - // Peer data is in the peer store - peerStore.get.withArgs(matchPeerId(remotePeerId)).resolves({ - id: remotePeerId, - addresses: [], - protocols: [protocol], - metadata: new Map(), - tags: new Map() - }); - // remote peer connects - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: conn - } - }); - await onConnectDefer.promise; - // remote peer disconnects - await conn.close(); - events.safeDispatchEvent('peer:disconnect', { - detail: remotePeerId - }); - await onDisconnectDefer.promise; - }); - it('should call onConnect handler after register, once a peer is connected and protocols are updated', async () => { - const onConnectDefer = pDefer(); - const onDisconnectDefer = pDefer(); - // Setup connections before registrar - const remotePeerId = await createEd25519PeerId(); - const conn = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - // return connection from connection manager - connectionManager.getConnections.withArgs(matchPeerId(remotePeerId)).returns([conn]); - const topology = { - onConnect: () => { - onConnectDefer.resolve(); - }, - onDisconnect: () => { - onDisconnectDefer.resolve(); - } - }; - // Register protocol - await registrar.register(protocol, topology); - // remote peer connects - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: conn - } - }); - // Can get details after identify - peerStore.get.withArgs(matchPeerId(conn.remotePeer)).resolves({ - id: conn.remotePeer, - addresses: [], - protocols: [protocol], - metadata: new Map(), - tags: new Map() - }); - // we have a connection to this peer - connectionManager.getConnections.withArgs(matchPeerId(conn.remotePeer)).returns([conn]); - // identify completes - events.safeDispatchEvent('peer:update', { - detail: { - peer: { - id: conn.remotePeer, - protocols: [protocol], - addresses: [], - metadata: new Map() - } - } - }); - await onConnectDefer.promise; - // Peer no longer supports the protocol our topology is registered for - events.safeDispatchEvent('peer:update', { - detail: { - peer: { - id: conn.remotePeer, - protocols: [], - addresses: [], - metadata: new Map() - }, - previous: { - id: conn.remotePeer, - protocols: [protocol], - addresses: [], - metadata: new Map() - } - } - }); - await onDisconnectDefer.promise; - }); - it('should not call topology handlers for transient connection', async () => { - const onConnectDefer = pDefer(); - const onDisconnectDefer = pDefer(); - // Setup connections before registrar - const remotePeerId = await createEd25519PeerId(); - const conn = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - // connection is transient - conn.transient = true; - // return connection from connection manager - connectionManager.getConnections.withArgs(matchPeerId(remotePeerId)).returns([conn]); - const topology = { - onConnect: () => { - onConnectDefer.reject(new Error('Topolgy onConnect called for transient connection')); - }, - onDisconnect: () => { - onDisconnectDefer.reject(new Error('Topolgy onDisconnect called for transient connection')); - } - }; - // Register topology for protocol - await registrar.register(protocol, topology); - // remote peer connects - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: conn - } - }); - await expect(Promise.any([ - onConnectDefer.promise, - onDisconnectDefer.promise, - new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, 1000); - }) - ])).to.eventually.not.be.rejected(); - }); - it('should call topology onConnect handler for transient connection when explicitly requested', async () => { - const onConnectDefer = pDefer(); - // Setup connections before registrar - const remotePeerId = await createEd25519PeerId(); - const conn = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - // connection is transient - conn.transient = true; - // return connection from connection manager - connectionManager.getConnections.withArgs(matchPeerId(remotePeerId)).returns([conn]); - const topology = { - notifyOnTransient: true, - onConnect: () => { - onConnectDefer.resolve(); - } - }; - // Register topology for protocol - await registrar.register(protocol, topology); - // remote peer connects - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: conn - } - }); - await expect(onConnectDefer.promise).to.eventually.be.undefined(); - }); - it('should call topology handlers for non-transient connection opened after transient connection', async () => { - const onConnectDefer = pDefer(); - let callCount = 0; - const topology = { - notifyOnTransient: true, - onConnect: () => { - callCount++; - if (callCount === 2) { - onConnectDefer.resolve(); - } - } - }; - // Register topology for protocol - await registrar.register(protocol, topology); - // Setup connections before registrar - const remotePeerId = await createEd25519PeerId(); - const transientConnection = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - transientConnection.transient = true; - const nonTransientConnection = mockConnection(mockMultiaddrConnection(mockDuplex(), remotePeerId)); - nonTransientConnection.transient = false; - // return connection from connection manager - connectionManager.getConnections.withArgs(matchPeerId(remotePeerId)).returns([ - transientConnection, - nonTransientConnection - ]); - // remote peer connects over transient connection - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: transientConnection - } - }); - // remote peer opens non-transient connection - events.safeDispatchEvent('peer:identify', { - detail: { - peerId: remotePeerId, - protocols: [protocol], - connection: nonTransientConnection - } - }); - await expect(onConnectDefer.promise).to.eventually.be.undefined(); - }); - it('should be able to register and unregister a handler', async () => { - const deferred = pDefer(); - libp2p = await createLibp2pNode({ - peerId: await createEd25519PeerId(), - transports: [ - webSockets() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - deferred.resolve(components); - } - } - }); - const components = await deferred.promise; - const registrar = components.registrar; - expect(registrar.getProtocols()).to.not.have.any.keys(['/echo/1.0.0', '/echo/1.0.1']); - const echoHandler = () => { }; - await libp2p.handle(['/echo/1.0.0', '/echo/1.0.1'], echoHandler); - expect(registrar.getHandler('/echo/1.0.0')).to.have.property('handler', echoHandler); - expect(registrar.getHandler('/echo/1.0.1')).to.have.property('handler', echoHandler); - await libp2p.unhandle(['/echo/1.0.0']); - expect(registrar.getProtocols()).to.not.have.any.keys(['/echo/1.0.0']); - expect(registrar.getHandler('/echo/1.0.1')).to.have.property('handler', echoHandler); - await expect(libp2p.peerStore.get(libp2p.peerId)).to.eventually.have.deep.property('protocols', [ - '/echo/1.0.1' - ]); - }); - }); -}); -//# sourceMappingURL=registrar.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/registrar/registrar.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/registrar/registrar.spec.js.map deleted file mode 100644 index 221e63da6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/registrar/registrar.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registrar.spec.js","sourceRoot":"","sources":["../../../test/registrar/registrar.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAyB,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAA;AAC5H,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,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/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.node.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.node.d.ts deleted file mode 100644 index e263e69a5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=transport-manager.node.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.node.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.node.d.ts.map deleted file mode 100644 index a4afdb959..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.node.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.node.d.ts","sourceRoot":"","sources":["../../../test/transports/transport-manager.node.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.node.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.node.js deleted file mode 100644 index 46a77e5fd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.node.js +++ /dev/null @@ -1,110 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { start, stop } from '@libp2p/interface/startable'; -import { FaultTolerance } from '@libp2p/interface/transport'; -import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { tcp } from '@libp2p/tcp'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core/memory'; -import { pEvent } from 'p-event'; -import pWaitFor from 'p-wait-for'; -import sinon from 'sinon'; -import { DefaultAddressManager } from '../../src/address-manager/index.js'; -import { defaultComponents } from '../../src/components.js'; -import { DefaultTransportManager } from '../../src/transport-manager.js'; -const addrs = [ - multiaddr('/ip4/127.0.0.1/tcp/0'), - multiaddr('/ip4/127.0.0.1/tcp/0') -]; -describe('Transport Manager (TCP)', () => { - let tm; - let localPeer; - let components; - before(async () => { - localPeer = await createEd25519PeerId(); - }); - beforeEach(async () => { - const events = new TypedEventEmitter(); - components = defaultComponents({ - peerId: localPeer, - events, - datastore: new MemoryDatastore(), - upgrader: mockUpgrader({ events }) - }); - components.addressManager = new DefaultAddressManager(components, { listen: addrs.map(addr => addr.toString()) }); - components.peerStore = new PersistentPeerStore(components); - tm = new DefaultTransportManager(components, { - faultTolerance: FaultTolerance.NO_FATAL - }); - components.transportManager = tm; - await start(tm); - }); - afterEach(async () => { - await tm.removeAll(); - expect(tm.getTransports()).to.be.empty(); - await stop(tm); - }); - it('should be able to add and remove a transport', async () => { - expect(tm.getTransports()).to.have.lengthOf(0); - tm.add(tcp()({ - logger: defaultLogger() - })); - expect(tm.getTransports()).to.have.lengthOf(1); - await tm.remove('@libp2p/tcp'); - expect(tm.getTransports()).to.have.lengthOf(0); - }); - it('should be able to listen', async () => { - const transport = tcp()({ - logger: defaultLogger() - }); - expect(tm.getTransports()).to.be.empty(); - tm.add(transport); - expect(tm.getTransports()).to.have.lengthOf(1); - const spyListener = sinon.spy(transport, 'createListener'); - await tm.listen(addrs); - // Ephemeral ip addresses may result in multiple listeners - expect(tm.getAddrs().length).to.equal(addrs.length); - await tm.stop(); - expect(spyListener.called).to.be.true(); - }); - it('should be able to dial', async () => { - tm.add(tcp()({ - logger: defaultLogger() - })); - await tm.listen(addrs); - const addr = tm.getAddrs().shift(); - if (addr == null) { - throw new Error('Could not find addr'); - } - const connection = await tm.dial(addr); - expect(connection).to.exist(); - await connection.close(); - }); - it('should remove listeners when they stop listening', async () => { - const transport = tcp()({ - logger: defaultLogger() - }); - tm.add(transport); - expect(tm.getListeners()).to.have.lengthOf(0); - const spyListener = sinon.spy(transport, 'createListener'); - await tm.listen(addrs); - expect(spyListener.callCount).to.equal(addrs.length); - // wait for listeners to start listening - await pWaitFor(async () => { - return tm.getListeners().length === addrs.length; - }); - // wait for listeners to stop listening - const closePromise = Promise.all(spyListener.getCalls().map(async (call) => { - return pEvent(call.returnValue, 'close'); - })); - await Promise.all(tm.getListeners().map(async (l) => { await l.close(); })); - await closePromise; - expect(tm.getListeners()).to.have.lengthOf(0); - await tm.stop(); - }); -}); -//# sourceMappingURL=transport-manager.node.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.node.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.node.js.map deleted file mode 100644 index ca003966e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.node.js","sourceRoot":"","sources":["../../../test/transports/transport-manager.node.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,C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CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;QAE7C,MAAM,EAAE,CAAC,IAAI,EAAE,CAAA;IACjB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.spec.d.ts deleted file mode 100644 index 9f7b811b6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=transport-manager.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.spec.d.ts.map deleted file mode 100644 index edad9dac1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.spec.d.ts","sourceRoot":"","sources":["../../../test/transports/transport-manager.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.spec.js deleted file mode 100644 index 7cbfe284f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.spec.js +++ /dev/null @@ -1,158 +0,0 @@ -/* eslint-env mocha */ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { start, stop } from '@libp2p/interface/startable'; -import { FaultTolerance } from '@libp2p/interface/transport'; -import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import sinon from 'sinon'; -import { DefaultAddressManager } from '../../src/address-manager/index.js'; -import { codes as ErrorCodes } from '../../src/errors.js'; -import { createLibp2p } from '../../src/index.js'; -import { DefaultTransportManager } from '../../src/transport-manager.js'; -const listenAddr = multiaddr('/ip4/127.0.0.1/tcp/0'); -describe('Transport Manager (WebSockets)', () => { - let tm; - let components; - beforeEach(async () => { - const events = new TypedEventEmitter(); - components = { - peerId: await createEd25519PeerId(), - events, - upgrader: mockUpgrader({ events }), - logger: defaultLogger() - }; - components.addressManager = new DefaultAddressManager(components, { listen: [listenAddr.toString()] }); - tm = new DefaultTransportManager(components, { - faultTolerance: FaultTolerance.NO_FATAL - }); - await start(tm); - }); - afterEach(async () => { - await tm.removeAll(); - await stop(tm); - expect(tm.getTransports()).to.be.empty(); - }); - it('should be able to add and remove a transport', async () => { - const transport = webSockets({ - filter: filters.all - }); - expect(tm.getTransports()).to.have.lengthOf(0); - tm.add(transport({ - logger: defaultLogger() - })); - expect(tm.getTransports()).to.have.lengthOf(1); - await tm.remove('@libp2p/websockets'); - expect(tm.getTransports()).to.have.lengthOf(0); - }); - it('should not be able to add a transport twice', async () => { - tm.add(webSockets()({ - logger: defaultLogger() - })); - expect(() => { - tm.add(webSockets()({ - logger: defaultLogger() - })); - }) - .to.throw() - .and.to.have.property('code', ErrorCodes.ERR_DUPLICATE_TRANSPORT); - }); - it('should be able to dial', async () => { - tm.add(webSockets({ filter: filters.all })({ - logger: defaultLogger() - })); - const addr = multiaddr(process.env.RELAY_MULTIADDR); - const connection = await tm.dial(addr); - expect(connection).to.exist(); - await connection.close(); - }); - it('should fail to dial an unsupported address', async () => { - tm.add(webSockets({ filter: filters.all })({ - logger: defaultLogger() - })); - const addr = multiaddr('/ip4/127.0.0.1/tcp/0'); - await expect(tm.dial(addr)) - .to.eventually.be.rejected() - .and.to.have.property('code', ErrorCodes.ERR_TRANSPORT_UNAVAILABLE); - }); - it('should fail to listen with no valid address', async () => { - tm = new DefaultTransportManager(components); - tm.add(webSockets({ filter: filters.all })({ - logger: defaultLogger() - })); - await expect(start(tm)) - .to.eventually.be.rejected() - .and.to.have.property('code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - await stop(tm); - }); -}); -describe('libp2p.transportManager (dial only)', () => { - let peerId; - let libp2p; - before(async () => { - peerId = await createEd25519PeerId(); - }); - afterEach(async () => { - sinon.restore(); - if (libp2p != null) { - await libp2p.stop(); - } - }); - it('fails to start if multiaddr fails to listen', async () => { - libp2p = await createLibp2p({ - peerId, - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0'] - }, - transports: [webSockets()], - connectionEncryption: [plaintext()], - start: false - }); - await expect(libp2p.start()).to.eventually.be.rejected - .with.property('code', ErrorCodes.ERR_NO_VALID_ADDRESSES); - }); - it('does not fail to start if provided listen multiaddr are not compatible to configured transports (when supporting dial only mode)', async () => { - libp2p = await createLibp2p({ - peerId, - addresses: { - listen: ['/ip4/127.0.0.1/tcp/0'] - }, - transportManager: { - faultTolerance: FaultTolerance.NO_FATAL - }, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ], - start: false - }); - await expect(libp2p.start()).to.eventually.be.undefined(); - }); - it('does not fail to start if provided listen multiaddr fail to listen on configured transports (when supporting dial only mode)', async () => { - libp2p = await createLibp2p({ - peerId, - addresses: { - listen: ['/ip4/127.0.0.1/tcp/12345/p2p/QmWDn2LY8nannvSWJzruUYoLZ4vV83vfCBwd8DipvdgQc3/p2p-circuit'] - }, - transportManager: { - faultTolerance: FaultTolerance.NO_FATAL - }, - transports: [ - webSockets() - ], - connectionEncryption: [ - plaintext() - ], - start: false - }); - await expect(libp2p.start()).to.eventually.be.undefined(); - }); -}); -//# sourceMappingURL=transport-manager.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.spec.js.map deleted file mode 100644 index fa5f523bb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/transports/transport-manager.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport-manager.spec.js","sourceRoot":"","sources":["../../../test/transports/transport-manager.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAC1E,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,YAAY,E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AM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,CAAA;IAC3D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,8HAA8H,EAAE,KAAK,IAAI,EAAE;QAC5I,MAAM,GAAG,MAAM,YAAY,CAAC;YAC1B,MAAM;YACN,SAAS,EAAE;gBACT,MAAM,EAAE,CAAC,yFAAyF,CAAC;aACpG;YACD,gBAAgB,EAAE;gBAChB,cAAc,EAAE,cAAc,CAAC,QAAQ;aACxC;YACD,UAAU,EAAE;gBACV,UAAU,EAAE;aACb;YACD,oBAAoB,EAAE;gBACpB,SAAS,EAAE;aACZ;YACD,KAAK,EAAE,KAAK;SACb,CAAC,CAAA;QAEF,MAAM,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,CAAA;IAC3D,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/upgrading/upgrader.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/upgrading/upgrader.spec.d.ts deleted file mode 100644 index 9763583dc..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/upgrading/upgrader.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=upgrader.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/upgrading/upgrader.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/upgrading/upgrader.spec.d.ts.map deleted file mode 100644 index aa7115453..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/upgrading/upgrader.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"upgrader.spec.d.ts","sourceRoot":"","sources":["../../../test/upgrading/upgrader.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/upgrading/upgrader.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/upgrading/upgrader.spec.js deleted file mode 100644 index 156069e09..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/upgrading/upgrader.spec.js +++ /dev/null @@ -1,857 +0,0 @@ -/* eslint-env mocha */ -import { yamux } from '@chainsafe/libp2p-yamux'; -import { circuitRelayTransport } from '@libp2p/circuit-relay-v2'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockConnectionGater, mockConnectionManager, mockMultiaddrConnPair, mockRegistrar, mockStream, mockMuxer } from '@libp2p/interface-compliance-tests/mocks'; -import { mplex } from '@libp2p/mplex'; -import { createEd25519PeerId } from '@libp2p/peer-id-factory'; -import { PersistentPeerStore } from '@libp2p/peer-store'; -import { plaintext } from '@libp2p/plaintext'; -import { webSockets } from '@libp2p/websockets'; -import * as filters from '@libp2p/websockets/filters'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { MemoryDatastore } from 'datastore-core'; -import delay from 'delay'; -import all from 'it-all'; -import drain from 'it-drain'; -import { pipe } from 'it-pipe'; -import pDefer from 'p-defer'; -import { pEvent } from 'p-event'; -import sinon from 'sinon'; -import { stubInterface } from 'sinon-ts'; -import { Uint8ArrayList } from 'uint8arraylist'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { defaultComponents } from '../../src/components.js'; -import { codes } from '../../src/errors.js'; -import { createLibp2p } from '../../src/index.js'; -import { DEFAULT_MAX_OUTBOUND_STREAMS } from '../../src/registrar.js'; -import { DefaultUpgrader } from '../../src/upgrader.js'; -const addrs = [ - multiaddr('/ip4/127.0.0.1/tcp/0'), - multiaddr('/ip4/127.0.0.1/tcp/0') -]; -describe('Upgrader', () => { - let localUpgrader; - let localMuxerFactory; - let localYamuxerFactory; - let localConnectionEncrypter; - let localConnectionProtector; - let remoteUpgrader; - let remoteMuxerFactory; - let remoteYamuxerFactory; - let remoteConnectionEncrypter; - let remoteConnectionProtector; - let localPeer; - let remotePeer; - let localComponents; - let remoteComponents; - beforeEach(async () => { - ([ - localPeer, - remotePeer - ] = await Promise.all([ - createEd25519PeerId(), - createEd25519PeerId() - ])); - localConnectionProtector = stubInterface(); - localConnectionProtector.protect.resolvesArg(0); - localComponents = defaultComponents({ - peerId: localPeer, - connectionGater: mockConnectionGater(), - registrar: mockRegistrar(), - datastore: new MemoryDatastore(), - connectionProtector: localConnectionProtector, - events: new TypedEventEmitter() - }); - localComponents.peerStore = new PersistentPeerStore(localComponents); - localComponents.connectionManager = mockConnectionManager(localComponents); - localMuxerFactory = mplex()(localComponents); - localYamuxerFactory = yamux()(); - localConnectionEncrypter = plaintext()(localComponents); - localUpgrader = new DefaultUpgrader(localComponents, { - connectionEncryption: [ - localConnectionEncrypter - ], - muxers: [ - localMuxerFactory, - localYamuxerFactory - ], - inboundUpgradeTimeout: 1000 - }); - remoteConnectionProtector = stubInterface(); - remoteConnectionProtector.protect.resolvesArg(0); - remoteComponents = defaultComponents({ - peerId: remotePeer, - connectionGater: mockConnectionGater(), - registrar: mockRegistrar(), - datastore: new MemoryDatastore(), - connectionProtector: remoteConnectionProtector, - events: new TypedEventEmitter() - }); - remoteComponents.peerStore = new PersistentPeerStore(remoteComponents); - remoteComponents.connectionManager = mockConnectionManager(remoteComponents); - remoteMuxerFactory = mplex()(remoteComponents); - remoteYamuxerFactory = yamux()(); - remoteConnectionEncrypter = plaintext()(remoteComponents); - remoteUpgrader = new DefaultUpgrader(remoteComponents, { - connectionEncryption: [ - remoteConnectionEncrypter - ], - muxers: [ - remoteMuxerFactory, - remoteYamuxerFactory - ], - inboundUpgradeTimeout: 1000 - }); - await localComponents.registrar.handle('/echo/1.0.0', ({ stream }) => { - void pipe(stream, stream); - }, { - maxInboundStreams: 10, - maxOutboundStreams: 10 - }); - await remoteComponents.registrar.handle('/echo/1.0.0', ({ stream }) => { - void pipe(stream, stream); - }, { - maxInboundStreams: 10, - maxOutboundStreams: 10 - }); - }); - afterEach(() => { - sinon.restore(); - }); - it('should upgrade with valid muxers and crypto', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - const stream = await connections[0].newStream('/echo/1.0.0'); - expect(stream).to.have.property('protocol', '/echo/1.0.0'); - const hello = uint8ArrayFromString('hello there!'); - const result = await pipe([hello], stream, function toBuffer(source) { - return (async function* () { - for await (const val of source) - yield val.slice(); - })(); - }, async (source) => all(source)); - expect(result).to.eql([hello]); - }); - it('should upgrade with only crypto', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - // No available muxers - localUpgrader = new DefaultUpgrader(localComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [], - inboundUpgradeTimeout: 1000 - }); - remoteUpgrader = new DefaultUpgrader(remoteComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [], - inboundUpgradeTimeout: 1000 - }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - await expect(connections[0].newStream('/echo/1.0.0')).to.be.rejected(); - // Verify the MultiaddrConnection close method is called - const inboundCloseSpy = sinon.spy(inbound, 'close'); - const outboundCloseSpy = sinon.spy(outbound, 'close'); - await Promise.all(connections.map(async (conn) => { await conn.close(); })); - expect(inboundCloseSpy.callCount).to.equal(1); - expect(outboundCloseSpy.callCount).to.equal(1); - }); - it('should use a private connection protector when provided', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const protector = { - async protect(connection) { - return connection; - } - }; - const protectorProtectSpy = sinon.spy(protector, 'protect'); - localComponents.connectionProtector = protector; - remoteComponents.connectionProtector = protector; - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - const stream = await connections[0].newStream('/echo/1.0.0'); - expect(stream).to.have.property('protocol', '/echo/1.0.0'); - const hello = uint8ArrayFromString('hello there!'); - const result = await pipe([hello], stream, function toBuffer(source) { - return (async function* () { - for await (const val of source) - yield val.slice(); - })(); - }, async (source) => all(source)); - expect(result).to.eql([hello]); - expect(protectorProtectSpy.callCount).to.eql(2); - }); - it('should fail if crypto fails', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - class BoomCrypto { - static protocol = '/insecure'; - protocol = '/insecure'; - async secureInbound() { throw new Error('Boom'); } - async secureOutbound() { throw new Error('Boom'); } - } - localUpgrader = new DefaultUpgrader(localComponents, { - connectionEncryption: [ - new BoomCrypto() - ], - muxers: [], - inboundUpgradeTimeout: 1000 - }); - remoteUpgrader = new DefaultUpgrader(remoteComponents, { - connectionEncryption: [ - new BoomCrypto() - ], - muxers: [], - inboundUpgradeTimeout: 1000 - }); - // Wait for the results of each side of the connection - const results = await Promise.allSettled([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - // Ensure both sides fail - expect(results).to.have.length(2); - results.forEach(result => { - expect(result).to.have.property('status', 'rejected'); - expect(result).to.have.nested.property('reason.code', codes.ERR_ENCRYPTION_FAILED); - }); - }); - it('should clear timeout if upgrade is successful', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - localUpgrader = new DefaultUpgrader(localComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [ - yamux()() - ], - inboundUpgradeTimeout: 1000 - }); - remoteUpgrader = new DefaultUpgrader(remoteComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [ - yamux()() - ], - inboundUpgradeTimeout: 1000 - }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - await delay(2000); - expect(connections).to.have.length(2); - connections.forEach(conn => { - conn.close().catch(() => { - throw new Error('Failed to close connection'); - }); - }); - }); - it('should fail if muxers do not match', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - class OtherMuxer { - protocol = '/muxer-local'; - streams = []; - newStream(name) { - throw new Error('Not implemented'); - } - source = (async function* () { - yield* []; - })(); - async sink() { } - async close() { } - abort() { } - } - class OtherMuxerFactory { - protocol = '/muxer-local'; - createStreamMuxer(init) { - return new OtherMuxer(); - } - } - class OtherOtherMuxerFactory { - protocol = '/muxer-local-other'; - createStreamMuxer(init) { - return new OtherMuxer(); - } - } - localUpgrader = new DefaultUpgrader(localComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [ - new OtherMuxerFactory(), - new OtherOtherMuxerFactory() - ], - inboundUpgradeTimeout: 1000 - }); - remoteUpgrader = new DefaultUpgrader(remoteComponents, { - connectionEncryption: [ - plaintext()(localComponents) - ], - muxers: [ - yamux()(), - mplex()(localComponents) - ], - inboundUpgradeTimeout: 1000 - }); - // Wait for the results of each side of the connection - const results = await Promise.allSettled([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - // Ensure both sides fail - expect(results).to.have.length(2); - results.forEach(result => { - expect(result).to.have.property('status', 'rejected'); - expect(result).to.have.nested.property('reason.code', codes.ERR_MUXER_UNAVAILABLE); - }); - }); - it('should map getStreams and close methods', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - // Create a few streams, at least 1 in each direction - // use multiple protocols to trigger regular multistream select - await connections[0].newStream(['/echo/1.0.0', '/echo/1.0.1']); - await connections[1].newStream(['/echo/1.0.0', '/echo/1.0.1']); - await connections[0].newStream(['/echo/1.0.0', '/echo/1.0.1']); - connections.forEach(conn => { - expect(conn.streams).to.have.length(3); - }); - // Verify the MultiaddrConnection close method is called - const inboundCloseSpy = sinon.spy(inbound, 'close'); - const outboundCloseSpy = sinon.spy(outbound, 'close'); - await Promise.all(connections.map(async (conn) => { await conn.close(); })); - expect(inboundCloseSpy.callCount).to.equal(1); - expect(outboundCloseSpy.callCount).to.equal(1); - }); - it('should call connection handlers', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const localConnectionEventReceived = pDefer(); - const localConnectionEndEventReceived = pDefer(); - const remoteConnectionEventReceived = pDefer(); - const remoteConnectionEndEventReceived = pDefer(); - localComponents.events.addEventListener('connection:open', () => { - localConnectionEventReceived.resolve(); - }); - localComponents.events.addEventListener('connection:close', () => { - localConnectionEndEventReceived.resolve(); - }); - remoteComponents.events.addEventListener('connection:open', () => { - remoteConnectionEventReceived.resolve(); - }); - remoteComponents.events.addEventListener('connection:close', () => { - remoteConnectionEndEventReceived.resolve(); - }); - // Verify onConnection is called with the connection - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - await Promise.all([ - localConnectionEventReceived.promise, - remoteConnectionEventReceived.promise - ]); - // Verify onConnectionEnd is called with the connection - await Promise.all(connections.map(async (conn) => { await conn.close(); })); - await Promise.all([ - localConnectionEndEventReceived.promise, - remoteConnectionEndEventReceived.promise - ]); - }); - it('should fail to create a stream for an unsupported protocol', async () => { - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections).to.have.length(2); - const results = await Promise.allSettled([ - connections[0].newStream('/unsupported/1.0.0'), - connections[1].newStream('/unsupported/1.0.0') - ]); - expect(results).to.have.length(2); - results.forEach(result => { - expect(result).to.have.property('status', 'rejected'); - expect(result).to.have.nested.property('reason.code', codes.ERR_UNSUPPORTED_PROTOCOL); - }); - }); - it('should abort protocol selection for slow streams', async () => { - const createStreamMuxerSpy = sinon.spy(localMuxerFactory, 'createStreamMuxer'); - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - // 10 ms timeout - const signal = AbortSignal.timeout(10); - // should have created muxer for connection - expect(createStreamMuxerSpy).to.have.property('callCount', 1); - // create mock muxed stream that never sends data - const muxer = createStreamMuxerSpy.getCall(0).returnValue; - muxer.newStream = () => { - return mockStream({ - source: (async function* () { - // longer than the timeout - await delay(1000); - yield new Uint8ArrayList(); - }()), - sink: drain - }); - }; - await expect(connections[0].newStream(['/echo/1.0.0', '/echo/1.0.1'], { - signal - })) - .to.eventually.be.rejected.with.property('code', 'ABORT_ERR'); - }); - it('should close streams when protocol negotiation fails', async () => { - await remoteComponents.registrar.unhandle('/echo/1.0.0'); - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound), - remoteUpgrader.upgradeInbound(inbound) - ]); - expect(connections[0].streams).to.have.lengthOf(0); - expect(connections[1].streams).to.have.lengthOf(0); - await expect(connections[0].newStream(['/echo/1.0.0', '/echo/1.0.1'])) - .to.eventually.be.rejected.with.property('code', 'ERR_UNSUPPORTED_PROTOCOL'); - // wait for remote to close - await delay(100); - expect(connections[0].streams).to.have.lengthOf(0); - expect(connections[1].streams).to.have.lengthOf(0); - }); - it('should allow skipping encryption, protection and muxing', async () => { - const localStreamMuxerFactorySpy = sinon.spy(localMuxerFactory, 'createStreamMuxer'); - const localMuxerFactoryOverride = mockMuxer(); - const localStreamMuxerFactoryOverrideSpy = sinon.spy(localMuxerFactoryOverride, 'createStreamMuxer'); - const localConnectionEncrypterSpy = sinon.spy(localConnectionEncrypter, 'secureOutbound'); - const remoteStreamMuxerFactorySpy = sinon.spy(remoteMuxerFactory, 'createStreamMuxer'); - const remoteMuxerFactoryOverride = mockMuxer(); - const remoteStreamMuxerFactoryOverrideSpy = sinon.spy(remoteMuxerFactoryOverride, 'createStreamMuxer'); - const remoteConnectionEncrypterSpy = sinon.spy(remoteConnectionEncrypter, 'secureInbound'); - const { inbound, outbound } = mockMultiaddrConnPair({ - addrs: [ - multiaddr('/ip4/127.0.0.1/tcp/0').encapsulate(`/p2p/${remotePeer.toString()}`), - multiaddr('/ip4/127.0.0.1/tcp/0') - ], - remotePeer - }); - const connections = await Promise.all([ - localUpgrader.upgradeOutbound(outbound, { - skipEncryption: true, - skipProtection: true, - muxerFactory: localMuxerFactoryOverride - }), - remoteUpgrader.upgradeInbound(inbound, { - skipEncryption: true, - skipProtection: true, - muxerFactory: remoteMuxerFactoryOverride - }) - ]); - expect(connections).to.have.length(2); - const stream = await connections[0].newStream(['/echo/1.0.0', '/echo/1.0.1']); - expect(stream).to.have.property('protocol', '/echo/1.0.0'); - const hello = uint8ArrayFromString('hello there!'); - const result = await pipe([hello], stream, function toBuffer(source) { - return (async function* () { - for await (const val of source) - yield val.slice(); - })(); - }, async (source) => all(source)); - expect(result).to.eql([hello]); - expect(localStreamMuxerFactorySpy.callCount).to.equal(0, 'did not use passed stream muxer factory'); - expect(localStreamMuxerFactoryOverrideSpy.callCount).to.equal(1, 'did not use passed stream muxer factory'); - expect(remoteStreamMuxerFactorySpy.callCount).to.equal(0, 'did not use passed stream muxer factory'); - expect(remoteStreamMuxerFactoryOverrideSpy.callCount).to.equal(1, 'did not use passed stream muxer factory'); - expect(localConnectionEncrypterSpy.callCount).to.equal(0, 'used local connection encrypter'); - expect(remoteConnectionEncrypterSpy.callCount).to.equal(0, 'used remote connection encrypter'); - expect(localConnectionProtector.protect.callCount).to.equal(0, 'used local connection protector'); - expect(remoteConnectionProtector.protect.callCount).to.equal(0, 'used remote connection protector'); - }); -}); -describe('libp2p.upgrader', () => { - let peers; - let libp2p; - let remoteLibp2p; - before(async () => { - peers = await Promise.all([ - createEd25519PeerId(), - createEd25519PeerId() - ]); - }); - afterEach(async () => { - sinon.restore(); - if (libp2p != null) { - await libp2p.stop(); - } - if (remoteLibp2p != null) { - await remoteLibp2p.stop(); - } - }); - it('should create an Upgrader', async () => { - const deferred = pDefer(); - const protector = { - async protect(connection) { - return connection; - } - }; - libp2p = await createLibp2p({ - peerId: peers[0], - transports: [ - webSockets() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionProtector: () => protector, - services: { - test: (components) => { - deferred.resolve(components); - } - } - }); - const components = await deferred.promise; - expect(components.upgrader).to.exist(); - expect(components.connectionProtector).to.exist(); - }); - it('should return muxed streams', async () => { - const localDeferred = pDefer(); - const remoteDeferred = pDefer(); - const remotePeer = peers[1]; - libp2p = await createLibp2p({ - peerId: peers[0], - transports: [ - webSockets() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - localDeferred.resolve(components); - } - } - }); - const echoHandler = () => { }; - await libp2p.handle(['/echo/1.0.0'], echoHandler); - remoteLibp2p = await createLibp2p({ - peerId: remotePeer, - transports: [ - webSockets() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - remoteDeferred.resolve(components); - } - } - }); - await remoteLibp2p.handle('/echo/1.0.0', echoHandler); - const localComponents = await localDeferred.promise; - const remoteComponents = await remoteDeferred.promise; - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const [localConnection] = await Promise.all([ - localComponents.upgrader.upgradeOutbound(outbound), - remoteComponents.upgrader.upgradeInbound(inbound) - ]); - const remoteLibp2pUpgraderOnStreamSpy = sinon.spy(remoteComponents.upgrader, '_onStream'); - const stream = await localConnection.newStream(['/echo/1.0.0', '/echo/1.0.1']); - expect(stream).to.include.keys(['id', 'sink', 'source']); - const [arg0] = remoteLibp2pUpgraderOnStreamSpy.getCall(0).args; - expect(arg0.stream).to.include.keys(['id', 'sink', 'source']); - }); - it('should emit connect and disconnect events', async () => { - const remotePeer = peers[1]; - libp2p = await createLibp2p({ - peerId: peers[0], - addresses: { - listen: [ - `${process.env.RELAY_MULTIADDR}/p2p-circuit` - ] - }, - transports: [ - webSockets({ - filter: filters.all - }), - circuitRelayTransport() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }); - await libp2p.start(); - remoteLibp2p = await createLibp2p({ - peerId: remotePeer, - transports: [ - webSockets({ - filter: filters.all - }), - circuitRelayTransport() - ], - streamMuxers: [ - yamux(), - mplex() - ], - connectionEncryption: [ - plaintext() - ], - connectionGater: mockConnectionGater() - }); - await remoteLibp2p.start(); - // Upgrade and check the connect event - const connectionPromise = pEvent(libp2p, 'connection:open'); - const connection = await remoteLibp2p.dial(libp2p.getMultiaddrs()); - const connectEvent = await connectionPromise; - if (connectEvent.type !== 'connection:open') { - throw new Error(`Incorrect event type, expected: 'connection:open' actual: ${connectEvent.type}`); - } - expect(remotePeer.equals(connectEvent.detail.remotePeer)).to.equal(true); - const disconnectionPromise = pEvent(libp2p, 'peer:disconnect'); - // Close and check the disconnect event - await connection.close(); - const disconnectEvent = await disconnectionPromise; - if (disconnectEvent.type !== 'peer:disconnect') { - throw new Error(`Incorrect event type, expected: 'peer:disconnect' actual: ${disconnectEvent.type}`); - } - expect(remotePeer.equals(disconnectEvent.detail)).to.equal(true); - }); - it('should limit the number of incoming streams that can be opened using a protocol', async () => { - const localDeferred = pDefer(); - const remoteDeferred = pDefer(); - const protocol = '/a-test-protocol/1.0.0'; - const remotePeer = peers[1]; - libp2p = await createLibp2p({ - peerId: peers[0], - transports: [ - webSockets() - ], - streamMuxers: [ - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - localDeferred.resolve(components); - } - }, - connectionGater: mockConnectionGater() - }); - remoteLibp2p = await createLibp2p({ - peerId: remotePeer, - transports: [ - webSockets() - ], - streamMuxers: [ - mplex() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - remoteDeferred.resolve(components); - } - }, - connectionGater: mockConnectionGater() - }); - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const localComponents = await localDeferred.promise; - const remoteComponents = await remoteDeferred.promise; - const [localToRemote] = await Promise.all([ - localComponents.upgrader.upgradeOutbound(outbound), - remoteComponents.upgrader.upgradeInbound(inbound) - ]); - let streamCount = 0; - await libp2p.handle(protocol, (data) => { }, { - maxInboundStreams: 10, - maxOutboundStreams: 10 - }); - await remoteLibp2p.handle(protocol, (data) => { - streamCount++; - }, { - maxInboundStreams: 1, - maxOutboundStreams: 1 - }); - expect(streamCount).to.equal(0); - await localToRemote.newStream([protocol, '/other/1.0.0']); - expect(streamCount).to.equal(1); - const s = await localToRemote.newStream(protocol); - await expect(drain(s.source)).to.eventually.be.rejected() - .with.property('code', 'ERR_STREAM_RESET'); - }); - it('should limit the number of outgoing streams that can be opened using a protocol', async () => { - const localDeferred = pDefer(); - const remoteDeferred = pDefer(); - const protocol = '/a-test-protocol/1.0.0'; - const remotePeer = peers[1]; - libp2p = await createLibp2p({ - peerId: peers[0], - transports: [ - webSockets() - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - localDeferred.resolve(components); - } - }, - connectionGater: mockConnectionGater() - }); - remoteLibp2p = await createLibp2p({ - peerId: remotePeer, - transports: [ - webSockets() - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - remoteDeferred.resolve(components); - } - } - }); - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const localComponents = await localDeferred.promise; - const remoteComponents = await remoteDeferred.promise; - const [localToRemote] = await Promise.all([ - localComponents.upgrader.upgradeOutbound(outbound), - remoteComponents.upgrader.upgradeInbound(inbound) - ]); - let streamCount = 0; - await libp2p.handle(protocol, (data) => { }, { - maxInboundStreams: 1, - maxOutboundStreams: 1 - }); - await remoteLibp2p.handle(protocol, (data) => { - streamCount++; - }, { - maxInboundStreams: 10, - maxOutboundStreams: 10 - }); - expect(streamCount).to.equal(0); - await localToRemote.newStream([protocol, '/other/1.0.0']); - expect(streamCount).to.equal(1); - await expect(localToRemote.newStream(protocol)).to.eventually.be.rejected() - .with.property('code', codes.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS); - }); - it('should allow overriding the number of outgoing streams that can be opened using a protocol without a handler', async () => { - const localDeferred = pDefer(); - const remoteDeferred = pDefer(); - const protocol = '/a-test-protocol/1.0.0'; - const remotePeer = peers[1]; - libp2p = await createLibp2p({ - peerId: peers[0], - transports: [ - webSockets() - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - localDeferred.resolve(components); - } - }, - connectionGater: mockConnectionGater() - }); - remoteLibp2p = await createLibp2p({ - peerId: remotePeer, - transports: [ - webSockets() - ], - streamMuxers: [ - yamux() - ], - connectionEncryption: [ - plaintext() - ], - services: { - test: (components) => { - remoteDeferred.resolve(components); - } - } - }); - const { inbound, outbound } = mockMultiaddrConnPair({ addrs, remotePeer }); - const localComponents = await localDeferred.promise; - const remoteComponents = await remoteDeferred.promise; - const [localToRemote] = await Promise.all([ - localComponents.upgrader.upgradeOutbound(outbound), - remoteComponents.upgrader.upgradeInbound(inbound) - ]); - let streamCount = 0; - const limit = DEFAULT_MAX_OUTBOUND_STREAMS + 1; - await remoteLibp2p.handle(protocol, (data) => { - streamCount++; - }, { - maxInboundStreams: limit + 1, - maxOutboundStreams: 10 - }); - expect(streamCount).to.equal(0); - for (let i = 0; i < limit; i++) { - await localToRemote.newStream([protocol, '/other/1.0.0'], { - maxOutboundStreams: limit - }); - } - expect(streamCount).to.equal(limit); - // should reject without overriding limit - await expect(localToRemote.newStream(protocol)).to.eventually.be.rejected() - .with.property('code', codes.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS); - // should reject even with overriding limit - await expect(localToRemote.newStream(protocol, { - maxOutboundStreams: limit - })).to.eventually.be.rejected() - .with.property('code', codes.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS); - }); -}); -//# sourceMappingURL=upgrader.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/upgrading/upgrader.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/upgrading/upgrader.spec.js.map deleted file mode 100644 index 216c17147..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/test/upgrading/upgrader.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"upgrader.spec.js","sourceRoot":"","sources":["../../../test/upgrading/upgrader.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAClK,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAE,SA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AAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAE/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;YAC9B,MAAM,aAAa,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,cAAc,CAAC,EAAE;gBACxD,kBAAkB,EAAE,KAAK;aAC1B,CAAC,CAAA;SACH;QAED,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAEnC,yCAAyC;QACzC,MAAM,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE;aACxE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,sCAAsC,CAAC,CAAA;QAEtE,2CAA2C;QAC3C,MAAM,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,EAAE;YAC7C,kBAAkB,EAAE,KAAK;SAC1B,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE;aAC5B,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,sCAAsC,CAAC,CAAA;IACxE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/tsconfig.tsbuildinfo deleted file mode 100644 index 92126c681..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../interface/dist/src/errors.d.ts","../../interface/dist/src/startable.d.ts","../../../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../../../node_modules/multiformats/dist/types/src/block/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../../../node_modules/multiformats/dist/types/src/link/interface.d.ts","../../../node_modules/multiformats/dist/types/src/cid.d.ts","../../interface/dist/src/peer-id/index.d.ts","../../logger/dist/src/index.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../../../node_modules/it-stream-types/dist/src/index.d.ts","../../../node_modules/uint8arraylist/dist/src/index.d.ts","../../interface/dist/src/connection/index.d.ts","../../interface/dist/src/peer-info/index.d.ts","../../interface/dist/src/content-routing/index.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../interface/dist/src/events.d.ts","../../interface/dist/src/metrics/index.d.ts","../../interface/dist/src/peer-routing/index.d.ts","../../interface/dist/src/peer-store/index.d.ts","../../interface/dist/src/stream-handler/index.d.ts","../../interface/dist/src/topology/index.d.ts","../../interface/dist/src/stream-muxer/index.d.ts","../../interface/dist/src/transport/index.d.ts","../../interface/dist/src/index.d.ts","../../interface/dist/src/connection-gater/index.d.ts","../../interface-internal/dist/src/address-manager/index.d.ts","../../peer-collections/dist/src/map.d.ts","../../peer-collections/dist/src/set.d.ts","../../peer-collections/dist/src/list.d.ts","../../peer-collections/dist/src/index.d.ts","../../interface-internal/dist/src/connection-manager/index.d.ts","../../interface-internal/dist/src/registrar/index.d.ts","../../interface-internal/dist/src/transport-manager/index.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../../../node_modules/multiformats/dist/types/src/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../../../node_modules/multiformats/dist/types/src/varint.d.ts","../../../node_modules/multiformats/dist/types/src/bytes.d.ts","../../../node_modules/multiformats/dist/types/src/index.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/raw.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/json.d.ts","../../../node_modules/multiformats/dist/types/src/bases/base.d.ts","../../../node_modules/multiformats/dist/types/src/basics.d.ts","../../../node_modules/uint8arrays/dist/src/util/bases.d.ts","../../../node_modules/uint8arrays/dist/src/to-string.d.ts","../../../node_modules/interface-datastore/dist/src/key.d.ts","../../../node_modules/interface-store/dist/src/index.d.ts","../../../node_modules/interface-datastore/dist/src/index.d.ts","../src/components.ts","../../utils/dist/src/address-sort.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/resolvers/index.d.ts","../../../node_modules/merge-options/index.d.ts","../src/errors.ts","../../crypto/dist/src/keys/ed25519-class.d.ts","../../crypto/dist/src/keys/interface.d.ts","../../crypto/dist/src/keys/ecdh.d.ts","../../crypto/dist/src/keys/ephemeral-keys.d.ts","../../crypto/dist/src/keys/key-stretcher.d.ts","../../../node_modules/protons-runtime/dist/src/codec.d.ts","../../../node_modules/protons-runtime/dist/src/decode.d.ts","../../../node_modules/protons-runtime/dist/src/encode.d.ts","../../../node_modules/protons-runtime/dist/src/codecs/enum.d.ts","../../../node_modules/protons-runtime/dist/src/codecs/message.d.ts","../../../node_modules/protons-runtime/dist/src/utils/reader.d.ts","../../../node_modules/protons-runtime/dist/src/utils/writer.d.ts","../../../node_modules/protons-runtime/dist/src/index.d.ts","../../crypto/dist/src/keys/keys.d.ts","../../crypto/dist/src/keys/rsa-class.d.ts","../../crypto/dist/src/keys/secp256k1-class.d.ts","../../interface/dist/src/keys/index.d.ts","../../crypto/dist/src/keys/index.d.ts","../../interface/dist/src/peer-discovery/index.d.ts","../../peer-id/dist/src/index.d.ts","../../peer-id-factory/dist/src/index.d.ts","../../peer-store/dist/src/index.d.ts","../../../node_modules/datastore-core/dist/src/base.d.ts","../../../node_modules/datastore-core/dist/src/memory.d.ts","../../../node_modules/uint8arrays/dist/src/concat.d.ts","../../../node_modules/uint8arrays/dist/src/from-string.d.ts","../src/address-manager/utils.ts","../src/address-manager/index.ts","../src/config/connection-gater.ts","../../interface/dist/src/peer-store/tags.d.ts","../../../node_modules/rate-limiter-flexible/lib/index.d.ts","../src/get-peer.ts","../../../node_modules/eventemitter3/index.d.ts","../../../node_modules/p-queue/dist/queue.d.ts","../../../node_modules/p-queue/dist/options.d.ts","../../../node_modules/p-queue/dist/priority-queue.d.ts","../../../node_modules/p-queue/dist/index.d.ts","../../utils/dist/src/peer-job-queue.d.ts","../src/connection-manager/constants.defaults.ts","../src/connection-manager/constants.ts","../src/connection-manager/auto-dial.ts","../src/connection-manager/connection-pruner.ts","../../../node_modules/any-signal/dist/src/index.d.ts","../../../node_modules/p-defer/index.d.ts","../src/connection-manager/utils.ts","../src/connection-manager/dial-queue.ts","../src/connection-manager/index.ts","../../../node_modules/it-merge/dist/src/index.d.ts","../../../node_modules/it-pipe/dist/src/index.d.ts","../../../node_modules/it-filter/dist/src/index.d.ts","../../../node_modules/it-map/dist/src/index.d.ts","../src/content-routing/utils.ts","../src/content-routing/index.ts","../../../node_modules/it-first/dist/src/index.d.ts","../src/peer-routing.ts","../src/registrar.ts","../../interface/dist/src/metrics/tracked-map.d.ts","../src/transport-manager.ts","../../multistream-select/dist/src/constants.d.ts","../../../node_modules/it-byte-stream/dist/src/index.d.ts","../../../node_modules/it-length-prefixed/dist/src/encode.d.ts","../../../node_modules/it-reader/dist/src/index.d.ts","../../../node_modules/it-length-prefixed/dist/src/decode.d.ts","../../../node_modules/it-length-prefixed/dist/src/index.d.ts","../../../node_modules/it-length-prefixed-stream/dist/src/index.d.ts","../../multistream-select/dist/src/select.d.ts","../../multistream-select/dist/src/handle.d.ts","../../multistream-select/dist/src/index.d.ts","../src/connection/index.ts","../../interface/dist/src/connection-encrypter/index.d.ts","../src/upgrader.ts","../src/version.ts","../src/libp2p.ts","../src/index.ts","../src/config.ts","../../../node_modules/private-ip/lib/index.d.ts","../src/config/connection-gater.browser.ts","../src/connection-manager/constants.browser.ts","../../../node_modules/protobufjs/index.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.d.ts","../../../node_modules/it-pushable/dist/src/index.d.ts","../../interface/dist/src/pubsub/index.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message-cache.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-stats.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/compute-score.d.ts","../../../node_modules/denque/index.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/message-deliveries.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/metrics.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/set.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/index.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/tracer.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/config.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/stream.d.ts","../../../node_modules/protobufjs/minimal.d.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/decoderpc.ts","../../../node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/@types/basic.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/proto/payload.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/@types/libp2p.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/nonce.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/@types/handshake.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/crypto.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/noise.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/crypto/js.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/index.d.ts","../../../node_modules/@chainsafe/libp2p-yamux/dist/src/config.d.ts","../../../node_modules/@chainsafe/libp2p-yamux/dist/src/frame.d.ts","../../utils/dist/src/abstract-stream.d.ts","../../../node_modules/@chainsafe/libp2p-yamux/dist/src/stream.d.ts","../../../node_modules/@chainsafe/libp2p-yamux/dist/src/muxer.d.ts","../../../node_modules/@chainsafe/libp2p-yamux/dist/src/index.d.ts","../../transport-circuit-relay-v2/dist/src/pb/index.d.ts","../../../node_modules/it-protobuf-stream/dist/src/index.d.ts","../../transport-circuit-relay-v2/dist/src/server/advert-service.d.ts","../../transport-circuit-relay-v2/dist/src/server/reservation-store.d.ts","../../transport-circuit-relay-v2/dist/src/server/index.d.ts","../../transport-circuit-relay-v2/dist/src/transport/discovery.d.ts","../../transport-circuit-relay-v2/dist/src/transport/reservation-store.d.ts","../../transport-circuit-relay-v2/dist/src/transport/index.d.ts","../../transport-circuit-relay-v2/dist/src/constants.d.ts","../../transport-circuit-relay-v2/dist/src/index.d.ts","../../../node_modules/@libp2p/daemon-protocol/dist/src/index.d.ts","../../../node_modules/@libp2p/daemon-protocol/dist/src/stream-handler.d.ts","../../../node_modules/@libp2p/daemon-client/dist/src/index.d.ts","../../kad-dht/dist/src/providers.d.ts","../../../node_modules/progress-events/dist/src/index.d.ts","../../kad-dht/dist/src/record/record.d.ts","../../kad-dht/dist/src/record/index.d.ts","../../kad-dht/dist/src/index.d.ts","../../../node_modules/@libp2p/daemon-server/dist/src/index.d.ts","../../pubsub/dist/src/index.d.ts","../../pubsub-floodsub/dist/src/cache.d.ts","../../pubsub-floodsub/dist/src/config.d.ts","../../pubsub-floodsub/dist/src/index.d.ts","../../protocol-identify/dist/src/index.d.ts","../../../node_modules/@libp2p/interop/dist/src/connect.d.ts","../../../node_modules/@libp2p/interop/dist/src/dht/index.d.ts","../../../node_modules/@libp2p/interop/dist/src/pubsub/index.d.ts","../../../node_modules/@libp2p/interop/dist/src/relay/index.d.ts","../../../node_modules/@libp2p/interop/dist/src/streams/index.d.ts","../../../node_modules/@libp2p/interop/dist/src/index.d.ts","../../stream-multiplexer-mplex/dist/src/message-types.d.ts","../../stream-multiplexer-mplex/dist/src/stream.d.ts","../../stream-multiplexer-mplex/dist/src/mplex.d.ts","../../stream-multiplexer-mplex/dist/src/index.d.ts","../../transport-tcp/dist/src/listener.d.ts","../../transport-tcp/dist/src/index.d.ts","../../../node_modules/execa/index.d.ts","../../../node_modules/go-libp2p/dist/src/index.d.ts","../test/interop.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/@types/chai-as-promised/index.d.ts","../../../node_modules/chai-parentheses/index.d.ts","../../../node_modules/@types/chai-subset/index.d.ts","../../../node_modules/chai-bites/index.d.ts","../../../node_modules/@types/chai-string/index.d.ts","../../../node_modules/aegir/dist/utils/chai.d.ts","../../../node_modules/delay/index.d.ts","../../../node_modules/@types/sinonjs__fake-timers/index.d.ts","../../../node_modules/@types/sinon/index.d.ts","../../../node_modules/sinon-ts/dist/src/index.d.ts","../test/addresses/address-manager.spec.ts","../../connection-encrypter-plaintext/dist/src/index.d.ts","../../utils/dist/src/multiaddr/is-loopback.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/it-ws/dist/src/sink.d.ts","../../../node_modules/it-ws/dist/src/web-socket.d.ts","../../../node_modules/it-ws/dist/src/duplex.d.ts","../../../node_modules/it-ws/dist/src/client.d.ts","../../transport-websockets/dist/src/index.d.ts","../../../node_modules/p-timeout/index.d.ts","../../../node_modules/p-event/index.d.ts","../../../node_modules/p-times/node_modules/p-map/index.d.ts","../../../node_modules/p-times/index.d.ts","../../interface-compliance-tests/dist/src/mocks/connection-gater.d.ts","../../interface-compliance-tests/dist/src/mocks/connection-manager.d.ts","../../interface-compliance-tests/dist/src/mocks/connection.d.ts","../../interface-compliance-tests/dist/src/mocks/multiaddr-connection.d.ts","../../interface-compliance-tests/dist/src/mocks/muxer.d.ts","../../interface-compliance-tests/dist/src/mocks/registrar.d.ts","../../interface-compliance-tests/dist/src/mocks/upgrader.d.ts","../../interface-compliance-tests/dist/src/mocks/duplex.d.ts","../../interface-compliance-tests/dist/src/mocks/metrics.d.ts","../../interface-compliance-tests/dist/src/mocks/index.d.ts","../../transport-websockets/dist/src/filters.d.ts","../test/fixtures/base-options.browser.ts","../test/fixtures/creators/peer.ts","../test/fixtures/base-options.ts","../test/addresses/utils.ts","../test/addresses/addresses.node.ts","../../interface-compliance-tests/dist/src/index.d.ts","../../interface-compliance-tests/dist/src/connection/index.d.ts","../../interface-compliance-tests/dist/src/peers.d.ts","../test/connection/fixtures/pair.ts","../test/connection/compliance.spec.ts","../test/connection/index.spec.ts","../../../node_modules/datastore-core/dist/src/errors.d.ts","../../../node_modules/datastore-core/dist/src/shard.d.ts","../../../node_modules/datastore-core/dist/src/keytransform.d.ts","../../../node_modules/datastore-core/dist/src/sharding.d.ts","../../../node_modules/datastore-core/dist/src/mount.d.ts","../../../node_modules/datastore-core/dist/src/tiered.d.ts","../../../node_modules/datastore-core/dist/src/namespace.d.ts","../../../node_modules/datastore-core/dist/src/index.d.ts","../../../node_modules/p-wait-for/index.d.ts","../test/fixtures/match-peer-id.ts","../test/connection-manager/auto-dial.spec.ts","../../../node_modules/@multiformats/multiaddr-matcher/dist/src/index.d.ts","../test/connection-manager/dial-queue.spec.ts","../test/fixtures/echo-service.ts","../test/connection-manager/direct.node.ts","../test/connection-manager/direct.spec.ts","../../../node_modules/it-all/dist/src/index.d.ts","../test/connection-manager/index.node.ts","../test/connection-manager/index.spec.ts","../test/connection-manager/resolver.spec.ts","../../../node_modules/it-drain/dist/src/index.d.ts","../test/content-routing/utils.ts","../test/content-routing/content-routing.node.ts","../test/content-routing/dht/utils.ts","../test/content-routing/dht/operation.node.ts","../test/core/consume-peer-record.spec.ts","../test/core/encryption.spec.ts","../test/core/events.spec.ts","../test/core/get-public-key.spec.ts","../test/core/listening.node.ts","../test/core/peer-id.spec.ts","../../peer-discovery-bootstrap/dist/src/index.d.ts","../../crypto/dist/src/aes/index.d.ts","../../crypto/dist/src/hmac/index.d.ts","../../crypto/dist/src/pbkdf2.d.ts","../../crypto/dist/src/random-bytes.d.ts","../../crypto/dist/src/index.d.ts","../../../node_modules/@types/dns-packet/index.d.ts","../../../node_modules/@types/multicast-dns/index.d.ts","../../peer-discovery-mdns/dist/src/mdns.d.ts","../../peer-discovery-mdns/dist/src/index.d.ts","../test/peer-discovery/index.node.ts","../test/peer-discovery/index.spec.ts","../test/peer-routing/utils.ts","../test/peer-routing/peer-routing.node.ts","../test/registrar/registrar.spec.ts","../test/transports/transport-manager.node.ts","../test/transports/transport-manager.spec.ts","../test/upgrading/upgrader.spec.ts","../../../node_modules/keyv/src/index.d.ts","../../../node_modules/@types/http-cache-semantics/index.d.ts","../../../node_modules/@types/responselike/index.d.ts","../../../node_modules/@types/cacheable-request/index.d.ts","../../../node_modules/@types/ms/index.d.ts","../../../node_modules/@types/debug/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/keyv/index.d.ts","../../../node_modules/@types/linkify-it/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/lodash.random/index.d.ts","../../../node_modules/@types/lodash.range/index.d.ts","../../../node_modules/@types/mdurl/encode.d.ts","../../../node_modules/@types/mdurl/decode.d.ts","../../../node_modules/@types/mdurl/parse.d.ts","../../../node_modules/@types/mdurl/format.d.ts","../../../node_modules/@types/mdurl/index.d.ts","../../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../../node_modules/@types/markdown-it/lib/token.d.ts","../../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../../node_modules/@types/markdown-it/lib/index.d.ts","../../../node_modules/@types/markdown-it/index.d.ts","../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/mdast/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/minimist/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/retry/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/sinon-chai/index.d.ts","../../../node_modules/@types/strip-bom/index.d.ts","../../../node_modules/@types/strip-json-comments/index.d.ts","../../../node_modules/@types/which/index.d.ts","../../../node_modules/@types/xsalsa20/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts","../../../node_modules/@types/yauzl/index.d.ts","../../../node_modules/@chainsafe/libp2p-noise/dist/src/proto/payload.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","cb4b40f34fe4b1d87c530a0f3c2c1e043e338829fab8cf5cbd92a91c8c1374b8","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc","176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","4369b27ca2716a04200930b5f24fa87a6ed62d8c70f80a83270956b6b23c32ae","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"8d6138a264ddc6f94f16e99d4e117a2d6eb31b217891cf091b6437a2f114d561","affectsGlobalScope":true},"a882b74c4ba115c6e86371f3592a3accb2c50874b6fcd92a4f83d17a4d6993af","4a8722c7d7a4dac1616db1f41ad0113998ccbbbcd37af43def3fbe6b41208c83","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"0b3868d3f87c95ea73bdfab380e536843ec3573aa76233b97aac40518494ea24","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","30c2ec6abf6aaa60eb4f32fb1235531506b7961c6d1bdc7430711aec8fd85295","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"d48009cbe8a30a504031cc82e1286f78fed33b7a42abf7602c23b5547b382563","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"24ba151e213906027e2b1f5223d33575a3612b0234a0e2b56119520bbe0e594b","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","28c1fc8505da2181ee74c9fe902fac964159cfae266c4413905d50eaecea8a19","84b8cc86ad19115f2637401cdd220460a25542df478c966a5ffc5eeaf3825299",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","1bf687d978bdd6d5aff10b9eb0ff0695179f8594d4446946fd0182d6d25fa433","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1","7f2cc72a16a663ab9f8d99bd5658e583251ce0c003bf80a948973e15a7ef9596","af89ab13b40dd28cd91818fc6329914d2b9663591831f032ff0f0cb4a028d4a5","83a1426ac1a9cf144141dfe10d71a68629623a7c28245c9ca0e0352bead501fd","2726c0a6a4a87fad11e6846e6b0b40b8924fbe66340adc512093c4273bc53e4e","c888daaa99fdf6c5712d98605fdcf21cbbaab756a629661a44cac44ede464d37","e044f60686dc70015a3b7e7c64ad0ac5ec5ec101a0aede0782ec077e136b6a65","a232f867897bbecfebf68df575a417af1afd9b5dd3d83fb4d59e0a133a0de93d","228dbc8825b7a45af7d416dee95c0a2162d7cf73ffddfd52357b7e548882bdaa","4e152867a5b1bea2dc6a2921c0196f877630fc144369f8c7b9a69905caa62741","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","88de5467cd5e4c2c1384629806d56ac1215657bddf39ef9f60a0e05beee2b131","ff5820394809bfc32a7e4586ff11b3c07327a0f4c756709aef92f1cd73d6da48","bfe2af20f3ff0579331661ef4c5d2597e0c31a7a0d760e41eaff0502bf064c4d","f52a0e53f79d7fd1c1c55a3cbda59499d4cce75f3188969024cdc286b29ad3ea","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","a878d4c7237a7af50e96534295fcf723134d70cbb1e9bfd8365266b912aee6ec","8970ab047d89c71edf9973609dd62f61bb366abeabbff36a1200103b6c1c605b","36d756189d9295e3a964e5cd45cb8ac965d5d2ada53ed848e08608426c146d69","8bdb5c16e8b9ba625ec08d8189879a6fb47b2c3c458a5d43ebd53a8763b5712e",{"version":"d920cd596508281d66f5b040b2e5c2728b02dc59cd481905dfa019dcf7151473","signature":"0d954151e68f83130428c7c4e47b4578edb239e5d1f4e0e3fce6fa3987fd0c46"},"38efa025cf48a42e6f449592f2bccb35729b182b1f6435701f75c6fe555b9cde","fadc84f69bab30e956d9926db282149dacad42d5f300a4cf6ed81b7d43c51d0b","d9619bdf47b220d356c646b3693eb6fd5cd0cfd1016da5b2f1d37ad0763da88d",{"version":"73d6a504cf3a99898e727db717d4d65d804f07c27324feb7e6991f4d9c8f7557","signature":"faac43934437f1d0900b60a80bca64fe9b7357b02fdabfe16b5e735155de3d42"},"b9998d79c6cb4e43e9d812fec5ccafbedee623c589904e3e3f0439ef861e25dd","7a6f74294b8fb90f5e3832be21e25898dd81b2a1adc36dda6929813ba4135311","d25e693302c8e284b417884b40dbadffe693b0daff8999a000995114dbf74c49","a1d4ac1b15cd62c7346d976e3a01e6cbcd4f166ea6b7866907d25c5acc832d77","5d40e6a7071d0d1e6e558e17214ff786ecb3ea73e31b25a88c2cbe2435fa1252","fd617cc8eec6f43227ab572160bac9d23c723073e83a9b100bd15c758eff34c2","ec3786b43d68955ecdb12ce679d3bc61b6b25c4d0ac5bcdaf50fa4a746189b98","3155e98b0df0c1523715e8a1c75c8a67c401aeb58d6eccf8bd89d5d775b8c1cf","fa82b7b22d9df87323e31e9e2ad75911028f3e544647fd212424b3c4452fee3f","90aa0b916eef195a17c3dbd621746f82ac7969ecc3dbf27c81ee4c68c5af7f25","9ceec2a882368c0160a8a3879aa0efce0fb985751fc23ff6191006030969cfa4","cad5d6451789234434c28dd2d6a8267b0d64c479b1ad267321faa31ba90d570b","e0e8254f7a1a21b5768beb4dbc9d4574ce67aefa59d88251d16b17c658f2a69e","c45242078469b9680653d6a0667b23b1b767ec908825a14bfa8bb1dde2e30dae","5dcd218cfe8eb7fd6a1e5668c1a98734ddefe888d17129f8844552dddda2a74d","0564c90e8c2577950a446d6197a3ab7ec433ad5ac98435378e8855427f4cbf24","e1712267198fc3dd7903d0b945d5049fd56d68cadaf986c0adc40235fee43488","df21f5c49d638cbd6bd322eeb5b16d8352ba14ccb88cc9b23a7d8d5c2eaaf659","40924f439552f559ffa4e41d300a411646ac9f3b53e578a012f7c439d36c6a30","f6d13788d90394a540d136fb8ba9a0a647d8baa2e51d2ae155d039b031f4717f","81c6dd936bf342efbb1b1a5440a4300db5d39d70a6ad49ebc91ca7033ae9ce79","924dd07d0dce2040a5106708a766802871d83562671e5aa3a443a87007428af1","8b1b666fe96fd9e713f1279a3e446f16ee824f46ca0c2c075e4e89f0b1258e6c","6aecbb60c2216da24acb86490f7c6270a820fd85424c8a509e3d284aa47f7a56","6af9cf238459fe6d7e2d61cd50a157a6f540905c9793718e0e6e5993ab0cd650","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f",{"version":"a9c5ce8f8c58d9765a03253195220cf4f92dafcec282422eb8a040529347810f","signature":"eb7e1526f24a930a1704fb10dbb8ea6b67155201538511c0597a78fe52cd5ad0"},{"version":"9d2c89e67738dde758932be6024680e8a75fcb29a5bcae0e849c880b9b5a2874","signature":"e21613b58d0d5d11dc5145c33a4e946e2f1c45a8a205af81605756688dd6ceaf"},{"version":"b549b4d3c0dbcbd5ba7e390f73551e47da1a2f4540f02748b67d097c839e8d5b","signature":"b627014446a386a8d065a2d0b4101c30694d51727e23da49233d8907e5b713c7"},"55e5a976b594dc02f054860fb59a5299872a5b3c8c90e96733a5c9c9d4ed1fb8","fd0dcd93884e6815d949e96fa15c89fdcbdab54503da402ae3a4caf31579c936",{"version":"e6bb2b7fadde29c393d340275d4ac7aeacf1eb876595f57aa24e5513a382b3ef","signature":"63ca909407550cae71c33965de45eecd193b8f8f039351c035fa5f1048c56844"},"27679e96d1bd38c5938178aaf4abe8627493090b63d6bae2ce8436e6a87ebe4d","a77fbecee25688f568e18b43f8f54195d6c278a2a9a687ada5ab3d2f726524eb","e29f2b3a93ca3392fe29fa8e7b93985e854b44fe28e2b5c113f08296095bd6b7","d27956c8b392088a06d882e1edb58aab4d5cf5ab1229b73f99329ab21f352147","d643518d0b08b3d8d6e7f1fa884bca57ef95caaa1c312abbd9e1d4ed0d51c370","2808ffd2725582e383a1d994188f0ad0eb2c456dc9845e8b6aa327383adb061e",{"version":"41ae2c0b7d01b64ec7b62ad4ccda00ad31a0aa7ae7f7284c2fd42e0936a88c5e","signature":"80988a4177913a1a01949bbf9e937652db5c88e54ccd3c3cceb76b333e456dd8"},{"version":"626ea938ac500bfaa0949f341ef326537d5892fc0c5657f3daf19a26fdbba9ec","signature":"5bfc6fd511694c1b7a798f9d8ba74c36f0319fe250a8d0620f938754316cc63f"},{"version":"bcf650f73a69cfe54c668c11901d7ce5baf9fdaaaa6420ec17253e67a1632c8f","signature":"be50726c9d62972a6797fc828490aaf8bf47a0b316f513c62043d6d26763ca25"},{"version":"614db724cedd81dc8a8b7ec3a375169d3055db2220c77bfbeeb5312eb4adf07b","signature":"3d9fe271b931d600a0f40f892b38fef1ce19193598aa7c41a649f9d70681ba3b"},"ca027df9fd496a200d99ca0db4b0077463ce4926a6c8e05cfae522c5971ccbc0","acd5d501223e3a7cdd229b501fce5fb071937b72bd05fa33e543eb21c8ee0aba",{"version":"0f2023112b4aa2e14dcff2572aefcaa69cdcf4143d1316a7c2f72dd3af8168e4","signature":"4de820fd1ee608149e674b6a7cc0d1fc0e492602238318696bc1887545874828"},{"version":"c5fda50b180cf1afdd1a3a68a8fa4a2723fcd4360a4e528db486d0ee4a598c16","signature":"2cac9001d5225ca959d0c3f5f80d35d5f013e8ebed154c498eca6c4972f4bab4"},{"version":"65827869dba0b53120021452552098e9ae4f4f4893d02e3809aea287379d0385","signature":"b958ae1dbad15a21485564e451f5e2228d90b71ec5a34bbdac9d9a5e724977e8"},"ebc51770c27d90812d97af081e035c941e7ce706a909c838e759b6d605967f83","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6","b9c8e45d6c518e88e902d77684fd368aff2965cf1b68553f65595a02fcdb9271","4c7450b3aa5f4eca98e0cc2c9345ced21ff3eac3e1d7e9cdb60c1506af3c28ac",{"version":"e0db3f04a02c9ef7e7dcc6b2d3df5b1429772cf2a621c10a7c55f1d900b5f08b","signature":"c8be47f329ddbed80083263f609d8c371aef74f245533fe8f735cfdc7ff81f46"},{"version":"5e72b8a1f80b69026210580877854692458685702dc6e594be768610a2ec3c40","signature":"0818e6c6df479d2fa37a814b3dfb485bc62cdaa0d2bc0975a8f8c92cb94d0019"},"f0d7ddd36a5f0302dbad31ae1756103614b1d2cb5d66787f6c7707421844600f",{"version":"0eab3309046467aa3bc74d3a63144a23c5d752fbc51a866cd5151bb3a0135b95","signature":"cc709944ab0871c160c167f85783e1d4c6965118253189a7d4050929f3ee9731"},{"version":"3e89bcb6787647878dee340dd79c3cc80cf12acfe49292f8b0a675c76d25fd80","signature":"663d1476d5406bb576933204087e4f6ca44c046ae2dbfa9557d1984c9f4625de"},"4dd9ae44b5db6481b9e4b97d73a11c70bc73b9872fcbe7afd294ac144524327a",{"version":"0faaec63b3842dcfff015dd500d6c4e5a2638f68ab6f118d743171a8492b8ff0","signature":"d6015cb929c7cb6ccde98f27cc9132dcf19c17ecc9603dcf9d7f3db1f3f2a407"},"18ea46e4d0790901645c0c35dba475cd9cc807bff21069d0712dc6cdd8e5a948","f7cd98b9514f659b7c56823a01bfbc090d160315d6cbec8b0bc93cb6e51256ee","f30cfcfff28ee8f87563225b47239bb07b9b11edd09dda0ea6499b18cca1a30e","0edb8a97ead1fefd337458449050857e80740e31a3f76cffa656262f4e651a50","db8e4b47dd8c22634e3a326e5a5f60aa71a8ad4a0458fc0aadb6951f1c7cdc54","5b7a6d3f5c1b1d94d6cbc6c1e113588e20ae61d583d0d0cb5ec3fd92926d3749","61e6c9b8686325521a57c5b666fe2eff5a2ded387d784ef798074be55c065115","49e4e28978a87105cd9f0751ef1de0f0027f05b54bb7fa7e6623384e249e2b69","08fa330c7b2cff91534f26d3b425c1c91e4dc09456eac94a4b90d7327d78ff45","6b36e4d73dc098ce39e690245b11bcddf64d3bf899ee3492c3a3b90fe7c4ef4a",{"version":"48d1f43215005531a8504b28ead6eeb1028e207f0ba5d0a48bf662c3cd83aee7","signature":"a57c2842a2521df37424e2408aa2a56959fb21289cdad0e1f46db96b90f26bab"},"f5337c3ea7b8702ffe2718f56a24325a67d517c0d552ef71b8d578d9f33a99d3",{"version":"b0150ab8495cfd4663d8dd8e9e0d7ca41ae2ef11949660ba5f8a8a7f4ed48977","signature":"dba2c5b1d82935514a77d71247e55bee230e03a5ae4e0e81bd3100910a74fd72"},{"version":"49edd25481acf33a4ddc1e247ec183e8baedcc3046ec73d0bd667d548002e8a3","signature":"fa091e487523449b62860cde2e6b83dddccf8443c3340f5834ff8ee937b97862"},{"version":"6fba7311ed757f04bef53b3681d9bbba4b681ea26a9b5fc0f05441df9247faca","signature":"452a1c5114901a45142bd00787acdbfcec0df71d6e8f08d44359990ac5018512"},{"version":"a7041eccf3ab5836cef6a250d19891dafa0baa144d356e4e995951ae07638abe","signature":"8f184e0e9ab262f3876e9df1c4f558d073e2423c5f52f9e5fcdb26401f1f1da6"},{"version":"ce2a4ca07d0b15fce4d2524e40d0c43a8631034996e92944e041fa090f9d0a18","signature":"1a0f1f766840f4d8da9242bd623dae922220a68103649d69ebb2de45b48e815d"},"db5a96761bf022851439f3e689ea8b7aca6055037647ba21501ed22d7c1b3bb3",{"version":"49ce78b09ad6872188259c0581435bc04faf9e09ed51ebd8e14ea73c7b6cf2ce","signature":"9e01780d391da4a7ff69191f227e324d7c6eff00f2c43cce9b6241761847741c"},{"version":"698b99e5612a81874c7c8816ebfd905bb2f4241a08dddb6dc6172a66a33a58a3","signature":"8c28bf28c8f832aa42278508fcb89eb937ebc13e3d39039a42d5cc72516974e8"},"688c9dfd2b7114f5f01022abb5b179659f990d5af5924f185c2644ca99fe7b77","925a8770415572378b7b62dcd714e744b7ffed86de59bdbe1d25c68d9d1f7f51","fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","03e385ae2125c9aa9dead008b42a0ab20d0812c26c19ee210d84c2666113f867","444fd02034dcb14575c1d65b39678654508784d34c4d66d6631b54bb6aa24d21","d4936633d5453e441ad5ab182efad46a0e1285fe5f9f5c2948cad3e71b7c2c23","7378c8a8eb3feec7b36b268d55794b625a77f1a3a4d075932425fd263aadd8c2","a1b60bd2328318dcbec30bdf529dad31a13315ff2df60c8bd71630c58a575b06","5d11703e2c5d4dbe00bbe79f3bc864d178cf8d6ebccc2d1448ea29e93654f029","92aabe63a01fe06680e7e49775d5a66524f4816d49490af8e82330e5aeff91fd","ed849d616865076f44a41c87f27698f7cdf230290c44bafc71d7c2bc6919b202","5c2862817a9073efcdc8608cb171525067c4a7afd82f2cd800bf208104085234","626a82c4bd44767fb7ab3709a2a7857d43b02b575e7d1678d3d24f889515983c","8f364fec0ef20506aa9cf00b5cd8b620c1c0389687b11a3a32b0b5d4716ad894","dcef5e69bfd584dd4640a8363792acac1f2328767a57f401ee6daa0f281c632a","763bb8df872cbb8783e29e19bd7a1dea0f88f7fd7398343af38be8509a65df82","c286b410193495d067668bcdbd13ea3f3a39001edff02edee248babf2652e563","ba1405da509cc84896a588978efc45400d4f9844ee738d750b59868b1ad1618a","129e03ea345ad2ec480758767408a6119112e1c1d6a454f83524c8590549a949","932cade1c5802123b5831f332ad8a6297f0f7d14d0ee04f5a774408f393e2200","1165dc3daad62e737ee6c7016470a4a9a4c751be9f47da494a718a0b428bfe49","1969a7f95125132dd513d57d726f4a645270bbe2c4036ae23231f6fe916b0bd3","35095a100857bdbca3c31ddd6e1eb18259140dee0092d97e631889daf084eaec","6744c64cda78d6af7280d69c20ead828fa4296efe0b582548cb10ab66914993d","612bf9cb0b0a7ce6eab9fa9c09da1b1e4e5ec8f6b94f282035bfc89f68d4f3c6","1cc2659564153cef042b6a377a36a04d861398d678e7032ec42698d8c80ec77f","1f66808998faa0d77e425d4c5ae8f481c3234d4b8c1deff001e1af71b4b041f3","2f37bd92ed3c6cbac299dbfd79abe367c5e5d72e098abdb8d3e3900badd53e88","4110b29391d0835f9b88a4c69cb7e1cdddbac43ca9ee86393ebc15567c271b4d","8db42cde9161c917ae86f075cb21c16d1fab5965db0c4f4b372b4e7a0276f82e","f2dc190b33c1e842552ab4117c29cc960edd8ce2327a22254ec47cbcbdbb91f7","c8031a5db82b240f801a5684ab693e95e1e06dc76958894fe42d35acbd446f28","1633b84fd3346ad6500a88e7a119ac778bb6f6b2746a3b7b8164c5ef2721822f","75e0c62536016dac8cc0d825742ff7cc4c0455ebc86923e47edcc19edac0997c","de6afce5d1e6f2f81a5030fee9c7400a56b3c4077c5f9699cd71294c91e525cf","067ab20bf63d65f9b724398636d5083a71fb7d8cfe80a504ce2d2fe31400eab7","df54eaa5ea53c6bb3a9548bc5d2f6fb22583ea3e8b936a4e8ec5acfd90422ff3","faff9c6bf0fdb4020a7562249152411c8836693214e96fb1ec8af5935ccf6f1f","a982ea9a0d0c2fd5bb64eb8b251a80528fd73dc75a0ff2945483c778d1538a45","c23e3a1201af6ac7008a961c755134b204e3a9cf88b0483dbcf84e6a8439abf6","58cb8a81e19e00682e13e339d3f5ca0e24062d4144459b83f5fab67fddb4ab2b","bbd1f1105b91037d6ea5e27a488842f519a639bf9544140a80887069d98aef79","91061d4b30ccb1bdecb7f77e1b2fe4851834216214e836a4bdc3e4ff509ace65","90c062de3a56230a2788738b08a1180ade53bff424fbcc4cccef9010f8ff8bf5","02501688d58478fe06e958ddb5e194c1176e59bc7978b98d565a25ada290e294","e1b02ca4c82a90dabfdf773d4e80e56741e57923f2b73b2626a0555d61c9b7b4","71d388419783d94fb23aa078aec7258e470733d2d0ef80e792c226f820d245d2","be8d072f400254824429edab10acbe595299b702c97b99cc47f8e8018b7102ff","1a319786bea64c944ba8dd33331090034468efbab9c2fb96552850033d62d8d8","33174450482b921bbf093e3d52f501f7f93b5fd612311aa86e7339f2800162aa","a549d8215160fc249abf80f37aeebc573b26b491fe99c90a4ab70e50ea44948e","6e6733927ade923e34b243d6fbec1465cfc8ed6edf62c6e09ed00c529f0d93de","83b3a9e85f7967509436fcdfa9be9bd543fb54003a9233c5c0af087e4a2c11c8","dc92d6eccf12395aa1d47afb765d5e4a1cd2639a385db0e3e88e9937ad2b63a3","efcac7cadc707d5a2160f7ecb5c50e1c44491bdc400425edc3fbe8bdeb9b644d","1242141c87ba3396bead6f379f6d6778bd38d02017f243aa448d1454a5fdc90e","359a90789781b494878462da0ce3542c3e2ba9a7ecf15c2fbff8af21eeed3117","db4d7c9c5038c75e1df338d780a6c06c79589b5105f138dd29b62310aab749fe","b056f955c85dd0eb196ff290138eb4a83787c3f413505b9ae2676a602be7d40d","d2012ac9bb5854c62e3a26000bda07f7ed765a3dd8ee7b705c7d83e085706271","0af481fc1bf41aafebc2f02c5df80b1a41bdb1cea1b202c44c1bb0e681f9d63e","17a4105ddae0308e19ee8532bdeb76278efa9dc644366060ca644541d3fd831c","913ffa031f7455c53e99c75ae130a046612d2ee0e716ed92707e996cbd3952ea","44e897d02326bf4d8169ea9638fe0a4c53b8f85cc48ae2fcbbb67b2f72c1d805","288fb1b9df77067c3c2675bde87d23d4a3f01bb6f929f854f11bdb68662968ff","b43b5156bc2831b46f6226777e292ff1646b3651ce190708b6228a078d42da4a","c3e77c4aa1097a38dcf4a20a093ce65033a16f3a48dab0ae3c5f6661bc39b11c","22c980472aeac42a88c7954c9645c5cf0c511142afd048699daf516b25f9ea2d","aabcb267f8a73a9923157af617c47e2d707481760e60967dfa836613e2b7433b","502048f764485a8d13079c153f3ab8659c8d40c900e3d13fe5a4f901216ef7ea","3fdffecf635bb6a2a57a4b5eb321f302355168a775b9d2b56aa0a61748c4db87","0d6e9983d87ca882bd160af191909bce5c1d9b22f4bcb247d914b572cbddc076","590815e7bd28778a71732b03b4852917e18bf42670cc1931e4f95ebe99157838","32cbe201bfe8ed7f4c323fb8a3fcfdfb451f22e84d3c49da33ceda2fbf9230be","50d536e2e8bdbb4234b6ade05992aa4227fbf0401aba24922734c3ddb4a3ff11",{"version":"0ea1988bfa2de2538b465f03ccec8d23a4ad137733c0ac943686044c59301b9b","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d","27573b15894c6311146838fa3b45786bacc013a4bca6c84adc1b11a4e7c8a4c0","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2","8d16e3ff29dd0650435766702b01c2f7e9d1f289a48fcbf8e93687d6ecf33f26",{"version":"4cc7b06037a8b4d268685c9c5f3a7512e5abbbe85754de00eea65e4af69f4d18","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"325d8f966024c6ee9696a9b1ef84fae789029aa40c2f492f513f042506067dd4","4f590c560ee71a07def1a8e0d663d9d7ddb0d806deab94d8ceaac1f6408ac314","f7163a5d37d21f636f6a5cd1c064ce95fada21917859a64b6cc49a8b6fd5c1a8","3f666b04eebdae90161ddb1688911a72644fb9836c076707758391ecdd0efaaa","1dcd0086953c3ed3210ddbb09c9933c3a59629a47feacfdf8245cf3efc69c7af","c18f4ad1703534835a14df4eb6de7e7dfa70f82fe947cb7864399c68169ad3e7","0c4ba3558cec749d376e43f9795ecfab6ad3893e0f8a40a761b0d32bf95524f8","1d34cb56aad5cbca58399312584b2d573e1d4d79917cf9548397b7f5dc8a4a48","91764b36fe5e1c5d688f5f90eeea47703a059ab9a81bf80f7bbc9b04507b7bd3","115327b8e1f68c03004d841b83e332ed16b8f48af59ac00f38313887d7ec2920","177efa90a97917618cef3f68b04ee95c393fceea045dfc0aef2820d5aaa9e8f0","f3c65459172595a5a332a5f74e99d3ddb6200201550a2d1ed1b03dcfa9c0d76f","f6e125b70d7118004733e6856a90163bbeb01a4633316fc2a2aaccbfca6ded6f","46507ca157c8093e9b90b1c62be468ccb4aa693eaacae464b3935f6f24ccc9ff","af9a54fd33c9b0b2c05e433a71994ae07b75a3c4adbe82bdf6de863ce0f0e340","818068f6c587f5540e5cdc7b0f2ea6c04a0b9fe11745ca60f031bf349c17ba5c","d5840c8f2acfef007839d4e252ad45bf87219021c81de7de5cc98646f5d99d0d","f2601f76cd8ebb45e274730c33b44897fdea4bc742cb83fd98586754f08a3398","054dda98b75dec317926dddfb103939b99cccfc8ade63d7e6a2ef2f3343d37f9","a3f9f52ce73700565c8d9ba2aa75823ab8fc8e7258a27ecb828cd4257b8f918d","ad3490364b6442ca8694fc6cd364b63a5d807651a514837cc22ef29df624bb9d","4b5603a1ccca455500cfb39517d41ec011f31ba84bb6de44473344a237d89168","2e5e5c1e456256a0ae3b2aad2b771fc751081ce0a28ec5dc2c64e65b0412dea0",{"version":"29cbd44b63e1373c5333f6a15b146de939492adee7bd0f365daf3a06cd65e21b","signature":"24e087d3b31a47d62c6c3993d39192013c5053f8fbca6071bafc7cec8a8d001b"},{"version":"664564e7585304eef4017daec5cfae3363cab137a5886f60778907349bde8b5b","signature":"3f17c7fa020acaea60b13c7a4aa818b43af21e670a63d2dadc23c91b9e18d0b7"},{"version":"bb3fbadbd80095e2a4e6b4ab3660abad522e3dd29c7ed789b5587a896da0bb54","signature":"e0f6fbf8d68b52c380346198897e0a93f1ae28f86330a88becc270b8c0091036"},{"version":"8cb350cb47ec9806c322ff42235c998bfd2431f8aaea942bc8fa788c4884602a","signature":"878912f2da7af40fcdf0e9c72301491113ad60d80b56f75f9dbcdaf9560efc75"},{"version":"ffcea8929e2e7bcfc9681b53d930d4d76bffa486f3867bc419aa14330c77b922","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","4a337d4b854af8d61f943bb689ccdf523a615d109638148e7c04f8d451124bde","bac9f741786fd70df187dc6a82222ac8516fb7b7034a1266d422febb635c1cbb",{"version":"f18c42254c093ff60ee9d0fd4e7ee14cd6d1a15bacc4cd987eefc2e2557a8dc6","signature":"518a3cef0d51ba223da57c7e8be03696fc4aa41a9f55e1630d548dac970eb6ac"},{"version":"71f5318cea6e3b64a4e1dab2564e819172c476d8769ccb2538aa57932cc65218","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"72033392f964381ad90647d2d9f06cab5bfec7e620f50a7d55de2823544efe19","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"d626f2c25d5d6daddb082576771a8e7b591233a7893a1739513c44f35a3f7489","7c59943d77166c1aecd731af8683a7b5a0984e1bc0427fa35be504d77c41fdcd","d357e56d630bcd0f63cfc678e306702555b4f791c2d8e07f037de39171be4cd3","238f87de951ed064c7ec3e30a987f386d4821bacfc8c7548cdccf848b8b6035c","a93ae01c9ed49ba423599144ffa3cd520db83e53b32471865905a65113bb3e59","6088973936033e869d3616b63d25c15363862b491f46af77d40a5215ee8cc1a8","04a80a0c9937d8d13620c1dcbcad60f3dd44385a76ac4e3b6cc389a955628256","02a8cc0d6cd7bf40d796bc94f975889aa82d0aae28a9b1ae470f4ba036f6ad8d","adb5ad16c19ff8dbfa9daa3a7dc8e1b039c381a2b94383144a53368681ad8ca0",{"version":"f73b9058c762abbcbb49d84b763f34f1dd47b71778e4f8963f01ed3bcc799749","signature":"b7b69c2e092bcba2a7ed8e26febeb8a8c15820c842451da89295ad8fea198e4b"},{"version":"0811daf51c6804a50262affde5c65480f51079b2d2aa1c1a1a948a7946a78ed7","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"b095fc8b641823c0a9dff9b0c7efa153db137c7c1512bb600995cf281b8f607f",{"version":"65ebfc151c78d1f6280915961897bd653175f71d1f0d48d070b0e12a6ee9b5d2","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"ab3cd789079dc58a03c1fa4b03baec764a24355aee00ab9ac4f29a1425d43b6d","signature":"f32f42a0ff6a2c2888746fc195585b4b70d62d09b2013bbb4f984c7ea7a48a66"},{"version":"ae856979375d9e5639b638af0d29ae832c8962ee023cb2b4fc8245e4aab0addd","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"eaa3b7616b2b314395494c049103baac9abed5130c37d8b171b64e841a2d940d","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"5ccc3c7f73ef48c223635cd4506f21133560de7abc4c09c623327bb1b54386dc",{"version":"830cf570c14fc77bfb7077aeaf8d22d124aab3fa6b23f337cedb0e4f65f19cba","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"14fafdc45e77ab7ce0ae87f1e8ceff495e7f80cbf89a8ce939a55eeb673deac6","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"d364010282a38935c34224a3c710246ece045a4f856dd48d46d7706d5ab6f246","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"687ec53a7422d8cf80477fffa82a2db211f724039267931642befcd4907aec26",{"version":"0569aabb972296b4eda3354f04ee852be3a3e5e9146150e410d966d8193e9a8d","signature":"a70f34c07bd6616df1a739e849c159f8cb144e6848808da94983cfdd80717264"},{"version":"8857f2b989814577c48410c51b19210a75e1142d6f673559b8e8cb7cee9155e5","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"74380673bfbcfab03e2ac8fbf7ab3040854088f0135ec6f1a80dab310bf087c7","signature":"1685b7bf75a707a658191846463c7b441d7617876816187236c2f7456f84b67c"},{"version":"6b0182ebdbd5187e44f4d50ed41ea8df8506b17e074e6fba97958542c06b1eae","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"571d2b33d636318cea915cc18aef35d858b9923fa5eec3a2dbdca5ac3b86c543","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"19cff718745012226a4232482c19c3566aeb846d58b0d72fd9e13cfe9925085b","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"3a0c74a63edf77177b54a9bd654315f37ab866823cce9cb11309b526a72b2c8c","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"e1be5fd899f565dfac8d7f831451d3d364ee2438e500ab36b7290ac3f77dfdf1","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"4b4a9cacb07588f869af5e910a9f262ac8c7c61f95a60d7a9766caf52bcf9877","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"42759c04bda25b20ab982e99963f6921934895f60e78d94a22d8d137a78dde59","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"6bcccfb00fbd5e180d8a9f28a4594e50fcf847628e8fc1d8f984d4c9bd24ed1d","df1bbd333631040027035b56cb31093015e59ce977a590500ed09feab109939b","a4f27ea63e3ff26a94b6681967a5276a2df9ddb80ae990df1ad03c0fffb34eca","18418f70457cee30da01c21bc26869ceb1ae65564784136f7fe2f7f2ff8f740f","3d2ec84143e6462a786b5d9ecf06f4f6f67a59a1f16c5a3a5e41721ba8478b7f","892f412f701d356f85cd3cb7d48b87ffecc0d4f85a2005c1d53e5e08414df8b1","5bfd23a4c8765d347e296639b75f50f4dfca445d2eb41ea0892e68b8976a0cdf","62a8effc4dd17bbc2c05927b4ca5f67e73fdb458e203b128c041d0d70ffa6b55","6b235e2b5f651d8fc5e06e6a5e41164164ad1bcce02edbbec07ef9419a6164a9","237b9868dd1ad6ff90abdfe22a14d323162704c6d8987e2b7905684fa3f7bdf3",{"version":"2da3f60192fd2a1bc69d43216b1ba3cd8053df69ddc0466e60eba51469d8159a","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"a1e32322f27ed7e7a9854a1b0025829a9a8694962c8ff08b66bb84bde18d76b3","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"0569aabb972296b4eda3354f04ee852be3a3e5e9146150e410d966d8193e9a8d","signature":"a70f34c07bd6616df1a739e849c159f8cb144e6848808da94983cfdd80717264"},{"version":"b359bda98a583c52c22ec8d3f2f3a7be26fc3df601f9c655286a7203a6a6cd87","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"24265aed586bbedf558d98048c3988260266e11c45cb579a73e2c5dae4813207","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"89b712b3515bffd0c615b344d0934582f6958dbfba5e5d12fef599819953d996","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"8e87715118f25403983a9b577dbe5b0fe8b754de0ec013860c25c2cb62c93cb8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"7a8c93220e8ebf8fd54353d566e140b3679f527627c8a1317fce12ee660d3fb8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","b8442e9db28157344d1bc5d8a5a256f1692de213f0c0ddeb84359834015a008c","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","da2b6356b84a40111aaecb18304ea4e4fcb43d70efb1c13ca7d7a906445ee0d3","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","6f294731b495c65ecf46a5694f0082954b961cf05463bea823f8014098eaffa0","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","68a0d0c508e1b6d8d23a519a8a0a3303dc5baa4849ca049f21e5bad41945e3fc","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","b03afe4bec768ae333582915146f48b161e567a81b5ebc31c4d78af089770ac9","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","4f6a12044ee6f458db11964153830abbc499e73d065c51c329ec97407f4b13dd","13e834b958fe7e9010d2161497f98916974a0618be7a773281a253a948da8b0d","dae5c8e0ca15779492744cb4071c5b3c94c2121940fbaefb43ca9a045557a0c9","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a",{"version":"525b52b38b44420fb1758c0917e7b67cf379f7f9477d2ba7343f3d5f50a44258","affectsGlobalScope":true},"4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","dc5fa6012f710446a9ed04156d986bd81d9119c93ecb63d85c6a9d493264b5dc","5aac5efd20619b522faeeb0badf250834850c605ad8c5fb91c6502a54057f413","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[199,203,[230,232],235,[242,245],[248,250],255,256,258,259,261,272,[274,278],280,281,357,369,[393,397],[401,403],413,414,[416,419],[421,423],[425,434],[445,452]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[157],[68,69,157,165,168,180,181,283,285,286,287,294,297,298,299,300,302],[157,283,286],[157,283,301],[157,282],[157,283,285,286,289],[157,288,290],[157,288,289,296],[157,292],[157,286,288,290,291,293,294,295],[157,286],[74,75,157],[157,286,294],[68,72,157,220,283,285],[157,304,306,307],[157,273,304,305],[157,304,306,308],[157,309],[157,273,305,309,310,311],[68,73,74,75,157,166,273,304,305,306,309],[157,304],[74,157,216],[69,157],[157,171,314,317],[73,74,157,171,173,284,313,314,316],[74,157,173,313,314,315],[67,68,72,73,74,76,157,329,330],[73,74,157],[72,75,157,173,303,329,336],[157,348],[157,331,343,344,345,346,347],[72,157],[70,71,157],[127,130,156,157,164,453,454,455],[157,358],[157,457],[157,164],[127,157,164],[157,476],[157,464,466,467,468,469,470,471,472,473,474,475,476],[157,464,465,467,468,469,470,471,472,473,474,475,476],[157,465,466,467,468,469,470,471,472,473,474,475,476],[157,464,465,466,468,469,470,471,472,473,474,475,476],[157,464,465,466,467,469,470,471,472,473,474,475,476],[157,464,465,466,467,468,470,471,472,473,474,475,476],[157,464,465,466,467,468,469,471,472,473,474,475,476],[157,464,465,466,467,468,469,470,472,473,474,475,476],[157,464,465,466,467,468,469,470,471,473,474,475,476],[157,464,465,466,467,468,469,470,471,472,474,475,476],[157,464,465,466,467,468,469,470,471,472,473,475,476],[157,464,465,466,467,468,469,470,471,472,473,474,476],[157,464,465,466,467,468,469,470,471,472,473,474,475],[157,498],[157,483],[157,487,488,489],[157,486],[157,488],[157,463,484,485,490,493,495,496,497],[157,485,491,492,498],[157,491,494],[157,485,486,491,498],[157,485,498],[157,500],[157,479,480,481,482],[121,127,157,164,441],[78,157],[114,157],[115,120,148,157],[116,127,128,135,145,156,157],[116,117,127,135,157],[118,157],[119,120,128,136,157],[120,145,153,157],[121,123,127,135,157],[122,157],[123,124,157],[127,157],[125,127,157],[114,127,157],[127,128,129,145,156,157],[127,128,129,142,145,148,157],[112,157,161],[123,127,130,135,145,156,157],[127,128,130,131,135,145,153,156,157],[130,132,145,153,156,157],[78,79,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163],[127,133,157],[134,156,157,161],[123,127,135,145,157],[136,157],[137,157],[114,138,157],[139,155,157,161],[140,157],[141,157],[127,142,143,157],[142,144,157,159],[115,127,145,146,147,148,157],[115,145,147,157],[145,146,157],[148,157],[149,157],[114,145,157],[127,151,152,157],[151,152,157],[120,135,145,153,157],[154,157],[135,155,157],[115,130,141,156,157],[120,157],[145,157,158],[134,157,159],[157,160],[115,120,127,129,138,145,156,157,159,161],[145,157,162],[130,145,157,164],[157,508,547],[157,508,532,547],[157,547],[157,508],[157,508,533,547],[157,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546],[157,533,547],[157,358,367],[157,366],[127,130,132,145,153,156,157,162,164],[157,553],[127,145,157,164],[157,358,359,360,361,362,363],[157,358,359],[157,197,198],[157,198,226,227,404,405,406,407,408,409,410],[157,197,198,226,411],[157,196,197,198,226],[157,197,198,226],[157,198,406],[157,198,411],[115,116,145,157],[157,196,197],[157,195],[73,74,157,263,267],[73,74,157,265,267],[73,74,157,267],[74,157,264,266],[73,157],[73,74,157,268],[157,372,373,375],[73,157,372,373,374],[73,157,372],[157,372],[63,157],[157,189,190,191,192],[66,67,157],[66,157],[64,157],[157,183],[65,157],[65,157,185],[67,157,184,185,186,187,188],[63,64,65,66,157,183],[63,64,65,157],[157,378],[157,236,237,238,239],[157,237],[157,237,238],[157,380],[157,216],[157,209],[157,209,216],[74,157,209],[157,209,210,211,212,213,214,215],[157,367],[157,194],[157,189,193],[89,93,156,157],[89,145,156,157],[84,157],[86,89,153,156,157],[135,153,157],[84,157,164],[86,89,135,156,157],[81,82,85,88,115,127,145,156,157],[81,87,157],[85,89,115,148,156,157,164],[115,157,164],[105,115,157,164],[83,84,157,164],[89,157],[83,84,85,86,87,88,89,90,91,93,94,95,96,97,98,99,100,101,102,103,104,106,107,108,109,110,111,157],[89,96,97,157],[87,89,97,98,157],[88,157],[81,84,89,157],[89,93,97,98,157],[93,157],[87,89,92,156,157],[81,86,87,89,93,96,157],[115,145,157],[84,89,105,115,157,161,164],[157,173,273],[157,221,436,437,438,439],[157,205],[157,189],[157,206],[157,204,207,208,217,218,219,220],[75,157,398],[157,174],[68,72,157,165,173,180,181,285],[68,73,74,75,157,171,173,181],[157,382,383,384,385,386,387,388,389,390],[157,166],[68,72,73,74,75,157],[75,157,171,284,315],[68,75,157,170,181],[157,165,172,173,181],[68,72,75,157,173,179],[75,157,170],[72,75,157,172],[68,73,74,75,157],[68,72,75,157],[68,72,73,74,157,173],[67,76,157,173],[62,68,72,75,76,77,157,165,166,167,168,169,170,172],[75,157],[76,157,165],[65,67,157],[68,72,157],[68,76,157,173],[68,74,75,157,165,284],[73,74,75,157,173],[68,75,157],[72,75,157,165,171,173],[67,68,76,157,165,166,168,173,175,180,181,198,332,333,335],[62,68,157,173,189,198],[74,157,334],[68,72,157,165,168,173,182,223,230],[61,62,68,69,75,77,157,165,166,167,168,172,173,174,175,180,181,182,198],[61,72,157,172,173,200,201,202,203,277],[72,157,174,279],[62,157,165,168,173,179,180,195,241,243],[72,157,165,168,173,179,180,243],[157,242],[61,68,72,75,157,165,166,168,173,174,179,182,200,201,203,229,235,240,243,246,247,248],[61,62,68,72,75,157,165,166,168,173,174,179,180,182,200,201,203,233,234,235,243,244,245,249],[72,157,165,173,246],[61,68,72,75,157,165,173],[61,62,67,76,77,157,168,173,203,251,252,255],[61,73,76,157,168,253,254],[61,68,72,157,203,223],[68,75,77,157,166,167,171,172,173,174,198,199,222,225,231,250,261,273,276],[61,68,69,72,75,76,77,157,165,166,167,168,170,173,179,181,199,203,221,222,223,224,225,227,228,229,231,232,250,256,258,259,261,274,275,277,278],[61,68,69,76,157,167,168,173,203,251,252,253,255,257],[61,68,69,157,165,168,170,173,180,181,202,203],[61,62,72,75,157,165,166,172,173,175,182,203,260],[61,68,75,157,165,166,168,171,172,173,174,180,181,203,223,243,259,271,272,273],[68,69,72,157,165,168,173,182,224,231,364,365,367,368],[72,157,173,276,364,367,370,371,377,379,394,396],[157,354,377,395],[68,69,72,75,157,165,168,173,179,180,199,224,225,229,243,244,364,365,367,368,411,412,413],[68,69,72,75,157,168,172,173,174,182,224,247,249,364,365,367,368,391,415],[61,62,68,69,72,75,128,136,137,157,165,182,199,203,223,224,225,227,229,231,249,250,252,261,276,284,318,352,354,364,365,367,368,370,391,412,417],[61,68,69,72,75,157,165,173,182,199,200,203,223,224,225,227,243,247,250,261,277,318,342,352,364,365,367,368,370,377,379,391,392,394],[62,68,157,165,168,174,182,199,203,250,252,276,277,364,365,367,368,391,393,394,412,417,420],[68,69,72,75,157,165,168,173,174,182,224,233,250,276,364,367,368,379,391,393,394,412],[68,72,157,172,203,223,224,247,276,318,328,352,364,367,370,377,391,392],[69,72,75,157,224,272,399,400,401],[73,74,157,247,254],[69,72,157,224,272,364,367],[67,72,76,77,157,223,247,277,336,364,367,368,394,395,420,424,425],[68,72,157,173,229,277,318,336,352,354,364,370,394,412,427],[157,277,336,395],[72,157,276,370,377,394],[68,157,277,370,377,394],[157,173,277,364,370,377,379],[157,173,276,336,364,367,370,377,394],[68,157,276,354,364,370,394],[157,277,364,370,377],[157,173,202,277,328,352,370,377,391,392],[157,173,202,277,318,328,352,354,370,377,392],[68,72,157,173,224,231,276,277,381,393],[62,157,181,252],[68,157,367],[68,69,72,77,128,157,167,173,221,222,223,247,277,303,312,318,328,331,336,337,341,342,348,352,354,355,356],[68,72,157,165,173,195,222,247,277,336,364,367,394,395,435,440,444],[62,68,157,222,276,364,367,368,393,394],[68,72,76,157,167,173,224,247,276,336,364,365,367,368,394,395,420,424,447],[68,69,157,165,168,170,173,174,180,181,182,199,224,225,227,247,250,259,276,318,352,364,368,370,377,391,394,413],[62,68,69,72,157,165,172,199,224,225,227,231,261,354,364,367,379,391,412],[62,68,69,72,157,165,172,173,199,203,224,231,261,277,364,367,370,377,391,392],[68,72,74,75,157,165,171,172,173,199,203,224,225,229,247,252,259,273,274,277,318,328,352,364,365,367,368,370,377,379,391,392,411,420,424],[68,157],[73,157,271],[157,173,262,268,269,270],[73,157,173,271],[157,176,177,178],[157,168,173,222],[157,222,443],[62,157,165,173,175,222,442],[68,157,220],[63,65,67,68,157],[68,72,157,165,168,173,198],[68,75,157,165,168,173,175,180,181],[68,74,157,285,338,339,340],[68,74,75,157,165,173,179,181,240,285],[157,171,351],[74,157],[73,74,75,157,171,173,349,350,352],[74,157,173,315,349],[72,157,165,179,319,323,326,327],[62,77,157,165,173],[68,75,157,168,173,174,175,180,181,319,320,321,322,328],[62,68,72,157,173,179,319,328],[62,68,77,157,165,168,173,180,181,182],[68,77,157,165,168,172,173,174,175,180,181,324,325],[62,68,157,165,168,173,180,182,319],[72,157,166,172,173,353],[72,75,157,165,166,172,173,354],[130,157,164,172,173,372,376],[69,73,74,75,157,173],[157,168],[68,157,240],[157,273,304,556],[157,273,309,310,311,556],[68,72,165,168,173,182],[62,68,75,77,165,166,167,168,172,173,174,175,180,181,182,198],[173,277],[174],[62,165,168,173,180],[72,165,168,173,180],[242],[68,72,75,166,168,173,174,179,182,240],[62,68,72,75,165,166,168,173,174,179,180,182,244,245,249],[72,173,246],[68,72,75,173],[62,67,76,77,168,173],[73,76,168],[68,72],[68,75,77,166,167,171,172,173,174,198,199,222,225,231,250,261,273],[68,72,75,77,165,166,167,168,170,173,181,199,277],[68,69,76,167,168,173],[68,69,165,168,170,173,180,181],[62,72,75,165,166,172,173,175,182],[68,75,165,166,168,171,172,173,174,180,181,273],[277],[73,74],[277,336],[68,173,276,277],[181],[68,367]],"referencedMap":[[299,1],[303,2],[287,3],[302,4],[283,5],[294,6],[291,7],[297,8],[293,9],[288,1],[289,1],[296,10],[290,11],[300,12],[298,13],[286,14],[295,1],[304,1],[308,15],[306,16],[309,17],[311,18],[312,19],[310,20],[307,21],[305,22],[313,23],[314,1],[318,24],[317,25],[316,26],[331,27],[329,22],[330,28],[337,29],[343,30],[344,30],[348,31],[345,30],[346,30],[347,30],[415,32],[71,32],[72,33],[70,32],[201,32],[456,34],[359,35],[363,35],[361,35],[358,1],[458,36],[441,37],[454,1],[459,1],[460,1],[461,1],[462,38],[463,1],[477,39],[478,39],[465,40],[466,41],[464,42],[467,43],[468,44],[469,45],[470,46],[471,47],[472,48],[473,49],[474,50],[475,51],[476,52],[499,53],[484,54],[490,55],[488,1],[487,56],[489,57],[498,58],[493,59],[495,60],[496,61],[497,62],[491,1],[492,62],[494,62],[486,62],[485,1],[501,63],[480,1],[479,1],[482,54],[483,64],[481,54],[502,1],[503,1],[504,1],[457,1],[442,65],[78,66],[79,66],[114,67],[115,68],[116,69],[117,70],[118,71],[119,72],[120,73],[121,74],[122,75],[123,76],[124,76],[126,77],[125,78],[127,79],[128,80],[129,81],[113,82],[163,1],[130,83],[131,84],[132,85],[164,86],[133,87],[134,88],[135,89],[136,90],[137,91],[138,92],[139,93],[140,94],[141,95],[142,96],[143,96],[144,97],[145,98],[147,99],[146,100],[148,101],[149,102],[150,103],[151,104],[152,105],[153,106],[154,107],[155,108],[156,109],[157,110],[158,111],[159,112],[160,113],[161,114],[162,115],[505,1],[506,1],[455,116],[507,1],[532,117],[533,118],[508,119],[511,119],[530,117],[531,117],[521,117],[520,120],[518,117],[513,117],[526,117],[524,117],[528,117],[512,117],[525,117],[529,117],[514,117],[515,117],[527,117],[509,117],[516,117],[517,117],[519,117],[523,117],[534,121],[522,117],[510,117],[547,122],[546,1],[541,121],[543,123],[542,121],[535,121],[536,121],[538,121],[540,121],[544,123],[545,123],[537,123],[539,123],[548,124],[367,125],[366,1],[549,1],[550,1],[500,1],[551,1],[372,126],[552,37],[553,1],[554,127],[555,128],[364,129],[246,1],[80,1],[362,35],[360,130],[226,131],[404,1],[411,132],[406,133],[227,134],[408,135],[410,136],[405,137],[407,133],[409,135],[365,1],[292,1],[236,1],[355,138],[356,1],[198,139],[196,140],[197,1],[420,1],[263,28],[424,1],[253,1],[257,1],[268,141],[266,142],[264,143],[267,144],[254,1],[251,1],[252,145],[320,146],[284,1],[265,28],[73,1],[376,147],[375,148],[373,149],[374,150],[453,77],[202,1],[192,151],[63,1],[193,152],[64,153],[188,1],[67,154],[183,155],[191,156],[190,156],[185,157],[186,158],[65,1],[189,159],[184,160],[66,161],[187,1],[247,1],[379,162],[240,163],[238,164],[239,165],[237,1],[378,1],[381,166],[380,1],[412,162],[279,1],[333,1],[282,1],[301,5],[209,167],[212,168],[213,169],[210,170],[211,168],[216,171],[214,22],[215,167],[234,1],[368,172],[59,1],[60,1],[10,1],[11,1],[14,1],[13,1],[2,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[3,1],[4,1],[23,1],[27,1],[24,1],[25,1],[26,1],[28,1],[29,1],[30,1],[5,1],[31,1],[32,1],[33,1],[34,1],[6,1],[38,1],[35,1],[36,1],[37,1],[39,1],[7,1],[40,1],[45,1],[46,1],[41,1],[42,1],[43,1],[44,1],[8,1],[50,1],[47,1],[48,1],[49,1],[51,1],[9,1],[52,1],[53,1],[54,1],[57,1],[55,1],[56,1],[1,1],[58,1],[12,1],[74,1],[228,1],[229,173],[195,173],[194,174],[96,175],[103,176],[95,175],[110,177],[87,178],[86,179],[109,37],[104,180],[107,181],[89,182],[88,183],[84,184],[83,185],[106,186],[85,187],[90,188],[91,1],[94,188],[81,1],[112,189],[111,188],[98,190],[99,191],[101,192],[97,193],[100,194],[105,37],[92,195],[93,196],[102,197],[82,198],[108,199],[370,200],[436,1],[437,1],[440,201],[206,202],[204,203],[207,204],[221,205],[205,1],[208,202],[217,22],[218,203],[219,203],[438,1],[439,1],[399,206],[398,1],[382,207],[383,208],[384,209],[389,28],[391,210],[390,211],[385,212],[386,213],[387,214],[388,215],[400,1],[175,32],[180,216],[181,217],[182,218],[273,219],[174,220],[75,221],[77,222],[61,1],[165,38],[173,223],[220,1],[166,224],[260,211],[222,225],[68,226],[76,227],[167,228],[168,227],[233,1],[285,229],[62,1],[169,224],[171,230],[170,231],[172,232],[336,233],[332,234],[335,235],[334,22],[231,236],[230,1],[199,237],[278,238],[280,239],[232,207],[244,240],[245,241],[281,242],[242,1],[243,242],[249,243],[250,244],[248,245],[272,246],[256,247],[255,248],[203,1],[235,249],[277,250],[276,251],[258,252],[259,253],[261,254],[274,255],[275,1],[369,256],[397,257],[396,258],[414,259],[416,260],[418,261],[419,262],[421,263],[422,264],[423,265],[402,266],[401,267],[403,268],[426,269],[428,270],[427,1],[425,271],[429,272],[430,273],[431,274],[432,275],[433,276],[434,277],[393,278],[395,279],[394,280],[417,281],[413,282],[357,283],[445,284],[446,285],[448,286],[447,271],[449,287],[450,288],[451,289],[452,290],[69,291],[262,1],[270,292],[271,293],[269,294],[179,295],[178,291],[176,291],[177,291],[435,296],[444,297],[443,298],[224,299],[223,300],[225,301],[342,302],[339,1],[340,1],[341,303],[338,304],[352,305],[349,306],[351,307],[350,308],[327,1],[328,309],[319,22],[321,310],[323,311],[322,312],[324,313],[326,314],[325,315],[354,316],[353,317],[392,32],[377,318],[315,319],[200,320],[371,32],[241,321]],"exportedModulesMap":[[299,1],[303,2],[287,3],[302,4],[283,5],[294,6],[291,7],[297,8],[293,9],[288,1],[289,1],[296,10],[290,11],[300,12],[298,13],[286,14],[295,1],[304,1],[308,15],[306,322],[309,17],[311,18],[312,323],[310,20],[307,21],[305,22],[313,23],[314,1],[318,24],[317,25],[316,26],[331,27],[329,22],[330,28],[337,29],[343,30],[344,30],[348,31],[345,30],[346,30],[347,30],[415,32],[71,32],[72,33],[70,32],[201,32],[456,34],[359,35],[363,35],[361,35],[358,1],[458,36],[441,37],[454,1],[459,1],[460,1],[461,1],[462,38],[463,1],[477,39],[478,39],[465,40],[466,41],[464,42],[467,43],[468,44],[469,45],[470,46],[471,47],[472,48],[473,49],[474,50],[475,51],[476,52],[499,53],[484,54],[490,55],[488,1],[487,56],[489,57],[498,58],[493,59],[495,60],[496,61],[497,62],[491,1],[492,62],[494,62],[486,62],[485,1],[501,63],[480,1],[479,1],[482,54],[483,64],[481,54],[502,1],[503,1],[504,1],[457,1],[442,65],[78,66],[79,66],[114,67],[115,68],[116,69],[117,70],[118,71],[119,72],[120,73],[121,74],[122,75],[123,76],[124,76],[126,77],[125,78],[127,79],[128,80],[129,81],[113,82],[163,1],[130,83],[131,84],[132,85],[164,86],[133,87],[134,88],[135,89],[136,90],[137,91],[138,92],[139,93],[140,94],[141,95],[142,96],[143,96],[144,97],[145,98],[147,99],[146,100],[148,101],[149,102],[150,103],[151,104],[152,105],[153,106],[154,107],[155,108],[156,109],[157,110],[158,111],[159,112],[160,113],[161,114],[162,115],[505,1],[506,1],[455,116],[507,1],[532,117],[533,118],[508,119],[511,119],[530,117],[531,117],[521,117],[520,120],[518,117],[513,117],[526,117],[524,117],[528,117],[512,117],[525,117],[529,117],[514,117],[515,117],[527,117],[509,117],[516,117],[517,117],[519,117],[523,117],[534,121],[522,117],[510,117],[547,122],[546,1],[541,121],[543,123],[542,121],[535,121],[536,121],[538,121],[540,121],[544,123],[545,123],[537,123],[539,123],[548,124],[367,125],[366,1],[549,1],[550,1],[500,1],[551,1],[372,126],[552,37],[553,1],[554,127],[555,128],[364,129],[246,1],[80,1],[362,35],[360,130],[226,131],[404,1],[411,132],[406,133],[227,134],[408,135],[410,136],[405,137],[407,133],[409,135],[365,1],[292,1],[236,1],[355,138],[356,1],[198,139],[196,140],[197,1],[420,1],[263,28],[424,1],[253,1],[257,1],[268,141],[266,142],[264,143],[267,144],[254,1],[251,1],[252,145],[320,146],[284,1],[265,28],[73,1],[376,147],[375,148],[373,149],[374,150],[453,77],[202,1],[192,151],[63,1],[193,152],[64,153],[188,1],[67,154],[183,155],[191,156],[190,156],[185,157],[186,158],[65,1],[189,159],[184,160],[66,161],[187,1],[247,1],[379,162],[240,163],[238,164],[239,165],[237,1],[378,1],[381,166],[380,1],[412,162],[279,1],[333,1],[282,1],[301,5],[209,167],[212,168],[213,169],[210,170],[211,168],[216,171],[214,22],[215,167],[234,1],[368,172],[59,1],[60,1],[10,1],[11,1],[14,1],[13,1],[2,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[3,1],[4,1],[23,1],[27,1],[24,1],[25,1],[26,1],[28,1],[29,1],[30,1],[5,1],[31,1],[32,1],[33,1],[34,1],[6,1],[38,1],[35,1],[36,1],[37,1],[39,1],[7,1],[40,1],[45,1],[46,1],[41,1],[42,1],[43,1],[44,1],[8,1],[50,1],[47,1],[48,1],[49,1],[51,1],[9,1],[52,1],[53,1],[54,1],[57,1],[55,1],[56,1],[1,1],[58,1],[12,1],[74,1],[228,1],[229,173],[195,173],[194,174],[96,175],[103,176],[95,175],[110,177],[87,178],[86,179],[109,37],[104,180],[107,181],[89,182],[88,183],[84,184],[83,185],[106,186],[85,187],[90,188],[91,1],[94,188],[81,1],[112,189],[111,188],[98,190],[99,191],[101,192],[97,193],[100,194],[105,37],[92,195],[93,196],[102,197],[82,198],[108,199],[370,200],[436,1],[437,1],[440,201],[206,202],[204,203],[207,204],[221,205],[205,1],[208,202],[217,22],[218,203],[219,203],[438,1],[439,1],[399,206],[398,1],[382,207],[383,208],[384,209],[389,28],[391,210],[390,211],[385,212],[386,213],[387,214],[388,215],[400,1],[175,32],[180,216],[181,217],[182,218],[273,219],[174,220],[75,221],[77,222],[61,1],[165,38],[173,223],[220,1],[166,224],[260,211],[222,225],[68,226],[76,227],[167,228],[168,227],[233,1],[285,229],[62,1],[169,224],[171,230],[170,231],[172,232],[336,233],[332,234],[335,235],[334,22],[231,324],[199,325],[278,326],[280,327],[232,327],[244,328],[245,329],[281,330],[243,330],[249,331],[250,332],[248,333],[272,334],[256,335],[255,336],[235,337],[277,338],[276,339],[258,340],[259,341],[261,342],[274,343],[396,344],[401,345],[425,346],[393,326],[395,326],[394,347],[417,348],[413,349],[447,346],[69,291],[262,1],[270,292],[271,293],[269,294],[179,295],[178,291],[176,291],[177,291],[435,296],[444,297],[443,298],[224,299],[223,300],[225,301],[342,302],[339,1],[340,1],[341,303],[338,304],[352,305],[349,306],[351,307],[350,308],[327,1],[328,309],[319,22],[321,310],[323,311],[322,312],[324,313],[326,314],[325,315],[354,316],[353,317],[392,32],[377,318],[315,319],[200,320],[371,32],[241,321]],"semanticDiagnosticsPerFile":[299,303,287,302,283,294,291,297,293,288,289,296,290,300,298,286,295,304,308,306,309,311,312,310,307,305,313,314,318,317,316,331,329,330,337,343,344,348,345,346,347,415,71,72,70,201,456,359,363,361,358,458,441,454,459,460,461,462,463,477,478,465,466,464,467,468,469,470,471,472,473,474,475,476,499,484,490,488,487,489,498,493,495,496,497,491,492,494,486,485,501,480,479,482,483,481,502,503,504,457,442,78,79,114,115,116,117,118,119,120,121,122,123,124,126,125,127,128,129,113,163,130,131,132,164,133,134,135,136,137,138,139,140,141,142,143,144,145,147,146,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,505,506,455,507,532,533,508,511,530,531,521,520,518,513,526,524,528,512,525,529,514,515,527,509,516,517,519,523,534,522,510,547,546,541,543,542,535,536,538,540,544,545,537,539,548,367,366,549,550,500,551,372,552,553,554,555,364,246,80,362,360,226,404,411,406,227,408,410,405,407,409,365,292,236,355,356,198,196,197,420,263,424,253,257,268,266,264,267,254,251,252,320,284,265,73,376,375,373,374,453,202,192,63,193,64,188,67,183,191,190,185,186,65,189,184,66,187,247,379,240,238,239,237,378,381,380,412,279,333,282,301,209,212,213,210,211,216,214,215,234,368,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,74,228,229,195,194,96,103,95,110,87,86,109,104,107,89,88,84,83,106,85,90,91,94,81,112,111,98,99,101,97,100,105,92,93,102,82,108,370,436,437,440,206,204,207,221,205,208,217,218,219,438,439,399,398,382,383,384,389,391,390,385,386,387,388,400,175,180,181,182,273,174,75,77,61,165,173,220,166,260,222,68,76,167,168,233,285,62,169,171,170,172,336,332,335,334,231,230,199,278,280,232,244,245,281,242,243,249,250,248,272,256,255,203,235,277,276,258,259,261,274,275,369,397,396,414,416,418,419,421,422,423,402,401,403,426,428,427,425,429,430,431,432,433,434,393,395,394,417,413,357,445,446,448,447,449,450,451,452,69,262,270,271,269,179,178,176,177,435,444,443,224,223,225,342,339,340,341,338,352,349,351,350,327,328,319,321,323,322,324,326,325,354,353,392,377,315,200,371,241],"latestChangedDtsFile":"./src/upgrader.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/package.json deleted file mode 100644 index 3e8023769..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/package.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "name": "libp2p", - "version": "0.46.21", - "description": "JavaScript implementation of libp2p, a modular peer to peer network stack", - "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/libp2p#readme", - "repository": { - "type": "git", - "url": "git+https://github.com/libp2p/js-libp2p.git" - }, - "bugs": { - "url": "https://github.com/libp2p/js-libp2p/issues" - }, - "keywords": [ - "IPFS", - "libp2p", - "network", - "p2p", - "peer", - "peer-to-peer" - ], - "type": "module", - "types": "./dist/src/index.d.ts", - "files": [ - "src", - "dist", - "!dist/test", - "!**/*.tsbuildinfo" - ], - "exports": { - ".": { - "types": "./dist/src/index.d.ts", - "import": "./dist/src/index.js" - } - }, - "eslintConfig": { - "extends": "ipfs", - "parserOptions": { - "project": true, - "sourceType": "module" - }, - "ignorePatterns": [ - "!.aegir.js", - "test/ts-use", - "*.d.ts" - ] - }, - "scripts": { - "clean": "aegir clean", - "lint": "aegir lint", - "dep-check": "aegir dep-check", - "prepublishOnly": "node scripts/update-version.js && npm run build", - "build": "aegir build", - "test": "aegir test", - "test:node": "aegir test -t node -f \"./dist/test/**/*.{node,spec}.js\" --cov", - "test:chrome": "aegir test -t browser -f \"./dist/test/**/*.spec.js\" --cov", - "test:chrome-webworker": "aegir test -t webworker -f \"./dist/test/**/*.spec.js\"", - "test:firefox": "aegir test -t browser -f \"./dist/test/**/*.spec.js\" -- --browser firefox", - "test:firefox-webworker": "aegir test -t webworker -f \"./dist/test/**/*.spec.js\" -- --browser firefox", - "test:webkit": "aegir test -t browser -f \"./dist/test/**/*.spec.js\" -- --browser webkit", - "test:interop": "aegir test -t node -f dist/test/interop.js" - }, - "dependencies": { - "@libp2p/crypto": "^2.0.8", - "@libp2p/interface": "^0.1.6", - "@libp2p/interface-internal": "^0.1.9", - "@libp2p/logger": "^3.1.0", - "@libp2p/multistream-select": "^4.0.6", - "@libp2p/peer-collections": "^4.0.8", - "@libp2p/peer-id": "^3.0.6", - "@libp2p/peer-id-factory": "^3.0.8", - "@libp2p/peer-store": "^9.0.9", - "@libp2p/utils": "^4.0.7", - "@multiformats/mafmt": "^12.1.6", - "@multiformats/multiaddr": "^12.1.10", - "@multiformats/multiaddr-matcher": "^1.1.0", - "any-signal": "^4.1.1", - "datastore-core": "^9.0.1", - "delay": "^6.0.0", - "interface-datastore": "^8.2.0", - "it-all": "^3.0.2", - "it-drain": "^3.0.2", - "it-filter": "^3.0.1", - "it-first": "^3.0.3", - "it-map": "^3.0.4", - "it-merge": "^3.0.0", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "merge-options": "^3.0.4", - "multiformats": "^12.1.3", - "p-defer": "^4.0.0", - "p-queue": "^7.4.1", - "private-ip": "^3.0.1", - "rate-limiter-flexible": "^3.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - }, - "devDependencies": { - "@chainsafe/libp2p-gossipsub": "^10.0.0", - "@chainsafe/libp2p-noise": "^13.0.2", - "@chainsafe/libp2p-yamux": "^5.0.0", - "@libp2p/bootstrap": "^9.0.12", - "@libp2p/circuit-relay-v2": "^0.0.0", - "@libp2p/daemon-client": "^7.0.0", - "@libp2p/daemon-server": "^6.0.0", - "@libp2p/floodsub": "^8.0.13", - "@libp2p/identify": "^0.0.0", - "@libp2p/interface-compliance-tests": "^4.1.5", - "@libp2p/interop": "^9.0.0", - "@libp2p/kad-dht": "^10.0.15", - "@libp2p/mdns": "^9.0.14", - "@libp2p/mplex": "^9.0.12", - "@libp2p/plaintext": "^0.0.0", - "@libp2p/tcp": "^8.0.13", - "@libp2p/websockets": "^7.0.13", - "aegir": "^41.0.2", - "execa": "^8.0.1", - "go-libp2p": "^1.1.1", - "it-pushable": "^3.2.1", - "p-event": "^6.0.0", - "p-times": "^4.0.0", - "p-wait-for": "^5.0.2", - "sinon": "^17.0.0", - "sinon-ts": "^2.0.0" - }, - "browser": { - "./dist/src/connection-manager/constants.js": "./dist/src/connection-manager/constants.browser.js", - "./dist/src/config/connection-gater.js": "./dist/src/config/connection-gater.browser.js" - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/address-manager/README.md b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/address-manager/README.md deleted file mode 100644 index ae181eba9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/address-manager/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Address Manager - -The Address manager is responsible for keeping an updated register of the peer's addresses. It includes 2 different types of Addresses: `Listen Addresses` and `Announce Addresses`. - -These Addresses should be specified in your libp2p [configuration](../../../../doc/CONFIGURATION.md) when you create your node. - -## Listen Addresses - -A libp2p node should have a set of listen addresses, which will be used by libp2p underlying transports to listen for dials from other nodes in the network. - -Before a libp2p node starts, its configured listen addresses will be passed to the AddressManager, so that during startup the libp2p transports can use them to listen for connections. Accordingly, listen addresses should be specified through the libp2p configuration, in order to have the `AddressManager` created with them. - -It is important pointing out that libp2p accepts ephemeral listening addresses. In this context, the provided listen addresses might not be exactly the same as the ones used by the transports. For example TCP may replace `/ip4/0.0.0.0/tcp/0` with something like `/ip4/127.0.0.1/tcp/8989`. As a consequence, libp2p should take into account this when determining its advertised addresses. - -## Announce Addresses - -In some scenarios, a libp2p node will need to announce addresses that it is not listening on. In other words, Announce Addresses are an amendment to the Listen Addresses that aim to enable other nodes to achieve connectivity to this node. - -Scenarios for Announce Addresses include: -- when you setup a libp2p node in your private network at home, but you need to announce your public IP Address to the outside world; -- when you want to announce a DNS address, which maps to your public IP Address. - -## Implementation - -When a libp2p node is created, the Address Manager will be populated from the provided addresses through the libp2p configuration. Once the node is started, the Transport Manager component will gather the listen addresses from the Address Manager, so that the libp2p transports can attempt to bind to them. - -Libp2p will use the the Address Manager as the source of truth when advertising the peers addresses. After all transports are ready, other libp2p components/subsystems will kickoff, namely the Identify Service and the DHT. Both of them will announce the node addresses to the other peers in the network. The announce addresses will have an important role here and will be gathered by libp2p to compute its current addresses to advertise everytime it is needed. - -## Future Considerations - -### Dynamic address modifications - -In a future iteration, we can enable these addresses to be modified in runtime. For this, the Address Manager should be responsible for notifying interested subsystems of these changes, through an Event Emitter. - -#### Modify Listen Addresses - -While adding new addresses to listen on runtime should be trivial, removing a listen address might have bad implications for the node, since all the connections using that listen address will be closed. However, libp2p should provide a mechanism for both adding and removing listen addresses in the future. - -Every time a new listen address is added, the Address Manager should emit an event with the new multiaddrs to listen. The Transport Manager should listen to this events and act accordingly. - -#### Modify Announce Addresses - -When the announce addresses are modified, the Address Manager should emit an event so that other subsystems can act accordingly. For example, libp2p identify service should use the libp2p push protocol to inform other peers about these changes. diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/address-manager/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/address-manager/index.ts deleted file mode 100644 index 1ff557a6a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/address-manager/index.ts +++ /dev/null @@ -1,237 +0,0 @@ -import { peerIdFromString } from '@libp2p/peer-id' -import { multiaddr } from '@multiformats/multiaddr' -import { debounce } from './utils.js' -import type { ComponentLogger, Libp2pEvents, Logger } from '@libp2p/interface' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { TransportManager } from '@libp2p/interface-internal/transport-manager' -import type { Multiaddr } from '@multiformats/multiaddr' - -export interface AddressManagerInit { - /** - * Pass an function in this field to override the list of addresses - * that are announced to the network - */ - announceFilter?: AddressFilter - - /** - * list of multiaddrs string representation to listen - */ - listen?: string[] - - /** - * list of multiaddrs string representation to announce - */ - announce?: string[] - - /** - * list of multiaddrs string representation to never announce - */ - noAnnounce?: string[] -} - -export interface DefaultAddressManagerComponents { - peerId: PeerId - transportManager: TransportManager - peerStore: PeerStore - events: TypedEventTarget - logger: ComponentLogger -} - -/** - * A function that takes a list of multiaddrs and returns a list - * to announce - */ -export interface AddressFilter { - (addrs: Multiaddr[]): Multiaddr[] -} - -const defaultAddressFilter = (addrs: Multiaddr[]): Multiaddr[] => addrs - -interface ObservedAddressMetadata { - confident: boolean -} - -/** - * If the passed multiaddr contains the passed peer id, remove it - */ -function stripPeerId (ma: Multiaddr, peerId: PeerId): Multiaddr { - const observedPeerIdStr = ma.getPeerId() - - // strip our peer id if it has been passed - if (observedPeerIdStr != null) { - const observedPeerId = peerIdFromString(observedPeerIdStr) - - // use same encoding for comparison - if (observedPeerId.equals(peerId)) { - ma = ma.decapsulate(multiaddr(`/p2p/${peerId.toString()}`)) - } - } - - return ma -} - -export class DefaultAddressManager { - private readonly log: Logger - private readonly components: DefaultAddressManagerComponents - // this is an array to allow for duplicates, e.g. multiples of `/ip4/0.0.0.0/tcp/0` - private readonly listen: string[] - private readonly announce: Set - private readonly observed: Map - private readonly announceFilter: AddressFilter - - /** - * Responsible for managing the peer addresses. - * Peers can specify their listen and announce addresses. - * The listen addresses will be used by the libp2p transports to listen for new connections, - * while the announce addresses will be used for the peer addresses' to other peers in the network. - */ - constructor (components: DefaultAddressManagerComponents, init: AddressManagerInit = {}) { - const { listen = [], announce = [] } = init - - this.components = components - this.log = components.logger.forComponent('libp2p:address-manager') - this.listen = listen.map(ma => ma.toString()) - this.announce = new Set(announce.map(ma => ma.toString())) - this.observed = new Map() - this.announceFilter = init.announceFilter ?? defaultAddressFilter - - // this method gets called repeatedly on startup when transports start listening so - // debounce it so we don't cause multiple self:peer:update events to be emitted - this._updatePeerStoreAddresses = debounce(this._updatePeerStoreAddresses.bind(this), 1000) - - // update our stored addresses when new transports listen - components.events.addEventListener('transport:listening', () => { - this._updatePeerStoreAddresses() - }) - // update our stored addresses when existing transports stop listening - components.events.addEventListener('transport:close', () => { - this._updatePeerStoreAddresses() - }) - } - - _updatePeerStoreAddresses (): void { - // if announce addresses have been configured, ensure they make it into our peer - // record for things like identify - const addrs = this.getAnnounceAddrs() - .concat(this.components.transportManager.getAddrs()) - .concat( - [...this.observed.entries()] - .filter(([_, metadata]) => metadata.confident) - .map(([str]) => multiaddr(str)) - ).map(ma => { - // strip our peer id if it is present - if (ma.getPeerId() === this.components.peerId.toString()) { - return ma.decapsulate(`/p2p/${this.components.peerId.toString()}`) - } - - return ma - }) - - this.components.peerStore.patch(this.components.peerId, { - multiaddrs: addrs - }) - .catch(err => { this.log.error('error updating addresses', err) }) - } - - /** - * Get peer listen multiaddrs - */ - getListenAddrs (): Multiaddr[] { - return Array.from(this.listen).map((a) => multiaddr(a)) - } - - /** - * Get peer announcing multiaddrs - */ - getAnnounceAddrs (): Multiaddr[] { - return Array.from(this.announce).map((a) => multiaddr(a)) - } - - /** - * Get observed multiaddrs - */ - getObservedAddrs (): Multiaddr[] { - return Array.from(this.observed).map(([a]) => multiaddr(a)) - } - - /** - * Add peer observed addresses - */ - addObservedAddr (addr: Multiaddr): void { - addr = stripPeerId(addr, this.components.peerId) - const addrString = addr.toString() - - // do not trigger the change:addresses event if we already know about this address - if (this.observed.has(addrString)) { - return - } - - this.observed.set(addrString, { - confident: false - }) - } - - confirmObservedAddr (addr: Multiaddr): void { - addr = stripPeerId(addr, this.components.peerId) - const addrString = addr.toString() - - const metadata = this.observed.get(addrString) ?? { - confident: false - } - - const startingConfidence = metadata.confident - - this.observed.set(addrString, { - confident: true - }) - - // only trigger the 'self:peer:update' event if our confidence in an address has changed - if (!startingConfidence) { - this._updatePeerStoreAddresses() - } - } - - removeObservedAddr (addr: Multiaddr): void { - addr = stripPeerId(addr, this.components.peerId) - const addrString = addr.toString() - - this.observed.delete(addrString) - } - - getAddresses (): Multiaddr[] { - let addrs = this.getAnnounceAddrs().map(ma => ma.toString()) - - if (addrs.length === 0) { - // no configured announce addrs, add configured listen addresses - addrs = this.components.transportManager.getAddrs().map(ma => ma.toString()) - } - - // add observed addresses we are confident in - addrs = addrs.concat( - Array.from(this.observed) - .filter(([ma, metadata]) => metadata.confident) - .map(([ma]) => ma) - ) - - // dedupe multiaddrs - const addrSet = new Set(addrs) - - // Create advertising list - return this.announceFilter(Array.from(addrSet) - .map(str => multiaddr(str))) - .map(ma => { - // do not append our peer id to a path multiaddr as it will become invalid - if (ma.protos().pop()?.path === true) { - return ma - } - - if (ma.getPeerId() === this.components.peerId.toString()) { - return ma - } - - return ma.encapsulate(`/p2p/${this.components.peerId.toString()}`) - }) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/address-manager/utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/address-manager/utils.ts deleted file mode 100644 index 7062446a8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/address-manager/utils.ts +++ /dev/null @@ -1,13 +0,0 @@ -export function debounce (func: () => void, wait: number): () => void { - let timeout: ReturnType | undefined - - return function () { - const later = function (): void { - timeout = undefined - func() - } - - clearTimeout(timeout) - timeout = setTimeout(later, wait) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/components.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/components.ts deleted file mode 100644 index f03169820..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/components.ts +++ /dev/null @@ -1,164 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { isStartable, type Startable } from '@libp2p/interface/startable' -import { defaultLogger } from '@libp2p/logger' -import type { Libp2pEvents, ComponentLogger, NodeInfo } from '@libp2p/interface' -import type { ConnectionProtector } from '@libp2p/interface/connection' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { ContentRouting } from '@libp2p/interface/content-routing' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerRouting } from '@libp2p/interface/peer-routing' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Upgrader } from '@libp2p/interface/transport' -import type { AddressManager } from '@libp2p/interface-internal/address-manager' -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager' -import type { Registrar } from '@libp2p/interface-internal/registrar' -import type { TransportManager } from '@libp2p/interface-internal/transport-manager' -import type { Datastore } from 'interface-datastore' - -export interface Components extends Record, Startable { - peerId: PeerId - nodeInfo: NodeInfo - logger: ComponentLogger - events: TypedEventTarget - addressManager: AddressManager - peerStore: PeerStore - upgrader: Upgrader - registrar: Registrar - connectionManager: ConnectionManager - transportManager: TransportManager - connectionGater: ConnectionGater - contentRouting: ContentRouting - peerRouting: PeerRouting - datastore: Datastore - connectionProtector?: ConnectionProtector - metrics?: Metrics -} - -export interface ComponentsInit { - peerId?: PeerId - nodeInfo?: NodeInfo - logger?: ComponentLogger - events?: TypedEventTarget - addressManager?: AddressManager - peerStore?: PeerStore - upgrader?: Upgrader - metrics?: Metrics - registrar?: Registrar - connectionManager?: ConnectionManager - transportManager?: TransportManager - connectionGater?: ConnectionGater - contentRouting?: ContentRouting - peerRouting?: PeerRouting - datastore?: Datastore - connectionProtector?: ConnectionProtector -} - -class DefaultComponents implements Startable { - public components: Record = {} - private _started = false - - constructor (init: ComponentsInit = {}) { - this.components = {} - - for (const [key, value] of Object.entries(init)) { - this.components[key] = value - } - - if (this.components.logger == null) { - this.components.logger = defaultLogger() - } - } - - isStarted (): boolean { - return this._started - } - - private async _invokeStartableMethod (methodName: 'beforeStart' | 'start' | 'afterStart' | 'beforeStop' | 'stop' | 'afterStop'): Promise { - await Promise.all( - Object.values(this.components) - .filter(obj => isStartable(obj)) - .map(async (startable: Startable) => { - await startable[methodName]?.() - }) - ) - } - - async beforeStart (): Promise { - await this._invokeStartableMethod('beforeStart') - } - - async start (): Promise { - await this._invokeStartableMethod('start') - this._started = true - } - - async afterStart (): Promise { - await this._invokeStartableMethod('afterStart') - } - - async beforeStop (): Promise { - await this._invokeStartableMethod('beforeStop') - } - - async stop (): Promise { - await this._invokeStartableMethod('stop') - this._started = false - } - - async afterStop (): Promise { - await this._invokeStartableMethod('afterStop') - } -} - -const OPTIONAL_SERVICES = [ - 'metrics', - 'connectionProtector' -] - -const NON_SERVICE_PROPERTIES = [ - 'components', - 'isStarted', - 'beforeStart', - 'start', - 'afterStart', - 'beforeStop', - 'stop', - 'afterStop', - 'then', - '_invokeStartableMethod' -] - -export function defaultComponents (init: ComponentsInit = {}): Components { - const components = new DefaultComponents(init) - - const proxy = new Proxy(components, { - get (target, prop, receiver) { - if (typeof prop === 'string' && !NON_SERVICE_PROPERTIES.includes(prop)) { - const service = components.components[prop] - - if (service == null && !OPTIONAL_SERVICES.includes(prop)) { - throw new CodeError(`${prop} not set`, 'ERR_SERVICE_MISSING') - } - - return service - } - - return Reflect.get(target, prop, receiver) - }, - - set (target, prop, value) { - if (typeof prop === 'string') { - components.components[prop] = value - } else { - Reflect.set(target, prop, value) - } - - return true - } - }) - - // @ts-expect-error component keys are proxied - return proxy -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/config.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/config.ts deleted file mode 100644 index a9b83fb53..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/config.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { FaultTolerance } from '@libp2p/interface/transport' -import { defaultAddressSort } from '@libp2p/utils/address-sort' -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers' -import mergeOptions from 'merge-options' -import { codes, messages } from './errors.js' -import type { Libp2pInit } from './index.js' -import type { ServiceMap, RecursivePartial } from '@libp2p/interface' -import type { Multiaddr } from '@multiformats/multiaddr' - -const DefaultConfig: Partial = { - addresses: { - listen: [], - announce: [], - noAnnounce: [], - announceFilter: (multiaddrs: Multiaddr[]) => multiaddrs - }, - connectionManager: { - resolvers: { - dnsaddr: dnsaddrResolver - }, - addressSorter: defaultAddressSort - }, - transportManager: { - faultTolerance: FaultTolerance.FATAL_ALL - } -} - -export function validateConfig > (opts: RecursivePartial>): Libp2pInit { - const resultingOptions: Libp2pInit = mergeOptions(DefaultConfig, opts) - - if (resultingOptions.transports == null || resultingOptions.transports.length < 1) { - throw new CodeError(messages.ERR_TRANSPORTS_REQUIRED, codes.ERR_TRANSPORTS_REQUIRED) - } - - if (resultingOptions.connectionProtector === null && globalThis.process?.env?.LIBP2P_FORCE_PNET != null) { // eslint-disable-line no-undef - throw new CodeError(messages.ERR_PROTECTOR_REQUIRED, codes.ERR_PROTECTOR_REQUIRED) - } - - return resultingOptions -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/config/connection-gater.browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/config/connection-gater.browser.ts deleted file mode 100644 index c03a15369..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/config/connection-gater.browser.ts +++ /dev/null @@ -1,31 +0,0 @@ -import isPrivate from 'private-ip' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { Multiaddr } from '@multiformats/multiaddr' - -/** - * Returns a connection gater that disallows dialling private addresses by - * default. Browsers are severely limited in their resource usage so don't - * waste time trying to dial undiallable addresses. - */ -export function connectionGater (gater: ConnectionGater = {}): ConnectionGater { - return { - denyDialPeer: async () => false, - denyDialMultiaddr: async (multiaddr: Multiaddr) => { - const tuples = multiaddr.stringTuples() - - if (tuples[0][0] === 4 || tuples[0][0] === 41) { - return Boolean(isPrivate(`${tuples[0][1]}`)) - } - - return false - }, - denyInboundConnection: async () => false, - denyOutboundConnection: async () => false, - denyInboundEncryptedConnection: async () => false, - denyOutboundEncryptedConnection: async () => false, - denyInboundUpgradedConnection: async () => false, - denyOutboundUpgradedConnection: async () => false, - filterMultiaddrForPeer: async () => true, - ...gater - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/config/connection-gater.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/config/connection-gater.ts deleted file mode 100644 index 40f1827ae..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/config/connection-gater.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ConnectionGater } from '@libp2p/interface/connection-gater' - -/** - * Returns a default connection gater implementation that allows everything - */ -export function connectionGater (gater: ConnectionGater = {}): ConnectionGater { - return { - denyDialPeer: async () => false, - denyDialMultiaddr: async () => false, - denyInboundConnection: async () => false, - denyOutboundConnection: async () => false, - denyInboundEncryptedConnection: async () => false, - denyOutboundEncryptedConnection: async () => false, - denyInboundUpgradedConnection: async () => false, - denyOutboundUpgradedConnection: async () => false, - filterMultiaddrForPeer: async () => true, - ...gater - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/auto-dial.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/auto-dial.ts deleted file mode 100644 index 9cd95d6df..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/auto-dial.ts +++ /dev/null @@ -1,287 +0,0 @@ -import { PeerMap, PeerSet } from '@libp2p/peer-collections' -import { PeerJobQueue } from '@libp2p/utils/peer-job-queue' -import { toString as uint8ArrayToString } from 'uint8arrays/to-string' -import { AUTO_DIAL_CONCURRENCY, AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE, AUTO_DIAL_INTERVAL, AUTO_DIAL_MAX_QUEUE_LENGTH, AUTO_DIAL_PEER_RETRY_THRESHOLD, AUTO_DIAL_PRIORITY, LAST_DIAL_FAILURE_KEY, MIN_CONNECTIONS } from './constants.js' -import type { Libp2pEvents, Logger, ComponentLogger } from '@libp2p/interface' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Startable } from '@libp2p/interface/startable' -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager' - -interface AutoDialInit { - minConnections?: number - maxQueueLength?: number - autoDialConcurrency?: number - autoDialPriority?: number - autoDialInterval?: number - autoDialPeerRetryThreshold?: number - autoDialDiscoveredPeersDebounce?: number -} - -interface AutoDialComponents { - connectionManager: ConnectionManager - peerStore: PeerStore - events: TypedEventTarget - logger: ComponentLogger -} - -const defaultOptions = { - minConnections: MIN_CONNECTIONS, - maxQueueLength: AUTO_DIAL_MAX_QUEUE_LENGTH, - autoDialConcurrency: AUTO_DIAL_CONCURRENCY, - autoDialPriority: AUTO_DIAL_PRIORITY, - autoDialInterval: AUTO_DIAL_INTERVAL, - autoDialPeerRetryThreshold: AUTO_DIAL_PEER_RETRY_THRESHOLD, - autoDialDiscoveredPeersDebounce: AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE -} - -export class AutoDial implements Startable { - private readonly connectionManager: ConnectionManager - private readonly peerStore: PeerStore - private readonly queue: PeerJobQueue - private readonly minConnections: number - private readonly autoDialPriority: number - private readonly autoDialIntervalMs: number - private readonly autoDialMaxQueueLength: number - private readonly autoDialPeerRetryThresholdMs: number - private readonly autoDialDiscoveredPeersDebounce: number - private autoDialInterval?: ReturnType - private started: boolean - private running: boolean - private readonly log: Logger - - /** - * Proactively tries to connect to known peers stored in the PeerStore. - * It will keep the number of connections below the upper limit and sort - * the peers to connect based on whether we know their keys and protocols. - */ - constructor (components: AutoDialComponents, init: AutoDialInit) { - this.connectionManager = components.connectionManager - this.peerStore = components.peerStore - this.minConnections = init.minConnections ?? defaultOptions.minConnections - this.autoDialPriority = init.autoDialPriority ?? defaultOptions.autoDialPriority - this.autoDialIntervalMs = init.autoDialInterval ?? defaultOptions.autoDialInterval - this.autoDialMaxQueueLength = init.maxQueueLength ?? defaultOptions.maxQueueLength - this.autoDialPeerRetryThresholdMs = init.autoDialPeerRetryThreshold ?? defaultOptions.autoDialPeerRetryThreshold - this.autoDialDiscoveredPeersDebounce = init.autoDialDiscoveredPeersDebounce ?? defaultOptions.autoDialDiscoveredPeersDebounce - this.log = components.logger.forComponent('libp2p:connection-manager:auto-dial') - this.started = false - this.running = false - this.queue = new PeerJobQueue({ - concurrency: init.autoDialConcurrency ?? defaultOptions.autoDialConcurrency - }) - this.queue.addListener('error', (err) => { - this.log.error('error during auto-dial', err) - }) - - // check the min connection limit whenever a peer disconnects - components.events.addEventListener('connection:close', () => { - this.autoDial() - .catch(err => { - this.log.error(err) - }) - }) - - // sometimes peers are discovered in quick succession so add a small - // debounce to ensure all eligible peers are autodialed - let debounce: ReturnType - - // when new peers are discovered, dial them if we don't have - // enough connections - components.events.addEventListener('peer:discovery', () => { - clearTimeout(debounce) - debounce = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error(err) - }) - }, this.autoDialDiscoveredPeersDebounce) - }) - } - - isStarted (): boolean { - return this.started - } - - start (): void { - this.autoDialInterval = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err) - }) - }, this.autoDialIntervalMs) - this.started = true - } - - afterStart (): void { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err) - }) - } - - stop (): void { - // clear the queue - this.queue.clear() - clearTimeout(this.autoDialInterval) - this.started = false - this.running = false - } - - async autoDial (): Promise { - if (!this.started) { - return - } - - const connections = this.connectionManager.getConnectionsMap() - const numConnections = connections.size - - // Already has enough connections - if (numConnections >= this.minConnections) { - if (this.minConnections > 0) { - this.log.trace('have enough connections %d/%d', numConnections, this.minConnections) - } - return - } - - if (this.queue.size > this.autoDialMaxQueueLength) { - this.log('not enough connections %d/%d but auto dial queue is full', numConnections, this.minConnections) - return - } - - if (this.running) { - this.log('not enough connections %d/%d - but skipping autodial as it is already running', numConnections, this.minConnections) - return - } - - this.running = true - - this.log('not enough connections %d/%d - will dial peers to increase the number of connections', numConnections, this.minConnections) - - const dialQueue = new PeerSet( - // @ts-expect-error boolean filter removes falsy peer IDs - this.connectionManager.getDialQueue() - .map(queue => queue.peerId) - .filter(Boolean) - ) - - // Sort peers on whether we know protocols or public keys for them - const peers = await this.peerStore.all({ - filters: [ - // Remove some peers - (peer) => { - // Remove peers without addresses - if (peer.addresses.length === 0) { - this.log.trace('not autodialing %p because they have no addresses', peer.id) - return false - } - - // remove peers we are already connected to - if (connections.has(peer.id)) { - this.log.trace('not autodialing %p because they are already connected', peer.id) - return false - } - - // remove peers we are already dialling - if (dialQueue.has(peer.id)) { - this.log.trace('not autodialing %p because they are already being dialed', peer.id) - return false - } - - // remove peers already in the autodial queue - if (this.queue.hasJob(peer.id)) { - this.log.trace('not autodialing %p because they are already being autodialed', peer.id) - return false - } - - return true - } - ] - }) - - // shuffle the peers - this is so peers with the same tag values will be - // dialled in a different order each time - const shuffledPeers = peers.sort(() => Math.random() > 0.5 ? 1 : -1) - - // Sort shuffled peers by tag value - const peerValues = new PeerMap() - for (const peer of shuffledPeers) { - if (peerValues.has(peer.id)) { - continue - } - - // sum all tag values - peerValues.set(peer.id, [...peer.tags.values()].reduce((acc, curr) => { - return acc + curr.value - }, 0)) - } - - // sort by value, highest to lowest - const sortedPeers = shuffledPeers.sort((a, b) => { - const peerAValue = peerValues.get(a.id) ?? 0 - const peerBValue = peerValues.get(b.id) ?? 0 - - if (peerAValue > peerBValue) { - return -1 - } - - if (peerAValue < peerBValue) { - return 1 - } - - return 0 - }) - - const peersThatHaveNotFailed = sortedPeers.filter(peer => { - const lastDialFailure = peer.metadata.get(LAST_DIAL_FAILURE_KEY) - - if (lastDialFailure == null) { - return true - } - - const lastDialFailureTimestamp = parseInt(uint8ArrayToString(lastDialFailure)) - - if (isNaN(lastDialFailureTimestamp)) { - return true - } - - // only dial if the time since the last failure is above the retry threshold - return Date.now() - lastDialFailureTimestamp > this.autoDialPeerRetryThresholdMs - }) - - this.log('selected %d/%d peers to dial', peersThatHaveNotFailed.length, peers.length) - - for (const peer of peersThatHaveNotFailed) { - this.queue.add(async () => { - const numConnections = this.connectionManager.getConnectionsMap().size - - // Check to see if we still need to auto dial - if (numConnections >= this.minConnections) { - this.log('got enough connections now %d/%d', numConnections, this.minConnections) - this.queue.clear() - return - } - - this.log('connecting to a peerStore stored peer %p', peer.id) - await this.connectionManager.openConnection(peer.id, { - priority: this.autoDialPriority - }) - }, { - peerId: peer.id - }).catch(err => { - this.log.error('could not connect to peerStore stored peer', err) - }) - } - - this.running = false - - if (this.started) { - this.autoDialInterval = setTimeout(() => { - this.autoDial() - .catch(err => { - this.log.error('error while autodialing', err) - }) - }, this.autoDialIntervalMs) - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/connection-pruner.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/connection-pruner.ts deleted file mode 100644 index 71a2f2308..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/connection-pruner.ts +++ /dev/null @@ -1,157 +0,0 @@ -import { PeerMap } from '@libp2p/peer-collections' -import { MAX_CONNECTIONS } from './constants.js' -import type { Libp2pEvents, Logger, ComponentLogger } from '@libp2p/interface' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager' -import type { Multiaddr } from '@multiformats/multiaddr' - -interface ConnectionPrunerInit { - maxConnections?: number - allow?: Multiaddr[] -} - -interface ConnectionPrunerComponents { - connectionManager: ConnectionManager - peerStore: PeerStore - events: TypedEventTarget - logger: ComponentLogger -} - -const defaultOptions = { - maxConnections: MAX_CONNECTIONS, - allow: [] -} - -/** - * If we go over the max connections limit, choose some connections to close - */ -export class ConnectionPruner { - private readonly maxConnections: number - private readonly connectionManager: ConnectionManager - private readonly peerStore: PeerStore - private readonly allow: Multiaddr[] - private readonly events: TypedEventTarget - private readonly log: Logger - - constructor (components: ConnectionPrunerComponents, init: ConnectionPrunerInit = {}) { - this.maxConnections = init.maxConnections ?? defaultOptions.maxConnections - this.allow = init.allow ?? defaultOptions.allow - this.connectionManager = components.connectionManager - this.peerStore = components.peerStore - this.events = components.events - this.log = components.logger.forComponent('libp2p:connection-manager:connection-pruner') - - // check the max connection limit whenever a peer connects - components.events.addEventListener('connection:open', () => { - this.maybePruneConnections() - .catch(err => { - this.log.error(err) - }) - }) - } - - /** - * If we have more connections than our maximum, select some excess connections - * to prune based on peer value - */ - async maybePruneConnections (): Promise { - const connections = this.connectionManager.getConnections() - const numConnections = connections.length - const toPrune = Math.max(numConnections - this.maxConnections, 0) - - this.log('checking max connections limit %d/%d', numConnections, this.maxConnections) - if (numConnections <= this.maxConnections) { - return - } - - this.log('max connections limit exceeded %d/%d, pruning %d connection(s)', numConnections, this.maxConnections, toPrune) - const peerValues = new PeerMap() - - // work out peer values - for (const connection of connections) { - const remotePeer = connection.remotePeer - - if (peerValues.has(remotePeer)) { - continue - } - - peerValues.set(remotePeer, 0) - - try { - const peer = await this.peerStore.get(remotePeer) - - // sum all tag values - peerValues.set(remotePeer, [...peer.tags.values()].reduce((acc, curr) => { - return acc + curr.value - }, 0)) - } catch (err: any) { - if (err.code !== 'ERR_NOT_FOUND') { - this.log.error('error loading peer tags', err) - } - } - } - - // sort by value, lowest to highest - const sortedConnections = connections.sort((a, b) => { - const peerAValue = peerValues.get(a.remotePeer) ?? 0 - const peerBValue = peerValues.get(b.remotePeer) ?? 0 - - if (peerAValue > peerBValue) { - return 1 - } - - if (peerAValue < peerBValue) { - return -1 - } - - // if the peers have an equal tag value then we want to close short-lived connections first - const connectionALifespan = a.timeline.open - const connectionBLifespan = b.timeline.open - - if (connectionALifespan < connectionBLifespan) { - return 1 - } - - if (connectionALifespan > connectionBLifespan) { - return -1 - } - - return 0 - }) - - // close some connections - const toClose = [] - - for (const connection of sortedConnections) { - this.log('too many connections open - closing a connection to %p', connection.remotePeer) - // check allow list - const connectionInAllowList = this.allow.some((ma) => { - return connection.remoteAddr.toString().startsWith(ma.toString()) - }) - - // Connections in the allow list should be excluded from pruning - if (!connectionInAllowList) { - toClose.push(connection) - } - - if (toClose.length === toPrune) { - break - } - } - - // close connections - await Promise.all( - toClose.map(async connection => { - try { - await connection.close() - } catch (err) { - this.log.error(err) - } - }) - ) - - // despatch prune event - this.events.safeDispatchEvent('connection:prune', { detail: toClose }) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/constants.browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/constants.browser.ts deleted file mode 100644 index 2c369c124..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/constants.browser.ts +++ /dev/null @@ -1,21 +0,0 @@ -export * from './constants.defaults.js' - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export const MIN_CONNECTIONS = 5 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export const MAX_CONNECTIONS = 100 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export const MAX_PARALLEL_DIALS = 50 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export const AUTO_DIAL_PEER_RETRY_THRESHOLD = 1000 * 60 * 7 diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/constants.defaults.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/constants.defaults.ts deleted file mode 100644 index 2eb5044e7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/constants.defaults.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#dialTimeout - */ -export const DIAL_TIMEOUT = 30e3 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundUpgradeTimeout - */ -export const INBOUND_UPGRADE_TIMEOUT = 30e3 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxPeerAddrsToDial - */ -export const MAX_PEER_ADDRS_TO_DIAL = 25 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialInterval - */ -export const AUTO_DIAL_INTERVAL = 5000 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialConcurrency - */ -export const AUTO_DIAL_CONCURRENCY = 25 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialPriority - */ -export const AUTO_DIAL_PRIORITY = 0 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#autoDialMaxQueueLength - */ -export const AUTO_DIAL_MAX_QUEUE_LENGTH = 100 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialDiscoveredPeersDebounce - */ -export const AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE = 10 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#inboundConnectionThreshold - */ -export const INBOUND_CONNECTION_THRESHOLD = 5 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxIncomingPendingConnections - */ -export const MAX_INCOMING_PENDING_CONNECTIONS = 10 - -/** - * Store as part of the peer store metadata for a given peer, the value for this - * key is a timestamp of the last time a dial attempted failed with the relevant - * peer stored as a string. - * - * Used to insure we do not endlessly try to auto dial peers we have recently - * failed to dial. - */ -export const LAST_DIAL_FAILURE_KEY = 'last-dial-failure' diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/constants.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/constants.ts deleted file mode 100644 index a6a6c486f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/constants.ts +++ /dev/null @@ -1,21 +0,0 @@ -export * from './constants.defaults.js' - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#minConnections - */ -export const MIN_CONNECTIONS = 50 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxConnections - */ -export const MAX_CONNECTIONS = 300 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/index._internal_.ConnectionManagerConfig.html#maxParallelDials - */ -export const MAX_PARALLEL_DIALS = 100 - -/** - * @see https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.unknown.ConnectionManagerInit.html#autoDialPeerRetryThreshold - */ -export const AUTO_DIAL_PEER_RETRY_THRESHOLD = 1000 * 60 diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/dial-queue.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/dial-queue.ts deleted file mode 100644 index 9550c95df..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/dial-queue.ts +++ /dev/null @@ -1,580 +0,0 @@ -import { AbortError, CodeError, ERR_TIMEOUT } from '@libp2p/interface/errors' -import { setMaxListeners } from '@libp2p/interface/events' -import { PeerMap } from '@libp2p/peer-collections' -import { defaultAddressSort } from '@libp2p/utils/address-sort' -import { type Multiaddr, type Resolver, resolvers } from '@multiformats/multiaddr' -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers' -import { type ClearableSignal, anySignal } from 'any-signal' -import pDefer from 'p-defer' -import PQueue from 'p-queue' -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' -import { codes } from '../errors.js' -import { getPeerAddress } from '../get-peer.js' -import { - DIAL_TIMEOUT, - MAX_PARALLEL_DIALS, - MAX_PEER_ADDRS_TO_DIAL, - LAST_DIAL_FAILURE_KEY -} from './constants.js' -import { combineSignals, resolveMultiaddrs } from './utils.js' -import type { AddressSorter, AbortOptions, PendingDial, ComponentLogger, Logger } from '@libp2p/interface' -import type { Connection } from '@libp2p/interface/connection' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { Metric, Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { Address, PeerStore } from '@libp2p/interface/peer-store' -import type { TransportManager } from '@libp2p/interface-internal/transport-manager' - -export interface PendingDialTarget { - resolve(value: any): void - reject(err: Error): void -} - -export interface DialOptions extends AbortOptions { - priority?: number - force?: boolean -} - -interface PendingDialInternal extends PendingDial { - promise: Promise -} - -interface DialerInit { - addressSorter?: AddressSorter - maxParallelDials?: number - maxPeerAddrsToDial?: number - dialTimeout?: number - resolvers?: Record - connections?: PeerMap -} - -const defaultOptions = { - addressSorter: defaultAddressSort, - maxParallelDials: MAX_PARALLEL_DIALS, - maxPeerAddrsToDial: MAX_PEER_ADDRS_TO_DIAL, - dialTimeout: DIAL_TIMEOUT, - resolvers: { - dnsaddr: dnsaddrResolver - } -} - -interface DialQueueComponents { - peerId: PeerId - metrics?: Metrics - peerStore: PeerStore - transportManager: TransportManager - connectionGater: ConnectionGater - logger: ComponentLogger -} - -export class DialQueue { - public pendingDials: PendingDialInternal[] - public queue: PQueue - private readonly peerId: PeerId - private readonly peerStore: PeerStore - private readonly connectionGater: ConnectionGater - private readonly transportManager: TransportManager - private readonly addressSorter: AddressSorter - private readonly maxPeerAddrsToDial: number - private readonly dialTimeout: number - private readonly inProgressDialCount?: Metric - private readonly pendingDialCount?: Metric - private readonly shutDownController: AbortController - private readonly connections: PeerMap - private readonly log: Logger - - constructor (components: DialQueueComponents, init: DialerInit = {}) { - this.addressSorter = init.addressSorter ?? defaultOptions.addressSorter - this.maxPeerAddrsToDial = init.maxPeerAddrsToDial ?? defaultOptions.maxPeerAddrsToDial - this.dialTimeout = init.dialTimeout ?? defaultOptions.dialTimeout - this.connections = init.connections ?? new PeerMap() - this.log = components.logger.forComponent('libp2p:connection-manager:dial-queue') - - this.peerId = components.peerId - this.peerStore = components.peerStore - this.connectionGater = components.connectionGater - this.transportManager = components.transportManager - this.shutDownController = new AbortController() - - setMaxListeners(Infinity, this.shutDownController.signal) - - this.pendingDialCount = components.metrics?.registerMetric('libp2p_dial_queue_pending_dials') - this.inProgressDialCount = components.metrics?.registerMetric('libp2p_dial_queue_in_progress_dials') - this.pendingDials = [] - - for (const [key, value] of Object.entries(init.resolvers ?? {})) { - resolvers.set(key, value) - } - - // controls dial concurrency - this.queue = new PQueue({ - concurrency: init.maxParallelDials ?? defaultOptions.maxParallelDials - }) - - // a job was added to the queue - this.queue.on('add', () => { - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - // a queued job started - this.queue.on('active', () => { - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - // a started job completed without error - this.queue.on('completed', () => { - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - // a started job errored - this.queue.on('error', (err) => { - this.log.error('error in dial queue', err) - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - // all queued jobs have been started - this.queue.on('empty', () => { - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - // add started jobs have run and the queue is empty - this.queue.on('idle', () => { - this.pendingDialCount?.update(this.queue.size) - this.inProgressDialCount?.update(this.queue.pending) - }) - } - - /** - * Clears any pending dials - */ - stop (): void { - this.shutDownController.abort() - } - - /** - * Connects to a given peer, multiaddr or list of multiaddrs. - * - * If a peer is passed, all known multiaddrs will be tried. If a multiaddr or - * multiaddrs are passed only those will be dialled. - * - * Where a list of multiaddrs is passed, if any contain a peer id then all - * multiaddrs in the list must contain the same peer id. - * - * The dial to the first address that is successfully able to upgrade a connection - * will be used, all other dials will be aborted when that happens. - */ - async dial (peerIdOrMultiaddr: PeerId | Multiaddr | Multiaddr[], options: DialOptions = {}): Promise { - const { peerId, multiaddrs } = getPeerAddress(peerIdOrMultiaddr) - - const addrs: Address[] = multiaddrs.map(multiaddr => ({ - multiaddr, - isCertified: false - })) - - // create abort conditions - need to do this before `calculateMultiaddrs` as we may be about to - // resolve a dns addr which can time out - const signal = this.createDialAbortControllers(options.signal) - let addrsToDial: Address[] - - try { - // load addresses from address book, resolve and dnsaddrs, filter undiallables, add peer IDs, etc - addrsToDial = await this.calculateMultiaddrs(peerId, addrs, { - ...options, - signal - }) - } catch (err) { - signal.clear() - throw err - } - - // make sure we don't have an existing connection to any of the addresses we - // are about to dial - let existingConnection = Array.from(this.connections.values()).flat().find(conn => { - if (options.force === true) { - return false - } - - return addrsToDial.find(addr => { - return addr.multiaddr.equals(conn.remoteAddr) - }) - }) - - if (existingConnection != null) { - this.log('already connected to %a', existingConnection.remoteAddr) - return existingConnection - } - - // ready to dial, all async work finished - make sure we don't have any - // pending dials in progress for this peer or set of multiaddrs - const existingDial = this.pendingDials.find(dial => { - // is the dial for the same peer id? - if (dial.peerId != null && peerId != null && dial.peerId.equals(peerId)) { - return true - } - - // is the dial for the same set of multiaddrs? - if (addrsToDial.map(({ multiaddr }) => multiaddr.toString()).join() === dial.multiaddrs.map(multiaddr => multiaddr.toString()).join()) { - return true - } - - return false - }) - - if (existingDial != null) { - this.log('joining existing dial target for %p', peerId) - signal.clear() - return existingDial.promise - } - - this.log('creating dial target for', addrsToDial.map(({ multiaddr }) => multiaddr.toString())) - // @ts-expect-error .promise property is set below - const pendingDial: PendingDialInternal = { - id: randomId(), - status: 'queued', - peerId, - multiaddrs: addrsToDial.map(({ multiaddr }) => multiaddr) - } - - pendingDial.promise = this.performDial(pendingDial, { - ...options, - signal - }) - .finally(() => { - // remove our pending dial entry - this.pendingDials = this.pendingDials.filter(p => p.id !== pendingDial.id) - - // clean up abort signals/controllers - signal.clear() - }) - .catch(async err => { - this.log.error('dial failed to %s', pendingDial.multiaddrs.map(ma => ma.toString()).join(', '), err) - - if (peerId != null) { - // record the last failed dial - try { - await this.peerStore.patch(peerId, { - metadata: { - [LAST_DIAL_FAILURE_KEY]: uint8ArrayFromString(Date.now().toString()) - } - }) - } catch (err: any) { - this.log.error('could not update last dial failure key for %p', peerId, err) - } - } - - // Error is a timeout - if (signal.aborted) { - const error = new CodeError(err.message, ERR_TIMEOUT) - throw error - } - - throw err - }) - - // let other dials join this one - this.pendingDials.push(pendingDial) - - const connection = await pendingDial.promise - - // we may have been dialing a multiaddr without a peer id attached but by - // this point we have upgraded the connection so the remote peer information - // should be available - check again that we don't already have a connection - // to the remote multiaddr - existingConnection = Array.from(this.connections.values()).flat().find(conn => { - if (options.force === true) { - return false - } - - return conn.id !== connection.id && conn.remoteAddr.equals(connection.remoteAddr) - }) - - if (existingConnection != null) { - this.log('already connected to %a', existingConnection.remoteAddr) - await connection.close() - return existingConnection - } - - this.log('connection opened to %a', connection.remoteAddr) - return connection - } - - private createDialAbortControllers (userSignal?: AbortSignal): ClearableSignal { - // let any signal abort the dial - const signal = anySignal( - [AbortSignal.timeout(this.dialTimeout), - this.shutDownController.signal, - userSignal - ] - ) - - try { - // This emitter gets listened to a lot - setMaxListeners?.(Infinity, signal) - } catch {} - - return signal - } - - // eslint-disable-next-line complexity - private async calculateMultiaddrs (peerId?: PeerId, addrs: Address[] = [], options: DialOptions = {}): Promise { - // if a peer id or multiaddr(s) with a peer id, make sure it isn't our peer id and that we are allowed to dial it - if (peerId != null) { - if (this.peerId.equals(peerId)) { - throw new CodeError('Tried to dial self', codes.ERR_DIALED_SELF) - } - - if ((await this.connectionGater.denyDialPeer?.(peerId)) === true) { - throw new CodeError('The dial request is blocked by gater.allowDialPeer', codes.ERR_PEER_DIAL_INTERCEPTED) - } - - // if just a peer id was passed, load available multiaddrs for this peer from the address book - if (addrs.length === 0) { - this.log('loading multiaddrs for %p', peerId) - try { - const peer = await this.peerStore.get(peerId) - addrs.push(...peer.addresses) - this.log('loaded multiaddrs for %p', peerId, addrs.map(({ multiaddr }) => multiaddr.toString())) - } catch (err: any) { - if (err.code !== codes.ERR_NOT_FOUND) { - throw err - } - } - } - } - - // resolve addresses - this can result in a one-to-many translation when dnsaddrs are resolved - let resolvedAddresses = (await Promise.all( - addrs.map(async addr => { - const result = await resolveMultiaddrs(addr.multiaddr, { - ...options, - log: this.log - }) - - if (result.length === 1 && result[0].equals(addr.multiaddr)) { - return addr - } - - return result.map(multiaddr => ({ - multiaddr, - isCertified: false - })) - }) - )) - .flat() - - // ensure the peer id is appended to the multiaddr - if (peerId != null) { - const peerIdMultiaddr = `/p2p/${peerId.toString()}` - resolvedAddresses = resolvedAddresses.map(addr => { - const lastProto = addr.multiaddr.protos().pop() - - // do not append peer id to path multiaddrs - if (lastProto?.path === true) { - return addr - } - - // append peer id to multiaddr if it is not already present - if (addr.multiaddr.getPeerId() == null) { - return { - multiaddr: addr.multiaddr.encapsulate(peerIdMultiaddr), - isCertified: addr.isCertified - } - } - - return addr - }) - } - - const filteredAddrs = resolvedAddresses.filter(addr => { - // filter out any multiaddrs that we do not have transports for - if (this.transportManager.transportForMultiaddr(addr.multiaddr) == null) { - return false - } - - // if the resolved multiaddr has a PeerID but it's the wrong one, ignore it - // - this can happen with addresses like bootstrap.libp2p.io that resolve - // to multiple different peers - const addrPeerId = addr.multiaddr.getPeerId() - if (peerId != null && addrPeerId != null) { - return peerId.equals(addrPeerId) - } - - return true - }) - - // deduplicate addresses - const dedupedAddrs = new Map() - - for (const addr of filteredAddrs) { - const maStr = addr.multiaddr.toString() - const existing = dedupedAddrs.get(maStr) - - if (existing != null) { - existing.isCertified = existing.isCertified || addr.isCertified || false - continue - } - - dedupedAddrs.set(maStr, addr) - } - - const dedupedMultiaddrs = [...dedupedAddrs.values()] - - if (dedupedMultiaddrs.length === 0 || dedupedMultiaddrs.length > this.maxPeerAddrsToDial) { - this.log('addresses for %p before filtering', peerId ?? 'unknown peer', resolvedAddresses.map(({ multiaddr }) => multiaddr.toString())) - this.log('addresses for %p after filtering', peerId ?? 'unknown peer', dedupedMultiaddrs.map(({ multiaddr }) => multiaddr.toString())) - } - - // make sure we actually have some addresses to dial - if (dedupedMultiaddrs.length === 0) { - throw new CodeError('The dial request has no valid addresses', codes.ERR_NO_VALID_ADDRESSES) - } - - // make sure we don't have too many addresses to dial - if (dedupedMultiaddrs.length > this.maxPeerAddrsToDial) { - throw new CodeError('dial with more addresses than allowed', codes.ERR_TOO_MANY_ADDRESSES) - } - - const gatedAdrs: Address[] = [] - - for (const addr of dedupedMultiaddrs) { - if (this.connectionGater.denyDialMultiaddr != null && await this.connectionGater.denyDialMultiaddr(addr.multiaddr)) { - continue - } - - gatedAdrs.push(addr) - } - - const sortedGatedAddrs = gatedAdrs.sort(this.addressSorter) - - // make sure we actually have some addresses to dial - if (sortedGatedAddrs.length === 0) { - throw new CodeError('The connection gater denied all addresses in the dial request', codes.ERR_NO_VALID_ADDRESSES) - } - - return sortedGatedAddrs - } - - private async performDial (pendingDial: PendingDialInternal, options: DialOptions = {}): Promise { - const dialAbortControllers: Array<(AbortController | undefined)> = pendingDial.multiaddrs.map(() => new AbortController()) - - try { - // internal peer dial queue - only one dial per peer at a time - const peerDialQueue = new PQueue({ concurrency: 1 }) - peerDialQueue.on('error', (err) => { - this.log.error('error dialing %s %o', pendingDial.multiaddrs, err) - }) - - const conn = await Promise.any(pendingDial.multiaddrs.map(async (addr, i) => { - const controller = dialAbortControllers[i] - - if (controller == null) { - throw new CodeError('dialAction did not come with an AbortController', codes.ERR_INVALID_PARAMETERS) - } - - // let any signal abort the dial - const signal = combineSignals(controller.signal, options.signal) - signal.addEventListener('abort', () => { - this.log('dial to %a aborted', addr) - }) - const deferred = pDefer() - - await peerDialQueue.add(async () => { - if (signal.aborted) { - this.log('dial to %a was aborted before reaching the head of the peer dial queue', addr) - deferred.reject(new AbortError()) - return - } - - // add the individual dial to the dial queue so we don't breach maxConcurrentDials - await this.queue.add(async () => { - try { - if (signal.aborted) { - this.log('dial to %a was aborted before reaching the head of the dial queue', addr) - deferred.reject(new AbortError()) - return - } - - // update dial status - pendingDial.status = 'active' - - const conn = await this.transportManager.dial(addr, { - ...options, - signal - }) - - if (controller.signal.aborted) { - // another dial succeeded faster than this one - this.log('multiple dials succeeded, closing superfluous connection') - - conn.close().catch(err => { - this.log.error('error closing superfluous connection', err) - }) - - deferred.reject(new AbortError()) - return - } - - // remove the successful AbortController so it is not aborted - dialAbortControllers[i] = undefined - - // immediately abort any other dials - dialAbortControllers.forEach(c => { - if (c !== undefined) { - c.abort() - } - }) - - this.log('dial to %a succeeded', addr) - - // resolve the connection promise - deferred.resolve(conn) - } catch (err: any) { - // something only went wrong if our signal was not aborted - this.log.error('error during dial of %a', addr, err) - deferred.reject(err) - } - }, { - ...options, - signal - }).catch(err => { - deferred.reject(err) - }) - }, { - signal - }).catch(err => { - deferred.reject(err) - }).finally(() => { - signal.clear() - }) - - return deferred.promise - })) - - // dial succeeded or failed - if (conn == null) { - throw new CodeError('successful dial led to empty object returned from peer dial queue', codes.ERR_TRANSPORT_DIAL_FAILED) - } - - pendingDial.status = 'success' - - return conn - } catch (err: any) { - pendingDial.status = 'error' - - // if we only dialled one address, unwrap the AggregateError to provide more - // useful feedback to the user - if (pendingDial.multiaddrs.length === 1 && err.name === 'AggregateError') { - throw err.errors[0] - } - - throw err - } - } -} - -/** - * Returns a random string - */ -function randomId (): string { - return `${(parseInt(String(Math.random() * 1e9), 10)).toString()}${Date.now()}` -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/index.ts deleted file mode 100644 index 03240c4bf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/index.ts +++ /dev/null @@ -1,612 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { KEEP_ALIVE } from '@libp2p/interface/peer-store/tags' -import { PeerMap } from '@libp2p/peer-collections' -import { defaultAddressSort } from '@libp2p/utils/address-sort' -import { type Multiaddr, type Resolver, multiaddr } from '@multiformats/multiaddr' -import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers' -import { RateLimiterMemory } from 'rate-limiter-flexible' -import { codes } from '../errors.js' -import { getPeerAddress } from '../get-peer.js' -import { AutoDial } from './auto-dial.js' -import { ConnectionPruner } from './connection-pruner.js' -import { AUTO_DIAL_CONCURRENCY, AUTO_DIAL_MAX_QUEUE_LENGTH, AUTO_DIAL_PRIORITY, DIAL_TIMEOUT, INBOUND_CONNECTION_THRESHOLD, MAX_CONNECTIONS, MAX_INCOMING_PENDING_CONNECTIONS, MAX_PARALLEL_DIALS, MAX_PEER_ADDRS_TO_DIAL, MIN_CONNECTIONS } from './constants.js' -import { DialQueue } from './dial-queue.js' -import type { PendingDial, AddressSorter, Libp2pEvents, AbortOptions, ComponentLogger, Logger } from '@libp2p/interface' -import type { Connection, MultiaddrConnection } from '@libp2p/interface/connection' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { Peer, PeerStore } from '@libp2p/interface/peer-store' -import type { Startable } from '@libp2p/interface/startable' -import type { ConnectionManager, OpenConnectionOptions } from '@libp2p/interface-internal/connection-manager' -import type { TransportManager } from '@libp2p/interface-internal/transport-manager' - -const DEFAULT_DIAL_PRIORITY = 50 - -export interface ConnectionManagerInit { - /** - * The maximum number of connections libp2p is willing to have before it starts - * pruning connections to reduce resource usage. (default: 300, 100 in browsers) - */ - maxConnections?: number - - /** - * The minimum number of connections below which libp2p will start to dial peers - * from the peer book. Setting this to 0 effectively disables this behaviour. - * (default: 50, 5 in browsers) - */ - minConnections?: number - - /** - * How long to wait between attempting to keep our number of concurrent connections - * above minConnections (default: 5000) - */ - autoDialInterval?: number - - /** - * When dialling peers from the peer book to keep the number of open connections - * above `minConnections`, add dials for this many peers to the dial queue - * at once. (default: 25) - */ - autoDialConcurrency?: number - - /** - * To allow user dials to take priority over auto dials, use this value as the - * dial priority. (default: 0) - */ - autoDialPriority?: number - - /** - * Limit the maximum number of peers to dial when trying to keep the number of - * open connections above `minConnections`. (default: 100) - */ - autoDialMaxQueueLength?: number - - /** - * When we've failed to dial a peer, do not autodial them again within this - * number of ms. (default: 1 minute, 7 minutes in browsers) - */ - autoDialPeerRetryThreshold?: number - - /** - * Newly discovered peers may be auto-dialed to increase the number of open - * connections, but they can be discovered in quick succession so add a small - * delay before attempting to dial them in case more peers have been - * discovered. (default: 10ms) - */ - autoDialDiscoveredPeersDebounce?: number - - /** - * Sort the known addresses of a peer before trying to dial, By default public - * addresses will be dialled before private (e.g. loopback or LAN) addresses. - */ - addressSorter?: AddressSorter - - /** - * The maximum number of dials across all peers to execute in parallel. - * (default: 100, 50 in browsers) - */ - maxParallelDials?: number - - /** - * Maximum number of addresses allowed for a given peer - if a peer has more - * addresses than this then the dial will fail. (default: 25) - */ - maxPeerAddrsToDial?: number - - /** - * How long a dial attempt is allowed to take, including DNS resolution - * of the multiaddr, opening a socket and upgrading it to a Connection. - */ - dialTimeout?: number - - /** - * When a new inbound connection is opened, the upgrade process (e.g. protect, - * encrypt, multiplex etc) must complete within this number of ms. (default: 30s) - */ - inboundUpgradeTimeout?: number - - /** - * Multiaddr resolvers to use when dialling - */ - resolvers?: Record - - /** - * A list of multiaddrs that will always be allowed (except if they are in the - * deny list) to open connections to this node even if we've reached maxConnections - */ - allow?: string[] - - /** - * A list of multiaddrs that will never be allowed to open connections to - * this node under any circumstances - */ - deny?: string[] - - /** - * If more than this many connections are opened per second by a single - * host, reject subsequent connections. (default: 5) - */ - inboundConnectionThreshold?: number - - /** - * The maximum number of parallel incoming connections allowed that have yet to - * complete the connection upgrade - e.g. choosing connection encryption, muxer, etc. - * (default: 10) - */ - maxIncomingPendingConnections?: number -} - -const defaultOptions = { - minConnections: MIN_CONNECTIONS, - maxConnections: MAX_CONNECTIONS, - inboundConnectionThreshold: INBOUND_CONNECTION_THRESHOLD, - maxIncomingPendingConnections: MAX_INCOMING_PENDING_CONNECTIONS, - autoDialConcurrency: AUTO_DIAL_CONCURRENCY, - autoDialPriority: AUTO_DIAL_PRIORITY, - autoDialMaxQueueLength: AUTO_DIAL_MAX_QUEUE_LENGTH -} - -export interface DefaultConnectionManagerComponents { - peerId: PeerId - metrics?: Metrics - peerStore: PeerStore - transportManager: TransportManager - connectionGater: ConnectionGater - events: TypedEventTarget - logger: ComponentLogger -} - -/** - * Responsible for managing known connections. - */ -export class DefaultConnectionManager implements ConnectionManager, Startable { - private started: boolean - private readonly connections: PeerMap - private readonly allow: Multiaddr[] - private readonly deny: Multiaddr[] - private readonly maxIncomingPendingConnections: number - private incomingPendingConnections: number - private readonly maxConnections: number - - public readonly dialQueue: DialQueue - public readonly autoDial: AutoDial - public readonly connectionPruner: ConnectionPruner - private readonly inboundConnectionRateLimiter: RateLimiterMemory - - private readonly peerStore: PeerStore - private readonly metrics?: Metrics - private readonly events: TypedEventTarget - private readonly log: Logger - - constructor (components: DefaultConnectionManagerComponents, init: ConnectionManagerInit = {}) { - this.maxConnections = init.maxConnections ?? defaultOptions.maxConnections - const minConnections = init.minConnections ?? defaultOptions.minConnections - - if (this.maxConnections < minConnections) { - throw new CodeError('Connection Manager maxConnections must be greater than minConnections', codes.ERR_INVALID_PARAMETERS) - } - - /** - * Map of connections per peer - */ - this.connections = new PeerMap() - - this.started = false - this.peerStore = components.peerStore - this.metrics = components.metrics - this.events = components.events - this.log = components.logger.forComponent('libp2p:connection-manager') - - this.onConnect = this.onConnect.bind(this) - this.onDisconnect = this.onDisconnect.bind(this) - this.events.addEventListener('connection:open', this.onConnect) - this.events.addEventListener('connection:close', this.onDisconnect) - - // allow/deny lists - this.allow = (init.allow ?? []).map(ma => multiaddr(ma)) - this.deny = (init.deny ?? []).map(ma => multiaddr(ma)) - - this.incomingPendingConnections = 0 - this.maxIncomingPendingConnections = init.maxIncomingPendingConnections ?? defaultOptions.maxIncomingPendingConnections - - // controls individual peers trying to dial us too quickly - this.inboundConnectionRateLimiter = new RateLimiterMemory({ - points: init.inboundConnectionThreshold ?? defaultOptions.inboundConnectionThreshold, - duration: 1 - }) - - // controls what happens when we don't have enough connections - this.autoDial = new AutoDial({ - connectionManager: this, - peerStore: components.peerStore, - events: components.events, - logger: components.logger - }, { - minConnections, - autoDialConcurrency: init.autoDialConcurrency ?? defaultOptions.autoDialConcurrency, - autoDialPriority: init.autoDialPriority ?? defaultOptions.autoDialPriority, - maxQueueLength: init.autoDialMaxQueueLength ?? defaultOptions.autoDialMaxQueueLength - }) - - // controls what happens when we have too many connections - this.connectionPruner = new ConnectionPruner({ - connectionManager: this, - peerStore: components.peerStore, - events: components.events, - logger: components.logger - }, { - maxConnections: this.maxConnections, - allow: this.allow - }) - - this.dialQueue = new DialQueue({ - peerId: components.peerId, - metrics: components.metrics, - peerStore: components.peerStore, - transportManager: components.transportManager, - connectionGater: components.connectionGater, - logger: components.logger - }, { - addressSorter: init.addressSorter ?? defaultAddressSort, - maxParallelDials: init.maxParallelDials ?? MAX_PARALLEL_DIALS, - maxPeerAddrsToDial: init.maxPeerAddrsToDial ?? MAX_PEER_ADDRS_TO_DIAL, - dialTimeout: init.dialTimeout ?? DIAL_TIMEOUT, - resolvers: init.resolvers ?? { - dnsaddr: dnsaddrResolver - }, - connections: this.connections - }) - } - - isStarted (): boolean { - return this.started - } - - /** - * Starts the Connection Manager. If Metrics are not enabled on libp2p - * only event loop and connection limits will be monitored. - */ - async start (): Promise { - // track inbound/outbound connections - this.metrics?.registerMetricGroup('libp2p_connection_manager_connections', { - calculate: () => { - const metric = { - inbound: 0, - outbound: 0 - } - - for (const conns of this.connections.values()) { - for (const conn of conns) { - if (conn.direction === 'inbound') { - metric.inbound++ - } else { - metric.outbound++ - } - } - } - - return metric - } - }) - - // track total number of streams per protocol - this.metrics?.registerMetricGroup('libp2p_protocol_streams_total', { - label: 'protocol', - calculate: () => { - const metric: Record = {} - - for (const conns of this.connections.values()) { - for (const conn of conns) { - for (const stream of conn.streams) { - const key = `${stream.direction} ${stream.protocol ?? 'unnegotiated'}` - - metric[key] = (metric[key] ?? 0) + 1 - } - } - } - - return metric - } - }) - - // track 90th percentile of streams per protocol - this.metrics?.registerMetricGroup('libp2p_connection_manager_protocol_streams_per_connection_90th_percentile', { - label: 'protocol', - calculate: () => { - const allStreams: Record = {} - - for (const conns of this.connections.values()) { - for (const conn of conns) { - const streams: Record = {} - - for (const stream of conn.streams) { - const key = `${stream.direction} ${stream.protocol ?? 'unnegotiated'}` - - streams[key] = (streams[key] ?? 0) + 1 - } - - for (const [protocol, count] of Object.entries(streams)) { - allStreams[protocol] = allStreams[protocol] ?? [] - allStreams[protocol].push(count) - } - } - } - - const metric: Record = {} - - for (let [protocol, counts] of Object.entries(allStreams)) { - counts = counts.sort((a, b) => a - b) - - const index = Math.floor(counts.length * 0.9) - metric[protocol] = counts[index] - } - - return metric - } - }) - - this.autoDial.start() - - this.started = true - this.log('started') - } - - async afterStart (): Promise { - // re-connect to any peers with the KEEP_ALIVE tag - void Promise.resolve() - .then(async () => { - const keepAlivePeers: Peer[] = await this.peerStore.all({ - filters: [(peer) => { - return peer.tags.has(KEEP_ALIVE) - }] - }) - - await Promise.all( - keepAlivePeers.map(async peer => { - await this.openConnection(peer.id) - .catch(err => { - this.log.error(err) - }) - }) - ) - }) - .catch(err => { - this.log.error(err) - }) - - this.autoDial.afterStart() - } - - /** - * Stops the Connection Manager - */ - async stop (): Promise { - this.dialQueue.stop() - this.autoDial.stop() - - // Close all connections we're tracking - const tasks: Array> = [] - for (const connectionList of this.connections.values()) { - for (const connection of connectionList) { - tasks.push((async () => { - try { - await connection.close() - } catch (err) { - this.log.error(err) - } - })()) - } - } - - this.log('closing %d connections', tasks.length) - await Promise.all(tasks) - this.connections.clear() - - this.log('stopped') - } - - onConnect (evt: CustomEvent): void { - void this._onConnect(evt).catch(err => { - this.log.error(err) - }) - } - - /** - * Tracks the incoming connection and check the connection limit - */ - async _onConnect (evt: CustomEvent): Promise { - const { detail: connection } = evt - - if (!this.started) { - // This can happen when we are in the process of shutting down the node - await connection.close() - return - } - - const peerId = connection.remotePeer - const storedConns = this.connections.get(peerId) - let isNewPeer = false - - if (storedConns != null) { - storedConns.push(connection) - } else { - isNewPeer = true - this.connections.set(peerId, [connection]) - } - - // only need to store RSA public keys, all other types are embedded in the peer id - if (peerId.publicKey != null && peerId.type === 'RSA') { - await this.peerStore.patch(peerId, { - publicKey: peerId.publicKey - }) - } - - if (isNewPeer) { - this.events.safeDispatchEvent('peer:connect', { detail: connection.remotePeer }) - } - } - - /** - * Removes the connection from tracking - */ - onDisconnect (evt: CustomEvent): void { - const { detail: connection } = evt - - if (!this.started) { - // This can happen when we are in the process of shutting down the node - return - } - - const peerId = connection.remotePeer - let storedConn = this.connections.get(peerId) - - if (storedConn != null && storedConn.length > 1) { - storedConn = storedConn.filter((conn) => conn.id !== connection.id) - this.connections.set(peerId, storedConn) - } else if (storedConn != null) { - this.connections.delete(peerId) - this.events.safeDispatchEvent('peer:disconnect', { detail: connection.remotePeer }) - } - } - - getConnections (peerId?: PeerId): Connection[] { - if (peerId != null) { - return this.connections.get(peerId) ?? [] - } - - let conns: Connection[] = [] - - for (const c of this.connections.values()) { - conns = conns.concat(c) - } - - return conns - } - - getConnectionsMap (): PeerMap { - return this.connections - } - - async openConnection (peerIdOrMultiaddr: PeerId | Multiaddr | Multiaddr[], options: OpenConnectionOptions = {}): Promise { - if (!this.isStarted()) { - throw new CodeError('Not started', codes.ERR_NODE_NOT_STARTED) - } - - options.signal?.throwIfAborted() - - const { peerId } = getPeerAddress(peerIdOrMultiaddr) - - if (peerId != null && options.force !== true) { - this.log('dial %p', peerId) - const existingConnection = this.getConnections(peerId) - .find(conn => !conn.transient) - - if (existingConnection != null) { - this.log('had an existing non-transient connection to %p', peerId) - - return existingConnection - } - } - - const connection = await this.dialQueue.dial(peerIdOrMultiaddr, { - ...options, - priority: options.priority ?? DEFAULT_DIAL_PRIORITY - }) - let peerConnections = this.connections.get(connection.remotePeer) - - if (peerConnections == null) { - peerConnections = [] - this.connections.set(connection.remotePeer, peerConnections) - } - - // we get notified of connections via the Upgrader emitting "connection" - // events, double check we aren't already tracking this connection before - // storing it - let trackedConnection = false - - for (const conn of peerConnections) { - if (conn.id === connection.id) { - trackedConnection = true - } - } - - if (!trackedConnection) { - peerConnections.push(connection) - } - - return connection - } - - async closeConnections (peerId: PeerId, options: AbortOptions = {}): Promise { - const connections = this.connections.get(peerId) ?? [] - - await Promise.all( - connections.map(async connection => { - try { - await connection.close(options) - } catch (err: any) { - connection.abort(err) - } - }) - ) - } - - async acceptIncomingConnection (maConn: MultiaddrConnection): Promise { - // check deny list - const denyConnection = this.deny.some(ma => { - return maConn.remoteAddr.toString().startsWith(ma.toString()) - }) - - if (denyConnection) { - this.log('connection from %a refused - connection remote address was in deny list', maConn.remoteAddr) - return false - } - - // check allow list - const allowConnection = this.allow.some(ma => { - return maConn.remoteAddr.toString().startsWith(ma.toString()) - }) - - if (allowConnection) { - this.incomingPendingConnections++ - - return true - } - - // check pending connections - if (this.incomingPendingConnections === this.maxIncomingPendingConnections) { - this.log('connection from %a refused - incomingPendingConnections exceeded by host', maConn.remoteAddr) - return false - } - - if (maConn.remoteAddr.isThinWaistAddress()) { - const host = maConn.remoteAddr.nodeAddress().address - - try { - await this.inboundConnectionRateLimiter.consume(host, 1) - } catch { - this.log('connection from %a refused - inboundConnectionThreshold exceeded by host %s', maConn.remoteAddr, host) - return false - } - } - - if (this.getConnections().length < this.maxConnections) { - this.incomingPendingConnections++ - - return true - } - - this.log('connection from %a refused - maxConnections exceeded', maConn.remoteAddr) - return false - } - - afterUpgradeInbound (): void { - this.incomingPendingConnections-- - } - - getDialQueue (): PendingDial[] { - return this.dialQueue.pendingDials - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/utils.ts deleted file mode 100644 index d32108e26..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection-manager/utils.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { setMaxListeners } from '@libp2p/interface/events' -import { type AbortOptions, multiaddr, type Multiaddr } from '@multiformats/multiaddr' -import { type ClearableSignal, anySignal } from 'any-signal' -import type { LoggerOptions } from '@libp2p/interface' - -/** - * Resolve multiaddr recursively - */ -export async function resolveMultiaddrs (ma: Multiaddr, options: AbortOptions & LoggerOptions): Promise { - // TODO: recursive logic should live in multiaddr once dns4/dns6 support is in place - // Now only supporting resolve for dnsaddr - const resolvableProto = ma.protoNames().includes('dnsaddr') - - // Multiaddr is not resolvable? End recursion! - if (!resolvableProto) { - return [ma] - } - - const resolvedMultiaddrs = await resolveRecord(ma, options) - const recursiveMultiaddrs = await Promise.all(resolvedMultiaddrs.map(async (nm) => { - return resolveMultiaddrs(nm, options) - })) - - const addrs = recursiveMultiaddrs.flat() - const output = addrs.reduce((array, newM) => { - if (array.find(m => m.equals(newM)) == null) { - array.push(newM) - } - return array - }, ([])) - - options.log('resolved %s to', ma, output.map(ma => ma.toString())) - - return output -} - -/** - * Resolve a given multiaddr. If this fails, an empty array will be returned - */ -async function resolveRecord (ma: Multiaddr, options: AbortOptions & LoggerOptions): Promise { - try { - ma = multiaddr(ma.toString()) // Use current multiaddr module - const multiaddrs = await ma.resolve(options) - return multiaddrs - } catch (err) { - options.log.error(`multiaddr ${ma.toString()} could not be resolved`, err) - return [] - } -} - -export function combineSignals (...signals: Array): ClearableSignal { - const sigs: AbortSignal[] = [] - - for (const sig of signals) { - if (sig != null) { - setMaxListeners(Infinity, sig) - sigs.push(sig) - } - } - - // let any signal abort the dial - const signal = anySignal(sigs) - - setMaxListeners(Infinity, signal) - - return signal -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection/index.ts deleted file mode 100644 index bbb248acb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/connection/index.ts +++ /dev/null @@ -1,208 +0,0 @@ -import { symbol } from '@libp2p/interface/connection' -import { CodeError } from '@libp2p/interface/errors' -import { setMaxListeners } from '@libp2p/interface/events' -import type { AbortOptions, Logger, ComponentLogger } from '@libp2p/interface' -import type { Direction, Connection, Stream, ConnectionTimeline, ConnectionStatus, NewStreamOptions } from '@libp2p/interface/connection' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { Multiaddr } from '@multiformats/multiaddr' - -const CLOSE_TIMEOUT = 500 - -interface ConnectionInit { - remoteAddr: Multiaddr - remotePeer: PeerId - newStream(protocols: string[], options?: AbortOptions): Promise - close(options?: AbortOptions): Promise - abort(err: Error): void - getStreams(): Stream[] - status: ConnectionStatus - direction: Direction - timeline: ConnectionTimeline - multiplexer?: string - encryption?: string - transient?: boolean - logger: ComponentLogger -} - -/** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ -export class ConnectionImpl implements Connection { - /** - * Connection identifier. - */ - public readonly id: string - - /** - * Observed multiaddr of the remote peer - */ - public readonly remoteAddr: Multiaddr - - /** - * Remote peer id - */ - public readonly remotePeer: PeerId - - public direction: Direction - public timeline: ConnectionTimeline - public multiplexer?: string - public encryption?: string - public status: ConnectionStatus - public transient: boolean - public readonly log: Logger - - /** - * User provided tags - * - */ - public tags: string[] - - /** - * Reference to the new stream function of the multiplexer - */ - private readonly _newStream: (protocols: string[], options?: NewStreamOptions) => Promise - - /** - * Reference to the close function of the raw connection - */ - private readonly _close: (options?: AbortOptions) => Promise - - private readonly _abort: (err: Error) => void - - /** - * Reference to the getStreams function of the muxer - */ - private readonly _getStreams: () => Stream[] - - /** - * An implementation of the js-libp2p connection. - * Any libp2p transport should use an upgrader to return this connection. - */ - constructor (init: ConnectionInit) { - const { remoteAddr, remotePeer, newStream, close, abort, getStreams } = init - - this.id = `${(parseInt(String(Math.random() * 1e9))).toString(36)}${Date.now()}` - this.remoteAddr = remoteAddr - this.remotePeer = remotePeer - this.direction = init.direction - this.status = 'open' - this.timeline = init.timeline - this.multiplexer = init.multiplexer - this.encryption = init.encryption - this.transient = init.transient ?? false - this.log = init.logger.forComponent(`libp2p:connection:${this.direction}:${this.id}`) - - if (this.remoteAddr.getPeerId() == null) { - this.remoteAddr = this.remoteAddr.encapsulate(`/p2p/${this.remotePeer}`) - } - - this._newStream = newStream - this._close = close - this._abort = abort - this._getStreams = getStreams - this.tags = [] - } - - readonly [Symbol.toStringTag] = 'Connection' - - readonly [symbol] = true - - /** - * Get all the streams of the muxer - */ - get streams (): Stream[] { - return this._getStreams() - } - - /** - * Create a new stream from this connection - */ - async newStream (protocols: string | string[], options?: NewStreamOptions): Promise { - if (this.status === 'closing') { - throw new CodeError('the connection is being closed', 'ERR_CONNECTION_BEING_CLOSED') - } - - if (this.status === 'closed') { - throw new CodeError('the connection is closed', 'ERR_CONNECTION_CLOSED') - } - - if (!Array.isArray(protocols)) { - protocols = [protocols] - } - - if (this.transient && options?.runOnTransientConnection !== true) { - throw new CodeError('Cannot open protocol stream on transient connection', 'ERR_TRANSIENT_CONNECTION') - } - - const stream = await this._newStream(protocols, options) - - stream.direction = 'outbound' - - return stream - } - - /** - * Close the connection - */ - async close (options: AbortOptions = {}): Promise { - if (this.status === 'closed' || this.status === 'closing') { - return - } - - this.log('closing connection to %a', this.remoteAddr) - - this.status = 'closing' - - if (options.signal == null) { - const signal = AbortSignal.timeout(CLOSE_TIMEOUT) - setMaxListeners(Infinity, signal) - - options = { - ...options, - signal - } - } - - try { - this.log.trace('closing all streams') - - // close all streams gracefully - this can throw if we're not multiplexed - await Promise.all( - this.streams.map(async s => s.close(options)) - ) - - this.log.trace('closing underlying transport') - - // close raw connection - await this._close(options) - - this.log.trace('updating timeline with close time') - - this.status = 'closed' - this.timeline.close = Date.now() - } catch (err: any) { - this.log.error('error encountered during graceful close of connection to %a', this.remoteAddr, err) - this.abort(err) - } - } - - abort (err: Error): void { - this.log.error('aborting connection to %a due to error', this.remoteAddr, err) - - this.status = 'closing' - this.streams.forEach(s => { s.abort(err) }) - - this.log.error('all streams aborted', this.streams.length) - - // Abort raw connection - this._abort(err) - - this.timeline.close = Date.now() - this.status = 'closed' - } -} - -export function createConnection (init: ConnectionInit): Connection { - return new ConnectionImpl(init) -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/content-routing/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/content-routing/index.ts deleted file mode 100644 index a96c2bd9a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/content-routing/index.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import merge from 'it-merge' -import { pipe } from 'it-pipe' -import { codes, messages } from '../errors.js' -import { - storeAddresses, - uniquePeers, - requirePeers -} from './utils.js' -import type { AbortOptions } from '@libp2p/interface' -import type { ContentRouting } from '@libp2p/interface/content-routing' -import type { PeerInfo } from '@libp2p/interface/peer-info' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Startable } from '@libp2p/interface/startable' -import type { CID } from 'multiformats/cid' - -export interface CompoundContentRoutingInit { - routers: ContentRouting[] -} - -export interface CompoundContentRoutingComponents { - peerStore: PeerStore -} - -export class CompoundContentRouting implements ContentRouting, Startable { - private readonly routers: ContentRouting[] - private started: boolean - private readonly components: CompoundContentRoutingComponents - - constructor (components: CompoundContentRoutingComponents, init: CompoundContentRoutingInit) { - this.routers = init.routers ?? [] - this.started = false - this.components = components - } - - isStarted (): boolean { - return this.started - } - - async start (): Promise { - this.started = true - } - - async stop (): Promise { - this.started = false - } - - /** - * Iterates over all content routers in parallel to find providers of the given key - */ - async * findProviders (key: CID, options: AbortOptions = {}): AsyncIterable { - if (this.routers.length === 0) { - throw new CodeError('No content routers available', codes.ERR_NO_ROUTERS_AVAILABLE) - } - - yield * pipe( - merge( - ...this.routers.map(router => router.findProviders(key, options)) - ), - (source) => storeAddresses(source, this.components.peerStore), - (source) => uniquePeers(source), - (source) => requirePeers(source) - ) - } - - /** - * Iterates over all content routers in parallel to notify it is - * a provider of the given key - */ - async provide (key: CID, options: AbortOptions = {}): Promise { - if (this.routers.length === 0) { - throw new CodeError('No content routers available', codes.ERR_NO_ROUTERS_AVAILABLE) - } - - await Promise.all(this.routers.map(async (router) => { await router.provide(key, options) })) - } - - /** - * Store the given key/value pair in the available content routings - */ - async put (key: Uint8Array, value: Uint8Array, options?: AbortOptions): Promise { - if (!this.isStarted()) { - throw new CodeError(messages.NOT_STARTED_YET, codes.DHT_NOT_STARTED) - } - - await Promise.all(this.routers.map(async (router) => { - await router.put(key, value, options) - })) - } - - /** - * Get the value to the given key. - * Times out after 1 minute by default. - */ - async get (key: Uint8Array, options?: AbortOptions): Promise { - if (!this.isStarted()) { - throw new CodeError(messages.NOT_STARTED_YET, codes.DHT_NOT_STARTED) - } - - return Promise.any(this.routers.map(async (router) => { - return router.get(key, options) - })) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/content-routing/utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/content-routing/utils.ts deleted file mode 100644 index f114639c4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/content-routing/utils.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import filter from 'it-filter' -import map from 'it-map' -import type { PeerInfo } from '@libp2p/interface/peer-info' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Source } from 'it-stream-types' - -/** - * Store the multiaddrs from every peer in the passed peer store - */ -export async function * storeAddresses (source: Source, peerStore: PeerStore): AsyncIterable { - yield * map(source, async (peer) => { - // ensure we have the addresses for a given peer - await peerStore.merge(peer.id, { - multiaddrs: peer.multiaddrs - }) - - return peer - }) -} - -/** - * Filter peers by unique peer id - */ -export function uniquePeers (source: Source): AsyncIterable { - /** @type Set */ - const seen = new Set() - - return filter(source, (peer) => { - // dedupe by peer id - if (seen.has(peer.id.toString())) { - return false - } - - seen.add(peer.id.toString()) - - return true - }) -} - -/** - * Require at least `min` peers to be yielded from `source` - */ -export async function * requirePeers (source: Source, min: number = 1): AsyncIterable { - let seen = 0 - - for await (const peer of source) { - seen++ - - yield peer - } - - if (seen < min) { - throw new CodeError(`more peers required, seen: ${seen} min: ${min}`, 'NOT_FOUND') - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/errors.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/errors.ts deleted file mode 100644 index 0b84215aa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/errors.ts +++ /dev/null @@ -1,77 +0,0 @@ -export enum messages { - NOT_STARTED_YET = 'The libp2p node is not started yet', - DHT_DISABLED = 'DHT is not available', - PUBSUB_DISABLED = 'PubSub is not available', - CONN_ENCRYPTION_REQUIRED = 'At least one connection encryption module is required', - ERR_TRANSPORTS_REQUIRED = 'At least one transport module is required', - ERR_PROTECTOR_REQUIRED = 'Private network is enforced, but no protector was provided', - NOT_FOUND = 'Not found' -} - -export enum codes { - DHT_DISABLED = 'ERR_DHT_DISABLED', - ERR_PUBSUB_DISABLED = 'ERR_PUBSUB_DISABLED', - PUBSUB_NOT_STARTED = 'ERR_PUBSUB_NOT_STARTED', - DHT_NOT_STARTED = 'ERR_DHT_NOT_STARTED', - CONN_ENCRYPTION_REQUIRED = 'ERR_CONN_ENCRYPTION_REQUIRED', - ERR_TRANSPORTS_REQUIRED = 'ERR_TRANSPORTS_REQUIRED', - ERR_PROTECTOR_REQUIRED = 'ERR_PROTECTOR_REQUIRED', - ERR_PEER_DIAL_INTERCEPTED = 'ERR_PEER_DIAL_INTERCEPTED', - ERR_CONNECTION_INTERCEPTED = 'ERR_CONNECTION_INTERCEPTED', - ERR_INVALID_PROTOCOLS_FOR_STREAM = 'ERR_INVALID_PROTOCOLS_FOR_STREAM', - ERR_CONNECTION_ENDED = 'ERR_CONNECTION_ENDED', - ERR_CONNECTION_FAILED = 'ERR_CONNECTION_FAILED', - ERR_NODE_NOT_STARTED = 'ERR_NODE_NOT_STARTED', - ERR_ALREADY_ABORTED = 'ERR_ALREADY_ABORTED', - ERR_TOO_MANY_ADDRESSES = 'ERR_TOO_MANY_ADDRESSES', - ERR_NO_VALID_ADDRESSES = 'ERR_NO_VALID_ADDRESSES', - ERR_RELAYED_DIAL = 'ERR_RELAYED_DIAL', - ERR_DIALED_SELF = 'ERR_DIALED_SELF', - ERR_DISCOVERED_SELF = 'ERR_DISCOVERED_SELF', - ERR_DUPLICATE_TRANSPORT = 'ERR_DUPLICATE_TRANSPORT', - ERR_ENCRYPTION_FAILED = 'ERR_ENCRYPTION_FAILED', - ERR_HOP_REQUEST_FAILED = 'ERR_HOP_REQUEST_FAILED', - ERR_INVALID_KEY = 'ERR_INVALID_KEY', - ERR_INVALID_MESSAGE = 'ERR_INVALID_MESSAGE', - ERR_INVALID_PARAMETERS = 'ERR_INVALID_PARAMETERS', - ERR_INVALID_PEER = 'ERR_INVALID_PEER', - ERR_MUXER_UNAVAILABLE = 'ERR_MUXER_UNAVAILABLE', - ERR_NOT_FOUND = 'ERR_NOT_FOUND', - ERR_TRANSPORT_UNAVAILABLE = 'ERR_TRANSPORT_UNAVAILABLE', - ERR_TRANSPORT_DIAL_FAILED = 'ERR_TRANSPORT_DIAL_FAILED', - ERR_UNSUPPORTED_PROTOCOL = 'ERR_UNSUPPORTED_PROTOCOL', - ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED = 'ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED', - ERR_INVALID_MULTIADDR = 'ERR_INVALID_MULTIADDR', - ERR_SIGNATURE_NOT_VALID = 'ERR_SIGNATURE_NOT_VALID', - ERR_FIND_SELF = 'ERR_FIND_SELF', - ERR_NO_ROUTERS_AVAILABLE = 'ERR_NO_ROUTERS_AVAILABLE', - ERR_CONNECTION_NOT_MULTIPLEXED = 'ERR_CONNECTION_NOT_MULTIPLEXED', - ERR_NO_DIAL_TOKENS = 'ERR_NO_DIAL_TOKENS', - ERR_INVALID_CMS = 'ERR_INVALID_CMS', - ERR_MISSING_KEYS = 'ERR_MISSING_KEYS', - ERR_NO_KEY = 'ERR_NO_KEY', - ERR_INVALID_KEY_NAME = 'ERR_INVALID_KEY_NAME', - ERR_INVALID_KEY_TYPE = 'ERR_INVALID_KEY_TYPE', - ERR_KEY_ALREADY_EXISTS = 'ERR_KEY_ALREADY_EXISTS', - ERR_INVALID_KEY_SIZE = 'ERR_INVALID_KEY_SIZE', - ERR_KEY_NOT_FOUND = 'ERR_KEY_NOT_FOUND', - ERR_OLD_KEY_NAME_INVALID = 'ERR_OLD_KEY_NAME_INVALID', - ERR_NEW_KEY_NAME_INVALID = 'ERR_NEW_KEY_NAME_INVALID', - ERR_PASSWORD_REQUIRED = 'ERR_PASSWORD_REQUIRED', - ERR_PEM_REQUIRED = 'ERR_PEM_REQUIRED', - ERR_CANNOT_READ_KEY = 'ERR_CANNOT_READ_KEY', - ERR_MISSING_PRIVATE_KEY = 'ERR_MISSING_PRIVATE_KEY', - ERR_MISSING_PUBLIC_KEY = 'ERR_MISSING_PUBLIC_KEY', - ERR_INVALID_OLD_PASS_TYPE = 'ERR_INVALID_OLD_PASS_TYPE', - ERR_INVALID_NEW_PASS_TYPE = 'ERR_INVALID_NEW_PASS_TYPE', - ERR_INVALID_PASS_LENGTH = 'ERR_INVALID_PASS_LENGTH', - ERR_NOT_IMPLEMENTED = 'ERR_NOT_IMPLEMENTED', - ERR_WRONG_PING_ACK = 'ERR_WRONG_PING_ACK', - ERR_INVALID_RECORD = 'ERR_INVALID_RECORD', - ERR_ALREADY_SUCCEEDED = 'ERR_ALREADY_SUCCEEDED', - ERR_NO_HANDLER_FOR_PROTOCOL = 'ERR_NO_HANDLER_FOR_PROTOCOL', - ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS = 'ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS', - ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS = 'ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS', - ERR_CONNECTION_DENIED = 'ERR_CONNECTION_DENIED', - ERR_TRANSFER_LIMIT_EXCEEDED = 'ERR_TRANSFER_LIMIT_EXCEEDED' -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/get-peer.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/get-peer.ts deleted file mode 100644 index 8503fe7b6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/get-peer.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { isPeerId } from '@libp2p/interface/peer-id' -import { peerIdFromString } from '@libp2p/peer-id' -import { isMultiaddr } from '@multiformats/multiaddr' -import { codes } from './errors.js' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { Multiaddr } from '@multiformats/multiaddr' - -export interface PeerAddress { - peerId?: PeerId - multiaddrs: Multiaddr[] -} - -/** - * Extracts a PeerId and/or multiaddr from the passed PeerId or Multiaddr or an array of Multiaddrs - */ -export function getPeerAddress (peer: PeerId | Multiaddr | Multiaddr[]): PeerAddress { - if (isPeerId(peer)) { - return { peerId: peer, multiaddrs: [] } - } - - if (!Array.isArray(peer)) { - peer = [peer] - } - - let peerId: PeerId | undefined - - if (peer.length > 0) { - const peerIdStr = peer[0].getPeerId() - peerId = peerIdStr == null ? undefined : peerIdFromString(peerIdStr) - - // ensure PeerId is either not set or is consistent - peer.forEach(ma => { - if (!isMultiaddr(ma)) { - throw new CodeError('Invalid Multiaddr', codes.ERR_INVALID_MULTIADDR) - } - - const maPeerIdStr = ma.getPeerId() - - if (maPeerIdStr == null) { - if (peerId != null) { - throw new CodeError('Multiaddrs must all have the same peer id or have no peer id', codes.ERR_INVALID_PARAMETERS) - } - } else { - const maPeerId = peerIdFromString(maPeerIdStr) - - if (peerId == null || !peerId.equals(maPeerId)) { - throw new CodeError('Multiaddrs must all have the same peer id or have no peer id', codes.ERR_INVALID_PARAMETERS) - } - } - }) - } - - return { - peerId, - multiaddrs: peer - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/index.ts deleted file mode 100644 index 2c5fd44d4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/index.ts +++ /dev/null @@ -1,171 +0,0 @@ -/** - * @packageDocumentation - * - * Use the `createLibp2p` function to create a libp2p node. - * - * @example - * - * ```typescript - * import { createLibp2p } from 'libp2p' - * - * const node = await createLibp2p({ - * // ...other options - * }) - * ``` - */ - -import { createLibp2pNode } from './libp2p.js' -import type { AddressManagerInit } from './address-manager/index.js' -import type { Components } from './components.js' -import type { ConnectionManagerInit } from './connection-manager/index.js' -import type { TransportManagerInit } from './transport-manager.js' -import type { Libp2p, ServiceMap, RecursivePartial, ComponentLogger, NodeInfo } from '@libp2p/interface' -import type { ConnectionProtector } from '@libp2p/interface/connection' -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { ContentRouting } from '@libp2p/interface/content-routing' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerDiscovery } from '@libp2p/interface/peer-discovery' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerRouting } from '@libp2p/interface/peer-routing' -import type { StreamMuxerFactory } from '@libp2p/interface/stream-muxer' -import type { Transport } from '@libp2p/interface/transport' -import type { PersistentPeerStoreInit } from '@libp2p/peer-store' -import type { Datastore } from 'interface-datastore' - -export type ServiceFactoryMap = Record> = { - [Property in keyof T]: (components: Components) => T[Property] -} - -/** - * For Libp2p configurations and modules details read the [Configuration Document](./CONFIGURATION.md). - */ -export interface Libp2pInit }> { - /** - * peerId instance (it will be created if not provided) - */ - peerId: PeerId - - /** - * Metadata about the node - implementation name, version number, etc - */ - nodeInfo: NodeInfo - - /** - * Addresses for transport listening and to advertise to the network - */ - addresses: AddressManagerInit - - /** - * libp2p Connection Manager configuration - */ - connectionManager: ConnectionManagerInit - - /** - * A connection gater can deny new connections based on user criteria - */ - connectionGater: ConnectionGater - - /** - * libp2p transport manager configuration - */ - transportManager: TransportManagerInit - - /** - * An optional datastore to persist peer information, DHT records, etc. - * - * An in-memory datastore will be used if one is not provided. - */ - datastore: Datastore - - /** - * libp2p PeerStore configuration - */ - peerStore: PersistentPeerStoreInit - - /** - * An array that must include at least 1 compliant transport - */ - transports: Array<(components: Components) => Transport> - streamMuxers?: Array<(components: Components) => StreamMuxerFactory> - connectionEncryption?: Array<(components: Components) => ConnectionEncrypter> - peerDiscovery?: Array<(components: Components) => PeerDiscovery> - peerRouters?: Array<(components: Components) => PeerRouting> - contentRouters?: Array<(components: Components) => ContentRouting> - - /** - * A Metrics implementation can be supplied to collect metrics on this node - */ - metrics?(components: Components): Metrics - - /** - * A ConnectionProtector can be used to create a secure overlay on top of the network using pre-shared keys - */ - connectionProtector?(components: Components): ConnectionProtector - - /** - * Arbitrary libp2p modules - */ - services: ServiceFactoryMap - - /** - * An optional logging implementation that can be used to write runtime logs. - * - * Set the `DEBUG` env var or the `debug` key on LocalStorage to see logs. - * - * @example - * - * Node.js: - * - * ```console - * $ DEBUG="*libp2p:*" node myscript.js - * ``` - * - * Browsers: - * - * ```javascript - * localStorage.setItem('debug', '*libp2p:*') - * ``` - */ - logger?: ComponentLogger -} - -export type { Libp2p } - -export type Libp2pOptions> = RecursivePartial> & { start?: boolean } - -/** - * Returns a new instance of the Libp2p interface, generating a new PeerId - * if one is not passed as part of the options. - * - * The node will be started unless `start: false` is passed as an option. - * - * @example - * - * ```js - * import { createLibp2p } from 'libp2p' - * import { tcp } from '@libp2p/tcp' - * import { mplex } from '@libp2p/mplex' - * import { noise } from '@chainsafe/libp2p-noise' - * import { yamux } from '@chainsafe/libp2p-yamux' - * - * // specify options - * const options = { - * transports: [tcp()], - * streamMuxers: [yamux(), mplex()], - * connectionEncryption: [noise()] - * } - * - * // create libp2p - * const libp2p = await createLibp2p(options) - * ``` - */ -export async function createLibp2p }> (options: Libp2pOptions): Promise> { - const node = await createLibp2pNode(options) - - if (options.start !== false) { - await node.start() - } - - return node -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/libp2p.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/libp2p.ts deleted file mode 100644 index afe94969d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/libp2p.ts +++ /dev/null @@ -1,401 +0,0 @@ -import { unmarshalPublicKey } from '@libp2p/crypto/keys' -import { type ContentRouting, contentRouting } from '@libp2p/interface/content-routing' -import { CodeError } from '@libp2p/interface/errors' -import { TypedEventEmitter, CustomEvent, setMaxListeners } from '@libp2p/interface/events' -import { peerDiscovery } from '@libp2p/interface/peer-discovery' -import { type PeerRouting, peerRouting } from '@libp2p/interface/peer-routing' -import { defaultLogger } from '@libp2p/logger' -import { PeerSet } from '@libp2p/peer-collections' -import { peerIdFromString } from '@libp2p/peer-id' -import { createEd25519PeerId } from '@libp2p/peer-id-factory' -import { PersistentPeerStore } from '@libp2p/peer-store' -import { isMultiaddr, type Multiaddr } from '@multiformats/multiaddr' -import { MemoryDatastore } from 'datastore-core/memory' -import { concat as uint8ArrayConcat } from 'uint8arrays/concat' -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' -import { DefaultAddressManager } from './address-manager/index.js' -import { defaultComponents } from './components.js' -import { connectionGater } from './config/connection-gater.js' -import { validateConfig } from './config.js' -import { DefaultConnectionManager } from './connection-manager/index.js' -import { CompoundContentRouting } from './content-routing/index.js' -import { codes } from './errors.js' -import { DefaultPeerRouting } from './peer-routing.js' -import { DefaultRegistrar } from './registrar.js' -import { DefaultTransportManager } from './transport-manager.js' -import { DefaultUpgrader } from './upgrader.js' -import * as pkg from './version.js' -import type { Components } from './components.js' -import type { Libp2p, Libp2pInit, Libp2pOptions } from './index.js' -import type { Libp2pEvents, PendingDial, ServiceMap, AbortOptions, ComponentLogger, Logger } from '@libp2p/interface' -import type { Connection, NewStreamOptions, Stream } from '@libp2p/interface/connection' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerInfo } from '@libp2p/interface/peer-info' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Topology } from '@libp2p/interface/topology' -import type { StreamHandler, StreamHandlerOptions } from '@libp2p/interface-internal/registrar' - -export class Libp2pNode> extends TypedEventEmitter implements Libp2p { - public peerId: PeerId - public peerStore: PeerStore - public contentRouting: ContentRouting - public peerRouting: PeerRouting - public metrics?: Metrics - public services: T - public logger: ComponentLogger - - public components: Components - #started: boolean - private readonly log: Logger - - constructor (init: Libp2pInit) { - super() - - // event bus - components can listen to this emitter to be notified of system events - // and also cause them to be emitted - const events = new TypedEventEmitter() - const originalDispatch = events.dispatchEvent.bind(events) - events.dispatchEvent = (evt: any) => { - const internalResult = originalDispatch(evt) - const externalResult = this.dispatchEvent( - new CustomEvent(evt.type, { detail: evt.detail }) - ) - - return internalResult || externalResult - } - - // This emitter gets listened to a lot - setMaxListeners(Infinity, events) - - this.#started = false - this.peerId = init.peerId - this.logger = init.logger ?? defaultLogger() - this.log = this.logger.forComponent('libp2p') - // @ts-expect-error {} may not be of type T - this.services = {} - const components = this.components = defaultComponents({ - peerId: init.peerId, - nodeInfo: init.nodeInfo ?? { - name: pkg.name, - version: pkg.version - }, - logger: this.logger, - events, - datastore: init.datastore ?? new MemoryDatastore(), - connectionGater: connectionGater(init.connectionGater) - }) - - this.peerStore = this.configureComponent('peerStore', new PersistentPeerStore(components, { - addressFilter: this.components.connectionGater.filterMultiaddrForPeer, - ...init.peerStore - })) - - // Create Metrics - if (init.metrics != null) { - this.metrics = this.configureComponent('metrics', init.metrics(this.components)) - } - - components.events.addEventListener('peer:update', evt => { - // if there was no peer previously in the peer store this is a new peer - if (evt.detail.previous == null) { - const peerInfo: PeerInfo = { - id: evt.detail.peer.id, - multiaddrs: evt.detail.peer.addresses.map(a => a.multiaddr) - } - - components.events.safeDispatchEvent('peer:discovery', { detail: peerInfo }) - } - }) - - // Set up connection protector if configured - if (init.connectionProtector != null) { - this.configureComponent('connectionProtector', init.connectionProtector(components)) - } - - // Set up the Upgrader - this.components.upgrader = new DefaultUpgrader(this.components, { - connectionEncryption: (init.connectionEncryption ?? []).map((fn, index) => this.configureComponent(`connection-encryption-${index}`, fn(this.components))), - muxers: (init.streamMuxers ?? []).map((fn, index) => this.configureComponent(`stream-muxers-${index}`, fn(this.components))), - inboundUpgradeTimeout: init.connectionManager.inboundUpgradeTimeout - }) - - // Setup the transport manager - this.configureComponent('transportManager', new DefaultTransportManager(this.components, init.transportManager)) - - // Create the Connection Manager - this.configureComponent('connectionManager', new DefaultConnectionManager(this.components, init.connectionManager)) - - // Create the Registrar - this.configureComponent('registrar', new DefaultRegistrar(this.components)) - - // Addresses {listen, announce, noAnnounce} - this.configureComponent('addressManager', new DefaultAddressManager(this.components, init.addresses)) - - // Peer routers - const peerRouters: PeerRouting[] = (init.peerRouters ?? []).map((fn, index) => this.configureComponent(`peer-router-${index}`, fn(this.components))) - this.peerRouting = this.components.peerRouting = this.configureComponent('peerRouting', new DefaultPeerRouting(this.components, { - routers: peerRouters - })) - - // Content routers - const contentRouters: ContentRouting[] = (init.contentRouters ?? []).map((fn, index) => this.configureComponent(`content-router-${index}`, fn(this.components))) - this.contentRouting = this.components.contentRouting = this.configureComponent('contentRouting', new CompoundContentRouting(this.components, { - routers: contentRouters - })) - - // Discovery modules - ;(init.peerDiscovery ?? []).forEach((fn, index) => { - const service = this.configureComponent(`peer-discovery-${index}`, fn(this.components)) - - service.addEventListener('peer', (evt) => { - this.#onDiscoveryPeer(evt) - }) - }) - - // Transport modules - init.transports.forEach((fn, index) => { - this.components.transportManager.add(this.configureComponent(`transport-${index}`, fn(this.components))) - }) - - // User defined modules - if (init.services != null) { - for (const name of Object.keys(init.services)) { - const createService = init.services[name] - const service: any = createService(this.components) - - if (service == null) { - this.log.error('service factory %s returned null or undefined instance', name) - continue - } - - this.services[name as keyof T] = service - this.configureComponent(name, service) - - if (service[contentRouting] != null) { - this.log('registering service %s for content routing', name) - contentRouters.push(service[contentRouting]) - } - - if (service[peerRouting] != null) { - this.log('registering service %s for peer routing', name) - peerRouters.push(service[peerRouting]) - } - - if (service[peerDiscovery] != null) { - this.log('registering service %s for peer discovery', name) - service[peerDiscovery].addEventListener('peer', (evt: CustomEvent) => { - this.#onDiscoveryPeer(evt) - }) - } - } - } - } - - private configureComponent (name: string, component: T): T { - if (component == null) { - this.log.error('component %s was null or undefined', name) - } - - this.components[name] = component - - return component - } - - /** - * Starts the libp2p node and all its subsystems - */ - async start (): Promise { - if (this.#started) { - return - } - - this.#started = true - - this.log('libp2p is starting') - - try { - await this.components.beforeStart?.() - await this.components.start() - await this.components.afterStart?.() - - this.safeDispatchEvent('start', { detail: this }) - this.log('libp2p has started') - } catch (err: any) { - this.log.error('An error occurred starting libp2p', err) - await this.stop() - throw err - } - } - - /** - * Stop the libp2p node by closing its listeners and open connections - */ - async stop (): Promise { - if (!this.#started) { - return - } - - this.log('libp2p is stopping') - - this.#started = false - - await this.components.beforeStop?.() - await this.components.stop() - await this.components.afterStop?.() - - this.safeDispatchEvent('stop', { detail: this }) - this.log('libp2p has stopped') - } - - isStarted (): boolean { - return this.#started - } - - getConnections (peerId?: PeerId): Connection[] { - return this.components.connectionManager.getConnections(peerId) - } - - getDialQueue (): PendingDial[] { - return this.components.connectionManager.getDialQueue() - } - - getPeers (): PeerId[] { - const peerSet = new PeerSet() - - for (const conn of this.components.connectionManager.getConnections()) { - peerSet.add(conn.remotePeer) - } - - return Array.from(peerSet) - } - - async dial (peer: PeerId | Multiaddr | Multiaddr[], options: AbortOptions = {}): Promise { - return this.components.connectionManager.openConnection(peer, options) - } - - async dialProtocol (peer: PeerId | Multiaddr | Multiaddr[], protocols: string | string[], options: NewStreamOptions = {}): Promise { - if (protocols == null) { - throw new CodeError('no protocols were provided to open a stream', codes.ERR_INVALID_PROTOCOLS_FOR_STREAM) - } - - protocols = Array.isArray(protocols) ? protocols : [protocols] - - if (protocols.length === 0) { - throw new CodeError('no protocols were provided to open a stream', codes.ERR_INVALID_PROTOCOLS_FOR_STREAM) - } - - const connection = await this.dial(peer, options) - - return connection.newStream(protocols, options) - } - - getMultiaddrs (): Multiaddr[] { - return this.components.addressManager.getAddresses() - } - - getProtocols (): string[] { - return this.components.registrar.getProtocols() - } - - async hangUp (peer: PeerId | Multiaddr, options: AbortOptions = {}): Promise { - if (isMultiaddr(peer)) { - peer = peerIdFromString(peer.getPeerId() ?? '') - } - - await this.components.connectionManager.closeConnections(peer, options) - } - - /** - * Get the public key for the given peer id - */ - async getPublicKey (peer: PeerId, options: AbortOptions = {}): Promise { - this.log('getPublicKey %p', peer) - - if (peer.publicKey != null) { - return peer.publicKey - } - - const peerInfo = await this.peerStore.get(peer) - - if (peerInfo.id.publicKey != null) { - return peerInfo.id.publicKey - } - - const peerKey = uint8ArrayConcat([ - uint8ArrayFromString('/pk/'), - peer.multihash.digest - ]) - - // search any available content routing methods - const bytes = await this.contentRouting.get(peerKey, options) - // ensure the returned key is valid - unmarshalPublicKey(bytes) - - await this.peerStore.patch(peer, { - publicKey: bytes - }) - - return bytes - } - - async handle (protocols: string | string[], handler: StreamHandler, options?: StreamHandlerOptions): Promise { - if (!Array.isArray(protocols)) { - protocols = [protocols] - } - - await Promise.all( - protocols.map(async protocol => { - await this.components.registrar.handle(protocol, handler, options) - }) - ) - } - - async unhandle (protocols: string[] | string): Promise { - if (!Array.isArray(protocols)) { - protocols = [protocols] - } - - await Promise.all( - protocols.map(async protocol => { - await this.components.registrar.unhandle(protocol) - }) - ) - } - - async register (protocol: string, topology: Topology): Promise { - return this.components.registrar.register(protocol, topology) - } - - unregister (id: string): void { - this.components.registrar.unregister(id) - } - - /** - * Called whenever peer discovery services emit `peer` events and adds peers - * to the peer store. - */ - #onDiscoveryPeer (evt: CustomEvent): void { - const { detail: peer } = evt - - if (peer.id.toString() === this.peerId.toString()) { - this.log.error(new Error(codes.ERR_DISCOVERED_SELF)) - return - } - - void this.components.peerStore.merge(peer.id, { - multiaddrs: peer.multiaddrs - }) - .catch(err => { this.log.error(err) }) - } -} - -/** - * Returns a new Libp2pNode instance - this exposes more of the internals than the - * libp2p interface and is useful for testing and debugging. - */ -export async function createLibp2pNode > (options: Libp2pOptions): Promise> { - options.peerId ??= await createEd25519PeerId() - - return new Libp2pNode(validateConfig(options)) -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/peer-routing.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/peer-routing.ts deleted file mode 100644 index f5082cab5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/peer-routing.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import filter from 'it-filter' -import first from 'it-first' -import merge from 'it-merge' -import { pipe } from 'it-pipe' -import { - storeAddresses, - uniquePeers, - requirePeers -} from './content-routing/utils.js' -import { codes, messages } from './errors.js' -import type { AbortOptions, Logger } from '@libp2p/interface' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerInfo } from '@libp2p/interface/peer-info' -import type { PeerRouting } from '@libp2p/interface/peer-routing' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { ComponentLogger } from '@libp2p/logger' - -export interface PeerRoutingInit { - routers?: PeerRouting[] -} - -export interface DefaultPeerRoutingComponents { - peerId: PeerId - peerStore: PeerStore - logger: ComponentLogger -} - -export class DefaultPeerRouting implements PeerRouting { - private readonly log: Logger - private readonly peerId: PeerId - private readonly peerStore: PeerStore - private readonly routers: PeerRouting[] - - constructor (components: DefaultPeerRoutingComponents, init: PeerRoutingInit) { - this.log = components.logger.forComponent('libp2p:peer-routing') - this.peerId = components.peerId - this.peerStore = components.peerStore - this.routers = init.routers ?? [] - } - - /** - * Iterates over all peer routers in parallel to find the given peer - */ - async findPeer (id: PeerId, options?: AbortOptions): Promise { - if (this.routers.length === 0) { - throw new CodeError('No peer routers available', codes.ERR_NO_ROUTERS_AVAILABLE) - } - - if (id.toString() === this.peerId.toString()) { - throw new CodeError('Should not try to find self', codes.ERR_FIND_SELF) - } - - const self = this - - const output = await pipe( - merge( - ...this.routers.map(router => (async function * () { - try { - yield await router.findPeer(id, options) - } catch (err) { - self.log.error(err) - } - })()) - ), - (source) => filter(source, Boolean), - (source) => storeAddresses(source, this.peerStore), - async (source) => first(source) - ) - - if (output != null) { - return output - } - - throw new CodeError(messages.NOT_FOUND, codes.ERR_NOT_FOUND) - } - - /** - * Attempt to find the closest peers on the network to the given key - */ - async * getClosestPeers (key: Uint8Array, options?: AbortOptions): AsyncIterable { - if (this.routers.length === 0) { - throw new CodeError('No peer routers available', codes.ERR_NO_ROUTERS_AVAILABLE) - } - - yield * pipe( - merge( - ...this.routers.map(router => router.getClosestPeers(key, options)) - ), - (source) => storeAddresses(source, this.peerStore), - (source) => uniquePeers(source), - (source) => requirePeers(source) - ) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/registrar.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/registrar.ts deleted file mode 100644 index 11d70b05a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/registrar.ts +++ /dev/null @@ -1,234 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import merge from 'merge-options' -import { codes } from './errors.js' -import type { IdentifyResult, Libp2pEvents, Logger, PeerUpdate } from '@libp2p/interface' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { Topology } from '@libp2p/interface/topology' -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager' -import type { StreamHandlerOptions, StreamHandlerRecord, Registrar, StreamHandler } from '@libp2p/interface-internal/registrar' -import type { ComponentLogger } from '@libp2p/logger' - -export const DEFAULT_MAX_INBOUND_STREAMS = 32 -export const DEFAULT_MAX_OUTBOUND_STREAMS = 64 - -export interface RegistrarComponents { - peerId: PeerId - connectionManager: ConnectionManager - peerStore: PeerStore - events: TypedEventTarget - logger: ComponentLogger -} - -/** - * Responsible for notifying registered protocols of events in the network. - */ -export class DefaultRegistrar implements Registrar { - private readonly log: Logger - private readonly topologies: Map> - private readonly handlers: Map - private readonly components: RegistrarComponents - - constructor (components: RegistrarComponents) { - this.log = components.logger.forComponent('libp2p:registrar') - this.topologies = new Map() - this.handlers = new Map() - this.components = components - - this._onDisconnect = this._onDisconnect.bind(this) - this._onPeerUpdate = this._onPeerUpdate.bind(this) - this._onPeerIdentify = this._onPeerIdentify.bind(this) - - this.components.events.addEventListener('peer:disconnect', this._onDisconnect) - this.components.events.addEventListener('peer:update', this._onPeerUpdate) - this.components.events.addEventListener('peer:identify', this._onPeerIdentify) - } - - getProtocols (): string[] { - return Array.from(new Set([ - ...this.handlers.keys() - ])).sort() - } - - getHandler (protocol: string): StreamHandlerRecord { - const handler = this.handlers.get(protocol) - - if (handler == null) { - throw new CodeError(`No handler registered for protocol ${protocol}`, codes.ERR_NO_HANDLER_FOR_PROTOCOL) - } - - return handler - } - - getTopologies (protocol: string): Topology[] { - const topologies = this.topologies.get(protocol) - - if (topologies == null) { - return [] - } - - return [ - ...topologies.values() - ] - } - - /** - * Registers the `handler` for each protocol - */ - async handle (protocol: string, handler: StreamHandler, opts?: StreamHandlerOptions): Promise { - if (this.handlers.has(protocol)) { - throw new CodeError(`Handler already registered for protocol ${protocol}`, codes.ERR_PROTOCOL_HANDLER_ALREADY_REGISTERED) - } - - const options = merge.bind({ ignoreUndefined: true })({ - maxInboundStreams: DEFAULT_MAX_INBOUND_STREAMS, - maxOutboundStreams: DEFAULT_MAX_OUTBOUND_STREAMS - }, opts) - - this.handlers.set(protocol, { - handler, - options - }) - - // Add new protocol to self protocols in the peer store - await this.components.peerStore.merge(this.components.peerId, { - protocols: [protocol] - }) - } - - /** - * Removes the handler for each protocol. The protocol - * will no longer be supported on streams. - */ - async unhandle (protocols: string | string[]): Promise { - const protocolList = Array.isArray(protocols) ? protocols : [protocols] - - protocolList.forEach(protocol => { - this.handlers.delete(protocol) - }) - - // Update self protocols in the peer store - await this.components.peerStore.patch(this.components.peerId, { - protocols: this.getProtocols() - }) - } - - /** - * Register handlers for a set of multicodecs given - */ - async register (protocol: string, topology: Topology): Promise { - if (topology == null) { - throw new CodeError('invalid topology', codes.ERR_INVALID_PARAMETERS) - } - - // Create topology - const id = `${(Math.random() * 1e9).toString(36)}${Date.now()}` - - let topologies = this.topologies.get(protocol) - - if (topologies == null) { - topologies = new Map() - this.topologies.set(protocol, topologies) - } - - topologies.set(id, topology) - - return id - } - - /** - * Unregister topology - */ - unregister (id: string): void { - for (const [protocol, topologies] of this.topologies.entries()) { - if (topologies.has(id)) { - topologies.delete(id) - - if (topologies.size === 0) { - this.topologies.delete(protocol) - } - } - } - } - - /** - * Remove a disconnected peer from the record - */ - _onDisconnect (evt: CustomEvent): void { - const remotePeer = evt.detail - - void this.components.peerStore.get(remotePeer) - .then(peer => { - for (const protocol of peer.protocols) { - const topologies = this.topologies.get(protocol) - - if (topologies == null) { - // no topologies are interested in this protocol - continue - } - - for (const topology of topologies.values()) { - topology.onDisconnect?.(remotePeer) - } - } - }) - .catch(err => { - if (err.code === codes.ERR_NOT_FOUND) { - // peer has not completed identify so they are not in the peer store - return - } - - this.log.error('could not inform topologies of disconnecting peer %p', remotePeer, err) - }) - } - - /** - * When a peer is updated, if they have removed supported protocols notify any - * topologies interested in the removed protocols. - */ - _onPeerUpdate (evt: CustomEvent): void { - const { peer, previous } = evt.detail - const removed = (previous?.protocols ?? []).filter(protocol => !peer.protocols.includes(protocol)) - - for (const protocol of removed) { - const topologies = this.topologies.get(protocol) - - if (topologies == null) { - // no topologies are interested in this protocol - continue - } - - for (const topology of topologies.values()) { - topology.onDisconnect?.(peer.id) - } - } - } - - /** - * After identify has completed and we have received the list of supported - * protocols, notify any topologies interested in those protocols. - */ - _onPeerIdentify (evt: CustomEvent): void { - const protocols = evt.detail.protocols - const connection = evt.detail.connection - const peerId = evt.detail.peerId - - for (const protocol of protocols) { - const topologies = this.topologies.get(protocol) - - if (topologies == null) { - // no topologies are interested in this protocol - continue - } - - for (const topology of topologies.values()) { - if (connection.transient && topology.notifyOnTransient !== true) { - continue - } - - topology.onConnect?.(peerId, connection) - } - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/transport-manager.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/transport-manager.ts deleted file mode 100644 index a9b47d5cc..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/transport-manager.ts +++ /dev/null @@ -1,300 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { trackedMap } from '@libp2p/interface/metrics/tracked-map' -import { FaultTolerance } from '@libp2p/interface/transport' -import { codes } from './errors.js' -import type { Libp2pEvents, AbortOptions, ComponentLogger, Logger } from '@libp2p/interface' -import type { Connection } from '@libp2p/interface/connection' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { Metrics } from '@libp2p/interface/metrics' -import type { Startable } from '@libp2p/interface/startable' -import type { Listener, Transport, Upgrader } from '@libp2p/interface/transport' -import type { AddressManager } from '@libp2p/interface-internal/address-manager' -import type { TransportManager } from '@libp2p/interface-internal/transport-manager' -import type { Multiaddr } from '@multiformats/multiaddr' - -export interface TransportManagerInit { - faultTolerance?: FaultTolerance -} - -export interface DefaultTransportManagerComponents { - metrics?: Metrics - addressManager: AddressManager - upgrader: Upgrader - events: TypedEventTarget - logger: ComponentLogger -} - -export class DefaultTransportManager implements TransportManager, Startable { - private readonly log: Logger - private readonly components: DefaultTransportManagerComponents - private readonly transports: Map - private readonly listeners: Map - private readonly faultTolerance: FaultTolerance - private started: boolean - - constructor (components: DefaultTransportManagerComponents, init: TransportManagerInit = {}) { - this.log = components.logger.forComponent('libp2p:transports') - this.components = components - this.started = false - this.transports = new Map() - this.listeners = trackedMap({ - name: 'libp2p_transport_manager_listeners', - metrics: this.components.metrics - }) - this.faultTolerance = init.faultTolerance ?? FaultTolerance.FATAL_ALL - } - - /** - * Adds a `Transport` to the manager - */ - add (transport: Transport): void { - const tag = transport[Symbol.toStringTag] - - if (tag == null) { - throw new CodeError('Transport must have a valid tag', codes.ERR_INVALID_KEY) - } - - if (this.transports.has(tag)) { - throw new CodeError(`There is already a transport with the tag ${tag}`, codes.ERR_DUPLICATE_TRANSPORT) - } - - this.log('adding transport %s', tag) - - this.transports.set(tag, transport) - - if (!this.listeners.has(tag)) { - this.listeners.set(tag, []) - } - } - - isStarted (): boolean { - return this.started - } - - start (): void { - this.started = true - } - - async afterStart (): Promise { - // Listen on the provided transports for the provided addresses - const addrs = this.components.addressManager.getListenAddrs() - - await this.listen(addrs) - } - - /** - * Stops all listeners - */ - async stop (): Promise { - const tasks = [] - for (const [key, listeners] of this.listeners) { - this.log('closing listeners for %s', key) - while (listeners.length > 0) { - const listener = listeners.pop() - - if (listener == null) { - continue - } - - tasks.push(listener.close()) - } - } - - await Promise.all(tasks) - this.log('all listeners closed') - for (const key of this.listeners.keys()) { - this.listeners.set(key, []) - } - - this.started = false - } - - /** - * Dials the given Multiaddr over it's supported transport - */ - async dial (ma: Multiaddr, options?: AbortOptions): Promise { - const transport = this.transportForMultiaddr(ma) - - if (transport == null) { - throw new CodeError(`No transport available for address ${String(ma)}`, codes.ERR_TRANSPORT_UNAVAILABLE) - } - - try { - return await transport.dial(ma, { - ...options, - upgrader: this.components.upgrader - }) - } catch (err: any) { - if (err.code == null) { - err.code = codes.ERR_TRANSPORT_DIAL_FAILED - } - - throw err - } - } - - /** - * Returns all Multiaddr's the listeners are using - */ - getAddrs (): Multiaddr[] { - let addrs: Multiaddr[] = [] - for (const listeners of this.listeners.values()) { - for (const listener of listeners) { - addrs = [...addrs, ...listener.getAddrs()] - } - } - return addrs - } - - /** - * Returns all the transports instances - */ - getTransports (): Transport[] { - return Array.of(...this.transports.values()) - } - - /** - * Returns all the listener instances - */ - getListeners (): Listener[] { - return Array.of(...this.listeners.values()).flat() - } - - /** - * Finds a transport that matches the given Multiaddr - */ - transportForMultiaddr (ma: Multiaddr): Transport | undefined { - for (const transport of this.transports.values()) { - const addrs = transport.filter([ma]) - - if (addrs.length > 0) { - return transport - } - } - } - - /** - * Starts listeners for each listen Multiaddr - */ - async listen (addrs: Multiaddr[]): Promise { - if (!this.isStarted()) { - throw new CodeError('Not started', codes.ERR_NODE_NOT_STARTED) - } - - if (addrs == null || addrs.length === 0) { - this.log('no addresses were provided for listening, this node is dial only') - return - } - - const couldNotListen = [] - - for (const [key, transport] of this.transports.entries()) { - const supportedAddrs = transport.filter(addrs) - const tasks = [] - - // For each supported multiaddr, create a listener - for (const addr of supportedAddrs) { - this.log('creating listener for %s on %a', key, addr) - const listener = transport.createListener({ - upgrader: this.components.upgrader - }) - - let listeners: Listener[] = this.listeners.get(key) ?? [] - - if (listeners == null) { - listeners = [] - this.listeners.set(key, listeners) - } - - listeners.push(listener) - - // Track listen/close events - listener.addEventListener('listening', () => { - this.components.events.safeDispatchEvent('transport:listening', { - detail: listener - }) - }) - listener.addEventListener('close', () => { - const index = listeners.findIndex(l => l === listener) - - // remove the listener - listeners.splice(index, 1) - - this.components.events.safeDispatchEvent('transport:close', { - detail: listener - }) - }) - - // We need to attempt to listen on everything - tasks.push(listener.listen(addr)) - } - - // Keep track of transports we had no addresses for - if (tasks.length === 0) { - couldNotListen.push(key) - continue - } - - const results = await Promise.allSettled(tasks) - // If we are listening on at least 1 address, succeed. - // TODO: we should look at adding a retry (`p-retry`) here to better support - // listening on remote addresses as they may be offline. We could then potentially - // just wait for any (`p-any`) listener to succeed on each transport before returning - const isListening = results.find(r => r.status === 'fulfilled') - if ((isListening == null) && this.faultTolerance !== FaultTolerance.NO_FATAL) { - throw new CodeError(`Transport (${key}) could not listen on any available address`, codes.ERR_NO_VALID_ADDRESSES) - } - } - - // If no transports were able to listen, throw an error. This likely - // means we were given addresses we do not have transports for - if (couldNotListen.length === this.transports.size) { - const message = `no valid addresses were provided for transports [${couldNotListen.join(', ')}]` - if (this.faultTolerance === FaultTolerance.FATAL_ALL) { - throw new CodeError(message, codes.ERR_NO_VALID_ADDRESSES) - } - this.log(`libp2p in dial mode only: ${message}`) - } - } - - /** - * Removes the given transport from the manager. - * If a transport has any running listeners, they will be closed. - */ - async remove (key: string): Promise { - const listeners = this.listeners.get(key) ?? [] - this.log.trace('removing transport %s', key) - - // Close any running listeners - const tasks = [] - this.log.trace('closing listeners for %s', key) - while (listeners.length > 0) { - const listener = listeners.pop() - - if (listener == null) { - continue - } - - tasks.push(listener.close()) - } - await Promise.all(tasks) - - this.transports.delete(key) - this.listeners.delete(key) - } - - /** - * Removes all transports from the manager. - * If any listeners are running, they will be closed. - * - * @async - */ - async removeAll (): Promise { - const tasks = [] - for (const key of this.transports.keys()) { - tasks.push(this.remove(key)) - } - - await Promise.all(tasks) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/upgrader.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/upgrader.ts deleted file mode 100644 index 4310f07c7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/upgrader.ts +++ /dev/null @@ -1,744 +0,0 @@ -import { CodeError, ERR_TIMEOUT } from '@libp2p/interface/errors' -import { setMaxListeners } from '@libp2p/interface/events' -import * as mss from '@libp2p/multistream-select' -import { peerIdFromString } from '@libp2p/peer-id' -import { createConnection } from './connection/index.js' -import { INBOUND_UPGRADE_TIMEOUT } from './connection-manager/constants.js' -import { codes } from './errors.js' -import { DEFAULT_MAX_INBOUND_STREAMS, DEFAULT_MAX_OUTBOUND_STREAMS } from './registrar.js' -import type { Libp2pEvents, AbortOptions, ComponentLogger, Logger } from '@libp2p/interface' -import type { MultiaddrConnection, Connection, Stream, ConnectionProtector, NewStreamOptions } from '@libp2p/interface/connection' -import type { ConnectionEncrypter, SecuredConnection } from '@libp2p/interface/connection-encrypter' -import type { ConnectionGater } from '@libp2p/interface/connection-gater' -import type { TypedEventTarget } from '@libp2p/interface/events' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { PeerStore } from '@libp2p/interface/peer-store' -import type { StreamMuxer, StreamMuxerFactory } from '@libp2p/interface/stream-muxer' -import type { Upgrader, UpgraderOptions } from '@libp2p/interface/transport' -import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager' -import type { Registrar } from '@libp2p/interface-internal/registrar' - -const DEFAULT_PROTOCOL_SELECT_TIMEOUT = 30000 - -interface CreateConnectionOptions { - cryptoProtocol: string - direction: 'inbound' | 'outbound' - maConn: MultiaddrConnection - upgradedConn: MultiaddrConnection - remotePeer: PeerId - muxerFactory?: StreamMuxerFactory - transient?: boolean -} - -interface OnStreamOptions { - connection: Connection - stream: Stream - protocol: string -} - -export interface CryptoResult extends SecuredConnection { - protocol: string -} - -export interface UpgraderInit { - connectionEncryption: ConnectionEncrypter[] - muxers: StreamMuxerFactory[] - - /** - * An amount of ms by which an inbound connection upgrade - * must complete - */ - inboundUpgradeTimeout?: number -} - -function findIncomingStreamLimit (protocol: string, registrar: Registrar): number | undefined { - try { - const { options } = registrar.getHandler(protocol) - - return options.maxInboundStreams - } catch (err: any) { - if (err.code !== codes.ERR_NO_HANDLER_FOR_PROTOCOL) { - throw err - } - } - - return DEFAULT_MAX_INBOUND_STREAMS -} - -function findOutgoingStreamLimit (protocol: string, registrar: Registrar, options: NewStreamOptions = {}): number { - try { - const { options } = registrar.getHandler(protocol) - - if (options.maxOutboundStreams != null) { - return options.maxOutboundStreams - } - } catch (err: any) { - if (err.code !== codes.ERR_NO_HANDLER_FOR_PROTOCOL) { - throw err - } - } - - return options.maxOutboundStreams ?? DEFAULT_MAX_OUTBOUND_STREAMS -} - -function countStreams (protocol: string, direction: 'inbound' | 'outbound', connection: Connection): number { - let streamCount = 0 - - connection.streams.forEach(stream => { - if (stream.direction === direction && stream.protocol === protocol) { - streamCount++ - } - }) - - return streamCount -} - -export interface DefaultUpgraderComponents { - peerId: PeerId - metrics?: Metrics - connectionManager: ConnectionManager - connectionGater: ConnectionGater - connectionProtector?: ConnectionProtector - registrar: Registrar - peerStore: PeerStore - events: TypedEventTarget - logger: ComponentLogger -} - -type ConnectionDeniedType = keyof Pick - -export class DefaultUpgrader implements Upgrader { - private readonly components: DefaultUpgraderComponents - private readonly connectionEncryption: Map - private readonly muxers: Map - private readonly inboundUpgradeTimeout: number - private readonly events: TypedEventTarget - private readonly log: Logger - - constructor (components: DefaultUpgraderComponents, init: UpgraderInit) { - this.components = components - this.connectionEncryption = new Map() - this.log = components.logger.forComponent('libp2p:upgrader') - - init.connectionEncryption.forEach(encrypter => { - this.connectionEncryption.set(encrypter.protocol, encrypter) - }) - - this.muxers = new Map() - - init.muxers.forEach(muxer => { - this.muxers.set(muxer.protocol, muxer) - }) - - this.inboundUpgradeTimeout = init.inboundUpgradeTimeout ?? INBOUND_UPGRADE_TIMEOUT - this.events = components.events - } - - async shouldBlockConnection (remotePeer: PeerId, maConn: MultiaddrConnection, connectionType: ConnectionDeniedType): Promise { - const connectionGater = this.components.connectionGater[connectionType] - - if (connectionGater !== undefined) { - if (await connectionGater(remotePeer, maConn)) { - throw new CodeError(`The multiaddr connection is blocked by gater.${connectionType}`, codes.ERR_CONNECTION_INTERCEPTED) - } - } - } - - /** - * Upgrades an inbound connection - */ - async upgradeInbound (maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise { - const accept = await this.components.connectionManager.acceptIncomingConnection(maConn) - - if (!accept) { - throw new CodeError('connection denied', codes.ERR_CONNECTION_DENIED) - } - - let encryptedConn: MultiaddrConnection - let remotePeer - let upgradedConn: MultiaddrConnection - let muxerFactory: StreamMuxerFactory | undefined - let cryptoProtocol - - const signal = AbortSignal.timeout(this.inboundUpgradeTimeout) - - const onAbort = (): void => { - maConn.abort(new CodeError('inbound upgrade timeout', ERR_TIMEOUT)) - } - - signal.addEventListener('abort', onAbort, { once: true }) - - setMaxListeners(Infinity, signal) - - try { - if ((await this.components.connectionGater.denyInboundConnection?.(maConn)) === true) { - throw new CodeError('The multiaddr connection is blocked by gater.acceptConnection', codes.ERR_CONNECTION_INTERCEPTED) - } - - this.components.metrics?.trackMultiaddrConnection(maConn) - - this.log('starting the inbound connection upgrade') - - // Protect - let protectedConn = maConn - - if (opts?.skipProtection !== true) { - const protector = this.components.connectionProtector - - if (protector != null) { - this.log('protecting the inbound connection') - protectedConn = await protector.protect(maConn) - } - } - - try { - // Encrypt the connection - encryptedConn = protectedConn - if (opts?.skipEncryption !== true) { - ({ - conn: encryptedConn, - remotePeer, - protocol: cryptoProtocol - } = await this._encryptInbound(protectedConn)) - - const maConn: MultiaddrConnection = { - ...protectedConn, - ...encryptedConn - } - - await this.shouldBlockConnection(remotePeer, maConn, 'denyInboundEncryptedConnection') - } else { - const idStr = maConn.remoteAddr.getPeerId() - - if (idStr == null) { - throw new CodeError('inbound connection that skipped encryption must have a peer id', codes.ERR_INVALID_MULTIADDR) - } - - const remotePeerId = peerIdFromString(idStr) - - cryptoProtocol = 'native' - remotePeer = remotePeerId - } - - upgradedConn = encryptedConn - if (opts?.muxerFactory != null) { - muxerFactory = opts.muxerFactory - } else if (this.muxers.size > 0) { - // Multiplex the connection - const multiplexed = await this._multiplexInbound({ - ...protectedConn, - ...encryptedConn - }, this.muxers) - muxerFactory = multiplexed.muxerFactory - upgradedConn = multiplexed.stream - } - } catch (err: any) { - this.log.error('Failed to upgrade inbound connection', err) - throw err - } - - await this.shouldBlockConnection(remotePeer, maConn, 'denyInboundUpgradedConnection') - - this.log('successfully upgraded inbound connection') - - return this._createConnection({ - cryptoProtocol, - direction: 'inbound', - maConn, - upgradedConn, - muxerFactory, - remotePeer, - transient: opts?.transient - }) - } finally { - signal.removeEventListener('abort', onAbort) - - this.components.connectionManager.afterUpgradeInbound() - } - } - - /** - * Upgrades an outbound connection - */ - async upgradeOutbound (maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise { - const idStr = maConn.remoteAddr.getPeerId() - let remotePeerId: PeerId | undefined - - if (idStr != null) { - remotePeerId = peerIdFromString(idStr) - - await this.shouldBlockConnection(remotePeerId, maConn, 'denyOutboundConnection') - } - - let encryptedConn: MultiaddrConnection - let remotePeer: PeerId - let upgradedConn: MultiaddrConnection - let cryptoProtocol - let muxerFactory - - this.components.metrics?.trackMultiaddrConnection(maConn) - - this.log('Starting the outbound connection upgrade') - - // If the transport natively supports encryption, skip connection - // protector and encryption - - // Protect - let protectedConn = maConn - if (opts?.skipProtection !== true) { - const protector = this.components.connectionProtector - - if (protector != null) { - protectedConn = await protector.protect(maConn) - } - } - - try { - // Encrypt the connection - encryptedConn = protectedConn - if (opts?.skipEncryption !== true) { - ({ - conn: encryptedConn, - remotePeer, - protocol: cryptoProtocol - } = await this._encryptOutbound(protectedConn, remotePeerId)) - - const maConn: MultiaddrConnection = { - ...protectedConn, - ...encryptedConn - } - - await this.shouldBlockConnection(remotePeer, maConn, 'denyOutboundEncryptedConnection') - } else { - if (remotePeerId == null) { - throw new CodeError('Encryption was skipped but no peer id was passed', codes.ERR_INVALID_PEER) - } - - cryptoProtocol = 'native' - remotePeer = remotePeerId - } - - upgradedConn = encryptedConn - if (opts?.muxerFactory != null) { - muxerFactory = opts.muxerFactory - } else if (this.muxers.size > 0) { - // Multiplex the connection - const multiplexed = await this._multiplexOutbound({ - ...protectedConn, - ...encryptedConn - }, this.muxers) - muxerFactory = multiplexed.muxerFactory - upgradedConn = multiplexed.stream - } - } catch (err: any) { - this.log.error('Failed to upgrade outbound connection', err) - await maConn.close(err) - throw err - } - - await this.shouldBlockConnection(remotePeer, maConn, 'denyOutboundUpgradedConnection') - - this.log('Successfully upgraded outbound connection') - - return this._createConnection({ - cryptoProtocol, - direction: 'outbound', - maConn, - upgradedConn, - muxerFactory, - remotePeer, - transient: opts?.transient - }) - } - - /** - * A convenience method for generating a new `Connection` - */ - _createConnection (opts: CreateConnectionOptions): Connection { - const { - cryptoProtocol, - direction, - maConn, - upgradedConn, - remotePeer, - muxerFactory, - transient - } = opts - - let muxer: StreamMuxer | undefined - let newStream: ((multicodecs: string[], options?: AbortOptions) => Promise) | undefined - let connection: Connection // eslint-disable-line prefer-const - - if (muxerFactory != null) { - // Create the muxer - muxer = muxerFactory.createStreamMuxer({ - direction, - // Run anytime a remote stream is created - onIncomingStream: muxedStream => { - if (connection == null) { - return - } - - void Promise.resolve() - .then(async () => { - const protocols = this.components.registrar.getProtocols() - const { stream, protocol } = await mss.handle(muxedStream, protocols, { - log: muxedStream.log, - yieldBytes: false - }) - - if (connection == null) { - return - } - - connection.log('incoming stream opened on %s', protocol) - - const incomingLimit = findIncomingStreamLimit(protocol, this.components.registrar) - const streamCount = countStreams(protocol, 'inbound', connection) - - if (streamCount === incomingLimit) { - const err = new CodeError(`Too many inbound protocol streams for protocol "${protocol}" - limit ${incomingLimit}`, codes.ERR_TOO_MANY_INBOUND_PROTOCOL_STREAMS) - muxedStream.abort(err) - - throw err - } - - // after the handshake the returned stream can have early data so override - // the souce/sink - muxedStream.source = stream.source - muxedStream.sink = stream.sink - muxedStream.protocol = protocol - - // allow closing the write end of a not-yet-negotiated stream - if (stream.closeWrite != null) { - muxedStream.closeWrite = stream.closeWrite - } - - // allow closing the read end of a not-yet-negotiated stream - if (stream.closeRead != null) { - muxedStream.closeRead = stream.closeRead - } - - // make sure we don't try to negotiate a stream we are closing - if (stream.close != null) { - muxedStream.close = stream.close - } - - // If a protocol stream has been successfully negotiated and is to be passed to the application, - // the peerstore should ensure that the peer is registered with that protocol - await this.components.peerStore.merge(remotePeer, { - protocols: [protocol] - }) - - this.components.metrics?.trackProtocolStream(muxedStream, connection) - - this._onStream({ connection, stream: muxedStream, protocol }) - }) - .catch(async err => { - this.log.error('error handling incoming stream id %s', muxedStream.id, err.message, err.code, err.stack) - - if (muxedStream.timeline.close == null) { - await muxedStream.close() - } - }) - } - }) - - newStream = async (protocols: string[], options: NewStreamOptions = {}): Promise => { - if (muxer == null) { - throw new CodeError('Stream is not multiplexed', codes.ERR_MUXER_UNAVAILABLE) - } - - connection.log('starting new stream for protocols %s', protocols) - const muxedStream = await muxer.newStream() - connection.log.trace('started new stream %s for protocols %s', muxedStream.id, protocols) - - try { - if (options.signal == null) { - this.log('No abort signal was passed while trying to negotiate protocols %s falling back to default timeout', protocols) - - const signal = AbortSignal.timeout(DEFAULT_PROTOCOL_SELECT_TIMEOUT) - setMaxListeners(Infinity, signal) - - options = { - ...options, - signal - } - } - - muxedStream.log.trace('selecting protocol from protocols %s', protocols) - - const { - stream, - protocol - } = await mss.select(muxedStream, protocols, { - ...options, - log: muxedStream.log, - yieldBytes: true - }) - - muxedStream.log('selected protocol %s', protocol) - - const outgoingLimit = findOutgoingStreamLimit(protocol, this.components.registrar, options) - const streamCount = countStreams(protocol, 'outbound', connection) - - if (streamCount >= outgoingLimit) { - const err = new CodeError(`Too many outbound protocol streams for protocol "${protocol}" - limit ${outgoingLimit}`, codes.ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS) - muxedStream.abort(err) - - throw err - } - - // If a protocol stream has been successfully negotiated and is to be passed to the application, - // the peerstore should ensure that the peer is registered with that protocol - await this.components.peerStore.merge(remotePeer, { - protocols: [protocol] - }) - - // after the handshake the returned stream can have early data so override - // the souce/sink - muxedStream.source = stream.source - muxedStream.sink = stream.sink - muxedStream.protocol = protocol - - // allow closing the write end of a not-yet-negotiated stream - if (stream.closeWrite != null) { - muxedStream.closeWrite = stream.closeWrite - } - - // allow closing the read end of a not-yet-negotiated stream - if (stream.closeRead != null) { - muxedStream.closeRead = stream.closeRead - } - - // make sure we don't try to negotiate a stream we are closing - if (stream.close != null) { - muxedStream.close = stream.close - } - - this.components.metrics?.trackProtocolStream(muxedStream, connection) - - return muxedStream - } catch (err: any) { - connection.log.error('could not create new stream for protocols %s', protocols, err) - - if (muxedStream.timeline.close == null) { - muxedStream.abort(err) - } - - if (err.code != null) { - throw err - } - - throw new CodeError(String(err), codes.ERR_UNSUPPORTED_PROTOCOL) - } - } - - // Pipe all data through the muxer - void Promise.all([ - muxer.sink(upgradedConn.source), - upgradedConn.sink(muxer.source) - ]).catch(err => { - this.log.error(err) - }) - } - - const _timeline = maConn.timeline - maConn.timeline = new Proxy(_timeline, { - set: (...args) => { - if (connection != null && args[1] === 'close' && args[2] != null && _timeline.close == null) { - // Wait for close to finish before notifying of the closure - (async () => { - try { - if (connection.status === 'open') { - await connection.close() - } - } catch (err: any) { - this.log.error(err) - } finally { - this.events.safeDispatchEvent('connection:close', { - detail: connection - }) - } - })().catch(err => { - this.log.error(err) - }) - } - - return Reflect.set(...args) - } - }) - maConn.timeline.upgraded = Date.now() - - const errConnectionNotMultiplexed = (): any => { - throw new CodeError('connection is not multiplexed', codes.ERR_CONNECTION_NOT_MULTIPLEXED) - } - - // Create the connection - connection = createConnection({ - remoteAddr: maConn.remoteAddr, - remotePeer, - status: 'open', - direction, - timeline: maConn.timeline, - multiplexer: muxer?.protocol, - encryption: cryptoProtocol, - transient, - logger: this.components.logger, - newStream: newStream ?? errConnectionNotMultiplexed, - getStreams: () => { if (muxer != null) { return muxer.streams } else { return [] } }, - close: async (options?: AbortOptions) => { - // Ensure remaining streams are closed gracefully - if (muxer != null) { - this.log.trace('close muxer') - await muxer.close(options) - } - - this.log.trace('close maconn') - // close the underlying transport - await maConn.close(options) - this.log.trace('closed maconn') - }, - abort: (err) => { - maConn.abort(err) - // Ensure remaining streams are aborted - if (muxer != null) { - muxer.abort(err) - } - } - }) - - this.events.safeDispatchEvent('connection:open', { - detail: connection - }) - - return connection - } - - /** - * Routes incoming streams to the correct handler - */ - _onStream (opts: OnStreamOptions): void { - const { connection, stream, protocol } = opts - const { handler, options } = this.components.registrar.getHandler(protocol) - - if (connection.transient && options.runOnTransientConnection !== true) { - throw new CodeError('Cannot open protocol stream on transient connection', 'ERR_TRANSIENT_CONNECTION') - } - - handler({ connection, stream }) - } - - /** - * Attempts to encrypt the incoming `connection` with the provided `cryptos` - */ - async _encryptInbound (connection: MultiaddrConnection): Promise { - const protocols = Array.from(this.connectionEncryption.keys()) - this.log('handling inbound crypto protocol selection', protocols) - - try { - const { stream, protocol } = await mss.handle(connection, protocols, { - log: connection.log - }) - const encrypter = this.connectionEncryption.get(protocol) - - if (encrypter == null) { - throw new Error(`no crypto module found for ${protocol}`) - } - - this.log('encrypting inbound connection using', protocol) - - return { - ...await encrypter.secureInbound(this.components.peerId, stream), - protocol - } - } catch (err: any) { - throw new CodeError(String(err), codes.ERR_ENCRYPTION_FAILED) - } - } - - /** - * Attempts to encrypt the given `connection` with the provided connection encrypters. - * The first `ConnectionEncrypter` module to succeed will be used - */ - async _encryptOutbound (connection: MultiaddrConnection, remotePeerId?: PeerId): Promise { - const protocols = Array.from(this.connectionEncryption.keys()) - this.log('selecting outbound crypto protocol', protocols) - - try { - connection.log.trace('selecting encrypter from %s', protocols) - - const { - stream, - protocol - } = await mss.select(connection, protocols, { - log: connection.log, - yieldBytes: true - }) - - const encrypter = this.connectionEncryption.get(protocol) - - if (encrypter == null) { - throw new Error(`no crypto module found for ${protocol}`) - } - - connection.log('encrypting outbound connection to %p using %p', remotePeerId) - - return { - ...await encrypter.secureOutbound(this.components.peerId, stream, remotePeerId), - protocol - } - } catch (err: any) { - throw new CodeError(String(err), codes.ERR_ENCRYPTION_FAILED) - } - } - - /** - * Selects one of the given muxers via multistream-select. That - * muxer will be used for all future streams on the connection. - */ - async _multiplexOutbound (connection: MultiaddrConnection, muxers: Map): Promise<{ stream: MultiaddrConnection, muxerFactory?: StreamMuxerFactory }> { - const protocols = Array.from(muxers.keys()) - this.log('outbound selecting muxer %s', protocols) - try { - connection.log.trace('selecting stream muxer from %s', protocols) - - const { - stream, - protocol - } = await mss.select(connection, protocols, { - log: connection.log, - yieldBytes: true - }) - - connection.log('selected %s as muxer protocol', protocol) - const muxerFactory = muxers.get(protocol) - - return { stream, muxerFactory } - } catch (err: any) { - connection.log.error('error multiplexing outbound stream', err) - throw new CodeError(String(err), codes.ERR_MUXER_UNAVAILABLE) - } - } - - /** - * Registers support for one of the given muxers via multistream-select. The - * selected muxer will be used for all future streams on the connection. - */ - async _multiplexInbound (connection: MultiaddrConnection, muxers: Map): Promise<{ stream: MultiaddrConnection, muxerFactory?: StreamMuxerFactory }> { - const protocols = Array.from(muxers.keys()) - this.log('inbound handling muxers %s', protocols) - try { - const { stream, protocol } = await mss.handle(connection, protocols, { - log: connection.log - }) - const muxerFactory = muxers.get(protocol) - - return { stream, muxerFactory } - } catch (err: any) { - this.log.error('error multiplexing inbound stream', err) - throw new CodeError(String(err), codes.ERR_MUXER_UNAVAILABLE) - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/version.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/version.ts deleted file mode 100644 index 36a3d88e7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/libp2p/src/version.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const version = '0.0.0' -export const name = 'libp2p' diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/index.min.js deleted file mode 100644 index 0beb5085b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/index.min.js +++ /dev/null @@ -1,51 +0,0 @@ -(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.ChainsafeLibp2PNoise = factory()}(typeof self !== 'undefined' ? self : this, function () { -"use strict";var ChainsafeLibp2PNoise=(()=>{var xu=Object.create;var On=Object.defineProperty;var mu=Object.getOwnPropertyDescriptor;var bu=Object.getOwnPropertyNames;var vu=Object.getPrototypeOf,wu=Object.prototype.hasOwnProperty;var ht=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),_t=(t,e)=>{for(var r in e)On(t,r,{get:e[r],enumerable:!0})},ha=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of bu(e))!wu.call(t,i)&&i!==r&&On(t,i,{get:()=>e[i],enumerable:!(n=mu(e,i))||n.enumerable});return t};var zt=(t,e,r)=>(r=t!=null?xu(vu(t)):{},ha(e||!t||!t.__esModule?On(r,"default",{value:t,enumerable:!0}):r,t)),Eu=t=>ha(On({},"__esModule",{value:!0}),t);var xa=ht((og,ga)=>{"use strict";function ya(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function Lu(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return ya(t,r)}catch{r.message=t.message,r.stack=t.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(t)),ya(new i,r)}}ga.exports=Lu});var lt=ht((h2,m0)=>{m0.exports={options:{usePureJavaScript:!1}}});var w0=ht((l2,v0)=>{var ks={};v0.exports=ks;var b0={};ks.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=il(t,e);else{var i=0,s=e.length,o=e.charAt(0),a=[0];for(i=0;i0;)a.push(f%s),f=f/s|0}for(i=0;t[i]===0&&i=0;--i)n+=e[a[i]]}if(r){var u=new RegExp(".{1,"+r+"}","g");n=n.match(u).join(`\r -`)}return n};ks.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=b0[e];if(!r){r=b0[e]=[];for(var n=0;n>=8;for(;f>0;)o.push(f&255),f>>=8}for(var u=0;t[u]===s&&u0;)s.push(a%n),a=a/n|0}var c="";for(r=0;t.at(r)===0&&r=0;--r)c+=e[s[r]];return c}});var Bt=ht((d2,A0)=>{var E0=lt(),S0=w0(),b=A0.exports=E0.util=E0.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){b.nextTick=process.nextTick,typeof setImmediate=="function"?b.setImmediate=setImmediate:b.setImmediate=b.nextTick;return}if(typeof setImmediate=="function"){b.setImmediate=function(){return setImmediate.apply(void 0,arguments)},b.nextTick=function(a){return setImmediate(a)};return}if(b.setImmediate=function(a){setTimeout(a,0)},typeof window<"u"&&typeof window.postMessage=="function"){let a=function(c){if(c.source===window&&c.data===t){c.stopPropagation();var f=e.slice();e.length=0,f.forEach(function(u){u()})}};var o=a,t="forge.setImmediate",e=[];b.setImmediate=function(c){e.push(c),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",a,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,i=document.createElement("div"),e=[];new MutationObserver(function(){var c=e.slice();e.length=0,c.forEach(function(f){f()})}).observe(i,{attributes:!0});var s=b.setImmediate;b.setImmediate=function(c){Date.now()-r>15?(r=Date.now(),s(c)):(e.push(c),e.length===1&&i.setAttribute("a",n=!n))}}b.nextTick=b.setImmediate})();b.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;b.globalScope=function(){return b.isNodejs?globalThis:typeof self>"u"?window:self}();b.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};b.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};b.isArrayBufferView=function(t){return t&&b.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function yn(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}b.ByteBuffer=Ps;function Ps(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(b.isArrayBuffer(t)||b.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;rsl&&(this.data.substr(0,1),this._constructedStringLength=0)};b.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};b.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};b.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};b.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};b.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};b.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(b.encodeUtf8(t))};b.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};b.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};b.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};b.ByteStringBuffer.prototype.putInt=function(t,e){yn(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};b.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};b.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};b.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};b.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};b.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};b.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};b.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};b.ByteStringBuffer.prototype.copy=function(){var t=b.createBuffer(this.data);return t.read=this.read,t};b.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};b.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};b.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};b.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};b.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};b.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};b.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};b.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};b.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};b.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};b.DataBuffer.prototype.putInt=function(t,e){yn(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};b.DataBuffer.prototype.putSignedInt=function(t,e){return yn(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};b.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};b.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};b.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};b.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};b.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};b.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};b.DataBuffer.prototype.copy=function(){return new b.DataBuffer(this)};b.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};b.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};b.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};b.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};b.xorBytes=function(t,e,r){for(var n="",i="",s="",o=0,a=0;r>0;--r,++o)i=t.charCodeAt(o)^e.charCodeAt(o),a>=10&&(n+=s,s="",a=0),s+=String.fromCharCode(i),++a;return n+=s,n};b.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var $e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",We=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],B0="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";b.encode64=function(t,e){for(var r="",n="",i,s,o,a=0;a>2),r+=$e.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=$e.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":$e.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};b.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,i,s,o=0;o>4),i!==64&&(e+=String.fromCharCode((n&15)<<4|i>>2),s!==64&&(e+=String.fromCharCode((i&3)<<6|s)));return e};b.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};b.decodeUtf8=function(t){return decodeURIComponent(escape(t))};b.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:S0.encode,decode:S0.decode}};b.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};b.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s>2),r+=$e.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=$e.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":$e.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};b.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,s,o,a,c=0,f=r;c>4,o!==64&&(n[f++]=(s&15)<<4|o>>2,a!==64&&(n[f++]=(o&3)<<6|a));return e?f-r:n.subarray(0,f)};b.binary.base58.encode=function(t,e){return b.binary.baseN.encode(t,B0,e)};b.binary.base58.decode=function(t,e){return b.binary.baseN.decode(t,B0,e)};b.text={utf8:{},utf16:{}};b.text.utf8.encode=function(t,e,r){t=b.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s"u"&&(r=["web","flash"]);var i,s=!1,o=null;for(var a in r){i=r[a];try{if(i==="flash"||i==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),s=i==="flash"}(i==="web"||i==="both")&&(e[0]=localStorage,n=t.apply(this,e),s=!0)}catch(c){o=c}if(s)break}if(!s)throw o;return n};b.setItem=function(t,e,r,n,i){pi(al,arguments,i)};b.getItem=function(t,e,r,n){return pi(cl,arguments,n)};b.removeItem=function(t,e,r,n){pi(fl,arguments,n)};b.clearItems=function(t,e,r){pi(ul,arguments,r)};b.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};b.format=function(t){for(var e=/%./g,r,n,i=0,s=[],o=0;r=e.exec(t);){n=t.substring(o,e.lastIndex-2),n.length>0&&s.push(n),o=e.lastIndex;var a=r[0][1];switch(a){case"s":case"o":i");break;case"%":s.push("%");break;default:s.push("<%"+a+"?>")}}return s.push(t.substring(o)),s.join("")};b.formatNumber=function(t,e,r,n){var i=t,s=isNaN(e=Math.abs(e))?2:e,o=r===void 0?",":r,a=n===void 0?".":n,c=i<0?"-":"",f=parseInt(i=Math.abs(+i||0).toFixed(s),10)+"",u=f.length>3?f.length%3:0;return c+(u?f.substr(0,u)+a:"")+f.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+a)+(s?o+Math.abs(i-f).toFixed(s).slice(2):"")};b.formatSize=function(t){return t>=1073741824?t=b.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=b.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=b.formatNumber(t/1024,0)+" KiB":t=b.formatNumber(t,0)+" bytes",t};b.bytesFromIP=function(t){return t.indexOf(".")!==-1?b.bytesFromIPv4(t):t.indexOf(":")!==-1?b.bytesFromIPv6(t):null};b.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=b.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1))}e.push(s)}if(r.length>0){var c=r[n];c.end-c.start>0&&(e.splice(c.start,c.end-c.start+1,""),c.start===0&&e.unshift(""),c.end===7&&e.push(""))}return e.join(":")};b.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in b&&!t.update)return e(null,b.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return b.cores=navigator.hardwareConcurrency,e(null,b.cores);if(typeof Worker>"u")return b.cores=1,e(null,b.cores);if(typeof Blob>"u")return b.cores=2,e(null,b.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(o){for(var a=Date.now(),c=a+4;Date.now()g.st&&u.stu.st&&g.st{var gn=lt();gn.pki=gn.pki||{};var Os=C0.exports=gn.pki.oids=gn.oids=gn.oids||{};function k(t,e){Os[t]=e,Os[e]=t}function ft(t,e){Os[t]=e}k("1.2.840.113549.1.1.1","rsaEncryption");k("1.2.840.113549.1.1.4","md5WithRSAEncryption");k("1.2.840.113549.1.1.5","sha1WithRSAEncryption");k("1.2.840.113549.1.1.7","RSAES-OAEP");k("1.2.840.113549.1.1.8","mgf1");k("1.2.840.113549.1.1.9","pSpecified");k("1.2.840.113549.1.1.10","RSASSA-PSS");k("1.2.840.113549.1.1.11","sha256WithRSAEncryption");k("1.2.840.113549.1.1.12","sha384WithRSAEncryption");k("1.2.840.113549.1.1.13","sha512WithRSAEncryption");k("1.3.101.112","EdDSA25519");k("1.2.840.10040.4.3","dsa-with-sha1");k("1.3.14.3.2.7","desCBC");k("1.3.14.3.2.26","sha1");k("1.3.14.3.2.29","sha1WithRSASignature");k("2.16.840.1.101.3.4.2.1","sha256");k("2.16.840.1.101.3.4.2.2","sha384");k("2.16.840.1.101.3.4.2.3","sha512");k("2.16.840.1.101.3.4.2.4","sha224");k("2.16.840.1.101.3.4.2.5","sha512-224");k("2.16.840.1.101.3.4.2.6","sha512-256");k("1.2.840.113549.2.2","md2");k("1.2.840.113549.2.5","md5");k("1.2.840.113549.1.7.1","data");k("1.2.840.113549.1.7.2","signedData");k("1.2.840.113549.1.7.3","envelopedData");k("1.2.840.113549.1.7.4","signedAndEnvelopedData");k("1.2.840.113549.1.7.5","digestedData");k("1.2.840.113549.1.7.6","encryptedData");k("1.2.840.113549.1.9.1","emailAddress");k("1.2.840.113549.1.9.2","unstructuredName");k("1.2.840.113549.1.9.3","contentType");k("1.2.840.113549.1.9.4","messageDigest");k("1.2.840.113549.1.9.5","signingTime");k("1.2.840.113549.1.9.6","counterSignature");k("1.2.840.113549.1.9.7","challengePassword");k("1.2.840.113549.1.9.8","unstructuredAddress");k("1.2.840.113549.1.9.14","extensionRequest");k("1.2.840.113549.1.9.20","friendlyName");k("1.2.840.113549.1.9.21","localKeyId");k("1.2.840.113549.1.9.22.1","x509Certificate");k("1.2.840.113549.1.12.10.1.1","keyBag");k("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");k("1.2.840.113549.1.12.10.1.3","certBag");k("1.2.840.113549.1.12.10.1.4","crlBag");k("1.2.840.113549.1.12.10.1.5","secretBag");k("1.2.840.113549.1.12.10.1.6","safeContentsBag");k("1.2.840.113549.1.5.13","pkcs5PBES2");k("1.2.840.113549.1.5.12","pkcs5PBKDF2");k("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");k("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");k("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");k("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");k("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");k("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");k("1.2.840.113549.2.7","hmacWithSHA1");k("1.2.840.113549.2.8","hmacWithSHA224");k("1.2.840.113549.2.9","hmacWithSHA256");k("1.2.840.113549.2.10","hmacWithSHA384");k("1.2.840.113549.2.11","hmacWithSHA512");k("1.2.840.113549.3.7","des-EDE3-CBC");k("2.16.840.1.101.3.4.1.2","aes128-CBC");k("2.16.840.1.101.3.4.1.22","aes192-CBC");k("2.16.840.1.101.3.4.1.42","aes256-CBC");k("2.5.4.3","commonName");k("2.5.4.4","surname");k("2.5.4.5","serialNumber");k("2.5.4.6","countryName");k("2.5.4.7","localityName");k("2.5.4.8","stateOrProvinceName");k("2.5.4.9","streetAddress");k("2.5.4.10","organizationName");k("2.5.4.11","organizationalUnitName");k("2.5.4.12","title");k("2.5.4.13","description");k("2.5.4.15","businessCategory");k("2.5.4.17","postalCode");k("2.5.4.42","givenName");k("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");k("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");k("2.16.840.1.113730.1.1","nsCertType");k("2.16.840.1.113730.1.13","nsComment");ft("2.5.29.1","authorityKeyIdentifier");ft("2.5.29.2","keyAttributes");ft("2.5.29.3","certificatePolicies");ft("2.5.29.4","keyUsageRestriction");ft("2.5.29.5","policyMapping");ft("2.5.29.6","subtreesConstraint");ft("2.5.29.7","subjectAltName");ft("2.5.29.8","issuerAltName");ft("2.5.29.9","subjectDirectoryAttributes");ft("2.5.29.10","basicConstraints");ft("2.5.29.11","nameConstraints");ft("2.5.29.12","policyConstraints");ft("2.5.29.13","basicConstraints");k("2.5.29.14","subjectKeyIdentifier");k("2.5.29.15","keyUsage");ft("2.5.29.16","privateKeyUsagePeriod");k("2.5.29.17","subjectAltName");k("2.5.29.18","issuerAltName");k("2.5.29.19","basicConstraints");ft("2.5.29.20","cRLNumber");ft("2.5.29.21","cRLReason");ft("2.5.29.22","expirationDate");ft("2.5.29.23","instructionCode");ft("2.5.29.24","invalidityDate");ft("2.5.29.25","cRLDistributionPoints");ft("2.5.29.26","issuingDistributionPoint");ft("2.5.29.27","deltaCRLIndicator");ft("2.5.29.28","issuingDistributionPoint");ft("2.5.29.29","certificateIssuer");ft("2.5.29.30","nameConstraints");k("2.5.29.31","cRLDistributionPoints");k("2.5.29.32","certificatePolicies");ft("2.5.29.33","policyMappings");ft("2.5.29.34","policyConstraints");k("2.5.29.35","authorityKeyIdentifier");ft("2.5.29.36","policyConstraints");k("2.5.29.37","extKeyUsage");ft("2.5.29.46","freshestCRL");ft("2.5.29.54","inhibitAnyPolicy");k("1.3.6.1.4.1.11129.2.4.2","timestampList");k("1.3.6.1.5.5.7.1.1","authorityInfoAccess");k("1.3.6.1.5.5.7.3.1","serverAuth");k("1.3.6.1.5.5.7.3.2","clientAuth");k("1.3.6.1.5.5.7.3.3","codeSigning");k("1.3.6.1.5.5.7.3.4","emailProtection");k("1.3.6.1.5.5.7.3.8","timeStamping")});var mn=ht((y2,T0)=>{var xt=lt();Bt();yi();var F=T0.exports=xt.asn1=xt.asn1||{};F.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};F.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};F.create=function(t,e,r,n,i){if(xt.util.isArray(n)){for(var s=[],o=0;oe){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}var hl=function(t,e){var r=t.getByte();if(e--,r!==128){var n,i=r&128;if(!i)n=r;else{var s=r&127;xn(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}};F.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof t=="string"&&(t=xt.util.createBuffer(t));var r=t.length(),n=gi(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=r,i.remaining=t.length(),i}return n};function gi(t,e,r,n){var i;xn(t,e,2);var s=t.getByte();e--;var o=s&192,a=s&31;i=t.length();var c=hl(t,e);if(e-=i-t.length(),c!==void 0&&c>e){if(n.strict){var f=new Error("Too few bytes to read ASN.1 value.");throw f.available=t.length(),f.remaining=e,f.requested=c,f}c=e}var u,h,l=(s&32)===32;if(l)if(u=[],c===void 0)for(;;){if(xn(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}i=t.length(),u.push(gi(t,e,r+1,n)),e-=i-t.length()}else for(;c>0;)i=t.length(),u.push(gi(t,c,r+1,n)),e-=i-t.length(),c-=i-t.length();if(u===void 0&&o===F.Class.UNIVERSAL&&a===F.Type.BITSTRING&&(h=t.bytes(c)),u===void 0&&n.decodeBitStrings&&o===F.Class.UNIVERSAL&&a===F.Type.BITSTRING&&c>1){var g=t.read,d=e,p=0;if(a===F.Type.BITSTRING&&(xn(t,e,1),p=t.getByte(),e--),p===0)try{i=t.length();var y={strict:!0,decodeBitStrings:!0},x=gi(t,e,r+1,y),v=i-t.length();e-=v,a==F.Type.BITSTRING&&v++;var m=x.tagClass;v===c&&(m===F.Class.UNIVERSAL||m===F.Class.CONTEXT_SPECIFIC)&&(u=[x])}catch{}u===void 0&&(t.read=g,e=d)}if(u===void 0){if(c===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=e}if(a===F.Type.BMPSTRING)for(u="";c>0;c-=2)xn(t,e,2),u+=String.fromCharCode(t.getInt16()),e-=2;else u=t.getBytes(c),e-=c}var A=h===void 0?null:{bitStringContents:h};return F.create(o,a,l,u,A)}F.toDer=function(t){var e=xt.util.createBuffer(),r=t.tagClass|t.type,n=xt.util.createBuffer(),i=!1;if("bitStringContents"in t&&(i=!0,t.original&&(i=F.equals(t,t.original))),i)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var s=0;s1&&(t.value.charCodeAt(0)===0&&!(t.value.charCodeAt(1)&128)||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var o=n.length(),a="";do a+=String.fromCharCode(o&255),o=o>>>8;while(o>0);e.putByte(a.length|128);for(var s=a.length-1;s>=0;--s)e.putByte(a.charCodeAt(s))}return e.putBuffer(n),e};F.oidToDer=function(t){var e=t.split("."),r=xt.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,i,s,o,a=2;a>>7,n||(o|=128),i.push(o),n=!1;while(s>0);for(var c=i.length-1;c>=0;--c)r.putByte(i[c])}return r};F.derToOid=function(t){var e;typeof t=="string"&&(t=xt.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;)r=t.getByte(),n=n<<7,r&128?n+=r&127:(e+="."+(n+r),n=0);return e};F.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),s=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=0;if(t.length>11){var c=t.charAt(10),f=10;c!=="+"&&c!=="-"&&(a=parseInt(t.substr(10,2),10),f+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,0),f&&(c=t.charAt(f),c==="+"||c==="-")){var u=parseInt(t.substr(f+1,2),10),h=parseInt(t.substr(f+4,2),10),l=u*60+h;l*=6e4,c==="+"?e.setTime(+e-l):e.setTime(+e+l)}return e};F.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),o=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),c=0,f=0,u=!1;t.charAt(t.length-1)==="Z"&&(u=!0);var h=t.length-5,l=t.charAt(h);if(l==="+"||l==="-"){var g=parseInt(t.substr(h+1,2),10),d=parseInt(t.substr(h+4,2),10);f=g*60+d,f*=6e4,l==="+"&&(f*=-1),u=!0}return t.charAt(14)==="."&&(c=parseFloat(t.substr(14),10)*1e3),u?(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,c),e.setTime(+e+f)):(e.setFullYear(r,n,i),e.setHours(s,o,a,c)),e};F.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};F.derToInteger=function(t){typeof t=="string"&&(t=xt.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};F.validate=function(t,e,r,n){var i=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(i=!0,e.value&&xt.util.isArray(e.value))for(var s=0,o=0;i&&o0&&(n+=` -`);for(var i="",s=0;s1?n+="0x"+xt.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var f=t.value.charCodeAt(0);f==1?n+=" (1 unused bit shown)":f>1&&(n+=" ("+f+" unused bits shown)")}}else if(t.type===F.Type.OCTETSTRING)I0.test(t.value)||(n+="("+t.value+") "),n+="0x"+xt.util.bytesToHex(t.value);else if(t.type===F.Type.UTF8)try{n+=xt.util.decodeUtf8(t.value)}catch(u){if(u.message==="URI malformed")n+="0x"+xt.util.bytesToHex(t.value)+" (malformed UTF8)";else throw u}else t.type===F.Type.PRINTABLESTRING||t.type===F.Type.IA5String?n+=t.value:I0.test(t.value)?n+="0x"+xt.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var Fs=ht((g2,_0)=>{var Nt=lt();Bt();_0.exports=Nt.cipher=Nt.cipher||{};Nt.cipher.algorithms=Nt.cipher.algorithms||{};Nt.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Nt.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Nt.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};Nt.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Nt.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Nt.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};Nt.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),Nt.cipher.algorithms[t]=e};Nt.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in Nt.cipher.algorithms?Nt.cipher.algorithms[t]:null};var Ms=Nt.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};Ms.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=Nt.util.createBuffer(),this.output=t.output||Nt.util.createBuffer(),this.mode.start(e)};Ms.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Ms.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var Hs=ht((x2,L0)=>{var Dt=lt();Bt();Dt.cipher=Dt.cipher||{};var nt=L0.exports=Dt.cipher.modes=Dt.cipher.modes||{};nt.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};nt.ecb.prototype.start=function(t){};nt.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};nt.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};nt.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=xi(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};nt.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};nt.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=xi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=xi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.ofb.prototype.decrypt=nt.ofb.prototype.encrypt;nt.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=xi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}mi(this._inBlock)};nt.ctr.prototype.decrypt=nt.ctr.prototype.encrypt;nt.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0,this._R=3774873600};nt.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=Dt.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=Dt.util.createBuffer(t.additionalData):r=Dt.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=Dt.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(Vs(n*8)))}this._inBlock=this._j0.slice(0),mi(this._inBlock),this._partialBytes=0,r=Dt.util.createBuffer(r),this._aDataLength=Vs(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};nt.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),mi(this._inBlock)};nt.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),mi(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};nt.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=t[n]>>>(7-r%8)*4&15,s=this._m[r][i];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};nt.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};nt.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,s=new Array(i),o=0;o>>1,i=new Array(r);i[n]=t.slice(0);for(var s=n>>>1;s>0;)this.pow(i[2*s],i[s]=[]),s>>=1;for(s=2;s4){var r=t;t=Dt.util.createBuffer();for(var n=0;n{var pt=lt();Fs();Hs();Bt();k0.exports=pt.aes=pt.aes||{};pt.aes.startEncrypting=function(t,e,r,n){var i=bi({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i};pt.aes.createEncryptionCipher=function(t,e){return bi({key:t,output:null,decrypt:!1,mode:e})};pt.aes.startDecrypting=function(t,e,r,n){var i=bi({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i};pt.aes.createDecryptionCipher=function(t,e){return bi({key:t,output:null,decrypt:!0,mode:e})};pt.aes.Algorithm=function(t,e){Gs||N0();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(n,i){return zs(r._w,n,i,!1)},decrypt:function(n,i){return zs(r._w,n,i,!0)}}}),r._init=!1};pt.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=pt.util.createBuffer(e);else if(pt.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=pt.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^a&255^99,$t[r]=a,qs[a]=r,c=t[a],i=t[r],s=t[i],o=t[s],f=c<<24^a<<16^a<<8^(a^c),u=(i^s^o)<<24^(r^o)<<16^(r^s^o)<<8^(r^i^o);for(var h=0;h<4;++h)ar[h][r]=f,ue[h][a]=u,f=f<<24|f>>>8,u=u<<24|u>>>8;r===0?r=n=1:(r=i^t[t[t[i^o]]],n^=t[t[n]])}}function D0(t,e){for(var r=t.slice(0),n,i=1,s=r.length,o=s+6+1,a=kr*o,c=s;c>>16&255]<<24^$t[n>>>8&255]<<16^$t[n&255]<<8^$t[n>>>24]^R0[i]<<24,i++):s>6&&c%s===4&&(n=$t[n>>>24]<<24^$t[n>>>16&255]<<16^$t[n>>>8&255]<<8^$t[n&255]),r[c]=r[c-s]^n;if(e){var f,u=ue[0],h=ue[1],l=ue[2],g=ue[3],d=r.slice(0);a=r.length;for(var c=0,p=a-kr;c>>24]]^h[$t[f>>>16&255]]^l[$t[f>>>8&255]]^g[$t[f&255]];r=d}return r}function zs(t,e,r,n){var i=t.length/4-1,s,o,a,c,f;n?(s=ue[0],o=ue[1],a=ue[2],c=ue[3],f=qs):(s=ar[0],o=ar[1],a=ar[2],c=ar[3],f=$t);var u,h,l,g,d,p,y;u=e[0]^t[0],h=e[n?3:1]^t[1],l=e[2]^t[2],g=e[n?1:3]^t[3];for(var x=3,v=1;v>>24]^o[h>>>16&255]^a[l>>>8&255]^c[g&255]^t[++x],p=s[h>>>24]^o[l>>>16&255]^a[g>>>8&255]^c[u&255]^t[++x],y=s[l>>>24]^o[g>>>16&255]^a[u>>>8&255]^c[h&255]^t[++x],g=s[g>>>24]^o[u>>>16&255]^a[h>>>8&255]^c[l&255]^t[++x],u=d,h=p,l=y;r[0]=f[u>>>24]<<24^f[h>>>16&255]<<16^f[l>>>8&255]<<8^f[g&255]^t[++x],r[n?3:1]=f[h>>>24]<<24^f[l>>>16&255]<<16^f[g>>>8&255]<<8^f[u&255]^t[++x],r[2]=f[l>>>24]<<24^f[g>>>16&255]<<16^f[u>>>8&255]<<8^f[h&255]^t[++x],r[n?1:3]=f[g>>>24]<<24^f[u>>>16&255]<<16^f[h>>>8&255]<<8^f[l&255]^t[++x]}function bi(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=pt.cipher.createDecipher(r,t.key):n=pt.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof pt.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var K0=ht((b2,U0)=>{var vt=lt();Fs();Hs();Bt();U0.exports=vt.des=vt.des||{};vt.des.startEncrypting=function(t,e,r,n){var i=vi({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};vt.des.createEncryptionCipher=function(t,e){return vi({key:t,output:null,decrypt:!1,mode:e})};vt.des.startDecrypting=function(t,e,r,n){var i=vi({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};vt.des.createDecryptionCipher=function(t,e){return vi({key:t,output:null,decrypt:!0,mode:e})};vt.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(n,i){return P0(r._keys,n,i,!1)},decrypt:function(n,i){return P0(r._keys,n,i,!0)}}}),r._init=!1};vt.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=vt.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=vl(e),this._init=!0}};pe("DES-ECB",vt.cipher.modes.ecb);pe("DES-CBC",vt.cipher.modes.cbc);pe("DES-CFB",vt.cipher.modes.cfb);pe("DES-OFB",vt.cipher.modes.ofb);pe("DES-CTR",vt.cipher.modes.ctr);pe("3DES-ECB",vt.cipher.modes.ecb);pe("3DES-CBC",vt.cipher.modes.cbc);pe("3DES-CFB",vt.cipher.modes.cfb);pe("3DES-OFB",vt.cipher.modes.ofb);pe("3DES-CTR",vt.cipher.modes.ctr);function pe(t,e){var r=function(){return new vt.des.Algorithm(t,e)};vt.cipher.registerAlgorithm(t,r)}var ll=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],dl=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],pl=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],yl=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],gl=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],xl=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],ml=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],bl=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function vl(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],a=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],l=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],d=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],p=t.length()>8?3:1,y=[],x=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,m,A=0;A>>4^B)&252645135,B^=m,S^=m<<4,m=(B>>>-16^S)&65535,S^=m,B^=m<<-16,m=(S>>>2^B)&858993459,B^=m,S^=m<<2,m=(B>>>-16^S)&65535,S^=m,B^=m<<-16,m=(S>>>1^B)&1431655765,B^=m,S^=m<<1,m=(B>>>8^S)&16711935,S^=m,B^=m<<8,m=(S>>>1^B)&1431655765,B^=m,S^=m<<1,m=S<<8|B>>>20&240,S=B<<24|B<<8&16711680|B>>>8&65280|B>>>24&240,B=m;for(var R=0;R>>26,B=B<<2|B>>>26):(S=S<<1|S>>>27,B=B<<1|B>>>27),S&=-15,B&=-15;var _=e[S>>>28]|r[S>>>24&15]|n[S>>>20&15]|i[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|a[S>>>4&15],O=c[B>>>28]|f[B>>>24&15]|u[B>>>20&15]|h[B>>>16&15]|l[B>>>12&15]|g[B>>>8&15]|d[B>>>4&15];m=(O>>>16^_)&65535,y[v++]=_^m,y[v++]=O^m<<16}}return y}function P0(t,e,r,n){var i=t.length===32?3:9,s;i===3?s=n?[30,-2,-2]:[0,32,2]:s=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,a=e[0],c=e[1];o=(a>>>4^c)&252645135,c^=o,a^=o<<4,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,a=a<<1|a>>>31,c=c<<1|c>>>31;for(var f=0;f>>4|c<<28)^t[l+1];o=a,a=c,c=o^(dl[g>>>24&63]|yl[g>>>16&63]|xl[g>>>8&63]|bl[g&63]|ll[d>>>24&63]|pl[d>>>16&63]|gl[d>>>8&63]|ml[d&63])}o=a,a=c,c=o}a=a>>>1|a<<31,c=c>>>1|c<<31,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(a>>>4^c)&252645135,c^=o,a^=o<<4,r[0]=a,r[1]=c}function vi(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=vt.cipher.createDecipher(r,t.key):n=vt.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof vt.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var cr=ht((v2,O0)=>{var wi=lt();O0.exports=wi.md=wi.md||{};wi.md.algorithms=wi.md.algorithms||{}});var F0=ht((w2,M0)=>{var Re=lt();cr();Bt();var wl=M0.exports=Re.hmac=Re.hmac||{};wl.create=function(){var t=null,e=null,r=null,n=null,i={};return i.start=function(s,o){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in Re.md.algorithms)e=Re.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else e=s;if(o===null)o=t;else{if(typeof o=="string")o=Re.util.createBuffer(o);else if(Re.util.isArray(o)){var a=o;o=Re.util.createBuffer();for(var c=0;ce.blockLength&&(e.start(),e.update(o.bytes()),o=e.digest()),r=Re.util.createBuffer(),n=Re.util.createBuffer(),f=o.length();for(var c=0;c{});var H0=ht((B2,V0)=>{var Wt=lt();F0();cr();Bt();var El=Wt.pkcs5=Wt.pkcs5||{},Ne;Wt.util.isNodejs&&!Wt.options.usePureJavaScript&&(Ne=Ei());V0.exports=Wt.pbkdf2=El.pbkdf2=function(t,e,r,n,i,s){if(typeof i=="function"&&(s=i,i=null),Wt.util.isNodejs&&!Wt.options.usePureJavaScript&&Ne.pbkdf2&&(i===null||typeof i!="object")&&(Ne.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?Ne.pbkdf2Sync.length===4?Ne.pbkdf2(t,e,r,n,function(m,A){if(m)return s(m);s(null,A.toString("binary"))}):Ne.pbkdf2(t,e,r,n,i,function(m,A){if(m)return s(m);s(null,A.toString("binary"))}):Ne.pbkdf2Sync.length===4?Ne.pbkdf2Sync(t,e,r,n).toString("binary"):Ne.pbkdf2Sync(t,e,r,n,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in Wt.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=Wt.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var a=new Error("Derived key is too long.");if(s)return s(a);throw a}var c=Math.ceil(n/o),f=n-(c-1)*o,u=Wt.hmac.create();u.start(i,t);var h="",l,g,d;if(!s){for(var p=1;p<=c;++p){u.start(null,null),u.update(e),u.update(Wt.util.int32ToBytes(p)),l=d=u.digest().getBytes();for(var y=2;y<=r;++y)u.start(null,null),u.update(d),g=u.digest().getBytes(),l=Wt.util.xorBytes(l,g,o),d=g;h+=pc)return s(null,h);u.start(null,null),u.update(e),u.update(Wt.util.int32ToBytes(p)),l=d=u.digest().getBytes(),y=2,v()}function v(){if(y<=r)return u.start(null,null),u.update(d),g=u.digest().getBytes(),l=Wt.util.xorBytes(l,g,o),d=g,++y,Wt.util.setImmediate(v);h+=p{var Bi=lt();Bt();var q0=z0.exports=Bi.pem=Bi.pem||{};q0.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r -`,n;if(t.procType&&(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=Si(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=Si(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=Si(n)),t.headers)for(var i=0;i65&&o!==-1){var a=e[o];a===","?(++o,e=e.substr(0,o)+`\r - `+e.substr(o)):e=e.substr(0,o)+`\r -`+a+e.substr(o+1),s=i-o-1,o=-1,++i}else(e[i]===" "||e[i]===" "||e[i]===",")&&(o=i);return e}function Sl(t){return t.replace(/^\s+/,"")}});var Q0=ht((C2,X0)=>{var ye=lt();cr();Bt();var W0=X0.exports=ye.sha256=ye.sha256||{};ye.md.sha256=ye.md.algorithms.sha256=W0;W0.create=function(){Y0||Bl();var t=null,e=ye.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),$0(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=ye.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(Ws.substr(0,n.blockLength-o));for(var a,c,f=n.fullMessageLength[0]*8,u=0;u>>0,f+=c,i.putInt32(f>>>0),f=a>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};$0(h,r,i);var l=ye.util.createBuffer();return l.putInt32(h.h0),l.putInt32(h.h1),l.putInt32(h.h2),l.putInt32(h.h3),l.putInt32(h.h4),l.putInt32(h.h5),l.putInt32(h.h6),l.putInt32(h.h7),l},n};var Ws=null,Y0=!1,Z0=null;function Bl(){Ws="\x80",Ws+=ye.util.fillString("\0",64),Z0=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Y0=!0}function $0(t,e,r){for(var n,i,s,o,a,c,f,u,h,l,g,d,p,y,x,v=r.length();v>=64;){for(f=0;f<16;++f)e[f]=r.getInt32();for(;f<64;++f)n=e[f-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=e[f-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[f]=n+e[f-7]+i+e[f-16]|0;for(u=t.h0,h=t.h1,l=t.h2,g=t.h3,d=t.h4,p=t.h5,y=t.h6,x=t.h7,f=0;f<64;++f)o=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),a=y^d&(p^y),s=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),c=u&h|l&(u^h),n=x+o+a+Z0[f]+e[f],i=s+c,x=y,y=p,p=d,d=g+n>>>0,g=l,l=h,h=u,u=n+i>>>0;t.h0=t.h0+u|0,t.h1=t.h1+h|0,t.h2=t.h2+l|0,t.h3=t.h3+g|0,t.h4=t.h4+d|0,t.h5=t.h5+p|0,t.h6=t.h6+y|0,t.h7=t.h7+x|0,v-=64}}});var j0=ht((I2,J0)=>{var ge=lt();Bt();var Ai=null;ge.util.isNodejs&&!ge.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Ai=Ei());var Al=J0.exports=ge.prng=ge.prng||{};Al.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();e.pools=n,e.pool=0,e.generate=function(f,u){if(!u)return e.generateSync(f);var h=e.plugin.cipher,l=e.plugin.increment,g=e.plugin.formatKey,d=e.plugin.formatSeed,p=ge.util.createBuffer();e.key=null,y();function y(x){if(x)return u(x);if(p.length()>=f)return u(null,p.getBytes(f));if(e.generated>1048575&&(e.key=null),e.key===null)return ge.util.nextTick(function(){s(y)});var v=h(e.key,e.seed);e.generated+=v.length,p.putBytes(v),e.key=g(h(e.key,l(e.seed))),e.seed=d(h(e.key,e.seed)),ge.util.setImmediate(y)}},e.generateSync=function(f){var u=e.plugin.cipher,h=e.plugin.increment,l=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var d=ge.util.createBuffer();d.length()1048575&&(e.key=null),e.key===null&&o();var p=u(e.key,e.seed);e.generated+=p.length,d.putBytes(p),e.key=l(u(e.key,h(e.seed))),e.seed=g(u(e.key,e.seed))}return d.getBytes(f)};function s(f){if(e.pools[0].messageLength>=32)return a(),f();var u=32-e.pools[0].messageLength<<5;e.seedFile(u,function(h,l){if(h)return f(h);e.collect(l),a(),f()})}function o(){if(e.pools[0].messageLength>=32)return a();var f=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(f)),a()}function a(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var f=e.plugin.md.create();f.update(e.keyBytes);for(var u=1,h=0;h<32;++h)e.reseeds%u===0&&(f.update(e.pools[h].digest().getBytes()),e.pools[h].start()),u=u<<1;e.keyBytes=f.digest().getBytes(),f.start(),f.update(e.keyBytes);var l=f.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(l),e.generated=0}function c(f){var u=null,h=ge.util.globalScope,l=h.crypto||h.msCrypto;l&&l.getRandomValues&&(u=function(S){return l.getRandomValues(S)});var g=ge.util.createBuffer();if(u)for(;g.length()>16),v+=(x&32767)<<16,v+=x>>15,v=(v&2147483647)+(v>>31),A=v&4294967295;for(var y=0;y<3;++y)m=A>>>(y<<3),m^=Math.floor(Math.random()*256),g.putByte(m&255)}return g.getBytes(f)}return Ai?(e.seedFile=function(f,u){Ai.randomBytes(f,function(h,l){if(h)return u(h);u(null,l.toString())})},e.seedFileSync=function(f){return Ai.randomBytes(f).toString()}):(e.seedFile=function(f,u){try{u(null,c(f))}catch(h){u(h)}},e.seedFileSync=c),e.collect=function(f){for(var u=f.length,h=0;h>l&255);e.collect(h)},e.registerWorker=function(f){if(f===self)e.seedFile=function(h,l){function g(d){var p=d.data;p.forge&&p.forge.prng&&(self.removeEventListener("message",g),l(p.forge.prng.err,p.forge.prng.bytes))}self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:h}}})};else{var u=function(h){var l=h.data;l.forge&&l.forge.prng&&e.seedFile(l.forge.prng.needed,function(g,d){f.postMessage({forge:{prng:{err:g,bytes:d}}})})};f.addEventListener("message",u)}},e}});var bn=ht((T2,Ys)=>{var kt=lt();$s();Q0();j0();Bt();(function(){if(kt.random&&kt.random.getBytes){Ys.exports=kt.random;return}(function(t){var e={},r=new Array(4),n=kt.util.createBuffer();e.formatKey=function(h){var l=kt.util.createBuffer(h);return h=new Array(4),h[0]=l.getInt32(),h[1]=l.getInt32(),h[2]=l.getInt32(),h[3]=l.getInt32(),kt.aes._expandKey(h,!1)},e.formatSeed=function(h){var l=kt.util.createBuffer(h);return h=new Array(4),h[0]=l.getInt32(),h[1]=l.getInt32(),h[2]=l.getInt32(),h[3]=l.getInt32(),h},e.cipher=function(h,l){return kt.aes._updateBlock(h,l,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=kt.md.sha256;function i(){var h=kt.prng.create(e);return h.getBytes=function(l,g){return h.generate(l,g)},h.getBytesSync=function(l){return h.generate(l)},h}var s=i(),o=null,a=kt.util.globalScope,c=a.crypto||a.msCrypto;if(c&&c.getRandomValues&&(o=function(h){return c.getRandomValues(h)}),kt.options.usePureJavaScript||!kt.util.isNodejs&&!o){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var f="";for(var u in navigator)try{typeof navigator[u]=="string"&&(f+=navigator[u])}catch{}s.collect(f),f=null}t&&(t().mousemove(function(h){s.collectInt(h.clientX,16),s.collectInt(h.clientY,16)}),t().keypress(function(h){s.collectInt(h.charCode,8)}))}if(!kt.random)kt.random=s;else for(var u in s)kt.random[u]=s[u];kt.random.createInstance=i,Ys.exports=kt.random})(typeof jQuery<"u"?jQuery:null)})()});var nc=ht((_2,rc)=>{var Yt=lt();Bt();var Zs=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],tc=[1,2,3,5],Cl=function(t,e){return t<>16-e},Il=function(t,e){return(t&65535)>>e|t<<16-e&65535};rc.exports=Yt.rc2=Yt.rc2||{};Yt.rc2.expandKey=function(t,e){typeof t=="string"&&(t=Yt.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),i=e,s=Math.ceil(i/8),o=255>>(i&7),a;for(a=n;a<128;a++)r.putByte(Zs[r.at(a-1)+r.at(a-n)&255]);for(r.setAt(128-s,Zs[r.at(128-s)&o]),a=127-s;a>=0;a--)r.setAt(a,Zs[r.at(a+1)^r.at(a+s)]);return r};var ec=function(t,e,r){var n=!1,i=null,s=null,o=null,a,c,f,u,h=[];for(t=Yt.rc2.expandKey(t,e),f=0;f<64;f++)h.push(t.getInt16Le());r?(a=function(d){for(f=0;f<4;f++)d[f]+=h[u]+(d[(f+3)%4]&d[(f+2)%4])+(~d[(f+3)%4]&d[(f+1)%4]),d[f]=Cl(d[f],tc[f]),u++},c=function(d){for(f=0;f<4;f++)d[f]+=h[d[(f+3)%4]&63]}):(a=function(d){for(f=3;f>=0;f--)d[f]=Il(d[f],tc[f]),d[f]-=h[u]+(d[(f+3)%4]&d[(f+2)%4])+(~d[(f+3)%4]&d[(f+1)%4]),u--},c=function(d){for(f=3;f>=0;f--)d[f]-=h[d[(f+3)%4]&63]});var l=function(d){var p=[];for(f=0;f<4;f++){var y=i.getInt16Le();o!==null&&(r?y^=o.getInt16Le():o.putInt16Le(y)),p.push(y&65535)}u=r?0:63;for(var x=0;x=8;)l([[5,a],[1,c],[6,a],[1,c],[5,a]])},finish:function(d){var p=!0;if(r)if(d)p=d(8,i,!r);else{var y=i.length()===8?8:8-i.length();i.fillWithByte(y,y)}if(p&&(n=!0,g.update()),!r&&(p=i.length()===0,p))if(d)p=d(8,s,!r);else{var x=s.length(),v=s.at(x-1);v>x?p=!1:s.truncate(v)}return p}},g};Yt.rc2.startEncrypting=function(t,e,r){var n=Yt.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};Yt.rc2.createEncryptionCipher=function(t,e){return ec(t,e,!0)};Yt.rc2.startDecrypting=function(t,e,r){var n=Yt.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};Yt.rc2.createDecryptionCipher=function(t,e){return ec(t,e,!1)}});var Ti=ht((L2,hc)=>{var Xs=lt();hc.exports=Xs.jsbn=Xs.jsbn||{};var De,Tl=0xdeadbeefcafe,ic=(Tl&16777215)==15715070;function D(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}Xs.jsbn.BigInteger=D;function ot(){return new D(null)}function _l(t,e,r,n,i,s){for(;--s>=0;){var o=e*this.data[t++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=o&67108863}return i}function Ll(t,e,r,n,i,s){for(var o=e&32767,a=e>>15;--s>=0;){var c=this.data[t]&32767,f=this.data[t++]>>15,u=a*c+f*o;c=o*c+((u&32767)<<15)+r.data[n]+(i&1073741823),i=(c>>>30)+(u>>>15)+a*f+(i>>>30),r.data[n++]=c&1073741823}return i}function sc(t,e,r,n,i,s){for(var o=e&16383,a=e>>14;--s>=0;){var c=this.data[t]&16383,f=this.data[t++]>>14,u=a*c+f*o;c=o*c+((u&16383)<<14)+r.data[n]+i,i=(c>>28)+(u>>14)+a*f,r.data[n++]=c&268435455}return i}typeof navigator>"u"?(D.prototype.am=sc,De=28):ic&&navigator.appName=="Microsoft Internet Explorer"?(D.prototype.am=Ll,De=30):ic&&navigator.appName!="Netscape"?(D.prototype.am=_l,De=26):(D.prototype.am=sc,De=28);D.prototype.DB=De;D.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function Dl(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}function Ye(t){var e=ot();return e.fromInt(t),e}function kl(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,i=!1,s=0;--n>=0;){var o=r==8?t[n]&255:ac(t,n);if(o<0){t.charAt(n)=="-"&&(i=!0);continue}i=!1,s==0?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB)}r==8&&t[0]&128&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}function Ul(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(a>a)>0&&(i=!0,s=oc(n));o>=0;)a>(a+=this.DB-e)):(n=this.data[o]>>(a-=e)&r,a<=0&&(a+=this.DB,--o)),n>0&&(i=!0),i&&(s+=oc(n));return i?s:"0"}function Kl(){var t=ot();return D.ZERO.subTo(this,t),t}function Ol(){return this.s<0?this.negate():this}function Ml(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}function Ii(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function Fl(){return this.t<=0?0:this.DB*(this.t-1)+Ii(this.data[this.t-1]^this.s&this.DM)}function Vl(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}function Hl(t,e){for(var r=t;r=0;--a)e.data[a+s+1]=this.data[a]>>n|o,o=(this.data[a]&i)<=0;--a)e.data[a]=0;e.data[s]=o,e.t=this.t+s+1,e.s=this.s,e.clamp()}function zl(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,i=this.DB-n,s=(1<>n;for(var o=r+1;o>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}function $l(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}function Yl(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,u=s.data[f-1];if(u!=0){var h=u*(1<1?s.data[f-2]>>this.F2:0),l=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(x,r)),D.ONE.dlShiftTo(f,x),x.subTo(s,s);s.t=0;){var v=r.data[--p]==u?this.DM:Math.floor(r.data[p]*l+(r.data[p-1]+d)*g);if((r.data[p]+=s.am(0,v,r,y,0,f))0&&r.rShiftTo(c,r),o<0&&D.ZERO.subTo(r,r)}}}function Zl(t){var e=ot();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(D.ZERO)>0&&t.subTo(e,e),e}function fr(t){this.m=t}function Xl(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function Ql(t){return t}function Jl(t){t.divRemTo(this.m,null,t)}function jl(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function td(t,e){t.squareTo(e),this.reduce(e)}fr.prototype.convert=Xl;fr.prototype.revert=Ql;fr.prototype.reduce=Jl;fr.prototype.mulTo=jl;fr.prototype.sqrTo=td;function ed(){if(this.t<1)return 0;var t=this.data[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function ur(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}function nd(t){var e=ot();return t.copyTo(e),this.reduce(e),e}function id(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function sd(t,e){t.squareTo(e),this.reduce(e)}function od(t,e,r){t.multiplyTo(e,r),this.reduce(r)}ur.prototype.convert=rd;ur.prototype.revert=nd;ur.prototype.reduce=id;ur.prototype.mulTo=od;ur.prototype.sqrTo=sd;function ad(){return(this.t>0?this.data[0]&1:this.s)==0}function cd(t,e){if(t>4294967295||t<1)return D.ONE;var r=ot(),n=ot(),i=e.convert(this),s=Ii(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,i,r);else{var o=r;r=n,n=o}return e.revert(r)}function fd(t,e){var r;return t<256||e.isEven()?r=new fr(e):r=new ur(e),this.exp(t,r)}D.prototype.copyTo=Nl;D.prototype.fromInt=Dl;D.prototype.fromString=kl;D.prototype.clamp=Pl;D.prototype.dlShiftTo=Vl;D.prototype.drShiftTo=Hl;D.prototype.lShiftTo=ql;D.prototype.rShiftTo=zl;D.prototype.subTo=Gl;D.prototype.multiplyTo=$l;D.prototype.squareTo=Wl;D.prototype.divRemTo=Yl;D.prototype.invDigit=ed;D.prototype.isEven=ad;D.prototype.exp=cd;D.prototype.toString=Ul;D.prototype.negate=Kl;D.prototype.abs=Ol;D.prototype.compareTo=Ml;D.prototype.bitLength=Fl;D.prototype.mod=Zl;D.prototype.modPowInt=fd;D.ZERO=Ye(0);D.ONE=Ye(1);function ud(){var t=ot();return this.copyTo(t),t}function hd(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}function dd(){return this.t==0?this.s:this.data[0]<<16>>16}function pd(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function yd(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function gd(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=Ye(r),i=ot(),s=ot(),o="";for(this.divRemTo(n,i,s);i.signum()>0;)o=(r+s.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,s);return s.intValue().toString(t)+o}function xd(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,s=0,o=0,a=0;a=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(o,0)),i&&D.ZERO.subTo(this,this)}function md(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(D.ONE.shiftLeft(t-1),Js,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(D.ONE.shiftLeft(t-1),this);else{var n=new Array,i=t&7;n.length=(t>>3)+1,e.nextBytes(n),i>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function vd(t){return this.compareTo(t)==0}function wd(t){return this.compareTo(t)<0?this:t}function Ed(t){return this.compareTo(t)>0?this:t}function Sd(t,e,r){var n,i,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),t&255||(t>>=8,e+=8),t&15||(t>>=4,e+=4),t&3||(t>>=2,e+=2),t&1||++e,e}function Dd(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}function Hd(t){var e=ot();return this.addTo(t,e),e}function qd(t){var e=ot();return this.subTo(t,e),e}function zd(t){var e=ot();return this.multiplyTo(t,e),e}function Gd(t){var e=ot();return this.divRemTo(t,e,null),e}function $d(t){var e=ot();return this.divRemTo(t,null,e),e}function Wd(t){var e=ot(),r=ot();return this.divRemTo(t,e,r),new Array(e,r)}function Yd(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Zd(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}function vn(){}function uc(t){return t}function Xd(t,e,r){t.multiplyTo(e,r)}function Qd(t,e){t.squareTo(e)}vn.prototype.convert=uc;vn.prototype.revert=uc;vn.prototype.mulTo=Xd;vn.prototype.sqrTo=Qd;function Jd(t){return this.exp(t,new vn)}function jd(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=ot();return t.copyTo(e),this.reduce(e),e}function rp(t){return t}function np(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function ip(t,e){t.squareTo(e),this.reduce(e)}function sp(t,e,r){t.multiplyTo(e,r),this.reduce(r)}Kr.prototype.convert=ep;Kr.prototype.revert=rp;Kr.prototype.reduce=np;Kr.prototype.mulTo=sp;Kr.prototype.sqrTo=ip;function op(t,e){var r=t.bitLength(),n,i=Ye(1),s;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new fr(e):e.isEven()?s=new Kr(e):s=new ur(e);var o=new Array,a=3,c=n-1,f=(1<1){var u=ot();for(s.sqrTo(o[1],u);a<=f;)o[a]=ot(),s.mulTo(u,o[a-2],o[a]),a+=2}var h=t.t-1,l,g=!0,d=ot(),p;for(r=Ii(t.data[h])-1;h>=0;){for(r>=c?l=t.data[h]>>r-c&f:(l=(t.data[h]&(1<0&&(l|=t.data[h-1]>>this.DB+r-c)),a=n;!(l&1);)l>>=1,--a;if((r-=a)<0&&(r+=this.DB,--h),g)o[l].copyTo(i),g=!1;else{for(;a>1;)s.sqrTo(i,d),s.sqrTo(d,i),a-=2;a>0?s.sqrTo(i,d):(p=i,i=d,d=p),s.mulTo(d,o[l],i)}for(;h>=0&&!(t.data[h]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function cp(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}function fp(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return D.ZERO;for(var r=t.clone(),n=this.clone(),i=Ye(1),s=Ye(0),o=Ye(0),a=Ye(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!i.isEven()||!s.isEven())&&(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!o.isEven()||!a.isEven())&&(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),s.subTo(a,s)):(n.subTo(r,n),e&&o.subTo(i,o),a.subTo(s,a))}if(n.compareTo(D.ONE)!=0)return D.ZERO;if(a.compareTo(t)>=0)return a.subtract(t);if(a.signum()<0)a.addTo(t,a);else return a;return a.signum()<0?a.add(t):a}var he=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],up=(1<<26)/he[he.length-1];function hp(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=he[he.length-1]){for(e=0;e=0);var a=s.modPow(n,this);if(a.compareTo(D.ONE)!=0&&a.compareTo(e)!=0){for(var c=1;c++{var xe=lt();cr();Bt();var dc=yc.exports=xe.sha1=xe.sha1||{};xe.md.sha1=xe.md.algorithms.sha1=dc;dc.create=function(){pc||pp();var t=null,e=xe.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),lc(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=xe.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(js.substr(0,n.blockLength-o));for(var a,c,f=n.fullMessageLength[0]*8,u=0;u>>0,f+=c,i.putInt32(f>>>0),f=a>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};lc(h,r,i);var l=xe.util.createBuffer();return l.putInt32(h.h0),l.putInt32(h.h1),l.putInt32(h.h2),l.putInt32(h.h3),l.putInt32(h.h4),l},n};var js=null,pc=!1;function pp(){js="\x80",js+=xe.util.fillString("\0",64),pc=!0}function lc(t,e,r){for(var n,i,s,o,a,c,f,u,h=r.length();h>=64;){for(i=t.h0,s=t.h1,o=t.h2,a=t.h3,c=t.h4,u=0;u<16;++u)n=r.getInt32(),e[u]=n,f=a^s&(o^a),n=(i<<5|i>>>27)+f+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<20;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,f=a^s&(o^a),n=(i<<5|i>>>27)+f+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<32;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<40;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<60;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s&o|a&(s^o),n=(i<<5|i>>>27)+f+c+2400959708+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<80;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+3395469782+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+s|0,t.h2=t.h2+o|0,t.h3=t.h3+a|0,t.h4=t.h4+c|0,h-=64}}});var bc=ht((N2,mc)=>{var me=lt();Bt();bn();gc();var xc=mc.exports=me.pkcs1=me.pkcs1||{};xc.encode_rsa_oaep=function(t,e,r){var n,i,s,o;typeof r=="string"?(n=r,i=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),s?s.start():s=me.md.sha1.create(),o||(o=s);var a=Math.ceil(t.n.bitLength()/8),c=a-2*s.digestLength-2;if(e.length>c){var f=new Error("RSAES-OAEP input message length is too long.");throw f.length=e.length,f.maxLength=c,f}n||(n=""),s.update(n,"raw");for(var u=s.digest(),h="",l=c-e.length,g=0;g>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+o),n+=r.digest().getBytes()}return n.substring(0,e)}});var vc=ht((D2,to)=>{var Ze=lt();Bt();Ti();bn();(function(){if(Ze.prime){to.exports=Ze.prime;return}var t=to.exports=Ze.prime=Ze.prime||{},e=Ze.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var i=function(h,l){return h|l};t.generateProbablePrime=function(h,l,g){typeof l=="function"&&(g=l,l={}),l=l||{};var d=l.algorithm||"PRIMEINC";typeof d=="string"&&(d={name:d}),d.options=d.options||{};var p=l.prng||Ze.random,y={nextBytes:function(x){for(var v=p.getBytesSync(x.length),m=0;ml&&(h=f(l,g)),h.isProbablePrime(p))return x(null,h);h.dAddOffset(r[d++%8],0)}while(y<0||+new Date-v"u")return o(h,l,g,d);var p=f(h,l),y=g.workers,x=g.workLoad||100,v=x*30/8,m=g.workerScript||"forge/prime.worker.js";if(y===-1)return Ze.util.estimateCores(function(S,B){S&&(B=2),y=B-1,A()});A();function A(){y=Math.max(1,y);for(var S=[],B=0;Bh&&(p=f(h,l));var z=p.toString(16);M.target.postMessage({hex:z,workLoad:x}),p.dAddOffset(v,0)}}}}function f(h,l){var g=new e(h,l),d=h-1;return g.testBit(d)||g.bitwiseTo(e.ONE.shiftLeft(d),i,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}function u(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}})()});var Ri=ht((k2,Ic)=>{var $=lt();mn();Ti();yi();bc();vc();bn();Bt();typeof st>"u"&&(st=$.jsbn.BigInteger);var st,eo=$.util.isNodejs?Ei():null,E=$.asn1,ne=$.util;$.pki=$.pki||{};Ic.exports=$.pki.rsa=$.rsa=$.rsa||{};var Q=$.pki,yp=[6,4,2,4,2,4,6,2],gp={name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},xp={name:"RSAPrivateKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},mp={name:"RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},bp=$.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},vp={name:"DigestInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:E.Class.UNIVERSAL,type:E.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},wp=function(t){var e;if(t.algorithm in Q.oids)e=Q.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=E.oidToDer(e).getBytes(),i=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]),s=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]);s.value.push(E.create(E.Class.UNIVERSAL,E.Type.OID,!1,n)),s.value.push(E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,""));var o=E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(s),i.value.push(o),E.toDer(i).getBytes()},Ac=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(st.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(st.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new st($.util.bytesToHex($.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(st.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var i=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(s)<0;)i=i.add(e.p);var o=i.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return o=o.multiply(n.modInverse(e.n)).mod(e.n),o};Q.rsa.encrypt=function(t,e,r){var n=r,i,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=Cc(t,e,r)):(i=$.util.createBuffer(),i.putBytes(t));for(var o=new st(i.toHex(),16),a=Ac(o,e,n),c=a.toString(16),f=$.util.createBuffer(),u=s-Math.ceil(c.length/2);u>0;)f.putByte(0),--u;return f.putBytes($.util.hexToBytes(c)),f.getBytes()};Q.rsa.decrypt=function(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=i,s}var o=new st($.util.createBuffer(t).toHex(),16);if(o.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var a=Ac(o,e,r),c=a.toString(16),f=$.util.createBuffer(),u=i-Math.ceil(c.length/2);u>0;)f.putByte(0),--u;return f.putBytes($.util.hexToBytes(c)),n!==!1?Li(f.getBytes(),e,r):f.getBytes()};Q.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||$.random,i={nextBytes:function(a){for(var c=n.getBytesSync(a.length),f=0;f>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+s);return o};Q.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new st(null);r.fromInt(30);for(var n=0,i=function(h,l){return h|l},s=+new Date,o,a=0;t.keys===null&&(e<=0||ac?t.pqState=0:t.num.isProbablePrime(Sp(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(yp[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(st.ONE),t.q1=t.q.subtract(st.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(st.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var u=t.e.modInverse(t.phi);t.keys={privateKey:Q.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Q.rsa.setPublicKey(t.n,t.e)}}o=+new Date,a+=o-s,s=o}return t.keys!==null};Q.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!$.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(wc("generateKeyPair"))return eo.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(a,c,f){if(a)return n(a);n(null,{privateKey:Q.privateKeyFromPem(f),publicKey:Q.publicKeyFromPem(c)})});if(Ec("generateKey")&&Ec("exportKey"))return ne.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:Bc(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(a){return ne.globalScope.crypto.subtle.exportKey("pkcs8",a.privateKey)}).then(void 0,function(a){n(a)}).then(function(a){if(a){var c=Q.privateKeyFromAsn1(E.fromDer($.util.createBuffer(a)));n(null,{privateKey:c,publicKey:Q.setRsaPublicKey(c.n,c.e)})}});if(Sc("generateKey")&&Sc("exportKey")){var i=ne.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:Bc(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(a){var c=a.target.result,f=ne.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);f.oncomplete=function(u){var h=u.target.result,l=Q.privateKeyFromAsn1(E.fromDer($.util.createBuffer(h)));n(null,{privateKey:l,publicKey:Q.setRsaPublicKey(l.n,l.e)})},f.onerror=function(u){n(u)}},i.onerror=function(a){n(a)};return}}else if(wc("generateKeyPairSync")){var s=eo.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Q.privateKeyFromPem(s.privateKey),publicKey:Q.publicKeyFromPem(s.publicKey)}}}var o=Q.rsa.createKeyPairGenerationState(t,e,r);if(!n)return Q.rsa.stepKeyPairGenerationState(o,0),o.keys;Ep(o,r,n)};Q.setRsaPublicKey=Q.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,i,s){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(a,c,f){return Cc(a,c,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(a,c){return $.pkcs1.encode_rsa_oaep(c,a,s)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(a){return a}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(n,r,!0);return Q.rsa.encrypt(o,r,!0)},r.verify=function(n,i,s,o){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),s==="RSASSA-PKCS1-V1_5"?s={verify:function(c,f){f=Li(f,r,!0);var u=E.fromDer(f,{parseAllBytes:o._parseAllDigestBytes}),h={},l=[];if(!E.validate(u,vp,h,l)){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=l,g}var d=E.derToOid(h.algorithmIdentifier);if(!(d===$.oids.md2||d===$.oids.md5||d===$.oids.sha1||d===$.oids.sha224||d===$.oids.sha256||d===$.oids.sha384||d===$.oids.sha512||d===$.oids["sha512-224"]||d===$.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=d,g}if((d===$.oids.md2||d===$.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return c===h.digest}}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:function(c,f){return f=Li(f,r,!0),c===f}});var a=Q.rsa.decrypt(i,r,!0,!1);return s.verify(n,a,r.n.bitLength())},r};Q.setRsaPrivateKey=Q.rsa.setPrivateKey=function(t,e,r,n,i,s,o,a){var c={n:t,e,d:r,p:n,q:i,dP:s,dQ:o,qInv:a};return c.decrypt=function(f,u,h){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var l=Q.rsa.decrypt(f,c,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:Li};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(g,d){return $.pkcs1.decode_rsa_oaep(d,g,h)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(g){return g}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(l,c,!1)},c.sign=function(f,u){var h=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:wp},h=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return f}},h=1);var l=u.encode(f,c.n.bitLength());return Q.rsa.encrypt(l,c,h)},c};Q.wrapRsaPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Q.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,E.toDer(t).getBytes())])};Q.privateKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,gp,e,r)&&(t=E.fromDer($.util.createBuffer(e.privateKey))),e={},r=[],!E.validate(t,xp,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,s,o,a,c,f,u,h;return i=$.util.createBuffer(e.privateKeyModulus).toHex(),s=$.util.createBuffer(e.privateKeyPublicExponent).toHex(),o=$.util.createBuffer(e.privateKeyPrivateExponent).toHex(),a=$.util.createBuffer(e.privateKeyPrime1).toHex(),c=$.util.createBuffer(e.privateKeyPrime2).toHex(),f=$.util.createBuffer(e.privateKeyExponent1).toHex(),u=$.util.createBuffer(e.privateKeyExponent2).toHex(),h=$.util.createBuffer(e.privateKeyCoefficient).toHex(),Q.setRsaPrivateKey(new st(i,16),new st(s,16),new st(o,16),new st(a,16),new st(c,16),new st(f,16),new st(u,16),new st(h,16))};Q.privateKeyToAsn1=Q.privateKeyToRSAPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.e)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.d)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.p)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.q)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.dP)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.dQ)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.qInv))])};Q.publicKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,bp,e,r)){var n=E.derToOid(e.publicKeyOid);if(n!==Q.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}t=e.rsaPublicKey}if(r=[],!E.validate(t,mp,e,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var s=$.util.createBuffer(e.publicKeyModulus).toHex(),o=$.util.createBuffer(e.publicKeyExponent).toHex();return Q.setRsaPublicKey(new st(s,16),new st(o,16))};Q.publicKeyToAsn1=Q.publicKeyToSubjectPublicKeyInfo=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Q.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.BITSTRING,!1,[Q.publicKeyToRSAPublicKey(t)])])};Q.publicKeyToRSAPublicKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.e))])};function Cc(t,e,r){var n=$.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=i-11,s}n.putByte(0),n.putByte(r);var o=i-3-t.length,a;if(r===0||r===1){a=r===0?0:255;for(var c=0;c0;){for(var f=0,u=$.random.getBytes(o),c=0;c"u")throw new Error("Encryption block is invalid.");var c=0;if(a===0){c=i-3-n;for(var f=0;f1;){if(s.getByte()!==255){--s.read;break}++c}else if(a===2)for(c=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++c}var u=s.getByte();if(u!==0||c!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function Ep(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),i();function i(){s(t.pBits,function(a,c){if(a)return r(a);if(t.p=c,t.q!==null)return o(a,t.q);s(t.qBits,o)})}function s(a,c){$.prime.generateProbablePrime(a,n,c)}function o(a,c){if(a)return r(a);if(t.q=c,t.p.compareTo(t.q)<0){var f=t.p;t.p=t.q,t.q=f}if(t.p.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)!==0){t.p=null,i();return}if(t.q.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)!==0){t.q=null,s(t.qBits,o);return}if(t.p1=t.p.subtract(st.ONE),t.q1=t.q.subtract(st.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(st.ONE)!==0){t.p=t.q=null,i();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,o);return}var u=t.e.modInverse(t.phi);t.keys={privateKey:Q.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Q.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function be(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=$.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function Sp(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function wc(t){return $.util.isNodejs&&typeof eo[t]=="function"}function Ec(t){return typeof ne.globalScope<"u"&&typeof ne.globalScope.crypto=="object"&&typeof ne.globalScope.crypto.subtle=="object"&&typeof ne.globalScope.crypto.subtle[t]=="function"}function Sc(t){return typeof ne.globalScope<"u"&&typeof ne.globalScope.msCrypto=="object"&&typeof ne.globalScope.msCrypto.subtle=="object"&&typeof ne.globalScope.msCrypto.subtle[t]=="function"}function Bc(t){for(var e=$.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{var H=lt();$s();mn();K0();cr();yi();H0();G0();bn();nc();Ri();Bt();typeof Tc>"u"&&(Tc=H.jsbn.BigInteger);var Tc,I=H.asn1,tt=H.pki=H.pki||{};Nc.exports=tt.pbe=H.pbe=H.pbe||{};var hr=tt.oids,Bp={name:"EncryptedPrivateKeyInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Ap={name:"PBES2Algorithms",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},Cp={name:"pkcs-12PbeParams",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"iterations"}]};tt.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=H.random.getBytesSync(r.saltSize),i=r.count,s=I.integerToDer(i),o,a,c;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var f,u,h;switch(r.algorithm){case"aes128":o=16,f=16,u=hr["aes128-CBC"],h=H.aes.createEncryptionCipher;break;case"aes192":o=24,f=16,u=hr["aes192-CBC"],h=H.aes.createEncryptionCipher;break;case"aes256":o=32,f=16,u=hr["aes256-CBC"],h=H.aes.createEncryptionCipher;break;case"des":o=8,f=8,u=hr.desCBC,h=H.des.createEncryptionCipher;break;default:var l=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw l.algorithm=r.algorithm,l}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),d=Rc(g),p=H.pkcs5.pbkdf2(e,n,i,o,d),y=H.random.getBytesSync(f),x=h(p);x.start(y),x.update(I.toDer(t)),x.finish(),c=x.output.getBytes();var v=Ip(n,s,o,g);a=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr.pkcs5PBES2).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr.pkcs5PBKDF2).getBytes()),v]),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(u).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,y)])])])}else if(r.algorithm==="3des"){o=24;var m=new H.util.ByteBuffer(n),p=tt.pbe.generatePkcs12Key(e,m,1,i,o),y=tt.pbe.generatePkcs12Key(e,m,2,i,o),x=H.des.createEncryptionCipher(p);x.start(y),x.update(I.toDer(t)),x.finish(),c=x.output.getBytes(),a=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,n),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,s.getBytes())])])}else{var l=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw l.algorithm=r.algorithm,l}var A=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[a,I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,c)]);return A};tt.decryptPrivateKeyInfo=function(t,e){var r=null,n={},i=[];if(!I.validate(t,Bp,n,i)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=I.derToOid(n.encryptionOid),a=tt.pbe.getCipher(o,n.encryptionParams,e),c=H.util.createBuffer(n.encryptedData);return a.update(c),a.finish()&&(r=I.fromDer(a.output)),r};tt.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:I.toDer(t).getBytes()};return H.pem.encode(r,{maxline:e})};tt.encryptedPrivateKeyFromPem=function(t){var e=H.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return I.fromDer(e.body)};tt.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=tt.wrapRsaPrivateKey(tt.privateKeyToAsn1(t));return n=tt.encryptPrivateKeyInfo(n,e,r),tt.encryptedPrivateKeyToPem(n)}var i,s,o,a;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,s=H.random.getBytesSync(8),a=H.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,s=H.random.getBytesSync(8),a=H.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var f=H.pbe.opensslDeriveBytes(e,s.substr(0,8),o),u=a(f);u.start(s),u.update(I.toDer(tt.privateKeyToAsn1(t))),u.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:H.util.bytesToHex(s).toUpperCase()},body:u.output.getBytes()};return H.pem.encode(h)};tt.decryptRsaPrivateKey=function(t,e){var r=null,n=H.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,o;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,o=H.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,o=H.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,o=H.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,o=H.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,o=H.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,o=function(h){return H.rc2.createDecryptionCipher(h,40)};break;case"RC2-64-CBC":s=8,o=function(h){return H.rc2.createDecryptionCipher(h,64)};break;case"RC2-128-CBC":s=16,o=function(h){return H.rc2.createDecryptionCipher(h,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var a=H.util.hexToBytes(n.dekInfo.parameters),c=H.pbe.opensslDeriveBytes(e,a.substr(0,8),s),f=o(c);if(f.start(a),f.update(H.util.createBuffer(n.body)),f.finish())r=f.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=tt.decryptPrivateKeyInfo(I.fromDer(r),e):r=I.fromDer(r),r!==null&&(r=tt.privateKeyFromAsn1(r)),r};tt.pbe.generatePkcs12Key=function(t,e,r,n,i,s){var o,a;if(typeof s>"u"||s===null){if(!("sha1"in H.md))throw new Error('"sha1" hash algorithm unavailable.');s=H.md.sha1.create()}var c=s.digestLength,f=s.blockLength,u=new H.util.ByteBuffer,h=new H.util.ByteBuffer;if(t!=null){for(a=0;a=0;a--)q=q>>8,q+=_.at(a)+U.at(a),U.setAt(a,q&255);M.putBuffer(U)}m=M,u.putBuffer(B)}return u.truncate(u.length()-i),u};tt.pbe.getCipher=function(t,e,r){switch(t){case tt.oids.pkcs5PBES2:return tt.pbe.getCipherForPBES2(t,e,r);case tt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case tt.oids["pbewithSHAAnd40BitRC2-CBC"]:return tt.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};tt.pbe.getCipherForPBES2=function(t,e,r){var n={},i=[];if(!I.validate(e,Ap,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}if(t=I.derToOid(n.kdfOid),t!==tt.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=I.derToOid(n.encOid),t!==tt.oids["aes128-CBC"]&&t!==tt.oids["aes192-CBC"]&&t!==tt.oids["aes256-CBC"]&&t!==tt.oids["des-EDE3-CBC"]&&t!==tt.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var o=n.kdfSalt,a=H.util.createBuffer(n.kdfIterationCount);a=a.getInt(a.length()<<3);var c,f;switch(tt.oids[t]){case"aes128-CBC":c=16,f=H.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,f=H.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,f=H.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,f=H.des.createDecryptionCipher;break;case"desCBC":c=8,f=H.des.createDecryptionCipher;break}var u=Lc(n.prfOid),h=H.pkcs5.pbkdf2(r,o,a,c,u),l=n.encIv,g=f(h);return g.start(l),g};tt.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},i=[];if(!I.validate(e,Cp,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=H.util.createBuffer(n.salt),a=H.util.createBuffer(n.iterations);a=a.getInt(a.length()<<3);var c,f,u;switch(t){case tt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,f=8,u=H.des.startDecrypting;break;case tt.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,f=8,u=function(p,y){var x=H.rc2.createDecryptionCipher(p,40);return x.start(y,null),x};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=Lc(n.prfOid),l=tt.pbe.generatePkcs12Key(r,o,1,a,c,h);h.start();var g=tt.pbe.generatePkcs12Key(r,o,2,a,f,h);return u(l,g)};tt.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in H.md))throw new Error('"md5" hash algorithm unavailable.');n=H.md.md5.create()}e===null&&(e="");for(var i=[_c(n,t+e)],s=16,o=1;s{var mt=lt();cr();Bt();var _n=wf.exports=mt.sha512=mt.sha512||{};mt.md.sha512=mt.md.algorithms.sha512=_n;var bf=mt.sha384=mt.sha512.sha384=mt.sha512.sha384||{};bf.create=function(){return _n.create("SHA-384")};mt.md.sha384=mt.md.algorithms.sha384=bf;mt.sha512.sha256=mt.sha512.sha256||{create:function(){return _n.create("SHA-512/256")}};mt.md["sha512/256"]=mt.md.algorithms["sha512/256"]=mt.sha512.sha256;mt.sha512.sha224=mt.sha512.sha224||{create:function(){return _n.create("SHA-512/224")}};mt.md["sha512/224"]=mt.md.algorithms["sha512/224"]=mt.sha512.sha224;_n.create=function(t){if(vf||Yy(),typeof t>"u"&&(t="SHA-512"),!(t in br))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=br[t],r=null,n=mt.util.createBuffer(),i=new Array(80),s=0;s<80;++s)i[s]=new Array(2);var o=64;switch(t){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var a={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength128=[];for(var c=a.messageLengthSize/4,f=0;f>>0,u>>>0];for(var h=a.fullMessageLength.length-1;h>=0;--h)a.fullMessageLength[h]+=u[1],u[1]=u[0]+(a.fullMessageLength[h]/4294967296>>>0),a.fullMessageLength[h]=a.fullMessageLength[h]>>>0,u[0]=u[1]/4294967296>>>0;return n.putBytes(c),mf(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),a},a.digest=function(){var c=mt.util.createBuffer();c.putBytes(n.bytes());var f=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize,u=f&a.blockLength-1;c.putBytes(Fo.substr(0,a.blockLength-u));for(var h,l,g=a.fullMessageLength[0]*8,d=0;d>>0,g+=l,c.putInt32(g>>>0),g=h>>>0;c.putInt32(g);for(var p=new Array(r.length),d=0;d=128;){for(C=0;C<16;++C)e[C][0]=r.getInt32()>>>0,e[C][1]=r.getInt32()>>>0;for(;C<80;++C)L=e[C-2],N=L[0],T=L[1],n=((N>>>19|T<<13)^(T>>>29|N<<3)^N>>>6)>>>0,i=((N<<13|T>>>19)^(T<<3|N>>>29)^(N<<26|T>>>6))>>>0,P=e[C-15],N=P[0],T=P[1],s=((N>>>1|T<<31)^(N>>>8|T<<24)^N>>>7)>>>0,o=((N<<31|T>>>1)^(N<<24|T>>>8)^(N<<25|T>>>7))>>>0,w=e[C-7],K=e[C-16],T=i+w[1]+o+K[1],e[C][0]=n+w[0]+s+K[0]+(T/4294967296>>>0)>>>0,e[C][1]=T>>>0;for(p=t[0][0],y=t[0][1],x=t[1][0],v=t[1][1],m=t[2][0],A=t[2][1],S=t[3][0],B=t[3][1],R=t[4][0],_=t[4][1],O=t[5][0],M=t[5][1],U=t[6][0],q=t[6][1],z=t[7][0],Z=t[7][1],C=0;C<80;++C)f=((R>>>14|_<<18)^(R>>>18|_<<14)^(_>>>9|R<<23))>>>0,u=((R<<18|_>>>14)^(R<<14|_>>>18)^(_<<23|R>>>9))>>>0,h=(U^R&(O^U))>>>0,l=(q^_&(M^q))>>>0,a=((p>>>28|y<<4)^(y>>>2|p<<30)^(y>>>7|p<<25))>>>0,c=((p<<4|y>>>28)^(y<<30|p>>>2)^(y<<25|p>>>7))>>>0,g=(p&x|m&(p^x))>>>0,d=(y&v|A&(y^v))>>>0,T=Z+u+l+Vo[C][1]+e[C][1],n=z+f+h+Vo[C][0]+e[C][0]+(T/4294967296>>>0)>>>0,i=T>>>0,T=c+d,s=a+g+(T/4294967296>>>0)>>>0,o=T>>>0,z=U,Z=q,U=O,q=M,O=R,M=_,T=B+i,R=S+n+(T/4294967296>>>0)>>>0,_=T>>>0,S=m,B=A,m=x,A=v,x=p,v=y,T=i+o,p=n+s+(T/4294967296>>>0)>>>0,y=T>>>0;T=t[0][1]+y,t[0][0]=t[0][0]+p+(T/4294967296>>>0)>>>0,t[0][1]=T>>>0,T=t[1][1]+v,t[1][0]=t[1][0]+x+(T/4294967296>>>0)>>>0,t[1][1]=T>>>0,T=t[2][1]+A,t[2][0]=t[2][0]+m+(T/4294967296>>>0)>>>0,t[2][1]=T>>>0,T=t[3][1]+B,t[3][0]=t[3][0]+S+(T/4294967296>>>0)>>>0,t[3][1]=T>>>0,T=t[4][1]+_,t[4][0]=t[4][0]+R+(T/4294967296>>>0)>>>0,t[4][1]=T>>>0,T=t[5][1]+M,t[5][0]=t[5][0]+O+(T/4294967296>>>0)>>>0,t[5][1]=T>>>0,T=t[6][1]+q,t[6][0]=t[6][0]+U+(T/4294967296>>>0)>>>0,t[6][1]=T>>>0,T=t[7][1]+Z,t[7][0]=t[7][0]+z+(T/4294967296>>>0)>>>0,t[7][1]=T>>>0,V-=128}}});var tu=ht((Cw,jf)=>{var jr=1e3,tn=jr*60,en=tn*60,Sr=en*24,B1=Sr*7,A1=Sr*365.25;jf.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return C1(t);if(r==="number"&&isFinite(t))return e.long?T1(t):I1(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function C1(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*A1;case"weeks":case"week":case"w":return r*B1;case"days":case"day":case"d":return r*Sr;case"hours":case"hour":case"hrs":case"hr":case"h":return r*en;case"minutes":case"minute":case"mins":case"min":case"m":return r*tn;case"seconds":case"second":case"secs":case"sec":case"s":return r*jr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function I1(t){var e=Math.abs(t);return e>=Sr?Math.round(t/Sr)+"d":e>=en?Math.round(t/en)+"h":e>=tn?Math.round(t/tn)+"m":e>=jr?Math.round(t/jr)+"s":t+"ms"}function T1(t){var e=Math.abs(t);return e>=Sr?Vi(t,e,Sr,"day"):e>=en?Vi(t,e,en,"hour"):e>=tn?Vi(t,e,tn,"minute"):e>=jr?Vi(t,e,jr,"second"):t+" ms"}function Vi(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var ru=ht((Iw,eu)=>{function _1(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=tu(),r.destroy=f,Object.keys(t).forEach(u=>{r[u]=t[u]}),r.names=[],r.skips=[],r.formatters={};function e(u){let h=0;for(let l=0;l{if(B==="%%")return"%";A++;let _=r.formatters[R];if(typeof _=="function"){let O=y[A];B=_.call(x,O),y.splice(A,1),A--}return B}),r.formatArgs.call(x,y),(x.log||r.log).apply(x,y)}return p.namespace=u,p.useColors=r.useColors(),p.color=r.selectColor(u),p.extend=n,p.destroy=r.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>l!==null?l:(g!==r.namespaces&&(g=r.namespaces,d=r.enabled(u)),d),set:y=>{l=y}}),typeof r.init=="function"&&r.init(p),p}function n(u,h){let l=r(this.namespace+(typeof h>"u"?":":h)+u);return l.log=this.log,l}function i(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let h,l=(typeof u=="string"?u:"").split(/[\s,]+/),g=l.length;for(h=0;h"-"+h)].join(",");return r.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let h,l;for(h=0,l=r.skips.length;h{jt.formatArgs=R1;jt.save=N1;jt.load=D1;jt.useColors=L1;jt.storage=k1();jt.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();jt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function L1(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function R1(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Hi.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}jt.log=console.debug||console.log||(()=>{});function N1(t){try{t?jt.storage.setItem("debug",t):jt.storage.removeItem("debug")}catch{}}function D1(){let t;try{t=jt.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function k1(){try{return localStorage}catch{}}Hi.exports=ru()(jt);var{formatters:P1}=Hi.exports;P1.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var V1={};_t(V1,{noise:()=>F1,pureJsCrypto:()=>di});function Me(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function rt(t=0){return globalThis.Buffer?.alloc!=null?Me(globalThis.Buffer.alloc(t)):new Uint8Array(t)}function It(t=0){return globalThis.Buffer?.allocUnsafe!=null?Me(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}var Su=Math.pow(2,7),Bu=Math.pow(2,14),Au=Math.pow(2,21),Zi=Math.pow(2,28),Xi=Math.pow(2,35),Qi=Math.pow(2,42),Ji=Math.pow(2,49),ct=128,Ht=127;function Be(t){if(tNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Cu(t,e,r=0){switch(Be(t)){case 8:e[r++]=t&255|ct,t/=128;case 7:e[r++]=t&255|ct,t/=128;case 6:e[r++]=t&255|ct,t/=128;case 5:e[r++]=t&255|ct,t/=128;case 4:e[r++]=t&255|ct,t>>>=7;case 3:e[r++]=t&255|ct,t>>>=7;case 2:e[r++]=t&255|ct,t>>>=7;case 1:{e[r++]=t&255,t>>>=7;break}default:throw new Error("unreachable")}return e}function Iu(t,e,r=0){switch(Be(t)){case 8:e.set(r++,t&255|ct),t/=128;case 7:e.set(r++,t&255|ct),t/=128;case 6:e.set(r++,t&255|ct),t/=128;case 5:e.set(r++,t&255|ct),t/=128;case 4:e.set(r++,t&255|ct),t>>>=7;case 3:e.set(r++,t&255|ct),t>>>=7;case 2:e.set(r++,t&255|ct),t>>>=7;case 1:{e.set(r++,t&255),t>>>=7;break}default:throw new Error("unreachable")}return e}function Tu(t,e){let r=t[e],n=0;if(n+=r&Ht,ri+s.length,0));let r=It(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return Me(r)}function Lt(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let r=0;for(let n of e)if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.push(n);else if(Fn(n))r+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}prepend(...e){this.prependAll(e)}prependAll(e){let r=0;for(let n of e.reverse())if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.unshift(n);else if(Fn(n))r+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}get(e){let r=da(this.bufs,e);return r.buf[r.index]}set(e,r){let n=da(this.bufs,e);n.buf[n.index]=r}write(e,r=0){if(e instanceof Uint8Array)for(let n=0;n0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,r){let{bufs:n,length:i}=this._subList(e,r);return Gt(n,i)}subarray(e,r){let{bufs:n,length:i}=this._subList(e,r);return n.length===1?n[0]:Gt(n,i)}sublist(e,r){let{bufs:n,length:i}=this._subList(e,r),s=new t;return s.length=i,s.bufs=n,s}_subList(e,r){if(e=e??0,r=r??this.length,e<0&&(e=this.length+e),r<0&&(r=this.length+r),e<0||r>this.length)throw new RangeError("index is out of bounds");if(e===r)return{bufs:[],length:0};if(e===0&&r===this.length)return{bufs:[...this.bufs],length:this.length};let n=[],i=0;for(let s=0;s=c)continue;let f=e>=a&&ea&&r<=c;if(f&&u){if(e===a&&r===c){n.push(o);break}let h=e-a;n.push(o.subarray(h,h+(r-e)));break}if(f){if(e===0){n.push(o);continue}n.push(o.subarray(e-a));continue}if(u){if(r===c){n.push(o);break}n.push(o.subarray(0,r-a));break}n.push(o)}return{bufs:n,length:r-e}}indexOf(e,r=0){if(!Fn(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(r=Number(r??0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),e.length===0)return r>this.length?this.length:r;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let s=256,o=new Int32Array(s);for(let h=0;h=0;l--){let g=this.get(h+l);if(n[l]!==g){u=Math.max(1,l-a[g]);break}}if(u===0)return h}return-1}getInt8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt8(0)}setInt8(e,r){let n=It(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,r),this.write(n,e)}getInt16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,r)}setInt16(e,r,n){let i=rt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,r,n),this.write(i,e)}getInt32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,r)}setInt32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,r,n),this.write(i,e)}getBigInt64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,r)}setBigInt64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,r,n),this.write(i,e)}getUint8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint8(0)}setUint8(e,r){let n=It(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,r),this.write(n,e)}getUint16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,r)}setUint16(e,r,n){let i=rt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,r,n),this.write(i,e)}getUint32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,r)}setUint32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,r,n),this.write(i,e)}getBigUint64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,r)}setBigUint64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,r,n),this.write(i,e)}getFloat32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,r)}setFloat32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,r,n),this.write(i,e)}getFloat64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,r)}setFloat64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,r,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof t)||e.bufs.length!==this.bufs.length)return!1;for(let r=0;ri+s.byteLength,0)),n.length=r,n}};function Vn(t){return t[Symbol.asyncIterator]!=null}var Hn=t=>{let e=Be(t),r=It(e);return la(t,r),Hn.bytes=e,r};Hn.bytes=0;function nn(t,e){e=e??{};let r=e.lengthEncoder??Hn;function*n(i){let s=r(i.byteLength);s instanceof Uint8Array?yield s:yield*s,i instanceof Uint8Array?yield i:yield*i}return Vn(t)?async function*(){for await(let i of t)yield*n(i)}():function*(){for(let i of t)yield*n(i)}()}nn.single=(t,e)=>{e=e??{};let r=e.lengthEncoder??Hn;return new Rt(r(t.byteLength),t)};var Br=zt(xa(),1);var Ru=8,Nu=1024*1024*4,er;(function(t){t[t.LENGTH=0]="LENGTH",t[t.DATA=1]="DATA"})(er||(er={}));var ts=t=>{let e=Mn(t);return ts.bytes=Be(e),e};ts.bytes=0;function sn(t,e){let r=new Rt,n=er.LENGTH,i=-1,s=e?.lengthDecoder??ts,o=e?.maxLengthLength??Ru,a=e?.maxDataLength??Nu;function*c(){for(;r.byteLength>0;){if(n===er.LENGTH)try{if(i=s(r),i<0)throw(0,Br.default)(new Error("invalid message length"),"ERR_INVALID_MSG_LENGTH");if(i>a)throw(0,Br.default)(new Error("message length too long"),"ERR_MSG_DATA_TOO_LONG");let f=s.bytes;r.consume(f),e?.onLength!=null&&e.onLength(i),n=er.DATA}catch(f){if(f instanceof RangeError){if(r.byteLength>o)throw(0,Br.default)(new Error("message length length too long"),"ERR_MSG_LENGTH_TOO_LONG");break}throw f}if(n===er.DATA){if(r.byteLength0)throw(0,Br.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}():function*(){for(let f of t)r.append(f),yield*c();if(r.byteLength>0)throw(0,Br.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}()}sn.fromReader=(t,e)=>{let r=1,n=async function*(){for(;;)try{let{done:s,value:o}=await t.next(r);if(s===!0)return;o!=null&&(yield o)}catch(s){if(s.code==="ERR_UNDER_READ")return{done:!0,value:null};throw s}finally{r=1}}();return sn(n,{...e??{},onLength:s=>{r=s}})};function oe(){let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}var qn=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=r??"ABORT_ERR"}};async function ma(t,e,r){if(e==null)return t;if(e.aborted)return Promise.reject(new qn(r?.errorMessage,r?.errorCode));let n,i=new qn(r?.errorMessage,r?.errorCode);try{return await Promise.race([t,new Promise((s,o)=>{n=()=>{o(i)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var es=class{needNext;haveNext;ended;nextResult;constructor(){this.ended=!1,this.needNext=oe(),this.needNext.resolve(),this.haveNext=oe()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("Have next but next was undefined");let e=this.nextResult;return this.nextResult=void 0,this.needNext.resolve(),this.needNext=oe(),e}async throw(e){return this.ended=!0,e!=null&&this.haveNext.reject(e),{done:!0,value:void 0}}async return(){let e={done:!0,value:void 0};return await this._push(void 0),e}async push(e,r){await this._push(e,r)}async end(e,r){e!=null?await this.throw(e):await this._push(void 0,r)}async _push(e,r){if(e!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");this.nextResult!=null&&await this.needNext.promise,e!=null?this.nextResult={done:!1,value:e}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=oe(),await ma(this.needNext.promise,r?.signal,r)}};function ba(){return new es}var zn=class extends Error{code;constructor(e,r){super(e),this.code=r}},rs=class extends zn{type;constructor(e){super(e,"ABORT_ERR"),this.type="aborted"}};function va(t,e){let r=ba();t.sink(r).catch(async o=>{await r.end(o)}),t.sink=async o=>{for await(let a of o)await r.push(a);await r.end()};let n=t.source;t.source[Symbol.iterator]!=null?n=t.source[Symbol.iterator]():t.source[Symbol.asyncIterator]!=null&&(n=t.source[Symbol.asyncIterator]());let i=new Rt;return{read:async(o,a)=>{a?.signal?.throwIfAborted();let c,f=new Promise((u,h)=>{c=()=>{h(new rs("Read aborted"))},a?.signal?.addEventListener("abort",c)});try{if(o==null){let{done:h,value:l}=await Promise.race([n.next(),f]);return h===!0?new Rt:l}for(;i.byteLength{a?.signal?.throwIfAborted(),o instanceof Uint8Array?await r.push(o,a):await r.push(o.subarray(),a)},unwrap:()=>{if(i.byteLength>0){let o=t.source;t.source=async function*(){e?.yieldBytes===!1?yield i:yield*i,yield*o}()}return t}}}var Gn=class extends Error{code;constructor(e,r){super(e),this.code=r}},wa=t=>Mn(t);wa.bytes=0;function ns(t,e={}){let r=va(t,e);return e.maxDataLength!=null&&e.maxLengthLength==null&&(e.maxLengthLength=Be(e.maxDataLength)),{read:async i=>{let s=-1,o=new Rt,a=e?.lengthDecoder??wa;for(;;){o.append(await r.read(1,i));try{s=a(o)}catch(c){if(c instanceof RangeError)continue;throw c}if(e?.maxLengthLength!=null&&o.byteLength>e.maxLengthLength)throw new Gn("message length length too long","ERR_MSG_LENGTH_TOO_LONG");if(s>-1)break}if(e?.maxDataLength!=null&&s>e.maxDataLength)throw new Gn("message length too long","ERR_MSG_DATA_TOO_LONG");return r.read(s,i)},write:async(i,s)=>{await r.write(nn.single(i,e),s)},writeV:async(i,s)=>{let o=new Rt(...i.map(a=>nn.single(a,e)));await r.write(o,s)},unwrap:()=>r.unwrap()}}function is(){let t=oe(),e=!1;return{sink:async r=>{if(e)throw new Error("already piped");e=!0,t.resolve(r)},source:async function*(){yield*await t.promise}()}}function Ea(){let t=is(),e=is();return[{source:t.source,sink:e.sink},{source:e.source,sink:t.sink}]}var $n=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},Ar=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new $n(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let r=this.head;this.head=r.next=new $n(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var ss=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function Wn(t={}){return ku(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},t)}function ku(t,e){e=e??{};let r=e.onEnd,n=new Ar,i,s,o,a=oe(),c=async()=>{try{return n.isEmpty()?o?{done:!0}:await new Promise((y,x)=>{s=v=>{s=null,n.push(v);try{y(t(n))}catch(m){x(m)}return i}}):t(n)}finally{n.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=oe()})}},f=y=>s!=null?s(y):(n.push(y),i),u=y=>(n=new Ar,s!=null?s({error:y}):(n.push({error:y}),i)),h=y=>{if(o)return i;if(e?.objectMode!==!0&&y?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return f({done:!1,value:y})},l=y=>o?i:(o=!0,y!=null?u(y):f({done:!0})),g=()=>(n=new Ar,l(),{done:!0}),d=y=>(l(y),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:c,return:g,throw:d,push:h,end:l,get readableLength(){return n.size},onEmpty:async y=>{let x=y?.signal;if(x?.throwIfAborted(),n.isEmpty())return;let v,m;x!=null&&(v=new Promise((A,S)=>{m=()=>{S(new ss)},x.addEventListener("abort",m)}));try{await Promise.race([a.promise,v])}finally{m!=null&&x!=null&&x?.removeEventListener("abort",m)}}},r==null)return i;let p=i;return i={[Symbol.asyncIterator](){return this},next(){return p.next()},throw(y){return p.throw(y),r!=null&&(r(y),r=void 0),{done:!0}},return(){return p.return(),r!=null&&(r(),r=void 0),{done:!0}},push:h,end(y){return p.end(y),r!=null&&(r(y),r=void 0),i},get readableLength(){return p.readableLength},onEmpty:y=>p.onEmpty(y)},i}function Pu(t){return t[Symbol.asyncIterator]!=null}function Uu(...t){let e=[];for(let r of t)Pu(r)||e.push(r);return e.length===t.length?function*(){for(let r of e)yield*r}():async function*(){let r=Wn({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(t.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var Sa=Uu;function Ba(t,...e){if(t==null)throw new Error("Empty pipeline");if(os(t)){let n=t;t=()=>n.source}else if(Ca(t)||Aa(t)){let n=t;t=()=>n}let r=[t,...e];if(r.length>1&&os(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n{let e;for(;t.length>0;)e=t.shift()(e);return e},Aa=t=>t?.[Symbol.asyncIterator]!=null,Ca=t=>t?.[Symbol.iterator]!=null,os=t=>t==null?!1:t.sink!=null&&t.source!=null,Ou=t=>e=>{let r=t.sink(e);if(r?.then!=null){let n=Wn({objectMode:!0});r.then(()=>{n.end()},o=>{n.end(o)});let i,s=t.source;if(Aa(s))i=async function*(){yield*s,n.end()};else if(Ca(s))i=function*(){yield*s,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return Sa(n,i())}return t.source};var Ia=!!globalThis.process?.env?.DUMP_SESSION_KEYS;var Mu=t=>t instanceof Uint8Array;var Ae=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Ta=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Fu=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Fu)throw new Error("Non little-endian hardware is not supported");function Yn(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Zn(t){if(typeof t=="string")t=Yn(t);else if(Mu(t))t=t.slice();else throw new Error(`expected Uint8Array, got ${typeof t}`);return t}var Vu=t=>Object.prototype.toString.call(t)==="[object Object]"&&t.constructor===Object;function _a(t,e){if(e!==void 0&&(typeof e!="object"||!Vu(e)))throw new Error("options must be object or undefined");return Object.assign(t,e)}function rr(t,e){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");if(typeof e=="number"&&t.length!==e)throw new Error(`Uint8Array length ${e} expected`)}function La(t,e){if(t.length!==e.length)throw new Error("equalBytes: Different size of Uint8Arrays");let r=!0;for(let n=0;n(Object.assign(e,t),e);function cs(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,f=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+f,a,n)}function Xn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function fs(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function Cr(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function us(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ra(t,e){Cr(t);let r=e.outputLen;if(t.lengtht[e++]&255|(t[e++]&255)<<8,hs=class{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=Zn(e),rr(e,32);let r=Ot(e,0),n=Ot(e,2),i=Ot(e,4),s=Ot(e,6),o=Ot(e,8),a=Ot(e,10),c=Ot(e,12),f=Ot(e,14);this.r[0]=r&8191,this.r[1]=(r>>>13|n<<3)&8191,this.r[2]=(n>>>10|i<<6)&7939,this.r[3]=(i>>>7|s<<9)&8191,this.r[4]=(s>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|f<<8)&8191,this.r[9]=f>>>5&127;for(let u=0;u<8;u++)this.pad[u]=Ot(e,16+2*u)}process(e,r,n=!1){let i=n?0:2048,{h:s,r:o}=this,a=o[0],c=o[1],f=o[2],u=o[3],h=o[4],l=o[5],g=o[6],d=o[7],p=o[8],y=o[9],x=Ot(e,r+0),v=Ot(e,r+2),m=Ot(e,r+4),A=Ot(e,r+6),S=Ot(e,r+8),B=Ot(e,r+10),R=Ot(e,r+12),_=Ot(e,r+14),O=s[0]+(x&8191),M=s[1]+((x>>>13|v<<3)&8191),U=s[2]+((v>>>10|m<<6)&8191),q=s[3]+((m>>>7|A<<9)&8191),z=s[4]+((A>>>4|S<<12)&8191),Z=s[5]+(S>>>1&8191),C=s[6]+((S>>>14|B<<2)&8191),N=s[7]+((B>>>11|R<<5)&8191),T=s[8]+((R>>>8|_<<8)&8191),L=s[9]+(_>>>5|i),w=0,P=w+O*a+M*(5*y)+U*(5*p)+q*(5*d)+z*(5*g);w=P>>>13,P&=8191,P+=Z*(5*l)+C*(5*h)+N*(5*u)+T*(5*f)+L*(5*c),w+=P>>>13,P&=8191;let K=w+O*c+M*a+U*(5*y)+q*(5*p)+z*(5*d);w=K>>>13,K&=8191,K+=Z*(5*g)+C*(5*l)+N*(5*h)+T*(5*u)+L*(5*f),w+=K>>>13,K&=8191;let V=w+O*f+M*c+U*a+q*(5*y)+z*(5*p);w=V>>>13,V&=8191,V+=Z*(5*d)+C*(5*g)+N*(5*l)+T*(5*h)+L*(5*u),w+=V>>>13,V&=8191;let W=w+O*u+M*f+U*c+q*a+z*(5*y);w=W>>>13,W&=8191,W+=Z*(5*p)+C*(5*d)+N*(5*g)+T*(5*l)+L*(5*h),w+=W>>>13,W&=8191;let Y=w+O*h+M*u+U*f+q*c+z*a;w=Y>>>13,Y&=8191,Y+=Z*(5*y)+C*(5*p)+N*(5*d)+T*(5*g)+L*(5*l),w+=Y>>>13,Y&=8191;let et=w+O*l+M*h+U*u+q*f+z*c;w=et>>>13,et&=8191,et+=Z*a+C*(5*y)+N*(5*p)+T*(5*d)+L*(5*g),w+=et>>>13,et&=8191;let X=w+O*g+M*l+U*h+q*u+z*f;w=X>>>13,X&=8191,X+=Z*c+C*a+N*(5*y)+T*(5*p)+L*(5*d),w+=X>>>13,X&=8191;let J=w+O*d+M*g+U*l+q*h+z*u;w=J>>>13,J&=8191,J+=Z*f+C*c+N*a+T*(5*y)+L*(5*p),w+=J>>>13,J&=8191;let dt=w+O*p+M*d+U*g+q*l+z*h;w=dt>>>13,dt&=8191,dt+=Z*u+C*f+N*c+T*a+L*(5*y),w+=dt>>>13,dt&=8191;let ut=w+O*y+M*p+U*d+q*g+z*l;w=ut>>>13,ut&=8191,ut+=Z*h+C*u+N*f+T*c+L*a,w+=ut>>>13,ut&=8191,w=(w<<2)+w|0,w=w+P|0,P=w&8191,w=w>>>13,K+=w,s[0]=P,s[1]=K,s[2]=V,s[3]=W,s[4]=Y,s[5]=et,s[6]=X,s[7]=J,s[8]=dt,s[9]=ut}finalize(){let{h:e,pad:r}=this,n=new Uint16Array(10),i=e[1]>>>13;e[1]&=8191;for(let a=2;a<10;a++)e[a]+=i,i=e[a]>>>13,e[a]&=8191;e[0]+=i*5,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,n[0]=e[0]+5,i=n[0]>>>13,n[0]&=8191;for(let a=1;a<10;a++)n[a]=e[a]+i,i=n[a]>>>13,n[a]&=8191;n[9]-=8192;let s=(i^1)-1;for(let a=0;a<10;a++)n[a]&=s;s=~s;for(let a=0;a<10;a++)e[a]=e[a]&s|n[a];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let o=e[0]+r[0];e[0]=o&65535;for(let a=1;a<8;a++)o=(e[a]+r[a]|0)+(o>>>16)|0,e[a]=o&65535}update(e){us(this);let{buffer:r,blockLen:n}=this;e=Zn(e);let i=e.length;for(let s=0;s>>0,e[s++]=n[o]>>>8;return e}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}};function Hu(t){let e=(n,i)=>t(i).update(Zn(n)).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}var Na=Hu(t=>new hs(t));var qu=Yn("expand 16-byte k"),zu=Yn("expand 32-byte k"),Gu=Ae(qu),$u=Ae(zu);function G(t,e){return t<>>32-e}function ls(t){return t.byteOffset%4===0}var Qn=64,Wu=16,ka=2**32-1,Da=new Uint32Array;function Yu(t,e,r,n,i,s,o,a){let c=i.length,f=new Uint8Array(Qn),u=Ae(f),h=ls(i)&&ls(s),l=h?Ae(i):Da,g=h?Ae(s):Da;for(let d=0;d=ka)throw new Error("arx: counter overflow");let p=Math.min(Qn,c-d);if(h&&p===Qn){let y=d/4;if(d%4!==0)throw new Error("arx: invalid block position");for(let x=0,v;x{Cr(a),Cr(c),Cr(f);let l=f.length;if(u||(u=new Uint8Array(l)),Cr(u),Xn(h),h<0||h>=ka)throw new Error("arx: counter overflow");if(u.length0;)g.pop().fill(0);return u}}function Ka(t,e,r,n,i,s=20){let o=t[0],a=t[1],c=t[2],f=t[3],u=e[0],h=e[1],l=e[2],g=e[3],d=e[4],p=e[5],y=e[6],x=e[7],v=i,m=r[0],A=r[1],S=r[2],B=o,R=a,_=c,O=f,M=u,U=h,q=l,z=g,Z=d,C=p,N=y,T=x,L=v,w=m,P=A,K=S;for(let W=0;W{t.update(e);let r=e.length%16;r&&t.update(Ju.subarray(r))},ju=new Uint8Array(32);function Ua(t,e,r,n,i){let s=t(e,r,ju),o=Na.create(s);i&&Pa(o,i),Pa(o,n);let a=new Uint8Array(16),c=Ta(a);cs(c,0,BigInt(i?i.length:0),!0),cs(c,8,BigInt(n.length),!0),o.update(a);let f=o.digest();return s.fill(0),f}var Oa=t=>(e,r,n)=>(rr(e,32),rr(r),{encrypt:(s,o)=>{let a=s.length,c=a+16;o?rr(o,c):o=new Uint8Array(c),t(e,r,s,o,1);let f=Ua(t,e,r,o.subarray(0,-16),n);return o.set(f,a),o},decrypt:(s,o)=>{let a=s.length,c=a-16;if(a<16)throw new Error("encrypted data must be at least 16 bytes");o?rr(o,c):o=new Uint8Array(c);let f=s.subarray(0,-16),u=s.subarray(-16),h=Ua(t,e,r,f,n);if(!La(u,h))throw new Error("invalid tag");return t(e,r,f,o,1),o}}),ps=as({blockSize:64,nonceLength:12,tagLength:16},Oa(Xu)),Zg=as({blockSize:64,nonceLength:24,tagLength:16},Oa(Qu));function Jn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function ys(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function on(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Jn(t.outputLen),Jn(t.blockLen)}function Ir(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ma(t,e){ys(t);let r=e.outputLen;if(t.lengtht instanceof Uint8Array;var ti=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ae=(t,e)=>t<<32-e|t>>>e,th=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!th)throw new Error("Non little-endian hardware is not supported");function gs(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Fe(t){if(typeof t=="string"&&(t=gs(t)),!Fa(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function ei(...t){let e=new Uint8Array(t.reduce((n,i)=>n+i.length,0)),r=0;return t.forEach(n=>{if(!Fa(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}var Tr=class{clone(){return this._cloneInto()}},tx={}.toString;function ri(t){let e=n=>t().update(Fe(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function nr(t=32){if(jn&&typeof jn.getRandomValues=="function")return jn.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function eh(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,f=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+f,a,n)}var _r=class extends Tr{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ti(this.buffer)}update(e){Ir(this);let{view:r,buffer:n,blockLen:i}=this;e=Fe(e);let s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let h=o;hu.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h>xs&ni)}:{h:Number(t>>xs&ni)|0,l:Number(t&ni)|0}}function rh(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),ih=(t,e,r)=>t>>>r,sh=(t,e,r)=>t<<32-r|e>>>r,oh=(t,e,r)=>t>>>r|e<<32-r,ah=(t,e,r)=>t<<32-r|e>>>r,ch=(t,e,r)=>t<<64-r|e>>>r-32,fh=(t,e,r)=>t>>>r-32|e<<64-r,uh=(t,e)=>e,hh=(t,e)=>t,lh=(t,e,r)=>t<>>32-r,dh=(t,e,r)=>e<>>32-r,ph=(t,e,r)=>e<>>64-r,yh=(t,e,r)=>t<>>64-r;function gh(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var xh=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),mh=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,bh=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),vh=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,wh=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Eh=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0;var Sh={fromBig:Va,split:rh,toBig:nh,shrSH:ih,shrSL:sh,rotrSH:oh,rotrSL:ah,rotrBH:ch,rotrBL:fh,rotr32H:uh,rotr32L:hh,rotlSH:lh,rotlSL:dh,rotlBH:ph,rotlBL:yh,add:gh,add3L:xh,add3H:mh,add4L:bh,add4H:vh,add5H:Eh,add5L:wh},j=Sh;var[Bh,Ah]=j.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Ve=new Uint32Array(80),He=new Uint32Array(80),ms=class extends _r{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:f,El:u,Fh:h,Fl:l,Gh:g,Gl:d,Hh:p,Hl:y}=this;return[e,r,n,i,s,o,a,c,f,u,h,l,g,d,p,y]}set(e,r,n,i,s,o,a,c,f,u,h,l,g,d,p,y){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=f|0,this.El=u|0,this.Fh=h|0,this.Fl=l|0,this.Gh=g|0,this.Gl=d|0,this.Hh=p|0,this.Hl=y|0}process(e,r){for(let m=0;m<16;m++,r+=4)Ve[m]=e.getUint32(r),He[m]=e.getUint32(r+=4);for(let m=16;m<80;m++){let A=Ve[m-15]|0,S=He[m-15]|0,B=j.rotrSH(A,S,1)^j.rotrSH(A,S,8)^j.shrSH(A,S,7),R=j.rotrSL(A,S,1)^j.rotrSL(A,S,8)^j.shrSL(A,S,7),_=Ve[m-2]|0,O=He[m-2]|0,M=j.rotrSH(_,O,19)^j.rotrBH(_,O,61)^j.shrSH(_,O,6),U=j.rotrSL(_,O,19)^j.rotrBL(_,O,61)^j.shrSL(_,O,6),q=j.add4L(R,U,He[m-7],He[m-16]),z=j.add4H(q,B,M,Ve[m-7],Ve[m-16]);Ve[m]=z|0,He[m]=q|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:f,Dl:u,Eh:h,El:l,Fh:g,Fl:d,Gh:p,Gl:y,Hh:x,Hl:v}=this;for(let m=0;m<80;m++){let A=j.rotrSH(h,l,14)^j.rotrSH(h,l,18)^j.rotrBH(h,l,41),S=j.rotrSL(h,l,14)^j.rotrSL(h,l,18)^j.rotrBL(h,l,41),B=h&g^~h&p,R=l&d^~l&y,_=j.add5L(v,S,R,Ah[m],He[m]),O=j.add5H(_,x,A,B,Bh[m],Ve[m]),M=_|0,U=j.rotrSH(n,i,28)^j.rotrBH(n,i,34)^j.rotrBH(n,i,39),q=j.rotrSL(n,i,28)^j.rotrBL(n,i,34)^j.rotrBL(n,i,39),z=n&s^n&a^s&a,Z=i&o^i&c^o&c;x=p|0,v=y|0,p=g|0,y=d|0,g=h|0,d=l|0,{h,l}=j.add(f|0,u|0,O|0,M|0),f=a|0,u=c|0,a=s|0,c=o|0,s=n|0,o=i|0;let C=j.add3L(M,q,Z);n=j.add3H(C,O,U,z),i=C|0}({h:n,l:i}=j.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=j.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=j.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:f,l:u}=j.add(this.Dh|0,this.Dl|0,f|0,u|0),{h,l}=j.add(this.Eh|0,this.El|0,h|0,l|0),{h:g,l:d}=j.add(this.Fh|0,this.Fl|0,g|0,d|0),{h:p,l:y}=j.add(this.Gh|0,this.Gl|0,p|0,y|0),{h:x,l:v}=j.add(this.Hh|0,this.Hl|0,x|0,v|0),this.set(n,i,s,o,a,c,f,u,h,l,g,d,p,y,x,v)}roundClean(){Ve.fill(0),He.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var bs=ri(()=>new ms);var oi={};_t(oi,{bitGet:()=>Nh,bitLen:()=>Rh,bitMask:()=>an,bitSet:()=>Dh,bytesToHex:()=>Ce,bytesToNumberBE:()=>Ie,bytesToNumberLE:()=>ce,concatBytes:()=>_e,createHmacDrbg:()=>Es,ensureBytes:()=>yt,equalBytes:()=>_h,hexToBytes:()=>ir,hexToNumber:()=>ws,numberToBytesBE:()=>qe,numberToBytesLE:()=>Te,numberToHexUnpadded:()=>za,numberToVarBytesBE:()=>Th,utf8ToBytes:()=>Lh,validateObject:()=>ee});var qa=BigInt(0),ii=BigInt(1),Ch=BigInt(2),si=t=>t instanceof Uint8Array,Ih=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Ce(t){if(!si(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0)),r=0;return t.forEach(n=>{if(!si(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function _h(t,e){if(t.length!==e.length)return!1;for(let r=0;rqa;t>>=ii,e+=1);return e}function Nh(t,e){return t>>BigInt(e)&ii}var Dh=(t,e,r)=>t|(r?ii:qa)<(Ch<new Uint8Array(t),Ha=t=>Uint8Array.from(t);function Es(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=vs(t),i=vs(t),s=0,o=()=>{n.fill(1),i.fill(0),s=0},a=(...h)=>r(i,n,...h),c=(h=vs())=>{i=a(Ha([0]),h),n=a(),h.length!==0&&(i=a(Ha([1]),h),n=a())},f=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let h=0,l=[];for(;h{o(),c(h);let g;for(;!(g=l(f()));)c();return o(),g}}var kh={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function ee(t,e,r={}){let n=(i,s,o)=>{let a=kh[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);let c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(let[i,s]of Object.entries(e))n(i,s,!1);for(let[i,s]of Object.entries(r))n(i,s,!0);return t}var Tt=BigInt(0),bt=BigInt(1),sr=BigInt(2),Ph=BigInt(3),Ss=BigInt(4),Ga=BigInt(5),$a=BigInt(8),Uh=BigInt(9),Kh=BigInt(16);function at(t,e){let r=t%e;return r>=Tt?r:e+r}function Bs(t,e,r){if(r<=Tt||e 0");if(r===bt)return Tt;let n=bt;for(;e>Tt;)e&bt&&(n=n*t%r),t=t*t%r,e>>=bt;return n}function gt(t,e,r){let n=t;for(;e-- >Tt;)n*=n,n%=r;return n}function ai(t,e){if(t===Tt||e<=Tt)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=at(t,e),n=e,i=Tt,s=bt,o=bt,a=Tt;for(;r!==Tt;){let f=n/r,u=n%r,h=i-o*f,l=s-a*f;n=r,r=u,i=o,s=a,o=h,a=l}if(n!==bt)throw new Error("invert: does not exist");return at(i,e)}function Oh(t){let e=(t-bt)/sr,r,n,i;for(r=t-bt,n=0;r%sr===Tt;r/=sr,n++);for(i=sr;i(at(t,e)&bt)===bt,Fh=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function As(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Fh.reduce((n,i)=>(n[i]="function",n),e);return ee(t,r)}function Vh(t,e,r){if(r 0");if(r===Tt)return t.ONE;if(r===bt)return e;let n=t.ONE,i=e;for(;r>Tt;)r&bt&&(n=t.mul(n,i)),i=t.sqr(i),r>>=bt;return n}function Hh(t,e){let r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function Cs(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function ci(t,e,r=!1,n={}){if(t<=Tt)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:s}=Cs(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=Mh(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:an(i),ZERO:Tt,ONE:bt,create:c=>at(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Tt<=c&&cc===Tt,isOdd:c=>(c&bt)===bt,neg:c=>at(-c,t),eql:(c,f)=>c===f,sqr:c=>at(c*c,t),add:(c,f)=>at(c+f,t),sub:(c,f)=>at(c-f,t),mul:(c,f)=>at(c*f,t),pow:(c,f)=>Vh(a,c,f),div:(c,f)=>at(c*ai(f,t),t),sqrN:c=>c*c,addN:(c,f)=>c+f,subN:(c,f)=>c-f,mulN:(c,f)=>c*f,inv:c=>ai(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>Hh(a,c),cmov:(c,f,u)=>u?f:c,toBytes:c=>r?Te(c,s):qe(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?ce(c):Ie(c)}});return Object.freeze(a)}function Ya(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}function Za(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function Is(t){let e=Za(t);return e+Math.ceil(e/2)}function Xa(t,e,r=!1){let n=t.length,i=Za(e),s=Is(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let o=r?Ie(t):ce(t),a=at(o,e-bt)+bt;return r?Te(a,i):qe(a,i)}var zh=BigInt(0),Ts=BigInt(1);function fi(t,e){let r=(i,s)=>{let o=s.negate();return i?o:s},n=i=>{let s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>zh;)s&Ts&&(o=o.add(a)),a=a.double(),s>>=Ts;return o},precomputeWindow(i,s){let{windows:o,windowSize:a}=n(s),c=[],f=i,u=f;for(let h=0;h>=g,y>c&&(y-=l,o+=Ts);let x=p,v=p+Math.abs(y)-1,m=d%2!==0,A=y<0;y===0?u=u.add(r(m,s[x])):f=f.add(r(A,s[v]))}return{p:f,f:u}},wNAFCached(i,s,o,a){let c=i._WINDOW_SIZE||1,f=s.get(i);return f||(f=this.precomputeWindow(i,c),c!==1&&s.set(i,a(f))),this.wNAF(c,f,o)}}}function cn(t){return As(t.Fp),ee(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Cs(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var fe=BigInt(0),Qt=BigInt(1),ui=BigInt(2),Gh=BigInt(8),$h={zip215:!0};function Wh(t){let e=cn(t);return ee(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function hi(t){let e=Wh(t),{Fp:r,n,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,f=ui<{try{return{isValid:!0,value:r.sqrt(L*r.inv(w))}}catch{return{isValid:!1,value:fe}}}),l=e.adjustScalarBytes||(L=>L),g=e.domain||((L,w,P)=>{if(w.length||P)throw new Error("Contexts/pre-hash are not supported");return L}),d=L=>typeof L=="bigint"&&fed(L)&&d(w)&&LL===fe||p(L,f);function x(L,w){if(p(L,w))return L;throw new Error(`Expected valid scalar < ${w}, got ${typeof L} ${L}`)}function v(L){return L===fe?L:x(L,n)}let m=new Map;function A(L){if(!(L instanceof S))throw new Error("ExtendedPoint expected")}class S{constructor(w,P,K,V){if(this.ex=w,this.ey=P,this.ez=K,this.et=V,!y(w))throw new Error("x required");if(!y(P))throw new Error("y required");if(!y(K))throw new Error("z required");if(!y(V))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(w){if(w instanceof S)throw new Error("extended point not allowed");let{x:P,y:K}=w||{};if(!y(P)||!y(K))throw new Error("invalid affine point");return new S(P,K,Qt,u(P*K))}static normalizeZ(w){let P=r.invertBatch(w.map(K=>K.ez));return w.map((K,V)=>K.toAffine(P[V])).map(S.fromAffine)}_setWindowSize(w){this._WINDOW_SIZE=w,m.delete(this)}assertValidity(){let{a:w,d:P}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:K,ey:V,ez:W,et:Y}=this,et=u(K*K),X=u(V*V),J=u(W*W),dt=u(J*J),ut=u(et*w),Ut=u(J*u(ut+X)),Kt=u(dt+u(P*u(et*X)));if(Ut!==Kt)throw new Error("bad point: equation left != right (1)");let Ct=u(K*V),Vt=u(W*Y);if(Ct!==Vt)throw new Error("bad point: equation left != right (2)")}equals(w){A(w);let{ex:P,ey:K,ez:V}=this,{ex:W,ey:Y,ez:et}=w,X=u(P*et),J=u(W*V),dt=u(K*et),ut=u(Y*V);return X===J&&dt===ut}is0(){return this.equals(S.ZERO)}negate(){return new S(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:w}=e,{ex:P,ey:K,ez:V}=this,W=u(P*P),Y=u(K*K),et=u(ui*u(V*V)),X=u(w*W),J=P+K,dt=u(u(J*J)-W-Y),ut=X+Y,Ut=ut-et,Kt=X-Y,Ct=u(dt*Ut),Vt=u(ut*Kt),Se=u(dt*Kt),tr=u(Ut*ut);return new S(Ct,Vt,tr,Se)}add(w){A(w);let{a:P,d:K}=e,{ex:V,ey:W,ez:Y,et}=this,{ex:X,ey:J,ez:dt,et:ut}=w;if(P===BigInt(-1)){let ia=u((W-V)*(J+X)),sa=u((W+V)*(J-X)),Yi=u(sa-ia);if(Yi===fe)return this.double();let oa=u(Y*ui*ut),aa=u(et*ui*dt),ca=aa+oa,fa=sa+ia,ua=aa-oa,du=u(ca*Yi),pu=u(fa*ua),yu=u(ca*ua),gu=u(Yi*fa);return new S(du,pu,gu,yu)}let Ut=u(V*X),Kt=u(W*J),Ct=u(et*K*ut),Vt=u(Y*dt),Se=u((V+W)*(X+J)-Ut-Kt),tr=Vt-Ct,rn=Vt+Ct,na=u(Kt-P*Ut),fu=u(Se*tr),uu=u(rn*na),hu=u(Se*na),lu=u(tr*rn);return new S(fu,uu,lu,hu)}subtract(w){return this.add(w.negate())}wNAF(w){return _.wNAFCached(this,m,w,S.normalizeZ)}multiply(w){let{p:P,f:K}=this.wNAF(x(w,n));return S.normalizeZ([P,K])[0]}multiplyUnsafe(w){let P=v(w);return P===fe?R:this.equals(R)||P===Qt?this:this.equals(B)?this.wNAF(P).p:_.unsafeLadder(this,P)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return _.unsafeLadder(this,n).is0()}toAffine(w){let{ex:P,ey:K,ez:V}=this,W=this.is0();w==null&&(w=W?Gh:r.inv(V));let Y=u(P*w),et=u(K*w),X=u(V*w);if(W)return{x:fe,y:Qt};if(X!==Qt)throw new Error("invZ was invalid");return{x:Y,y:et}}clearCofactor(){let{h:w}=e;return w===Qt?this:this.multiplyUnsafe(w)}static fromHex(w,P=!1){let{d:K,a:V}=e,W=r.BYTES;w=yt("pointHex",w,W);let Y=w.slice(),et=w[W-1];Y[W-1]=et&-129;let X=ce(Y);X===fe||(P?x(X,f):x(X,r.ORDER));let J=u(X*X),dt=u(J-Qt),ut=u(K*J-V),{isValid:Ut,value:Kt}=h(dt,ut);if(!Ut)throw new Error("Point.fromHex: invalid y coordinate");let Ct=(Kt&Qt)===Qt,Vt=(et&128)!==0;if(!P&&Kt===fe&&Vt)throw new Error("Point.fromHex: x=0 and x_0=1");return Vt!==Ct&&(Kt=u(-Kt)),S.fromAffine({x:Kt,y:X})}static fromPrivateKey(w){return U(w).point}toRawBytes(){let{x:w,y:P}=this.toAffine(),K=Te(P,r.BYTES);return K[K.length-1]|=w&Qt?128:0,K}toHex(){return Ce(this.toRawBytes())}}S.BASE=new S(e.Gx,e.Gy,Qt,u(e.Gx*e.Gy)),S.ZERO=new S(fe,Qt,Qt,fe);let{BASE:B,ZERO:R}=S,_=fi(S,a*8);function O(L){return at(L,n)}function M(L){return O(ce(L))}function U(L){let w=a;L=yt("private key",L,w);let P=yt("hashed private key",s(L),2*w),K=l(P.slice(0,w)),V=P.slice(w,2*w),W=M(K),Y=B.multiply(W),et=Y.toRawBytes();return{head:K,prefix:V,scalar:W,point:Y,pointBytes:et}}function q(L){return U(L).pointBytes}function z(L=new Uint8Array,...w){let P=_e(...w);return M(s(g(P,yt("context",L),!!i)))}function Z(L,w,P={}){L=yt("message",L),i&&(L=i(L));let{prefix:K,scalar:V,pointBytes:W}=U(w),Y=z(P.context,K,L),et=B.multiply(Y).toRawBytes(),X=z(P.context,et,W,L),J=O(Y+X*V);v(J);let dt=_e(et,Te(J,r.BYTES));return yt("result",dt,a*2)}let C=$h;function N(L,w,P,K=C){let{context:V,zip215:W}=K,Y=r.BYTES;L=yt("signature",L,2*Y),w=yt("message",w),i&&(w=i(w));let et=ce(L.slice(Y,2*Y)),X,J,dt;try{X=S.fromHex(P,W),J=S.fromHex(L.slice(0,Y),W),dt=B.multiplyUnsafe(et)}catch{return!1}if(!W&&X.isSmallOrder())return!1;let ut=z(V,J.toRawBytes(),X.toRawBytes(),w);return J.add(X.multiplyUnsafe(ut)).subtract(dt).clearCofactor().equals(S.ZERO)}return B._setWindowSize(8),{CURVE:e,getPublicKey:q,sign:Z,verify:N,ExtendedPoint:S,utils:{getExtendedPublicKey:U,randomPrivateKey:()=>o(r.BYTES),precompute(L=8,w=S.BASE){return w._setWindowSize(L),w.multiply(BigInt(3)),w}}}}var fn=BigInt(0),_s=BigInt(1);function Yh(t){return ee(t,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...t})}function Qa(t){let e=Yh(t),{P:r}=e,n=m=>at(m,r),i=e.montgomeryBits,s=Math.ceil(i/8),o=e.nByteLength,a=e.adjustScalarBytes||(m=>m),c=e.powPminus2||(m=>Bs(m,r-BigInt(2),r));function f(m,A,S){let B=n(m*(A-S));return A=n(A-B),S=n(S+B),[A,S]}function u(m){if(typeof m=="bigint"&&fn<=m&&m=fn;C--){let N=B>>C&_s;q^=N,z=f(q,_,M),_=z[0],M=z[1],z=f(q,O,U),O=z[0],U=z[1],q=N;let T=_+O,L=n(T*T),w=_-O,P=n(w*w),K=L-P,V=M+U,W=M-U,Y=n(W*T),et=n(V*w),X=Y+et,J=Y-et;M=n(X*X),U=n(R*n(J*J)),_=n(L*P),O=n(K*(L+n(h*K)))}z=f(q,_,M),_=z[0],M=z[1],z=f(q,O,U),O=z[0],U=z[1];let Z=c(O);return n(_*Z)}function g(m){return Te(n(m),s)}function d(m){let A=yt("u coordinate",m,s);return o===s&&(A[o-1]&=127),ce(A)}function p(m){let A=yt("scalar",m);if(A.length!==s&&A.length!==o)throw new Error(`Expected ${s} or ${o} bytes, got ${A.length}`);return ce(a(A))}function y(m,A){let S=d(A),B=p(m),R=l(S,B);if(R===fn)throw new Error("Invalid private or public key received");return g(R)}let x=g(e.Gu);function v(m){return y(m,x)}return{scalarMult:y,scalarMultBase:v,getSharedSecret:(m,A)=>y(m,A),getPublicKey:m=>v(m),utils:{randomPrivateKey:()=>e.randomBytes(e.nByteLength)},GuBytes:x}}var un=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Ja=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),Cx=BigInt(0),Zh=BigInt(1),Ls=BigInt(2),Xh=BigInt(5),ja=BigInt(10),Qh=BigInt(20),Jh=BigInt(40),t0=BigInt(80);function e0(t){let e=un,n=t*t%e*t%e,i=gt(n,Ls,e)*n%e,s=gt(i,Zh,e)*t%e,o=gt(s,Xh,e)*s%e,a=gt(o,ja,e)*o%e,c=gt(a,Qh,e)*a%e,f=gt(c,Jh,e)*c%e,u=gt(f,t0,e)*f%e,h=gt(u,t0,e)*f%e,l=gt(h,ja,e)*o%e;return{pow_p_5_8:gt(l,Ls,e)*t%e,b2:n}}function r0(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function jh(t,e){let r=un,n=at(e*e*e,r),i=at(n*n*e,r),s=e0(t*i).pow_p_5_8,o=at(t*n*s,r),a=at(e*o*o,r),c=o,f=at(o*Ja,r),u=a===t,h=a===at(-t,r),l=a===at(-t*Ja,r);return u&&(o=c),(h||l)&&(o=f),Wa(o,r)&&(o=at(-o,r)),{isValid:u||h,value:o}}var Le=ci(un,void 0,!0),Rs={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Le,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:bs,randomBytes:nr,adjustScalarBytes:r0,uvRatio:jh},Lr=hi(Rs);function n0(t,e,r){if(e.length>255)throw new Error("Context is too big");return ei(gs("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,e.length]),e,t)}var Ix=hi({...Rs,domain:n0}),Tx=hi({...Rs,domain:n0,prehash:bs}),hn=Qa({P:un,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:t=>{let e=un,{pow_p_5_8:r,b2:n}=e0(t);return at(gt(r,BigInt(3),e)*n,e)},adjustScalarBytes:r0,randomBytes:nr});var tl=(Le.ORDER+BigInt(3))/BigInt(8),_x=Le.pow(Ls,tl),Lx=Le.sqrt(Le.neg(Le.ONE)),Rx=(Le.ORDER-BigInt(5))/BigInt(8),Nx=BigInt(486662);var Dx=Ya(Le,Le.neg(BigInt(486664)));var kx=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Px=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Ux=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Kx=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var Ox=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var li=class extends Tr{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,on(e);let n=Fe(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew li(t,e).update(r).digest();Rr.create=(t,e)=>new li(t,e);function s0(t,e,r){return on(t),r===void 0&&(r=new Uint8Array(t.outputLen)),Rr(t,Fe(r),Fe(e))}var Ns=new Uint8Array([0]),i0=new Uint8Array;function o0(t,e,r,n=32){if(on(t),Jn(n),n>255*t.outputLen)throw new Error("Length should be <= 255*HashLen");let i=Math.ceil(n/t.outputLen);r===void 0&&(r=i0);let s=new Uint8Array(i*t.outputLen),o=Rr.create(t,e),a=o._cloneInto(),c=new Uint8Array(o.outputLen);for(let f=0;ft&e^~t&r,rl=(t,e,r)=>t&e^t&r^e&r,nl=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ze=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ge=new Uint32Array(64),Ds=class extends _r{constructor(){super(64,32,8,!1),this.A=ze[0]|0,this.B=ze[1]|0,this.C=ze[2]|0,this.D=ze[3]|0,this.E=ze[4]|0,this.F=ze[5]|0,this.G=ze[6]|0,this.H=ze[7]|0}get(){let{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let h=0;h<16;h++,r+=4)Ge[h]=e.getUint32(r,!1);for(let h=16;h<64;h++){let l=Ge[h-15],g=Ge[h-2],d=ae(l,7)^ae(l,18)^l>>>3,p=ae(g,17)^ae(g,19)^g>>>10;Ge[h]=p+Ge[h-7]+d+Ge[h-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:f,H:u}=this;for(let h=0;h<64;h++){let l=ae(a,6)^ae(a,11)^ae(a,25),g=u+l+el(a,c,f)+nl[h]+Ge[h]|0,p=(ae(n,2)^ae(n,13)^ae(n,22))+rl(n,i,s)|0;u=f,f=c,c=a,a=o+g|0,o=s,s=i,i=n,n=g+p|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,f=f+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,f,u)}roundClean(){Ge.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Nr=ri(()=>new Ds);var di={hashSHA256(t){return Nr(t)},getHKDF(t,e){let r=s0(Nr,e,t),i=o0(Nr,r,void 0,96),s=i.subarray(0,32),o=i.subarray(32,64),a=i.subarray(64,96);return[s,o,a]},generateX25519KeyPair(){let t=hn.utils.randomPrivateKey();return{publicKey:hn.getPublicKey(t),privateKey:t}},generateX25519KeyPairFromSeed(t){return{publicKey:hn.getPublicKey(t),privateKey:t}},generateX25519SharedKey(t,e){return hn.getSharedSecret(t,e)},chaCha20Poly1305Encrypt(t,e,r,n){return ps(n,e,r).encrypt(t)},chaCha20Poly1305Decrypt(t,e,r,n,i){return ps(n,e,r).decrypt(t,i)}};var a0=di;var Dr=t=>{let e=It(2);return new DataView(e.buffer,e.byteOffset,e.byteLength).setUint16(0,t,!1),e};Dr.bytes=2;var ln=t=>{if(t.length<2)throw RangeError("Could not decode int16BE");return t instanceof Uint8Array?new DataView(t.buffer,t.byteOffset,t.byteLength).getUint16(0,!1):t.getUint16(0)};ln.bytes=2;function c0(t){return new Rt(t.ne,t.ciphertext)}function f0(t){return new Rt(t.ne,t.ns,t.ciphertext)}function u0(t){return new Rt(t.ns,t.ciphertext)}function h0(t){if(t.length<32)throw new Error("Cannot decode stage 0 MessageBuffer: length less than 32 bytes.");return{ne:t.subarray(0,32),ciphertext:t.subarray(32,t.length),ns:rt(0)}}function l0(t){if(t.length<80)throw new Error("Cannot decode stage 1 MessageBuffer: length less than 80 bytes.");return{ne:t.subarray(0,32),ns:t.subarray(32,80),ciphertext:t.subarray(80,t.length)}}function d0(t){if(t.length<48)throw new Error("Cannot decode stage 2 MessageBuffer: length less than 48 bytes.");return{ne:rt(0),ns:t.subarray(0,48),ciphertext:t.subarray(48,t.length)}}var y0=16;function g0(t,e){return async function*(r){for await(let n of r)for(let i=0;in.length&&(s=n.length);let o=t.encrypt(n.subarray(i,s),t.session);e?.encryptedPackets.increment(),yield new Rt(Dr(o.byteLength),o)}}}function x0(t,e){return async function*(r){for await(let n of r)for(let i=0;in.length&&(s=n.length),s-y0Dp});function Tp(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,A=new Uint8Array(m);x!==v;){for(var S=d[x],B=0,R=m-1;(S!==0||B>>0,A[R]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");y=B,x++}for(var _=m-y;_!==m&&A[_]===0;)_++;for(var O=c.repeat(p);_>>0,m=new Uint8Array(v);d[p];){var A=r[d.charCodeAt(p)];if(A===255)return;for(var S=0,B=v-1;(A!==0||S>>0,m[B]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");x=S,p++}if(d[p]!==" "){for(var R=v-x;R!==v&&m[R]===0;)R++;for(var _=new Uint8Array(y+(v-R)),O=y;R!==v;)_[O++]=m[R++];return _}}}function g(d){var p=l(d);if(p)return p;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:l,decode:g}}var _p=Tp,Lp=_p,kc=Lp;var K2=new Uint8Array(0);var Pc=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var Uc=t=>new TextEncoder().encode(t),Kc=t=>new TextDecoder().decode(t);var ro=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},no=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Mc(this,e)}},io=class{constructor(e){this.decoders=e}or(e){return Mc(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Mc=(t,e)=>new io({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),so=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ro(e,r,n),this.decoder=new no(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Or=({name:t,prefix:e,encode:r,decode:n})=>new so(t,e,r,n),Xe=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=kc(r,e);return Or({prefix:t,name:e,encode:n,decode:s=>ke(i(s))})},Rp=(t,e,r,n)=>{let i={};for(let u=0;u=8&&(a-=8,o[f++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},Np=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<Or({prefix:e,name:t,encode(i){return Np(i,n,r)},decode(i){return Rp(i,n,r,t)}});var Dp=Xe({prefix:"9",name:"base10",alphabet:"0123456789"});var ao={};_t(ao,{base16:()=>kp,base16upper:()=>Pp});var kp=St({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Pp=St({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var co={};_t(co,{base2:()=>Up});var Up=St({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var fo={};_t(fo,{base256emoji:()=>Vp});var Fc=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Kp=Fc.reduce((t,e,r)=>(t[r]=e,t),[]),Op=Fc.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Mp(t){return t.reduce((e,r)=>(e+=Kp[r],e),"")}function Fp(t){let e=[];for(let r of t){let n=Op[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var Vp=Or({prefix:"\u{1F680}",name:"base256emoji",encode:Mp,decode:Fp});var uo={};_t(uo,{base32:()=>Qe,base32hex:()=>Gp,base32hexpad:()=>Wp,base32hexpadupper:()=>Yp,base32hexupper:()=>$p,base32pad:()=>qp,base32padupper:()=>zp,base32upper:()=>Hp,base32z:()=>Zp});var Qe=St({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Hp=St({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),qp=St({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),zp=St({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Gp=St({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),$p=St({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Wp=St({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Yp=St({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Zp=St({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ho={};_t(ho,{base36:()=>Xp,base36upper:()=>Qp});var Xp=Xe({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Qp=Xe({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var lo={};_t(lo,{base58btc:()=>Mt,base58flickr:()=>Jp});var Mt=Xe({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Jp=Xe({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var po={};_t(po,{base64:()=>Mr,base64pad:()=>jp,base64url:()=>ty,base64urlpad:()=>ey});var Mr=St({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),jp=St({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ty=St({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ey=St({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var yo={};_t(yo,{base8:()=>ry});var ry=St({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var go={};_t(go,{identity:()=>ny});var ny=Or({prefix:"\0",name:"identity",encode:t=>Kc(t),decode:t=>Uc(t)});var J2=new TextEncoder,j2=new TextDecoder;var mo={};_t(mo,{identity:()=>Je});var oy=qc,Vc=128,ay=127,cy=~ay,fy=Math.pow(2,31);function qc(t,e,r){e=e||[],r=r||0;for(var n=r;t>=fy;)e[r++]=t&255|Vc,t/=128;for(;t&cy;)e[r++]=t&255|Vc,t>>>=7;return e[r]=t|0,qc.bytes=r-n+1,e}var uy=xo,hy=128,Hc=127;function xo(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw xo.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&Hc)<=hy);return xo.bytes=s-n,r}var ly=Math.pow(2,7),dy=Math.pow(2,14),py=Math.pow(2,21),yy=Math.pow(2,28),gy=Math.pow(2,35),xy=Math.pow(2,42),my=Math.pow(2,49),by=Math.pow(2,56),vy=Math.pow(2,63),wy=function(t){return t[wn.decode(t,e),wn.decode.bytes],Fr=(t,e,r=0)=>(wn.encode(t,e,r),e),Vr=t=>wn.encodingLength(t);var ve=(t,e)=>{let r=e.byteLength,n=Vr(t),i=n+Vr(r),s=new Uint8Array(i+r);return Fr(t,s,0),Fr(r,s,n),s.set(e,i),new Hr(t,r,e,s)},Sn=t=>{let e=ke(t),[r,n]=En(e),[i,s]=En(e.subarray(n)),o=e.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new Hr(r,i,o,e)},zc=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&Pc(t.bytes,r.bytes)}},Hr=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var Gc=0,By="identity",$c=ke,Ay=t=>ve(Gc,$c(t)),Je={code:Gc,name:By,encode:$c,digest:Ay};var wo={};_t(wo,{sha256:()=>Ft,sha512:()=>Cy});var vo=({name:t,code:e,encode:r})=>new bo(t,e,r),bo=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?ve(this.code,r):r.then(n=>ve(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Yc=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Ft=vo({name:"sha2-256",code:18,encode:Yc("SHA-256")}),Cy=vo({name:"sha2-512",code:19,encode:Yc("SHA-512")});var Zc=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return Ty(r,Eo(t),e||Mt.encoder);default:return _y(r,Eo(t),e||Qe.encoder)}};var Xc=new WeakMap,Eo=t=>{let e=Xc.get(t);if(e==null){let r=new Map;return Xc.set(t,r),r}return e},lr=class t{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==Bn)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Ly)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=ve(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&zc(e.multihash,n.multihash)}toString(e){return Zc(this,e)}toJSON(){return{"/":Zc(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new t(n,i,s,o||Qc(n,i,s.bytes))}else if(r[Ry]===!0){let{version:n,multihash:i,code:s}=r,o=Sn(i);return t.create(n,s,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==Bn)throw new Error(`Version 0 CID must use dag-pb (code: ${Bn}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=Qc(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,Bn,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=ke(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new Hr(r.multihashCode,r.digestSize,s,i);return[r.version===0?t.createV0(o):t.createV1(r.codec,o),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,l]=En(e.subarray(r));return r+=l,h},i=n(),s=Bn;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),c=n(),f=r+c,u=f-o;return{version:i,codec:s,multihashCode:a,digestSize:c,multihashSize:u,size:f}}static parse(e,r){let[n,i]=Iy(e,r),s=t.decode(i);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Eo(s).set(n,e),s}},Iy=(t,e)=>{switch(t[0]){case"Q":{let r=e||Mt;return[Mt.prefix,r.decode(`${Mt.prefix}${t}`)]}case Mt.prefix:{let r=e||Mt;return[Mt.prefix,r.decode(t)]}case Qe.prefix:{let r=e||Qe;return[Qe.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},Ty=(t,e,r)=>{let{prefix:n}=r;if(n!==Mt.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let s=r.encode(t).slice(1);return e.set(n,s),s}else return i},_y=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let s=r.encode(t);return e.set(n,s),s}else return i},Bn=112,Ly=18,Qc=(t,e,r)=>{let n=Vr(t),i=n+Vr(e),s=new Uint8Array(i+r.byteLength);return Fr(t,s,0),Fr(e,s,n),s.set(r,i),s},Ry=Symbol.for("@ipld/js-cid/CID");var zr={...go,...co,...yo,...oo,...ao,...uo,...ho,...lo,...po,...fo},ym={...wo,...mo};function jc(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var Jc=jc("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),So=jc("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);let e=It(t.length);for(let r=0;rmr,Ed25519PublicKey:()=>Tn,generateKeyPair:()=>zy,generateKeyPairFromSeed:()=>yf,unmarshalEd25519PrivateKey:()=>Hy,unmarshalEd25519PublicKey:()=>qy});var Gr=32,Pe=64,ki=32;async function tf(){let t=Lr.utils.randomPrivateKey(),e=Lr.getPublicKey(t);return{privateKey:sf(t,e),publicKey:e}}async function ef(t){if(t.length!==ki)throw new TypeError('"seed" must be 32 bytes in length.');if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');let e=t,r=Lr.getPublicKey(e);return{privateKey:sf(e,r),publicKey:r}}async function rf(t,e){let r=t.subarray(0,ki);return Lr.sign(e,r)}async function nf(t,e,r){return Lr.verify(e,r,t)}function sf(t,e){let r=new Uint8Array(Pe);for(let n=0;n>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return dr;if(ePy)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,i=e-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>hf&&(i=0n,++n>hf&&(n=0n))),new t(Number(i),Number(n))}static fromNumber(e){if(e===0)return dr;let r=e<0;r&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new t(n,i)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):dr}},dr=new Xt(0,0);dr.toBigInt=function(){return 0n};dr.zzEncode=dr.zzDecode=function(){return this};dr.length=function(){return 1};var hf=4294967296n;function lf(t){let e=0,r=0;for(let n=0;n191&&a<224?s[o++]=(a&31)<<6|t[e++]&63:a>239&&a<365?(a=((a&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,s[o++]=55296+(a>>10),s[o++]=56320+(a&1023)):s[o++]=(a&15)<<12|(t[e++]&63)<<6|t[e++]&63,o>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,s)),o=0);return i!=null?(o>0&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))}function To(t,e,r){let n=r,i,s;for(let o=0;o>6|192,e[r++]=i&63|128):(i&64512)===55296&&((s=t.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(s&1023),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128);return r-n}function le(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Pi(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var _o=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,le(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw le(this,4);return Pi(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw le(this,4);return Pi(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw le(this,4);let e=cf(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw le(this,4);let e=uf(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw le(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return df(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw le(this,e);this.pos+=e}else do if(this.pos>=this.len)throw le(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Xt(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw le(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw le(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw le(this,8);let e=Pi(this.buf,this.pos+=4),r=Pi(this.buf,this.pos+=4);return new Xt(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Lo(t){return new _o(t instanceof Uint8Array?t:t.subarray())}function pr(t,e){let r=Lo(t);return e.decode(r)}function Ro(t){let e=t??8192,r=e>>>1,n,i=e;return function(o){if(o<1||o>r)return It(o);i+o>e&&(n=It(e),i=0);let a=n.subarray(i,i+=o);return i&7&&(i=(i|7)+1),a}}var yr=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function No(){}var ko=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},Uy=Ro();function Ky(t){return globalThis.Buffer!=null?It(t):Uy(t)}var In=class{len;head;tail;states;constructor(){this.len=0,this.head=new yr(No,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new yr(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new Po((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(An,10,Xt.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=Xt.fromBigInt(e);return this._push(An,r.length(),r)}uint64Number(e){let r=Xt.fromNumber(e);return this._push(An,r.length(),r)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=Xt.fromBigInt(e).zzEncode();return this._push(An,r.length(),r)}sint64Number(e){let r=Xt.fromNumber(e).zzEncode();return this._push(An,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(Do,1,e?1:0)}fixed32(e){return this._push(Cn,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=Xt.fromBigInt(e);return this._push(Cn,4,r.lo)._push(Cn,4,r.hi)}fixed64Number(e){let r=Xt.fromNumber(e);return this._push(Cn,4,r.lo)._push(Cn,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(af,4,e)}double(e){return this._push(ff,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(Do,1,0):this.uint32(r)._push(My,r,e)}string(e){let r=lf(e);return r!==0?this.uint32(r)._push(To,r,e):this._push(Do,1,0)}fork(){return this.states=new ko(this),this.head=this.tail=new yr(No,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new yr(No,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=Ky(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function Do(t,e,r){e[r]=t&255}function Oy(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var Po=class extends yr{next;constructor(e,r){super(Oy,e,r),this.next=void 0}};function An(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function Cn(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function My(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(In.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(Fy,e,t),this},In.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(Vy,e,t),this});function Fy(t,e,r){e.set(t,r)}function Vy(t,e,r){t.length<40?To(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(At(t),r)}function Uo(){return new In}function gr(t,e){let r=Uo();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var Wr;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(Wr||(Wr={}));function Ui(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function Ko(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(s,o){let a=e(s);o.int32(a)},n=function(s){let o=s.int32();return e(o)};return Ui("enum",Wr.VARINT,r,n)}function xr(t,e){return Ui("message",Wr.LENGTH_DELIMITED,t,e)}var wt;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.Secp256k1="Secp256k1"})(wt||(wt={}));var Oo;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.Secp256k1=2]="Secp256k1"})(Oo||(Oo={}));(function(t){t.codec=()=>Ko(Oo)})(wt||(wt={}));var we;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),wt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=wt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(we||(we={}));var Ee;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),wt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=wt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Ee||(Ee={}));var Tn=class{_key;constructor(e){this._key=Yr(e,Gr)}async verify(e,r){return nf(this._key,r,e)}marshal(){return this._key}get bytes(){return we.encode({Type:wt.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},mr=class{_key;_publicKey;constructor(e,r){this._key=Yr(e,Pe),this._publicKey=Yr(r,Gr)}async sign(e){return rf(this._key,e)}get public(){return new Tn(this._publicKey)}marshal(){return this._key}get bytes(){return Ee.encode({Type:wt.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=Je.digest(this.public.bytes);return Mt.encode(e.bytes).substring(1)}async export(e,r="libp2p-key"){if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function Hy(t){if(t.length>Pe){t=Yr(t,Pe+Gr);let n=t.subarray(0,Pe),i=t.subarray(Pe,t.length);return new mr(n,i)}t=Yr(t,Pe);let e=t.subarray(0,Pe),r=t.subarray(Gr);return new mr(e,r)}function qy(t){return t=Yr(t,Gr),new Tn(t)}async function zy(){let{privateKey:t,publicKey:e}=await tf();return new mr(t,e)}async function yf(t){let{privateKey:e,publicKey:r}=await ef(t);return new mr(e,r)}function Yr(t,e){if(t=Uint8Array.from(t??[]),t.length!==e)throw new it(`Key must be a Uint8Array of length ${e}, got ${t.length}`,"ERR_INVALID_KEY_TYPE");return t}function Et(t,e="utf8"){let r=Di[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var pb=zt(Bt(),1),yb=zt(Ti(),1),gf=zt(lt(),1);function de(t,e){let r=Uint8Array.from(t.abs().toByteArray());if(r=r[0]===0?r.subarray(1):r,e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Gt([new Uint8Array(e-r.length),r])}return Et(r,"base64url")}function Jt(t){let e=xf(t);return new gf.default.jsbn.BigInteger(Et(e,"base16"),16)}function xf(t,e){let r=At(t,"base64urlpad");if(e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Gt([new Uint8Array(e-r.length),r])}return r}var Gy={"P-256":256,"P-384":384,"P-521":521},$y=Object.keys(Gy),Cb=$y.join(" / ");var zo={};_t(zo,{MAX_KEY_SIZE:()=>Nn,RsaPrivateKey:()=>Zr,RsaPublicKey:()=>Rn,fromJwk:()=>n1,generateKeyPair:()=>i1,unmarshalRsaPrivateKey:()=>e1,unmarshalRsaPublicKey:()=>r1});var Ln=zt(lt(),1);var uv=zt(Ef(),1);function Oi(t){if(isNaN(t)||t<=0)throw new it("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return nr(t)}var $b=zt(Ri(),1),Ho=zt(lt(),1);function Sf(t,e){return e.map(r=>Jt(t[r]))}function Bf(t){return Ho.default.pki.setRsaPrivateKey(...Sf(t,["n","e","d","p","q","dp","dq","qi"]))}function Af(t){return Ho.default.pki.setRsaPublicKey(...Sf(t,["n","e"]))}var vr={};_t(vr,{jwkToPkcs1:()=>Xy,jwkToPkix:()=>Jy,pkcs1ToJwk:()=>Zy,pkixToJwk:()=>Qy});var Zb=zt(mn(),1),Xb=zt(Ri(),1);var Ue=zt(lt(),1);function Zy(t){let e=Ue.default.asn1.fromDer(Et(t,"ascii")),r=Ue.default.pki.privateKeyFromAsn1(e);return{kty:"RSA",n:de(r.n),e:de(r.e),d:de(r.d),p:de(r.p),q:de(r.q),dp:de(r.dP),dq:de(r.dQ),qi:de(r.qInv),alg:"RS256"}}function Xy(t){if(t.n==null||t.e==null||t.d==null||t.p==null||t.q==null||t.dp==null||t.dq==null||t.qi==null)throw new it("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ue.default.pki.privateKeyToAsn1({n:Jt(t.n),e:Jt(t.e),d:Jt(t.d),p:Jt(t.p),q:Jt(t.q),dP:Jt(t.dp),dQ:Jt(t.dq),qInv:Jt(t.qi)});return At(Ue.default.asn1.toDer(e).getBytes(),"ascii")}function Qy(t){let e=Ue.default.asn1.fromDer(Et(t,"ascii")),r=Ue.default.pki.publicKeyFromAsn1(e);return{kty:"RSA",n:de(r.n),e:de(r.e)}}function Jy(t){if(t.n==null||t.e==null)throw new it("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ue.default.pki.publicKeyToAsn1({n:Jt(t.n),e:Jt(t.e)});return At(Ue.default.asn1.toDer(e).getBytes(),"ascii")}async function Cf(t){let e=await Zt.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await _f(e);return{privateKey:r[0],publicKey:r[1]}}async function qo(t){let r=[await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await jy(t)],n=await _f({privateKey:r[0],publicKey:r[1]});return{privateKey:n[0],publicKey:n[1]}}async function If(t,e){let r=await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),n=await Zt.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(e));return new Uint8Array(n,0,n.byteLength)}async function Tf(t,e,r){let n=await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return Zt.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},n,e,r)}async function _f(t){if(t.privateKey==null||t.publicKey==null)throw new it("Private and public key are required","ERR_INVALID_PARAMETERS");return Promise.all([Zt.get().subtle.exportKey("jwk",t.privateKey),Zt.get().subtle.exportKey("jwk",t.publicKey)])}async function jy(t){return Zt.get().subtle.importKey("jwk",{kty:t.kty,n:t.n,e:t.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}function Lf(t,e,r,n){let i=e?Af(t):Bf(t),s=Et(Uint8Array.from(r),"ascii"),o=n(s,i);return At(o,"ascii")}function Rf(t,e){return Lf(t,!0,e,(r,n)=>n.encrypt(r))}function Nf(t,e){return Lf(t,!1,e,(r,n)=>n.decrypt(r))}function Mi(t){if(t.kty!=="RSA")throw new it("invalid key type","ERR_INVALID_KEY_TYPE");if(t.n==null)throw new it("invalid key modulus","ERR_INVALID_KEY_MODULUS");return At(t.n,"base64url").length*8}var Nn=8192,Rn=class{_key;constructor(e){this._key=e}async verify(e,r){return Tf(this._key,r,e)}marshal(){return vr.jwkToPkix(this._key)}get bytes(){return we.encode({Type:wt.RSA,Data:this.marshal()}).subarray()}encrypt(e){return Rf(this._key,e)}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},Zr=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r}genSecret(){return Oi(16)}async sign(e){return If(this._key,e)}get public(){if(this._publicKey==null)throw new it("public key not provided","ERR_PUBKEY_NOT_PROVIDED");return new Rn(this._publicKey)}decrypt(e){return Nf(this._key,e)}marshal(){return vr.jwkToPkcs1(this._key)}get bytes(){return Ee.encode({Type:wt.RSA,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=await this.public.hash();return Et(e,"base58btc")}async export(e,r="pkcs-8"){if(r==="pkcs-8"){let n=new Ln.default.util.ByteBuffer(this.marshal()),i=Ln.default.asn1.fromDer(n),s=Ln.default.pki.privateKeyFromAsn1(i),o={algorithm:"aes256",count:1e4,saltSize:128/8,prfAlgorithm:"sha512"};return Ln.default.pki.encryptRsaPrivateKey(s,e,o)}else{if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}}};async function e1(t){let e=vr.pkcs1ToJwk(t);if(Mi(e)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let r=await qo(e);return new Zr(r.privateKey,r.publicKey)}function r1(t){let e=vr.pkixToJwk(t);if(Mi(e)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");return new Rn(e)}async function n1(t){if(Mi(t)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await qo(t);return new Zr(e.privateKey,e.publicKey)}async function i1(t){if(t>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await Cf(t);return new Zr(e.privateKey,e.publicKey)}var Yo={};_t(Yo,{Secp256k1PrivateKey:()=>kn,Secp256k1PublicKey:()=>Dn,generateKeyPair:()=>g1,unmarshalSecp256k1PrivateKey:()=>p1,unmarshalSecp256k1PublicKey:()=>y1});function s1(t){let e=cn(t);ee(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:o1,hexToBytes:a1}=oi,wr={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){let{Err:e}=wr;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:o1(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=wr,r=typeof t=="string"?a1(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:s}=wr._parseInt(r.subarray(2)),{d:o,l:a}=wr._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){let e=f=>Number.parseInt(f[0],16)&8?"00"+f:f,r=f=>{let u=f.toString(16);return u.length&1?`0${u}`:u},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},Ke=BigInt(0),ie=BigInt(1),gv=BigInt(2),Df=BigInt(3),xv=BigInt(4);function c1(t){let e=s1(t),{Fp:r}=e,n=e.toBytes||((d,p,y)=>{let x=p.toAffine();return _e(Uint8Array.from([4]),r.toBytes(x.x),r.toBytes(x.y))}),i=e.fromBytes||(d=>{let p=d.subarray(1),y=r.fromBytes(p.subarray(0,r.BYTES)),x=r.fromBytes(p.subarray(r.BYTES,2*r.BYTES));return{x:y,y:x}});function s(d){let{a:p,b:y}=e,x=r.sqr(d),v=r.mul(x,d);return r.add(r.add(v,r.mul(d,p)),y)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(d){return typeof d=="bigint"&&Ker.eql(m,r.ZERO);return v(y)&&v(x)?h.ZERO:new h(y,x,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){let y=r.invertBatch(p.map(x=>x.pz));return p.map((x,v)=>x.toAffine(y[v])).map(h.fromAffine)}static fromHex(p){let y=h.fromAffine(i(yt("pointHex",p)));return y.assertValidity(),y}static fromPrivateKey(p){return h.BASE.multiply(c(p))}_setWindowSize(p){this._WINDOW_SIZE=p,f.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:p,y}=this.toAffine();if(!r.isValid(p)||!r.isValid(y))throw new Error("bad point: x or y not FE");let x=r.sqr(y),v=s(p);if(!r.eql(x,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:p}=this.toAffine();if(r.isOdd)return!r.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){u(p);let{px:y,py:x,pz:v}=this,{px:m,py:A,pz:S}=p,B=r.eql(r.mul(y,S),r.mul(m,v)),R=r.eql(r.mul(x,S),r.mul(A,v));return B&&R}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){let{a:p,b:y}=e,x=r.mul(y,Df),{px:v,py:m,pz:A}=this,S=r.ZERO,B=r.ZERO,R=r.ZERO,_=r.mul(v,v),O=r.mul(m,m),M=r.mul(A,A),U=r.mul(v,m);return U=r.add(U,U),R=r.mul(v,A),R=r.add(R,R),S=r.mul(p,R),B=r.mul(x,M),B=r.add(S,B),S=r.sub(O,B),B=r.add(O,B),B=r.mul(S,B),S=r.mul(U,S),R=r.mul(x,R),M=r.mul(p,M),U=r.sub(_,M),U=r.mul(p,U),U=r.add(U,R),R=r.add(_,_),_=r.add(R,_),_=r.add(_,M),_=r.mul(_,U),B=r.add(B,_),M=r.mul(m,A),M=r.add(M,M),_=r.mul(M,U),S=r.sub(S,_),R=r.mul(M,O),R=r.add(R,R),R=r.add(R,R),new h(S,B,R)}add(p){u(p);let{px:y,py:x,pz:v}=this,{px:m,py:A,pz:S}=p,B=r.ZERO,R=r.ZERO,_=r.ZERO,O=e.a,M=r.mul(e.b,Df),U=r.mul(y,m),q=r.mul(x,A),z=r.mul(v,S),Z=r.add(y,x),C=r.add(m,A);Z=r.mul(Z,C),C=r.add(U,q),Z=r.sub(Z,C),C=r.add(y,v);let N=r.add(m,S);return C=r.mul(C,N),N=r.add(U,z),C=r.sub(C,N),N=r.add(x,v),B=r.add(A,S),N=r.mul(N,B),B=r.add(q,z),N=r.sub(N,B),_=r.mul(O,C),B=r.mul(M,z),_=r.add(B,_),B=r.sub(q,_),_=r.add(q,_),R=r.mul(B,_),q=r.add(U,U),q=r.add(q,U),z=r.mul(O,z),C=r.mul(M,C),q=r.add(q,z),z=r.sub(U,z),z=r.mul(O,z),C=r.add(C,z),U=r.mul(q,C),R=r.add(R,U),U=r.mul(N,C),B=r.mul(Z,B),B=r.sub(B,U),U=r.mul(Z,q),_=r.mul(N,_),_=r.add(_,U),new h(B,R,_)}subtract(p){return this.add(p.negate())}is0(){return this.equals(h.ZERO)}wNAF(p){return g.wNAFCached(this,f,p,y=>{let x=r.invertBatch(y.map(v=>v.pz));return y.map((v,m)=>v.toAffine(x[m])).map(h.fromAffine)})}multiplyUnsafe(p){let y=h.ZERO;if(p===Ke)return y;if(a(p),p===ie)return this;let{endo:x}=e;if(!x)return g.unsafeLadder(this,p);let{k1neg:v,k1:m,k2neg:A,k2:S}=x.splitScalar(p),B=y,R=y,_=this;for(;m>Ke||S>Ke;)m&ie&&(B=B.add(_)),S&ie&&(R=R.add(_)),_=_.double(),m>>=ie,S>>=ie;return v&&(B=B.negate()),A&&(R=R.negate()),R=new h(r.mul(R.px,x.beta),R.py,R.pz),B.add(R)}multiply(p){a(p);let y=p,x,v,{endo:m}=e;if(m){let{k1neg:A,k1:S,k2neg:B,k2:R}=m.splitScalar(y),{p:_,f:O}=this.wNAF(S),{p:M,f:U}=this.wNAF(R);_=g.constTimeNegate(A,_),M=g.constTimeNegate(B,M),M=new h(r.mul(M.px,m.beta),M.py,M.pz),x=_.add(M),v=O.add(U)}else{let{p:A,f:S}=this.wNAF(y);x=A,v=S}return h.normalizeZ([x,v])[0]}multiplyAndAddUnsafe(p,y,x){let v=h.BASE,m=(S,B)=>B===Ke||B===ie||!S.equals(v)?S.multiplyUnsafe(B):S.multiply(B),A=m(this,y).add(m(p,x));return A.is0()?void 0:A}toAffine(p){let{px:y,py:x,pz:v}=this,m=this.is0();p==null&&(p=m?r.ONE:r.inv(v));let A=r.mul(y,p),S=r.mul(x,p),B=r.mul(v,p);if(m)return{x:r.ZERO,y:r.ZERO};if(!r.eql(B,r.ONE))throw new Error("invZ was invalid");return{x:A,y:S}}isTorsionFree(){let{h:p,isTorsionFree:y}=e;if(p===ie)return!0;if(y)return y(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:p,clearCofactor:y}=e;return p===ie?this:y?y(h,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),n(h,this,p)}toHex(p=!0){return Ce(this.toRawBytes(p))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);let l=e.nBitLength,g=fi(h,e.endo?Math.ceil(l/2):l);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function f1(t){let e=cn(t);return ee(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function kf(t){let e=f1(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(C){return KeCe(qe(C,e.nByteLength));function d(C){let N=n>>ie;return C>N}function p(C){return d(C)?a(-C):C}let y=(C,N,T)=>Ie(C.slice(N,T));class x{constructor(N,T,L){this.r=N,this.s=T,this.recovery=L,this.assertValidity()}static fromCompact(N){let T=e.nByteLength;return N=yt("compactSignature",N,T*2),new x(y(N,0,T),y(N,T,2*T))}static fromDER(N){let{r:T,s:L}=wr.toSig(yt("DER",N));return new x(T,L)}assertValidity(){if(!l(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!l(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(N){return new x(this.r,this.s,N)}recoverPublicKey(N){let{r:T,s:L,recovery:w}=this,P=R(yt("msgHash",N));if(w==null||![0,1,2,3].includes(w))throw new Error("recovery id invalid");let K=w===2||w===3?T+e.n:T;if(K>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let V=w&1?"03":"02",W=f.fromHex(V+g(K)),Y=c(K),et=a(-P*Y),X=a(L*Y),J=f.BASE.multiplyAndAddUnsafe(W,et,X);if(!J)throw new Error("point at infinify");return J.assertValidity(),J}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return ir(this.toDERHex())}toDERHex(){return wr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ir(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}let v={isValidPrivateKey(C){try{return u(C),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let C=Is(e.n);return Xa(e.randomBytes(C),e.n)},precompute(C=8,N=f.BASE){return N._setWindowSize(C),N.multiply(BigInt(3)),N}};function m(C,N=!0){return f.fromPrivateKey(C).toRawBytes(N)}function A(C){let N=C instanceof Uint8Array,T=typeof C=="string",L=(N||T)&&C.length;return N?L===i||L===s:T?L===2*i||L===2*s:C instanceof f}function S(C,N,T=!0){if(A(C))throw new Error("first arg must be private key");if(!A(N))throw new Error("second arg must be public key");return f.fromHex(N).multiply(u(C)).toRawBytes(T)}let B=e.bits2int||function(C){let N=Ie(C),T=C.length*8-e.nBitLength;return T>0?N>>BigInt(T):N},R=e.bits2int_modN||function(C){return a(B(C))},_=an(e.nBitLength);function O(C){if(typeof C!="bigint")throw new Error("bigint expected");if(!(Ke<=C&&C<_))throw new Error(`bigint expected < 2^${e.nBitLength}`);return qe(C,e.nByteLength)}function M(C,N,T=U){if(["recovered","canonical"].some(ut=>ut in T))throw new Error("sign() legacy options not supported");let{hash:L,randomBytes:w}=e,{lowS:P,prehash:K,extraEntropy:V}=T;P==null&&(P=!0),C=yt("msgHash",C),K&&(C=yt("prehashed msgHash",L(C)));let W=R(C),Y=u(N),et=[O(Y),O(W)];if(V!=null){let ut=V===!0?w(r.BYTES):V;et.push(yt("extraEntropy",ut))}let X=_e(...et),J=W;function dt(ut){let Ut=B(ut);if(!l(Ut))return;let Kt=c(Ut),Ct=f.BASE.multiply(Ut).toAffine(),Vt=a(Ct.x);if(Vt===Ke)return;let Se=a(Kt*a(J+Vt*Y));if(Se===Ke)return;let tr=(Ct.x===Vt?0:2)|Number(Ct.y&ie),rn=Se;return P&&d(Se)&&(rn=p(Se),tr^=1),new x(Vt,rn,tr)}return{seed:X,k2sig:dt}}let U={lowS:e.lowS,prehash:!1},q={lowS:e.lowS,prehash:!1};function z(C,N,T=U){let{seed:L,k2sig:w}=M(C,N,T),P=e;return Es(P.hash.outputLen,P.nByteLength,P.hmac)(L,w)}f.BASE._setWindowSize(8);function Z(C,N,T,L=q){let w=C;if(N=yt("msgHash",N),T=yt("publicKey",T),"strict"in L)throw new Error("options.strict was renamed to lowS");let{lowS:P,prehash:K}=L,V,W;try{if(typeof w=="string"||w instanceof Uint8Array)try{V=x.fromDER(w)}catch(Ct){if(!(Ct instanceof wr.Err))throw Ct;V=x.fromCompact(w)}else if(typeof w=="object"&&typeof w.r=="bigint"&&typeof w.s=="bigint"){let{r:Ct,s:Vt}=w;V=new x(Ct,Vt)}else throw new Error("PARSE");W=f.fromHex(T)}catch(Ct){if(Ct.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(P&&V.hasHighS())return!1;K&&(N=e.hash(N));let{r:Y,s:et}=V,X=R(N),J=c(et),dt=a(X*J),ut=a(Y*J),Ut=f.BASE.multiplyAndAddUnsafe(W,dt,ut)?.toAffine();return Ut?a(Ut.x)===Y:!1}return{CURVE:e,getPublicKey:m,getSharedSecret:S,sign:z,verify:Z,ProjectivePoint:f,Signature:x,utils:v}}function u1(t){return{hash:t,hmac:(e,...r)=>Rr(t,e,ei(...r)),randomBytes:nr}}function Pf(t,e){let r=n=>kf({...t,...u1(n)});return Object.freeze({...r(e),create:r})}var Of=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Uf=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h1=BigInt(1),Go=BigInt(2),Kf=(t,e)=>(t+e/Go)/e;function l1(t){let e=Of,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),f=t*t*t%e,u=f*f*t%e,h=gt(u,r,e)*u%e,l=gt(h,r,e)*u%e,g=gt(l,Go,e)*f%e,d=gt(g,i,e)*g%e,p=gt(d,s,e)*d%e,y=gt(p,a,e)*p%e,x=gt(y,c,e)*y%e,v=gt(x,a,e)*p%e,m=gt(v,r,e)*u%e,A=gt(m,o,e)*d%e,S=gt(A,n,e)*f%e,B=gt(S,Go,e);if(!$o.eql($o.sqr(B),t))throw new Error("Cannot find square root");return B}var $o=ci(Of,void 0,void 0,{sqrt:l1}),Oe=Pf({a:BigInt(0),b:BigInt(7),Fp:$o,n:Uf,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=Uf,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-h1*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=Kf(s*t,e),c=Kf(-n*t,e),f=at(t-a*r-c*i,e),u=at(-a*n-c*s,e),h=f>o,l=u>o;if(h&&(f=e-f),l&&(u=e-u),f>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:f,k2neg:l,k2:u}}}},Nr),Cv=BigInt(0);var Iv=Oe.ProjectivePoint;function Mf(){return Oe.utils.randomPrivateKey()}async function Ff(t,e){let{digest:r}=await Ft.digest(e);try{return Oe.sign(r,t).toDERRawBytes()}catch(n){throw new it(String(n),"ERR_INVALID_INPUT")}}async function Vf(t,e,r){try{let{digest:n}=await Ft.digest(r);return Oe.verify(e,n,t)}catch(n){throw new it(String(n),"ERR_INVALID_INPUT")}}function Hf(t){return Oe.ProjectivePoint.fromHex(t).toRawBytes(!0)}function qf(t){try{Oe.getPublicKey(t,!0)}catch(e){throw new it(String(e),"ERR_INVALID_PRIVATE_KEY")}}function Wo(t){try{Oe.ProjectivePoint.fromHex(t)}catch(e){throw new it(String(e),"ERR_INVALID_PUBLIC_KEY")}}function zf(t){try{return Oe.getPublicKey(t,!0)}catch(e){throw new it(String(e),"ERR_INVALID_PRIVATE_KEY")}}var Dn=class{_key;constructor(e){Wo(e),this._key=e}async verify(e,r){return Vf(this._key,r,e)}marshal(){return Hf(this._key)}get bytes(){return we.encode({Type:wt.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},kn=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r??zf(e),qf(this._key),Wo(this._publicKey)}async sign(e){return Ff(this._key,e)}get public(){return new Dn(this._publicKey)}marshal(){return this._key}get bytes(){return Ee.encode({Type:wt.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=await this.public.hash();return Et(e,"base58btc")}async export(e,r="libp2p-key"){if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function p1(t){return new kn(t)}function y1(t){return new Dn(t)}async function g1(){let t=Mf();return new kn(t)}var Er={rsa:zo,ed25519:Mo,secp256k1:Yo};function Gf(t){let e=Object.keys(Er).join(" / ");return new it(`invalid or unsupported key type ${t}. Must be ${e}`,"ERR_UNSUPPORTED_KEY_TYPE")}function $f(t){let e=we.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case wt.RSA:return Er.rsa.unmarshalRsaPublicKey(r);case wt.Ed25519:return Er.ed25519.unmarshalEd25519PublicKey(r);case wt.Secp256k1:return Er.secp256k1.unmarshalSecp256k1PublicKey(r);default:throw Gf(e.Type??"unknown")}}async function Wf(t){let e=Ee.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case wt.RSA:return Er.rsa.unmarshalRsaPrivateKey(r);case wt.Ed25519:return Er.ed25519.unmarshalEd25519PrivateKey(r);case wt.Secp256k1:return Er.secp256k1.unmarshalSecp256k1PrivateKey(r);default:throw Gf(e.Type??"RSA")}}var Yf=Symbol.for("@libp2p/peer-id");var m1=Symbol.for("nodejs.util.inspect.custom"),Zf=Object.values(zr).map(t=>t.decoder).reduce((t,e)=>t.or(e),zr.identity.decoder),Xf=114,Zo=36,Xo=37,Pn=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[Yf]=!0;toString(){return this.string==null&&(this.string=Mt.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return lr.createV1(Xf,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return Lt(this.multihash.bytes,e);if(typeof e=="string")return b1(e).equals(this);if(e?.multihash?.bytes!=null)return Lt(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[m1](){return`PeerId(${this.toString()})`}},Xr=class extends Pn{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},Qr=class extends Pn{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},Jr=class extends Pn{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function b1(t,e){if(e=e??Zf,t.charAt(0)==="1"||t.charAt(0)==="Q"){let r=Sn(Mt.decode(`z${t}`));return t.startsWith("12D")?new Qr({multihash:r}):t.startsWith("16U")?new Jr({multihash:r}):new Xr({multihash:r})}return v1(Zf.decode(t))}function v1(t){try{let e=Sn(t);if(e.code===Je.code){if(e.digest.length===Zo)return new Qr({multihash:e});if(e.digest.length===Xo)return new Jr({multihash:e})}if(e.code===Ft.code)return new Xr({multihash:e})}catch{return w1(lr.decode(t))}throw new Error("Supplied PeerID CID is invalid")}function w1(t){if(t==null||t.multihash==null||t.version==null||t.version===1&&t.code!==Xf)throw new Error("Supplied PeerID CID is invalid");let e=t.multihash;if(e.code===Ft.code)return new Xr({multihash:t.multihash});if(e.code===Je.code){if(e.digest.length===Zo)return new Qr({multihash:t.multihash});if(e.digest.length===Xo)return new Jr({multihash:t.multihash})}throw new Error("Supplied PeerID CID is invalid")}async function Qo(t,e){return t.length===Zo?new Qr({multihash:ve(Je.code,t),privateKey:e}):t.length===Xo?new Jr({multihash:ve(Je.code,t),privateKey:e}):new Xr({multihash:await Ft.digest(t),publicKey:t,privateKey:e})}var Fi;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{if(i.lengthDelimited!==!1&&n.fork(),r.webtransportCerthashes!=null)for(let s of r.webtransportCerthashes)n.uint32(10),n.bytes(s);i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={webtransportCerthashes:[]},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:{i.webtransportCerthashes.push(r.bytes());break}default:{r.skipType(o&7);break}}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Fi||(Fi={}));var Un;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.identityKey!=null&&r.identityKey.byteLength>0&&(n.uint32(10),n.bytes(r.identityKey)),r.identitySig!=null&&r.identitySig.byteLength>0&&(n.uint32(18),n.bytes(r.identitySig)),r.extensions!=null&&(n.uint32(34),Fi.codec().encode(r.extensions,n)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={identityKey:rt(0),identitySig:rt(0)},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:{i.identityKey=r.bytes();break}case 2:{i.identitySig=r.bytes();break}case 4:{i.extensions=Fi.codec().decode(r,r.uint32());break}default:{r.skipType(o&7);break}}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Un||(Un={}));async function Qf(t,e,r){let n=await S1(t,Jf(e));if(t.publicKey==null)throw new Error("PublicKey was missing from local PeerId");return E1(t.publicKey,n,r)}function E1(t,e,r){return Un.encode({identityKey:t,identitySig:e,extensions:r??{webtransportCerthashes:[]}}).subarray()}async function S1(t,e){if(t.privateKey==null)throw new Error("PrivateKey was missing from PeerId");return(await Wf(t.privateKey)).sign(e)}async function Jo(t){return Qo(t.identityKey)}function jo(t){return Un.decode(t)}function Jf(t){let e=At("noise-libp2p-static-key:");return Gt([e,t],e.length+t.length)}async function ta(t,e,r){let n=await Qo(e.identityKey);if(!n.equals(r))throw new Error(`Payload identity key ${n.toString()} does not match expected remote peer ${r.toString()}`);let i=Jf(t);if(n.publicKey==null)throw new Error("PublicKey was missing from PeerId");if(e.identitySig==null)throw new Error("Signature was missing from message");if(!await $f(n.publicKey).verify(i,e.identitySig))throw new Error("Static key doesn't match to peer that signed payload!");return n}function Kn(t){return!(!(t instanceof Uint8Array)||t.length!==32)}var te=zt(nu(),1);te.default.formatters.b=t=>t==null?"undefined":Mt.baseEncode(t);te.default.formatters.t=t=>t==null?"undefined":Qe.baseEncode(t);te.default.formatters.m=t=>t==null?"undefined":Mr.baseEncode(t);te.default.formatters.p=t=>t==null?"undefined":t.toString();te.default.formatters.c=t=>t==null?"undefined":t.toString();te.default.formatters.k=t=>t==null?"undefined":t.toString();te.default.formatters.a=t=>t==null?"undefined":t.toString();function U1(t){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=t,e.destroy=()=>!0,e.extend=()=>e,e}function iu(t){let e=U1(`${t}:trace`);return te.default.enabled(`${t}:trace`)&&te.default.names.map(r=>r.toString()).find(r=>r.includes(":trace"))!=null&&(e=(0,te.default)(`${t}:trace`)),Object.assign((0,te.default)(t),{error:(0,te.default)(`${t}:error`),trace:e})}var Pt=iu("libp2p:noise");var se;Ia?se=Pt:se=Object.assign(()=>{},{enabled:!1,trace:()=>{},error:()=>{}});function su(t){se(`LOCAL_STATIC_PUBLIC_KEY ${Et(t.publicKey,"hex")}`),se(`LOCAL_STATIC_PRIVATE_KEY ${Et(t.privateKey,"hex")}`)}function ea(t){t?(se(`LOCAL_PUBLIC_EPHEMERAL_KEY ${Et(t.publicKey,"hex")}`),se(`LOCAL_PRIVATE_EPHEMERAL_KEY ${Et(t.privateKey,"hex")}`)):se("Missing local ephemeral keys.")}function ou(t){se(`REMOTE_STATIC_PUBLIC_KEY ${Et(t,"hex")}`)}function ra(t){se(`REMOTE_EPHEMERAL_PUBLIC_KEY ${Et(t,"hex")}`)}function au(t){t.cs1&&t.cs2?(se(`CIPHER_STATE_1 ${t.cs1.n.getUint64()} ${Et(t.cs1.k,"hex")}`),se(`CIPHER_STATE_2 ${t.cs2.n.getUint64()} ${Et(t.cs2.k,"hex")}`)):se("Missing cipher state.")}var K1=0,O1=4294967295,M1="Cipherstate has reached maximum n, a new handshake must be performed",qi=class{n;bytes;view;constructor(e=K1){this.n=e,this.bytes=rt(12),this.view=new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength),this.view.setUint32(4,e,!0)}increment(){this.n++,this.view.setUint32(4,this.n,!0)}getBytes(){return this.bytes}getUint64(){return this.n}assertValue(){if(this.n>O1)throw new Error(M1)}};var zi=class{crypto;constructor(e){this.crypto=e}encryptWithAd(e,r,n){let i=this.encrypt(e.k,e.n,r,n);return e.n.increment(),i}decryptWithAd(e,r,n,i){let{plaintext:s,valid:o}=this.decrypt(e.k,e.n,r,n,i);return o&&e.n.increment(),{plaintext:s,valid:o}}hasKey(e){return!this.isEmptyKey(e.k)}createEmptyKey(){return rt(32)}isEmptyKey(e){let r=this.createEmptyKey();return Lt(r,e)}encrypt(e,r,n,i){return r.assertValue(),this.crypto.chaCha20Poly1305Encrypt(i,r.getBytes(),n,e)}encryptAndHash(e,r){let n;return this.hasKey(e.cs)?n=this.encryptWithAd(e.cs,e.h,r):n=r,this.mixHash(e,n),n}decrypt(e,r,n,i,s){r.assertValue();let o=this.crypto.chaCha20Poly1305Decrypt(i,r.getBytes(),n,e,s);return o?{plaintext:o,valid:!0}:{plaintext:rt(0),valid:!1}}decryptAndHash(e,r){let n,i=!0;return this.hasKey(e.cs)?{plaintext:n,valid:i}=this.decryptWithAd(e.cs,e.h,r):n=r,this.mixHash(e,r),{plaintext:n,valid:i}}dh(e,r){try{let n=this.crypto.generateX25519SharedKey(e,r);return n.length===32?n:n.subarray(0,32)}catch(n){let i=n;return Pt.error(i),rt(32)}}mixHash(e,r){e.h=this.getHash(e.h,r)}getHash(e,r){return this.crypto.hashSHA256(Gt([e,r],e.length+r.length))}mixKey(e,r){let[n,i]=this.crypto.getHKDF(e.ck,r);e.cs=this.initializeKey(i),e.ck=n}initializeKey(e){return{k:e,n:new qi}}initializeSymmetric(e){let r=At(e,"utf-8"),n=this.hashProtocolName(r),i=n,s=this.createEmptyKey();return{cs:this.initializeKey(s),ck:i,h:n}}hashProtocolName(e){if(e.length<=32){let r=rt(32);return r.set(e),r}else return this.getHash(e,rt(0))}split(e){let[r,n]=this.crypto.getHKDF(e.ck,rt(0)),i=this.initializeKey(r),s=this.initializeKey(n);return{cs1:i,cs2:s}}writeMessageRegular(e,r){let n=this.encryptWithAd(e,rt(0),r),i=this.createEmptyKey(),s=rt(0);return{ne:i,ns:s,ciphertext:n}}readMessageRegular(e,r){return this.decryptWithAd(e,rt(0),r.ciphertext)}};var Gi=class extends zi{initializeInitiator(e,r,n,i){let s="Noise_XX_25519_ChaChaPoly_SHA256",o=this.initializeSymmetric(s);this.mixHash(o,e);let a=rt(32);return{ss:o,s:r,rs:n,psk:i,re:a}}initializeResponder(e,r,n,i){let s="Noise_XX_25519_ChaChaPoly_SHA256",o=this.initializeSymmetric(s);this.mixHash(o,e);let a=rt(32);return{ss:o,s:r,rs:n,psk:i,re:a}}writeMessageA(e,r,n){let i=rt(0);n!==void 0?e.e=n:e.e=this.crypto.generateX25519KeyPair();let s=e.e.publicKey;this.mixHash(e.ss,s);let o=this.encryptAndHash(e.ss,r);return{ne:s,ns:i,ciphertext:o}}writeMessageB(e,r){e.e=this.crypto.generateX25519KeyPair();let n=e.e.publicKey;this.mixHash(e.ss,n),this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));let i=e.s.publicKey,s=this.encryptAndHash(e.ss,i);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));let o=this.encryptAndHash(e.ss,r);return{ne:n,ns:s,ciphertext:o}}writeMessageC(e,r){let n=e.s.publicKey,i=this.encryptAndHash(e.ss,n);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));let s=this.encryptAndHash(e.ss,r),a={ne:this.createEmptyKey(),ns:i,ciphertext:s},{cs1:c,cs2:f}=this.split(e.ss);return{h:e.ss.h,messageBuffer:a,cs1:c,cs2:f}}readMessageA(e,r){return Kn(r.ne)&&(e.re=r.ne),this.mixHash(e.ss,e.re),this.decryptAndHash(e.ss,r.ciphertext)}readMessageB(e,r){if(Kn(r.ne)&&(e.re=r.ne),this.mixHash(e.ss,e.re),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));let{plaintext:n,valid:i}=this.decryptAndHash(e.ss,r.ns);i&&Kn(n)&&(e.rs=n),this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));let{plaintext:s,valid:o}=this.decryptAndHash(e.ss,r.ciphertext);return{plaintext:s,valid:i&&o}}readMessageC(e,r){let{plaintext:n,valid:i}=this.decryptAndHash(e.ss,r.ns);if(i&&Kn(n)&&(e.rs=n),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));let{plaintext:s,valid:o}=this.decryptAndHash(e.ss,r.ciphertext),{cs1:a,cs2:c}=this.split(e.ss);return{h:e.ss.h,plaintext:s,valid:i&&o,cs1:a,cs2:c}}initSession(e,r,n){let i=this.createEmptyKey(),s=rt(32),o;return e?o=this.initializeInitiator(r,n,s,i):o=this.initializeResponder(r,n,s,i),{hs:o,i:e,mc:0}}sendMessage(e,r,n){let i;if(e.mc===0)i=this.writeMessageA(e.hs,r,n);else if(e.mc===1)i=this.writeMessageB(e.hs,r);else if(e.mc===2){let{h:s,messageBuffer:o,cs1:a,cs2:c}=this.writeMessageC(e.hs,r);i=o,e.h=s,e.cs1=a,e.cs2=c}else if(e.mc>2)if(e.i){if(!e.cs1)throw new Error("CS1 (cipher state) is not defined");i=this.writeMessageRegular(e.cs1,r)}else{if(!e.cs2)throw new Error("CS2 (cipher state) is not defined");i=this.writeMessageRegular(e.cs2,r)}else throw new Error("Session invalid.");return e.mc++,i}recvMessage(e,r){let n=rt(0),i=!1;if(e.mc===0)({plaintext:n,valid:i}=this.readMessageA(e.hs,r));else if(e.mc===1)({plaintext:n,valid:i}=this.readMessageB(e.hs,r));else if(e.mc===2){let{h:s,plaintext:o,valid:a,cs1:c,cs2:f}=this.readMessageC(e.hs,r);n=o,i=a,e.h=s,e.cs1=c,e.cs2=f}return e.mc++,{plaintext:n,valid:i}}};var $i=class{isInitiator;session;remotePeer;remoteExtensions={webtransportCerthashes:[]};payload;connection;xx;staticKeypair;prologue;constructor(e,r,n,i,s,o,a,c){this.isInitiator=e,this.payload=r,this.prologue=n,this.staticKeypair=s,this.connection=o,a&&(this.remotePeer=a),this.xx=c??new Gi(i),this.session=this.xx.initSession(this.isInitiator,this.prologue,this.staticKeypair)}async propose(){if(su(this.session.hs.s),this.isInitiator){Pt.trace("Stage 0 - Initiator starting to send first message.");let e=this.xx.sendMessage(this.session,rt(0));await this.connection.write(c0(e)),Pt.trace("Stage 0 - Initiator finished sending first message."),ea(this.session.hs.e)}else{Pt.trace("Stage 0 - Responder waiting to receive first message...");let e=h0((await this.connection.read()).subarray()),{valid:r}=this.xx.recvMessage(this.session,e);if(!r)throw new or("xx handshake stage 0 validation fail");Pt.trace("Stage 0 - Responder received first message."),ra(this.session.hs.re)}}async exchange(){if(this.isInitiator){Pt.trace("Stage 1 - Initiator waiting to receive first message from responder...");let e=l0((await this.connection.read()).subarray()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new or("xx handshake stage 1 validation fail");Pt.trace("Stage 1 - Initiator received the message."),ra(this.session.hs.re),ou(this.session.hs.rs),Pt.trace("Initiator going to check remote's signature...");try{let i=jo(r);this.remotePeer=this.remotePeer||await Jo(i),await ta(this.session.hs.rs,i,this.remotePeer),this.setRemoteNoiseExtension(i.extensions)}catch(i){let s=i;throw new pn(`Error occurred while verifying signed payload: ${s.message}`)}Pt.trace("All good with the signature!")}else{Pt.trace("Stage 1 - Responder sending out first message with signed payload and static key.");let e=this.xx.sendMessage(this.session,this.payload);await this.connection.write(f0(e)),Pt.trace("Stage 1 - Responder sent the second handshake message with signed payload."),ea(this.session.hs.e)}}async finish(){if(this.isInitiator){Pt.trace("Stage 2 - Initiator sending third handshake message.");let e=this.xx.sendMessage(this.session,this.payload);await this.connection.write(u0(e)),Pt.trace("Stage 2 - Initiator sent message with signed payload.")}else{Pt.trace("Stage 2 - Responder waiting for third handshake message...");let e=d0((await this.connection.read()).subarray()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new or("xx handshake stage 2 validation fail");Pt.trace("Stage 2 - Responder received the message, finished handshake.");try{let i=jo(r);this.remotePeer=this.remotePeer||await Jo(i),await ta(this.session.hs.rs,i,this.remotePeer),this.setRemoteNoiseExtension(i.extensions)}catch(i){let s=i;throw new pn(`Error occurred while verifying signed payload: ${s.message}`)}}au(this.session)}encrypt(e,r){let n=this.getCS(r);return this.xx.encryptWithAd(n,rt(0),e)}decrypt(e,r,n){let i=this.getCS(r,!1);return this.xx.decryptWithAd(i,rt(0),e,n)}getRemoteStaticKey(){return this.session.hs.rs}getCS(e,r=!0){if(!e.cs1||!e.cs2)throw new or("Handshake not completed properly, cipher state does not exist.");return this.isInitiator?r?e.cs1:e.cs2:r?e.cs2:e.cs1}setRemoteNoiseExtension(e){e&&(this.remoteExtensions=e)}};function cu(t){return{xxHandshakeSuccesses:t.registerCounter("libp2p_noise_xxhandshake_successes_total",{help:"Total count of noise xxHandshakes successes_"}),xxHandshakeErrors:t.registerCounter("libp2p_noise_xxhandshake_error_total",{help:"Total count of noise xxHandshakes errors"}),encryptedPackets:t.registerCounter("libp2p_noise_encrypted_packets_total",{help:"Total count of noise encrypted packets successfully"}),decryptedPackets:t.registerCounter("libp2p_noise_decrypted_packets_total",{help:"Total count of noise decrypted packets"}),decryptErrors:t.registerCounter("libp2p_noise_decrypt_errors_total",{help:"Total count of noise decrypt errors"})}}var Wi=class{protocol="/noise";crypto;prologue;staticKeys;extensions;metrics;constructor(e={}){let{staticNoiseKey:r,extensions:n,crypto:i,prologueBytes:s,metrics:o}=e;this.crypto=i??a0,this.extensions=n,this.metrics=o?cu(o):void 0,r?this.staticKeys=this.crypto.generateX25519KeyPairFromSeed(r):this.staticKeys=this.crypto.generateX25519KeyPair(),this.prologue=s??rt(0)}async secureOutbound(e,r,n){let i=ns(r,{lengthEncoder:Dr,lengthDecoder:ln,maxDataLength:65535}),s=await this.performHandshake({connection:i,isInitiator:!0,localPeer:e,remotePeer:n}),o=await this.createSecureConnection(i,s);return r.source=o.source,r.sink=o.sink,{conn:r,remoteExtensions:s.remoteExtensions,remotePeer:s.remotePeer}}async secureInbound(e,r,n){let i=ns(r,{lengthEncoder:Dr,lengthDecoder:ln,maxDataLength:65535}),s=await this.performHandshake({connection:i,isInitiator:!1,localPeer:e,remotePeer:n}),o=await this.createSecureConnection(i,s);return r.source=o.source,r.sink=o.sink,{conn:r,remotePeer:s.remotePeer,remoteExtensions:s.remoteExtensions}}async performHandshake(e){let r=await Qf(e.localPeer,this.staticKeys.publicKey,this.extensions);return this.performXXHandshake(e,r)}async performXXHandshake(e,r){let{isInitiator:n,remotePeer:i,connection:s}=e,o=new $i(n,r,this.prologue,this.crypto,this.staticKeys,s,i);try{await o.propose(),await o.exchange(),await o.finish(),this.metrics?.xxHandshakeSuccesses.increment()}catch(a){if(this.metrics?.xxHandshakeErrors.increment(),a instanceof Error)throw a.message=`Error occurred during XX handshake: ${a.message}`,a}return o}async createSecureConnection(e,r){let[n,i]=Ea(),s=e.unwrap();return await Ba(n,g0(r,this.metrics),s,o=>sn(o,{lengthDecoder:ln}),x0(r,this.metrics),n),i}};function F1(t={}){return()=>new Wi(t)}return Eu(V1);})(); -/*! Bundled license information: - -@noble/ciphers/esm/utils.js: - (*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *) - -@noble/hashes/esm/utils.js: - (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/modular.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/curve.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/edwards.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/montgomery.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/ed25519.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/weierstrass.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/_shortw_utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/secp256k1.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) -*/ -return ChainsafeLibp2PNoise})); diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/basic.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/basic.d.ts deleted file mode 100644 index 5b8bbb19b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/basic.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type bytes = Uint8Array; -export type bytes32 = Uint8Array; -export type bytes16 = Uint8Array; -export type uint64 = number; -//# sourceMappingURL=basic.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/basic.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/basic.d.ts.map deleted file mode 100644 index eeee2bada..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/basic.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../src/@types/basic.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG,UAAU,CAAA;AAC9B,MAAM,MAAM,OAAO,GAAG,UAAU,CAAA;AAChC,MAAM,MAAM,OAAO,GAAG,UAAU,CAAA;AAEhC,MAAM,MAAM,MAAM,GAAG,MAAM,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/basic.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/basic.js deleted file mode 100644 index f839d2b8c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/basic.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=basic.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/basic.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/basic.js.map deleted file mode 100644 index aa623d697..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/basic.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"basic.js","sourceRoot":"","sources":["../../../src/@types/basic.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake-interface.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake-interface.d.ts deleted file mode 100644 index 40a820d88..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake-interface.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { bytes } from './basic.js'; -import type { NoiseSession } from './handshake.js'; -import type { NoiseExtensions } from '../proto/payload.js'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export interface IHandshake { - session: NoiseSession; - remotePeer: PeerId; - remoteExtensions: NoiseExtensions; - encrypt: (plaintext: bytes, session: NoiseSession) => bytes; - decrypt: (ciphertext: bytes, session: NoiseSession, dst?: Uint8Array) => { - plaintext: bytes; - valid: boolean; - }; -} -//# sourceMappingURL=handshake-interface.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake-interface.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake-interface.d.ts.map deleted file mode 100644 index 2b64678a8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake-interface.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake-interface.d.ts","sourceRoot":"","sources":["../../../src/@types/handshake-interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,YAAY,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,eAAe,CAAA;IACjC,OAAO,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,KAAK,KAAK,CAAA;IAC3D,OAAO,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,UAAU,KAAK;QAAE,SAAS,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAA;CAC9G"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake-interface.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake-interface.js deleted file mode 100644 index 6cb504ea8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake-interface.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=handshake-interface.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake-interface.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake-interface.js.map deleted file mode 100644 index f59aae35f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake-interface.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake-interface.js","sourceRoot":"","sources":["../../../src/@types/handshake-interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake.d.ts deleted file mode 100644 index 558a55238..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { bytes, bytes32, uint64 } from './basic.js'; -import type { KeyPair } from './libp2p.js'; -import type { Nonce } from '../nonce.js'; -export type Hkdf = [bytes, bytes, bytes]; -export interface MessageBuffer { - ne: bytes32; - ns: bytes; - ciphertext: bytes; -} -export interface CipherState { - k: bytes32; - n: Nonce; -} -export interface SymmetricState { - cs: CipherState; - ck: bytes32; - h: bytes32; -} -export interface HandshakeState { - ss: SymmetricState; - s: KeyPair; - e?: KeyPair; - rs: bytes32; - re: bytes32; - psk: bytes32; -} -export interface NoiseSession { - hs: HandshakeState; - h?: bytes32; - cs1?: CipherState; - cs2?: CipherState; - mc: uint64; - i: boolean; -} -export interface INoisePayload { - identityKey: bytes; - identitySig: bytes; - data: bytes; -} -//# sourceMappingURL=handshake.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake.d.ts.map deleted file mode 100644 index e4a428b8e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake.d.ts","sourceRoot":"","sources":["../../../src/@types/handshake.ts"],"names":[],"mappings":"AAA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-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake.js deleted file mode 100644 index 39c1bf13f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=handshake.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake.js.map deleted file mode 100644 index bed86a99f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/handshake.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake.js","sourceRoot":"","sources":["../../../src/@types/handshake.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/libp2p.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/libp2p.d.ts deleted file mode 100644 index d573b2ab6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/libp2p.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { bytes32 } from './basic.js'; -import type { NoiseExtensions } from '../proto/payload.js'; -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter'; -export interface KeyPair { - publicKey: bytes32; - privateKey: bytes32; -} -export interface INoiseConnection extends ConnectionEncrypter { -} -//# sourceMappingURL=libp2p.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/libp2p.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/libp2p.d.ts.map deleted file mode 100644 index 07f8bb308..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/libp2p.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"libp2p.d.ts","sourceRoot":"","sources":["../../../src/@types/libp2p.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAEjF,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB,CAAC,eAAe,CAAC;CAAG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/libp2p.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/libp2p.js deleted file mode 100644 index 9b5e5678e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/libp2p.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=libp2p.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/libp2p.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/libp2p.js.map deleted file mode 100644 index efd4520e6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/@types/libp2p.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"libp2p.js","sourceRoot":"","sources":["../../../src/@types/libp2p.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/constants.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/constants.d.ts deleted file mode 100644 index 576fb1857..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/constants.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare const NOISE_MSG_MAX_LENGTH_BYTES = 65535; -export declare const NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG: number; -export declare const DUMP_SESSION_KEYS: boolean; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/constants.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/constants.d.ts.map deleted file mode 100644 index 8bb0fa819..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,QAAQ,CAAA;AAC/C,eAAO,MAAM,sCAAsC,QAAkC,CAAA;AAErF,eAAO,MAAM,iBAAiB,SAAsD,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/constants.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/constants.js deleted file mode 100644 index e1381b284..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/constants.js +++ /dev/null @@ -1,4 +0,0 @@ -export const NOISE_MSG_MAX_LENGTH_BYTES = 65535; -export const NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG = NOISE_MSG_MAX_LENGTH_BYTES - 16; -export const DUMP_SESSION_KEYS = Boolean(globalThis.process?.env?.DUMP_SESSION_KEYS); -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/constants.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/constants.js.map deleted file mode 100644 index d21a05013..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAA;AAC/C,MAAM,CAAC,MAAM,sCAAsC,GAAG,0BAA0B,GAAG,EAAE,CAAA;AAErF,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto.d.ts deleted file mode 100644 index c98b18b9a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { bytes32, bytes } from './@types/basic.js'; -import type { Hkdf } from './@types/handshake.js'; -import type { KeyPair } from './@types/libp2p.js'; -export interface ICryptoInterface { - hashSHA256: (data: Uint8Array) => Uint8Array; - getHKDF: (ck: bytes32, ikm: Uint8Array) => Hkdf; - generateX25519KeyPair: () => KeyPair; - generateX25519KeyPairFromSeed: (seed: Uint8Array) => KeyPair; - generateX25519SharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Uint8Array; - chaCha20Poly1305Encrypt: (plaintext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32) => bytes; - chaCha20Poly1305Decrypt: (ciphertext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array) => bytes | null; -} -//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto.d.ts.map deleted file mode 100644 index 21fb764ad..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,UAAU,CAAA;IAE5C,OAAO,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,KAAK,IAAI,CAAA;IAE/C,qBAAqB,EAAE,MAAM,OAAO,CAAA;IACpC,6BAA6B,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAA;IAC5D,uBAAuB,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,KAAK,UAAU,CAAA;IAEtF,uBAAuB,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,KAAK,KAAK,CAAA;IACxG,uBAAuB,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,UAAU,KAAK,KAAK,GAAG,IAAI,CAAA;CACnI"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto.js deleted file mode 100644 index d4b4414d0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto.js.map deleted file mode 100644 index e85268dce..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.browser.d.ts deleted file mode 100644 index c819d1f23..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.browser.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const defaultCrypto: import("..").ICryptoInterface; -//# sourceMappingURL=index.browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.browser.d.ts.map deleted file mode 100644 index 8ae396c49..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../../../src/crypto/index.browser.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,+BAAe,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.browser.js deleted file mode 100644 index 04eea2a62..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.browser.js +++ /dev/null @@ -1,3 +0,0 @@ -import { pureJsCrypto } from './js'; -export const defaultCrypto = pureJsCrypto; -//# sourceMappingURL=index.browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.browser.js.map deleted file mode 100644 index e96421aa8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../../../src/crypto/index.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAEnC,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.d.ts deleted file mode 100644 index cf8aff630..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ICryptoInterface } from '../crypto.js'; -export declare const defaultCrypto: ICryptoInterface; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.d.ts.map deleted file mode 100644 index 5f7efefc8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crypto/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AA2DpD,eAAO,MAAM,aAAa,EAAE,gBA+E3B,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.js deleted file mode 100644 index bde9ae3dd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.js +++ /dev/null @@ -1,138 +0,0 @@ -import crypto from 'node:crypto'; -import { newInstance, ChaCha20Poly1305 } from '@chainsafe/as-chacha20poly1305'; -import { digest } from '@chainsafe/as-sha256'; -import { isElectronMain } from 'wherearewe'; -import { pureJsCrypto } from './js.js'; -const ctx = newInstance(); -const asImpl = new ChaCha20Poly1305(ctx); -const CHACHA_POLY1305 = 'chacha20-poly1305'; -const PKCS8_PREFIX = Buffer.from([0x30, 0x2e, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x04, 0x22, 0x04, 0x20]); -const X25519_PREFIX = Buffer.from([0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x03, 0x21, 0x00]); -const nodeCrypto = { - hashSHA256(data) { - return crypto.createHash('sha256').update(data).digest(); - }, - chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - const cipher = crypto.createCipheriv(CHACHA_POLY1305, k, nonce, { - authTagLength: 16 - }); - cipher.setAAD(ad, { plaintextLength: plaintext.byteLength }); - const updated = cipher.update(plaintext); - const final = cipher.final(); - const tag = cipher.getAuthTag(); - const encrypted = Buffer.concat([updated, tag, final], updated.byteLength + tag.byteLength + final.byteLength); - return encrypted; - }, - chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, _dst) { - const authTag = ciphertext.subarray(ciphertext.length - 16); - const text = ciphertext.subarray(0, ciphertext.length - 16); - const decipher = crypto.createDecipheriv(CHACHA_POLY1305, k, nonce, { - authTagLength: 16 - }); - decipher.setAAD(ad, { - plaintextLength: text.byteLength - }); - decipher.setAuthTag(authTag); - const updated = decipher.update(text); - const final = decipher.final(); - if (final.byteLength > 0) { - return Buffer.concat([updated, final], updated.byteLength + final.byteLength); - } - return updated; - } -}; -const asCrypto = { - hashSHA256(data) { - return digest(data); - }, - chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - return asImpl.seal(k, nonce, plaintext, ad); - }, - chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) { - return asImpl.open(k, nonce, ciphertext, ad, dst); - } -}; -// benchmarks show that for chacha20poly1305 -// the as implementation is faster for smaller payloads(<1200) -// and the node implementation is faster for larger payloads -export const defaultCrypto = { - ...pureJsCrypto, - hashSHA256(data) { - return nodeCrypto.hashSHA256(data); - }, - chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - if (plaintext.length < 1200) { - return asCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k); - } - return nodeCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k); - }, - chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) { - if (ciphertext.length < 1200) { - return asCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst); - } - return nodeCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst); - }, - generateX25519KeyPair() { - const { publicKey, privateKey } = crypto.generateKeyPairSync('x25519', { - publicKeyEncoding: { - type: 'spki', - format: 'der' - }, - privateKeyEncoding: { - type: 'pkcs8', - format: 'der' - } - }); - return { - publicKey: publicKey.subarray(X25519_PREFIX.length), - privateKey: privateKey.subarray(PKCS8_PREFIX.length) - }; - }, - generateX25519KeyPairFromSeed(seed) { - const privateKey = crypto.createPrivateKey({ - key: Buffer.concat([ - PKCS8_PREFIX, - seed - ], PKCS8_PREFIX.byteLength + seed.byteLength), - type: 'pkcs8', - format: 'der' - }); - const publicKey = crypto.createPublicKey(privateKey) - .export({ - type: 'spki', - format: 'der' - }).subarray(X25519_PREFIX.length); - return { - publicKey, - privateKey: seed - }; - }, - generateX25519SharedKey(privateKey, publicKey) { - publicKey = Buffer.concat([ - X25519_PREFIX, - publicKey - ], X25519_PREFIX.byteLength + publicKey.byteLength); - privateKey = Buffer.concat([ - PKCS8_PREFIX, - privateKey - ], PKCS8_PREFIX.byteLength + privateKey.byteLength); - return crypto.diffieHellman({ - publicKey: crypto.createPublicKey({ - key: Buffer.from(publicKey, publicKey.byteOffset, publicKey.byteLength), - type: 'spki', - format: 'der' - }), - privateKey: crypto.createPrivateKey({ - key: Buffer.from(privateKey, privateKey.byteOffset, privateKey.byteLength), - type: 'pkcs8', - format: 'der' - }) - }); - } -}; -// no chacha20-poly1305 in electron https://github.com/electron/electron/issues/24024 -if (isElectronMain) { - defaultCrypto.chaCha20Poly1305Encrypt = asCrypto.chaCha20Poly1305Encrypt; - defaultCrypto.chaCha20Poly1305Decrypt = asCrypto.chaCha20Poly1305Decrypt; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.js.map deleted file mode 100644 index 8e5524ac5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/crypto/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,M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,MAAM,CAAC,MAAM,CAAC;YACxB,aAAa;YACb,SAAS;SACV,EAAE,aAAa,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,CAAA;QAEnD,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;YACzB,YAAY;YACZ,UAAU;SACX,EAAE,YAAY,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,CAAA;QAEnD,OAAO,MAAM,CAAC,aAAa,CAAC;YAC1B,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC;gBAChC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,UAAU,CAAC;gBACvE,IAAI,EAAE,MAAM;gBACZ,MAAM,EAAE,KAAK;aACd,CAAC;YACF,UAAU,EAAE,MAAM,CAAC,gBAAgB,CAAC;gBAClC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC;gBAC1E,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,KAAK;aACd,CAAC;SACH,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,qFAAqF;AACrF,IAAI,cAAc,EAAE;IAClB,aAAa,CAAC,uBAAuB,GAAG,QAAQ,CAAC,uBAAuB,CAAA;IACxE,aAAa,CAAC,uBAAuB,GAAG,QAAQ,CAAC,uBAAuB,CAAA;CACzE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/js.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/js.d.ts deleted file mode 100644 index 4020b8611..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/js.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ICryptoInterface } from '../crypto.js'; -export declare const pureJsCrypto: ICryptoInterface; -//# sourceMappingURL=js.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/js.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/js.d.ts.map deleted file mode 100644 index d9693c950..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/js.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"js.d.ts","sourceRoot":"","sources":["../../../src/crypto/js.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpD,eAAO,MAAM,YAAY,EAAE,gBA+C1B,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/js.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/js.js deleted file mode 100644 index b2aa8b079..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/js.js +++ /dev/null @@ -1,43 +0,0 @@ -import { chacha20poly1305 } from '@noble/ciphers/chacha'; -import { x25519 } from '@noble/curves/ed25519'; -import { extract, expand } from '@noble/hashes/hkdf'; -import { sha256 } from '@noble/hashes/sha256'; -export const pureJsCrypto = { - hashSHA256(data) { - return sha256(data); - }, - getHKDF(ck, ikm) { - const prk = extract(sha256, ikm, ck); - const okmU8Array = expand(sha256, prk, undefined, 96); - const okm = okmU8Array; - const k1 = okm.subarray(0, 32); - const k2 = okm.subarray(32, 64); - const k3 = okm.subarray(64, 96); - return [k1, k2, k3]; - }, - generateX25519KeyPair() { - const secretKey = x25519.utils.randomPrivateKey(); - const publicKey = x25519.getPublicKey(secretKey); - return { - publicKey, - privateKey: secretKey - }; - }, - generateX25519KeyPairFromSeed(seed) { - const publicKey = x25519.getPublicKey(seed); - return { - publicKey, - privateKey: seed - }; - }, - generateX25519SharedKey(privateKey, publicKey) { - return x25519.getSharedSecret(privateKey, publicKey); - }, - chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - return chacha20poly1305(k, nonce, ad).encrypt(plaintext); - }, - chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) { - return chacha20poly1305(k, nonce, ad).decrypt(ciphertext, dst); - } -}; -//# sourceMappingURL=js.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/js.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/js.js.map deleted file mode 100644 index a58e0e68d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/js.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"js.js","sourceRoot":"","sources":["../../../src/crypto/js.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAM7C,MAAM,CAAC,MAAM,YAAY,GAAqB;IAC5C,UAAU,CAAE,IAAgB;QAC1B,OAAO,MAAM,CAAC,IAAI,CAAC,CAAA;IACrB,CAAC;IAED,OAAO,CAAE,EAAW,EAAE,GAAe;QACnC,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAAA;QACpC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,CAAA;QACrD,MAAM,GAAG,GAAG,UAAU,CAAA;QAEtB,MAAM,EAAE,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;QAC9B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-yield-chunks/noise/dist/src/crypto/streaming.d.ts deleted file mode 100644 index a897b30ad..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/streaming.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import type { IHandshake } from '../@types/handshake-interface.js'; -import type { MetricsRegistry } from '../metrics.js'; -import type { Transform } from 'it-stream-types'; -export declare function encryptStream(handshake: IHandshake, metrics?: MetricsRegistry): Transform>; -export declare function decryptStream(handshake: IHandshake, metrics?: MetricsRegistry): Transform, AsyncGenerator>; -//# sourceMappingURL=streaming.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/streaming.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/streaming.d.ts.map deleted file mode 100644 index 76ac88dcd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/streaming.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../../src/crypto/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAG/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAKhD,wBAAgB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,CAgBvI;AAGD,wBAAgB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC,CA4BtJ"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/streaming.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/streaming.js deleted file mode 100644 index 5a6723913..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/streaming.js +++ /dev/null @@ -1,50 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import { NOISE_MSG_MAX_LENGTH_BYTES, NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG } from '../constants.js'; -import { uint16BEEncode } from '../encoder.js'; -const CHACHA_TAG_LENGTH = 16; -// Returns generator that encrypts payload from the user -export function encryptStream(handshake, metrics) { - return async function* (source) { - for await (const chunk of source) { - for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG) { - let end = i + NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG; - if (end > chunk.length) { - end = chunk.length; - } - const data = handshake.encrypt(chunk.subarray(i, end), handshake.session); - metrics?.encryptedPackets.increment(); - yield new Uint8ArrayList(uint16BEEncode(data.byteLength), data); - } - } - }; -} -// Decrypt received payload to the user -export function decryptStream(handshake, metrics) { - return async function* (source) { - for await (const chunk of source) { - for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES) { - let end = i + NOISE_MSG_MAX_LENGTH_BYTES; - if (end > chunk.length) { - end = chunk.length; - } - if (end - CHACHA_TAG_LENGTH < i) { - throw new Error('Invalid chunk'); - } - const encrypted = chunk.subarray(i, end); - // memory allocation is not cheap so reuse the encrypted Uint8Array - // see https://github.com/ChainSafe/js-libp2p-noise/pull/242#issue-1422126164 - // this is ok because chacha20 reads bytes one by one and don't reread after that - // it's also tested in https://github.com/ChainSafe/as-chacha20poly1305/pull/1/files#diff-25252846b58979dcaf4e41d47b3eadd7e4f335e7fb98da6c049b1f9cd011f381R48 - const dst = chunk.subarray(i, end - CHACHA_TAG_LENGTH); - const { plaintext: decrypted, valid } = handshake.decrypt(encrypted, handshake.session, dst); - if (!valid) { - metrics?.decryptErrors.increment(); - throw new Error('Failed to validate decrypted chunk'); - } - metrics?.decryptedPackets.increment(); - yield decrypted; - } - } - }; -} -//# sourceMappingURL=streaming.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/streaming.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/streaming.js.map deleted file mode 100644 index 302b7fff6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/crypto/streaming.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streaming.js","sourceRoot":"","sources":["../../../src/crypto/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,0BAA0B,EAAE,sCAAsC,EAAE,MAAM,iBAAiB,CAAA;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAK9C,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAE5B,wDAAwD;AACxD,MAAM,UAAU,aAAa,CAAE,SAAqB,EAAE,OAAyB;IAC7E,OAAO,KAAK,SAAU,CAAC,EAAE,MAAM;QAC7B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE;YAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,sCAAsC,EAAE;gBAC7E,IAAI,GAAG,GAAG,CAAC,GAAG,sCAAsC,CAAA;gBACpD,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE;oBACtB,GAAG,GAAG,KAAK,CAAC,MAAM,CAAA;iBACnB;gBAED,MAAM,IAAI,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AE;oBACV,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,CAAA;oBAClC,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;iBACtD;gBACD,OAAO,EAAE,gBAAgB,CAAC,SAAS,EAAE,CAAA;gBACrC,MAAM,SAAS,CAAA;aAChB;SACF;IACH,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/encoder.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/encoder.d.ts deleted file mode 100644 index a24ce9256..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/encoder.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import type { bytes } from './@types/basic.js'; -import type { MessageBuffer } from './@types/handshake.js'; -import type { LengthDecoderFunction } from 'it-length-prefixed'; -export declare const uint16BEEncode: { - (value: number): Uint8Array; - bytes: number; -}; -export declare const uint16BEDecode: LengthDecoderFunction; -export declare function encode0(message: MessageBuffer): Uint8ArrayList; -export declare function encode1(message: MessageBuffer): Uint8ArrayList; -export declare function encode2(message: MessageBuffer): Uint8ArrayList; -export declare function decode0(input: bytes): MessageBuffer; -export declare function decode1(input: bytes): MessageBuffer; -export declare function decode2(input: bytes): MessageBuffer; -//# sourceMappingURL=encoder.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/encoder.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/encoder.d.ts.map deleted file mode 100644 index 76e8c0a65..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/encoder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encoder.d.ts","sourceRoot":"","sources":["../../src/encoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAE/D,eAAO,MAAM,cAAc;YAAW,MAAM,GAAG,UAAU;;CAIxD,CAAA;AAGD,eAAO,MAAM,cAAc,EAAE,qBAQ5B,CAAA;AAKD,wBAAgB,OAAO,CAAE,OAAO,EAAE,aAAa,GAAG,cAAc,CAE/D;AAED,wBAAgB,OAAO,CAAE,OAAO,EAAE,aAAa,GAAG,cAAc,CAE/D;AAED,wBAAgB,OAAO,CAAE,OAAO,EAAE,aAAa,GAAG,cAAc,CAE/D;AAED,wBAAgB,OAAO,CAAE,KAAK,EAAE,KAAK,GAAG,aAAa,CAUpD;AAED,wBAAgB,OAAO,CAAE,KAAK,EAAE,KAAK,GAAG,aAAa,CAUpD;AAED,wBAAgB,OAAO,CAAE,KAAK,EAAE,KAAK,GAAG,aAAa,CAUpD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/encoder.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/encoder.js deleted file mode 100644 index fb9145e54..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/encoder.js +++ /dev/null @@ -1,58 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import { alloc as uint8ArrayAlloc, allocUnsafe as uint8ArrayAllocUnsafe } from 'uint8arrays/alloc'; -export const uint16BEEncode = (value) => { - const target = uint8ArrayAllocUnsafe(2); - new DataView(target.buffer, target.byteOffset, target.byteLength).setUint16(0, value, false); - return target; -}; -uint16BEEncode.bytes = 2; -export const uint16BEDecode = (data) => { - if (data.length < 2) - throw RangeError('Could not decode int16BE'); - if (data instanceof Uint8Array) { - return new DataView(data.buffer, data.byteOffset, data.byteLength).getUint16(0, false); - } - return data.getUint16(0); -}; -uint16BEDecode.bytes = 2; -// Note: IK and XX encoder usage is opposite (XX uses in stages encode0 where IK uses encode1) -export function encode0(message) { - return new Uint8ArrayList(message.ne, message.ciphertext); -} -export function encode1(message) { - return new Uint8ArrayList(message.ne, message.ns, message.ciphertext); -} -export function encode2(message) { - return new Uint8ArrayList(message.ns, message.ciphertext); -} -export function decode0(input) { - if (input.length < 32) { - throw new Error('Cannot decode stage 0 MessageBuffer: length less than 32 bytes.'); - } - return { - ne: input.subarray(0, 32), - ciphertext: input.subarray(32, input.length), - ns: uint8ArrayAlloc(0) - }; -} -export function decode1(input) { - if (input.length < 80) { - throw new Error('Cannot decode stage 1 MessageBuffer: length less than 80 bytes.'); - } - return { - ne: input.subarray(0, 32), - ns: input.subarray(32, 80), - ciphertext: input.subarray(80, input.length) - }; -} -export function decode2(input) { - if (input.length < 48) { - throw new Error('Cannot decode stage 2 MessageBuffer: length less than 48 bytes.'); - } - return { - ne: uint8ArrayAlloc(0), - ns: input.subarray(0, 48), - ciphertext: input.subarray(48, input.length) - }; -} -//# sourceMappingURL=encoder.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/encoder.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/encoder.js.map deleted file mode 100644 index 243826435..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/encoder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encoder.js","sourceRoot":"","sources":["../../src/encoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,WAAW,IAAI,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAKlG,MAAM,CAAC,MAAM,cAAc,GA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/noise/dist/src/handshake-xx.d.ts deleted file mode 100644 index 8bde3f774..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshake-xx.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { XX } from './handshakes/xx.js'; -import type { bytes, bytes32 } from './@types/basic.js'; -import type { IHandshake } from './@types/handshake-interface.js'; -import type { NoiseSession } from './@types/handshake.js'; -import type { KeyPair } from './@types/libp2p.js'; -import type { ICryptoInterface } from './crypto.js'; -import type { NoiseExtensions } from './proto/payload.js'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { LengthPrefixedStream } from 'it-length-prefixed-stream'; -export declare class XXHandshake implements IHandshake { - isInitiator: boolean; - session: NoiseSession; - remotePeer: PeerId; - remoteExtensions: NoiseExtensions; - protected payload: bytes; - protected connection: LengthPrefixedStream; - protected xx: XX; - protected staticKeypair: KeyPair; - private readonly prologue; - constructor(isInitiator: boolean, payload: bytes, prologue: bytes32, crypto: ICryptoInterface, staticKeypair: KeyPair, connection: LengthPrefixedStream, remotePeer?: PeerId, handshake?: XX); - propose(): Promise; - exchange(): Promise; - finish(): Promise; - encrypt(plaintext: Uint8Array, session: NoiseSession): bytes; - decrypt(ciphertext: Uint8Array, session: NoiseSession, dst?: Uint8Array): { - plaintext: bytes; - valid: boolean; - }; - getRemoteStaticKey(): bytes; - private getCS; - protected setRemoteNoiseExtension(e: NoiseExtensions | null | undefined): void; -} -//# sourceMappingURL=handshake-xx.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshake-xx.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshake-xx.d.ts.map deleted file mode 100644 index cb8bec51a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshake-xx.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake-xx.d.ts","sourceRo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;IAiC1B,MAAM,IAAK,OAAO,CAAC,IAAI,CAAC;IA4B9B,OAAO,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,GAAG,KAAK;IAM7D,OAAO,CAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG;QAAE,SAAS,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE;IAM/G,kBAAkB,IAAK,KAAK;IAInC,OAAO,CAAC,KAAK;IAYb,SAAS,CAAC,uBAAuB,CAAE,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;CAKhF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshake-xx.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshake-xx.js deleted file mode 100644 index 373013b03..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshake-xx.js +++ /dev/null @@ -1,140 +0,0 @@ -import { InvalidCryptoExchangeError, UnexpectedPeerError } from '@libp2p/interface/errors'; -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { decode0, decode1, decode2, encode0, encode1, encode2 } from './encoder.js'; -import { XX } from './handshakes/xx.js'; -import { logger, logLocalStaticKeys, logLocalEphemeralKeys, logRemoteEphemeralKey, logRemoteStaticKey, logCipherState } from './logger.js'; -import { decodePayload, getPeerIdFromPayload, verifySignedPayload } from './utils.js'; -export class XXHandshake { - isInitiator; - session; - remotePeer; - remoteExtensions = { webtransportCerthashes: [] }; - payload; - connection; - xx; - staticKeypair; - prologue; - constructor(isInitiator, payload, prologue, crypto, staticKeypair, connection, remotePeer, handshake) { - this.isInitiator = isInitiator; - this.payload = payload; - this.prologue = prologue; - this.staticKeypair = staticKeypair; - this.connection = connection; - if (remotePeer) { - this.remotePeer = remotePeer; - } - this.xx = handshake ?? new XX(crypto); - this.session = this.xx.initSession(this.isInitiator, this.prologue, this.staticKeypair); - } - // stage 0 - async propose() { - logLocalStaticKeys(this.session.hs.s); - if (this.isInitiator) { - logger.trace('Stage 0 - Initiator starting to send first message.'); - const messageBuffer = this.xx.sendMessage(this.session, uint8ArrayAlloc(0)); - await this.connection.write(encode0(messageBuffer)); - logger.trace('Stage 0 - Initiator finished sending first message.'); - logLocalEphemeralKeys(this.session.hs.e); - } - else { - logger.trace('Stage 0 - Responder waiting to receive first message...'); - const receivedMessageBuffer = decode0((await this.connection.read()).subarray()); - const { valid } = this.xx.recvMessage(this.session, receivedMessageBuffer); - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 0 validation fail'); - } - logger.trace('Stage 0 - Responder received first message.'); - logRemoteEphemeralKey(this.session.hs.re); - } - } - // stage 1 - async exchange() { - if (this.isInitiator) { - logger.trace('Stage 1 - Initiator waiting to receive first message from responder...'); - const receivedMessageBuffer = decode1((await this.connection.read()).subarray()); - const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer); - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 1 validation fail'); - } - logger.trace('Stage 1 - Initiator received the message.'); - logRemoteEphemeralKey(this.session.hs.re); - logRemoteStaticKey(this.session.hs.rs); - logger.trace("Initiator going to check remote's signature..."); - try { - const decodedPayload = decodePayload(plaintext); - this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload); - await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer); - this.setRemoteNoiseExtension(decodedPayload.extensions); - } - catch (e) { - const err = e; - throw new UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`); - } - logger.trace('All good with the signature!'); - } - else { - logger.trace('Stage 1 - Responder sending out first message with signed payload and static key.'); - const messageBuffer = this.xx.sendMessage(this.session, this.payload); - await this.connection.write(encode1(messageBuffer)); - logger.trace('Stage 1 - Responder sent the second handshake message with signed payload.'); - logLocalEphemeralKeys(this.session.hs.e); - } - } - // stage 2 - async finish() { - if (this.isInitiator) { - logger.trace('Stage 2 - Initiator sending third handshake message.'); - const messageBuffer = this.xx.sendMessage(this.session, this.payload); - await this.connection.write(encode2(messageBuffer)); - logger.trace('Stage 2 - Initiator sent message with signed payload.'); - } - else { - logger.trace('Stage 2 - Responder waiting for third handshake message...'); - const receivedMessageBuffer = decode2((await this.connection.read()).subarray()); - const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer); - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 2 validation fail'); - } - logger.trace('Stage 2 - Responder received the message, finished handshake.'); - try { - const decodedPayload = decodePayload(plaintext); - this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload); - await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer); - this.setRemoteNoiseExtension(decodedPayload.extensions); - } - catch (e) { - const err = e; - throw new UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`); - } - } - logCipherState(this.session); - } - encrypt(plaintext, session) { - const cs = this.getCS(session); - return this.xx.encryptWithAd(cs, uint8ArrayAlloc(0), plaintext); - } - decrypt(ciphertext, session, dst) { - const cs = this.getCS(session, false); - return this.xx.decryptWithAd(cs, uint8ArrayAlloc(0), ciphertext, dst); - } - getRemoteStaticKey() { - return this.session.hs.rs; - } - getCS(session, encryption = true) { - if (!session.cs1 || !session.cs2) { - throw new InvalidCryptoExchangeError('Handshake not completed properly, cipher state does not exist.'); - } - if (this.isInitiator) { - return encryption ? session.cs1 : session.cs2; - } - else { - return encryption ? session.cs2 : session.cs1; - } - } - setRemoteNoiseExtension(e) { - if (e) { - this.remoteExtensions = e; - } - } -} -//# sourceMappingURL=handshake-xx.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshake-xx.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshake-xx.js.map deleted file mode 100644 index 1b47203b9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshake-xx.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handshake-xx.js","sourceRoot":"","sources":["../../src/handshake-xx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC1F,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACnF,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACf,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,YAAY,CAAA;AAUnB,MAAM,OAAO,WAAW;IACf,WAAW,CAAS;IACpB,OAAO,CAAc;IACrB,UAAU,CAAS;IACnB,gBAAgB,GAAoB,EAAE,sBAAsB,EAAE,EAAE,EAAE,CAAA;IAE/D,OAAO,CAAO;IACd,UAAU,CAAsB;IAChC,EAAE,CAAI;IACN,aAAa,CAAS;IAEf,QAAQ,CAAS;IAElC,YACE,WAAoB,EACpB,OAAc,EACd,QAAiB,EACjB,MAAwB,EACxB,aAAsB,EACtB,UAAgC,EAChC,UAAmB,EACnB,SAAc;QAEd,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QAClC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,UAAU,EAAE;YACd,IAAI,CAAC,UAA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AC,EAAE,CAAA;IAC3B,CAAC;IAEO,KAAK,CAAE,OAAqB,EAAE,UAAU,GAAG,IAAI;QACrD,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChC,MAAM,IAAI,0BAA0B,CAAC,gEAAgE,CAAC,CAAA;SACvG;QAED,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,OAAO,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA;SAC9C;aAAM;YACL,OAAO,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA;SAC9C;IACH,CAAC;IAES,uBAAuB,CAAE,CAAqC;QACtE,IAAI,CAAC,EAAE;YACL,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAA;SAC1B;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/abstract-handshake.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/abstract-handshake.d.ts deleted file mode 100644 index eb1e51754..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/abstract-handshake.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Nonce } from '../nonce.js'; -import type { bytes, bytes32 } from '../@types/basic.js'; -import type { CipherState, MessageBuffer, SymmetricState } from '../@types/handshake.js'; -import type { ICryptoInterface } from '../crypto.js'; -export interface DecryptedResult { - plaintext: bytes; - valid: boolean; -} -export interface SplitState { - cs1: CipherState; - cs2: CipherState; -} -export declare abstract class AbstractHandshake { - crypto: ICryptoInterface; - constructor(crypto: ICryptoInterface); - encryptWithAd(cs: CipherState, ad: Uint8Array, plaintext: Uint8Array): bytes; - decryptWithAd(cs: CipherState, ad: Uint8Array, ciphertext: Uint8Array, dst?: Uint8Array): DecryptedResult; - protected hasKey(cs: CipherState): boolean; - protected createEmptyKey(): bytes32; - protected isEmptyKey(k: bytes32): boolean; - protected encrypt(k: bytes32, n: Nonce, ad: Uint8Array, plaintext: Uint8Array): bytes; - protected encryptAndHash(ss: SymmetricState, plaintext: bytes): bytes; - protected decrypt(k: bytes32, n: Nonce, ad: bytes, ciphertext: bytes, dst?: Uint8Array): DecryptedResult; - protected decryptAndHash(ss: SymmetricState, ciphertext: bytes): DecryptedResult; - protected dh(privateKey: bytes32, publicKey: bytes32): bytes32; - protected mixHash(ss: SymmetricState, data: bytes): void; - protected getHash(a: Uint8Array, b: Uint8Array): bytes32; - protected mixKey(ss: SymmetricState, ikm: bytes32): void; - protected initializeKey(k: bytes32): CipherState; - protected initializeSymmetric(protocolName: string): SymmetricState; - protected hashProtocolName(protocolName: Uint8Array): bytes32; - protected split(ss: SymmetricState): SplitState; - protected writeMessageRegular(cs: CipherState, payload: bytes): MessageBuffer; - protected readMessageRegular(cs: CipherState, message: MessageBuffer): DecryptedResult; -} -//# sourceMappingURL=abstract-handshake.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/abstract-handshake.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/abstract-handshake.d.ts.map deleted file mode 100644 index 0ffc88414..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/abstract-handshake.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-handshake.d.ts","sourceRoot":"","sources":["../../../src/handshakes/abstract-handshake.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,c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AAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO;IAgB/D,SAAS,CAAC,OAAO,CAAE,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,KAAK,GAAG,IAAI;IAIzD,SAAS,CAAC,OAAO,CAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO;IAKzD,SAAS,CAAC,MAAM,CAAE,EAAE,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI;IAMzD,SAAS,CAAC,aAAa,CAAE,CAAC,EAAE,OAAO,GAAG,WAAW;IAMjD,SAAS,CAAC,mBAAmB,CAAE,YAAY,EAAE,MAAM,GAAG,cAAc;IAWpE,SAAS,CAAC,gBAAgB,CAAE,YAAY,EAAE,UAAU,GAAG,OAAO;IAU9D,SAAS,CAAC,KAAK,CAAE,EAAE,EAAE,cAAc,GAAG,UAAU;IAQhD,SAAS,CAAC,mBAAmB,CAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,GAAG,aAAa;IAQ9E,SAAS,CAAC,kBAAkB,CAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,GAAG,eAAe;CAGxF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/abstract-handshake.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/abstract-handshake.js deleted file mode 100644 index f1d205fe1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/abstract-handshake.js +++ /dev/null @@ -1,141 +0,0 @@ -import { fromString as uint8ArrayFromString } from 'uint8arrays'; -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; -import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; -import { logger } from '../logger.js'; -import { Nonce } from '../nonce.js'; -export class AbstractHandshake { - crypto; - constructor(crypto) { - this.crypto = crypto; - } - encryptWithAd(cs, ad, plaintext) { - const e = this.encrypt(cs.k, cs.n, ad, plaintext); - cs.n.increment(); - return e; - } - decryptWithAd(cs, ad, ciphertext, dst) { - const { plaintext, valid } = this.decrypt(cs.k, cs.n, ad, ciphertext, dst); - if (valid) - cs.n.increment(); - return { plaintext, valid }; - } - // Cipher state related - hasKey(cs) { - return !this.isEmptyKey(cs.k); - } - createEmptyKey() { - return uint8ArrayAlloc(32); - } - isEmptyKey(k) { - const emptyKey = this.createEmptyKey(); - return uint8ArrayEquals(emptyKey, k); - } - encrypt(k, n, ad, plaintext) { - n.assertValue(); - return this.crypto.chaCha20Poly1305Encrypt(plaintext, n.getBytes(), ad, k); - } - encryptAndHash(ss, plaintext) { - let ciphertext; - if (this.hasKey(ss.cs)) { - ciphertext = this.encryptWithAd(ss.cs, ss.h, plaintext); - } - else { - ciphertext = plaintext; - } - this.mixHash(ss, ciphertext); - return ciphertext; - } - decrypt(k, n, ad, ciphertext, dst) { - n.assertValue(); - const encryptedMessage = this.crypto.chaCha20Poly1305Decrypt(ciphertext, n.getBytes(), ad, k, dst); - if (encryptedMessage) { - return { - plaintext: encryptedMessage, - valid: true - }; - } - else { - return { - plaintext: uint8ArrayAlloc(0), - valid: false - }; - } - } - decryptAndHash(ss, ciphertext) { - let plaintext; - let valid = true; - if (this.hasKey(ss.cs)) { - ({ plaintext, valid } = this.decryptWithAd(ss.cs, ss.h, ciphertext)); - } - else { - plaintext = ciphertext; - } - this.mixHash(ss, ciphertext); - return { plaintext, valid }; - } - dh(privateKey, publicKey) { - try { - const derivedU8 = this.crypto.generateX25519SharedKey(privateKey, publicKey); - if (derivedU8.length === 32) { - return derivedU8; - } - return derivedU8.subarray(0, 32); - } - catch (e) { - const err = e; - logger.error(err); - return uint8ArrayAlloc(32); - } - } - mixHash(ss, data) { - ss.h = this.getHash(ss.h, data); - } - getHash(a, b) { - const u = this.crypto.hashSHA256(uint8ArrayConcat([a, b], a.length + b.length)); - return u; - } - mixKey(ss, ikm) { - const [ck, tempK] = this.crypto.getHKDF(ss.ck, ikm); - ss.cs = this.initializeKey(tempK); - ss.ck = ck; - } - initializeKey(k) { - return { k, n: new Nonce() }; - } - // Symmetric state related - initializeSymmetric(protocolName) { - const protocolNameBytes = uint8ArrayFromString(protocolName, 'utf-8'); - const h = this.hashProtocolName(protocolNameBytes); - const ck = h; - const key = this.createEmptyKey(); - const cs = this.initializeKey(key); - return { cs, ck, h }; - } - hashProtocolName(protocolName) { - if (protocolName.length <= 32) { - const h = uint8ArrayAlloc(32); - h.set(protocolName); - return h; - } - else { - return this.getHash(protocolName, uint8ArrayAlloc(0)); - } - } - split(ss) { - const [tempk1, tempk2] = this.crypto.getHKDF(ss.ck, uint8ArrayAlloc(0)); - const cs1 = this.initializeKey(tempk1); - const cs2 = this.initializeKey(tempk2); - return { cs1, cs2 }; - } - writeMessageRegular(cs, payload) { - const ciphertext = this.encryptWithAd(cs, uint8ArrayAlloc(0), payload); - const ne = this.createEmptyKey(); - const ns = uint8ArrayAlloc(0); - return { ne, ns, ciphertext }; - } - readMessageRegular(cs, message) { - return this.decryptWithAd(cs, uint8ArrayAlloc(0), message.ciphertext); - } -} -//# sourceMappingURL=abstract-handshake.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/abstract-handshake.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/abstract-handshake.js.map deleted file mode 100644 index 757420896..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/abstract-handshake.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-handshake.js","sourceRoot":"","sources":["../../../src/handshakes/abstract-handshake.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,KAA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,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAA;QACvE,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAEtC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;IACrB,CAAC;IAES,mBAAmB,CAAE,EAAe,EAAE,OAAc;QAC5D,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;QACtE,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;QAChC,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,CAAC,CAAA;QAE7B,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,CAAA;IAC/B,CAAC;IAES,kBAAkB,CAAE,EAAe,EAAE,OAAsB;QACnE,OAAO,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;IACvE,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/xx.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/xx.d.ts deleted file mode 100644 index bf79dc414..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/xx.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { AbstractHandshake, type DecryptedResult } from './abstract-handshake.js'; -import type { bytes32, bytes } from '../@types/basic.js'; -import type { MessageBuffer, NoiseSession } from '../@types/handshake.js'; -import type { KeyPair } from '../@types/libp2p.js'; -export declare class XX extends AbstractHandshake { - private initializeInitiator; - private initializeResponder; - private writeMessageA; - private writeMessageB; - private writeMessageC; - private readMessageA; - private readMessageB; - private readMessageC; - initSession(initiator: boolean, prologue: bytes32, s: KeyPair): NoiseSession; - sendMessage(session: NoiseSession, message: bytes, ephemeral?: KeyPair): MessageBuffer; - recvMessage(session: NoiseSession, message: MessageBuffer): DecryptedResult; -} -//# sourceMappingURL=xx.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/xx.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/xx.d.ts.map deleted file mode 100644 index 76c3cbdac..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/xx.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx.d.ts","sourceRoot":"","sources":["../../../src/handshakes/xx.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACjF,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAA+B,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACtG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,qBAAa,EAAG,SAAQ,iBAAiB;IACvC,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,YAAY;IAmBpB,OAAO,CAAC,YAAY;IAgBb,WAAW,CAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,YAAY;IAkB7E,WAAW,CAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,aAAa;IAkCvF,WAAW,CAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,GAAG,eAAe;CAkBpF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/xx.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/xx.js deleted file mode 100644 index dbfa58f06..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/xx.js +++ /dev/null @@ -1,162 +0,0 @@ -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { isValidPublicKey } from '../utils.js'; -import { AbstractHandshake } from './abstract-handshake.js'; -export class XX extends AbstractHandshake { - initializeInitiator(prologue, s, rs, psk) { - const name = 'Noise_XX_25519_ChaChaPoly_SHA256'; - const ss = this.initializeSymmetric(name); - this.mixHash(ss, prologue); - const re = uint8ArrayAlloc(32); - return { ss, s, rs, psk, re }; - } - initializeResponder(prologue, s, rs, psk) { - const name = 'Noise_XX_25519_ChaChaPoly_SHA256'; - const ss = this.initializeSymmetric(name); - this.mixHash(ss, prologue); - const re = uint8ArrayAlloc(32); - return { ss, s, rs, psk, re }; - } - writeMessageA(hs, payload, e) { - const ns = uint8ArrayAlloc(0); - if (e !== undefined) { - hs.e = e; - } - else { - hs.e = this.crypto.generateX25519KeyPair(); - } - const ne = hs.e.publicKey; - this.mixHash(hs.ss, ne); - const ciphertext = this.encryptAndHash(hs.ss, payload); - return { ne, ns, ciphertext }; - } - writeMessageB(hs, payload) { - hs.e = this.crypto.generateX25519KeyPair(); - const ne = hs.e.publicKey; - this.mixHash(hs.ss, ne); - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re)); - const spk = hs.s.publicKey; - const ns = this.encryptAndHash(hs.ss, spk); - this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re)); - const ciphertext = this.encryptAndHash(hs.ss, payload); - return { ne, ns, ciphertext }; - } - writeMessageC(hs, payload) { - const spk = hs.s.publicKey; - const ns = this.encryptAndHash(hs.ss, spk); - this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re)); - const ciphertext = this.encryptAndHash(hs.ss, payload); - const ne = this.createEmptyKey(); - const messageBuffer = { ne, ns, ciphertext }; - const { cs1, cs2 } = this.split(hs.ss); - return { h: hs.ss.h, messageBuffer, cs1, cs2 }; - } - readMessageA(hs, message) { - if (isValidPublicKey(message.ne)) { - hs.re = message.ne; - } - this.mixHash(hs.ss, hs.re); - return this.decryptAndHash(hs.ss, message.ciphertext); - } - readMessageB(hs, message) { - if (isValidPublicKey(message.ne)) { - hs.re = message.ne; - } - this.mixHash(hs.ss, hs.re); - if (!hs.e) { - throw new Error('Handshake state `e` param is missing.'); - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re)); - const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns); - if (valid1 && isValidPublicKey(ns)) { - hs.rs = ns; - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs)); - const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext); - return { plaintext, valid: (valid1 && valid2) }; - } - readMessageC(hs, message) { - const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns); - if (valid1 && isValidPublicKey(ns)) { - hs.rs = ns; - } - if (!hs.e) { - throw new Error('Handshake state `e` param is missing.'); - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs)); - const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext); - const { cs1, cs2 } = this.split(hs.ss); - return { h: hs.ss.h, plaintext, valid: (valid1 && valid2), cs1, cs2 }; - } - initSession(initiator, prologue, s) { - const psk = this.createEmptyKey(); - const rs = uint8ArrayAlloc(32); // no static key yet - let hs; - if (initiator) { - hs = this.initializeInitiator(prologue, s, rs, psk); - } - else { - hs = this.initializeResponder(prologue, s, rs, psk); - } - return { - hs, - i: initiator, - mc: 0 - }; - } - sendMessage(session, message, ephemeral) { - let messageBuffer; - if (session.mc === 0) { - messageBuffer = this.writeMessageA(session.hs, message, ephemeral); - } - else if (session.mc === 1) { - messageBuffer = this.writeMessageB(session.hs, message); - } - else if (session.mc === 2) { - const { h, messageBuffer: resultingBuffer, cs1, cs2 } = this.writeMessageC(session.hs, message); - messageBuffer = resultingBuffer; - session.h = h; - session.cs1 = cs1; - session.cs2 = cs2; - } - else if (session.mc > 2) { - if (session.i) { - if (!session.cs1) { - throw new Error('CS1 (cipher state) is not defined'); - } - messageBuffer = this.writeMessageRegular(session.cs1, message); - } - else { - if (!session.cs2) { - throw new Error('CS2 (cipher state) is not defined'); - } - messageBuffer = this.writeMessageRegular(session.cs2, message); - } - } - else { - throw new Error('Session invalid.'); - } - session.mc++; - return messageBuffer; - } - recvMessage(session, message) { - let plaintext = uint8ArrayAlloc(0); - let valid = false; - if (session.mc === 0) { - ({ plaintext, valid } = this.readMessageA(session.hs, message)); - } - else if (session.mc === 1) { - ({ plaintext, valid } = this.readMessageB(session.hs, message)); - } - else if (session.mc === 2) { - const { h, plaintext: resultingPlaintext, valid: resultingValid, cs1, cs2 } = this.readMessageC(session.hs, message); - plaintext = resultingPlaintext; - valid = resultingValid; - session.h = h; - session.cs1 = cs1; - session.cs2 = cs2; - } - session.mc++; - return { plaintext, valid }; - } -} -//# sourceMappingURL=xx.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/xx.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/xx.js.map deleted file mode 100644 index e4e4a1586..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/handshakes/xx.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":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dist/src/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/index.d.ts deleted file mode 100644 index 20ec9c473..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { NoiseInit } from './noise.js'; -import type { NoiseExtensions } from './proto/payload.js'; -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter'; -export type { ICryptoInterface } from './crypto.js'; -export { pureJsCrypto } from './crypto/js.js'; -export declare function noise(init?: NoiseInit): () => ConnectionEncrypter; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/index.d.ts.map deleted file mode 100644 index 4c067ef45..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AACjF,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,wBAAgB,KAAK,CAAE,IAAI,GAAE,SAAc,GAAG,MAAM,mBAAmB,CAAC,eAAe,CAAC,CAEvF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/index.js deleted file mode 100644 index 83cdd3f49..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import { Noise } from './noise.js'; -export { pureJsCrypto } from './crypto/js.js'; -export function noise(init = {}) { - return () => new Noise(init); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/index.js.map deleted file mode 100644 index fbdf2daf9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAKlC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,UAAU,KAAK,CAAE,OAAkB,EAAE;IACzC,OAAO,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/logger.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/logger.d.ts deleted file mode 100644 index 55e6ab35d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/logger.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { type Logger } from '@libp2p/logger'; -import type { NoiseSession } from './@types/handshake.js'; -import type { KeyPair } from './@types/libp2p.js'; -declare const log: Logger; -export { log as logger }; -export declare function logLocalStaticKeys(s: KeyPair): void; -export declare function logLocalEphemeralKeys(e: KeyPair | undefined): void; -export declare function logRemoteStaticKey(rs: Uint8Array): void; -export declare function logRemoteEphemeralKey(re: Uint8Array): void; -export declare function logCipherState(session: NoiseSession): void; -//# sourceMappingURL=logger.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/logger.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/logger.d.ts.map deleted file mode 100644 index 8873892ba..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/logger.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAU,MAAM,gBAAgB,CAAA;AAGpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAEjD,QAAA,MAAM,GAAG,QAAyB,CAAA;AAElC,OAAO,EAAE,GAAG,IAAI,MAAM,EAAE,CAAA;AAaxB,wBAAgB,kBAAkB,CAAE,CAAC,EAAE,OAAO,GAAG,IAAI,CAGpD;AAED,wBAAgB,qBAAqB,CAAE,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAOnE;AAED,wBAAgB,kBAAkB,CAAE,EAAE,EAAE,UAAU,GAAG,IAAI,CAExD;AAED,wBAAgB,qBAAqB,CAAE,EAAE,EAAE,UAAU,GAAG,IAAI,CAE3D;AAED,wBAAgB,cAAc,CAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CAO3D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/logger.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/logger.js deleted file mode 100644 index daf1e24aa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/logger.js +++ /dev/null @@ -1,45 +0,0 @@ -import { logger } from '@libp2p/logger'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { DUMP_SESSION_KEYS } from './constants.js'; -const log = logger('libp2p:noise'); -export { log as logger }; -let keyLogger; -if (DUMP_SESSION_KEYS) { - keyLogger = log; -} -else { - keyLogger = Object.assign(() => { }, { - enabled: false, - trace: () => { }, - error: () => { } - }); -} -export function logLocalStaticKeys(s) { - keyLogger(`LOCAL_STATIC_PUBLIC_KEY ${uint8ArrayToString(s.publicKey, 'hex')}`); - keyLogger(`LOCAL_STATIC_PRIVATE_KEY ${uint8ArrayToString(s.privateKey, 'hex')}`); -} -export function logLocalEphemeralKeys(e) { - if (e) { - keyLogger(`LOCAL_PUBLIC_EPHEMERAL_KEY ${uint8ArrayToString(e.publicKey, 'hex')}`); - keyLogger(`LOCAL_PRIVATE_EPHEMERAL_KEY ${uint8ArrayToString(e.privateKey, 'hex')}`); - } - else { - keyLogger('Missing local ephemeral keys.'); - } -} -export function logRemoteStaticKey(rs) { - keyLogger(`REMOTE_STATIC_PUBLIC_KEY ${uint8ArrayToString(rs, 'hex')}`); -} -export function logRemoteEphemeralKey(re) { - keyLogger(`REMOTE_EPHEMERAL_PUBLIC_KEY ${uint8ArrayToString(re, 'hex')}`); -} -export function logCipherState(session) { - if (session.cs1 && session.cs2) { - keyLogger(`CIPHER_STATE_1 ${session.cs1.n.getUint64()} ${uint8ArrayToString(session.cs1.k, 'hex')}`); - keyLogger(`CIPHER_STATE_2 ${session.cs2.n.getUint64()} ${uint8ArrayToString(session.cs2.k, 'hex')}`); - } - else { - keyLogger('Missing cipher state.'); - } -} -//# sourceMappingURL=logger.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/logger.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/logger.js.map deleted file mode 100644 index e408da6b8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/logger.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version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AS,CAAC,4BAA4B,kBAAkB,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;AACxE,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAE,EAAc;IACnD,SAAS,CAAC,+BAA+B,kBAAkB,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;AAC3E,CAAC;AAED,MAAM,UAAU,cAAc,CAAE,OAAqB;IACnD,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE;QAC9B,SAAS,CAAC,kBAAkB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;QACpG,SAAS,CAAC,kBAAkB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;KACrG;SAAM;QACL,SAAS,CAAC,uBAAuB,CAAC,CAAA;KACnC;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/metrics.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/metrics.d.ts deleted file mode 100644 index 4fe5a1280..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/metrics.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Counter, Metrics } from '@libp2p/interface/metrics'; -export type MetricsRegistry = Record; -export declare function registerMetrics(metrics: Metrics): MetricsRegistry; -//# sourceMappingURL=metrics.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/metrics.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/metrics.d.ts.map deleted file mode 100644 index 5d29159ee..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/metrics.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../src/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEjE,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAErD,wBAAgB,eAAe,CAAE,OAAO,EAAE,OAAO,GAAG,eAAe,CA2BlE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/metrics.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/metrics.js deleted file mode 100644 index 1b5123db8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/metrics.js +++ /dev/null @@ -1,20 +0,0 @@ -export function registerMetrics(metrics) { - return { - xxHandshakeSuccesses: metrics.registerCounter('libp2p_noise_xxhandshake_successes_total', { - help: 'Total count of noise xxHandshakes successes_' - }), - xxHandshakeErrors: metrics.registerCounter('libp2p_noise_xxhandshake_error_total', { - help: 'Total count of noise xxHandshakes errors' - }), - encryptedPackets: metrics.registerCounter('libp2p_noise_encrypted_packets_total', { - help: 'Total count of noise encrypted packets successfully' - }), - decryptedPackets: metrics.registerCounter('libp2p_noise_decrypted_packets_total', { - help: 'Total count of noise decrypted packets' - }), - decryptErrors: metrics.registerCounter('libp2p_noise_decrypt_errors_total', { - help: 'Total count of noise decrypt errors' - }) - }; -} -//# sourceMappingURL=metrics.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/metrics.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/metrics.js.map deleted file mode 100644 index 9c23b331e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/metrics.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/metrics.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,eAAe,CAAE,OAAgB;IAC/C,OAAO;QACL,oBAAoB,EAAE,OAAO,CAAC,eAAe,CAC3C,0CAA0C,EAAE;YAC1C,IAAI,EAAE,8CAA8C;SACrD,CAAC;QAEJ,iBAAiB,EAAE,OAAO,CAAC,eAAe,CACxC,sCAAsC,EAAE;YACtC,IAAI,EAAE,0CAA0C;SACjD,CAAC;QAEJ,gBAAgB,EAAE,OAAO,CAAC,eAAe,CACvC,sCAAsC,EAAE;YACtC,IAAI,EAAE,qDAAqD;SAC5D,CAAC;QAEJ,gBAAgB,EAAE,OAAO,CAAC,eAAe,CACvC,sCAAsC,EAAE;YACtC,IAAI,EAAE,wCAAwC;SAC/C,CAAC;QAEJ,aAAa,EAAE,OAAO,CAAC,eAAe,CACpC,mCAAmC,EAAE;YACnC,IAAI,EAAE,qCAAqC;SAC5C,CAAC;KACL,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/noise.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/noise.d.ts deleted file mode 100644 index 51255c0e1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/noise.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { bytes } from './@types/basic.js'; -import type { INoiseConnection } from './@types/libp2p.js'; -import type { ICryptoInterface } from './crypto.js'; -import type { NoiseExtensions } from './proto/payload.js'; -import type { MultiaddrConnection } from '@libp2p/interface/connection'; -import type { SecuredConnection } from '@libp2p/interface/connection-encrypter'; -import type { Metrics } from '@libp2p/interface/metrics'; -import type { PeerId } from '@libp2p/interface/peer-id'; -import type { Duplex } from 'it-stream-types'; -import type { Uint8ArrayList } from 'uint8arraylist'; -export interface NoiseInit { - /** - * x25519 private key, reuse for faster handshakes - */ - staticNoiseKey?: bytes; - extensions?: NoiseExtensions; - crypto?: ICryptoInterface; - prologueBytes?: Uint8Array; - metrics?: Metrics; -} -export declare class Noise implements INoiseConnection { - protocol: string; - crypto: ICryptoInterface; - private readonly prologue; - private readonly staticKeys; - private readonly extensions?; - private readonly metrics?; - constructor(init?: NoiseInit); - /** - * Encrypt outgoing data to the remote party (handshake as initiator) - * - * @param {PeerId} localPeer - PeerId of the receiving peer - * @param {Stream} connection - streaming iterable duplex that will be encrypted - * @param {PeerId} remotePeer - PeerId of the remote peer. Used to validate the integrity of the remote peer. - * @returns {Promise>} - */ - secureOutbound> = MultiaddrConnection>(localPeer: PeerId, connection: Stream, remotePeer?: PeerId): Promise>; - /** - * Decrypt incoming data (handshake as responder). - * - * @param {PeerId} localPeer - PeerId of the receiving peer. - * @param {Stream} connection - streaming iterable duplex that will be encrypted. - * @param {PeerId} remotePeer - optional PeerId of the initiating peer, if known. This may only exist during transport upgrades. - * @returns {Promise>} - */ - secureInbound> = MultiaddrConnection>(localPeer: PeerId, connection: Stream, remotePeer?: PeerId): Promise>; - /** - * If Noise pipes supported, tries IK handshake first with XX as fallback if it fails. - * If noise pipes disabled or remote peer static key is unknown, use XX. - * - * @param {HandshakeParams} params - */ - private performHandshake; - private performXXHandshake; - private createSecureConnection; -} -//# sourceMappingURL=noise.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/noise.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/noise.d.ts.map deleted file mode 100644 index cec69f3cf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/noise.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise.d.ts","sourceRoot":"","sources":["../../src/noise.ts"],"names":[],"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AAG,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IA2BxO;;;;;;;OAOG;IACU,aAAa,CAAE,MAAM,SAAS,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,GAAG,mBAAmB,EAAG,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IA2BvO;;;;;OAKG;YACW,gBAAgB;YAOhB,kBAAkB;YA+BlB,sBAAsB;CAmBrC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/noise.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/noise.js deleted file mode 100644 index ff97e2199..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/noise.js +++ /dev/null @@ -1,135 +0,0 @@ -import { decode } from 'it-length-prefixed'; -import { lpStream } from 'it-length-prefixed-stream'; -import { duplexPair } from 'it-pair/duplex'; -import { pipe } from 'it-pipe'; -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { NOISE_MSG_MAX_LENGTH_BYTES } from './constants.js'; -import { defaultCrypto } from './crypto/index.js'; -import { decryptStream, encryptStream } from './crypto/streaming.js'; -import { uint16BEDecode, uint16BEEncode } from './encoder.js'; -import { XXHandshake } from './handshake-xx.js'; -import { registerMetrics } from './metrics.js'; -import { getPayload } from './utils.js'; -export class Noise { - protocol = '/noise'; - crypto; - prologue; - staticKeys; - extensions; - metrics; - constructor(init = {}) { - const { staticNoiseKey, extensions, crypto, prologueBytes, metrics } = init; - this.crypto = crypto ?? defaultCrypto; - this.extensions = extensions; - this.metrics = metrics ? registerMetrics(metrics) : undefined; - if (staticNoiseKey) { - // accepts x25519 private key of length 32 - this.staticKeys = this.crypto.generateX25519KeyPairFromSeed(staticNoiseKey); - } - else { - this.staticKeys = this.crypto.generateX25519KeyPair(); - } - this.prologue = prologueBytes ?? uint8ArrayAlloc(0); - } - /** - * Encrypt outgoing data to the remote party (handshake as initiator) - * - * @param {PeerId} localPeer - PeerId of the receiving peer - * @param {Stream} connection - streaming iterable duplex that will be encrypted - * @param {PeerId} remotePeer - PeerId of the remote peer. Used to validate the integrity of the remote peer. - * @returns {Promise>} - */ - async secureOutbound(localPeer, connection, remotePeer) { - const wrappedConnection = lpStream(connection, { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - }); - const handshake = await this.performHandshake({ - connection: wrappedConnection, - isInitiator: true, - localPeer, - remotePeer - }); - const conn = await this.createSecureConnection(wrappedConnection, handshake); - connection.source = conn.source; - connection.sink = conn.sink; - return { - conn: connection, - remoteExtensions: handshake.remoteExtensions, - remotePeer: handshake.remotePeer - }; - } - /** - * Decrypt incoming data (handshake as responder). - * - * @param {PeerId} localPeer - PeerId of the receiving peer. - * @param {Stream} connection - streaming iterable duplex that will be encrypted. - * @param {PeerId} remotePeer - optional PeerId of the initiating peer, if known. This may only exist during transport upgrades. - * @returns {Promise>} - */ - async secureInbound(localPeer, connection, remotePeer) { - const wrappedConnection = lpStream(connection, { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - }); - const handshake = await this.performHandshake({ - connection: wrappedConnection, - isInitiator: false, - localPeer, - remotePeer - }); - const conn = await this.createSecureConnection(wrappedConnection, handshake); - connection.source = conn.source; - connection.sink = conn.sink; - return { - conn: connection, - remotePeer: handshake.remotePeer, - remoteExtensions: handshake.remoteExtensions - }; - } - /** - * If Noise pipes supported, tries IK handshake first with XX as fallback if it fails. - * If noise pipes disabled or remote peer static key is unknown, use XX. - * - * @param {HandshakeParams} params - */ - async performHandshake(params) { - const payload = await getPayload(params.localPeer, this.staticKeys.publicKey, this.extensions); - // run XX handshake - return this.performXXHandshake(params, payload); - } - async performXXHandshake(params, payload) { - const { isInitiator, remotePeer, connection } = params; - const handshake = new XXHandshake(isInitiator, payload, this.prologue, this.crypto, this.staticKeys, connection, remotePeer); - try { - await handshake.propose(); - await handshake.exchange(); - await handshake.finish(); - this.metrics?.xxHandshakeSuccesses.increment(); - } - catch (e) { - this.metrics?.xxHandshakeErrors.increment(); - if (e instanceof Error) { - e.message = `Error occurred during XX handshake: ${e.message}`; - throw e; - } - } - return handshake; - } - async createSecureConnection(connection, handshake) { - // Create encryption box/unbox wrapper - const [secure, user] = duplexPair(); - const network = connection.unwrap(); - await pipe(secure, // write to wrapper - encryptStream(handshake, this.metrics), // encrypt data + prefix with message length - network, // send to the remote peer - (source) => decode(source, { lengthDecoder: uint16BEDecode }), // read message length prefix - decryptStream(handshake, this.metrics), // decrypt the incoming data - secure // pipe to the wrapper - ); - return user; - } -} -//# sourceMappingURL=noise.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/noise.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/noise.js.map deleted file mode 100644 index dae7d9748..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/noise.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise.js","sourceRoot":"","sources":["../../src/noise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAA6B,MAAM,2BAA2B,CAAA;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM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AqB;QAErB,sCAAsC;QACtC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,UAAU,EAA+B,CAAA;QAChE,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,CAAA;QAEnC,MAAM,IAAI,CACR,MAAM,EAAE,mBAAmB;QAC3B,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,4CAA4C;QACpF,OAAO,EAAE,0BAA0B;QACnC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC,EAAE,6BAA6B;QAC5F,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,4BAA4B;QACpE,MAAM,CAAC,sBAAsB;SAC9B,CAAA;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/nonce.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/nonce.d.ts deleted file mode 100644 index 662855bd3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/nonce.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { bytes, uint64 } from './@types/basic.js'; -export declare const MIN_NONCE = 0; -export declare const MAX_NONCE = 4294967295; -/** - * The nonce is an uint that's increased over time. - * Maintaining different representations help improve performance. - */ -export declare class Nonce { - private n; - private readonly bytes; - private readonly view; - constructor(n?: number); - increment(): void; - getBytes(): bytes; - getUint64(): uint64; - assertValue(): void; -} -//# sourceMappingURL=nonce.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/nonce.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/nonce.d.ts.map deleted file mode 100644 index 6e502d077..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/nonce.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nonce.d.ts","sourceRoot":"","sources":["../../src/nonce.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAEtD,eAAO,MAAM,SAAS,IAAI,CAAA;AAO1B,eAAO,MAAM,SAAS,aAAa,CAAA;AAInC;;;GAGG;AACH,qBAAa,KAAK;IAChB,OAAO,CAAC,CAAC,CAAQ;IACjB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;IAC7B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;gBAElB,CAAC,SAAY;IAO1B,SAAS,IAAK,IAAI;IAMlB,QAAQ,IAAK,KAAK;IAIlB,SAAS,IAAK,MAAM;IAIpB,WAAW,IAAK,IAAI;CAKrB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/nonce.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/nonce.js deleted file mode 100644 index 0130475cf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/nonce.js +++ /dev/null @@ -1,42 +0,0 @@ -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -export const MIN_NONCE = 0; -// For performance reasons, the nonce is represented as a JS `number` -// Although JS `number` can safely represent integers up to 2 ** 53 - 1, we choose to only use -// 4 bytes to store the data for performance reason. -// This is a slight deviation from the noise spec, which describes the max nonce as 2 ** 64 - 2 -// The effect is that this implementation will need a new handshake to be performed after fewer messages are exchanged than other implementations with full uint64 nonces. -// this MAX_NONCE is still a large number of messages, so the practical effect of this is negligible. -export const MAX_NONCE = 0xffffffff; -const ERR_MAX_NONCE = 'Cipherstate has reached maximum n, a new handshake must be performed'; -/** - * The nonce is an uint that's increased over time. - * Maintaining different representations help improve performance. - */ -export class Nonce { - n; - bytes; - view; - constructor(n = MIN_NONCE) { - this.n = n; - this.bytes = uint8ArrayAlloc(12); - this.view = new DataView(this.bytes.buffer, this.bytes.byteOffset, this.bytes.byteLength); - this.view.setUint32(4, n, true); - } - increment() { - this.n++; - // Even though we're treating the nonce as 8 bytes, RFC7539 specifies 12 bytes for a nonce. - this.view.setUint32(4, this.n, true); - } - getBytes() { - return this.bytes; - } - getUint64() { - return this.n; - } - assertValue() { - if (this.n > MAX_NONCE) { - throw new Error(ERR_MAX_NONCE); - } - } -} -//# sourceMappingURL=nonce.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/nonce.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/nonce.js.map deleted file mode 100644 index d663be87f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/nonce.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nonce.js","sourceRoot":"","sources":["../../src/nonce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAG5D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAA;AAC1B,qEAAqE;AACrE,8FAA8F;AAC9F,oDAAoD;AACpD,+FAA+F;AAC/F,0KAA0K;AAC1K,qGAAqG;AACrG,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAA;AAEnC,MAAM,aAAa,GAAG,sEAAsE,CAAA;AAE5F;;;GAGG;AACH,MAAM,OAAO,KAAK;IACR,CAAC,CAAQ;IACA,KAAK,CAAO;IACZ,IAAI,CAAU;IAE/B,YAAa,CAAC,GAAG,SAAS;QACxB,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,KAAK,GAAG,eAAe,CAAC,EAAE,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QACzF,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;IACjC,CAAC;IAED,SAAS;QACP,IAAI,CAAC,CAAC,EAAE,CAAA;QACR,2FAA2F;QAC3F,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;IACtC,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,CAAC,CAAA;IACf,CAAC;IAED,WAAW;QACT,IAAI,IAAI,CAAC,CAAC,GAAG,SAAS,EAAE;YACtB,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAA;SAC/B;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/proto/payload.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/proto/payload.d.ts deleted file mode 100644 index 9d10fef73..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/proto/payload.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { type Codec } from 'protons-runtime'; -import type { Uint8ArrayList } from 'uint8arraylist'; -export interface NoiseExtensions { - webtransportCerthashes: Uint8Array[]; -} -export declare namespace NoiseExtensions { - const codec: () => Codec; - const encode: (obj: Partial) => Uint8Array; - const decode: (buf: Uint8Array | Uint8ArrayList) => NoiseExtensions; -} -export interface NoiseHandshakePayload { - identityKey: Uint8Array; - identitySig: Uint8Array; - extensions?: NoiseExtensions; -} -export declare namespace NoiseHandshakePayload { - const codec: () => Codec; - const encode: (obj: Partial) => Uint8Array; - const decode: (buf: Uint8Array | Uint8ArrayList) => NoiseHandshakePayload; -} -//# sourceMappingURL=payload.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/proto/payload.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/proto/payload.d.ts.map deleted file mode 100644 index 69519e688..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/proto/payload.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/proto/payload.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,KAAK,EAAyC,MAAM,iBAAiB,CAAA;AAEnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,WAAW,eAAe;IAC9B,sBAAsB,EAAE,UAAU,EAAE,CAAA;CACrC;AAED,yBAAiB,eAAe,CAAC;IAGxB,MAAM,KAAK,QAAO,MAAM,eAAe,CA4C7C,CAAA;IAEM,MAAM,MAAM,QAAS,QAAQ,eAAe,CAAC,KAAG,UAEtD,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,GAAG,cAAc,KAAG,eAEzD,CAAA;CACF;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,UAAU,CAAA;IACvB,WAAW,EAAE,UAAU,CAAA;IACvB,UAAU,CAAC,EAAE,eAAe,CAAA;CAC7B;AAED,yBAAiB,qBAAqB,CAAC;IAG9B,MAAM,KAAK,QAAO,MAAM,qBAAqB,CA6DnD,CAAA;IAEM,MAAM,MAAM,QAAS,QAAQ,qBAAqB,CAAC,KAAG,UAE5D,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,GAAG,cAAc,KAAG,qBAEzD,CAAA;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/proto/payload.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/proto/payload.js deleted file mode 100644 index 6ff217bdf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/proto/payload.js +++ /dev/null @@ -1,119 +0,0 @@ -/* eslint-disable import/export */ -/* eslint-disable complexity */ -/* eslint-disable @typescript-eslint/no-namespace */ -/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ -/* eslint-disable @typescript-eslint/no-empty-interface */ -import { decodeMessage, encodeMessage, message } from 'protons-runtime'; -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -export var NoiseExtensions; -(function (NoiseExtensions) { - let _codec; - NoiseExtensions.codec = () => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork(); - } - if (obj.webtransportCerthashes != null) { - for (const value of obj.webtransportCerthashes) { - w.uint32(10); - w.bytes(value); - } - } - if (opts.lengthDelimited !== false) { - w.ldelim(); - } - }, (reader, length) => { - const obj = { - webtransportCerthashes: [] - }; - const end = length == null ? reader.len : reader.pos + length; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - obj.webtransportCerthashes.push(reader.bytes()); - break; - } - default: { - reader.skipType(tag & 7); - break; - } - } - } - return obj; - }); - } - return _codec; - }; - NoiseExtensions.encode = (obj) => { - return encodeMessage(obj, NoiseExtensions.codec()); - }; - NoiseExtensions.decode = (buf) => { - return decodeMessage(buf, NoiseExtensions.codec()); - }; -})(NoiseExtensions || (NoiseExtensions = {})); -export var NoiseHandshakePayload; -(function (NoiseHandshakePayload) { - let _codec; - NoiseHandshakePayload.codec = () => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork(); - } - if ((obj.identityKey != null && obj.identityKey.byteLength > 0)) { - w.uint32(10); - w.bytes(obj.identityKey); - } - if ((obj.identitySig != null && obj.identitySig.byteLength > 0)) { - w.uint32(18); - w.bytes(obj.identitySig); - } - if (obj.extensions != null) { - w.uint32(34); - NoiseExtensions.codec().encode(obj.extensions, w); - } - if (opts.lengthDelimited !== false) { - w.ldelim(); - } - }, (reader, length) => { - const obj = { - identityKey: uint8ArrayAlloc(0), - identitySig: uint8ArrayAlloc(0) - }; - const end = length == null ? reader.len : reader.pos + length; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - obj.identityKey = reader.bytes(); - break; - } - case 2: { - obj.identitySig = reader.bytes(); - break; - } - case 4: { - obj.extensions = NoiseExtensions.codec().decode(reader, reader.uint32()); - break; - } - default: { - reader.skipType(tag & 7); - break; - } - } - } - return obj; - }); - } - return _codec; - }; - NoiseHandshakePayload.encode = (obj) => { - return encodeMessage(obj, NoiseHandshakePayload.codec()); - }; - NoiseHandshakePayload.decode = (buf) => { - return decodeMessage(buf, NoiseHandshakePayload.codec()); - }; -})(NoiseHandshakePayload || (NoiseHandshakePayload = {})); -//# sourceMappingURL=payload.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/proto/payload.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/proto/payload.js.map deleted file mode 100644 index d87a4016f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/proto/payload.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../src/proto/payload.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,+BAA+B;AAC/B,oDAAoD;AACpD,8EAA8E;AAC9E,0DAA0D;AAE1D,OAAO,EAAc,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACnF,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAO5D,MAAM,KAAW,eAAe,CAwD/B;AAxDD,WAAiB,eAAe;IAC9B,IAAI,MAA8B,CAAA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CAAC,CAAC,CAAA;SACH;QAED,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;IAEY,4BAAM,GAAG,CAAC,GAAmC,EAAc,EAAE;QACxE,OAAO,aAAa,CAAC,GAAG,EAAE,qBAAqB,CAAC,KAAK,EAAE,CAAC,CAAA;IAC1D,CAAC,CAAA;IAEY,4BAAM,GAAG,CAAC,GAAgC,EAAyB,EAAE;QAChF,OAAO,aAAa,CAAC,GAAG,EAAE,qBAAqB,CAAC,KAAK,EAAE,CAAC,CAAA;IAC1D,CAAC,CAAA;AACH,CAAC,EAzEgB,qBAAqB,KAArB,qBAAqB,QAyErC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/utils.d.ts deleted file mode 100644 index 84d925c27..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/utils.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { type NoiseExtensions, NoiseHandshakePayload } from './proto/payload.js'; -import type { bytes } from './@types/basic.js'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export declare function getPayload(localPeer: PeerId, staticPublicKey: bytes, extensions?: NoiseExtensions): Promise; -export declare function createHandshakePayload(libp2pPublicKey: Uint8Array, signedPayload: Uint8Array, extensions?: NoiseExtensions): bytes; -export declare function signPayload(peerId: PeerId, payload: bytes): Promise; -export declare function getPeerIdFromPayload(payload: NoiseHandshakePayload): Promise; -export declare function decodePayload(payload: bytes | Uint8Array): NoiseHandshakePayload; -export declare function getHandshakePayload(publicKey: bytes): bytes; -/** - * Verifies signed payload, throws on any irregularities. - * - * @param {bytes} noiseStaticKey - owner's noise static key - * @param {bytes} payload - decoded payload - * @param {PeerId} remotePeer - owner's libp2p peer ID - * @returns {Promise} - peer ID of payload owner - */ -export declare function verifySignedPayload(noiseStaticKey: bytes, payload: NoiseHandshakePayload, remotePeer: PeerId): Promise; -export declare function isValidPublicKey(pk: bytes): boolean; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/utils.d.ts.map deleted file mode 100644 index 50f0d9642..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,wBAAsB,UAAU,CAC9B,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,KAAK,EACtB,UAAU,CAAC,EAAE,eAAe,GAC3B,OAAO,CAAC,KAAK,CAAC,CAYhB;AAED,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,UAAU,EAC3B,aAAa,EAAE,UAAU,EACzB,UAAU,CAAC,EAAE,eAAe,GAC3B,KAAK,CAMP;AAED,wBAAsB,WAAW,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAQjF;AAED,wBAAsB,oBAAoB,CAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAE3F;AAED,wBAAgB,aAAa,CAAE,OAAO,EAAE,KAAK,GAAG,UAAU,GAAG,qBAAqB,CAEjF;AAED,wBAAgB,mBAAmB,CAAE,SAAS,EAAE,KAAK,GAAG,KAAK,CAG5D;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,cAAc,EAAE,KAAK,EACrB,OAAO,EAAE,qBAAqB,EAC9B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAyBjB;AAED,wBAAgB,gBAAgB,CAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAUpD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/utils.js deleted file mode 100644 index b88ea5ef4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/utils.js +++ /dev/null @@ -1,74 +0,0 @@ -import { unmarshalPublicKey, unmarshalPrivateKey } from '@libp2p/crypto/keys'; -import { peerIdFromKeys } from '@libp2p/peer-id'; -import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { NoiseHandshakePayload } from './proto/payload.js'; -export async function getPayload(localPeer, staticPublicKey, extensions) { - const signedPayload = await signPayload(localPeer, getHandshakePayload(staticPublicKey)); - if (localPeer.publicKey == null) { - throw new Error('PublicKey was missing from local PeerId'); - } - return createHandshakePayload(localPeer.publicKey, signedPayload, extensions); -} -export function createHandshakePayload(libp2pPublicKey, signedPayload, extensions) { - return NoiseHandshakePayload.encode({ - identityKey: libp2pPublicKey, - identitySig: signedPayload, - extensions: extensions ?? { webtransportCerthashes: [] } - }).subarray(); -} -export async function signPayload(peerId, payload) { - if (peerId.privateKey == null) { - throw new Error('PrivateKey was missing from PeerId'); - } - const privateKey = await unmarshalPrivateKey(peerId.privateKey); - return privateKey.sign(payload); -} -export async function getPeerIdFromPayload(payload) { - return peerIdFromKeys(payload.identityKey); -} -export function decodePayload(payload) { - return NoiseHandshakePayload.decode(payload); -} -export function getHandshakePayload(publicKey) { - const prefix = uint8ArrayFromString('noise-libp2p-static-key:'); - return uint8ArrayConcat([prefix, publicKey], prefix.length + publicKey.length); -} -/** - * Verifies signed payload, throws on any irregularities. - * - * @param {bytes} noiseStaticKey - owner's noise static key - * @param {bytes} payload - decoded payload - * @param {PeerId} remotePeer - owner's libp2p peer ID - * @returns {Promise} - peer ID of payload owner - */ -export async function verifySignedPayload(noiseStaticKey, payload, remotePeer) { - // Unmarshaling from PublicKey protobuf - const payloadPeerId = await peerIdFromKeys(payload.identityKey); - if (!payloadPeerId.equals(remotePeer)) { - throw new Error(`Payload identity key ${payloadPeerId.toString()} does not match expected remote peer ${remotePeer.toString()}`); - } - const generatedPayload = getHandshakePayload(noiseStaticKey); - if (payloadPeerId.publicKey == null) { - throw new Error('PublicKey was missing from PeerId'); - } - if (payload.identitySig == null) { - throw new Error('Signature was missing from message'); - } - const publicKey = unmarshalPublicKey(payloadPeerId.publicKey); - const valid = await publicKey.verify(generatedPayload, payload.identitySig); - if (!valid) { - throw new Error("Static key doesn't match to peer that signed payload!"); - } - return payloadPeerId; -} -export function isValidPublicKey(pk) { - if (!(pk instanceof Uint8Array)) { - return false; - } - if (pk.length !== 32) { - return false; - } - return true; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/utils.js.map deleted file mode 100644 index 7e09ad531..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/src/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5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,OAAO,KAAK,CAAA;KACb;IAED,IAAI,EAAE,CAAC,MAAM,KAAK,EAAE,EAAE;QACpB,OAAO,KAAK,CAAA;KACb;IAED,OAAO,IAAI,CAAA;AACb,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/compliance.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/compliance.spec.d.ts deleted file mode 100644 index dac08d9d2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/compliance.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=compliance.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/compliance.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/compliance.spec.d.ts.map deleted file mode 100644 index dc9e71995..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/compliance.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.d.ts","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/compliance.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/compliance.spec.js deleted file mode 100644 index 68cfabeb5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/compliance.spec.js +++ /dev/null @@ -1,11 +0,0 @@ -import tests from '@libp2p/interface-compliance-tests/connection-encryption'; -import { Noise } from '../src/noise.js'; -describe('spec compliance tests', function () { - tests({ - async setup() { - return new Noise(); - }, - async teardown() { } - }); -}); -//# sourceMappingURL=compliance.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/compliance.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/compliance.spec.js.map deleted file mode 100644 index 43ca499a2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/compliance.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.js","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,0DAA0D,CAAA;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,QAAQ,CAAC,uBAAuB,EAAE;IAChC,KAAK,CAAC;QACJ,KAAK,CAAC,KAAK;YACT,OAAO,IAAI,KAAK,EAAE,CAAA;QACpB,CAAC;QACD,KAAK,CAAC,QAAQ,KAAK,CAAC;KACrB,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/fixtures/peer.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/fixtures/peer.d.ts deleted file mode 100644 index 7a23a4986..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/fixtures/peer.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PeerId } from '@libp2p/interface/peer-id'; -export declare function createPeerIdsFromFixtures(length: number): Promise; -export declare function createPeerIds(length: number): Promise; -//# sourceMappingURL=peer.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/fixtures/peer.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/fixtures/peer.d.ts.map deleted file mode 100644 index f076c8510..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/fixtures/peer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer.d.ts","sourceRoot":"","sources":["../../../test/fixtures/peer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAqBvD,wBAAsB,yBAAyB,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAIlF;AAED,wBAAsB,aAAa,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAQtE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/fixtures/peer.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/fixtures/peer.js deleted file mode 100644 index 307e38c37..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/fixtures/peer.js +++ /dev/null @@ -1,31 +0,0 @@ -import { createEd25519PeerId, createFromJSON } from '@libp2p/peer-id-factory'; -// ed25519 keys -const peers = [{ - id: '12D3KooWH45PiqBjfnEfDfCD6TqJrpqTBJvQDwGHvjGpaWwms46D', - privKey: 'CAESYBtKXrMwawAARmLScynQUuSwi/gGSkwqDPxi15N3dqDHa4T4iWupkMe5oYGwGH3Hyfvd/QcgSTqg71oYZJadJ6prhPiJa6mQx7mhgbAYfcfJ+939ByBJOqDvWhhklp0nqg==', - pubKey: 'CAESIGuE+IlrqZDHuaGBsBh9x8n73f0HIEk6oO9aGGSWnSeq' - }, { - id: '12D3KooWP63uzL78BRMpkQ7augMdNi1h3VBrVWZucKjyhzGVaSi1', - privKey: 'CAESYPxO3SHyfc2578hDmfkGGBY255JjiLuVavJWy+9ivlpsxSyVKf36ipyRGL6szGzHuFs5ceEuuGVrPMg/rW2Ch1bFLJUp/fqKnJEYvqzMbMe4Wzlx4S64ZWs8yD+tbYKHVg==', - pubKey: 'CAESIMUslSn9+oqckRi+rMxsx7hbOXHhLrhlazzIP61tgodW' - }, { - id: '12D3KooWF85R7CM2Wikdtb2sjwnd24e1tgojf3MEWwizmVB8PA6U', - privKey: 'CAESYNXoQ5CnooE939AEqE2JJGPqvhoFJn0xP+j9KwjfOfDkTtPyfn2kJ1gn3uOYTcmoHFU1bbETNtRVuPMi1fmDmqFO0/J+faQnWCfe45hNyagcVTVtsRM21FW48yLV+YOaoQ==', - pubKey: 'CAESIE7T8n59pCdYJ97jmE3JqBxVNW2xEzbUVbjzItX5g5qh' - }, { - id: '12D3KooWPCofiCjhdtezP4eMnqBjjutFZNHjV39F5LWNrCvaLnzT', - privKey: 'CAESYLhUut01XPu+yIPbtZ3WnxOd26FYuTMRn/BbdFYsZE2KxueKRlo9yIAxmFReoNFUKztUU4G2aUiTbqDQaA6i0MDG54pGWj3IgDGYVF6g0VQrO1RTgbZpSJNuoNBoDqLQwA==', - pubKey: 'CAESIMbnikZaPciAMZhUXqDRVCs7VFOBtmlIk26g0GgOotDA' - }]; -export async function createPeerIdsFromFixtures(length) { - return Promise.all(Array.from({ length }).map(async (_, i) => createFromJSON(peers[i]))); -} -export async function createPeerIds(length) { - const peerIds = []; - for (let i = 0; i < length; i++) { - const id = await createEd25519PeerId(); - peerIds.push(id); - } - return peerIds; -} -//# sourceMappingURL=peer.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/fixtures/peer.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/fixtures/peer.js.map deleted file mode 100644 index a0da6c2d9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/fixtures/peer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"peer.js","sourceRoot":"","sources":["../../../test/fixtures/peer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAG7E,eAAe;AACf,MAAM,KAAK,GAAG,CAAC;QACb,EAAE,EAAE,sDAAsD;QAC1D,OAAO,EAAE,0IAA0I;QACnJ,MAAM,EAAE,kDAAkD;KAC3D,EAAE;QACD,EAAE,EAAE,sDAAsD;QAC1D,OAAO,EAAE,0IAA0I;QACnJ,MAAM,EAAE,kDAAkD;KAC3D,EAAE;QACD,EAAE,EAAE,sDAAsD;QAC1D,OAAO,EAAE,0IAA0I;QACnJ,MAAM,EAAE,kDAAkD;KAC3D,EAAE;QACD,EAAE,EAAE,sDAAsD;QAC1D,OAAO,EAAE,0IAA0I;QACnJ,MAAM,EAAE,kDAAkD;KAC3D,CAAC,CAAA;AAEF,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAE,MAAc;IAC7D,OAAO,OAAO,CAAC,GAAG,CAChB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CACrE,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAE,MAAc;IACjD,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,MAAM,EAAE,GAAG,MAAM,mBAAmB,EAAE,CAAA;QACtC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;KACjB;IAED,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/handshakes/xx.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/handshakes/xx.spec.d.ts deleted file mode 100644 index 638a8ffa7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/handshakes/xx.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=xx.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/handshakes/xx.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/handshakes/xx.spec.d.ts.map deleted file mode 100644 index d46c424d4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/handshakes/xx.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx.spec.d.ts","sourceRoot":"","sources":["../../../test/handshakes/xx.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/handshakes/xx.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/handshakes/xx.spec.js deleted file mode 100644 index 1fb4f4029..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/handshakes/xx.spec.js +++ /dev/null @@ -1,126 +0,0 @@ -import { Buffer } from 'buffer'; -import { expect, assert } from 'aegir/chai'; -import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { pureJsCrypto } from '../../src/crypto/js.js'; -import { XX } from '../../src/handshakes/xx.js'; -import { createHandshakePayload, getHandshakePayload } from '../../src/utils.js'; -import { generateEd25519Keys } from '../utils.js'; -describe('XX Handshake', () => { - const prologue = Buffer.alloc(0); - it('Test creating new XX session', async () => { - try { - const xx = new XX(pureJsCrypto); - const kpInitiator = pureJsCrypto.generateX25519KeyPair(); - xx.initSession(true, prologue, kpInitiator); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('Test get HKDF', () => { - const ckBytes = Buffer.from('4e6f6973655f58585f32353531395f58436861436861506f6c795f53484132353600000000000000000000000000000000000000000000000000000000000000', 'hex'); - const ikm = Buffer.from('a3eae50ea37a47e8a7aa0c7cd8e16528670536dcd538cebfd724fb68ce44f1910ad898860666227d4e8dd50d22a9a64d1c0a6f47ace092510161e9e442953da3', 'hex'); - const ck = Buffer.alloc(32); - ckBytes.copy(ck); - const [k1, k2, k3] = pureJsCrypto.getHKDF(ck, ikm); - expect(uint8ArrayToString(k1, 'hex')).to.equal('cc5659adff12714982f806e2477a8d5ddd071def4c29bb38777b7e37046f6914'); - expect(uint8ArrayToString(k2, 'hex')).to.equal('a16ada915e551ab623f38be674bb4ef15d428ae9d80688899c9ef9b62ef208fa'); - expect(uint8ArrayToString(k3, 'hex')).to.equal('ff67bf9727e31b06efc203907e6786667d2c7a74ac412b4d31a80ba3fd766f68'); - }); - async function doHandshake(xx) { - const kpInit = pureJsCrypto.generateX25519KeyPair(); - const kpResp = pureJsCrypto.generateX25519KeyPair(); - // initiator setup - const libp2pInitKeys = await generateEd25519Keys(); - const initSignedPayload = await libp2pInitKeys.sign(getHandshakePayload(kpInit.publicKey)); - // responder setup - const libp2pRespKeys = await generateEd25519Keys(); - const respSignedPayload = await libp2pRespKeys.sign(getHandshakePayload(kpResp.publicKey)); - // initiator: new XX noise session - const nsInit = xx.initSession(true, prologue, kpInit); - // responder: new XX noise session - const nsResp = xx.initSession(false, prologue, kpResp); - /* STAGE 0 */ - // initiator creates payload - libp2pInitKeys.marshal().slice(0, 32); - const libp2pInitPubKey = libp2pInitKeys.marshal().slice(32, 64); - const payloadInitEnc = createHandshakePayload(libp2pInitPubKey, initSignedPayload); - // initiator sends message - const message = Buffer.concat([Buffer.alloc(0), payloadInitEnc]); - const messageBuffer = xx.sendMessage(nsInit, message); - expect(messageBuffer.ne.length).not.equal(0); - // responder receives message - xx.recvMessage(nsResp, messageBuffer); - /* STAGE 1 */ - // responder creates payload - libp2pRespKeys.marshal().slice(0, 32); - const libp2pRespPubKey = libp2pRespKeys.marshal().slice(32, 64); - const payloadRespEnc = createHandshakePayload(libp2pRespPubKey, respSignedPayload); - const message1 = Buffer.concat([message, payloadRespEnc]); - const messageBuffer2 = xx.sendMessage(nsResp, message1); - expect(messageBuffer2.ne.length).not.equal(0); - expect(messageBuffer2.ns.length).not.equal(0); - // initiator receive payload - xx.recvMessage(nsInit, messageBuffer2); - /* STAGE 2 */ - // initiator send message - const messageBuffer3 = xx.sendMessage(nsInit, Buffer.alloc(0)); - // responder receive message - xx.recvMessage(nsResp, messageBuffer3); - if (nsInit.cs1 == null || nsResp.cs1 == null || nsInit.cs2 == null || nsResp.cs2 == null) { - throw new Error('CipherState missing'); - } - assert(uint8ArrayEquals(nsInit.cs1.k, nsResp.cs1.k)); - assert(uint8ArrayEquals(nsInit.cs2.k, nsResp.cs2.k)); - return { nsInit, nsResp }; - } - it('Test handshake', async () => { - try { - const xx = new XX(pureJsCrypto); - await doHandshake(xx); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('Test symmetric encrypt and decrypt', async () => { - try { - const xx = new XX(pureJsCrypto); - const { nsInit, nsResp } = await doHandshake(xx); - const ad = Buffer.from('authenticated'); - const message = Buffer.from('HelloCrypto'); - if (nsInit.cs1 == null || nsResp.cs1 == null || nsInit.cs2 == null || nsResp.cs2 == null) { - throw new Error('CipherState missing'); - } - const ciphertext = xx.encryptWithAd(nsInit.cs1, ad, message); - assert(!uint8ArrayEquals(Buffer.from('HelloCrypto'), ciphertext), 'Encrypted message should not be same as plaintext.'); - const { plaintext: decrypted, valid } = xx.decryptWithAd(nsResp.cs1, ad, ciphertext); - assert(uint8ArrayEquals(Buffer.from('HelloCrypto'), decrypted), 'Decrypted text not equal to original message.'); - assert(valid); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('Test multiple messages encryption and decryption', async () => { - const xx = new XX(pureJsCrypto); - const { nsInit, nsResp } = await doHandshake(xx); - const ad = Buffer.from('authenticated'); - const message = Buffer.from('ethereum1'); - if (nsInit.cs1 == null || nsResp.cs1 == null || nsInit.cs2 == null || nsResp.cs2 == null) { - throw new Error('CipherState missing'); - } - const encrypted = xx.encryptWithAd(nsInit.cs1, ad, message); - const { plaintext: decrypted } = xx.decryptWithAd(nsResp.cs1, ad, encrypted); - assert.equal('ethereum1', uint8ArrayToString(decrypted, 'utf8'), 'Decrypted text not equal to original message.'); - const message2 = Buffer.from('ethereum2'); - const encrypted2 = xx.encryptWithAd(nsInit.cs1, ad, message2); - const { plaintext: decrypted2 } = xx.decryptWithAd(nsResp.cs1, ad, encrypted2); - assert.equal('ethereum2', uint8ArrayToString(decrypted2, 'utf-8'), 'Decrypted text not equal to original message.'); - }); -}); -//# sourceMappingURL=xx.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/handshakes/xx.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/handshakes/xx.spec.js.map deleted file mode 100644 index c1bd0610e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/handshakes/xx.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx.spec.js","sourceRoot":"","sources":["../../../test/handshakes/xx.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,EAAE,EAAE,MAAM,4BAA4B,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAIjD,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC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,CAAC,qBAAqB,CAAC,CAAA;SACvC;QAED,MAAM,SAAS,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QAC3D,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;QAC5E,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,kBAAkB,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,+CAA+C,CAAC,CAAA;QAEjH,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QACzC,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAA;QAC7D,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,EAAE,UAAU,CAAC,CAAA;QAC9E,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,kBAAkB,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,+CAA+C,CAAC,CAAA;IACrH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/index.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/index.spec.d.ts deleted file mode 100644 index b37c2d278..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/index.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/index.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/index.spec.d.ts.map deleted file mode 100644 index 5c897805d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/index.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../test/index.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/index.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/index.spec.js deleted file mode 100644 index 19e71aa40..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/index.spec.js +++ /dev/null @@ -1,49 +0,0 @@ -import { expect } from 'aegir/chai'; -import { lpStream } from 'it-length-prefixed-stream'; -import { duplexPair } from 'it-pair/duplex'; -import sinon from 'sinon'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { noise } from '../src/index.js'; -import { Noise } from '../src/noise.js'; -import { createPeerIdsFromFixtures } from './fixtures/peer.js'; -function createCounterSpy() { - return sinon.spy({ - increment: () => { }, - reset: () => { } - }); -} -describe('Index', () => { - it('should expose class with tag and required functions', () => { - const noiseInstance = noise()(); - expect(noiseInstance.protocol).to.equal('/noise'); - expect(typeof (noiseInstance.secureInbound)).to.equal('function'); - expect(typeof (noiseInstance.secureOutbound)).to.equal('function'); - }); - it('should collect metrics', async () => { - const [localPeer, remotePeer] = await createPeerIdsFromFixtures(2); - const metricsRegistry = new Map(); - const metrics = { - registerCounter: (name) => { - const counter = createCounterSpy(); - metricsRegistry.set(name, counter); - return counter; - } - }; - const noiseInit = new Noise({ metrics: metrics }); - const noiseResp = new Noise({}); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection, localPeer) - ]); - const wrappedInbound = lpStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - await wrappedOutbound.write(uint8ArrayFromString('test')); - await wrappedInbound.read(); - expect(metricsRegistry.get('libp2p_noise_xxhandshake_successes_total')?.increment.callCount).to.equal(1); - expect(metricsRegistry.get('libp2p_noise_xxhandshake_error_total')?.increment.callCount).to.equal(0); - expect(metricsRegistry.get('libp2p_noise_encrypted_packets_total')?.increment.callCount).to.equal(1); - expect(metricsRegistry.get('libp2p_noise_decrypt_errors_total')?.increment.callCount).to.equal(0); - }); -}); -//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/index.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/index.spec.js.map deleted file mode 100644 index 65a6567d3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/index.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../test/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAI9D,SAAS,gBAAgB;IACvB,OAAO,KAAK,CAAC,GAAG,CAAC;QACf,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;QACnB,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;KACh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,SAAS,EAAE,kBAAkB,EAAE,UAAU,CAAC;YACnE,SAAS,CAAC,aAAa,CAAC,UAAU,EAAE,iBAAiB,EAAE,SAAS,CAAC;SAClE,CAAC,CAAA;QACF,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAC7C,MAAM,eAAe,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;QAE/C,MAAM,eAAe,CAAC,KAAK,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAA;QACzD,MAAM,cAAc,CAAC,IAAI,EAAE,CAAA;QAC3B,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,0CAA0C,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACxG,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,sCAAsC,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACpG,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,sCAAsC,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACpG,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,mCAAmC,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACnG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/interop.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/interop.d.ts deleted file mode 100644 index f160cf14e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/interop.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=interop.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/interop.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/interop.d.ts.map deleted file mode 100644 index 14efbf496..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/interop.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interop.d.ts","sourceRoot":"","sources":["../../test/interop.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/interop.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/interop.js deleted file mode 100644 index 031d7f039..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/interop.js +++ /dev/null @@ -1,93 +0,0 @@ -import fs from 'fs'; -import { yamux } from '@chainsafe/libp2p-yamux'; -import { unmarshalPrivateKey } from '@libp2p/crypto/keys'; -import { createClient } from '@libp2p/daemon-client'; -import { createServer } from '@libp2p/daemon-server'; -import { connectInteropTests } from '@libp2p/interop'; -import { logger } from '@libp2p/logger'; -import { peerIdFromKeys } from '@libp2p/peer-id'; -import { tcp } from '@libp2p/tcp'; -import { multiaddr } from '@multiformats/multiaddr'; -import { execa } from 'execa'; -import { path as p2pd } from 'go-libp2p'; -import { createLibp2p } from 'libp2p'; -import pDefer from 'p-defer'; -import { noise } from '../src/index.js'; -async function createGoPeer(options) { - const controlPort = Math.floor(Math.random() * (50000 - 10000 + 1)) + 10000; - const apiAddr = multiaddr(`/ip4/0.0.0.0/tcp/${controlPort}`); - const log = logger(`go-libp2p:${controlPort}`); - const opts = [ - `-listen=${apiAddr.toString()}`, - '-hostAddrs=/ip4/0.0.0.0/tcp/0' - ]; - if (options.noise === true) { - opts.push('-noise=true'); - } - if (options.key != null) { - opts.push(`-id=${options.key}`); - } - const deferred = pDefer(); - const proc = execa(p2pd(), opts); - proc.stdout?.on('data', (buf) => { - const str = buf.toString(); - log(str); - // daemon has started - if (str.includes('Control socket:')) { - deferred.resolve(); - } - }); - proc.stderr?.on('data', (buf) => { - log.error(buf.toString()); - }); - await deferred.promise; - return { - client: createClient(apiAddr), - stop: async () => { - proc.kill(); - } - }; -} -async function createJsPeer(options) { - let peerId; - if (options.key != null) { - const keyFile = fs.readFileSync(options.key); - const privateKey = await unmarshalPrivateKey(keyFile); - peerId = await peerIdFromKeys(privateKey.public.bytes, privateKey.bytes); - } - const opts = { - peerId, - addresses: { - listen: ['/ip4/0.0.0.0/tcp/0'] - }, - transports: [tcp()], - streamMuxers: [yamux()], - connectionEncryption: [noise()] - }; - const node = await createLibp2p(opts); - const server = createServer(multiaddr('/ip4/0.0.0.0/tcp/0'), node); - await server.start(); - return { - client: createClient(server.getMultiaddr()), - stop: async () => { - await server.stop(); - await node.stop(); - } - }; -} -async function main() { - const factory = { - async spawn(options) { - if (options.type === 'go') { - return createGoPeer(options); - } - return createJsPeer(options); - } - }; - connectInteropTests(factory); -} -main().catch(err => { - console.error(err); // eslint-disable-line no-console - process.exit(1); -}); -//# sourceMappingURL=interop.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/interop.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/interop.js.map deleted file mode 100644 index 28efc87f8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/interop.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interop.js","sourceRoot":"","sources":["../../test/interop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,YAAY,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SAC/B;QACD,UAAU,EAAE,CAAC,GAAG,EAAE,CAAC;QACnB,YAAY,EAAE,CAAC,KAAK,EAAE,CAAC;QACvB,oBAAoB,EAAE,CAAC,KAAK,EAAE,CAAC;KAChC,CAAA;IAED,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,CAAA;IACrC,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,oBAAoB,CAAC,EAAE,IAAW,CAAC,CAAA;IACzE,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;IAEpB,OAAO;QACL,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QAC3C,IAAI,EAAE,KAAK,IAAI,EAAE;YACf,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;YACnB,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;QACnB,CAAC;KACF,CAAA;AACH,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAkB;QAC7B,KAAK,CAAC,KAAK,CAAE,OAAqB;YAChC,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE;gBACzB,OAAO,YAAY,CAAC,OAAO,CAAC,CAAA;aAC7B;YAED,OAAO,YAAY,CAAC,OAAO,CAAC,CAAA;QAC9B,CAAC;KACF,CAAA;IAED,mBAAmB,CAAC,OAAO,CAAC,CAAA;AAC9B,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA,CAAC,iCAAiC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/noise.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/noise.spec.d.ts deleted file mode 100644 index f520ec336..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/noise.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=noise.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/noise.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/noise.spec.d.ts.map deleted file mode 100644 index 2e9faaa67..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/noise.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise.spec.d.ts","sourceRoot":"","sources":["../../test/noise.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/noise.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/noise.spec.js deleted file mode 100644 index b8a3acafb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/noise.spec.js +++ /dev/null @@ -1,182 +0,0 @@ -import { Buffer } from 'buffer'; -import { assert, expect } from 'aegir/chai'; -import { randomBytes } from 'iso-random-stream'; -import { byteStream } from 'it-byte-stream'; -import { lpStream } from 'it-length-prefixed-stream'; -import { duplexPair } from 'it-pair/duplex'; -import sinon from 'sinon'; -import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; -import { NOISE_MSG_MAX_LENGTH_BYTES } from '../src/constants.js'; -import { pureJsCrypto } from '../src/crypto/js.js'; -import { decode0, decode2, encode1, uint16BEDecode, uint16BEEncode } from '../src/encoder.js'; -import { XXHandshake } from '../src/handshake-xx.js'; -import { XX } from '../src/handshakes/xx.js'; -import { Noise } from '../src/noise.js'; -import { createHandshakePayload, getHandshakePayload, getPayload, signPayload } from '../src/utils.js'; -import { createPeerIdsFromFixtures } from './fixtures/peer.js'; -import { getKeyPairFromPeerId } from './utils.js'; -describe('Noise', () => { - let remotePeer, localPeer; - const sandbox = sinon.createSandbox(); - before(async () => { - [localPeer, remotePeer] = await createPeerIdsFromFixtures(2); - }); - afterEach(function () { - sandbox.restore(); - }); - it('should communicate through encrypted streams without noise pipes', async () => { - try { - const noiseInit = new Noise({ staticNoiseKey: undefined, extensions: undefined }); - const noiseResp = new Noise({ staticNoiseKey: undefined, extensions: undefined }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection, localPeer) - ]); - const wrappedInbound = lpStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - await wrappedOutbound.write(Buffer.from('test')); - const response = await wrappedInbound.read(); - expect(uint8ArrayToString(response.slice())).equal('test'); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('should test that secureOutbound is spec compliant', async () => { - const noiseInit = new Noise({ staticNoiseKey: undefined }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, { wrapped, handshake }] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - (async () => { - const wrapped = lpStream(inboundConnection, { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - }); - const prologue = Buffer.alloc(0); - const staticKeys = pureJsCrypto.generateX25519KeyPair(); - const xx = new XX(pureJsCrypto); - const payload = await getPayload(remotePeer, staticKeys.publicKey); - const handshake = new XXHandshake(false, payload, prologue, pureJsCrypto, staticKeys, wrapped, localPeer, xx); - let receivedMessageBuffer = decode0((await wrapped.read()).slice()); - // The first handshake message contains the initiator's ephemeral public key - expect(receivedMessageBuffer.ne.length).equal(32); - xx.recvMessage(handshake.session, receivedMessageBuffer); - // Stage 1 - const { publicKey: libp2pPubKey } = getKeyPairFromPeerId(remotePeer); - const signedPayload = await signPayload(remotePeer, getHandshakePayload(staticKeys.publicKey)); - const handshakePayload = createHandshakePayload(libp2pPubKey, signedPayload); - const messageBuffer = xx.sendMessage(handshake.session, handshakePayload); - await wrapped.write(encode1(messageBuffer)); - // Stage 2 - finish handshake - receivedMessageBuffer = decode2((await wrapped.read()).slice()); - xx.recvMessage(handshake.session, receivedMessageBuffer); - return { wrapped, handshake }; - })() - ]); - const wrappedOutbound = byteStream(outbound.conn); - await wrappedOutbound.write(uint8ArrayFromString('test')); - // Check that noise message is prefixed with 16-bit big-endian unsigned integer - const data = (await wrapped.read()).slice(); - const { plaintext: decrypted, valid } = handshake.decrypt(data, handshake.session); - // Decrypted data should match - expect(uint8ArrayEquals(decrypted, uint8ArrayFromString('test'))).to.be.true(); - expect(valid).to.be.true(); - }); - it('should test large payloads', async function () { - this.timeout(10000); - try { - const noiseInit = new Noise({ staticNoiseKey: undefined }); - const noiseResp = new Noise({ staticNoiseKey: undefined }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection, localPeer) - ]); - const wrappedInbound = byteStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - const largePlaintext = randomBytes(60000); - await wrappedOutbound.write(Buffer.from(largePlaintext)); - const response = await wrappedInbound.read(60000); - expect(response.length).equals(largePlaintext.length); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('should working without remote peer provided in incoming connection', async () => { - try { - const staticKeysInitiator = pureJsCrypto.generateX25519KeyPair(); - const noiseInit = new Noise({ staticNoiseKey: staticKeysInitiator.privateKey }); - const staticKeysResponder = pureJsCrypto.generateX25519KeyPair(); - const noiseResp = new Noise({ staticNoiseKey: staticKeysResponder.privateKey }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection) - ]); - const wrappedInbound = lpStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - await wrappedOutbound.write(Buffer.from('test v2')); - const response = await wrappedInbound.read(); - expect(uint8ArrayToString(response.slice())).equal('test v2'); - if (inbound.remotePeer.publicKey == null || localPeer.publicKey == null || - outbound.remotePeer.publicKey == null || remotePeer.publicKey == null) { - throw new Error('Public key missing from PeerId'); - } - assert(uint8ArrayEquals(inbound.remotePeer.publicKey, localPeer.publicKey)); - assert(uint8ArrayEquals(outbound.remotePeer.publicKey, remotePeer.publicKey)); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('should accept and return Noise extension from remote peer', async () => { - try { - const certhashInit = Buffer.from('certhash data from init'); - const staticKeysInitiator = pureJsCrypto.generateX25519KeyPair(); - const noiseInit = new Noise({ staticNoiseKey: staticKeysInitiator.privateKey, extensions: { webtransportCerthashes: [certhashInit] } }); - const staticKeysResponder = pureJsCrypto.generateX25519KeyPair(); - const certhashResp = Buffer.from('certhash data from respon'); - const noiseResp = new Noise({ staticNoiseKey: staticKeysResponder.privateKey, extensions: { webtransportCerthashes: [certhashResp] } }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection) - ]); - assert(uint8ArrayEquals(inbound.remoteExtensions?.webtransportCerthashes[0] ?? new Uint8Array(), certhashInit)); - assert(uint8ArrayEquals(outbound.remoteExtensions?.webtransportCerthashes[0] ?? new Uint8Array(), certhashResp)); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('should accept a prologue', async () => { - try { - const noiseInit = new Noise({ staticNoiseKey: undefined, crypto: pureJsCrypto, prologueBytes: Buffer.from('Some prologue') }); - const noiseResp = new Noise({ staticNoiseKey: undefined, crypto: pureJsCrypto, prologueBytes: Buffer.from('Some prologue') }); - const [inboundConnection, outboundConnection] = duplexPair(); - const [outbound, inbound] = await Promise.all([ - noiseInit.secureOutbound(localPeer, outboundConnection, remotePeer), - noiseResp.secureInbound(remotePeer, inboundConnection, localPeer) - ]); - const wrappedInbound = lpStream(inbound.conn); - const wrappedOutbound = lpStream(outbound.conn); - await wrappedOutbound.write(Buffer.from('test')); - const response = await wrappedInbound.read(); - expect(uint8ArrayToString(response.slice())).equal('test'); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); -}); -//# sourceMappingURL=noise.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/noise.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/noise.spec.js.map deleted file mode 100644 index 0f925ef77..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/noise.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"noise.spec.js","sourceRoot":"","sources":["../../test/noise.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,0B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AC,IAAI,EAAE,CAAA;YAC5C,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;SAC3D;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,GAAG,GAAG,CAAU,CAAA;YACtB,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;SAC3B;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/utils.d.ts deleted file mode 100644 index c7109157e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/utils.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { KeyPair } from '../src/@types/libp2p.js'; -import type { PrivateKey } from '@libp2p/interface/keys'; -import type { PeerId } from '@libp2p/interface/peer-id'; -export declare function generateEd25519Keys(): Promise; -export declare function getKeyPairFromPeerId(peerId: PeerId): KeyPair; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/utils.d.ts.map deleted file mode 100644 index 5d1b75ca9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../test/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,wBAAsB,mBAAmB,IAAK,OAAO,CAAC,UAAU,CAAC,CAEhE;AAED,wBAAgB,oBAAoB,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAS7D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/utils.js deleted file mode 100644 index decf6328f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/utils.js +++ /dev/null @@ -1,14 +0,0 @@ -import { keys } from '@libp2p/crypto'; -export async function generateEd25519Keys() { - return keys.generateKeyPair('Ed25519', 32); -} -export function getKeyPairFromPeerId(peerId) { - if (peerId.privateKey == null || peerId.publicKey == null) { - throw new Error('PrivateKey or PublicKey missing from PeerId'); - } - return { - privateKey: peerId.privateKey.subarray(0, 32), - publicKey: peerId.publicKey - }; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/utils.js.map deleted file mode 100644 index b318263c0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../test/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAKrC,MAAM,CAAC,KAAK,UAAU,mBAAmB;IACvC,OAAO,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;AAC5C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAE,MAAc;IAClD,IAAI,MAAM,CAAC,UAAU,IAAI,IAAI,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI,EAAE;QACzD,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;KAC/D;IAED,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;QAC7C,SAAS,EAAE,MAAM,CAAC,SAAS;KAC5B,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/xx-handshake.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/xx-handshake.spec.d.ts deleted file mode 100644 index 32a0f4c79..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/xx-handshake.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=xx-handshake.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/xx-handshake.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/xx-handshake.spec.d.ts.map deleted file mode 100644 index fa3bf2512..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/xx-handshake.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx-handshake.spec.d.ts","sourceRoot":"","sources":["../../test/xx-handshake.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/xx-handshake.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/xx-handshake.spec.js deleted file mode 100644 index a89a68b08..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/xx-handshake.spec.js +++ /dev/null @@ -1,119 +0,0 @@ -import { Buffer } from 'buffer'; -import { assert, expect } from 'aegir/chai'; -import { lpStream } from 'it-length-prefixed-stream'; -import { duplexPair } from 'it-pair/duplex'; -import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; -import { defaultCrypto } from '../src/crypto/index.js'; -import { XXHandshake } from '../src/handshake-xx.js'; -import { getPayload } from '../src/utils.js'; -import { createPeerIdsFromFixtures } from './fixtures/peer.js'; -describe('XX Handshake', () => { - let peerA, peerB, fakePeer; - before(async () => { - [peerA, peerB, fakePeer] = await createPeerIdsFromFixtures(3); - }); - it('should propose, exchange and finish handshake', async () => { - try { - const duplex = duplexPair(); - const connectionFrom = lpStream(duplex[0]); - const connectionTo = lpStream(duplex[1]); - const prologue = Buffer.alloc(0); - const staticKeysInitiator = defaultCrypto.generateX25519KeyPair(); - const staticKeysResponder = defaultCrypto.generateX25519KeyPair(); - const initPayload = await getPayload(peerA, staticKeysInitiator.publicKey); - const handshakeInitiator = new XXHandshake(true, initPayload, prologue, defaultCrypto, staticKeysInitiator, connectionFrom, peerB); - const respPayload = await getPayload(peerB, staticKeysResponder.publicKey); - const handshakeResponder = new XXHandshake(false, respPayload, prologue, defaultCrypto, staticKeysResponder, connectionTo, peerA); - await Promise.all([ - handshakeInitiator.propose(), - handshakeResponder.propose() - ]); - await Promise.all([ - handshakeResponder.exchange(), - handshakeInitiator.exchange() - ]); - await Promise.all([ - handshakeInitiator.finish(), - handshakeResponder.finish() - ]); - const sessionInitator = handshakeInitiator.session; - const sessionResponder = handshakeResponder.session; - // Test shared key - if (sessionInitator.cs1 && sessionResponder.cs1 && sessionInitator.cs2 && sessionResponder.cs2) { - assert(uint8ArrayEquals(sessionInitator.cs1.k, sessionResponder.cs1.k)); - assert(uint8ArrayEquals(sessionInitator.cs2.k, sessionResponder.cs2.k)); - } - else { - assert(false); - } - // Test encryption and decryption - const encrypted = handshakeInitiator.encrypt(Buffer.from('encryptthis'), handshakeInitiator.session); - const { plaintext: decrypted, valid } = handshakeResponder.decrypt(encrypted, handshakeResponder.session); - assert(uint8ArrayEquals(decrypted, Buffer.from('encryptthis'))); - assert(valid); - } - catch (e) { - const err = e; - assert(false, err.message); - } - }); - it('Initiator should fail to exchange handshake if given wrong public key in payload', async () => { - try { - const duplex = duplexPair(); - const connectionFrom = lpStream(duplex[0]); - const connectionTo = lpStream(duplex[1]); - const prologue = Buffer.alloc(0); - const staticKeysInitiator = defaultCrypto.generateX25519KeyPair(); - const staticKeysResponder = defaultCrypto.generateX25519KeyPair(); - const initPayload = await getPayload(peerA, staticKeysInitiator.publicKey); - const handshakeInitiator = new XXHandshake(true, initPayload, prologue, defaultCrypto, staticKeysInitiator, connectionFrom, fakePeer); - const respPayload = await getPayload(peerB, staticKeysResponder.publicKey); - const handshakeResponder = new XXHandshake(false, respPayload, prologue, defaultCrypto, staticKeysResponder, connectionTo, peerA); - await Promise.all([ - handshakeInitiator.propose(), - handshakeResponder.propose() - ]); - await Promise.all([ - handshakeResponder.exchange(), - handshakeInitiator.exchange() - ]); - assert(false, 'Should throw exception'); - } - catch (e) { - const err = e; - expect(err.message).equals(`Error occurred while verifying signed payload: Payload identity key ${peerB.toString()} does not match expected remote peer ${fakePeer.toString()}`); - } - }); - it('Responder should fail to exchange handshake if given wrong public key in payload', async () => { - try { - const duplex = duplexPair(); - const connectionFrom = lpStream(duplex[0]); - const connectionTo = lpStream(duplex[1]); - const prologue = Buffer.alloc(0); - const staticKeysInitiator = defaultCrypto.generateX25519KeyPair(); - const staticKeysResponder = defaultCrypto.generateX25519KeyPair(); - const initPayload = await getPayload(peerA, staticKeysInitiator.publicKey); - const handshakeInitiator = new XXHandshake(true, initPayload, prologue, defaultCrypto, staticKeysInitiator, connectionFrom, peerB); - const respPayload = await getPayload(peerB, staticKeysResponder.publicKey); - const handshakeResponder = new XXHandshake(false, respPayload, prologue, defaultCrypto, staticKeysResponder, connectionTo, fakePeer); - await Promise.all([ - handshakeInitiator.propose(), - handshakeResponder.propose() - ]); - await Promise.all([ - handshakeResponder.exchange(), - handshakeInitiator.exchange() - ]); - await Promise.all([ - handshakeInitiator.finish(), - handshakeResponder.finish() - ]); - assert(false, 'Should throw exception'); - } - catch (e) { - const err = e; - expect(err.message).equals(`Error occurred while verifying signed payload: Payload identity key ${peerA.toString()} does not match expected remote peer ${fakePeer.toString()}`); - } - }); -}); -//# sourceMappingURL=xx-handshake.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/xx-handshake.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/xx-handshake.spec.js.map deleted file mode 100644 index 6b3161d8a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/test/xx-handshake.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xx-handshake.spec.js","sourceRoot":"","sources":["../../test/xx-handshake.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAG9D,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAI,KAAa,EAAE,KAAa,EAAE,QAAgB,CAAA;IAElD,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,MAAM,yBAAyB,CAAC,CAAC,CAAC,CAAA;IAC/D,CAAC,CAAC,C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C,CAAA;YAEF,MAAM,OAAO,CAAC,GAAG,CAAC;gBAChB,kBAAkB,CAAC,MAAM,EAAE;gBAC3B,kBAAkB,CAAC,MAAM,EAAE;aAC5B,CAAC,CAAA;YAEF,MAAM,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAA;SACxC;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,GAAG,GAAG,CAAU,CAAA;YACtB,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,uEAAuE,KAAK,CAAC,QAAQ,EAAE,wCAAwC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;SACjL;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/tsconfig.tsbuildinfo deleted file mode 100644 index def3f48e9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/constants.ts","../src/@types/basic.ts","../node_modules/protons-runtime/dist/src/codec.d.ts","../node_modules/uint8arraylist/dist/src/index.d.ts","../node_modules/protons-runtime/dist/src/decode.d.ts","../node_modules/protons-runtime/dist/src/encode.d.ts","../node_modules/protons-runtime/dist/src/codecs/enum.d.ts","../node_modules/protons-runtime/dist/src/codecs/message.d.ts","../node_modules/protons-runtime/dist/src/utils/reader.d.ts","../node_modules/protons-runtime/dist/src/utils/writer.d.ts","../node_modules/protons-runtime/dist/src/index.d.ts","../node_modules/uint8arrays/dist/src/alloc.d.ts","../src/proto/payload.ts","../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface/dist/src/peer-id/index.d.ts","../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-info/index.d.ts","../node_modules/@libp2p/interface/dist/src/content-routing/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/buffer/index.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@libp2p/interface/dist/src/events.d.ts","../node_modules/@libp2p/interface/dist/src/metrics/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-routing/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-store/index.d.ts","../node_modules/@libp2p/interface/dist/src/startable.d.ts","../node_modules/@libp2p/interface/dist/src/stream-handler/index.d.ts","../node_modules/@libp2p/interface/dist/src/topology/index.d.ts","../node_modules/it-stream-types/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/index.d.ts","../node_modules/@libp2p/interface/dist/src/transport/index.d.ts","../node_modules/@libp2p/interface/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-encrypter/index.d.ts","../src/@types/libp2p.ts","../src/nonce.ts","../src/@types/handshake.ts","../src/crypto.ts","../node_modules/it-length-prefixed/dist/src/encode.d.ts","../node_modules/it-reader/dist/src/index.d.ts","../node_modules/it-length-prefixed/dist/src/decode.d.ts","../node_modules/it-length-prefixed/dist/src/index.d.ts","../src/encoder.ts","../node_modules/@libp2p/interface/dist/src/errors.d.ts","../node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../node_modules/multiformats/dist/types/src/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../node_modules/multiformats/dist/types/src/varint.d.ts","../node_modules/multiformats/dist/types/src/bytes.d.ts","../node_modules/multiformats/dist/types/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ed25519-class.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/interface.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ecdh.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ephemeral-keys.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/key-stretcher.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/keys.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/rsa-class.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/secp256k1-class.d.ts","../node_modules/@libp2p/interface/dist/src/keys/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/index.d.ts","../node_modules/@libp2p/peer-id/dist/src/index.d.ts","../node_modules/uint8arrays/dist/src/concat.d.ts","../node_modules/multiformats/dist/types/src/codecs/raw.d.ts","../node_modules/multiformats/dist/types/src/codecs/json.d.ts","../node_modules/multiformats/dist/types/src/bases/base.d.ts","../node_modules/multiformats/dist/types/src/basics.d.ts","../node_modules/uint8arrays/dist/src/util/bases.d.ts","../node_modules/uint8arrays/dist/src/from-string.d.ts","../src/utils.ts","../node_modules/uint8arrays/dist/src/compare.d.ts","../node_modules/uint8arrays/dist/src/equals.d.ts","../node_modules/uint8arrays/dist/src/to-string.d.ts","../node_modules/uint8arrays/dist/src/xor.d.ts","../node_modules/uint8arrays/dist/src/index.d.ts","../node_modules/@libp2p/logger/dist/src/index.d.ts","../src/logger.ts","../src/handshakes/abstract-handshake.ts","../src/handshakes/xx.ts","../src/@types/handshake-interface.ts","../node_modules/it-byte-stream/dist/src/index.d.ts","../node_modules/it-length-prefixed-stream/dist/src/index.d.ts","../src/handshake-xx.ts","../node_modules/it-pair/dist/src/duplex.d.ts","../node_modules/it-pipe/dist/src/index.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/types.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/wasm.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/chacha20poly1305.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/poly1305.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/chacha20.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/index.d.ts","../node_modules/@chainsafe/as-sha256/lib/hashobject.d.ts","../node_modules/@chainsafe/as-sha256/lib/wasm.d.ts","../node_modules/@chainsafe/as-sha256/lib/sha256.d.ts","../node_modules/@chainsafe/as-sha256/lib/index.d.ts","../node_modules/wherearewe/dist/src/index.d.ts","../node_modules/@noble/ciphers/utils.d.ts","../node_modules/@noble/ciphers/chacha.d.ts","../node_modules/@noble/curves/abstract/utils.d.ts","../node_modules/@noble/curves/abstract/modular.d.ts","../node_modules/@noble/curves/abstract/curve.d.ts","../node_modules/@noble/curves/abstract/edwards.d.ts","../node_modules/@noble/curves/abstract/hash-to-curve.d.ts","../node_modules/@noble/curves/abstract/montgomery.d.ts","../node_modules/@noble/curves/ed25519.d.ts","../node_modules/@noble/hashes/utils.d.ts","../node_modules/@noble/hashes/hkdf.d.ts","../node_modules/@noble/hashes/_sha2.d.ts","../node_modules/@noble/hashes/sha256.d.ts","../src/crypto/js.ts","../src/crypto/index.ts","../src/metrics.ts","../src/crypto/streaming.ts","../src/noise.ts","../src/index.ts","../src/crypto/index.browser.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/index.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/connection-encryption/index.d.ts","../test/compliance.spec.ts","../node_modules/@types/chai/index.d.ts","../node_modules/@types/chai-as-promised/index.d.ts","../node_modules/chai-parentheses/index.d.ts","../node_modules/@types/chai-subset/index.d.ts","../node_modules/chai-bites/index.d.ts","../node_modules/@types/chai-string/index.d.ts","../node_modules/aegir/dist/utils/chai.d.ts","../node_modules/@types/sinonjs__fake-timers/index.d.ts","../node_modules/@types/sinon/index.d.ts","../node_modules/@libp2p/peer-id-factory/dist/src/index.d.ts","../test/fixtures/peer.ts","../test/index.spec.ts","../node_modules/it-pushable/dist/src/index.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/config.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/frame.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/stream.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/muxer.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/index.d.ts","../node_modules/@libp2p/daemon-protocol/dist/src/index.d.ts","../node_modules/@libp2p/daemon-protocol/dist/src/stream-handler.d.ts","../node_modules/@libp2p/daemon-client/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/pubsub/index.d.ts","../node_modules/protobufjs/index.d.ts","../node_modules/protobufjs/minimal.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/decoderpc.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message-cache.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/metrics.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/set.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-stats.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/compute-score.d.ts","../node_modules/denque/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/message-deliveries.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/tracer.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/config.d.ts","../node_modules/@libp2p/peer-collections/dist/src/map.d.ts","../node_modules/@libp2p/peer-collections/dist/src/set.d.ts","../node_modules/@libp2p/peer-collections/dist/src/list.d.ts","../node_modules/@libp2p/peer-collections/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/connection-manager/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/registrar/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/key.d.ts","../node_modules/interface-store/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/providers.d.ts","../node_modules/@libp2p/interface-internal/dist/src/address-manager/index.d.ts","../node_modules/progress-events/dist/src/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/record/record.d.ts","../node_modules/@libp2p/kad-dht/dist/src/record/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/index.d.ts","../node_modules/@libp2p/daemon-server/dist/src/index.d.ts","../node_modules/@libp2p/interop/dist/src/connect.d.ts","../node_modules/@libp2p/interop/dist/src/dht/index.d.ts","../node_modules/@libp2p/interop/dist/src/pubsub/index.d.ts","../node_modules/@libp2p/interop/dist/src/relay/index.d.ts","../node_modules/@libp2p/interop/dist/src/streams/index.d.ts","../node_modules/@libp2p/interop/dist/src/index.d.ts","../node_modules/@libp2p/tcp/dist/src/listener.d.ts","../node_modules/@libp2p/tcp/dist/src/index.d.ts","../node_modules/execa/index.d.ts","../node_modules/go-libp2p/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/transport-manager/index.d.ts","../node_modules/libp2p/dist/src/address-manager/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-gater/index.d.ts","../node_modules/libp2p/dist/src/components.d.ts","../node_modules/libp2p/dist/src/connection-manager/auto-dial.d.ts","../node_modules/libp2p/dist/src/connection-manager/connection-pruner.d.ts","../node_modules/eventemitter3/index.d.ts","../node_modules/p-queue/dist/queue.d.ts","../node_modules/p-queue/dist/options.d.ts","../node_modules/p-queue/dist/priority-queue.d.ts","../node_modules/p-queue/dist/index.d.ts","../node_modules/libp2p/dist/src/connection-manager/dial-queue.d.ts","../node_modules/libp2p/dist/src/connection-manager/index.d.ts","../node_modules/libp2p/dist/src/transport-manager.d.ts","../node_modules/@libp2p/interface/dist/src/peer-discovery/index.d.ts","../node_modules/@libp2p/keychain/dist/src/index.d.ts","../node_modules/@libp2p/peer-store/dist/src/index.d.ts","../node_modules/libp2p/dist/src/index.d.ts","../node_modules/p-defer/index.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface-peer-id/dist/src/index.d.ts","../test/interop.ts","../node_modules/iso-random-stream/dist/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/aes/index.d.ts","../node_modules/@libp2p/crypto/dist/src/hmac/index.d.ts","../node_modules/@libp2p/crypto/dist/src/pbkdf2.d.ts","../node_modules/@libp2p/crypto/dist/src/random-bytes.d.ts","../node_modules/@libp2p/crypto/dist/src/index.d.ts","../test/utils.ts","../test/noise.spec.ts","../test/xx-handshake.spec.ts","../test/handshakes/xx.spec.ts","../node_modules/keyv/src/index.d.ts","../node_modules/@types/http-cache-semantics/index.d.ts","../node_modules/@types/responselike/index.d.ts","../node_modules/@types/cacheable-request/index.d.ts","../node_modules/@types/ms/index.d.ts","../node_modules/@types/debug/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/keyv/index.d.ts","../node_modules/@types/linkify-it/index.d.ts","../node_modules/@types/mdurl/encode.d.ts","../node_modules/@types/mdurl/decode.d.ts","../node_modules/@types/mdurl/parse.d.ts","../node_modules/@types/mdurl/format.d.ts","../node_modules/@types/mdurl/index.d.ts","../node_modules/@types/markdown-it/lib/common/utils.d.ts","../node_modules/@types/markdown-it/lib/token.d.ts","../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../node_modules/@types/markdown-it/lib/ruler.d.ts","../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../node_modules/@types/markdown-it/lib/parser_block.d.ts","../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../node_modules/@types/markdown-it/lib/parser_core.d.ts","../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../node_modules/@types/markdown-it/lib/renderer.d.ts","../node_modules/@types/markdown-it/lib/index.d.ts","../node_modules/@types/markdown-it/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/mdast/index.d.ts","../node_modules/@types/minimatch/index.d.ts","../node_modules/@types/minimist/index.d.ts","../node_modules/@types/mocha/index.d.ts","../node_modules/@types/normalize-package-data/index.d.ts","../node_modules/@types/parse-json/index.d.ts","../node_modules/@types/retry/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts","../node_modules/@types/strip-bom/index.d.ts","../node_modules/@types/strip-json-comments/index.d.ts","../node_modules/@types/ungap__structured-clone/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts","../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"1bc2fdadc59c4529e51cd693e1bb45c0f9d6c4cf079b008fa3a17da4cd08af44","signature":"a5b2968580425f209992ad1d8a62ab079d84643e00e0f0b11f65fe6423a643f5"},{"version":"a00b40912153391370bfc844161907779723e82cd2d671b3bebea763212f048e","signature":"35095a100857bdbca3c31ddd6e1eb18259140dee0092d97e631889daf084eaec"},"fd617cc8eec6f43227ab572160bac9d23c723073e83a9b100bd15c758eff34c2","176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d","ec3786b43d68955ecdb12ce679d3bc61b6b25c4d0ac5bcdaf50fa4a746189b98","3155e98b0df0c1523715e8a1c75c8a67c401aeb58d6eccf8bd89d5d775b8c1cf","fa82b7b22d9df87323e31e9e2ad75911028f3e544647fd212424b3c4452fee3f","90aa0b916eef195a17c3dbd621746f82ac7969ecc3dbf27c81ee4c68c5af7f25","9ceec2a882368c0160a8a3879aa0efce0fb985751fc23ff6191006030969cfa4","cad5d6451789234434c28dd2d6a8267b0d64c479b1ad267321faa31ba90d570b","e0e8254f7a1a21b5768beb4dbc9d4574ce67aefa59d88251d16b17c658f2a69e","c33b700f5d0797c331e08b29f8440204e19cf035555ea9111321f881f1b4702a",{"version":"b2d663f1f5da5b395c5dc6ba6dbc633d61580235f82faaca06bf420fcdae46cf","signature":"6744c64cda78d6af7280d69c20ead828fa4296efe0b582548cb10ab66914993d"},"f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","4369b27ca2716a04200930b5f24fa87a6ed62d8c70f80a83270956b6b23c32ae","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"8d6138a264ddc6f94f16e99d4e117a2d6eb31b217891cf091b6437a2f114d561","affectsGlobalScope":true},"a882b74c4ba115c6e86371f3592a3accb2c50874b6fcd92a4f83d17a4d6993af","4a8722c7d7a4dac1616db1f41ad0113998ccbbbcd37af43def3fbe6b41208c83","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"0b3868d3f87c95ea73bdfab380e536843ec3573aa76233b97aac40518494ea24","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","30c2ec6abf6aaa60eb4f32fb1235531506b7961c6d1bdc7430711aec8fd85295","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"d48009cbe8a30a504031cc82e1286f78fed33b7a42abf7602c23b5547b382563","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"24ba151e213906027e2b1f5223d33575a3612b0234a0e2b56119520bbe0e594b","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","28c1fc8505da2181ee74c9fe902fac964159cfae266c4413905d50eaecea8a19","84b8cc86ad19115f2637401cdd220460a25542df478c966a5ffc5eeaf3825299",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc","010d5afec4b47ea596f6c59a25ce628fa4e31ea15fd51e73d44ca2d72a780be8","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","f5337c3ea7b8702ffe2718f56a24325a67d517c0d552ef71b8d578d9f33a99d3",{"version":"1cd9488f96f8d5657d4109a6ae188f65846e905c5b236fdf379c16362e7a60a7","signature":"612bf9cb0b0a7ce6eab9fa9c09da1b1e4e5ec8f6b94f282035bfc89f68d4f3c6"},{"version":"2dec630463aaa98bfbc039a798f1757b9d53fd8ebd1722817b05b4534133d8cb","signature":"1cc2659564153cef042b6a377a36a04d861398d678e7032ec42698d8c80ec77f"},{"version":"ad1764b2c66d631e98be0b8255b410a319857ece25c6e8ae9627a535a0241c6b","signature":"1f66808998faa0d77e425d4c5ae8f481c3234d4b8c1deff001e1af71b4b041f3"},{"version":"c99a598040f64ddf29965a42c440a61492300923e58015c9dbad51a95f245b53","signature":"2f37bd92ed3c6cbac299dbfd79abe367c5e5d72e098abdb8d3e3900badd53e88"},"f30cfcfff28ee8f87563225b47239bb07b9b11edd09dda0ea6499b18cca1a30e","0edb8a97ead1fefd337458449050857e80740e31a3f76cffa656262f4e651a50","db8e4b47dd8c22634e3a326e5a5f60aa71a8ad4a0458fc0aadb6951f1c7cdc54","5b7a6d3f5c1b1d94d6cbc6c1e113588e20ae61d583d0d0cb5ec3fd92926d3749",{"version":"57b66a49fde8cfb80495147e1e115f4d09e7d089a97bca210d7b737a9a3dfd40","signature":"7c86832b33e8881089597745da92dc33a29681874849008a13069039bd613ea6"},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","b9998d79c6cb4e43e9d812fec5ccafbedee623c589904e3e3f0439ef861e25dd","7a6f74294b8fb90f5e3832be21e25898dd81b2a1adc36dda6929813ba4135311","d25e693302c8e284b417884b40dbadffe693b0daff8999a000995114dbf74c49","a1d4ac1b15cd62c7346d976e3a01e6cbcd4f166ea6b7866907d25c5acc832d77","5d40e6a7071d0d1e6e558e17214ff786ecb3ea73e31b25a88c2cbe2435fa1252","c45242078469b9680653d6a0667b23b1b767ec908825a14bfa8bb1dde2e30dae","5dcd218cfe8eb7fd6a1e5668c1a98734ddefe888d17129f8844552dddda2a74d","0564c90e8c2577950a446d6197a3ab7ec433ad5ac98435378e8855427f4cbf24","e1712267198fc3dd7903d0b945d5049fd56d68cadaf986c0adc40235fee43488","df21f5c49d638cbd6bd322eeb5b16d8352ba14ccb88cc9b23a7d8d5c2eaaf659","f6d13788d90394a540d136fb8ba9a0a647d8baa2e51d2ae155d039b031f4717f","6af9cf238459fe6d7e2d61cd50a157a6f540905c9793718e0e6e5993ab0cd650","88de5467cd5e4c2c1384629806d56ac1215657bddf39ef9f60a0e05beee2b131","ff5820394809bfc32a7e4586ff11b3c07327a0f4c756709aef92f1cd73d6da48","bfe2af20f3ff0579331661ef4c5d2597e0c31a7a0d760e41eaff0502bf064c4d","f52a0e53f79d7fd1c1c55a3cbda59499d4cce75f3188969024cdc286b29ad3ea","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f",{"version":"9b48eef82666050e509dece807d29b825fde4909ac48c7f1cab67390973a03ec","signature":"220216e61adba5829f622fe331a5a99d4aeedcda11c983149ceff8a063d2585f"},"0eff9792dd66a9aef708b34dd51d2e46158ae518db6ab14f54c5a99e8551abe7","66336b5a5d5e897e932cbf1e306ff8ac8a9929971409a8049c8c8a249cd8b57c","a878d4c7237a7af50e96534295fcf723134d70cbb1e9bfd8365266b912aee6ec","1185e162cb22a9bc3e94b2ae2ba35ed943ee69beae5364b38680f7d8587e7d35","23b0b3d88c166dad8d63750b716b921c51053ad54b14a4e7e32fd526033566db","fbacab2238e299ccf6596c3bd404c7dcad2c5a88ecd254a8a38cf2d184a67c75",{"version":"177dfa229223890f5e22db17d46280f2d4a16ca4c9ab73e4bbff4a1fd12300b4","signature":"e8f2522c8a4cf550c9fcc6154869253bd9ece549be7b5aeaaa7b20f73fb5cd83"},{"version":"e82bddfda890f3c83d1ece8c1df0ce57769a2a82b0ff81aff1409b329a460fc2","signature":"3f39c6ba0e49842fc434134519c30a89d3ec16da9701cf4d1113abf2f2ccfa17"},{"version":"a9ed6ff8aa6f2ea797e06d0f8bb03a4f43ab73a8adf133166140ca1ea208b520","signature":"b73dc3c92a3cdfe4144eafad3b73c13787c5cffe4ec5b35cd0467e9a3ede9ec1"},{"version":"b55e067a9546ac1c237571f938f04ae6593e138a2c1a645ed9171dbc36ee764e","signature":"f30884bec83e02740b8a410ecba62ba558f571a554e1b377ac4b83dff125b57e"},"4de66b5983d6286bfe3606cf155a5b21043111389d0b4c7b23d3f4282099f7d4","3968eed4d327e075c2386fad0b39b5ad2fe1892f6409a3bb46660c46f58300a6",{"version":"36be103794251feb6152dd2c8ec5d0e5f841a189c920881bccfe27f7459f54ed","signature":"0cae8a9a58a4d4836626ea63c8e3e699e7bcdab24c31ef39009abaf97c704b1c"},"b1129d7c114eba7c7b155dc809d6371ef86a0738f7ca93b3efef9b796d6168d9","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6","ffff3307a2c3797cdc04d7493e94245c13a646194c87f5bf5d2432995b834cc3","a87bc62d9a6be405f53f883a422efd557775224cd2b6688440cd333aaac27169","3d08777d7a3f5c1899a21dc2bd9f0ca80cfe0badba576cae22f5b47b7f81b3eb","bbbfe3163d9421b837e4e203c24243344be38e4359b6fc15426943454d8949b6","8cf4dc652e929c4de69ce5079b98a0683757b2dde66a7cee93edcb5aa08d5c48","f74d877f1fc949fb61197bf32a41829a83ee6aea528787dc2788378baaaa0ecf","a62a02c433e6fee26404825310ad462433320ef2e9f80fa7b9156135fd975f8f","22f15ae5c80b3e795da92636aa03d8f981811d067d82bff01ca54093c0535ec0","b56d4bc83ec01834829979ad57de59b4947cd62f71b102ab0040b6960d5bdc81","a10213415bf98670b026b77a90c7933594f0b5c34bde5b74e80134fdf0331bba","00cd454fa42dca69cdea08d4cb9698e679ba9a31762c23d905e45ba92269ac3a","58765e8e715155b2940e868ab1534b1bfac7087f6b42f7810ef94cc077d62981","f1c4e4db3e1dd83c3749f174e662de845e1217017ead0c15074e3ba00db67b6e","5aaea3d4b3af0c8339006c30af04eafdeb21b0a1bba2f1d32540ade412ee80a7","eb72bbe04857681ebd08a48d3b0869969c335445c31de53a85f76b4a42b97c92","c8cc38cbba80bfd5719c1b9d7efcd76fc90d4497e8a9aa715db426993274f0ae","49b6ff487f2d72569e361f077397214fea20839712527f5fb9ed8bb877dd7db8","d3043c37eeeb10d8a5c0c2a3b9d72e23a5fed2e9a367c5b4154bc8d9283601f3","58ff317d61b47e8fc6688bd50e6770311691202553f119d1e1d79b64d864e200","cde49e6e1ab8a2b4202958e3267e898489b737198a0599c7d251f94d9dea658b","3c3ca314a2b01902ef19b499be6e052925a849f14e2d9185afb323df3d3a72b6","b4b4af7820e7888cf67beeb95d0d6144b3d854370a7b78a598e80dc268e74249","1e7146a407bf85762b80681cd4aa3b544000e30c9b24d04685dfa69f82a48fd9","a3c42863fed9b49c35144d60aa0b2865b5fede65ea0050a28f45381af6dae035",{"version":"d898e165d52d3df19f98e46a53df138c8e28b1ec7224e75140d419f7bc60c7f0","signature":"8db42cde9161c917ae86f075cb21c16d1fab5965db0c4f4b372b4e7a0276f82e"},{"version":"f2f278cd3ffe7eb472b5daaec63622a32623cdf0d71395dfe60895363af42dc7","signature":"a03bc49af672574771ede656f9c35be60c2ba44f45655aed449e7f9e5efae6aa"},{"version":"19e0cd3c787b3570a7e8c20aa0718062bfb65e97391bd700bf37612569f3fc68","signature":"39c164f8cfdeb33577063044cf89c43c19bb4f79fae41960e0a17c6de26272c5"},{"version":"d416db55d180900dcf6c3eb98c776c85f3b4f9c4a0907cb8ffdb505500136f18","signature":"7115ea7b230353fe5e5d9436fe7f5b8863dea85c1b7c030c58a75bdb9e844b91"},{"version":"699246380aaa11f56f67ba8a5583f035e79f3de9d5837fe1979c579bafc32156","signature":"4110b29391d0835f9b88a4c69cb7e1cdddbac43ca9ee86393ebc15567c271b4d"},{"version":"aaa8702650fe4efdb8e82d41231add24a0b809b17f55d52009dc469c8ee0b011","signature":"f2dc190b33c1e842552ab4117c29cc960edd8ce2327a22254ec47cbcbdbb91f7"},{"version":"96db0fd5e766faa06d7b4f3ccc7e3b7df29a4c1aa4f116eaec55e5936e321325","signature":"0017550b13ae859f43d4b435fdab5e5035b0d6f7b7959458f30f67e859882d4d"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","e9fd0c57db08c441b0f044449b651e5d9910fa6c7871dbcb4d266b9cd357e2ed",{"version":"bf471b46fd0e07028f318e408bc578f4a3e125333bb545445175e6ba50791ffe","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2","81c6dd936bf342efbb1b1a5440a4300db5d39d70a6ad49ebc91ca7033ae9ce79",{"version":"13acb84a8fa8264d596433ae541c83b13d226a9592e6a26b165002c38132b97a","signature":"e307a4efa11c7f907b4e98ebb9496837e1901f13a19d8b0ed8c51205b09d528f"},{"version":"303ae53a3993e592fa9602ec5c83bac6d5c074f6e73fca8b2007f6db3ecf25f8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","c8031a5db82b240f801a5684ab693e95e1e06dc76958894fe42d35acbd446f28","1633b84fd3346ad6500a88e7a119ac778bb6f6b2746a3b7b8164c5ef2721822f","37fa00014a0f86b91526c4fde9b31af33d3e3bd5892c0519aa0d96d7935de484","5c9d5e0cd18c905ee6f6bc6f85b02c4d5b6f64ad08e1181f63785fae04823db3","5abd603c11eeb815a1746ff003233ae03c8f4f34fcf7835742c30fff038d4100","df54eaa5ea53c6bb3a9548bc5d2f6fb22583ea3e8b936a4e8ec5acfd90422ff3","be8d072f400254824429edab10acbe595299b702c97b99cc47f8e8018b7102ff","1a319786bea64c944ba8dd33331090034468efbab9c2fb96552850033d62d8d8","33174450482b921bbf093e3d52f501f7f93b5fd612311aa86e7339f2800162aa","03e385ae2125c9aa9dead008b42a0ab20d0812c26c19ee210d84c2666113f867","688c9dfd2b7114f5f01022abb5b179659f990d5af5924f185c2644ca99fe7b77","932cade1c5802123b5831f332ad8a6297f0f7d14d0ee04f5a774408f393e2200","925a8770415572378b7b62dcd714e744b7ffed86de59bdbe1d25c68d9d1f7f51","38fc2c990835686053591402bd73803ef28e117fa49427763e62636fd16c76ad","85489033e86eba49bfef2ad7330f8bb57cf7ef6aeb341c00ae1a3e5b19a02f4f","d4936633d5453e441ad5ab182efad46a0e1285fe5f9f5c2948cad3e71b7c2c23","a1b60bd2328318dcbec30bdf529dad31a13315ff2df60c8bd71630c58a575b06","e7ad5aa8eb177708949df3abbfe5ccbe7b75c920fb3bdd89426c38c61f239da6","8cc6a35806cd10d448b0f2ab01fe0b6194ca57fdaced2d71781b68e83c55bd88","8f364fec0ef20506aa9cf00b5cd8b620c1c0389687b11a3a32b0b5d4716ad894","5d11703e2c5d4dbe00bbe79f3bc864d178cf8d6ebccc2d1448ea29e93654f029","f4e82c91aac3b61f3ad04f11a44c5b79f724ff8a09281d0afa24a6624633ff25","ed849d616865076f44a41c87f27698f7cdf230290c44bafc71d7c2bc6919b202","7b8b9017156ef8bf3bbe42785fac8956e5c9869f4a494536d7f548a7c1c7d98a","eb2f08ae9c540a5fb60a5edddc0860ca3dad54ec842301ca73441d9e54534af0","763bb8df872cbb8783e29e19bd7a1dea0f88f7fd7398343af38be8509a65df82","687ce021a76c91c0e0b08fa5b828de2916e1b1aa9a23394e8ebc4dd96b8ee776","c286b410193495d067668bcdbd13ea3f3a39001edff02edee248babf2652e563","ba1405da509cc84896a588978efc45400d4f9844ee738d750b59868b1ad1618a","83a1426ac1a9cf144141dfe10d71a68629623a7c28245c9ca0e0352bead501fd","2726c0a6a4a87fad11e6846e6b0b40b8924fbe66340adc512093c4273bc53e4e","c888daaa99fdf6c5712d98605fdcf21cbbaab756a629661a44cac44ede464d37","e044f60686dc70015a3b7e7c64ad0ac5ec5ec101a0aede0782ec077e136b6a65","a232f867897bbecfebf68df575a417af1afd9b5dd3d83fb4d59e0a133a0de93d","228dbc8825b7a45af7d416dee95c0a2162d7cf73ffddfd52357b7e548882bdaa","602baeb62ccf84672ba7afacb5a21b675171282397513cac8f06d3a8634f840c","8970ab047d89c71edf9973609dd62f61bb366abeabbff36a1200103b6c1c605b","36d756189d9295e3a964e5cd45cb8ac965d5d2ada53ed848e08608426c146d69","8bdb5c16e8b9ba625ec08d8189879a6fb47b2c3c458a5d43ebd53a8763b5712e","93597e08900c3ac5ec730c16c4fbe425f7342e1f0420967b2afd90d67a2abee1","af89ab13b40dd28cd91818fc6329914d2b9663591831f032ff0f0cb4a028d4a5","6e6733927ade923e34b243d6fbec1465cfc8ed6edf62c6e09ed00c529f0d93de","83b3a9e85f7967509436fcdfa9be9bd543fb54003a9233c5c0af087e4a2c11c8","dc92d6eccf12395aa1d47afb765d5e4a1cd2639a385db0e3e88e9937ad2b63a3","ffb6e0556a4b5323c8bdf12727d000e8a3633f0552fffc4b779ae88546be2770","1242141c87ba3396bead6f379f6d6778bd38d02017f243aa448d1454a5fdc90e","17a4105ddae0308e19ee8532bdeb76278efa9dc644366060ca644541d3fd831c","913ffa031f7455c53e99c75ae130a046612d2ee0e716ed92707e996cbd3952ea","44e897d02326bf4d8169ea9638fe0a4c53b8f85cc48ae2fcbbb67b2f72c1d805","288fb1b9df77067c3c2675bde87d23d4a3f01bb6f929f854f11bdb68662968ff","b43b5156bc2831b46f6226777e292ff1646b3651ce190708b6228a078d42da4a","c3e77c4aa1097a38dcf4a20a093ce65033a16f3a48dab0ae3c5f6661bc39b11c","93acb99d30b8a22b443bfefb333d15d6310af7bd76a832f9559f7af9535ed2ae","3053e413471eef0274bc90318db14072e6164fbcc77765ab9557a769370382b2","32cbe201bfe8ed7f4c323fb8a3fcfdfb451f22e84d3c49da33ceda2fbf9230be","50d536e2e8bdbb4234b6ade05992aa4227fbf0401aba24922734c3ddb4a3ff11","4e152867a5b1bea2dc6a2921c0196f877630fc144369f8c7b9a69905caa62741","445c1751941d390dedf7667ab0fef01d468089576c07eba15810bf69485e4589","7f2cc72a16a663ab9f8d99bd5658e583251ce0c003bf80a948973e15a7ef9596","6af42c3c33c7123e7b056a6fd272d470914f382fad5e99689fa4991ff610e757","60f7cf25a65631bcfc27276a9b7b584ad13c2a37f871376d5d02e2133bc5fef9","e1c0439c8c796ddfdd08206dfd2cf7a7defec9d83f7b1e873d908489bda18af4","27679e96d1bd38c5938178aaf4abe8627493090b63d6bae2ce8436e6a87ebe4d","a77fbecee25688f568e18b43f8f54195d6c278a2a9a687ada5ab3d2f726524eb","e29f2b3a93ca3392fe29fa8e7b93985e854b44fe28e2b5c113f08296095bd6b7","d27956c8b392088a06d882e1edb58aab4d5cf5ab1229b73f99329ab21f352147","d643518d0b08b3d8d6e7f1fa884bca57ef95caaa1c312abbd9e1d4ed0d51c370","8c15566043b036c0720caf51ca343754e84e34fbaaf4a58d8080cf4ab2d93734","d8c8d41b25ef1827daaff9d84db43593995ce075551e7f4d8f10e316261e86f0","22fcf82dcbb4743dc846e838434ad1c2843cd18476e534dd3b37f85ece99ac73","40924f439552f559ffa4e41d300a411646ac9f3b53e578a012f7c439d36c6a30","7a34c06f5ed61c8108b2b82b7834655f1933d6ead3c9f6ff9d12efee4cb4bcaf","ee24d63f039e5745a279243916c7bb2c3d405bc0158912c0f37471381b467087","459c0ca522af7a412ef771447fe2c558c9a4640cffa4f53bacac05d0378a3ae7","acd5d501223e3a7cdd229b501fce5fb071937b72bd05fa33e543eb21c8ee0aba","f196d5ed4194259ffb797a34001a5edb7a165cd110dc3e4d8f03f11e3531fe9b","683889752b7c95fffd073b82ea76d36b3fe548ef3bb9887eb903676eabd676ff","a439ff9443c77478bb024ea2d96fbc088bccc915adf6bb8aeb9ab21fd737a071","b40afc6ff175241970202125bc1b5996cf5783b2f755977691f8c6522ace9f14","8bfc11f55ca063b10f0335922693ca70885d8f59b20607dd501250d1b1e960db","a884051a029dc34c400dc1dbad39a878935d37ebbea62d357d17b25f0076b578",{"version":"1b1ca1d97df4268847d5c387b1a89c01ec2fdc2062def1216442c8f040dcb660","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"6e0011406961ab3d469f2a7c3fddc41a5c9fb6d9452c47b5389124da846ab07a","df1bbd333631040027035b56cb31093015e59ce977a590500ed09feab109939b","a4f27ea63e3ff26a94b6681967a5276a2df9ddb80ae990df1ad03c0fffb34eca","18418f70457cee30da01c21bc26869ceb1ae65564784136f7fe2f7f2ff8f740f","3d2ec84143e6462a786b5d9ecf06f4f6f67a59a1f16c5a3a5e41721ba8478b7f","892f412f701d356f85cd3cb7d48b87ffecc0d4f85a2005c1d53e5e08414df8b1",{"version":"14261c0d2da587df791a696c8272003a3c5c1d7dd3a91f459092a8ab99759ca3","signature":"23d9dffba690dd7b1cc3986e0d592011a8660f0cb7632037b83b157b659c1510"},{"version":"1bcee41416ce15644b7e0eb66c2bb9df82007068fc83675d48927495cde7bd57","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"28ff2e0cd9350ef52ad5d6a77ddf2650d0505bd3d8cb1db66e1e5abf798d0c92","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"86b69f4f564965d8fd203354ebfcc235e37958a8195b600161deb5b9982a4dde","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a","4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","852bcf5d92d819abdf34ba0759c311b61d5dac7b9963a6c3cc4f23b025dee8f3","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[61,62,73,[185,188],193,220,[227,230],233,[260,266],269,280,281,364,[371,374]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[164,236],[164,236,237],[164,237,238,239,240],[164,237],[164],[164,242,244],[164,243],[79,164,172,175,226,292,295,296,297,298,300,308,309,310,311,316,317],[164,295,297],[164,294,295],[164,293],[164,292,295,297,299],[164,301,303],[164,299,301,307],[164,305],[164,297,300,301,302,303,304,306],[164,297],[64,164,183],[164,297,300],[79,82,164,210,292,295],[164,226],[164,180,284,287],[64,164,179,180,182,282,283,284,286],[64,164,182,283,284,285],[164,211,366,367,368,369],[164,203],[164,201],[164,204],[164,202,205,206,207,208,209,210],[64,71,164],[64,78,79,82,83,164,179,289,290],[64,164,179],[82,164,182,183,289,318,327],[164,184,267],[82,164],[79,82,164,182,183,315],[164,178,183],[82,164,181,183],[164,358,362],[164,361,362],[164,361],[164,358,359,360],[64,79,164,179,183],[79,82,164,183],[64,79,82,164,179,182],[78,83,164,182],[134,164,171],[79,82,83,84,164,172,173,174,175,176,177,178,181,183],[164,183],[83,164,172],[76,78,164],[79,82,164],[79,83,164,182],[64,79,164,172,183,282],[64,164,179,182,183],[79,164,183],[82,164,172,180,182,183],[164,334],[164,291,329,330,331,332,333],[78,79,83,164,172,173,175,182,316,317,321,322,323,324,326],[79,164,176,201,321],[64,164,325],[79,164,210,321],[79,164],[164,312,313,314],[79,164,210],[74,76,78,79,164],[79,82,164,172,175,182,321],[82,164,173,181,335],[82,164,172,173,181,183,336],[80,81,164],[164,247],[164,250],[164,249,250,251],[164,249,251,252,253,254],[164,256],[164,256,258],[134,137,163,164,171,375,376,377],[164,270],[164,379],[164,405],[164,390],[164,394,395,396],[164,393],[164,395],[164,385,391,392,397,400,402,403,404],[164,392,398,399,405],[164,398,401],[164,392,393,398,405],[164,392,405],[164,407],[164,386,387,388,389],[85,164],[121,164],[122,127,155,164],[123,134,135,142,152,163,164],[123,124,134,142,164],[125,164],[126,127,135,143,164],[127,152,160,164],[128,130,134,142,164],[129,164],[130,131,164],[134,164],[132,134,164],[121,134,164],[134,135,136,152,163,164],[134,135,136,149,152,155,164],[119,164,168],[130,134,137,142,152,163,164],[134,135,137,138,142,152,160,163,164],[137,139,152,160,163,164],[85,86,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170],[134,140,164],[141,163,164,168],[130,134,142,152,164],[143,164],[144,164],[121,145,164],[146,162,164,168],[147,164],[148,164],[134,149,150,164],[149,151,164,166],[122,134,152,153,154,155,164],[122,152,154,164],[152,153,164],[155,164],[156,164],[121,152,164],[134,158,159,164],[158,159,164],[127,142,152,160,164],[161,164],[142,162,164],[122,137,148,163,164],[127,164],[152,164,165],[141,164,166],[164,167],[122,127,134,136,145,152,163,164,166,168],[152,164,169],[137,152,164,171],[164,415,454],[164,415,439,454],[164,454],[164,415],[164,415,440,454],[164,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453],[164,440,454],[164,277],[164,458],[134,152,164,171],[164,270,271,272,273,274,275],[164,270,271],[122,123,152,164],[164,319,320],[164,223],[64,164,179,192,231],[64,164,179,190,192],[64,164,179,192],[64,164,189,191],[164,179],[79,82,164,172,175,182,339],[79,84,164,172,173,174,175,176,181,182,183,316,317,321,323,339,341],[164,172,175,176,182,316],[82,164,172,175,182,316],[79,82,164,173,175,182,183,315,339,341,349],[79,82,164,172,173,175,176,182,183,315,316,339,341,343,344,350],[79,84,164,173,174,180,181,182,183,184,321,340,341,342,351,352,353,354,355],[82,164,172,173,176,181,182,183,323,339],[74,164],[164,201,214,215,216],[77,78,164],[77,164],[75,164],[164,195],[76,164],[76,164,197],[78,164,196,197,198,199,200],[74,75,76,77,164,195],[74,75,76,164],[164,345,346,347,348],[164,346],[164,346,347],[71,164],[63,164],[63,71,164],[63,64,164],[63,65,66,67,68,69,70,164],[164,218],[164,213,218,219,221,222,223,224],[164,201,217],[96,100,163,164],[96,152,163,164],[91,164],[93,96,160,163,164],[142,160,164],[164,171],[91,164,171],[93,96,142,163,164],[88,89,92,95,122,134,152,163,164],[88,94,164],[92,96,122,155,163,164,171],[122,164,171],[112,122,164,171],[90,91,164,171],[96,164],[90,91,92,93,94,95,96,97,98,100,101,102,103,104,105,106,107,108,109,110,111,113,114,115,116,117,118,164],[96,103,104,164],[94,96,104,105,164],[95,164],[88,91,96,164],[96,100,104,105,164],[100,164],[94,96,99,163,164],[88,93,94,96,100,103,164],[122,152,164],[91,96,112,122,164,168,171],[62,73,79,164,187],[62,164,185,186],[62,73,164,184],[62,164,185,187],[164,260],[127,164,185,188,241,245,246,260],[62,164,185,187,188,248,255,257,259],[61,64,164,179,193,230,262],[62,64,72,164,187,192],[62,72,73,79,164,185,187,188,193,194,220,227,229,230,232],[62,72,164,186,187,188,213,222,225,227],[62,72,164,185,187,220,228],[73,164,184,188,260,264],[61,164,185,187,223,226],[164,173],[61,62,64,72,73,79,164,173,179,183,184,185,188,192,193,220,230,232,233,234,235,261,262,263],[62,72,164],[64,71,72,164],[62,73,79,164,211,212,213,219],[164,264,268],[79,164,279],[122,164,185,187,220,222,223,229,260,276,371],[64,164,173,219,232,234,264,265,276,278,280],[82,135,164,211,212,226,265,288,291,328,334,336,337,338,356,357,363],[61,64,79,122,164,193,219,220,222,223,229,231,232,233,234,260,264,276,278,280,365,371],[79,164,185,210,370],[79,122,164,220,222,232,233,234,261,276,280],[62,73,79,187],[62,185,186],[62,73,184],[62,185,187],[265],[188],[64,179,230,262],[62,64,187,192],[62,73,79,185,187,188,229,230,232],[62,186,187,188],[62,185,187,228],[73,184,188,260,264],[185,187,226],[173],[62,64,73,79,173,179,183,184,185,188],[62],[64,71],[62,73,79],[79],[79,185,210]],"referencedMap":[[240,1],[238,2],[241,3],[239,4],[236,5],[237,5],[242,5],[245,6],[244,7],[243,5],[311,5],[318,8],[298,9],[296,10],[295,11],[300,12],[304,13],[308,14],[306,15],[301,5],[299,5],[307,16],[303,17],[309,18],[310,19],[297,20],[302,5],[283,21],[284,5],[288,22],[287,23],[286,24],[366,5],[367,5],[370,25],[204,26],[202,27],[205,28],[211,29],[203,5],[206,26],[207,30],[208,27],[209,27],[368,5],[369,5],[291,31],[289,30],[290,32],[328,33],[268,34],[267,5],[323,35],[316,36],[317,37],[339,38],[363,39],[359,5],[360,40],[362,41],[358,5],[361,42],[184,43],[341,44],[183,45],[84,46],[194,5],[172,47],[182,48],[210,5],[173,49],[353,50],[79,51],[83,52],[174,53],[175,52],[292,54],[176,5],[177,49],[180,55],[285,5],[178,56],[181,57],[329,58],[330,58],[334,59],[331,58],[332,58],[333,58],[327,60],[322,61],[326,62],[325,30],[354,63],[226,64],[315,65],[314,64],[312,64],[313,64],[279,66],[212,67],[355,68],[336,69],[335,70],[81,35],[82,71],[80,35],[248,72],[247,5],[251,73],[252,74],[253,74],[250,5],[254,5],[249,5],[255,75],[258,76],[257,76],[259,77],[256,5],[378,78],[271,79],[275,79],[273,79],[270,5],[380,80],[376,5],[381,5],[382,5],[383,5],[384,47],[385,5],[406,81],[391,82],[397,83],[395,5],[394,84],[396,85],[405,86],[400,87],[402,88],[403,89],[404,90],[398,5],[399,90],[401,90],[393,90],[392,5],[408,91],[387,5],[386,5],[389,82],[390,92],[388,82],[409,5],[410,5],[411,5],[379,5],[85,93],[86,93],[121,94],[122,95],[123,96],[124,97],[125,98],[126,99],[127,100],[128,101],[129,102],[130,103],[131,103],[133,104],[132,105],[134,106],[135,107],[136,108],[120,109],[170,5],[137,110],[138,111],[139,112],[171,113],[140,114],[141,115],[142,116],[143,117],[144,118],[145,119],[146,120],[147,121],[148,122],[149,123],[150,123],[151,124],[152,125],[154,126],[153,127],[155,128],[156,129],[157,130],[158,131],[159,132],[160,133],[161,134],[162,135],[163,136],[164,137],[165,138],[166,139],[167,140],[168,141],[169,142],[412,5],[413,5],[377,143],[414,5],[439,144],[440,145],[415,146],[418,146],[437,144],[438,144],[428,144],[427,147],[425,144],[420,144],[433,144],[431,144],[435,144],[419,144],[432,144],[436,144],[421,144],[422,144],[434,144],[416,144],[423,144],[424,144],[426,144],[430,144],[441,148],[429,144],[417,144],[454,149],[453,5],[448,148],[450,150],[449,148],[442,148],[443,148],[445,148],[447,148],[451,150],[452,150],[444,150],[446,150],[278,151],[277,5],[455,5],[456,5],[457,5],[407,5],[458,5],[459,152],[460,153],[276,154],[87,5],[274,79],[272,155],[305,5],[345,5],[337,156],[338,5],[321,157],[319,158],[320,5],[365,5],[231,32],[232,159],[191,160],[189,161],[192,162],[234,163],[235,163],[282,5],[190,32],[179,5],[375,104],[340,164],[342,165],[343,166],[344,167],[350,168],[351,169],[356,170],[352,171],[216,172],[74,5],[217,173],[75,174],[200,5],[78,175],[195,176],[215,177],[214,177],[197,178],[198,179],[76,5],[201,180],[196,181],[77,182],[199,5],[357,5],[349,183],[347,184],[348,185],[346,5],[324,5],[293,5],[294,11],[63,186],[67,187],[68,188],[65,189],[66,187],[71,190],[69,30],[70,186],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[64,5],[72,5],[221,5],[213,5],[222,5],[219,191],[225,192],[223,191],[218,193],[224,5],[103,194],[110,195],[102,194],[117,196],[94,197],[93,198],[116,199],[111,200],[114,201],[96,202],[95,203],[91,204],[90,205],[113,206],[92,207],[97,208],[98,5],[101,208],[88,5],[119,209],[118,208],[105,210],[106,211],[108,212],[104,213],[107,214],[112,199],[99,215],[100,216],[109,217],[89,218],[115,219],[246,5],[62,5],[230,220],[187,221],[185,222],[61,5],[188,223],[266,224],[261,225],[260,226],[263,227],[193,228],[233,229],[228,230],[229,231],[265,232],[227,233],[262,234],[264,235],[186,236],[73,237],[220,238],[269,239],[280,240],[374,241],[281,242],[364,243],[372,244],[371,245],[373,246]],"exportedModulesMap":[[240,1],[238,2],[241,3],[239,4],[236,5],[237,5],[242,5],[245,6],[244,7],[243,5],[311,5],[318,8],[298,9],[296,10],[295,11],[300,12],[304,13],[308,14],[306,15],[301,5],[299,5],[307,16],[303,17],[309,18],[310,19],[297,20],[302,5],[283,21],[284,5],[288,22],[287,23],[286,24],[366,5],[367,5],[370,25],[204,26],[202,27],[205,28],[211,29],[203,5],[206,26],[207,30],[208,27],[209,27],[368,5],[369,5],[291,31],[289,30],[290,32],[328,33],[268,34],[267,5],[323,35],[316,36],[317,37],[339,38],[363,39],[359,5],[360,40],[362,41],[358,5],[361,42],[184,43],[341,44],[183,45],[84,46],[194,5],[172,47],[182,48],[210,5],[173,49],[353,50],[79,51],[83,52],[174,53],[175,52],[292,54],[176,5],[177,49],[180,55],[285,5],[178,56],[181,57],[329,58],[330,58],[334,59],[331,58],[332,58],[333,58],[327,60],[322,61],[326,62],[325,30],[354,63],[226,64],[315,65],[314,64],[312,64],[313,64],[279,66],[212,67],[355,68],[336,69],[335,70],[81,35],[82,71],[80,35],[248,72],[247,5],[251,73],[252,74],[253,74],[250,5],[254,5],[249,5],[255,75],[258,76],[257,76],[259,77],[256,5],[378,78],[271,79],[275,79],[273,79],[270,5],[380,80],[376,5],[381,5],[382,5],[383,5],[384,47],[385,5],[406,81],[391,82],[397,83],[395,5],[394,84],[396,85],[405,86],[400,87],[402,88],[403,89],[404,90],[398,5],[399,90],[401,90],[393,90],[392,5],[408,91],[387,5],[386,5],[389,82],[390,92],[388,82],[409,5],[410,5],[411,5],[379,5],[85,93],[86,93],[121,94],[122,95],[123,96],[124,97],[125,98],[126,99],[127,100],[128,101],[129,102],[130,103],[131,103],[133,104],[132,105],[134,106],[135,107],[136,108],[120,109],[170,5],[137,110],[138,111],[139,112],[171,113],[140,114],[141,115],[142,116],[143,117],[144,118],[145,119],[146,120],[147,121],[148,122],[149,123],[150,123],[151,124],[152,125],[154,126],[153,127],[155,128],[156,129],[157,130],[158,131],[159,132],[160,133],[161,134],[162,135],[163,136],[164,137],[165,138],[166,139],[167,140],[168,141],[169,142],[412,5],[413,5],[377,143],[414,5],[439,144],[440,145],[415,146],[418,146],[437,144],[438,144],[428,144],[427,147],[425,144],[420,144],[433,144],[431,144],[435,144],[419,144],[432,144],[436,144],[421,144],[422,144],[434,144],[416,144],[423,144],[424,144],[426,144],[430,144],[441,148],[429,144],[417,144],[454,149],[453,5],[448,148],[450,150],[449,148],[442,148],[443,148],[445,148],[447,148],[451,150],[452,150],[444,150],[446,150],[278,151],[277,5],[455,5],[456,5],[457,5],[407,5],[458,5],[459,152],[460,153],[276,154],[87,5],[274,79],[272,155],[305,5],[345,5],[337,156],[338,5],[321,157],[319,158],[320,5],[365,5],[231,32],[232,159],[191,160],[189,161],[192,162],[234,163],[235,163],[282,5],[190,32],[179,5],[375,104],[340,164],[342,165],[343,166],[344,167],[350,168],[351,169],[356,170],[352,171],[216,172],[74,5],[217,173],[75,174],[200,5],[78,175],[195,176],[215,177],[214,177],[197,178],[198,179],[76,5],[201,180],[196,181],[77,182],[199,5],[357,5],[349,183],[347,184],[348,185],[346,5],[324,5],[293,5],[294,11],[63,186],[67,187],[68,188],[65,189],[66,187],[71,190],[69,30],[70,186],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[64,5],[72,5],[221,5],[213,5],[222,5],[219,191],[225,192],[223,191],[218,193],[224,5],[103,194],[110,195],[102,194],[117,196],[94,197],[93,198],[116,199],[111,200],[114,201],[96,202],[95,203],[91,204],[90,205],[113,206],[92,207],[97,208],[98,5],[101,208],[88,5],[119,209],[118,208],[105,210],[106,211],[108,212],[104,213],[107,214],[112,199],[99,215],[100,216],[109,217],[89,218],[115,219],[246,5],[230,247],[187,248],[185,249],[188,250],[266,251],[261,252],[260,252],[263,253],[193,254],[233,255],[228,256],[229,257],[265,258],[227,259],[262,260],[264,261],[186,262],[73,263],[220,264],[280,265],[371,266]],"semanticDiagnosticsPerFile":[240,238,241,239,236,237,242,245,244,243,311,318,298,296,295,300,304,308,306,301,299,307,303,309,310,297,302,283,284,288,287,286,366,367,370,204,202,205,211,203,206,207,208,209,368,369,291,289,290,328,268,267,323,316,317,339,363,359,360,362,358,361,184,341,183,84,194,172,182,210,173,353,79,83,174,175,292,176,177,180,285,178,181,329,330,334,331,332,333,327,322,326,325,354,226,315,314,312,313,279,212,355,336,335,81,82,80,248,247,251,252,253,250,254,249,255,258,257,259,256,378,271,275,273,270,380,376,381,382,383,384,385,406,391,397,395,394,396,405,400,402,403,404,398,399,401,393,392,408,387,386,389,390,388,409,410,411,379,85,86,121,122,123,124,125,126,127,128,129,130,131,133,132,134,135,136,120,170,137,138,139,171,140,141,142,143,144,145,146,147,148,149,150,151,152,154,153,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,412,413,377,414,439,440,415,418,437,438,428,427,425,420,433,431,435,419,432,436,421,422,434,416,423,424,426,430,441,429,417,454,453,448,450,449,442,443,445,447,451,452,444,446,278,277,455,456,457,407,458,459,460,276,87,274,272,305,345,337,338,321,319,320,365,231,232,191,189,192,234,235,282,190,179,375,340,342,343,344,350,351,356,352,216,74,217,75,200,78,195,215,214,197,198,76,201,196,77,199,357,349,347,348,346,324,293,294,63,67,68,65,66,71,69,70,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,64,72,221,213,222,219,225,223,218,224,103,110,102,117,94,93,116,111,114,96,95,91,90,113,92,97,98,101,88,119,118,105,106,108,104,107,112,99,100,109,89,115,246,62,230,187,185,61,188,266,261,260,263,193,233,228,229,265,227,262,264,186,73,220,269,280,374,281,364,372,371,373],"latestChangedDtsFile":"./test/handshakes/xx.spec.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/package.json deleted file mode 100644 index f57d80eba..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/package.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "name": "@chainsafe/libp2p-noise", - "version": "13.0.3", - "author": "ChainSafe ", - "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/ChainSafe/js-libp2p-noise#readme", - "repository": { - "type": "git", - "url": "git+https://github.com/ChainSafe/js-libp2p-noise.git" - }, - "bugs": { - "url": "https://github.com/ChainSafe/js-libp2p-noise/issues" - }, - "keywords": [ - "crypto", - "libp2p", - "noise" - ], - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - }, - "type": "module", - "types": "./dist/src/index.d.ts", - "files": [ - "src", - "dist", - "!dist/test", - "!**/*.tsbuildinfo" - ], - "exports": { - ".": { - "types": "./dist/src/index.d.ts", - "import": "./dist/src/index.js" - } - }, - "eslintConfig": { - "extends": "ipfs", - "parserOptions": { - "sourceType": "module" - }, - "rules": { - "@typescript-eslint/no-unused-vars": "error", - "@typescript-eslint/explicit-function-return-type": "warn", - "@typescript-eslint/strict-boolean-expressions": "off" - }, - "ignorePatterns": [ - "src/proto/payload.js", - "src/proto/payload.d.ts", - "test/fixtures/node-globals.js" - ] - }, - "scripts": { - "bench": "node benchmarks/benchmark.js", - "clean": "aegir clean", - "dep-check": "aegir dep-check", - "build": "aegir build", - "lint": "aegir lint", - "lint:fix": "aegir lint --fix", - "test": "aegir test", - "test:node": "aegir test -t node", - "test:browser": "aegir test -t browser -t webworker", - "test:electron-main": "aegir test -t electron-main", - "test:interop": "aegir test -t node -f dist/test/interop.js", - "docs": "aegir docs", - "proto:gen": "protons ./src/proto/payload.proto", - "prepublish": "npm run build" - }, - "dependencies": { - "@chainsafe/as-chacha20poly1305": "^0.1.0", - "@chainsafe/as-sha256": "^0.4.1", - "@libp2p/crypto": "^2.0.0", - "@libp2p/interface": "^0.1.0", - "@libp2p/logger": "^3.0.0", - "@libp2p/peer-id": "^3.0.0", - "@noble/ciphers": "^0.4.0", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "it-byte-stream": "^1.0.0", - "it-length-prefixed": "^9.0.1", - "it-length-prefixed-stream": "^1.0.0", - "it-pair": "^2.0.6", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.4", - "wherearewe": "^2.0.1" - }, - "devDependencies": { - "@chainsafe/libp2p-yamux": "^5.0.0", - "@libp2p/daemon-client": "^7.0.0", - "@libp2p/daemon-server": "^6.0.0", - "@libp2p/interface-compliance-tests": "^4.0.0", - "@libp2p/interface-peer-id": "^2.0.2", - "@libp2p/interop": "^9.0.0", - "@libp2p/peer-id-factory": "^3.0.0", - "@libp2p/tcp": "^8.0.0", - "@multiformats/multiaddr": "^12.1.0", - "@types/sinon": "^17.0.1", - "aegir": "^40.0.8", - "benchmark": "^2.1.4", - "execa": "^8.0.1", - "go-libp2p": "^1.0.3", - "iso-random-stream": "^2.0.2", - "libp2p": "^0.46.0", - "mkdirp": "^3.0.0", - "p-defer": "^4.0.0", - "protons": "^7.0.0", - "sinon": "^17.0.1" - }, - "browser": { - "./dist/src/crypto/index.js": "./dist/src/crypto/index.browser.js", - "util": false - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/@types/basic.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/@types/basic.ts deleted file mode 100644 index 364d1f89e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/@types/basic.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type bytes = Uint8Array -export type bytes32 = Uint8Array -export type bytes16 = Uint8Array - -export type uint64 = number diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/@types/handshake-interface.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/@types/handshake-interface.ts deleted file mode 100644 index 9b402b1fd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/@types/handshake-interface.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { bytes } from './basic.js' -import type { NoiseSession } from './handshake.js' -import type { NoiseExtensions } from '../proto/payload.js' -import type { PeerId } from '@libp2p/interface/peer-id' - -export interface IHandshake { - session: NoiseSession - remotePeer: PeerId - remoteExtensions: NoiseExtensions - encrypt: (plaintext: bytes, session: NoiseSession) => bytes - decrypt: (ciphertext: bytes, session: NoiseSession, dst?: Uint8Array) => { plaintext: bytes, valid: boolean } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/@types/handshake.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/@types/handshake.ts deleted file mode 100644 index ec333b703..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/@types/handshake.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { bytes, bytes32, uint64 } from './basic.js' -import type { KeyPair } from './libp2p.js' -import type { Nonce } from '../nonce.js' - -export type Hkdf = [bytes, bytes, bytes] - -export interface MessageBuffer { - ne: bytes32 - ns: bytes - ciphertext: bytes -} - -export interface CipherState { - k: bytes32 - // For performance reasons, the nonce is represented as a Nonce object - // The nonce is treated as a uint64, even though the underlying `number` only has 52 safely-available bits. - n: Nonce -} - -export interface SymmetricState { - cs: CipherState - ck: bytes32 // chaining key - h: bytes32 // handshake hash -} - -export interface HandshakeState { - ss: SymmetricState - s: KeyPair - e?: KeyPair - rs: bytes32 - re: bytes32 - psk: bytes32 -} - -export interface NoiseSession { - hs: HandshakeState - h?: bytes32 - cs1?: CipherState - cs2?: CipherState - mc: uint64 - i: boolean -} - -export interface INoisePayload { - identityKey: bytes - identitySig: bytes - data: bytes -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/@types/libp2p.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/@types/libp2p.ts deleted file mode 100644 index c20fe9395..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/@types/libp2p.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { bytes32 } from './basic.js' -import type { NoiseExtensions } from '../proto/payload.js' -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter' - -export interface KeyPair { - publicKey: bytes32 - privateKey: bytes32 -} - -export interface INoiseConnection extends ConnectionEncrypter {} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/constants.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/constants.ts deleted file mode 100644 index 7e8105c47..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/constants.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const NOISE_MSG_MAX_LENGTH_BYTES = 65535 -export const NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG = NOISE_MSG_MAX_LENGTH_BYTES - 16 - -export const DUMP_SESSION_KEYS = Boolean(globalThis.process?.env?.DUMP_SESSION_KEYS) diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/crypto.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/crypto.ts deleted file mode 100644 index 108dfee1c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/crypto.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { bytes32, bytes } from './@types/basic.js' -import type { Hkdf } from './@types/handshake.js' -import type { KeyPair } from './@types/libp2p.js' - -export interface ICryptoInterface { - hashSHA256: (data: Uint8Array) => Uint8Array - - getHKDF: (ck: bytes32, ikm: Uint8Array) => Hkdf - - generateX25519KeyPair: () => KeyPair - generateX25519KeyPairFromSeed: (seed: Uint8Array) => KeyPair - generateX25519SharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Uint8Array - - chaCha20Poly1305Encrypt: (plaintext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32) => bytes - chaCha20Poly1305Decrypt: (ciphertext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array) => bytes | null -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/crypto/index.browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/crypto/index.browser.ts deleted file mode 100644 index f691a85c5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/crypto/index.browser.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { pureJsCrypto } from './js' - -export const defaultCrypto = pureJsCrypto diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/crypto/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/crypto/index.ts deleted file mode 100644 index 946799c9b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/crypto/index.ts +++ /dev/null @@ -1,151 +0,0 @@ -import crypto from 'node:crypto' -import { newInstance, ChaCha20Poly1305 } from '@chainsafe/as-chacha20poly1305' -import { digest } from '@chainsafe/as-sha256' -import { isElectronMain } from 'wherearewe' -import { pureJsCrypto } from './js.js' -import type { KeyPair } from '../@types/libp2p.js' -import type { ICryptoInterface } from '../crypto.js' - -const ctx = newInstance() -const asImpl = new ChaCha20Poly1305(ctx) -const CHACHA_POLY1305 = 'chacha20-poly1305' -const PKCS8_PREFIX = Buffer.from([0x30, 0x2e, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x04, 0x22, 0x04, 0x20]) -const X25519_PREFIX = Buffer.from([0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x03, 0x21, 0x00]) -const nodeCrypto: Pick = { - hashSHA256 (data) { - return crypto.createHash('sha256').update(data).digest() - }, - - chaCha20Poly1305Encrypt (plaintext, nonce, ad, k) { - const cipher = crypto.createCipheriv(CHACHA_POLY1305, k, nonce, { - authTagLength: 16 - }) - cipher.setAAD(ad, { plaintextLength: plaintext.byteLength }) - const updated = cipher.update(plaintext) - const final = cipher.final() - const tag = cipher.getAuthTag() - - const encrypted = Buffer.concat([updated, tag, final], updated.byteLength + tag.byteLength + final.byteLength) - return encrypted - }, - - chaCha20Poly1305Decrypt (ciphertext, nonce, ad, k, _dst) { - const authTag = ciphertext.subarray(ciphertext.length - 16) - const text = ciphertext.subarray(0, ciphertext.length - 16) - const decipher = crypto.createDecipheriv(CHACHA_POLY1305, k, nonce, { - authTagLength: 16 - }) - decipher.setAAD(ad, { - plaintextLength: text.byteLength - }) - decipher.setAuthTag(authTag) - const updated = decipher.update(text) - const final = decipher.final() - if (final.byteLength > 0) { - return Buffer.concat([updated, final], updated.byteLength + final.byteLength) - } - return updated - } -} - -const asCrypto: Pick = { - hashSHA256 (data) { - return digest(data) - }, - chaCha20Poly1305Encrypt (plaintext, nonce, ad, k) { - return asImpl.seal(k, nonce, plaintext, ad) - }, - chaCha20Poly1305Decrypt (ciphertext, nonce, ad, k, dst) { - return asImpl.open(k, nonce, ciphertext, ad, dst) - } -} - -// benchmarks show that for chacha20poly1305 -// the as implementation is faster for smaller payloads(<1200) -// and the node implementation is faster for larger payloads -export const defaultCrypto: ICryptoInterface = { - ...pureJsCrypto, - hashSHA256 (data) { - return nodeCrypto.hashSHA256(data) - }, - chaCha20Poly1305Encrypt (plaintext, nonce, ad, k) { - if (plaintext.length < 1200) { - return asCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) - } - return nodeCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) - }, - chaCha20Poly1305Decrypt (ciphertext, nonce, ad, k, dst) { - if (ciphertext.length < 1200) { - return asCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) - } - return nodeCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) - }, - generateX25519KeyPair (): KeyPair { - const { publicKey, privateKey } = crypto.generateKeyPairSync('x25519', { - publicKeyEncoding: { - type: 'spki', - format: 'der' - }, - privateKeyEncoding: { - type: 'pkcs8', - format: 'der' - } - }) - - return { - publicKey: publicKey.subarray(X25519_PREFIX.length), - privateKey: privateKey.subarray(PKCS8_PREFIX.length) - } - }, - generateX25519KeyPairFromSeed (seed: Uint8Array): KeyPair { - const privateKey = crypto.createPrivateKey({ - key: Buffer.concat([ - PKCS8_PREFIX, - seed - ], PKCS8_PREFIX.byteLength + seed.byteLength), - type: 'pkcs8', - format: 'der' - }) - - const publicKey = crypto.createPublicKey(privateKey) - .export({ - type: 'spki', - format: 'der' - }).subarray(X25519_PREFIX.length) - - return { - publicKey, - privateKey: seed - } - }, - generateX25519SharedKey (privateKey: Uint8Array, publicKey: Uint8Array): Uint8Array { - publicKey = Buffer.concat([ - X25519_PREFIX, - publicKey - ], X25519_PREFIX.byteLength + publicKey.byteLength) - - privateKey = Buffer.concat([ - PKCS8_PREFIX, - privateKey - ], PKCS8_PREFIX.byteLength + privateKey.byteLength) - - return crypto.diffieHellman({ - publicKey: crypto.createPublicKey({ - key: Buffer.from(publicKey, publicKey.byteOffset, publicKey.byteLength), - type: 'spki', - format: 'der' - }), - privateKey: crypto.createPrivateKey({ - key: Buffer.from(privateKey, privateKey.byteOffset, privateKey.byteLength), - type: 'pkcs8', - format: 'der' - }) - }) - } -} - -// no chacha20-poly1305 in electron https://github.com/electron/electron/issues/24024 -if (isElectronMain) { - defaultCrypto.chaCha20Poly1305Encrypt = asCrypto.chaCha20Poly1305Encrypt - defaultCrypto.chaCha20Poly1305Decrypt = asCrypto.chaCha20Poly1305Decrypt -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/crypto/js.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/crypto/js.ts deleted file mode 100644 index e47d4761b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/crypto/js.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { chacha20poly1305 } from '@noble/ciphers/chacha' -import { x25519 } from '@noble/curves/ed25519' -import { extract, expand } from '@noble/hashes/hkdf' -import { sha256 } from '@noble/hashes/sha256' -import type { bytes, bytes32 } from '../@types/basic.js' -import type { Hkdf } from '../@types/handshake.js' -import type { KeyPair } from '../@types/libp2p.js' -import type { ICryptoInterface } from '../crypto.js' - -export const pureJsCrypto: ICryptoInterface = { - hashSHA256 (data: Uint8Array): Uint8Array { - return sha256(data) - }, - - getHKDF (ck: bytes32, ikm: Uint8Array): Hkdf { - const prk = extract(sha256, ikm, ck) - const okmU8Array = expand(sha256, prk, undefined, 96) - const okm = okmU8Array - - const k1 = okm.subarray(0, 32) - const k2 = okm.subarray(32, 64) - const k3 = okm.subarray(64, 96) - - return [k1, k2, k3] - }, - - generateX25519KeyPair (): KeyPair { - const secretKey = x25519.utils.randomPrivateKey() - const publicKey = x25519.getPublicKey(secretKey) - - return { - publicKey, - privateKey: secretKey - } - }, - - generateX25519KeyPairFromSeed (seed: Uint8Array): KeyPair { - const publicKey = x25519.getPublicKey(seed) - - return { - publicKey, - privateKey: seed - } - }, - - generateX25519SharedKey (privateKey: Uint8Array, publicKey: Uint8Array): Uint8Array { - return x25519.getSharedSecret(privateKey, publicKey) - }, - - chaCha20Poly1305Encrypt (plaintext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32): bytes { - return chacha20poly1305(k, nonce, ad).encrypt(plaintext) - }, - - chaCha20Poly1305Decrypt (ciphertext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array): bytes | null { - return chacha20poly1305(k, nonce, ad).decrypt(ciphertext, dst) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/crypto/streaming.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/crypto/streaming.ts deleted file mode 100644 index c3bebff18..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/crypto/streaming.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist' -import { NOISE_MSG_MAX_LENGTH_BYTES, NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG } from '../constants.js' -import { uint16BEEncode } from '../encoder.js' -import type { IHandshake } from '../@types/handshake-interface.js' -import type { MetricsRegistry } from '../metrics.js' -import type { Transform } from 'it-stream-types' - -const CHACHA_TAG_LENGTH = 16 - -// Returns generator that encrypts payload from the user -export function encryptStream (handshake: IHandshake, metrics?: MetricsRegistry): Transform> { - return async function * (source) { - for await (const chunk of source) { - for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG) { - let end = i + NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG - if (end > chunk.length) { - end = chunk.length - } - - const data = handshake.encrypt(chunk.subarray(i, end), handshake.session) - metrics?.encryptedPackets.increment() - - yield new Uint8ArrayList(uint16BEEncode(data.byteLength), data) - } - } - } -} - -// Decrypt received payload to the user -export function decryptStream (handshake: IHandshake, metrics?: MetricsRegistry): Transform, AsyncGenerator> { - return async function * (source) { - for await (const chunk of source) { - for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES) { - let end = i + NOISE_MSG_MAX_LENGTH_BYTES - if (end > chunk.length) { - end = chunk.length - } - - if (end - CHACHA_TAG_LENGTH < i) { - throw new Error('Invalid chunk') - } - const encrypted = chunk.subarray(i, end) - // memory allocation is not cheap so reuse the encrypted Uint8Array - // see https://github.com/ChainSafe/js-libp2p-noise/pull/242#issue-1422126164 - // this is ok because chacha20 reads bytes one by one and don't reread after that - // it's also tested in https://github.com/ChainSafe/as-chacha20poly1305/pull/1/files#diff-25252846b58979dcaf4e41d47b3eadd7e4f335e7fb98da6c049b1f9cd011f381R48 - const dst = chunk.subarray(i, end - CHACHA_TAG_LENGTH) - const { plaintext: decrypted, valid } = handshake.decrypt(encrypted, handshake.session, dst) - if (!valid) { - metrics?.decryptErrors.increment() - throw new Error('Failed to validate decrypted chunk') - } - metrics?.decryptedPackets.increment() - yield decrypted - } - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/encoder.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/encoder.ts deleted file mode 100644 index 8c4d203d4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/encoder.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist' -import { alloc as uint8ArrayAlloc, allocUnsafe as uint8ArrayAllocUnsafe } from 'uint8arrays/alloc' -import type { bytes } from './@types/basic.js' -import type { MessageBuffer } from './@types/handshake.js' -import type { LengthDecoderFunction } from 'it-length-prefixed' - -export const uint16BEEncode = (value: number): Uint8Array => { - const target = uint8ArrayAllocUnsafe(2) - new DataView(target.buffer, target.byteOffset, target.byteLength).setUint16(0, value, false) - return target -} -uint16BEEncode.bytes = 2 - -export const uint16BEDecode: LengthDecoderFunction = (data: Uint8Array | Uint8ArrayList): number => { - if (data.length < 2) throw RangeError('Could not decode int16BE') - - if (data instanceof Uint8Array) { - return new DataView(data.buffer, data.byteOffset, data.byteLength).getUint16(0, false) - } - - return data.getUint16(0) -} -uint16BEDecode.bytes = 2 - -// Note: IK and XX encoder usage is opposite (XX uses in stages encode0 where IK uses encode1) - -export function encode0 (message: MessageBuffer): Uint8ArrayList { - return new Uint8ArrayList(message.ne, message.ciphertext) -} - -export function encode1 (message: MessageBuffer): Uint8ArrayList { - return new Uint8ArrayList(message.ne, message.ns, message.ciphertext) -} - -export function encode2 (message: MessageBuffer): Uint8ArrayList { - return new Uint8ArrayList(message.ns, message.ciphertext) -} - -export function decode0 (input: bytes): MessageBuffer { - if (input.length < 32) { - throw new Error('Cannot decode stage 0 MessageBuffer: length less than 32 bytes.') - } - - return { - ne: input.subarray(0, 32), - ciphertext: input.subarray(32, input.length), - ns: uint8ArrayAlloc(0) - } -} - -export function decode1 (input: bytes): MessageBuffer { - if (input.length < 80) { - throw new Error('Cannot decode stage 1 MessageBuffer: length less than 80 bytes.') - } - - return { - ne: input.subarray(0, 32), - ns: input.subarray(32, 80), - ciphertext: input.subarray(80, input.length) - } -} - -export function decode2 (input: bytes): MessageBuffer { - if (input.length < 48) { - throw new Error('Cannot decode stage 2 MessageBuffer: length less than 48 bytes.') - } - - return { - ne: uint8ArrayAlloc(0), - ns: input.subarray(0, 48), - ciphertext: input.subarray(48, input.length) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/handshake-xx.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/handshake-xx.ts deleted file mode 100644 index 3b547dc03..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/handshake-xx.ts +++ /dev/null @@ -1,178 +0,0 @@ -import { InvalidCryptoExchangeError, UnexpectedPeerError } from '@libp2p/interface/errors' -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { decode0, decode1, decode2, encode0, encode1, encode2 } from './encoder.js' -import { XX } from './handshakes/xx.js' -import { - logger, - logLocalStaticKeys, - logLocalEphemeralKeys, - logRemoteEphemeralKey, - logRemoteStaticKey, - logCipherState -} from './logger.js' -import { - decodePayload, - getPeerIdFromPayload, - verifySignedPayload -} from './utils.js' -import type { bytes, bytes32 } from './@types/basic.js' -import type { IHandshake } from './@types/handshake-interface.js' -import type { CipherState, NoiseSession } from './@types/handshake.js' -import type { KeyPair } from './@types/libp2p.js' -import type { ICryptoInterface } from './crypto.js' -import type { NoiseExtensions } from './proto/payload.js' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { LengthPrefixedStream } from 'it-length-prefixed-stream' - -export class XXHandshake implements IHandshake { - public isInitiator: boolean - public session: NoiseSession - public remotePeer!: PeerId - public remoteExtensions: NoiseExtensions = { webtransportCerthashes: [] } - - protected payload: bytes - protected connection: LengthPrefixedStream - protected xx: XX - protected staticKeypair: KeyPair - - private readonly prologue: bytes32 - - constructor ( - isInitiator: boolean, - payload: bytes, - prologue: bytes32, - crypto: ICryptoInterface, - staticKeypair: KeyPair, - connection: LengthPrefixedStream, - remotePeer?: PeerId, - handshake?: XX - ) { - this.isInitiator = isInitiator - this.payload = payload - this.prologue = prologue - this.staticKeypair = staticKeypair - this.connection = connection - if (remotePeer) { - this.remotePeer = remotePeer - } - this.xx = handshake ?? new XX(crypto) - this.session = this.xx.initSession(this.isInitiator, this.prologue, this.staticKeypair) - } - - // stage 0 - public async propose (): Promise { - logLocalStaticKeys(this.session.hs.s) - if (this.isInitiator) { - logger.trace('Stage 0 - Initiator starting to send first message.') - const messageBuffer = this.xx.sendMessage(this.session, uint8ArrayAlloc(0)) - await this.connection.write(encode0(messageBuffer)) - logger.trace('Stage 0 - Initiator finished sending first message.') - logLocalEphemeralKeys(this.session.hs.e) - } else { - logger.trace('Stage 0 - Responder waiting to receive first message...') - const receivedMessageBuffer = decode0((await this.connection.read()).subarray()) - const { valid } = this.xx.recvMessage(this.session, receivedMessageBuffer) - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 0 validation fail') - } - logger.trace('Stage 0 - Responder received first message.') - logRemoteEphemeralKey(this.session.hs.re) - } - } - - // stage 1 - public async exchange (): Promise { - if (this.isInitiator) { - logger.trace('Stage 1 - Initiator waiting to receive first message from responder...') - const receivedMessageBuffer = decode1((await this.connection.read()).subarray()) - const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer) - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 1 validation fail') - } - logger.trace('Stage 1 - Initiator received the message.') - logRemoteEphemeralKey(this.session.hs.re) - logRemoteStaticKey(this.session.hs.rs) - - logger.trace("Initiator going to check remote's signature...") - try { - const decodedPayload = decodePayload(plaintext) - this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload) - await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer) - this.setRemoteNoiseExtension(decodedPayload.extensions) - } catch (e) { - const err = e as Error - throw new UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`) - } - logger.trace('All good with the signature!') - } else { - logger.trace('Stage 1 - Responder sending out first message with signed payload and static key.') - const messageBuffer = this.xx.sendMessage(this.session, this.payload) - await this.connection.write(encode1(messageBuffer)) - logger.trace('Stage 1 - Responder sent the second handshake message with signed payload.') - logLocalEphemeralKeys(this.session.hs.e) - } - } - - // stage 2 - public async finish (): Promise { - if (this.isInitiator) { - logger.trace('Stage 2 - Initiator sending third handshake message.') - const messageBuffer = this.xx.sendMessage(this.session, this.payload) - await this.connection.write(encode2(messageBuffer)) - logger.trace('Stage 2 - Initiator sent message with signed payload.') - } else { - logger.trace('Stage 2 - Responder waiting for third handshake message...') - const receivedMessageBuffer = decode2((await this.connection.read()).subarray()) - const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer) - if (!valid) { - throw new InvalidCryptoExchangeError('xx handshake stage 2 validation fail') - } - logger.trace('Stage 2 - Responder received the message, finished handshake.') - - try { - const decodedPayload = decodePayload(plaintext) - this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload) - await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer) - this.setRemoteNoiseExtension(decodedPayload.extensions) - } catch (e) { - const err = e as Error - throw new UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`) - } - } - logCipherState(this.session) - } - - public encrypt (plaintext: Uint8Array, session: NoiseSession): bytes { - const cs = this.getCS(session) - - return this.xx.encryptWithAd(cs, uint8ArrayAlloc(0), plaintext) - } - - public decrypt (ciphertext: Uint8Array, session: NoiseSession, dst?: Uint8Array): { plaintext: bytes, valid: boolean } { - const cs = this.getCS(session, false) - - return this.xx.decryptWithAd(cs, uint8ArrayAlloc(0), ciphertext, dst) - } - - public getRemoteStaticKey (): bytes { - return this.session.hs.rs - } - - private getCS (session: NoiseSession, encryption = true): CipherState { - if (!session.cs1 || !session.cs2) { - throw new InvalidCryptoExchangeError('Handshake not completed properly, cipher state does not exist.') - } - - if (this.isInitiator) { - return encryption ? session.cs1 : session.cs2 - } else { - return encryption ? session.cs2 : session.cs1 - } - } - - protected setRemoteNoiseExtension (e: NoiseExtensions | null | undefined): void { - if (e) { - this.remoteExtensions = e - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/handshakes/abstract-handshake.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/handshakes/abstract-handshake.ts deleted file mode 100644 index 308d298c5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/handshakes/abstract-handshake.ts +++ /dev/null @@ -1,181 +0,0 @@ -import { fromString as uint8ArrayFromString } from 'uint8arrays' -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { concat as uint8ArrayConcat } from 'uint8arrays/concat' -import { equals as uint8ArrayEquals } from 'uint8arrays/equals' -import { logger } from '../logger.js' -import { Nonce } from '../nonce.js' -import type { bytes, bytes32 } from '../@types/basic.js' -import type { CipherState, MessageBuffer, SymmetricState } from '../@types/handshake.js' -import type { ICryptoInterface } from '../crypto.js' - -export interface DecryptedResult { - plaintext: bytes - valid: boolean -} - -export interface SplitState { - cs1: CipherState - cs2: CipherState -} - -export abstract class AbstractHandshake { - public crypto: ICryptoInterface - - constructor (crypto: ICryptoInterface) { - this.crypto = crypto - } - - public encryptWithAd (cs: CipherState, ad: Uint8Array, plaintext: Uint8Array): bytes { - const e = this.encrypt(cs.k, cs.n, ad, plaintext) - cs.n.increment() - - return e - } - - public decryptWithAd (cs: CipherState, ad: Uint8Array, ciphertext: Uint8Array, dst?: Uint8Array): DecryptedResult { - const { plaintext, valid } = this.decrypt(cs.k, cs.n, ad, ciphertext, dst) - if (valid) cs.n.increment() - - return { plaintext, valid } - } - - // Cipher state related - protected hasKey (cs: CipherState): boolean { - return !this.isEmptyKey(cs.k) - } - - protected createEmptyKey (): bytes32 { - return uint8ArrayAlloc(32) - } - - protected isEmptyKey (k: bytes32): boolean { - const emptyKey = this.createEmptyKey() - return uint8ArrayEquals(emptyKey, k) - } - - protected encrypt (k: bytes32, n: Nonce, ad: Uint8Array, plaintext: Uint8Array): bytes { - n.assertValue() - - return this.crypto.chaCha20Poly1305Encrypt(plaintext, n.getBytes(), ad, k) - } - - protected encryptAndHash (ss: SymmetricState, plaintext: bytes): bytes { - let ciphertext - if (this.hasKey(ss.cs)) { - ciphertext = this.encryptWithAd(ss.cs, ss.h, plaintext) - } else { - ciphertext = plaintext - } - - this.mixHash(ss, ciphertext) - return ciphertext - } - - protected decrypt (k: bytes32, n: Nonce, ad: bytes, ciphertext: bytes, dst?: Uint8Array): DecryptedResult { - n.assertValue() - - const encryptedMessage = this.crypto.chaCha20Poly1305Decrypt(ciphertext, n.getBytes(), ad, k, dst) - - if (encryptedMessage) { - return { - plaintext: encryptedMessage, - valid: true - } - } else { - return { - plaintext: uint8ArrayAlloc(0), - valid: false - } - } - } - - protected decryptAndHash (ss: SymmetricState, ciphertext: bytes): DecryptedResult { - let plaintext: bytes; let valid = true - if (this.hasKey(ss.cs)) { - ({ plaintext, valid } = this.decryptWithAd(ss.cs, ss.h, ciphertext)) - } else { - plaintext = ciphertext - } - - this.mixHash(ss, ciphertext) - return { plaintext, valid } - } - - protected dh (privateKey: bytes32, publicKey: bytes32): bytes32 { - try { - const derivedU8 = this.crypto.generateX25519SharedKey(privateKey, publicKey) - - if (derivedU8.length === 32) { - return derivedU8 - } - - return derivedU8.subarray(0, 32) - } catch (e) { - const err = e as Error - logger.error(err) - return uint8ArrayAlloc(32) - } - } - - protected mixHash (ss: SymmetricState, data: bytes): void { - ss.h = this.getHash(ss.h, data) - } - - protected getHash (a: Uint8Array, b: Uint8Array): bytes32 { - const u = this.crypto.hashSHA256(uint8ArrayConcat([a, b], a.length + b.length)) - return u - } - - protected mixKey (ss: SymmetricState, ikm: bytes32): void { - const [ck, tempK] = this.crypto.getHKDF(ss.ck, ikm) - ss.cs = this.initializeKey(tempK) - ss.ck = ck - } - - protected initializeKey (k: bytes32): CipherState { - return { k, n: new Nonce() } - } - - // Symmetric state related - - protected initializeSymmetric (protocolName: string): SymmetricState { - const protocolNameBytes = uint8ArrayFromString(protocolName, 'utf-8') - const h = this.hashProtocolName(protocolNameBytes) - - const ck = h - const key = this.createEmptyKey() - const cs: CipherState = this.initializeKey(key) - - return { cs, ck, h } - } - - protected hashProtocolName (protocolName: Uint8Array): bytes32 { - if (protocolName.length <= 32) { - const h = uint8ArrayAlloc(32) - h.set(protocolName) - return h - } else { - return this.getHash(protocolName, uint8ArrayAlloc(0)) - } - } - - protected split (ss: SymmetricState): SplitState { - const [tempk1, tempk2] = this.crypto.getHKDF(ss.ck, uint8ArrayAlloc(0)) - const cs1 = this.initializeKey(tempk1) - const cs2 = this.initializeKey(tempk2) - - return { cs1, cs2 } - } - - protected writeMessageRegular (cs: CipherState, payload: bytes): MessageBuffer { - const ciphertext = this.encryptWithAd(cs, uint8ArrayAlloc(0), payload) - const ne = this.createEmptyKey() - const ns = uint8ArrayAlloc(0) - - return { ne, ns, ciphertext } - } - - protected readMessageRegular (cs: CipherState, message: MessageBuffer): DecryptedResult { - return this.decryptWithAd(cs, uint8ArrayAlloc(0), message.ciphertext) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/handshakes/xx.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/handshakes/xx.ts deleted file mode 100644 index 61077388f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/handshakes/xx.ts +++ /dev/null @@ -1,185 +0,0 @@ -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { isValidPublicKey } from '../utils.js' -import { AbstractHandshake, type DecryptedResult } from './abstract-handshake.js' -import type { bytes32, bytes } from '../@types/basic.js' -import type { CipherState, HandshakeState, MessageBuffer, NoiseSession } from '../@types/handshake.js' -import type { KeyPair } from '../@types/libp2p.js' - -export class XX extends AbstractHandshake { - private initializeInitiator (prologue: bytes32, s: KeyPair, rs: bytes32, psk: bytes32): HandshakeState { - const name = 'Noise_XX_25519_ChaChaPoly_SHA256' - const ss = this.initializeSymmetric(name) - this.mixHash(ss, prologue) - const re = uint8ArrayAlloc(32) - - return { ss, s, rs, psk, re } - } - - private initializeResponder (prologue: bytes32, s: KeyPair, rs: bytes32, psk: bytes32): HandshakeState { - const name = 'Noise_XX_25519_ChaChaPoly_SHA256' - const ss = this.initializeSymmetric(name) - this.mixHash(ss, prologue) - const re = uint8ArrayAlloc(32) - - return { ss, s, rs, psk, re } - } - - private writeMessageA (hs: HandshakeState, payload: bytes, e?: KeyPair): MessageBuffer { - const ns = uint8ArrayAlloc(0) - - if (e !== undefined) { - hs.e = e - } else { - hs.e = this.crypto.generateX25519KeyPair() - } - - const ne = hs.e.publicKey - - this.mixHash(hs.ss, ne) - const ciphertext = this.encryptAndHash(hs.ss, payload) - - return { ne, ns, ciphertext } - } - - private writeMessageB (hs: HandshakeState, payload: bytes): MessageBuffer { - hs.e = this.crypto.generateX25519KeyPair() - const ne = hs.e.publicKey - this.mixHash(hs.ss, ne) - - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re)) - const spk = hs.s.publicKey - const ns = this.encryptAndHash(hs.ss, spk) - - this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re)) - const ciphertext = this.encryptAndHash(hs.ss, payload) - - return { ne, ns, ciphertext } - } - - private writeMessageC (hs: HandshakeState, payload: bytes): { messageBuffer: MessageBuffer, cs1: CipherState, cs2: CipherState, h: bytes } { - const spk = hs.s.publicKey - const ns = this.encryptAndHash(hs.ss, spk) - this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re)) - const ciphertext = this.encryptAndHash(hs.ss, payload) - const ne = this.createEmptyKey() - const messageBuffer: MessageBuffer = { ne, ns, ciphertext } - const { cs1, cs2 } = this.split(hs.ss) - - return { h: hs.ss.h, messageBuffer, cs1, cs2 } - } - - private readMessageA (hs: HandshakeState, message: MessageBuffer): DecryptedResult { - if (isValidPublicKey(message.ne)) { - hs.re = message.ne - } - - this.mixHash(hs.ss, hs.re) - return this.decryptAndHash(hs.ss, message.ciphertext) - } - - private readMessageB (hs: HandshakeState, message: MessageBuffer): DecryptedResult { - if (isValidPublicKey(message.ne)) { - hs.re = message.ne - } - - this.mixHash(hs.ss, hs.re) - if (!hs.e) { - throw new Error('Handshake state `e` param is missing.') - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re)) - const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns) - if (valid1 && isValidPublicKey(ns)) { - hs.rs = ns - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs)) - const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext) - return { plaintext, valid: (valid1 && valid2) } - } - - private readMessageC (hs: HandshakeState, message: MessageBuffer): { h: bytes, plaintext: bytes, valid: boolean, cs1: CipherState, cs2: CipherState } { - const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns) - if (valid1 && isValidPublicKey(ns)) { - hs.rs = ns - } - if (!hs.e) { - throw new Error('Handshake state `e` param is missing.') - } - this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs)) - - const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext) - const { cs1, cs2 } = this.split(hs.ss) - - return { h: hs.ss.h, plaintext, valid: (valid1 && valid2), cs1, cs2 } - } - - public initSession (initiator: boolean, prologue: bytes32, s: KeyPair): NoiseSession { - const psk = this.createEmptyKey() - const rs = uint8ArrayAlloc(32) // no static key yet - let hs - - if (initiator) { - hs = this.initializeInitiator(prologue, s, rs, psk) - } else { - hs = this.initializeResponder(prologue, s, rs, psk) - } - - return { - hs, - i: initiator, - mc: 0 - } - } - - public sendMessage (session: NoiseSession, message: bytes, ephemeral?: KeyPair): MessageBuffer { - let messageBuffer: MessageBuffer - if (session.mc === 0) { - messageBuffer = this.writeMessageA(session.hs, message, ephemeral) - } else if (session.mc === 1) { - messageBuffer = this.writeMessageB(session.hs, message) - } else if (session.mc === 2) { - const { h, messageBuffer: resultingBuffer, cs1, cs2 } = this.writeMessageC(session.hs, message) - messageBuffer = resultingBuffer - session.h = h - session.cs1 = cs1 - session.cs2 = cs2 - } else if (session.mc > 2) { - if (session.i) { - if (!session.cs1) { - throw new Error('CS1 (cipher state) is not defined') - } - - messageBuffer = this.writeMessageRegular(session.cs1, message) - } else { - if (!session.cs2) { - throw new Error('CS2 (cipher state) is not defined') - } - - messageBuffer = this.writeMessageRegular(session.cs2, message) - } - } else { - throw new Error('Session invalid.') - } - - session.mc++ - return messageBuffer - } - - public recvMessage (session: NoiseSession, message: MessageBuffer): DecryptedResult { - let plaintext: bytes = uint8ArrayAlloc(0) - let valid = false - if (session.mc === 0) { - ({ plaintext, valid } = this.readMessageA(session.hs, message)) - } else if (session.mc === 1) { - ({ plaintext, valid } = this.readMessageB(session.hs, message)) - } else if (session.mc === 2) { - const { h, plaintext: resultingPlaintext, valid: resultingValid, cs1, cs2 } = this.readMessageC(session.hs, message) - plaintext = resultingPlaintext - valid = resultingValid - session.h = h - session.cs1 = cs1 - session.cs2 = cs2 - } - session.mc++ - return { plaintext, valid } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/index.ts deleted file mode 100644 index 3a42c8972..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Noise } from './noise.js' -import type { NoiseInit } from './noise.js' -import type { NoiseExtensions } from './proto/payload.js' -import type { ConnectionEncrypter } from '@libp2p/interface/connection-encrypter' -export type { ICryptoInterface } from './crypto.js' -export { pureJsCrypto } from './crypto/js.js' - -export function noise (init: NoiseInit = {}): () => ConnectionEncrypter { - return () => new Noise(init) -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/logger.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/logger.ts deleted file mode 100644 index b44ca7b42..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/logger.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { type Logger, logger } from '@libp2p/logger' -import { toString as uint8ArrayToString } from 'uint8arrays/to-string' -import { DUMP_SESSION_KEYS } from './constants.js' -import type { NoiseSession } from './@types/handshake.js' -import type { KeyPair } from './@types/libp2p.js' - -const log = logger('libp2p:noise') - -export { log as logger } - -let keyLogger: Logger -if (DUMP_SESSION_KEYS) { - keyLogger = log -} else { - keyLogger = Object.assign(() => { /* do nothing */ }, { - enabled: false, - trace: () => {}, - error: () => {} - }) -} - -export function logLocalStaticKeys (s: KeyPair): void { - keyLogger(`LOCAL_STATIC_PUBLIC_KEY ${uint8ArrayToString(s.publicKey, 'hex')}`) - keyLogger(`LOCAL_STATIC_PRIVATE_KEY ${uint8ArrayToString(s.privateKey, 'hex')}`) -} - -export function logLocalEphemeralKeys (e: KeyPair | undefined): void { - if (e) { - keyLogger(`LOCAL_PUBLIC_EPHEMERAL_KEY ${uint8ArrayToString(e.publicKey, 'hex')}`) - keyLogger(`LOCAL_PRIVATE_EPHEMERAL_KEY ${uint8ArrayToString(e.privateKey, 'hex')}`) - } else { - keyLogger('Missing local ephemeral keys.') - } -} - -export function logRemoteStaticKey (rs: Uint8Array): void { - keyLogger(`REMOTE_STATIC_PUBLIC_KEY ${uint8ArrayToString(rs, 'hex')}`) -} - -export function logRemoteEphemeralKey (re: Uint8Array): void { - keyLogger(`REMOTE_EPHEMERAL_PUBLIC_KEY ${uint8ArrayToString(re, 'hex')}`) -} - -export function logCipherState (session: NoiseSession): void { - if (session.cs1 && session.cs2) { - keyLogger(`CIPHER_STATE_1 ${session.cs1.n.getUint64()} ${uint8ArrayToString(session.cs1.k, 'hex')}`) - keyLogger(`CIPHER_STATE_2 ${session.cs2.n.getUint64()} ${uint8ArrayToString(session.cs2.k, 'hex')}`) - } else { - keyLogger('Missing cipher state.') - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/metrics.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/metrics.ts deleted file mode 100644 index 8d0b3a4e7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/metrics.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { Counter, Metrics } from '@libp2p/interface/metrics' - -export type MetricsRegistry = Record - -export function registerMetrics (metrics: Metrics): MetricsRegistry { - return { - xxHandshakeSuccesses: metrics.registerCounter( - 'libp2p_noise_xxhandshake_successes_total', { - help: 'Total count of noise xxHandshakes successes_' - }), - - xxHandshakeErrors: metrics.registerCounter( - 'libp2p_noise_xxhandshake_error_total', { - help: 'Total count of noise xxHandshakes errors' - }), - - encryptedPackets: metrics.registerCounter( - 'libp2p_noise_encrypted_packets_total', { - help: 'Total count of noise encrypted packets successfully' - }), - - decryptedPackets: metrics.registerCounter( - 'libp2p_noise_decrypted_packets_total', { - help: 'Total count of noise decrypted packets' - }), - - decryptErrors: metrics.registerCounter( - 'libp2p_noise_decrypt_errors_total', { - help: 'Total count of noise decrypt errors' - }) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/noise.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/noise.ts deleted file mode 100644 index 7996ef225..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/noise.ts +++ /dev/null @@ -1,201 +0,0 @@ -import { decode } from 'it-length-prefixed' -import { lpStream, type LengthPrefixedStream } from 'it-length-prefixed-stream' -import { duplexPair } from 'it-pair/duplex' -import { pipe } from 'it-pipe' -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { NOISE_MSG_MAX_LENGTH_BYTES } from './constants.js' -import { defaultCrypto } from './crypto/index.js' -import { decryptStream, encryptStream } from './crypto/streaming.js' -import { uint16BEDecode, uint16BEEncode } from './encoder.js' -import { XXHandshake } from './handshake-xx.js' -import { type MetricsRegistry, registerMetrics } from './metrics.js' -import { getPayload } from './utils.js' -import type { bytes } from './@types/basic.js' -import type { IHandshake } from './@types/handshake-interface.js' -import type { INoiseConnection, KeyPair } from './@types/libp2p.js' -import type { ICryptoInterface } from './crypto.js' -import type { NoiseExtensions } from './proto/payload.js' -import type { MultiaddrConnection } from '@libp2p/interface/connection' -import type { SecuredConnection } from '@libp2p/interface/connection-encrypter' -import type { Metrics } from '@libp2p/interface/metrics' -import type { PeerId } from '@libp2p/interface/peer-id' -import type { Duplex } from 'it-stream-types' -import type { Uint8ArrayList } from 'uint8arraylist' - -interface HandshakeParams { - connection: LengthPrefixedStream - isInitiator: boolean - localPeer: PeerId - remotePeer?: PeerId -} - -export interface NoiseInit { - /** - * x25519 private key, reuse for faster handshakes - */ - staticNoiseKey?: bytes - extensions?: NoiseExtensions - crypto?: ICryptoInterface - prologueBytes?: Uint8Array - metrics?: Metrics -} - -export class Noise implements INoiseConnection { - public protocol = '/noise' - public crypto: ICryptoInterface - - private readonly prologue: Uint8Array - private readonly staticKeys: KeyPair - private readonly extensions?: NoiseExtensions - private readonly metrics?: MetricsRegistry - - constructor (init: NoiseInit = {}) { - const { staticNoiseKey, extensions, crypto, prologueBytes, metrics } = init - - this.crypto = crypto ?? defaultCrypto - this.extensions = extensions - this.metrics = metrics ? registerMetrics(metrics) : undefined - - if (staticNoiseKey) { - // accepts x25519 private key of length 32 - this.staticKeys = this.crypto.generateX25519KeyPairFromSeed(staticNoiseKey) - } else { - this.staticKeys = this.crypto.generateX25519KeyPair() - } - this.prologue = prologueBytes ?? uint8ArrayAlloc(0) - } - - /** - * Encrypt outgoing data to the remote party (handshake as initiator) - * - * @param {PeerId} localPeer - PeerId of the receiving peer - * @param {Stream} connection - streaming iterable duplex that will be encrypted - * @param {PeerId} remotePeer - PeerId of the remote peer. Used to validate the integrity of the remote peer. - * @returns {Promise>} - */ - public async secureOutbound > = MultiaddrConnection> (localPeer: PeerId, connection: Stream, remotePeer?: PeerId): Promise> { - const wrappedConnection = lpStream( - connection, - { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - } - ) - const handshake = await this.performHandshake({ - connection: wrappedConnection, - isInitiator: true, - localPeer, - remotePeer - }) - const conn = await this.createSecureConnection(wrappedConnection, handshake) - - connection.source = conn.source - connection.sink = conn.sink - - return { - conn: connection, - remoteExtensions: handshake.remoteExtensions, - remotePeer: handshake.remotePeer - } - } - - /** - * Decrypt incoming data (handshake as responder). - * - * @param {PeerId} localPeer - PeerId of the receiving peer. - * @param {Stream} connection - streaming iterable duplex that will be encrypted. - * @param {PeerId} remotePeer - optional PeerId of the initiating peer, if known. This may only exist during transport upgrades. - * @returns {Promise>} - */ - public async secureInbound > = MultiaddrConnection> (localPeer: PeerId, connection: Stream, remotePeer?: PeerId): Promise> { - const wrappedConnection = lpStream( - connection, - { - lengthEncoder: uint16BEEncode, - lengthDecoder: uint16BEDecode, - maxDataLength: NOISE_MSG_MAX_LENGTH_BYTES - } - ) - const handshake = await this.performHandshake({ - connection: wrappedConnection, - isInitiator: false, - localPeer, - remotePeer - }) - const conn = await this.createSecureConnection(wrappedConnection, handshake) - - connection.source = conn.source - connection.sink = conn.sink - - return { - conn: connection, - remotePeer: handshake.remotePeer, - remoteExtensions: handshake.remoteExtensions - } - } - - /** - * If Noise pipes supported, tries IK handshake first with XX as fallback if it fails. - * If noise pipes disabled or remote peer static key is unknown, use XX. - * - * @param {HandshakeParams} params - */ - private async performHandshake (params: HandshakeParams): Promise { - const payload = await getPayload(params.localPeer, this.staticKeys.publicKey, this.extensions) - - // run XX handshake - return this.performXXHandshake(params, payload) - } - - private async performXXHandshake ( - params: HandshakeParams, - payload: bytes - ): Promise { - const { isInitiator, remotePeer, connection } = params - const handshake = new XXHandshake( - isInitiator, - payload, - this.prologue, - this.crypto, - this.staticKeys, - connection, - remotePeer - ) - - try { - await handshake.propose() - await handshake.exchange() - await handshake.finish() - this.metrics?.xxHandshakeSuccesses.increment() - } catch (e: unknown) { - this.metrics?.xxHandshakeErrors.increment() - if (e instanceof Error) { - e.message = `Error occurred during XX handshake: ${e.message}` - throw e - } - } - - return handshake - } - - private async createSecureConnection ( - connection: LengthPrefixedStream>>, - handshake: IHandshake - ): Promise>> { - // Create encryption box/unbox wrapper - const [secure, user] = duplexPair() - const network = connection.unwrap() - - await pipe( - secure, // write to wrapper - encryptStream(handshake, this.metrics), // encrypt data + prefix with message length - network, // send to the remote peer - (source) => decode(source, { lengthDecoder: uint16BEDecode }), // read message length prefix - decryptStream(handshake, this.metrics), // decrypt the incoming data - secure // pipe to the wrapper - ) - - return user - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/nonce.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/nonce.ts deleted file mode 100644 index e19183dd8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/nonce.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import type { bytes, uint64 } from './@types/basic.js' - -export const MIN_NONCE = 0 -// For performance reasons, the nonce is represented as a JS `number` -// Although JS `number` can safely represent integers up to 2 ** 53 - 1, we choose to only use -// 4 bytes to store the data for performance reason. -// This is a slight deviation from the noise spec, which describes the max nonce as 2 ** 64 - 2 -// The effect is that this implementation will need a new handshake to be performed after fewer messages are exchanged than other implementations with full uint64 nonces. -// this MAX_NONCE is still a large number of messages, so the practical effect of this is negligible. -export const MAX_NONCE = 0xffffffff - -const ERR_MAX_NONCE = 'Cipherstate has reached maximum n, a new handshake must be performed' - -/** - * The nonce is an uint that's increased over time. - * Maintaining different representations help improve performance. - */ -export class Nonce { - private n: uint64 - private readonly bytes: bytes - private readonly view: DataView - - constructor (n = MIN_NONCE) { - this.n = n - this.bytes = uint8ArrayAlloc(12) - this.view = new DataView(this.bytes.buffer, this.bytes.byteOffset, this.bytes.byteLength) - this.view.setUint32(4, n, true) - } - - increment (): void { - this.n++ - // Even though we're treating the nonce as 8 bytes, RFC7539 specifies 12 bytes for a nonce. - this.view.setUint32(4, this.n, true) - } - - getBytes (): bytes { - return this.bytes - } - - getUint64 (): uint64 { - return this.n - } - - assertValue (): void { - if (this.n > MAX_NONCE) { - throw new Error(ERR_MAX_NONCE) - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/proto/payload.proto b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/proto/payload.proto deleted file mode 100644 index cdb2383cb..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/proto/payload.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; - -message NoiseExtensions { - repeated bytes webtransport_certhashes = 1; -} - -message NoiseHandshakePayload { - bytes identity_key = 1; - bytes identity_sig = 2; - optional NoiseExtensions extensions = 4; -} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/proto/payload.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/proto/payload.ts deleted file mode 100644 index 5f8d5100f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/proto/payload.ts +++ /dev/null @@ -1,152 +0,0 @@ -/* eslint-disable import/export */ -/* eslint-disable complexity */ -/* eslint-disable @typescript-eslint/no-namespace */ -/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ -/* eslint-disable @typescript-eslint/no-empty-interface */ - -import { type Codec, decodeMessage, encodeMessage, message } from 'protons-runtime' -import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import type { Uint8ArrayList } from 'uint8arraylist' - -export interface NoiseExtensions { - webtransportCerthashes: Uint8Array[] -} - -export namespace NoiseExtensions { - let _codec: Codec - - export const codec = (): Codec => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork() - } - - if (obj.webtransportCerthashes != null) { - for (const value of obj.webtransportCerthashes) { - w.uint32(10) - w.bytes(value) - } - } - - if (opts.lengthDelimited !== false) { - w.ldelim() - } - }, (reader, length) => { - const obj: any = { - webtransportCerthashes: [] - } - - const end = length == null ? reader.len : reader.pos + length - - while (reader.pos < end) { - const tag = reader.uint32() - - switch (tag >>> 3) { - case 1: { - obj.webtransportCerthashes.push(reader.bytes()) - break - } - default: { - reader.skipType(tag & 7) - break - } - } - } - - return obj - }) - } - - return _codec - } - - export const encode = (obj: Partial): Uint8Array => { - return encodeMessage(obj, NoiseExtensions.codec()) - } - - export const decode = (buf: Uint8Array | Uint8ArrayList): NoiseExtensions => { - return decodeMessage(buf, NoiseExtensions.codec()) - } -} - -export interface NoiseHandshakePayload { - identityKey: Uint8Array - identitySig: Uint8Array - extensions?: NoiseExtensions -} - -export namespace NoiseHandshakePayload { - let _codec: Codec - - export const codec = (): Codec => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork() - } - - if ((obj.identityKey != null && obj.identityKey.byteLength > 0)) { - w.uint32(10) - w.bytes(obj.identityKey) - } - - if ((obj.identitySig != null && obj.identitySig.byteLength > 0)) { - w.uint32(18) - w.bytes(obj.identitySig) - } - - if (obj.extensions != null) { - w.uint32(34) - NoiseExtensions.codec().encode(obj.extensions, w) - } - - if (opts.lengthDelimited !== false) { - w.ldelim() - } - }, (reader, length) => { - const obj: any = { - identityKey: uint8ArrayAlloc(0), - identitySig: uint8ArrayAlloc(0) - } - - const end = length == null ? reader.len : reader.pos + length - - while (reader.pos < end) { - const tag = reader.uint32() - - switch (tag >>> 3) { - case 1: { - obj.identityKey = reader.bytes() - break - } - case 2: { - obj.identitySig = reader.bytes() - break - } - case 4: { - obj.extensions = NoiseExtensions.codec().decode(reader, reader.uint32()) - break - } - default: { - reader.skipType(tag & 7) - break - } - } - } - - return obj - }) - } - - return _codec - } - - export const encode = (obj: Partial): Uint8Array => { - return encodeMessage(obj, NoiseHandshakePayload.codec()) - } - - export const decode = (buf: Uint8Array | Uint8ArrayList): NoiseHandshakePayload => { - return decodeMessage(buf, NoiseHandshakePayload.codec()) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/utils.ts deleted file mode 100644 index 993c9628c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/noise/src/utils.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { unmarshalPublicKey, unmarshalPrivateKey } from '@libp2p/crypto/keys' -import { peerIdFromKeys } from '@libp2p/peer-id' -import { concat as uint8ArrayConcat } from 'uint8arrays/concat' -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' -import { type NoiseExtensions, NoiseHandshakePayload } from './proto/payload.js' -import type { bytes } from './@types/basic.js' -import type { PeerId } from '@libp2p/interface/peer-id' - -export async function getPayload ( - localPeer: PeerId, - staticPublicKey: bytes, - extensions?: NoiseExtensions -): Promise { - const signedPayload = await signPayload(localPeer, getHandshakePayload(staticPublicKey)) - - if (localPeer.publicKey == null) { - throw new Error('PublicKey was missing from local PeerId') - } - - return createHandshakePayload( - localPeer.publicKey, - signedPayload, - extensions - ) -} - -export function createHandshakePayload ( - libp2pPublicKey: Uint8Array, - signedPayload: Uint8Array, - extensions?: NoiseExtensions -): bytes { - return NoiseHandshakePayload.encode({ - identityKey: libp2pPublicKey, - identitySig: signedPayload, - extensions: extensions ?? { webtransportCerthashes: [] } - }).subarray() -} - -export async function signPayload (peerId: PeerId, payload: bytes): Promise { - if (peerId.privateKey == null) { - throw new Error('PrivateKey was missing from PeerId') - } - - const privateKey = await unmarshalPrivateKey(peerId.privateKey) - - return privateKey.sign(payload) -} - -export async function getPeerIdFromPayload (payload: NoiseHandshakePayload): Promise { - return peerIdFromKeys(payload.identityKey) -} - -export function decodePayload (payload: bytes | Uint8Array): NoiseHandshakePayload { - return NoiseHandshakePayload.decode(payload) -} - -export function getHandshakePayload (publicKey: bytes): bytes { - const prefix = uint8ArrayFromString('noise-libp2p-static-key:') - return uint8ArrayConcat([prefix, publicKey], prefix.length + publicKey.length) -} - -/** - * Verifies signed payload, throws on any irregularities. - * - * @param {bytes} noiseStaticKey - owner's noise static key - * @param {bytes} payload - decoded payload - * @param {PeerId} remotePeer - owner's libp2p peer ID - * @returns {Promise} - peer ID of payload owner - */ -export async function verifySignedPayload ( - noiseStaticKey: bytes, - payload: NoiseHandshakePayload, - remotePeer: PeerId -): Promise { - // Unmarshaling from PublicKey protobuf - const payloadPeerId = await peerIdFromKeys(payload.identityKey) - if (!payloadPeerId.equals(remotePeer)) { - throw new Error(`Payload identity key ${payloadPeerId.toString()} does not match expected remote peer ${remotePeer.toString()}`) - } - const generatedPayload = getHandshakePayload(noiseStaticKey) - - if (payloadPeerId.publicKey == null) { - throw new Error('PublicKey was missing from PeerId') - } - - if (payload.identitySig == null) { - throw new Error('Signature was missing from message') - } - - const publicKey = unmarshalPublicKey(payloadPeerId.publicKey) - - const valid = await publicKey.verify(generatedPayload, payload.identitySig) - - if (!valid) { - throw new Error("Static key doesn't match to peer that signed payload!") - } - - return payloadPeerId -} - -export function isValidPublicKey (pk: bytes): boolean { - if (!(pk instanceof Uint8Array)) { - return false - } - - if (pk.length !== 32) { - return false - } - - return true -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/package-lock.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/package-lock.json deleted file mode 100644 index 7f8503d48..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/package-lock.json +++ /dev/null @@ -1,1143 +0,0 @@ -{ - "name": "@libp2p/perf-js-libp2p-1-0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@libp2p/perf-js-libp2p-1-0", - "dependencies": { - "@chainsafe/libp2p-noise": "^13.0.3", - "@chainsafe/libp2p-yamux": "^5.0.3", - "@libp2p/perf": "next", - "@libp2p/tcp": "next", - "libp2p": "next" - } - }, - "node_modules/@chainsafe/as-chacha20poly1305": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@chainsafe/as-chacha20poly1305/-/as-chacha20poly1305-0.1.0.tgz", - "integrity": "sha512-BpNcL8/lji/GM3+vZ/bgRWqJ1q5kwvTFmGPk7pxm/QQZDbaMI98waOHjEymTjq2JmdD/INdNBFOVSyJofXg7ew==" - }, - "node_modules/@chainsafe/as-sha256": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.4.1.tgz", - "integrity": "sha512-IqeeGwQihK6Y2EYLFofqs2eY2ep1I2MvQXHzOAI+5iQN51OZlUkrLgyAugu2x86xZewDk5xas7lNczkzFzF62w==" - }, - "node_modules/@chainsafe/is-ip": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@chainsafe/is-ip/-/is-ip-2.0.2.tgz", - "integrity": "sha512-ndGqEMG1W5WkGagaqOZHpPU172AGdxr+LD15sv3WIUvT5oCFUrG1Y0CW/v2Egwj4JXEvSibaIIIqImsm98y1nA==" - }, - "node_modules/@chainsafe/libp2p-noise": { - "version": "13.0.3", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-13.0.3.tgz", - "integrity": "sha512-hzfhKUEx5XHDaC21wgROhTUFelaeYojH3DFYhCvqFnhRPUjmz+WJh2jweKaUlysKTTrEHv+JJob/TDY/IS6fRw==", - "dependencies": { - "@chainsafe/as-chacha20poly1305": "^0.1.0", - "@chainsafe/as-sha256": "^0.4.1", - "@libp2p/crypto": "^2.0.0", - "@libp2p/interface": "^0.1.0", - "@libp2p/logger": "^3.0.0", - "@libp2p/peer-id": "^3.0.0", - "@noble/ciphers": "^0.4.0", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "it-byte-stream": "^1.0.0", - "it-length-prefixed": "^9.0.1", - "it-length-prefixed-stream": "^1.0.0", - "it-pair": "^2.0.6", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.4", - "wherearewe": "^2.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@chainsafe/libp2p-yamux": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-yamux/-/libp2p-yamux-5.0.3.tgz", - "integrity": "sha512-I2g8eJFm4xvyrD9Z8+8RvqpCBqHiFtcOGrl4sQXPkktw0cY5hvXf0knIjOLacoNOdAPKG9MNscT4Vojp+sb6cw==", - "dependencies": { - "@libp2p/interface": "^0.1.0", - "@libp2p/logger": "^3.0.0", - "get-iterator": "^2.0.1", - "it-foreach": "^2.0.3", - "it-pipe": "^3.0.1", - "it-pushable": "^3.2.0", - "uint8arraylist": "^2.4.3" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@chainsafe/netmask": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@chainsafe/netmask/-/netmask-2.0.0.tgz", - "integrity": "sha512-I3Z+6SWUoaljh3TBzCnCxjlUyN8tA+NAk5L6m9IxvCf1BENQTePzPMis97CoN/iMW1St3WN+AWCCRp+TTBRiDg==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.1" - } - }, - "node_modules/@libp2p/crypto": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8.tgz", - "integrity": "sha512-8e5fh6bsJNpSjhrggtlm8QF+BERjelJswIjRS69aKgxp24R4z2kDM4pRYPkfQjXJDLNDtqWtKNmePgX23+QJsA==", - "dependencies": { - "@libp2p/interface": "^0.1.6", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.0.1", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/interface": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6.tgz", - "integrity": "sha512-Lzc5cS/hXuoXhuAbVIxJIHLCYmfPcbU0vVgrpMoiP1Qb2Q3ETU4A46GB8s8mWXgSU6tr9RcqerUqzFYD6+OAag==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.5", - "abortable-iterator": "^5.0.1", - "it-pushable": "^3.2.0", - "it-stream-types": "^2.0.1", - "multiformats": "^12.0.1", - "p-defer": "^4.0.0", - "race-signal": "^1.0.0", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/interface-internal": { - "version": "0.1.9-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-0.1.9-0b4a2ee79.tgz", - "integrity": "sha512-IGrEs9QsJdYYsSOhniUEQzHVtgB7WNyRqMF8g6iVGn/rM1bJd8MM4syczPn7OQQbkAKqoLQL32XzGN2JgzAvZQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-collections": "4.0.8-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/interface-internal/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/logger": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-3.1.0.tgz", - "integrity": "sha512-qJbJBAhxHVsRBtQSOIkSLi0lskUSFjzE+zm0QvoyxzZKSz+mX41mZLbnofPIVOVauoDQ40dXpe7WDUOq8AbiQQ==", - "dependencies": { - "@libp2p/interface": "^0.1.6", - "@multiformats/multiaddr": "^12.1.5", - "debug": "^4.3.4", - "interface-datastore": "^8.2.0", - "multiformats": "^12.0.1" - } - }, - "node_modules/@libp2p/multistream-select": { - "version": "4.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/multistream-select/-/multistream-select-4.0.6-0b4a2ee79.tgz", - "integrity": "sha512-ylXXuNgeizJ8ALRCp3V1eXbfzibt+cJUYyZvrO2GK7sGYDGlRh7T3rNMCHaU7tuXKN92xrD7Owwnk9rNjFtA+g==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "it-length-prefixed": "^9.0.3", - "it-length-prefixed-stream": "^1.1.1", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "p-defer": "^4.0.0", - "uint8-varint": "^2.0.2", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/multistream-select/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-collections": { - "version": "4.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-4.0.8-0b4a2ee79.tgz", - "integrity": "sha512-LYLTIlAWNLsDGlK7dhZ9azqkr9vpq5NbvuqTWAKEv02pFbJlmgIMUtPL6XJeyk2BLiZQtgp/nP6cpdFSPZTrBw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79" - } - }, - "node_modules/@libp2p/peer-collections/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-collections/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-id": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6.tgz", - "integrity": "sha512-iN1Ia5gH2U1V/GOVRmLHmVY6fblxzrOPUoZrMYjHl/K4s+AiI7ym/527WDeQvhQpD7j3TfDwcAYforD2dLGpLw==", - "dependencies": { - "@libp2p/interface": "^0.1.6", - "multiformats": "^12.0.1", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-id-factory": { - "version": "3.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id-factory/-/peer-id-factory-3.0.8-0b4a2ee79.tgz", - "integrity": "sha512-y7JrbVT4+ZAy7KDqwwfoBFHPjR5cBZI8+ySwbuyI1MApVxXjPenJdJZRInxQbUDjqWnQHP8dOa75lXhMowjxVg==", - "dependencies": { - "@libp2p/crypto": "2.0.8-0b4a2ee79", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "multiformats": "^12.1.3", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/crypto": { - "version": "2.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8-0b4a2ee79.tgz", - "integrity": "sha512-k6elAUnxMquhQYpCnlLmuU8NpfVU12XU0hFELsgC4TqKkC1PO7EuagngbjHilzyo1wpSAfaYGjAIjlQfjB50iw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.1.3", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-record": { - "version": "6.0.9-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-6.0.9-0b4a2ee79.tgz", - "integrity": "sha512-oZ7a2TidrdmpQuduqdgsZWPQbUPsGN87RTVg2+pgonSnzBtVV5ezHw9KRdhT/qJV4APlBPlRDv3uQU5/oFnqvA==", - "dependencies": { - "@libp2p/crypto": "2.0.8-0b4a2ee79", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "@libp2p/utils": "4.0.7-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "protons-runtime": "^5.0.0", - "uint8-varint": "^2.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-record/node_modules/@libp2p/crypto": { - "version": "2.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8-0b4a2ee79.tgz", - "integrity": "sha512-k6elAUnxMquhQYpCnlLmuU8NpfVU12XU0hFELsgC4TqKkC1PO7EuagngbjHilzyo1wpSAfaYGjAIjlQfjB50iw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.1.3", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-record/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-record/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-store": { - "version": "9.0.9-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-9.0.9-0b4a2ee79.tgz", - "integrity": "sha512-uiUsWo6RdOSgnmplpmcEWnETKp4SXeKAfEcwURgwpEAXsJhPx9UfY9kXMb4xov6ssfHWF8FnTPhlWSrLmCuO4A==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/peer-collections": "4.0.8-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "@libp2p/peer-id-factory": "3.0.8-0b4a2ee79", - "@libp2p/peer-record": "6.0.9-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "interface-datastore": "^8.2.0", - "it-all": "^3.0.2", - "mortice": "^3.0.1", - "multiformats": "^12.1.3", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/peer-store/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/peer-store/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/@libp2p/perf": { - "version": "2.0.1-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/perf/-/perf-2.0.1-0b4a2ee79.tgz", - "integrity": "sha512-B3pDbyEQ6z0yWkh8vkEZE6HbMabS63BH8Gm3kDHCaZm3n40KoFxqwoBL0Iy82nxk0/20Mc3D/bprqzEj2YUlVw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/interface-internal": "0.1.9-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.3" - } - }, - "node_modules/@libp2p/perf/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/tcp": { - "version": "8.0.13-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/tcp/-/tcp-8.0.13-0b4a2ee79.tgz", - "integrity": "sha512-/KuO1ivDV/L4/lLL4gmvq5vXz/xgK2vt9eV8nuwgwOUqWsJEeMkQbdOwKKajrIc0tnk1OFzXb5Kpua2bML++jQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/utils": "4.0.7-0b4a2ee79", - "@multiformats/mafmt": "^12.1.6", - "@multiformats/multiaddr": "^12.1.10", - "@types/sinon": "^17.0.0", - "stream-to-it": "^0.2.2" - } - }, - "node_modules/@libp2p/tcp/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/utils": { - "version": "4.0.7-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-4.0.7-0b4a2ee79.tgz", - "integrity": "sha512-ZHjjlDvG5j+SDtcYNJUhONflbcHNbwdHZsHZlpjwaYyHb74ZvKzd9O5YJTXoAZyJgN2v0cJ814Pc2ObrjrqpTw==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.2", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "@multiformats/multiaddr-matcher": "^1.1.0", - "get-iterator": "^2.0.1", - "is-loopback-addr": "^2.0.1", - "it-pushable": "^3.2.2", - "it-stream-types": "^2.0.1", - "p-queue": "^7.4.1", - "private-ip": "^3.0.1", - "race-signal": "^1.0.1", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@libp2p/utils/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/@multiformats/mafmt": { - "version": "12.1.6", - "resolved": "https://registry.npmjs.org/@multiformats/mafmt/-/mafmt-12.1.6.tgz", - "integrity": "sha512-tlJRfL21X+AKn9b5i5VnaTD6bNttpSpcqwKVmDmSHLwxoz97fAHaepqFOk/l1fIu94nImIXneNbhsJx/RQNIww==", - "dependencies": { - "@multiformats/multiaddr": "^12.0.0" - } - }, - "node_modules/@multiformats/multiaddr": { - "version": "12.1.10", - "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-12.1.10.tgz", - "integrity": "sha512-Bi3nJ/SE17+te40OLxFOpr9CvRodusZZLYZb3e5a0w9RzQcHzfKnnlfqdysLXZ2W5vXgxCUL/Uhndl51Ff2S+Q==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.1", - "@chainsafe/netmask": "^2.0.0", - "@libp2p/interface": "^0.1.1", - "dns-over-http-resolver": "3.0.0", - "multiformats": "^12.0.1", - "uint8-varint": "^2.0.1", - "uint8arrays": "^4.0.2" - } - }, - "node_modules/@multiformats/multiaddr-matcher": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@multiformats/multiaddr-matcher/-/multiaddr-matcher-1.1.0.tgz", - "integrity": "sha512-B/QbKpAxaHYVXFnbTdTgYqPDxmqoF2RYffwYoOv1MWfi2vBCZLdzmEKUBKv6fQr6s+LJFSHn2j2vczmwMFCQIA==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.1", - "@multiformats/multiaddr": "^12.0.0", - "multiformats": "^12.0.1" - } - }, - "node_modules/@noble/ciphers": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.4.0.tgz", - "integrity": "sha512-xaUaUUDWbHIFSxaQ/pIe+33VG2mfJp6N/KxKLmZr5biWdNznCAmfu24QRhX10BbVAuqOahAoyp0S4M9md6GPDw==", - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/curves": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", - "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", - "dependencies": { - "@noble/hashes": "1.3.2" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/hashes": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", - "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@types/sinon": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.2.tgz", - "integrity": "sha512-Zt6heIGsdqERkxctIpvN5Pv3edgBrhoeb3yHyxffd4InN0AX2SVNKSrhdDZKGQICVOxWP/q4DyhpfPNMSrpIiA==", - "dependencies": { - "@types/sinonjs__fake-timers": "*" - } - }, - "node_modules/@types/sinonjs__fake-timers": { - "version": "8.1.5", - "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz", - "integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==" - }, - "node_modules/abortable-iterator": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/abortable-iterator/-/abortable-iterator-5.0.1.tgz", - "integrity": "sha512-hlZ5Z8UwqrKsJcelVPEqDduZowJPBQJ9ZhBC2FXpja3lXy8X6MoI5uMzIgmrA8+3jcVnp8TF/tx+IBBqYJNUrg==", - "dependencies": { - "get-iterator": "^2.0.0", - "it-stream-types": "^2.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/any-signal": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/any-signal/-/any-signal-4.1.1.tgz", - "integrity": "sha512-iADenERppdC+A2YKbOXXB2WUeABLaM6qnpZ70kZbPZ1cZMMJ7eF+3CaYm+/PhBizgkzlvssC7QuHS30oOiQYWA==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/datastore-core": { - "version": "9.2.3", - "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-9.2.3.tgz", - "integrity": "sha512-jcvrVDt+jp7lUp2WhMXXgX/hoi3VcJebN+z/ZXbIRKOVfNOF4bl8cvr7sQ1y9qITikgC2coXFYd79Wzt/n13ZQ==", - "dependencies": { - "@libp2p/logger": "^3.0.0", - "err-code": "^3.0.1", - "interface-store": "^5.0.0", - "it-all": "^3.0.1", - "it-drain": "^3.0.1", - "it-filter": "^3.0.0", - "it-map": "^3.0.1", - "it-merge": "^3.0.1", - "it-pipe": "^3.0.0", - "it-pushable": "^3.0.0", - "it-sort": "^3.0.1", - "it-take": "^3.0.1", - "uint8arrays": "^4.0.2" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/delay": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/delay/-/delay-6.0.0.tgz", - "integrity": "sha512-2NJozoOHQ4NuZuVIr5CWd0iiLVIRSDepakaovIN+9eIDHEhdCAEvSy2cuf1DCrPPQLvHmbqTHODlhHg8UCy4zw==", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/dns-over-http-resolver": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/dns-over-http-resolver/-/dns-over-http-resolver-3.0.0.tgz", - "integrity": "sha512-5+BI+B7n8LKhNaEZBYErr+CBd9t5nYtjunByLhrLGtZ+i3TRgiU8yE87pCjEBu2KOwNsD9ljpSXEbZ4S8xih5g==", - "dependencies": { - "debug": "^4.3.4", - "receptacle": "^1.3.2" - } - }, - "node_modules/err-code": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", - "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" - }, - "node_modules/eventemitter3": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" - }, - "node_modules/get-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-2.0.1.tgz", - "integrity": "sha512-7HuY/hebu4gryTDT7O/XY/fvY9wRByEGdK6QOa4of8npTcv0+NS6frFKABcf6S9EBAsveTuKTsZQQBFMMNILIg==" - }, - "node_modules/interface-datastore": { - "version": "8.2.5", - "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-8.2.5.tgz", - "integrity": "sha512-kvLGJMz3RPoJF/g5DbEvfWWempIiSBLVMf63b0PBsziVcSkj0ofzHYI86v8vqpGedkQ81DtPCUKyvX9W7zWvrQ==", - "dependencies": { - "interface-store": "^5.0.0", - "nanoid": "^4.0.0", - "uint8arrays": "^4.0.2" - } - }, - "node_modules/interface-store": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/interface-store/-/interface-store-5.1.4.tgz", - "integrity": "sha512-SI2co5IAxAybBc9egRM2bXvHOa1RPh5SQQkO6di6t/aX92RbtzP4t8raB0l3GTzQmJADaBbzz8Tfa1QLgfMdGQ==" - }, - "node_modules/ip-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-5.0.0.tgz", - "integrity": "sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ipaddr.js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz", - "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==", - "engines": { - "node": ">= 10" - } - }, - "node_modules/is-electron": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.2.2.tgz", - "integrity": "sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg==" - }, - "node_modules/is-loopback-addr": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-2.0.2.tgz", - "integrity": "sha512-26POf2KRCno/KTNL5Q0b/9TYnL00xEsSaLfiFRmjM7m7Lw7ZMmFybzzuX4CcsLAluZGd+niLUiMRxEooVE3aqg==" - }, - "node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/it-all": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-all/-/it-all-3.0.4.tgz", - "integrity": "sha512-UMiy0i9DqCHBdWvMbzdYvVGa5/w4t1cc4nchpbnjdLhklglv8mQeEYnii0gvKESJuL1zV32Cqdb33R6/GPfxpQ==" - }, - "node_modules/it-byte-stream": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/it-byte-stream/-/it-byte-stream-1.0.5.tgz", - "integrity": "sha512-wGHbXPE0ZiU0poJTgCNOW06+mh9yyCwdF8bVv0zxchgql6CMQd/2NEXXtmwWE+N65st8bi/KWUWcMU2pJU2fEw==", - "dependencies": { - "it-stream-types": "^2.0.1", - "p-defer": "^4.0.0", - "race-signal": "^1.0.1", - "uint8arraylist": "^2.4.1" - } - }, - "node_modules/it-drain": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/it-drain/-/it-drain-3.0.5.tgz", - "integrity": "sha512-qYFe4SWdvs9oJGUY5bSjvmiLUMLzFEODNOQUdYdCIkuIgQF+AUB2INhM4yQ09buJ2rhHKDFxvTD/+yUq6qg0XA==" - }, - "node_modules/it-filter": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-filter/-/it-filter-3.0.4.tgz", - "integrity": "sha512-e0sz+st4sudK/zH6GZ/gRTRP8A/ADuJFCYDmRgMbZvR79y5+v4ZXav850bBZk5wL9zXaYZFxS1v/6Qi+Vjwh5g==", - "dependencies": { - "it-peekable": "^3.0.0" - } - }, - "node_modules/it-first": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-first/-/it-first-3.0.4.tgz", - "integrity": "sha512-FtQl84iTNxN5EItP/JgL28V2rzNMkCzTUlNoj41eVdfix2z1DBuLnBqZ0hzYhGGa1rMpbQf0M7CQSA2adlrLJg==" - }, - "node_modules/it-foreach": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/it-foreach/-/it-foreach-2.0.6.tgz", - "integrity": "sha512-OVosBHJsdXpAyeFlCbe3IGZia+65UykyAznakNsKXK+b99dbhuu/mOnXxTadDEo1GWhKx+WA8RNanKkMf07zQw==", - "dependencies": { - "it-peekable": "^3.0.0" - } - }, - "node_modules/it-length-prefixed": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-9.0.3.tgz", - "integrity": "sha512-YAu424ceYpXctxtjcLOqn7vJq082CaoP8J646ZusYISfQc3bpzQErgTUqMFj81V262KG2W9/YMBHsy6A/4yvmg==", - "dependencies": { - "err-code": "^3.0.1", - "it-reader": "^6.0.1", - "it-stream-types": "^2.0.1", - "uint8-varint": "^2.0.1", - "uint8arraylist": "^2.0.0", - "uint8arrays": "^4.0.2" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-length-prefixed-stream": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/it-length-prefixed-stream/-/it-length-prefixed-stream-1.1.4.tgz", - "integrity": "sha512-6YcQ5jsaYnuXBqF+oSGjSdSY9jF7HWl7yh+dxYytXxbE2GcdiOpn6pLM7m6AlIID9MCzQqMY5nOzaiatQ8A3/A==", - "dependencies": { - "it-byte-stream": "^1.0.0", - "it-length-prefixed": "^9.0.1", - "it-stream-types": "^2.0.1", - "uint8-varint": "^2.0.1", - "uint8arraylist": "^2.4.1" - } - }, - "node_modules/it-map": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/it-map/-/it-map-3.0.5.tgz", - "integrity": "sha512-hB0TDXo/h4KSJJDSRLgAPmDroiXP6Fx1ck4Bzl3US9hHfZweTKsuiP0y4gXuTMcJlS6vj0bb+f70rhkD47ZA3w==", - "dependencies": { - "it-peekable": "^3.0.0" - } - }, - "node_modules/it-merge": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/it-merge/-/it-merge-3.0.3.tgz", - "integrity": "sha512-FYVU15KC5pb/GQX1Ims+lee8d4pdqGVCpWr0lkNj8o4xuNo7jY71k6GuEiWdP+T7W1bJqewSxX5yoTy5yZpRVA==", - "dependencies": { - "it-pushable": "^3.2.0" - } - }, - "node_modules/it-pair": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/it-pair/-/it-pair-2.0.6.tgz", - "integrity": "sha512-5M0t5RAcYEQYNG5BV7d7cqbdwbCAp5yLdzvkxsZmkuZsLbTdZzah6MQySYfaAQjNDCq6PUnDt0hqBZ4NwMfW6g==", - "dependencies": { - "it-stream-types": "^2.0.1", - "p-defer": "^4.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-peekable": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/it-peekable/-/it-peekable-3.0.3.tgz", - "integrity": "sha512-Wx21JX/rMzTEl9flx3DGHuPV1KQFGOl8uoKfQtmZHgPQtGb89eQ6RyVd82h3HuP9Ghpt0WgBDlmmdWeHXqyx7w==" - }, - "node_modules/it-pipe": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/it-pipe/-/it-pipe-3.0.1.tgz", - "integrity": "sha512-sIoNrQl1qSRg2seYSBH/3QxWhJFn9PKYvOf/bHdtCBF0bnghey44VyASsWzn5dAx0DCDDABq1hZIuzKmtBZmKA==", - "dependencies": { - "it-merge": "^3.0.0", - "it-pushable": "^3.1.2", - "it-stream-types": "^2.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-pushable": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-3.2.3.tgz", - "integrity": "sha512-gzYnXYK8Y5t5b/BnJUr7glfQLO4U5vyb05gPx/TyTw+4Bv1zM9gFk4YsOrnulWefMewlphCjKkakFvj1y99Tcg==", - "dependencies": { - "p-defer": "^4.0.0" - } - }, - "node_modules/it-reader": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/it-reader/-/it-reader-6.0.4.tgz", - "integrity": "sha512-XCWifEcNFFjjBHtor4Sfaj8rcpt+FkY0L6WdhD578SCDhV4VUm7fCkF3dv5a+fTcfQqvN9BsxBTvWbYO6iCjTg==", - "dependencies": { - "it-stream-types": "^2.0.1", - "uint8arraylist": "^2.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-sort": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-sort/-/it-sort-3.0.4.tgz", - "integrity": "sha512-tvnC93JZZWjX4UxALy0asow0dzXabkoaRbrPJKClTKhNCqw4gzHr+H5axf1gohcthedRRkqd/ae+wl7WqoxFhw==", - "dependencies": { - "it-all": "^3.0.0" - } - }, - "node_modules/it-stream-types": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/it-stream-types/-/it-stream-types-2.0.1.tgz", - "integrity": "sha512-6DmOs5r7ERDbvS4q8yLKENcj6Yecr7QQTqWApbZdfAUTEC947d+PEha7PCqhm//9oxaLYL7TWRekwhoXl2s6fg==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/it-take": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/it-take/-/it-take-3.0.4.tgz", - "integrity": "sha512-RG8HDjAZlvkzz5Nav4xq6gK5zNT+Ff1UTIf+CrSJW8nIl6N1FpBH5e7clUshiCn+MmmMoSdIEpw4UaTolszxhA==" - }, - "node_modules/libp2p": { - "version": "0.46.21-0b4a2ee79", - "resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.46.21-0b4a2ee79.tgz", - "integrity": "sha512-WLThU38PZfc2nYzKCZdVgsuWALtkWavwSXQy4pNhSf8fAzbRTjRdY1EqR/O3G2tI6CybdHVj1dCxMnvvM/YXuA==", - "dependencies": { - "@libp2p/crypto": "2.0.8-0b4a2ee79", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/interface-internal": "0.1.9-0b4a2ee79", - "@libp2p/logger": "3.1.0-0b4a2ee79", - "@libp2p/multistream-select": "4.0.6-0b4a2ee79", - "@libp2p/peer-collections": "4.0.8-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "@libp2p/peer-id-factory": "3.0.8-0b4a2ee79", - "@libp2p/peer-store": "9.0.9-0b4a2ee79", - "@libp2p/utils": "4.0.7-0b4a2ee79", - "@multiformats/mafmt": "^12.1.6", - "@multiformats/multiaddr": "^12.1.10", - "@multiformats/multiaddr-matcher": "^1.1.0", - "any-signal": "^4.1.1", - "datastore-core": "^9.0.1", - "delay": "^6.0.0", - "interface-datastore": "^8.2.0", - "it-all": "^3.0.2", - "it-drain": "^3.0.2", - "it-filter": "^3.0.1", - "it-first": "^3.0.3", - "it-map": "^3.0.4", - "it-merge": "^3.0.0", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "merge-options": "^3.0.4", - "multiformats": "^12.1.3", - "p-defer": "^4.0.0", - "p-queue": "^7.4.1", - "private-ip": "^3.0.1", - "rate-limiter-flexible": "^3.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/libp2p/node_modules/@libp2p/crypto": { - "version": "2.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8-0b4a2ee79.tgz", - "integrity": "sha512-k6elAUnxMquhQYpCnlLmuU8NpfVU12XU0hFELsgC4TqKkC1PO7EuagngbjHilzyo1wpSAfaYGjAIjlQfjB50iw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.1.3", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/libp2p/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/libp2p/node_modules/@libp2p/logger": { - "version": "3.1.0-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-3.1.0-0b4a2ee79.tgz", - "integrity": "sha512-haeXJplYP29dYTkwLlGI/dc7nQuRTbRte7GeMcNwrmCeODM3uo3D0O7+qS6RulmRDbvWqs3muCxZyRFSU4oB+A==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "debug": "^4.3.4", - "interface-datastore": "^8.2.0", - "multiformats": "^12.1.3" - } - }, - "node_modules/libp2p/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/merge-options": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", - "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", - "dependencies": { - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mortice": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mortice/-/mortice-3.0.1.tgz", - "integrity": "sha512-eyDUsl1nCR9+JtNksKnaESLP9MgAXCA4w1LTtsmOSQNsThnv++f36rrBu5fC/fdGIwTJZmbiaR/QewptH93pYA==", - "dependencies": { - "nanoid": "^4.0.0", - "observable-webworkers": "^2.0.1", - "p-queue": "^7.2.0", - "p-timeout": "^6.0.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/multiformats": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.3.tgz", - "integrity": "sha512-eajQ/ZH7qXZQR2AgtfpmSMizQzmyYVmCql7pdhldPuYQi4atACekbJaQplk6dWyIi10jCaFnd6pqvcEFXjbaJw==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/nanoid": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.2.tgz", - "integrity": "sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.js" - }, - "engines": { - "node": "^14 || ^16 || >=18" - } - }, - "node_modules/netmask": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", - "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/node-forge": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", - "engines": { - "node": ">= 6.13.0" - } - }, - "node_modules/observable-webworkers": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/observable-webworkers/-/observable-webworkers-2.0.1.tgz", - "integrity": "sha512-JI1vB0u3pZjoQKOK1ROWzp0ygxSi7Yb0iR+7UNsw4/Zn4cQ0P3R7XL38zac/Dy2tEA7Lg88/wIJTjF8vYXZ0uw==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/p-defer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-4.0.0.tgz", - "integrity": "sha512-Vb3QRvQ0Y5XnF40ZUWW7JfLogicVh/EnA5gBIvKDJoYpeI82+1E3AlB9yOcKFS0AhHrWVnAQO39fbR0G99IVEQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-queue": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.4.1.tgz", - "integrity": "sha512-vRpMXmIkYF2/1hLBKisKeVYJZ8S2tZ0zEAmIJgdVKP2nq0nh4qCdf8bgw+ZgKrkh71AOCaqzwbJJk1WtdcF3VA==", - "dependencies": { - "eventemitter3": "^5.0.1", - "p-timeout": "^5.0.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-queue/node_modules/p-timeout": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", - "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-timeout": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", - "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/private-ip": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/private-ip/-/private-ip-3.0.1.tgz", - "integrity": "sha512-Ezc16ANuhSHmWAE6lbXUKburNzGpR0J5X0Zh5Um/PZ/s57Fp+HYqYe6BYPH2QbqKr/5WebfzJQ1jq6Kj5dbRmA==", - "dependencies": { - "@chainsafe/is-ip": "^2.0.1", - "ip-regex": "^5.0.0", - "ipaddr.js": "^2.1.0", - "netmask": "^2.0.2" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/protons-runtime": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-5.2.0.tgz", - "integrity": "sha512-jL3VSbXllgm17zurKQ/z+Ath0w+4BknJ+l/NLocfjAB8hbeASOZTNtb7zK3nDsKq2pHK9YFumNQvpkZ6gFfWhA==", - "dependencies": { - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/race-signal": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/race-signal/-/race-signal-1.0.2.tgz", - "integrity": "sha512-o3xNv0iTcIDQCXFlF6fPAMEBRjFxssgGoRqLbg06m+AdzEXXLUmoNOoUHTVz2NoBI8hHwKFKoC6IqyNtWr2bww==" - }, - "node_modules/rate-limiter-flexible": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/rate-limiter-flexible/-/rate-limiter-flexible-3.0.4.tgz", - "integrity": "sha512-LFrdT9Pl/TRxG143frHBPyESXHvS2tstLfAUM6shBbJ3M6YssT2cIUWFwAWVAU9Vl4Z2gUN7ZE7tSdQh/0aqcA==" - }, - "node_modules/receptacle": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/receptacle/-/receptacle-1.3.2.tgz", - "integrity": "sha512-HrsFvqZZheusncQRiEE7GatOAETrARKV/lnfYicIm8lbvp/JQOdADOfhjBd2DajvoszEyxSM6RlAAIZgEoeu/A==", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/stream-to-it": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/stream-to-it/-/stream-to-it-0.2.4.tgz", - "integrity": "sha512-4vEbkSs83OahpmBybNJXlJd7d6/RxzkkSdT3I0mnGt79Xd2Kk+e1JqbvAvsQfCeKj3aKb0QIWkyK3/n0j506vQ==", - "dependencies": { - "get-iterator": "^1.0.2" - } - }, - "node_modules/stream-to-it/node_modules/get-iterator": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-1.0.2.tgz", - "integrity": "sha512-v+dm9bNVfOYsY1OrhaCrmyOcYoSeVvbt+hHZ0Au+T+p1y+0Uyj9aMaGIeUTT6xdpRbWzDeYKvfOslPhggQMcsg==" - }, - "node_modules/uint8-varint": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/uint8-varint/-/uint8-varint-2.0.2.tgz", - "integrity": "sha512-LZXmBT0jiHR7J4oKM1GUhtdLFW1yPauzI8NjJlotXn92TprO9u8VMvEVR4QMk8xhUVUd+2fqfU2/kGbVHYSSWw==", - "dependencies": { - "uint8arraylist": "^2.0.0", - "uint8arrays": "^4.0.2" - } - }, - "node_modules/uint8arraylist": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-2.4.3.tgz", - "integrity": "sha512-oEVZr4/GrH87K0kjNce6z8pSCzLEPqHNLNR5sj8cJOySrTP8Vb/pMIbZKLJGhQKxm1TiZ31atNrpn820Pyqpow==", - "dependencies": { - "uint8arrays": "^4.0.2" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/uint8arrays": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.6.tgz", - "integrity": "sha512-4ZesjQhqOU2Ip6GPReIwN60wRxIupavL8T0Iy36BBHr2qyMrNxsPJvr7vpS4eFt8F8kSguWUPad6ZM9izs/vyw==", - "dependencies": { - "multiformats": "^12.0.1" - } - }, - "node_modules/wherearewe": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/wherearewe/-/wherearewe-2.0.1.tgz", - "integrity": "sha512-XUguZbDxCA2wBn2LoFtcEhXL6AXo+hVjGonwhSTTTU9SzbWG8Xu3onNIpzf9j/mYUcJQ0f+m37SzG77G851uFw==", - "dependencies": { - "is-electron": "^2.2.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - } - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/package.json deleted file mode 100644 index dc78f0d62..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "@libp2p/perf-js-libp2p-1-0", - "private": true, - "main": "index.js", - "type": "module", - "dependencies": { - "@chainsafe/libp2p-noise": "^13.0.3", - "@chainsafe/libp2p-yamux": "^5.0.3", - "@libp2p/perf": "next", - "@libp2p/tcp": "next", - "libp2p": "next" - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/perf b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/perf deleted file mode 100755 index 1a3e19c51..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/perf +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# In case this script is `kill`ed, `kill` its child process, namely the `node` -# process below. -cleanup() { - kill $node_pid -} -trap cleanup EXIT TERM - -# Find the path to the Node.js executable -node_path=$(which node) - -run_server=false -server_address="" -upload_bytes=0 -download_bytes=0 -transport="" - -# Parse named parameters manually -for ((i = 1; i <= $#; i++)); do - if [ "${!i}" == "--server-address" ]; then - server_address="${@:i+1:1}" - fi - if [ "${!i}" == "--upload-bytes" ]; then - upload_bytes="${@:i+1:1}" - fi - if [ "${!i}" == "--download-bytes" ]; then - download_bytes="${@:i+1:1}" - fi - if [ "${!i}" == "--transport" ]; then - transport="${@:i+1:1}" - fi - if [ "${!i}" == "--run-server" ]; then - run_server=true - fi -done - -# Run perf -node $(dirname "$0")/index.js --run-server=$run_server --server-address=$server_address --upload-bytes=$upload_bytes --download-bytes=$download_bytes --transport=$transport & - -node_pid=$! - -# Wait for `node_pid` to finish, or for it to be `kill`ed by the above -# `cleanup`. -wait $node_pid diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/index.min.js deleted file mode 100644 index 4e7453106..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/index.min.js +++ /dev/null @@ -1,3 +0,0 @@ -(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PTcp = factory()}(typeof self !== 'undefined' ? self : this, function () { -"use strict";var Libp2PTcp=(()=>{var Or=Object.create;var bt=Object.defineProperty;var Lr=Object.getOwnPropertyDescriptor;var Vr=Object.getOwnPropertyNames;var Fr=Object.getPrototypeOf,$r=Object.prototype.hasOwnProperty;var Y=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var Z=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),R=(r,t)=>{for(var e in t)bt(r,e,{get:t[e],enumerable:!0})},Ne=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vr(t))!$r.call(r,o)&&o!==e&&bt(r,o,{get:()=>t[o],enumerable:!(n=Lr(t,o))||n.enumerable});return r};var tt=(r,t,e)=>(e=r!=null?Or(Fr(r)):{},Ne(t||!r||!r.__esModule?bt(e,"default",{value:r,enumerable:!0}):e,r)),zr=r=>Ne(bt({},"__esModule",{value:!0}),r);var Dt=Z((Sc,Ir)=>{Ir.exports=r=>{if(r[Symbol.asyncIterator])return r;if(r.getReader)return async function*(){let t=r.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)return;yield n}}finally{t.releaseLock()}}();throw new Error("unknown stream")}});var Sr=Z((Tc,Cr)=>{Cr.exports=function(t){if(t){if(typeof t[Symbol.iterator]=="function")return t[Symbol.iterator]();if(typeof t[Symbol.asyncIterator]=="function")return t[Symbol.asyncIterator]();if(typeof t.next=="function")return t}throw new Error("argument is not an iterator or iterable")}});var Ae=Z((Pc,Tr)=>{var Mo=Sr();Tr.exports=r=>async t=>{t=Mo(t);let e=w=>{typeof w.return=="function"&&w.return()},n=null,o=null,s=w=>{n=w,o&&o(w),e(t)},i=null,a=!1,p=()=>{a=!0,i&&i()},f=null,m=!1,v=()=>{m=!0,f&&f()},x=null,u=()=>{x&&x()},d=()=>new Promise((w,S)=>{i=x=w,o=S,r.once("drain",u)}),E=()=>(e(t),new Promise((w,S)=>{if(a||m||n)return w();f=i=w,o=S})),N=()=>{r.removeListener("error",s),r.removeListener("close",p),r.removeListener("finish",v),r.removeListener("drain",u)};r.once("error",s),r.once("close",p),r.once("finish",v);try{for await(let w of t){if(!r.writable||r.destroyed||n)break;r.write(w)===!1&&await d()}}catch(w){n||r.destroy(),n=w}try{if(r.writable&&r.end(),await E(),n)throw n}finally{N()}}});var Ie=Z((Rc,Pr)=>{var Uo=Ae(),_o=Dt();Pr.exports=r=>({sink:Uo(r),source:_o(r)})});var Nr=Z((Nc,Rr)=>{var ko=Ie();Rr.exports=r=>async function*(t){let e=ko(r),n;if(e.sink(t).catch(o=>{n=o}),yield*e.source,n)throw n}});var Dr=Z((Dc,pt)=>{pt.exports=Dt();pt.exports.source=Dt();pt.exports.sink=Ae();pt.exports.transform=Nr();pt.exports.duplex=Ie()});var Go={};R(Go,{tcp:()=>jo});var kr=tt(Y("net"),1);var et=class r extends Error{code;type;constructor(t="The operation was aborted"){super(t),this.code=r.code,this.type=r.type}static code="ABORT_ERR";static type="aborted"},I=class extends Error{code;props;constructor(t,e,n){super(t),this.code=e,this.name=n?.name??"CodeError",this.props=n??{}}};var Me=Symbol.for("@libp2p/transport");var De;(function(r){r[r.FATAL_ALL=0]="FATAL_ALL",r[r.NO_FATAL=1]="NO_FATAL"})(De||(De={}));var Vt={};R(Vt,{base58btc:()=>T,base58flickr:()=>Xr});function Br(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n>>0,D=new Uint8Array(k);w!==S;){for(var O=d[w],B=0,_=k-1;(O!==0||B>>0,D[_]=O%a>>>0,O=O/a>>>0;if(O!==0)throw new Error("Non-zero carry");N=B,w++}for(var V=k-N;V!==k&&D[V]===0;)V++;for(var xt=p.repeat(E);V>>0,k=new Uint8Array(S);d[E];){var D=e[d.charCodeAt(E)];if(D===255)return;for(var O=0,B=S-1;(D!==0||O>>0,k[B]=D%256>>>0,D=D/256>>>0;if(D!==0)throw new Error("Non-zero carry");w=O,E++}if(d[E]!==" "){for(var _=S-w;_!==S&&k[_]===0;)_++;for(var V=new Uint8Array(N+(S-_)),xt=N;_!==S;)V[xt++]=k[_++];return V}}}function u(d){var E=x(d);if(E)return E;throw new Error(`Non-${t} character`)}return{encode:v,decodeUnsafe:x,decode:u}}var qr=Br,jr=qr,Ue=jr;var Qo=new Uint8Array(0);var _e=(r,t)=>{if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var ke=r=>new TextEncoder().encode(r),Oe=r=>new TextDecoder().decode(r);var _t=class{constructor(t,e,n){this.name=t,this.prefix=e,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},kt=class{constructor(t,e,n){if(this.name=t,this.prefix=e,e.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Ve(this,t)}},Ot=class{constructor(t){this.decoders=t}or(t){return Ve(this,t)}decode(t){let e=t[0],n=this.decoders[e];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Ve=(r,t)=>new Ot({...r.decoders||{[r.prefix]:r},...t.decoders||{[t.prefix]:t}}),Lt=class{constructor(t,e,n,o){this.name=t,this.prefix=e,this.baseEncode=n,this.baseDecode=o,this.encoder=new _t(t,e,n),this.decoder=new kt(t,e,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},rt=({name:r,prefix:t,encode:e,decode:n})=>new Lt(r,t,e,n),q=({prefix:r,name:t,alphabet:e})=>{let{encode:n,decode:o}=Ue(e,t);return rt({prefix:r,name:t,encode:n,decode:s=>M(o(s))})},Gr=(r,t,e,n)=>{let o={};for(let m=0;m=8&&(a-=8,i[f++]=255&p>>a)}if(a>=e||255&p<<8-a)throw new SyntaxError("Unexpected end of data");return i},Wr=(r,t,e)=>{let n=t[t.length-1]==="=",o=(1<e;)i-=e,s+=t[o&a>>i];if(i&&(s+=t[o&a<rt({prefix:t,name:r,encode(o){return Wr(o,n,e)},decode(o){return Gr(o,n,e,r)}});var T=q({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Xr=q({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Ft={};R(Ft,{base32:()=>F,base32hex:()=>Kr,base32hexpad:()=>Zr,base32hexpadupper:()=>tn,base32hexupper:()=>Yr,base32pad:()=>Jr,base32padupper:()=>Qr,base32upper:()=>Hr,base32z:()=>en});var F=b({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Hr=b({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Jr=b({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Qr=b({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Kr=b({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Yr=b({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Zr=b({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),tn=b({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),en=b({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var rn=ze,Fe=128,nn=127,on=~nn,sn=Math.pow(2,31);function ze(r,t,e){t=t||[],e=e||0;for(var n=e;r>=sn;)t[e++]=r&255|Fe,r/=128;for(;r&on;)t[e++]=r&255|Fe,r>>>=7;return t[e]=r|0,ze.bytes=e-n+1,t}var cn=$t,an=128,$e=127;function $t(r,n){var e=0,n=n||0,o=0,s=n,i,a=r.length;do{if(s>=a)throw $t.bytes=0,new RangeError("Could not decode varint");i=r[s++],e+=o<28?(i&$e)<=an);return $t.bytes=s-n,e}var ln=Math.pow(2,7),dn=Math.pow(2,14),un=Math.pow(2,21),pn=Math.pow(2,28),fn=Math.pow(2,35),hn=Math.pow(2,42),mn=Math.pow(2,49),gn=Math.pow(2,56),wn=Math.pow(2,63),xn=function(r){return r[ht.decode(r,t),ht.decode.bytes],nt=(r,t,e=0)=>(ht.encode(r,t,e),t),ot=r=>ht.encodingLength(r);var X=(r,t)=>{let e=t.byteLength,n=ot(r),o=n+ot(e),s=new Uint8Array(o+e);return nt(r,s,0),nt(e,s,n),s.set(t,o),new st(r,e,t,s)},vt=r=>{let t=M(r),[e,n]=mt(t),[o,s]=mt(t.subarray(n)),i=t.subarray(n+s);if(i.byteLength!==o)throw new Error("Incorrect length");return new st(e,o,i,t)},Be=(r,t)=>{if(r===t)return!0;{let e=t;return r.code===e.code&&r.size===e.size&&e.bytes instanceof Uint8Array&&_e(r.bytes,e.bytes)}},st=class{constructor(t,e,n,o){this.code=t,this.size=e,this.digest=n,this.bytes=o}};var qe=(r,t)=>{let{bytes:e,version:n}=r;switch(n){case 0:return En(e,zt(r),t||T.encoder);default:return An(e,zt(r),t||F.encoder)}};var je=new WeakMap,zt=r=>{let t=je.get(r);if(t==null){let e=new Map;return je.set(r,e),e}return t},j=class r{constructor(t,e,n,o){this.code=e,this.version=t,this.multihash=n,this.bytes=o,this["/"]=o}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:e}=this;if(t!==gt)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==In)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(e)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:e}=this.multihash,n=X(t,e);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return r.equals(this,t)}static equals(t,e){let n=e;return n&&t.code===n.code&&t.version===n.version&&Be(t.multihash,n.multihash)}toString(t){return qe(this,t)}toJSON(){return{"/":qe(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let e=t;if(e instanceof r)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){let{version:n,code:o,multihash:s,bytes:i}=e;return new r(n,o,s,i||Ge(n,o,s.bytes))}else if(e[Cn]===!0){let{version:n,multihash:o,code:s}=e,i=vt(o);return r.create(n,s,i)}else return null}static create(t,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(e!==gt)throw new Error(`Version 0 CID must use dag-pb (code: ${gt}) block encoding`);return new r(t,e,n,n.bytes)}case 1:{let o=Ge(t,e,n.bytes);return new r(t,e,n,o)}default:throw new Error("Invalid version")}}static createV0(t){return r.create(0,gt,t)}static createV1(t,e){return r.create(1,t,e)}static decode(t){let[e,n]=r.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return e}static decodeFirst(t){let e=r.inspectBytes(t),n=e.size-e.multihashSize,o=M(t.subarray(n,n+e.multihashSize));if(o.byteLength!==e.multihashSize)throw new Error("Incorrect length");let s=o.subarray(e.multihashSize-e.digestSize),i=new st(e.multihashCode,e.digestSize,s,o);return[e.version===0?r.createV0(i):r.createV1(e.codec,i),t.subarray(e.size)]}static inspectBytes(t){let e=0,n=()=>{let[v,x]=mt(t.subarray(e));return e+=x,v},o=n(),s=gt;if(o===18?(o=0,e=0):s=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let i=e,a=n(),p=n(),f=e+p,m=f-i;return{version:o,codec:s,multihashCode:a,digestSize:p,multihashSize:m,size:f}}static parse(t,e){let[n,o]=vn(t,e),s=r.decode(o);if(s.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return zt(s).set(n,t),s}},vn=(r,t)=>{switch(r[0]){case"Q":{let e=t||T;return[T.prefix,e.decode(`${T.prefix}${r}`)]}case T.prefix:{let e=t||T;return[T.prefix,e.decode(r)]}case F.prefix:{let e=t||F;return[F.prefix,e.decode(r)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],t.decode(r)]}}},En=(r,t,e)=>{let{prefix:n}=e;if(n!==T.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let o=t.get(n);if(o==null){let s=e.encode(r).slice(1);return t.set(n,s),s}else return o},An=(r,t,e)=>{let{prefix:n}=e,o=t.get(n);if(o==null){let s=e.encode(r);return t.set(n,s),s}else return o},gt=112,In=18,Ge=(r,t,e)=>{let n=ot(r),o=n+ot(t),s=new Uint8Array(o+e.byteLength);return nt(r,s,0),nt(t,s,n),s.set(e,o),s},Cn=Symbol.for("@ipld/js-cid/CID");function We(r,t){if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;eSn});var Sn=q({prefix:"9",name:"base10",alphabet:"0123456789"});var qt={};R(qt,{base16:()=>Tn,base16upper:()=>Pn});var Tn=b({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Pn=b({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var jt={};R(jt,{base2:()=>Rn});var Rn=b({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Gt={};R(Gt,{base256emoji:()=>_n});var Xe=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Nn=Xe.reduce((r,t,e)=>(r[e]=t,r),[]),Dn=Xe.reduce((r,t,e)=>(r[t.codePointAt(0)]=e,r),[]);function Mn(r){return r.reduce((t,e)=>(t+=Nn[e],t),"")}function Un(r){let t=[];for(let e of r){let n=Dn[e.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${e}`);t.push(n)}return new Uint8Array(t)}var _n=rt({prefix:"\u{1F680}",name:"base256emoji",encode:Mn,decode:Un});var Wt={};R(Wt,{base36:()=>kn,base36upper:()=>On});var kn=q({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),On=q({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Xt={};R(Xt,{base64:()=>Ln,base64pad:()=>Vn,base64url:()=>Fn,base64urlpad:()=>$n});var Ln=b({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Vn=b({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Fn=b({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),$n=b({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Ht={};R(Ht,{base8:()=>zn});var zn=b({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Jt={};R(Jt,{identity:()=>Bn});var Bn=rt({prefix:"\0",name:"identity",encode:r=>Oe(r),decode:r=>ke(r)});var ys=new TextEncoder,vs=new TextDecoder;var Qt={};R(Qt,{identity:()=>Xn});var He=0,Gn="identity",Je=M,Wn=r=>X(He,Je(r)),Xn={code:He,name:Gn,encode:Je,digest:Wn};var te={};R(te,{sha256:()=>Hn,sha512:()=>Jn});var Zt=tt(Y("crypto"),1);var Yt=({name:r,code:t,encode:e})=>new Kt(r,t,e),Kt=class{constructor(t,e,n){this.name=t,this.code=e,this.encode=n}digest(t){if(t instanceof Uint8Array){let e=this.encode(t);return e instanceof Uint8Array?X(this.code,e):e.then(n=>X(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Hn=Yt({name:"sha2-256",code:18,encode:r=>M(Zt.default.createHash("sha256").update(r).digest())}),Jn=Yt({name:"sha2-512",code:19,encode:r=>M(Zt.default.createHash("sha512").update(r).digest())});var wt={...Jt,...jt,...Ht,...Bt,...qt,...Ft,...Wt,...Vt,...Xt,...Gt},Ns={...te,...Qt};function ct(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function at(r=0){return globalThis.Buffer?.allocUnsafe!=null?ct(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function Ye(r,t,e,n){return{name:r,prefix:t,encoder:{name:r,prefix:t,encode:e},decoder:{decode:n}}}var Ke=Ye("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),ee=Ye("ascii","a",r=>{let t="a";for(let e=0;e{r=r.substring(1);let t=at(r.length);for(let e=0;eNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function to(r,t,e=0){switch(L(r)){case 8:t[e++]=r&255|h,r/=128;case 7:t[e++]=r&255|h,r/=128;case 6:t[e++]=r&255|h,r/=128;case 5:t[e++]=r&255|h,r/=128;case 4:t[e++]=r&255|h,r>>>=7;case 3:t[e++]=r&255|h,r>>>=7;case 2:t[e++]=r&255|h,r>>>=7;case 1:{t[e++]=r&255,r>>>=7;break}default:throw new Error("unreachable")}return t}function eo(r,t,e=0){switch(L(r)){case 8:t.set(e++,r&255|h),r/=128;case 7:t.set(e++,r&255|h),r/=128;case 6:t.set(e++,r&255|h),r/=128;case 5:t.set(e++,r&255|h),r/=128;case 4:t.set(e++,r&255|h),r>>>=7;case 3:t.set(e++,r&255|h),r>>>=7;case 2:t.set(e++,r&255|h),r>>>=7;case 1:{t.set(e++,r&255),r>>>=7;break}default:throw new Error("unreachable")}return t}function ro(r,t){let e=r[t],n=0;if(n+=e&C,eo+s.length,0));let e=at(t),n=0;for(let o of r)e.set(o,n),n+=o.length;return ct(e)}var At=class{index=0;input="";new(t){return this.index=0,this.input=t,this}readAtomically(t){let e=this.index,n=t();return n===void 0&&(this.index=e),n}parseWith(t){let e=t();if(this.index===this.input.length)return e}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(t){return this.readAtomically(()=>{let e=this.readChar();if(e===t)return e})}readSeparator(t,e,n){return this.readAtomically(()=>{if(!(e>0&&this.readGivenChar(t)===void 0))return n()})}readNumber(t,e,n,o){return this.readAtomically(()=>{let s=0,i=0,a=this.peekChar();if(a===void 0)return;let p=a==="0",f=2**(8*o)-1;for(;;){let m=this.readAtomically(()=>{let v=this.readChar();if(v===void 0)return;let x=Number.parseInt(v,t);if(!Number.isNaN(x))return x});if(m===void 0)break;if(s*=t,s+=m,s>f||(i+=1,e!==void 0&&i>e))return}if(i!==0)return!n&&p&&i>1?void 0:s})}readIPv4Addr(){return this.readAtomically(()=>{let t=new Uint8Array(4);for(let e=0;ethis.readNumber(10,3,!1,1));if(n===void 0)return;t[e]=n}return t})}readIPv6Addr(){let t=e=>{for(let n=0;nthis.readIPv4Addr());if(i!==void 0)return e[o]=i[0],e[o+1]=i[1],e[o+2]=i[2],e[o+3]=i[3],[o+4,!0]}let s=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(s===void 0)return[o,!1];e[o]=s>>8,e[o+1]=s&255}return[e.length,!1]};return this.readAtomically(()=>{let e=new Uint8Array(16),[n,o]=t(e);if(n===16)return e;if(o||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let s=new Uint8Array(14),i=16-(n+2),[a]=t(s.subarray(0,i));return e.set(s.subarray(0,a),16-a),e})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var Ws=new At;var ti=parseInt("0xFFFF",16),ei=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function ie(r,t="utf8"){let e=Et[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?ct(globalThis.Buffer.from(r,"utf-8")):e.decoder.decode(`${e.prefix}${r}`)}var U=Y("node:net");function It(r){return!!(0,U.isIP)(r)}var rr=U.isIPv4,lo=U.isIPv6,ce=function(r){let t=0;if(r=r.toString().trim(),rr(r)){let e=new Uint8Array(t+4);return r.split(/\./g).forEach(n=>{e[t++]=parseInt(n,10)&255}),e}if(lo(r)){let e=r.split(":",8),n;for(n=0;n0;n--)s.push("0");e.splice.apply(e,s)}let o=new Uint8Array(t+16);for(n=0;n>8&255,o[t++]=s&255}return o}throw new Error("invalid ip address")},nr=function(r,t=0,e){t=~~t,e=e??r.length-t;let n=new DataView(r.buffer);if(e===4){let o=[];for(let s=0;s{let t=fo(...r);ae[t.code]=t,dt[t.name]=t});function fo(r,t,e,n,o){return{code:r,size:t,name:e,resolvable:!!n,path:!!o}}function g(r){if(typeof r=="number"){if(ae[r]!=null)return ae[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(dt[r]!=null)return dt[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var Bi=g("ip4"),qi=g("ip6"),ji=g("ipcidr");function de(r,t){switch(g(r).code){case 4:case 41:return mo(t);case 42:return ir(t);case 6:case 273:case 33:case 132:return ar(t).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return ir(t);case 421:return bo(t);case 444:return cr(t);case 445:return cr(t);case 466:return xo(t);default:return P(t,"base16")}}function ue(r,t){switch(g(r).code){case 4:return or(t);case 41:return or(t);case 42:return sr(t);case 6:case 273:case 33:case 132:return pe(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return sr(t);case 421:return go(t);case 444:return yo(t);case 445:return vo(t);case 466:return wo(t);default:return ie(t,"base16")}}var le=Object.values(wt).map(r=>r.decoder),ho=function(){let r=le[0].or(le[1]);return le.slice(2).forEach(t=>r=r.or(t)),r}();function or(r){if(!It(r))throw new Error("invalid ip address");return ce(r)}function mo(r){let t=nr(r,0,r.length);if(t==null)throw new Error("ipBuff is required");if(!It(t))throw new Error("invalid ip address");return t}function pe(r){let t=new ArrayBuffer(2);return new DataView(t).setUint16(0,r),new Uint8Array(t)}function ar(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function sr(r){let t=ie(r),e=Uint8Array.from(lt(t.length));return $([e,t],e.length+t.length)}function ir(r){let t=H(r);if(r=r.slice(L(t)),r.length!==t)throw new Error("inconsistent lengths");return P(r)}function go(r){let t;r[0]==="Q"||r[0]==="1"?t=vt(T.decode(`z${r}`)).bytes:t=j.parse(r).multihash.bytes;let e=Uint8Array.from(lt(t.length));return $([e,t],e.length+t.length)}function wo(r){let t=ho.decode(r),e=Uint8Array.from(lt(t.length));return $([e,t],e.length+t.length)}function xo(r){let t=H(r),e=r.slice(L(t));if(e.length!==t)throw new Error("inconsistent lengths");return"u"+P(e,"base64url")}function bo(r){let t=H(r),e=r.slice(L(t));if(e.length!==t)throw new Error("inconsistent lengths");return P(e,"base58btc")}function yo(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==16)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion address.`);let e=F.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let o=pe(n);return $([e,o],e.length+o.length)}function vo(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==56)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion3 address.`);let e=F.decode(`b${t[0]}`),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let o=pe(n);return $([e,o],e.length+o.length)}function cr(r){let t=r.slice(0,r.length-2),e=r.slice(r.length-2),n=P(t,"base32"),o=ar(e);return`${n}:${o}`}function lr(r){r=fe(r);let t=[],e=[],n=null,o=r.split("/").slice(1);if(o.length===1&&o[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let s=0;s=o.length)throw ur("invalid address: "+r);if(a.path===!0){n=fe(o.slice(s).join("/")),t.push([a.code,ue(a.code,n)]),e.push([a.code,n]);break}let p=ue(a.code,o[s]);t.push([a.code,p]),e.push([a.code,de(a.code,p)])}return{string:dr(e),bytes:me(t),tuples:t,stringTuples:e,path:n}}function he(r){let t=[],e=[],n=null,o=0;for(;or.length)throw ur("Invalid address Uint8Array: "+P(r,"base16"));t.push([s,f]);let m=de(s,f);if(e.push([s,m]),a.path===!0){n=m;break}}return{bytes:Uint8Array.from(r),string:dr(e),tuples:t,stringTuples:e,path:n}}function dr(r){let t=[];return r.map(e=>{let n=g(e[0]);return t.push(n.name),e.length>1&&e[1]!=null&&t.push(e[1]),null}),fe(t.join("/"))}function me(r){return $(r.map(t=>{let e=g(t[0]),n=Uint8Array.from(lt(e.code));return t.length>1&&t[1]!=null&&(n=$([n,t[1]])),n}))}function Eo(r,t){if(r.size>0)return r.size/8;if(r.size===0)return 0;{let e=H(t instanceof Uint8Array?t:Uint8Array.from(t));return e+L(e)}}function fe(r){return"/"+r.trim().split("/").filter(t=>t).join("/")}function ur(r){return new Error("Error parsing address: "+r)}var Ao=Symbol.for("nodejs.util.inspect.custom"),ge=Symbol.for("@multiformats/js-multiaddr/multiaddr"),Io=[g("dns").code,g("dns4").code,g("dns6").code,g("dnsaddr").code],Ct=class r{bytes;#t;#e;#r;#n;[ge]=!0;constructor(t){t==null&&(t="");let e;if(t instanceof Uint8Array)e=he(t);else if(typeof t=="string"){if(t.length>0&&t.charAt(0)!=="/")throw new Error(`multiaddr "${t}" must start with a "/"`);e=lr(t)}else if(fr(t))e=he(t.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=e.bytes,this.#t=e.string,this.#e=e.tuples,this.#r=e.stringTuples,this.#n=e.path}toString(){return this.#t}toJSON(){return this.toString()}toOptions(){let t,e,n,o,s="",i=g("tcp"),a=g("udp"),p=g("ip4"),f=g("ip6"),m=g("dns6"),v=g("ip6zone");for(let[u,d]of this.stringTuples())u===v.code&&(s=`%${d??""}`),Io.includes(u)&&(e=i.name,o=443,n=`${d??""}${s}`,t=u===m.code?6:4),(u===i.code||u===a.code)&&(e=g(u).name,o=parseInt(d??"")),(u===p.code||u===f.code)&&(e=g(u).name,n=`${d??""}${s}`,t=u===f.code?6:4);if(t==null||e==null||n==null||o==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:t,host:n,transport:e,port:o}}protos(){return this.#e.map(([t])=>Object.assign({},g(t)))}protoCodes(){return this.#e.map(([t])=>t)}protoNames(){return this.#e.map(([t])=>g(t).name)}tuples(){return this.#e}stringTuples(){return this.#r}encapsulate(t){return t=new r(t),new r(this.toString()+t.toString())}decapsulate(t){let e=t.toString(),n=this.toString(),o=n.lastIndexOf(e);if(o<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${t.toString()}`);return new r(n.slice(0,o))}decapsulateCode(t){let e=this.tuples();for(let n=e.length-1;n>=0;n--)if(e[n][0]===t)return new r(me(e.slice(0,n)));return this}getPeerId(){try{let t=[];this.stringTuples().forEach(([n,o])=>{n===dt.p2p.code&&t.push([n,o]),n===dt["p2p-circuit"].code&&(t=[])});let e=t.pop();if(e?.[1]!=null){let n=e[1];return n[0]==="Q"||n[0]==="1"?P(T.decode(`z${n}`),"base58btc"):P(j.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#n}equals(t){return We(this.bytes,t.bytes)}async resolve(t){let e=this.protos().find(s=>s.resolvable);if(e==null)return[this];let n=pr.get(e.name);if(n==null)throw new I(`no available resolver for ${e.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,t)).map(s=>new r(s))}nodeAddress(){let t=this.toOptions();if(t.transport!=="tcp"&&t.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${t.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:t.family,address:t.host,port:t.port}}isThinWaistAddress(t){let e=(t??this).protos();return!(e.length!==2||e[0].code!==4&&e[0].code!==41||e[1].code!==6&&e[1].code!==273)}[Ao](){return`Multiaddr(${this.#t})`}};var pr=new Map;function fr(r){return!!r?.[ge]}function z(r){return new Ct(r)}var Co=c("dns4"),So=c("dns6"),To=c("dnsaddr"),Q=y(c("dns"),To,Co,So),Pt=y(c("ip4"),c("ip6")),W=y(l(Pt,c("tcp")),l(Q,c("tcp"))),Rt=l(Pt,c("udp")),Po=l(Rt,c("utp")),Ro=l(Rt,c("quic")),No=l(Rt,c("quic-v1")),we=y(l(W,c("ws")),l(Q,c("ws"))),St=y(l(we,c("p2p")),we),xe=y(l(W,c("wss")),l(Q,c("wss")),l(W,c("tls"),c("ws")),l(Q,c("tls"),c("ws"))),Tt=y(l(xe,c("p2p")),xe),be=y(l(W,c("http")),l(Pt,c("http")),l(Q,c("http"))),ye=y(l(W,c("https")),l(Pt,c("https")),l(Q,c("https"))),hr=l(Rt,c("webrtc-direct"),c("certhash")),wr=y(l(hr,c("p2p")),hr),mr=l(No,c("webtransport"),c("certhash"),c("certhash")),xr=y(l(mr,c("p2p")),mr),br=y(l(St,c("p2p-webrtc-star"),c("p2p")),l(Tt,c("p2p-webrtc-star"),c("p2p")),l(St,c("p2p-webrtc-star")),l(Tt,c("p2p-webrtc-star"))),gc=y(l(St,c("p2p-websocket-star"),c("p2p")),l(Tt,c("p2p-websocket-star"),c("p2p")),l(St,c("p2p-websocket-star")),l(Tt,c("p2p-websocket-star"))),yr=y(l(be,c("p2p-webrtc-direct"),c("p2p")),l(ye,c("p2p-webrtc-direct"),c("p2p")),l(be,c("p2p-webrtc-direct")),l(ye,c("p2p-webrtc-direct"))),K=y(we,xe,be,ye,br,yr,W,Po,Ro,Q,wr,xr),wc=y(l(K,c("p2p-stardust"),c("p2p")),l(K,c("p2p-stardust"))),G=y(l(K,c("p2p")),br,yr,wr,xr,c("p2p")),gr=y(l(G,c("p2p-circuit"),G),l(G,c("p2p-circuit")),l(c("p2p-circuit"),G),l(K,c("p2p-circuit")),l(c("p2p-circuit"),K),c("p2p-circuit")),vr=()=>y(l(gr,vr),gr),J=vr(),xc=y(l(J,G,J),l(G,J),l(J,G),J,G);var bc=y(l(J,c("webrtc"),c("p2p")),l(J,c("webrtc")),l(K,c("webrtc"),c("p2p")),l(K,c("webrtc")),c("webrtc"));function Er(r){function t(e){let n;try{n=z(e)}catch{return!1}let o=r(n.protoNames());return o===null?!1:o===!0||o===!1?o:o.length===0}return t}function l(...r){function t(e){if(e.length(n=typeof o=="function"?o().partialMatch(e):o.partialMatch(e),Array.isArray(n)&&(e=n),n===null)),n}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:Er(t),partialMatch:t}}function y(...r){function t(n){let o=null;return r.some(s=>{let i=typeof s=="function"?s().partialMatch(n):s.partialMatch(n);return i!=null?(o=i,!0):!1}),o}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:Er(t),partialMatch:t}}function c(r){let t=r;function e(o){let s;try{s=z(o)}catch{return!1}let i=s.protoNames();return i.length===1&&i[0]===t}function n(o){return o.length===0?null:o[0]===t?o.slice(1):null}return{toString:function(){return t},matches:e,partialMatch:n}}var _r=tt(Y("net"),1);var Nt=class extends EventTarget{#t=new Map;listenerCount(t){let e=this.#t.get(t);return e==null?0:e.length}addEventListener(t,e,n){super.addEventListener(t,e,n);let o=this.#t.get(t);o==null&&(o=[],this.#t.set(t,o)),o.push({callback:e,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(t,e,n){super.removeEventListener(t.toString(),e??null,n);let o=this.#t.get(t);o!=null&&(o=o.filter(({callback:s})=>s!==e),this.#t.set(t,o))}dispatchEvent(t){let e=super.dispatchEvent(t),n=this.#t.get(t.type);return n==null||(n=n.filter(({once:o})=>!o),this.#t.set(t.type,n)),e}safeDispatchEvent(t,e){return this.dispatchEvent(new ut(t,e))}},ve=class extends Event{detail;constructor(t,e){super(t,e),this.detail=e?.detail}},ut=globalThis.CustomEvent??ve;var Ee={ERR_INVALID_IP_PARAMETER:"ERR_INVALID_IP_PARAMETER",ERR_INVALID_PORT_PARAMETER:"ERR_INVALID_PORT_PARAMETER",ERR_INVALID_IP:"ERR_INVALID_IP"};function Ar(r,t){if(typeof r!="string")throw new I(`invalid ip provided: ${r}`,Ee.ERR_INVALID_IP_PARAMETER);if(typeof t=="string"&&(t=parseInt(t)),isNaN(t))throw new I(`invalid port provided: ${t}`,Ee.ERR_INVALID_PORT_PARAMETER);if((0,U.isIPv4)(r))return z(`/ip4/${r}/tcp/${t}`);if((0,U.isIPv6)(r))return z(`/ip6/${r}/tcp/${t}`);throw new I(`invalid ip:port for creating a multiaddr: ${r}:${t}`,Ee.ERR_INVALID_IP)}var Ur=tt(Dr(),1);var Ce=tt(Y("os"),1),Mr=tt(Y("path"),1);var Oo={ip4:"IPv4",ip6:"IPv6"};function ft(r,t={}){let e=r.getPath();return e!=null?Ce.default.platform()==="win32"?{path:Mr.default.join("\\\\.\\pipe\\",e)}:{path:e}:{...t,...r.toOptions()}}function Se(r,t,e){let n=o=>z(`/${r}/${o}/tcp/${e}`);return(Lo(t)?Fo(Oo[r]):[t]).map(n)}function Lo(r){return["0.0.0.0","::"].includes(r)}var Vo=Ce.default.networkInterfaces();function Fo(r){let t=[];for(let[,e]of Object.entries(Vo))if(e!=null)for(let n of e)n.family===r&&t.push(n.address);return t}var Mt=(r,t)=>{let e=t.logger.forComponent("libp2p:tcp:socket"),n=t.metrics,o=t.metricPrefix??"",s=t.socketInactivityTimeout??3e5,i=t.socketCloseTimeout??500;t.listeningAddr?.getPath()!=null&&(t.remoteAddr=t.listeningAddr),t.remoteAddr?.getPath()!=null&&(t.localAddr=t.remoteAddr);let a;if(t.remoteAddr!=null)a=t.remoteAddr;else{if(r.remoteAddress==null||r.remotePort==null)throw new I("Could not determine remote address or port","ERR_NO_REMOTE_ADDRESS");a=Ar(r.remoteAddress,r.remotePort)}let p=ft(a),f=p.path??`${p.host??""}:${p.port??""}`,{sink:m,source:v}=Ur.default.duplex(r);r.setTimeout(s,()=>{e("%s socket read timeout",f),n?.increment({[`${o}timeout`]:!0});let u;r.readable&&(u=new I("Socket read timeout","ERR_SOCKET_READ_TIMEOUT")),r.destroy(u)}),r.once("close",()=>{e("%s socket close",f),n?.increment({[`${o}close`]:!0}),x.timeline.close==null&&(x.timeline.close=Date.now())}),r.once("end",()=>{e("%s socket end",f),n?.increment({[`${o}end`]:!0})});let x={async sink(u){try{await m(async function*(){for await(let d of u)d instanceof Uint8Array?yield d:yield d.subarray()}())}catch(d){d.type!=="aborted"&&e(d)}r.end()},source:v,remoteAddr:a,timeline:{open:Date.now()},async close(u={}){if(r.destroyed){e("%s socket was already destroyed when trying to close",f);return}if(u.signal==null){let d=AbortSignal.timeout(i);u={...u,signal:d}}try{e("%s closing socket",f),await new Promise((d,E)=>{r.once("close",()=>{e("%s socket closed",f),d()}),r.once("error",N=>{e("%s socket error",f,N),x.timeline.close==null&&(x.timeline.close=Date.now()),E(N)}),r.setTimeout(i),r.end(),r.writableLength>0?r.once("drain",()=>{e("%s socket drained",f),r.destroy()}):r.destroy()})}catch(d){this.abort(d)}},abort:u=>{e("%s socket abort due to error",f,u),r.destroy(u)},log:e};return x};async function Te(r,t){try{await r.close()}catch(e){t.log.error("an error occurred closing the connection",e)}}var A;(function(r){r[r.INACTIVE=0]="INACTIVE",r[r.ACTIVE=1]="ACTIVE",r[r.PAUSED=2]="PAUSED"})(A||(A={}));var Ut=class extends Nt{context;server;connections=new Set;status={code:A.INACTIVE};metrics;addr;log;constructor(t){if(super(),this.context=t,t.keepAlive=t.keepAlive??!0,t.noDelay=t.noDelay??!0,this.log=t.logger.forComponent("libp2p:tcp:listener"),this.addr="unknown",this.server=_r.default.createServer(t,this.onSocket.bind(this)),t.maxConnections!==void 0&&(this.server.maxConnections=t.maxConnections),t.closeServerOnMaxConnections!=null&&t.closeServerOnMaxConnections.closeAbove= listenBelow","ERROR_CONNECTION_LIMITS");this.server.on("listening",()=>{if(t.metrics!=null){let e=this.server.address();e==null?this.addr="unknown":typeof e=="string"?this.addr=e:this.addr=`${e.address}:${e.port}`,t.metrics?.registerMetricGroup("libp2p_tcp_inbound_connections_total",{label:"address",help:"Current active connections in TCP listener",calculate:()=>({[this.addr]:this.connections.size})}),this.metrics={status:t.metrics.registerMetricGroup("libp2p_tcp_listener_status_info",{label:"address",help:"Current status of the TCP listener socket"}),errors:t.metrics.registerMetricGroup("libp2p_tcp_listener_errors_total",{label:"address",help:"Total count of TCP listener errors by type"}),events:t.metrics.registerMetricGroup("libp2p_tcp_listener_events_total",{label:"address",help:"Total count of TCP listener events by type"})},this.metrics?.status.update({[this.addr]:A.ACTIVE})}this.dispatchEvent(new ut("listening"))}).on("error",e=>{this.metrics?.errors.increment({[`${this.addr} listen_error`]:!0}),this.dispatchEvent(new ut("error",{detail:e}))}).on("close",()=>{this.metrics?.status.update({[this.addr]:this.status.code}),this.status.code!==A.PAUSED&&this.dispatchEvent(new ut("close"))})}onSocket(t){if(this.status.code!==A.ACTIVE)throw new I("Server is is not listening yet","ERR_SERVER_NOT_RUNNING");t.on("error",n=>{this.log("socket error",n),this.metrics?.events.increment({[`${this.addr} error`]:!0})});let e;try{e=Mt(t,{listeningAddr:this.status.listeningAddr,socketInactivityTimeout:this.context.socketInactivityTimeout,socketCloseTimeout:this.context.socketCloseTimeout,metrics:this.metrics?.events,metricPrefix:`${this.addr} `,logger:this.context.logger})}catch(n){this.log.error("inbound connection failed",n),this.metrics?.errors.increment({[`${this.addr} inbound_to_connection`]:!0});return}this.log("new inbound connection %s",e.remoteAddr);try{this.context.upgrader.upgradeInbound(e).then(n=>{this.log("inbound connection upgraded %s",e.remoteAddr),this.connections.add(e),t.once("close",()=>{this.connections.delete(e),this.context.closeServerOnMaxConnections!=null&&this.connections.size{this.log.error("error attempting to listen server once connection count under limit",o),this.context.closeServerOnMaxConnections?.onListenError?.(o)})}),this.context.handler!=null&&this.context.handler(n),this.context.closeServerOnMaxConnections!=null&&this.connections.size>=this.context.closeServerOnMaxConnections.closeAbove&&this.pause(!1).catch(o=>{this.log.error("error attempting to close server once connection count over limit",o)}),this.dispatchEvent(new ut("connection",{detail:n}))}).catch(async n=>{this.log.error("inbound connection failed",n),this.metrics?.errors.increment({[`${this.addr} inbound_upgrade`]:!0}),await Te(e,{log:this.log})}).catch(n=>{this.log.error("closing inbound connection failed",n)})}catch(n){this.log.error("inbound connection failed",n),Te(e,{log:this.log}).catch(o=>{this.log.error("closing inbound connection failed",o),this.metrics?.errors.increment({[`${this.addr} inbound_closing_failed`]:!0})})}}getAddrs(){if(this.status.code===A.INACTIVE)return[];let t=[],e=this.server.address(),{listeningAddr:n,peerId:o}=this.status;if(e==null)return[];if(typeof e=="string")t=[n];else try{n.toString().startsWith("/ip4")?t=t.concat(Se("ip4",e.address,e.port)):e.family==="IPv6"&&(t=t.concat(Se("ip6",e.address,e.port)))}catch(s){this.log.error("could not turn %s:%s into multiaddr",e.address,e.port,s)}return t.map(s=>o!=null?s.encapsulate(`/p2p/${o}`):s)}async listen(t){if(this.status.code===A.ACTIVE||this.status.code===A.PAUSED)throw new I("server is already listening","ERR_SERVER_ALREADY_LISTENING");let e=t.getPeerId(),n=e==null?t.decapsulateCode(421):t,{backlog:o}=this.context;try{this.status={code:A.ACTIVE,listeningAddr:n,peerId:e,netConfig:ft(n,{backlog:o})},await this.resume()}catch(s){throw this.status={code:A.INACTIVE},s}}async close(){await Promise.all([Promise.all(Array.from(this.connections.values()).map(async t=>Te(t,{log:this.log}))),this.pause(!0).catch(t=>{this.log.error("error attempting to close server once connection count over limit",t)})])}async resume(){if(this.server.listening||this.status.code===A.INACTIVE)return;let t=this.status.netConfig;await new Promise((e,n)=>{this.server.once("error",n),this.server.listen(t,e)}),this.status={...this.status,code:A.ACTIVE},this.log("Listening on %s",this.server.address())}async pause(t){if(!this.server.listening&&this.status.code===A.PAUSED&&t){this.status={code:A.INACTIVE};return}!this.server.listening||this.status.code!==A.ACTIVE||(this.log("Closing server on %s",this.server.address()),this.status=t?{code:A.INACTIVE}:{...this.status,code:A.PAUSED},await new Promise((e,n)=>{this.server.close(o=>{o!=null?n(o):e()})}))}};var Re=class{opts;metrics;components;log;constructor(t,e={}){this.log=t.logger.forComponent("libp2p:tcp"),this.opts=e,this.components=t,t.metrics!=null&&(this.metrics={dialerEvents:t.metrics.registerCounterGroup("libp2p_tcp_dialer_events_total",{label:"event",help:"Total count of TCP dialer events by type"})})}[Me]=!0;[Symbol.toStringTag]="@libp2p/tcp";async dial(t,e){e.keepAlive=e.keepAlive??!0,e.noDelay=e.noDelay??!0;let n=await this._connect(t,e);n.on("error",a=>{this.log("socket error",a)});let o=Mt(n,{remoteAddr:t,socketInactivityTimeout:this.opts.outboundSocketInactivityTimeout,socketCloseTimeout:this.opts.socketCloseTimeout,metrics:this.metrics?.dialerEvents,logger:this.components.logger}),s=()=>{o.close().catch(a=>{this.log.error("Error closing maConn after abort",a)})};e.signal?.addEventListener("abort",s,{once:!0}),this.log("new outbound connection %s",o.remoteAddr);let i=await e.upgrader.upgradeOutbound(o);if(this.log("outbound connection %s upgraded",o.remoteAddr),e.signal?.removeEventListener("abort",s),e.signal?.aborted===!0)throw i.close().catch(a=>{this.log.error("Error closing conn after abort",a)}),new et;return i}async _connect(t,e){if(e.signal?.aborted===!0)throw new et;return new Promise((n,o)=>{let s=Date.now(),i=ft(t,{...this.opts.dialOpts??{},...e});this.log("dialing %a",t);let a=kr.default.connect(i),p=u=>{let d=i.path??`${i.host??""}:${i.port}`;u.message=`connection error ${d}: ${u.message}`,this.metrics?.dialerEvents.increment({error:!0}),x(u)},f=()=>{this.log("connection timeout %a",t),this.metrics?.dialerEvents.increment({timeout:!0});let u=new I(`connection timeout after ${Date.now()-s}ms`,"ERR_CONNECT_TIMEOUT");a.emit("error",u)},m=()=>{this.log("connection opened %a",t),this.metrics?.dialerEvents.increment({connect:!0}),x()},v=()=>{this.log("connection aborted %a",t),this.metrics?.dialerEvents.increment({abort:!0}),a.destroy(),x(new et)},x=u=>{if(a.removeListener("error",p),a.removeListener("timeout",f),a.removeListener("connect",m),e.signal!=null&&e.signal.removeEventListener("abort",v),u!=null){o(u);return}n(a)};a.on("error",p),a.on("timeout",f),a.on("connect",m),e.signal!=null&&e.signal.addEventListener("abort",v)})}createListener(t){return new Ut({...this.opts.listenOpts??{},...t,maxConnections:this.opts.maxConnections,backlog:this.opts.backlog,closeServerOnMaxConnections:this.opts.closeServerOnMaxConnections,socketInactivityTimeout:this.opts.inboundSocketInactivityTimeout,socketCloseTimeout:this.opts.socketCloseTimeout,metrics:this.components.metrics,logger:this.components.logger})}filter(t){return t=Array.isArray(t)?t:[t],t.filter(e=>e.protoCodes().includes(290)?!1:e.protoCodes().includes(400)?!0:W.matches(e.decapsulateCode(421)))}};function jo(r={}){return t=>new Re(t,r)}return zr(Go);})(); -return Libp2PTcp})); diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/constants.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/constants.d.ts deleted file mode 100644 index f30b4f260..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/constants.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare const CODE_P2P = 421; -export declare const CODE_CIRCUIT = 290; -export declare const CODE_UNIX = 400; -export declare const CLOSE_TIMEOUT = 500; -export declare const SOCKET_TIMEOUT: number; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/constants.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/constants.d.ts.map deleted file mode 100644 index c31c9fd50..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,QAAQ,MAAM,CAAA;AAC3B,eAAO,MAAM,YAAY,MAAM,CAAA;AAC/B,eAAO,MAAM,SAAS,MAAM,CAAA;AAG5B,eAAO,MAAM,aAAa,MAAM,CAAA;AAGhC,eAAO,MAAM,cAAc,QAAY,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/constants.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/constants.js deleted file mode 100644 index 271d393f3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/constants.js +++ /dev/null @@ -1,9 +0,0 @@ -// p2p multi-address code -export const CODE_P2P = 421; -export const CODE_CIRCUIT = 290; -export const CODE_UNIX = 400; -// Time to wait for a connection to close gracefully before destroying it manually -export const CLOSE_TIMEOUT = 500; -// Close the socket if there is no activity after this long in ms -export const SOCKET_TIMEOUT = 5 * 60000; // 5 mins -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/constants.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/constants.js.map deleted file mode 100644 index f2a3aba59..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAA;AAC3B,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA;AAC/B,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAA;AAE5B,kFAAkF;AAClF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;AAEhC,iEAAiE;AACjE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,KAAK,CAAA,CAAC,SAAS"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/index.d.ts deleted file mode 100644 index c9fef833a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/index.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -/** - * @packageDocumentation - * - * A [libp2p transport](https://docs.libp2p.io/concepts/transports/overview/) based on the TCP networking stack. - * - * @example - * - * ```js - * import { tcp } from '@libp2p/tcp' - * import { multiaddr } from '@multiformats/multiaddr' - * import { pipe } from 'it-pipe' - * import all from 'it-all' - * - * // A simple upgrader that just returns the MultiaddrConnection - * const upgrader = { - * upgradeInbound: async maConn => maConn, - * upgradeOutbound: async maConn => maConn - * } - * - * const transport = tcp()() - * - * const listener = transport.createListener({ - * upgrader, - * handler: (socket) => { - * console.this.log('new connection opened') - * pipe( - * ['hello', ' ', 'World!'], - * socket - * ) - * } - * }) - * - * const addr = multiaddr('/ip4/127.0.0.1/tcp/9090') - * await listener.listen(addr) - * console.this.log('listening') - * - * const socket = await transport.dial(addr, { upgrader }) - * const values = await pipe( - * socket, - * all - * ) - * console.this.log(`Value: ${values.toString()}`) - * - * // Close connection after reading - * await listener.close() - * ``` - * - * Outputs: - * - * ```sh - * listening - * new connection opened - * Value: hello World! - * ``` - */ -import { type CreateListenerOptions, type DialOptions, type Transport } from '@libp2p/interface/transport'; -import { type CloseServerOnMaxConnectionsOpts } from './listener.js'; -import type { ComponentLogger } from '@libp2p/interface'; -import type { CounterGroup, Metrics } from '@libp2p/interface/metrics'; -import type { AbortOptions } from '@multiformats/multiaddr'; -export interface TCPOptions { - /** - * An optional number in ms that is used as an inactivity timeout after which the socket will be closed - */ - inboundSocketInactivityTimeout?: number; - /** - * An optional number in ms that is used as an inactivity timeout after which the socket will be closed - */ - outboundSocketInactivityTimeout?: number; - /** - * When closing a socket, wait this long for it to close gracefully before it is closed more forcibly - */ - socketCloseTimeout?: number; - /** - * Set this property to reject connections when the server's connection count gets high. - * https://nodejs.org/api/net.html#servermaxconnections - */ - maxConnections?: number; - /** - * Parameter to specify the maximum length of the queue of pending connections - * https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - backlog?: number; - /** - * Close server (stop listening for new connections) if connections exceed a limit. - * Open server (start listening for new connections) if connections fall below a limit. - */ - closeServerOnMaxConnections?: CloseServerOnMaxConnectionsOpts; - /** - * Options passed to `net.connect` for every opened TCP socket - */ - dialOpts?: TCPSocketOptions; - /** - * Options passed to every `net.createServer` for every TCP server - */ - listenOpts?: TCPSocketOptions; -} -/** - * Expose a subset of net.connect options - */ -export interface TCPSocketOptions extends AbortOptions { - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - noDelay?: boolean; - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - keepAlive?: boolean; - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - keepAliveInitialDelay?: number; - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#new-netsocketoptions - */ - allowHalfOpen?: boolean; -} -export interface TCPDialOptions extends DialOptions, TCPSocketOptions { -} -export interface TCPCreateListenerOptions extends CreateListenerOptions, TCPSocketOptions { -} -export interface TCPComponents { - metrics?: Metrics; - logger: ComponentLogger; -} -export interface TCPMetrics { - dialerEvents: CounterGroup; -} -export declare function tcp(init?: TCPOptions): (components: TCPComponents) => Transport; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/index.d.ts.map deleted file mode 100644 index 0a2362083..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAIH,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,WAAW,EAAU,KAAK,SAAS,EAAiB,MAAM,6BAA6B,CAAA;AAGjI,OAAO,EAAE,KAAK,+BAA+B,EAAe,MAAM,eAAe,CAAA;AAGjF,OAAO,KAAK,EAAE,eAAe,EAAU,MAAM,mBAAmB,CAAA;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACtE,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,yBAAyB,CAAA;AAGtE,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAA;IAEvC;;OAEG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAA;IAExC;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;OAGG;IACH,2BAA2B,CAAC,EAAE,+BAA+B,CAAA;IAE7D;;OAEG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAE3B;;OAEG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAE9B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,MAAM,WAAW,cAAe,SAAQ,WAAW,EAAE,gBAAgB;CAEpE;AAED,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB,EAAE,gBAAgB;CAExF;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,eAAe,CAAA;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,YAAY,CAAA;CAC3B;AAqLD,wBAAgB,GAAG,CAAE,IAAI,GAAE,UAAe,GAAG,CAAC,UAAU,EAAE,aAAa,KAAK,SAAS,CAIpF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/index.js deleted file mode 100644 index 5f20d90b6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/index.js +++ /dev/null @@ -1,214 +0,0 @@ -/** - * @packageDocumentation - * - * A [libp2p transport](https://docs.libp2p.io/concepts/transports/overview/) based on the TCP networking stack. - * - * @example - * - * ```js - * import { tcp } from '@libp2p/tcp' - * import { multiaddr } from '@multiformats/multiaddr' - * import { pipe } from 'it-pipe' - * import all from 'it-all' - * - * // A simple upgrader that just returns the MultiaddrConnection - * const upgrader = { - * upgradeInbound: async maConn => maConn, - * upgradeOutbound: async maConn => maConn - * } - * - * const transport = tcp()() - * - * const listener = transport.createListener({ - * upgrader, - * handler: (socket) => { - * console.this.log('new connection opened') - * pipe( - * ['hello', ' ', 'World!'], - * socket - * ) - * } - * }) - * - * const addr = multiaddr('/ip4/127.0.0.1/tcp/9090') - * await listener.listen(addr) - * console.this.log('listening') - * - * const socket = await transport.dial(addr, { upgrader }) - * const values = await pipe( - * socket, - * all - * ) - * console.this.log(`Value: ${values.toString()}`) - * - * // Close connection after reading - * await listener.close() - * ``` - * - * Outputs: - * - * ```sh - * listening - * new connection opened - * Value: hello World! - * ``` - */ -import net from 'net'; -import { AbortError, CodeError } from '@libp2p/interface/errors'; -import { symbol } from '@libp2p/interface/transport'; -import * as mafmt from '@multiformats/mafmt'; -import { CODE_CIRCUIT, CODE_P2P, CODE_UNIX } from './constants.js'; -import { TCPListener } from './listener.js'; -import { toMultiaddrConnection } from './socket-to-conn.js'; -import { multiaddrToNetConfig } from './utils.js'; -class TCP { - opts; - metrics; - components; - log; - constructor(components, options = {}) { - this.log = components.logger.forComponent('libp2p:tcp'); - this.opts = options; - this.components = components; - if (components.metrics != null) { - this.metrics = { - dialerEvents: components.metrics.registerCounterGroup('libp2p_tcp_dialer_events_total', { - label: 'event', - help: 'Total count of TCP dialer events by type' - }) - }; - } - } - [symbol] = true; - [Symbol.toStringTag] = '@libp2p/tcp'; - async dial(ma, options) { - options.keepAlive = options.keepAlive ?? true; - options.noDelay = options.noDelay ?? true; - // options.signal destroys the socket before 'connect' event - const socket = await this._connect(ma, options); - // Avoid uncaught errors caused by unstable connections - socket.on('error', err => { - this.log('socket error', err); - }); - const maConn = toMultiaddrConnection(socket, { - remoteAddr: ma, - socketInactivityTimeout: this.opts.outboundSocketInactivityTimeout, - socketCloseTimeout: this.opts.socketCloseTimeout, - metrics: this.metrics?.dialerEvents, - logger: this.components.logger - }); - const onAbort = () => { - maConn.close().catch(err => { - this.log.error('Error closing maConn after abort', err); - }); - }; - options.signal?.addEventListener('abort', onAbort, { once: true }); - this.log('new outbound connection %s', maConn.remoteAddr); - const conn = await options.upgrader.upgradeOutbound(maConn); - this.log('outbound connection %s upgraded', maConn.remoteAddr); - options.signal?.removeEventListener('abort', onAbort); - if (options.signal?.aborted === true) { - conn.close().catch(err => { - this.log.error('Error closing conn after abort', err); - }); - throw new AbortError(); - } - return conn; - } - async _connect(ma, options) { - if (options.signal?.aborted === true) { - throw new AbortError(); - } - return new Promise((resolve, reject) => { - const start = Date.now(); - const cOpts = multiaddrToNetConfig(ma, { - ...(this.opts.dialOpts ?? {}), - ...options - }); - this.log('dialing %a', ma); - const rawSocket = net.connect(cOpts); - const onError = (err) => { - const cOptsStr = cOpts.path ?? `${cOpts.host ?? ''}:${cOpts.port}`; - err.message = `connection error ${cOptsStr}: ${err.message}`; - this.metrics?.dialerEvents.increment({ error: true }); - done(err); - }; - const onTimeout = () => { - this.log('connection timeout %a', ma); - this.metrics?.dialerEvents.increment({ timeout: true }); - const err = new CodeError(`connection timeout after ${Date.now() - start}ms`, 'ERR_CONNECT_TIMEOUT'); - // Note: this will result in onError() being called - rawSocket.emit('error', err); - }; - const onConnect = () => { - this.log('connection opened %a', ma); - this.metrics?.dialerEvents.increment({ connect: true }); - done(); - }; - const onAbort = () => { - this.log('connection aborted %a', ma); - this.metrics?.dialerEvents.increment({ abort: true }); - rawSocket.destroy(); - done(new AbortError()); - }; - const done = (err) => { - rawSocket.removeListener('error', onError); - rawSocket.removeListener('timeout', onTimeout); - rawSocket.removeListener('connect', onConnect); - if (options.signal != null) { - options.signal.removeEventListener('abort', onAbort); - } - if (err != null) { - reject(err); - return; - } - resolve(rawSocket); - }; - rawSocket.on('error', onError); - rawSocket.on('timeout', onTimeout); - rawSocket.on('connect', onConnect); - if (options.signal != null) { - options.signal.addEventListener('abort', onAbort); - } - }); - } - /** - * Creates a TCP listener. The provided `handler` function will be called - * anytime a new incoming Connection has been successfully upgraded via - * `upgrader.upgradeInbound`. - */ - createListener(options) { - return new TCPListener({ - ...(this.opts.listenOpts ?? {}), - ...options, - maxConnections: this.opts.maxConnections, - backlog: this.opts.backlog, - closeServerOnMaxConnections: this.opts.closeServerOnMaxConnections, - socketInactivityTimeout: this.opts.inboundSocketInactivityTimeout, - socketCloseTimeout: this.opts.socketCloseTimeout, - metrics: this.components.metrics, - logger: this.components.logger - }); - } - /** - * Takes a list of `Multiaddr`s and returns only valid TCP addresses - */ - filter(multiaddrs) { - multiaddrs = Array.isArray(multiaddrs) ? multiaddrs : [multiaddrs]; - return multiaddrs.filter(ma => { - if (ma.protoCodes().includes(CODE_CIRCUIT)) { - return false; - } - if (ma.protoCodes().includes(CODE_UNIX)) { - return true; - } - return mafmt.TCP.matches(ma.decapsulateCode(CODE_P2P)); - }); - } -} -export function tcp(init = {}) { - return (components) => { - return new TCP(components, init); - }; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/index.js.map deleted file mode 100644 index 820bf53ee..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAgD,MAAM,EAAiC,MAAM,6BAA6B,CAAA;AACjI,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAwC,WAAW,EAAE,MAAM,eAAe,CAAA;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,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CAAC,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAA;QACxD,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AAED,MAAM,UAAU,GAAG,CAAE,OAAmB,EAAE;IACxC,OAAO,CAAC,UAAyB,EAAE,EAAE;QACnC,OAAO,IAAI,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/listener.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/listener.d.ts deleted file mode 100644 index 7ed8b5b06..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/listener.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import type { TCPCreateListenerOptions } from './index.js'; -import type { ComponentLogger } from '@libp2p/interface'; -import type { Connection } from '@libp2p/interface/connection'; -import type { CounterGroup, MetricGroup, Metrics } from '@libp2p/interface/metrics'; -import type { Listener, ListenerEvents, Upgrader } from '@libp2p/interface/transport'; -import type { Multiaddr } from '@multiformats/multiaddr'; -export interface CloseServerOnMaxConnectionsOpts { - /** Server listens once connection count is less than `listenBelow` */ - listenBelow: number; - /** Close server once connection count is greater than or equal to `closeAbove` */ - closeAbove: number; - onListenError?(err: Error): void; -} -interface Context extends TCPCreateListenerOptions { - handler?(conn: Connection): void; - upgrader: Upgrader; - socketInactivityTimeout?: number; - socketCloseTimeout?: number; - maxConnections?: number; - backlog?: number; - metrics?: Metrics; - closeServerOnMaxConnections?: CloseServerOnMaxConnectionsOpts; - logger: ComponentLogger; -} -export interface TCPListenerMetrics { - status: MetricGroup; - errors: CounterGroup; - events: CounterGroup; -} -export declare class TCPListener extends TypedEventEmitter implements Listener { - private readonly context; - private readonly server; - /** Keep track of open connections to destroy in case of timeout */ - private readonly connections; - private status; - private metrics?; - private addr; - private readonly log; - constructor(context: Context); - private onSocket; - getAddrs(): Multiaddr[]; - listen(ma: Multiaddr): Promise; - close(): Promise; - /** - * Can resume a stopped or start an inert server - */ - private resume; - private pause; -} -export {}; -//# sourceMappingURL=listener.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/listener.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/listener.d.ts.map deleted file mode 100644 index d81a9c284..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/listener.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../../src/listener.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAe,MAAM,0BAA0B,CAAA;AAQzE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAyB,MAAM,mBAAmB,CAAA;AAC/E,OAAO,KAAK,EAAuB,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACnF,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnF,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAaxD,MAAM,WAAW,+BAA+B;IAC9C,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAA;IACnB,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAA;CACjC;AAED,UAAU,OAAQ,SAAQ,wBAAwB;IAChD,OAAO,CAAC,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAA;IAChC,QAAQ,EAAE,QAAQ,CAAA;IAClB,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2BAA2B,CAAC,EAAE,+BAA+B,CAAA;IAC7D,MAAM,EAAE,eAAe,CAAA;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,WAAW,CAAA;IACnB,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,EAAE,YAAY,CAAA;CACrB;AAoBD,qBAAa,WAAY,SAAQ,iBAAiB,CAAC,cAAc,CAAE,YAAW,QAAQ;IASvE,OAAO,CAAC,QAAQ,CAAC,OAAO;IARrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,mEAAmE;IACnE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiC;IAC7D,OAAO,CAAC,MAAM,CAAmD;IACjE,OAAO,CAAC,OAAO,CAAC,CAAoB;IACpC,OAAO,CAAC,IAAI,CAAQ;IACpB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;gBAEE,OAAO,EAAE,OAAO;IAyF9C,OAAO,CAAC,QAAQ;IA0FhB,QAAQ,IAAK,SAAS,EAAE;IAgClB,MAAM,CAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBrC,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;IAY7B;;OAEG;YACW,MAAM;YAiBN,KAAK;CAgCpB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/listener.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/listener.js deleted file mode 100644 index 2e7e52ed7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/listener.js +++ /dev/null @@ -1,302 +0,0 @@ -import net from 'net'; -import { CodeError } from '@libp2p/interface/errors'; -import { TypedEventEmitter, CustomEvent } from '@libp2p/interface/events'; -import { CODE_P2P } from './constants.js'; -import { toMultiaddrConnection } from './socket-to-conn.js'; -import { getMultiaddrs, multiaddrToNetConfig } from './utils.js'; -/** - * Attempts to close the given maConn. If a failure occurs, it will be logged - */ -async function attemptClose(maConn, options) { - try { - await maConn.close(); - } - catch (err) { - options.log.error('an error occurred closing the connection', err); - } -} -var TCPListenerStatusCode; -(function (TCPListenerStatusCode) { - /** - * When server object is initialized but we don't know the listening address yet or - * the server object is stopped manually, can be resumed only by calling listen() - **/ - TCPListenerStatusCode[TCPListenerStatusCode["INACTIVE"] = 0] = "INACTIVE"; - TCPListenerStatusCode[TCPListenerStatusCode["ACTIVE"] = 1] = "ACTIVE"; - /* During the connection limits */ - TCPListenerStatusCode[TCPListenerStatusCode["PAUSED"] = 2] = "PAUSED"; -})(TCPListenerStatusCode || (TCPListenerStatusCode = {})); -export class TCPListener extends TypedEventEmitter { - context; - server; - /** Keep track of open connections to destroy in case of timeout */ - connections = new Set(); - status = { code: TCPListenerStatusCode.INACTIVE }; - metrics; - addr; - log; - constructor(context) { - super(); - this.context = context; - context.keepAlive = context.keepAlive ?? true; - context.noDelay = context.noDelay ?? true; - this.log = context.logger.forComponent('libp2p:tcp:listener'); - this.addr = 'unknown'; - this.server = net.createServer(context, this.onSocket.bind(this)); - // https://nodejs.org/api/net.html#servermaxconnections - // If set reject connections when the server's connection count gets high - // Useful to prevent too resource exhaustion via many open connections on high bursts of activity - if (context.maxConnections !== undefined) { - this.server.maxConnections = context.maxConnections; - } - if (context.closeServerOnMaxConnections != null) { - // Sanity check options - if (context.closeServerOnMaxConnections.closeAbove < context.closeServerOnMaxConnections.listenBelow) { - throw new CodeError('closeAbove must be >= listenBelow', 'ERROR_CONNECTION_LIMITS'); - } - } - this.server - .on('listening', () => { - if (context.metrics != null) { - // we are listening, register metrics for our port - const address = this.server.address(); - if (address == null) { - this.addr = 'unknown'; - } - else if (typeof address === 'string') { - // unix socket - this.addr = address; - } - else { - this.addr = `${address.address}:${address.port}`; - } - context.metrics?.registerMetricGroup('libp2p_tcp_inbound_connections_total', { - label: 'address', - help: 'Current active connections in TCP listener', - calculate: () => { - return { - [this.addr]: this.connections.size - }; - } - }); - this.metrics = { - status: context.metrics.registerMetricGroup('libp2p_tcp_listener_status_info', { - label: 'address', - help: 'Current status of the TCP listener socket' - }), - errors: context.metrics.registerMetricGroup('libp2p_tcp_listener_errors_total', { - label: 'address', - help: 'Total count of TCP listener errors by type' - }), - events: context.metrics.registerMetricGroup('libp2p_tcp_listener_events_total', { - label: 'address', - help: 'Total count of TCP listener events by type' - }) - }; - this.metrics?.status.update({ - [this.addr]: TCPListenerStatusCode.ACTIVE - }); - } - this.dispatchEvent(new CustomEvent('listening')); - }) - .on('error', err => { - this.metrics?.errors.increment({ [`${this.addr} listen_error`]: true }); - this.dispatchEvent(new CustomEvent('error', { detail: err })); - }) - .on('close', () => { - this.metrics?.status.update({ - [this.addr]: this.status.code - }); - // If this event is emitted, the transport manager will remove the listener from it's cache - // in the meanwhile if the connections are dropped then listener will start listening again - // and the transport manager will not be able to close the server - if (this.status.code !== TCPListenerStatusCode.PAUSED) { - this.dispatchEvent(new CustomEvent('close')); - } - }); - } - onSocket(socket) { - if (this.status.code !== TCPListenerStatusCode.ACTIVE) { - throw new CodeError('Server is is not listening yet', 'ERR_SERVER_NOT_RUNNING'); - } - // Avoid uncaught errors caused by unstable connections - socket.on('error', err => { - this.log('socket error', err); - this.metrics?.events.increment({ [`${this.addr} error`]: true }); - }); - let maConn; - try { - maConn = toMultiaddrConnection(socket, { - listeningAddr: this.status.listeningAddr, - socketInactivityTimeout: this.context.socketInactivityTimeout, - socketCloseTimeout: this.context.socketCloseTimeout, - metrics: this.metrics?.events, - metricPrefix: `${this.addr} `, - logger: this.context.logger - }); - } - catch (err) { - this.log.error('inbound connection failed', err); - this.metrics?.errors.increment({ [`${this.addr} inbound_to_connection`]: true }); - return; - } - this.log('new inbound connection %s', maConn.remoteAddr); - try { - this.context.upgrader.upgradeInbound(maConn) - .then((conn) => { - this.log('inbound connection upgraded %s', maConn.remoteAddr); - this.connections.add(maConn); - socket.once('close', () => { - this.connections.delete(maConn); - if (this.context.closeServerOnMaxConnections != null && - this.connections.size < this.context.closeServerOnMaxConnections.listenBelow) { - // The most likely case of error is if the port taken by this application is binded by - // another process during the time the server if closed. In that case there's not much - // we can do. resume() will be called again every time a connection is dropped, which - // acts as an eventual retry mechanism. onListenError allows the consumer act on this. - this.resume().catch(e => { - this.log.error('error attempting to listen server once connection count under limit', e); - this.context.closeServerOnMaxConnections?.onListenError?.(e); - }); - } - }); - if (this.context.handler != null) { - this.context.handler(conn); - } - if (this.context.closeServerOnMaxConnections != null && - this.connections.size >= this.context.closeServerOnMaxConnections.closeAbove) { - this.pause(false).catch(e => { - this.log.error('error attempting to close server once connection count over limit', e); - }); - } - this.dispatchEvent(new CustomEvent('connection', { detail: conn })); - }) - .catch(async (err) => { - this.log.error('inbound connection failed', err); - this.metrics?.errors.increment({ [`${this.addr} inbound_upgrade`]: true }); - await attemptClose(maConn, { - log: this.log - }); - }) - .catch(err => { - this.log.error('closing inbound connection failed', err); - }); - } - catch (err) { - this.log.error('inbound connection failed', err); - attemptClose(maConn, { - log: this.log - }) - .catch(err => { - this.log.error('closing inbound connection failed', err); - this.metrics?.errors.increment({ [`${this.addr} inbound_closing_failed`]: true }); - }); - } - } - getAddrs() { - if (this.status.code === TCPListenerStatusCode.INACTIVE) { - return []; - } - let addrs = []; - const address = this.server.address(); - const { listeningAddr, peerId } = this.status; - if (address == null) { - return []; - } - if (typeof address === 'string') { - addrs = [listeningAddr]; - } - else { - try { - // Because TCP will only return the IPv6 version - // we need to capture from the passed multiaddr - if (listeningAddr.toString().startsWith('/ip4')) { - addrs = addrs.concat(getMultiaddrs('ip4', address.address, address.port)); - } - else if (address.family === 'IPv6') { - addrs = addrs.concat(getMultiaddrs('ip6', address.address, address.port)); - } - } - catch (err) { - this.log.error('could not turn %s:%s into multiaddr', address.address, address.port, err); - } - } - return addrs.map(ma => peerId != null ? ma.encapsulate(`/p2p/${peerId}`) : ma); - } - async listen(ma) { - if (this.status.code === TCPListenerStatusCode.ACTIVE || this.status.code === TCPListenerStatusCode.PAUSED) { - throw new CodeError('server is already listening', 'ERR_SERVER_ALREADY_LISTENING'); - } - const peerId = ma.getPeerId(); - const listeningAddr = peerId == null ? ma.decapsulateCode(CODE_P2P) : ma; - const { backlog } = this.context; - try { - this.status = { - code: TCPListenerStatusCode.ACTIVE, - listeningAddr, - peerId, - netConfig: multiaddrToNetConfig(listeningAddr, { backlog }) - }; - await this.resume(); - } - catch (err) { - this.status = { code: TCPListenerStatusCode.INACTIVE }; - throw err; - } - } - async close() { - // Close connections and server the same time to avoid any race condition - await Promise.all([ - Promise.all(Array.from(this.connections.values()).map(async (maConn) => attemptClose(maConn, { - log: this.log - }))), - this.pause(true).catch(e => { - this.log.error('error attempting to close server once connection count over limit', e); - }) - ]); - } - /** - * Can resume a stopped or start an inert server - */ - async resume() { - if (this.server.listening || this.status.code === TCPListenerStatusCode.INACTIVE) { - return; - } - const netConfig = this.status.netConfig; - await new Promise((resolve, reject) => { - // NOTE: 'listening' event is only fired on success. Any error such as port already binded, is emitted via 'error' - this.server.once('error', reject); - this.server.listen(netConfig, resolve); - }); - this.status = { ...this.status, code: TCPListenerStatusCode.ACTIVE }; - this.log('Listening on %s', this.server.address()); - } - async pause(permanent) { - if (!this.server.listening && this.status.code === TCPListenerStatusCode.PAUSED && permanent) { - this.status = { code: TCPListenerStatusCode.INACTIVE }; - return; - } - if (!this.server.listening || this.status.code !== TCPListenerStatusCode.ACTIVE) { - return; - } - this.log('Closing server on %s', this.server.address()); - // NodeJS implementation tracks listening status with `this._handle` property. - // - Server.close() sets this._handle to null immediately. If this._handle is null, ERR_SERVER_NOT_RUNNING is thrown - // - Server.listening returns `this._handle !== null` https://github.com/nodejs/node/blob/386d761943bb1b217fba27d6b80b658c23009e60/lib/net.js#L1675 - // - Server.listen() if `this._handle !== null` throws ERR_SERVER_ALREADY_LISTEN - // - // NOTE: Both listen and close are technically not async actions, so it's not necessary to track - // states 'pending-close' or 'pending-listen' - // From docs https://nodejs.org/api/net.html#serverclosecallback - // Stops the server from accepting new connections and keeps existing connections. - // 'close' event is emitted only emitted when all connections are ended. - // The optional callback will be called once the 'close' event occurs. - // We need to set this status before closing server, so other procedures are aware - // during the time the server is closing - this.status = permanent ? { code: TCPListenerStatusCode.INACTIVE } : { ...this.status, code: TCPListenerStatusCode.PAUSED }; - await new Promise((resolve, reject) => { - this.server.close(err => { (err != null) ? reject(err) : resolve(); }); - }); - } -} -//# sourceMappingURL=listener.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/listener.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/listener.js.map deleted file mode 100644 index 2e89d00b6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/listener.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listener.js","sourceRoot":"","sources":["../../src/listener.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EACL,aAAa,EACb,oBAAoB,EAErB,MAAM,YAAY,CAAA;AAQnB;;GAEG;AACH,KAAK,UAAU,YAAY,CAAE,MAA2B,EAAE,OAAsB;IAC9E,IAAI;QACF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;KACrB;IAAC,O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gFAAgF;QAChF,EAAE;QACF,gGAAgG;QAChG,6CAA6C;QAE7C,gEAAgE;QAChE,kFAAkF;QAClF,wEAAwE;QACxE,sEAAsE;QAEtE,kFAAkF;QAClF,wCAAwC;QACxC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,qBAAqB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,qBAAqB,CAAC,MAAM,EAAE,CAAA;QAC3H,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA,CAAC,CAAC,CAAC,CAAA;QACvE,CAAC,CAAC,CAAA;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/socket-to-conn.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/socket-to-conn.d.ts deleted file mode 100644 index af459c198..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/socket-to-conn.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { ComponentLogger } from '@libp2p/interface'; -import type { MultiaddrConnection } from '@libp2p/interface/connection'; -import type { CounterGroup } from '@libp2p/interface/metrics'; -import type { Multiaddr } from '@multiformats/multiaddr'; -import type { Socket } from 'net'; -interface ToConnectionOptions { - listeningAddr?: Multiaddr; - remoteAddr?: Multiaddr; - localAddr?: Multiaddr; - socketInactivityTimeout?: number; - socketCloseTimeout?: number; - metrics?: CounterGroup; - metricPrefix?: string; - logger: ComponentLogger; -} -/** - * Convert a socket into a MultiaddrConnection - * https://github.com/libp2p/interface-transport#multiaddrconnection - */ -export declare const toMultiaddrConnection: (socket: Socket, options: ToConnectionOptions) => MultiaddrConnection; -export {}; -//# sourceMappingURL=socket-to-conn.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/socket-to-conn.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/socket-to-conn.d.ts.map deleted file mode 100644 index 36979c82f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/socket-to-conn.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"socket-to-conn.d.ts","sourceRoot":"","sources":["../../src/socket-to-conn.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAEjC,UAAU,mBAAmB;IAC3B,aAAa,CAAC,EAAE,SAAS,CAAA;IACzB,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE,eAAe,CAAA;CACxB;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,WAAY,MAAM,WAAW,mBAAmB,KAAG,mBA4KpF,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/socket-to-conn.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/socket-to-conn.js deleted file mode 100644 index 869e9d556..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/socket-to-conn.js +++ /dev/null @@ -1,158 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { ipPortToMultiaddr as toMultiaddr } from '@libp2p/utils/ip-port-to-multiaddr'; -// @ts-expect-error no types -import toIterable from 'stream-to-it'; -import { CLOSE_TIMEOUT, SOCKET_TIMEOUT } from './constants.js'; -import { multiaddrToNetConfig } from './utils.js'; -/** - * Convert a socket into a MultiaddrConnection - * https://github.com/libp2p/interface-transport#multiaddrconnection - */ -export const toMultiaddrConnection = (socket, options) => { - const log = options.logger.forComponent('libp2p:tcp:socket'); - const metrics = options.metrics; - const metricPrefix = options.metricPrefix ?? ''; - const inactivityTimeout = options.socketInactivityTimeout ?? SOCKET_TIMEOUT; - const closeTimeout = options.socketCloseTimeout ?? CLOSE_TIMEOUT; - // Check if we are connected on a unix path - if (options.listeningAddr?.getPath() != null) { - options.remoteAddr = options.listeningAddr; - } - if (options.remoteAddr?.getPath() != null) { - options.localAddr = options.remoteAddr; - } - let remoteAddr; - if (options.remoteAddr != null) { - remoteAddr = options.remoteAddr; - } - else { - if (socket.remoteAddress == null || socket.remotePort == null) { - // this can be undefined if the socket is destroyed (for example, if the client disconnected) - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#socketremoteaddress - throw new CodeError('Could not determine remote address or port', 'ERR_NO_REMOTE_ADDRESS'); - } - remoteAddr = toMultiaddr(socket.remoteAddress, socket.remotePort); - } - const lOpts = multiaddrToNetConfig(remoteAddr); - const lOptsStr = lOpts.path ?? `${lOpts.host ?? ''}:${lOpts.port ?? ''}`; - const { sink, source } = toIterable.duplex(socket); - // by default there is no timeout - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#socketsettimeouttimeout-callback - socket.setTimeout(inactivityTimeout, () => { - log('%s socket read timeout', lOptsStr); - metrics?.increment({ [`${metricPrefix}timeout`]: true }); - // only destroy with an error if the remote has not sent the FIN message - let err; - if (socket.readable) { - err = new CodeError('Socket read timeout', 'ERR_SOCKET_READ_TIMEOUT'); - } - // if the socket times out due to inactivity we must manually close the connection - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#event-timeout - socket.destroy(err); - }); - socket.once('close', () => { - log('%s socket close', lOptsStr); - metrics?.increment({ [`${metricPrefix}close`]: true }); - // In instances where `close` was not explicitly called, - // such as an iterable stream ending, ensure we have set the close - // timeline - if (maConn.timeline.close == null) { - maConn.timeline.close = Date.now(); - } - }); - socket.once('end', () => { - // the remote sent a FIN packet which means no more data will be sent - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#event-end - log('%s socket end', lOptsStr); - metrics?.increment({ [`${metricPrefix}end`]: true }); - }); - const maConn = { - async sink(source) { - try { - await sink((async function* () { - for await (const buf of source) { - if (buf instanceof Uint8Array) { - yield buf; - } - else { - // is it faster to yield all the buffers or just one big buffer? - yield * buf; - } - } - })()); - } - catch (err) { - // If aborted we can safely ignore - if (err.type !== 'aborted') { - // If the source errored the socket will already have been destroyed by - // toIterable.duplex(). If the socket errored it will already be - // destroyed. There's nothing to do here except log the error & return. - log(err); - } - } - // we have finished writing, send the FIN message - socket.end(); - }, - source, - // If the remote address was passed, use it - it may have the peer ID encapsulated - remoteAddr, - timeline: { open: Date.now() }, - async close(options = {}) { - if (socket.destroyed) { - log('%s socket was already destroyed when trying to close', lOptsStr); - return; - } - if (options.signal == null) { - const signal = AbortSignal.timeout(closeTimeout); - options = { - ...options, - signal - }; - } - try { - log('%s closing socket', lOptsStr); - await new Promise((resolve, reject) => { - socket.once('close', () => { - // socket completely closed - log('%s socket closed', lOptsStr); - resolve(); - }); - socket.once('error', (err) => { - log('%s socket error', lOptsStr, err); - // error closing socket - if (maConn.timeline.close == null) { - maConn.timeline.close = Date.now(); - } - reject(err); - }); - // shorten inactivity timeout - socket.setTimeout(closeTimeout); - // close writable end of the socket - socket.end(); - if (socket.writableLength > 0) { - // there are outgoing bytes waiting to be sent - socket.once('drain', () => { - log('%s socket drained', lOptsStr); - // all bytes have been sent we can destroy the socket (maybe) before the timeout - socket.destroy(); - }); - } - else { - // nothing to send, destroy immediately, no need for the timeout - socket.destroy(); - } - }); - } - catch (err) { - this.abort(err); - } - }, - abort: (err) => { - log('%s socket abort due to error', lOptsStr, err); - socket.destroy(err); - }, - log - }; - return maConn; -}; -//# sourceMappingURL=socket-to-conn.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/socket-to-conn.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/socket-to-conn.js.map deleted file mode 100644 index 0814b79a2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/socket-to-conn.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"socket-to-conn.js","sourceRoot":"","sources":["../../src/socket-to-conn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,iBAAiB,IAAI,WAAW,EAAE,MAAM,oCAAoC,CAAA;AACrF,4BAA4B;AAC5B,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAkBjD;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAc,EAAE,OAA4B,EAAuB,EAAE;IACzG,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAA;IAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;IAC/B,MAAM,YAAY,GAAG,OAAO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BAClC,GAAG,CAAC,iBAAiB,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAA;wBAErC,uBAAuB;wBACvB,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,IAAI,IAAI,EAAE;4BACjC,MAAM,CAAC,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;yBACnC;wBAED,MAAM,CAAC,GAAG,CAAC,CAAA;oBACb,CAAC,CAAC,CAAA;oBAEF,6BAA6B;oBAC7B,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAA;oBAE/B,mCAAmC;oBACnC,MAAM,CAAC,GAAG,EAAE,CAAA;oBAEZ,IAAI,MAAM,CAAC,cAAc,GAAG,CAAC,EAAE;wBAC7B,8CAA8C;wBAC9C,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE;4BACxB,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAA;4BAElC,gFAAgF;4BAChF,MAAM,CAAC,OAAO,EAAE,CAAA;wBAClB,CAAC,CAAC,CAAA;qBACH;yBAAM;wBACL,gEAAgE;wBAChE,MAAM,CAAC,OAAO,EAAE,CAAA;qBACjB;gBACH,CAAC,CAAC,CAAA;aACH;YAAC,OAAO,GAAQ,EAAE;gBACjB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;aAChB;QACH,CAAC;QAED,KAAK,EAAE,CAAC,GAAU,EAAE,EAAE;YACpB,GAAG,CAAC,8BAA8B,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAA;YAElD,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QACrB,CAAC;QAED,GAAG;KACJ,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/utils.d.ts deleted file mode 100644 index fcaacb7f9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/utils.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// -import type { Multiaddr } from '@multiformats/multiaddr'; -import type { ListenOptions, IpcSocketConnectOpts, TcpSocketConnectOpts } from 'net'; -export type NetConfig = ListenOptions | (IpcSocketConnectOpts & TcpSocketConnectOpts); -export declare function multiaddrToNetConfig(addr: Multiaddr, config?: NetConfig): NetConfig; -export declare function getMultiaddrs(proto: 'ip4' | 'ip6', ip: string, port: number): Multiaddr[]; -export declare function isAnyAddr(ip: string): boolean; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/utils.d.ts.map deleted file mode 100644 index c29db63f2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,KAAK,CAAA;AAIpF,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,CAAC,oBAAoB,GAAG,oBAAoB,CAAC,CAAA;AAErF,wBAAgB,oBAAoB,CAAE,IAAI,EAAE,SAAS,EAAE,MAAM,GAAE,SAAc,GAAG,SAAS,CAexF;AAED,wBAAgB,aAAa,CAAE,KAAK,EAAE,KAAK,GAAG,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CAG1F;AAED,wBAAgB,SAAS,CAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAE9C"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/utils.js deleted file mode 100644 index 6516cfd6d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/utils.js +++ /dev/null @@ -1,41 +0,0 @@ -import os from 'os'; -import path from 'path'; -import { multiaddr } from '@multiformats/multiaddr'; -const ProtoFamily = { ip4: 'IPv4', ip6: 'IPv6' }; -export function multiaddrToNetConfig(addr, config = {}) { - const listenPath = addr.getPath(); - // unix socket listening - if (listenPath != null) { - if (os.platform() === 'win32') { - // Use named pipes on Windows systems. - return { path: path.join('\\\\.\\pipe\\', listenPath) }; - } - else { - return { path: listenPath }; - } - } - // tcp listening - return { ...config, ...addr.toOptions() }; -} -export function getMultiaddrs(proto, ip, port) { - const toMa = (ip) => multiaddr(`/${proto}/${ip}/tcp/${port}`); - return (isAnyAddr(ip) ? getNetworkAddrs(ProtoFamily[proto]) : [ip]).map(toMa); -} -export function isAnyAddr(ip) { - return ['0.0.0.0', '::'].includes(ip); -} -const networks = os.networkInterfaces(); -function getNetworkAddrs(family) { - const addresses = []; - for (const [, netAddrs] of Object.entries(networks)) { - if (netAddrs != null) { - for (const netAddr of netAddrs) { - if (netAddr.family === family) { - addresses.push(netAddr.address); - } - } - } - } - return addresses; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/utils.js.map deleted file mode 100644 index 882084ffd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/src/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OA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E,CAAC,iBAAiB,EAAE,CAAA;AAEvC,SAAS,eAAe,CAAE,MAAc;IACtC,MAAM,SAAS,GAAa,EAAE,CAAA;IAE9B,KAAK,MAAM,CAAC,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QACnD,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;gBAC9B,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE;oBAC7B,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;iBAChC;aACF;SACF;KACF;IAED,OAAO,SAAS,CAAA;AAClB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/compliance.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/compliance.spec.d.ts deleted file mode 100644 index dac08d9d2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/compliance.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=compliance.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/compliance.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/compliance.spec.d.ts.map deleted file mode 100644 index dc9e71995..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/compliance.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.d.ts","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/compliance.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/compliance.spec.js deleted file mode 100644 index a9a426d73..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/compliance.spec.js +++ /dev/null @@ -1,43 +0,0 @@ -import net from 'net'; -import tests from '@libp2p/interface-compliance-tests/transport'; -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import sinon from 'sinon'; -import { tcp } from '../src/index.js'; -describe('interface-transport compliance', () => { - tests({ - async setup() { - const transport = tcp()({ - logger: defaultLogger() - }); - const addrs = [ - multiaddr('/ip4/127.0.0.1/tcp/9091'), - multiaddr('/ip4/127.0.0.1/tcp/9092'), - multiaddr('/ip4/127.0.0.1/tcp/9093'), - multiaddr('/ip6/::/tcp/9094') - ]; - // Used by the dial tests to simulate a delayed connect - const connector = { - delay(delayMs) { - const netConnect = net.connect; - sinon.replace(net, 'connect', (opts) => { - const socket = netConnect(opts); - const socketEmit = socket.emit.bind(socket); - sinon.replace(socket, 'emit', (...args) => { - const time = args[0] === 'connect' ? delayMs : 0; - setTimeout(() => socketEmit(...args), time); - return true; - }); - return socket; - }); - }, - restore() { - sinon.restore(); - } - }; - return { transport, addrs, connector }; - }, - async teardown() { } - }); -}); -//# sourceMappingURL=compliance.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/compliance.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/compliance.spec.js.map deleted file mode 100644 index 1f1b3b2ef..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/compliance.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.js","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,KAAK,MAAM,8CAA8C,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,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CAAC;gBACD,OAAO;oBACL,KAAK,CAAC,OAAO,EAAE,CAAA;gBACjB,CAAC;aACF,CAAA;YAED,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAA;QACxC,CAAC;QACD,KAAK,CAAC,QAAQ,KAAK,CAAC;KACrB,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection-limits.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection-limits.spec.d.ts deleted file mode 100644 index 502dc4ab3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection-limits.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=connection-limits.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection-limits.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection-limits.spec.d.ts.map deleted file mode 100644 index 4512df906..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection-limits.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-limits.spec.d.ts","sourceRoot":"","sources":["../../test/connection-limits.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection-limits.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection-limits.spec.js deleted file mode 100644 index 577c74dfd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection-limits.spec.js +++ /dev/null @@ -1,188 +0,0 @@ -import net from 'node:net'; -import { promisify } from 'util'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { tcp } from '../src/index.js'; -const buildSocketAssertions = (port, closeCallbacks) => { - function createSocket(i) { - const socket = net.connect({ host: '127.0.0.1', port }); - closeCallbacks.unshift(async function closeHandler() { - if (!socket.destroyed) { - socket.destroy(); - await new Promise((resolve) => socket.on('close', resolve)); - } - }); - return socket; - } - async function assertConnectedSocket(i) { - const socket = createSocket(i); - await new Promise((resolve, reject) => { - socket.once('connect', () => { - resolve(); - }); - socket.once('error', (err) => { - err.message = `Socket[${i}] ${err.message}`; - reject(err); - }); - }); - return socket; - } - async function assertRefusedSocket(i) { - const socket = createSocket(i); - await new Promise((resolve, reject) => { - socket.once('connect', () => { - reject(Error(`Socket[${i}] connected but was expected to reject`)); - }); - socket.once('error', (err) => { - if (err.message.includes('ECONNREFUSED')) { - resolve(); - } - else { - err.message = `Socket[${i}] unexpected error ${err.message}`; - reject(err); - } - }); - }); - return socket; - } - return { assertConnectedSocket, assertRefusedSocket }; -}; -async function assertServerConnections(listener, connections) { - // Expect server connections but allow time for sockets to connect or disconnect - for (let i = 0; i < 100; i++) { - // eslint-disable-next-line @typescript-eslint/dot-notation - if (listener['connections'].size === connections) { - return; - } - else { - await promisify(setTimeout)(10); - } - } - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(listener['connections'].size).equals(connections, 'invalid amount of server connections'); -} -describe('closeAbove/listenBelow', () => { - const afterEachCallbacks = []; - afterEach(async () => { - await Promise.all(afterEachCallbacks.map(fn => fn())); - afterEachCallbacks.length = 0; - }); - it('reject dial of connection above closeAbove', async () => { - const listenBelow = 2; - const closeAbove = 3; - const port = 9900; - const trasnport = tcp({ closeServerOnMaxConnections: { listenBelow, closeAbove } })({ - logger: defaultLogger() - }); - const upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - const listener = trasnport.createListener({ upgrader }); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.push(() => listener.close()); - await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`)); - const { assertConnectedSocket, assertRefusedSocket } = buildSocketAssertions(port, afterEachCallbacks); - await assertConnectedSocket(1); - await assertConnectedSocket(2); - await assertConnectedSocket(3); - await assertServerConnections(listener, 3); - // Limit reached, server should be closed here - await assertRefusedSocket(4); - await assertRefusedSocket(5); - await assertServerConnections(listener, 3); - }); - it('accepts dial of connection when connection drop listenBelow limit', async () => { - const listenBelow = 2; - const closeAbove = 3; - const port = 9900; - const trasnport = tcp({ closeServerOnMaxConnections: { listenBelow, closeAbove } })({ - logger: defaultLogger() - }); - const upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - const listener = trasnport.createListener({ upgrader }); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.push(() => listener.close()); - await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`)); - const { assertConnectedSocket } = buildSocketAssertions(port, afterEachCallbacks); - const socket1 = await assertConnectedSocket(1); - const socket2 = await assertConnectedSocket(2); - await assertConnectedSocket(3); - await assertServerConnections(listener, 3); - // Destroy sockets to be have connections < listenBelow - socket1.destroy(); - socket2.destroy(); - // After destroying 2 sockets connections will be below "listenBelow" limit - await assertServerConnections(listener, 1); - // Now it should be able to accept new connections - await assertConnectedSocket(4); - await assertConnectedSocket(5); - // 2 connections dropped and 2 new connections accepted - await assertServerConnections(listener, 3); - }); - it('should not emit "close" event when server is stopped due to "closeAbove" limit', async () => { - const listenBelow = 2; - const closeAbove = 3; - const port = 9900; - const trasnport = tcp({ closeServerOnMaxConnections: { listenBelow, closeAbove } })({ - logger: defaultLogger() - }); - const upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - const listener = trasnport.createListener({ upgrader }); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.push(() => listener.close()); - let closeEventCallCount = 0; - listener.addEventListener('close', () => { - closeEventCallCount += 1; - }); - await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`)); - const { assertConnectedSocket } = buildSocketAssertions(port, afterEachCallbacks); - await assertConnectedSocket(1); - await assertConnectedSocket(2); - await assertConnectedSocket(3); - await assertServerConnections(listener, 3); - // Limit reached, server should be closed but should not emit "close" event - expect(closeEventCallCount).equals(0); - }); - it('should emit "listening" event when server is resumed due to "listenBelow" limit', async () => { - const listenBelow = 2; - const closeAbove = 3; - const port = 9900; - const trasnport = tcp({ closeServerOnMaxConnections: { listenBelow, closeAbove } })({ - logger: defaultLogger() - }); - const upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - const listener = trasnport.createListener({ upgrader }); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.push(() => listener.close()); - let listeningEventCallCount = 0; - listener.addEventListener('listening', () => { - listeningEventCallCount += 1; - }); - await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`)); - const { assertConnectedSocket } = buildSocketAssertions(port, afterEachCallbacks); - // Server should be listening now - expect(listeningEventCallCount).equals(1); - const socket1 = await assertConnectedSocket(1); - const socket2 = await assertConnectedSocket(2); - await assertConnectedSocket(3); - // Limit reached, server should be closed now - await assertServerConnections(listener, 3); - // Close some sockets to resume listening - socket1.destroy(); - socket2.destroy(); - // Wait for listener to emit event - await promisify(setTimeout)(50); - // Server should emit the "listening" event again - expect(listeningEventCallCount).equals(2); - }); -}); -//# sourceMappingURL=connection-limits.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection-limits.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection-limits.spec.js.map deleted file mode 100644 index 801ffd48b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection-limits.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection-limits.spec.js","sourceR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GAAG,CAAC,CAAA;QAC/B,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,GAAG,EAAE;YAC1C,uBAAuB,IAAI,CAAC,CAAA;QAC9B,CAAC,CAAC,CAAA;QAEF,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,sBAAsB,IAAI,EAAE,CAAC,CAAC,CAAA;QAC9D,MAAM,EAAE,qBAAqB,EAAE,GAAG,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAA;QAEjF,iCAAiC;QACjC,MAAM,CAAC,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QAEzC,MAAM,OAAO,GAAG,MAAM,qBAAqB,CAAC,CAAC,CAAC,CAAA;QAC9C,MAAM,OAAO,GAAG,MAAM,qBAAqB,CAAC,CAAC,CAAC,CAAA;QAC9C,MAAM,qBAAqB,CAAC,CAAC,CAAC,CAAA;QAC9B,6CAA6C;QAC7C,MAAM,uBAAuB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;QAE1C,yCAAyC;QACzC,OAAO,CAAC,OAAO,EAAE,CAAA;QACjB,OAAO,CAAC,OAAO,EAAE,CAAA;QAEjB,kCAAkC;QAClC,MAAM,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAA;QAE/B,iDAAiD;QACjD,MAAM,CAAC,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection.spec.d.ts deleted file mode 100644 index 91628ea6f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=connection.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection.spec.d.ts.map deleted file mode 100644 index a6153fade..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection.spec.d.ts","sourceRoot":"","sources":["../../test/connection.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection.spec.js deleted file mode 100644 index d4bed18d2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection.spec.js +++ /dev/null @@ -1,73 +0,0 @@ -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { tcp } from '../src/index.js'; -describe('valid localAddr and remoteAddr', () => { - let transport; - let upgrader; - beforeEach(() => { - transport = tcp()({ - logger: defaultLogger() - }); - upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - }); - const ma = multiaddr('/ip4/127.0.0.1/tcp/0'); - it('should resolve port 0', async () => { - // Create a Promise that resolves when a connection is handled - let handled; - const handlerPromise = new Promise(resolve => { handled = resolve; }); - const handler = (conn) => { handled(conn); }; - // Create a listener with the handler - const listener = transport.createListener({ - handler, - upgrader - }); - // Listen on the multi-address - await listener.listen(ma); - const localAddrs = listener.getAddrs(); - expect(localAddrs.length).to.equal(1); - // Dial to that address - await transport.dial(localAddrs[0], { - upgrader - }); - // Wait for the incoming dial to be handled - await handlerPromise; - // Close the listener - await listener.close(); - }); - it('should handle multiple simultaneous closes', async () => { - // Create a Promise that resolves when a connection is handled - let handled; - const handlerPromise = new Promise(resolve => { handled = resolve; }); - const handler = (conn) => { handled(conn); }; - // Create a listener with the handler - const listener = transport.createListener({ - handler, - upgrader - }); - // Listen on the multi-address - await listener.listen(ma); - const localAddrs = listener.getAddrs(); - expect(localAddrs.length).to.equal(1); - // Dial to that address - const dialerConn = await transport.dial(localAddrs[0], { - upgrader - }); - // Wait for the incoming dial to be handled - await handlerPromise; - // Close the dialer with two simultaneous calls to `close` - await Promise.race([ - new Promise((resolve, reject) => setTimeout(() => { reject(new Error('Timed out waiting for connection close')); }, 500)), - await Promise.all([ - dialerConn.close(), - dialerConn.close() - ]) - ]); - await listener.close(); - }); -}); -//# sourceMappingURL=connection.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection.spec.js.map deleted file mode 100644 index 7dc8f31d7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/connection.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"connection.spec.js","sourceRoot":"","sources":["../../test/connection.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAIrC,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,IAAI,SAAoB,CAAA;IACxB,IAAI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p2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/filter.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/filter.spec.d.ts deleted file mode 100644 index ab805424d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/filter.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=filter.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/filter.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/filter.spec.d.ts.map deleted file mode 100644 index cdd7b3f4c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/filter.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"filter.spec.d.ts","sourceRoot":"","sources":["../../test/filter.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/filter.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/filter.spec.js deleted file mode 100644 index 944a2d63c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/filter.spec.js +++ /dev/null @@ -1,38 +0,0 @@ -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { tcp } from '../src/index.js'; -describe('filter addrs', () => { - const base = '/ip4/127.0.0.1'; - const ipfs = '/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'; - const unix = '/tmp/some/file.sock'; - let transport; - before(() => { - transport = tcp()({ - logger: defaultLogger() - }); - }); - it('filter valid addrs for this transport', () => { - const ma1 = multiaddr(base + '/tcp/9090'); - const ma2 = multiaddr(base + '/udp/9090'); - const ma3 = multiaddr(base + '/tcp/9090/http'); - const ma4 = multiaddr(base + '/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'); - const ma5 = multiaddr(base + '/tcp/9090/http' + ipfs); - const ma6 = multiaddr('/ip4/127.0.0.1/tcp/9090/p2p-circuit' + ipfs); - const ma7 = multiaddr('/dns4/libp2p.io/tcp/9090'); - const ma8 = multiaddr('/dnsaddr/libp2p.io/tcp/9090'); - const ma9 = multiaddr('/unix' + unix); - const valid = transport.filter([ma1, ma2, ma3, ma4, ma5, ma6, ma7, ma8, ma9]); - expect(valid.length).to.equal(5); - expect(valid[0]).to.deep.equal(ma1); - expect(valid[1]).to.deep.equal(ma4); - expect(valid[4]).to.deep.equal(ma9); - }); - it('filter a single addr for this transport', () => { - const ma1 = multiaddr(base + '/tcp/9090'); - const valid = transport.filter([ma1]); - expect(valid.length).to.equal(1); - expect(valid[0]).to.eql(ma1); - }); -}); -//# sourceMappingURL=filter.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/filter.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/filter.spec.js.map deleted file mode 100644 index 6ffefe6d8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/filter.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"filter.spec.js","sourceRoot":"","sources":["../../test/filter.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAGrC,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,MAAM,IAAI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E,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACnC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACnC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,GAAG,WAAW,CAAC,CAAA;QAEzC,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;QACrC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAChC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC9B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/listen-dial.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/listen-dial.spec.d.ts deleted file mode 100644 index a90db0054..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/listen-dial.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=listen-dial.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/listen-dial.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/listen-dial.spec.d.ts.map deleted file mode 100644 index e2e65e44e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/listen-dial.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listen-dial.spec.d.ts","sourceRoot":"","sources":["../../test/listen-dial.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/listen-dial.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/listen-dial.spec.js deleted file mode 100644 index db2b02346..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/listen-dial.spec.js +++ /dev/null @@ -1,308 +0,0 @@ -import os from 'os'; -import path from 'path'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockRegistrar, mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import all from 'it-all'; -import { pipe } from 'it-pipe'; -import pDefer from 'p-defer'; -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; -import { tcp } from '../src/index.js'; -const isCI = process.env.CI; -describe('listen', () => { - let transport; - let listener; - let upgrader; - beforeEach(() => { - transport = tcp()({ - logger: defaultLogger() - }); - upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - }); - afterEach(async () => { - try { - if (listener != null) { - await listener.close(); - } - } - catch { - // some tests close the listener so ignore errors - } - }); - it('listen on path', async () => { - const mh = multiaddr(`/unix/${path.resolve(os.tmpdir(), `/tmp/p2pd-${Date.now()}.sock`)}`); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - }); - it('listen on port 0', async () => { - const mh = multiaddr('/ip4/127.0.0.1/tcp/0'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - }); - it('errors when listening on busy port', async () => { - const mh = multiaddr('/ip4/127.0.0.1/tcp/0'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const listener2 = transport.createListener({ - upgrader - }); - const mh2 = listener.getAddrs()[0]; - await expect(listener2.listen(mh2)).to.eventually.be.rejected() - .with.property('code', 'EADDRINUSE'); - }); - it('listen on IPv6 addr', async () => { - if (isCI != null) { - return; - } - const mh = multiaddr('/ip6/::/tcp/9090'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - }); - it('listen on any Interface', async () => { - const mh = multiaddr('/ip4/0.0.0.0/tcp/9090'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - }); - it('getAddrs', async () => { - const mh = multiaddr('/ip4/127.0.0.1/tcp/9090'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length).to.equal(1); - expect(multiaddrs[0]).to.deep.equal(mh); - }); - it('getAddrs on port 0 listen', async () => { - const mh = multiaddr('/ip4/127.0.0.1/tcp/0'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length).to.equal(1); - }); - it('getAddrs from listening on 0.0.0.0', async () => { - const mh = multiaddr('/ip4/0.0.0.0/tcp/9090'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length > 0).to.equal(true); - expect(multiaddrs[0].toString().indexOf('0.0.0.0')).to.equal(-1); - }); - it('getAddrs from listening on 0.0.0.0 and port 0', async () => { - const mh = multiaddr('/ip4/0.0.0.0/tcp/0'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length > 0).to.equal(true); - expect(multiaddrs[0].toString().indexOf('0.0.0.0')).to.equal(-1); - }); - it('getAddrs from listening on ip6 \'::\'', async () => { - const mh = multiaddr('/ip6/::/tcp/9090'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length > 0).to.equal(true); - expect(multiaddrs[0].toOptions().host).to.not.equal('::'); - }); - it('getAddrs preserves IPFS Id', async () => { - const mh = multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'); - listener = transport.createListener({ - upgrader - }); - await listener.listen(mh); - const multiaddrs = listener.getAddrs(); - expect(multiaddrs.length).to.equal(1); - expect(multiaddrs[0]).to.deep.equal(mh); - }); -}); -describe('dial', () => { - const protocol = '/echo/1.0.0'; - let transport; - let upgrader; - beforeEach(async () => { - const registrar = mockRegistrar(); - void registrar.handle(protocol, (evt) => { - void pipe(evt.stream, evt.stream); - }); - upgrader = mockUpgrader({ - registrar, - events: new TypedEventEmitter() - }); - transport = tcp()({ - logger: defaultLogger() - }); - }); - it('dial on IPv4', async () => { - const ma = multiaddr('/ip4/127.0.0.1/tcp/9090'); - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const conn = await transport.dial(ma, { - upgrader - }); - const stream = await conn.newStream([protocol]); - const values = await pipe([uint8ArrayFromString('hey')], stream, async (source) => all(source)); - expect(values[0].subarray()).to.equalBytes(uint8ArrayFromString('hey')); - await conn.close(); - await listener.close(); - }); - it('dial on IPv6', async () => { - if (isCI != null) { - return; - } - const ma = multiaddr('/ip6/::/tcp/9090'); - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const conn = await transport.dial(ma, { - upgrader - }); - const stream = await conn.newStream([protocol]); - const values = await pipe([uint8ArrayFromString('hey')], stream, async (source) => all(source)); - expect(values[0].subarray()).to.equalBytes(uint8ArrayFromString('hey')); - await conn.close(); - await listener.close(); - }); - it('dial on path', async () => { - const ma = multiaddr(`/unix/${path.resolve(os.tmpdir(), `/tmp/p2pd-${Date.now()}.sock`)}`); - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const conn = await transport.dial(ma, { - upgrader - }); - const stream = await conn.newStream([protocol]); - const values = await pipe([uint8ArrayFromString('hey')], stream, async (source) => all(source)); - expect(values[0].subarray()).to.equalBytes(uint8ArrayFromString('hey')); - await conn.close(); - await listener.close(); - }); - it('dial and destroy on listener', async () => { - let handled; - const handledPromise = new Promise(resolve => { handled = resolve; }); - const ma = multiaddr('/ip6/::/tcp/9090'); - const listener = transport.createListener({ - handler: (conn) => { - // let multistream select finish before closing - setTimeout(() => { - void conn.close() - .then(() => { handled(); }); - }, 100); - }, - upgrader - }); - await listener.listen(ma); - const addrs = listener.getAddrs(); - const conn = await transport.dial(addrs[0], { - upgrader - }); - const stream = await conn.newStream([protocol]); - pipe(stream); - await handledPromise; - await conn.close(); - await listener.close(); - }); - it('dial and destroy on dialer', async () => { - if (isCI != null) { - return; - } - let handled; - const handledPromise = new Promise(resolve => { handled = resolve; }); - const ma = multiaddr('/ip6/::/tcp/9090'); - const listener = transport.createListener({ - handler: () => { - handled(); - }, - upgrader - }); - await listener.listen(ma); - const addrs = listener.getAddrs(); - const conn = await transport.dial(addrs[0], { - upgrader - }); - await conn.close(); - await handledPromise; - await listener.close(); - }); - it('dials on IPv4 with IPFS Id', async () => { - const ma = multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'); - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const conn = await transport.dial(ma, { - upgrader - }); - const stream = await conn.newStream([protocol]); - const values = await pipe([uint8ArrayFromString('hey')], stream, async (source) => all(source)); - expect(values[0].subarray()).to.equalBytes(uint8ArrayFromString('hey')); - await conn.close(); - await listener.close(); - }); - it('aborts during dial', async () => { - const ma = multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'); - const maConnPromise = pDefer(); - // @ts-expect-error missing return value - upgrader.upgradeOutbound = async (maConn) => { - maConnPromise.resolve(maConn); - // take a long time to give us time to abort the dial - await new Promise((resolve) => { - setTimeout(() => { resolve(); }, 100); - }); - }; - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const abortController = new AbortController(); - // abort once the upgrade process has started - void maConnPromise.promise.then(() => { abortController.abort(); }); - await expect(transport.dial(ma, { - upgrader, - signal: abortController.signal - })).to.eventually.be.rejected('The operation was aborted'); - await expect(maConnPromise.promise).to.eventually.have.nested.property('timeline.close') - .that.is.ok('did not gracefully close maConn'); - await listener.close(); - }); - it('aborts before dial', async () => { - const ma = multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw'); - const listener = transport.createListener({ - upgrader - }); - await listener.listen(ma); - const abortController = new AbortController(); - abortController.abort(); - await expect(transport.dial(ma, { - upgrader, - signal: abortController.signal - })).to.eventually.be.rejected('The operation was aborted'); - await listener.close(); - }); -}); -//# sourceMappingURL=listen-dial.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/listen-dial.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/listen-dial.spec.js.map deleted file mode 100644 index a83699924..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/listen-dial.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listen-dial.spec.js","sourceRoot":"","sources":["../../test/listen-dial.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,GAAG,MAAM,QAA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AAM,QAAQ,CAAC,KAAK,EAAE,CAAA;IACxB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/max-connections.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/max-connections.spec.d.ts deleted file mode 100644 index 72a08e916..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/max-connections.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=max-connections.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/max-connections.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/max-connections.spec.d.ts.map deleted file mode 100644 index ab2ee9d2f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/max-connections.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"max-connections.spec.d.ts","sourceRoot":"","sources":["../../test/max-connections.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/max-connections.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/max-connections.spec.js deleted file mode 100644 index ab083765e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/max-connections.spec.js +++ /dev/null @@ -1,73 +0,0 @@ -import net from 'node:net'; -import { promisify } from 'node:util'; -import { TypedEventEmitter } from '@libp2p/interface/events'; -import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'; -import { defaultLogger } from '@libp2p/logger'; -import { multiaddr } from '@multiformats/multiaddr'; -import { expect } from 'aegir/chai'; -import { tcp } from '../src/index.js'; -describe('maxConnections', () => { - const afterEachCallbacks = []; - afterEach(async () => { - await Promise.all(afterEachCallbacks.map(fn => fn())); - afterEachCallbacks.length = 0; - }); - it('reject dial of connection above maxConnections', async () => { - const maxConnections = 2; - const socketCount = 4; - const port = 9900; - const seenRemoteConnections = new Set(); - const transport = tcp({ maxConnections })({ - logger: defaultLogger() - }); - const upgrader = mockUpgrader({ - events: new TypedEventEmitter() - }); - const listener = transport.createListener({ upgrader }); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.push(() => listener.close()); - await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`)); - listener.addEventListener('connection', (conn) => { - seenRemoteConnections.add(conn.detail.remoteAddr.toString()); - }); - const sockets = []; - for (let i = 0; i < socketCount; i++) { - const socket = net.connect({ host: '127.0.0.1', port }); - sockets.push(socket); - // eslint-disable-next-line @typescript-eslint/promise-function-async - afterEachCallbacks.unshift(async () => { - if (!socket.destroyed) { - socket.destroy(); - await new Promise((resolve) => socket.on('close', resolve)); - } - }); - // Wait for connection so the order of sockets is stable, sockets expected to be alive are always [0,1] - await new Promise((resolve, reject) => { - socket.on('connect', () => { - resolve(); - }); - socket.on('error', (err) => { - reject(err); - }); - }); - } - // With server.maxConnections the TCP socket is created and the initial handshake is completed - // Then in the server handler NodeJS javascript code will call socket.emit('drop') if over the limit - // https://github.com/nodejs/node/blob/fddc701d3c0eb4520f2af570876cc987ae6b4ba2/lib/net.js#L1706 - // Wait for some time for server to drop all sockets above limit - await promisify(setTimeout)(250); - expect(seenRemoteConnections.size).equals(maxConnections, 'wrong serverConnections'); - for (let i = 0; i < socketCount; i++) { - const socket = sockets[i]; - if (i < maxConnections) { - // Assert socket connected - expect(socket.destroyed).equals(false, `socket ${i} under limit must not be destroyed`); - } - else { - // Assert socket ended - expect(socket.destroyed).equals(true, `socket ${i} above limit must be destroyed`); - } - } - }); -}); -//# sourceMappingURL=max-connections.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/max-connections.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/max-connections.spec.js.map deleted file mode 100644 index 232ec408b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/max-connections.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"max-connections.spec.js","sourceRoot":"","sources":["../../test/max-connections.spec.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAA;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAErC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,MAAM,kBAAkB,GAAoC,EAAE,CAAA;IAC9D,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,MAAM,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;QACrD,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gDAAgD,EAAE,KAAK,IAAI,EAAE;QAC9D,MAAM,cAAc,GAAG,CAAC,CAAA;QACxB,MAAM,WAAW,GAAG,CAAC,CAAA;QACrB,MAAM,IAAI,GAAG,IAAI,CAAA;QAEjB,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAU,CAAA;QAC/C,MAAM,SAAS,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uGAAuG;YACvG,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC1C,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;oBACxB,OAAO,EAAE,CAAA;gBACX,CAAC,CAAC,CAAA;gBACF,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;oBACzB,MAAM,CAAC,GAAG,CAAC,CAAA;gBACb,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;SACH;QAED,8FAA8F;QAC9F,oGAAoG;QACpG,gGAAgG;QAEhG,gEAAgE;QAChE,MAAM,SAAS,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAA;QAEhC,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,yBAAyB,CAAC,CAAA;QAEpF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,CAAC,EAAE,EAAE;YACpC,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;YAEzB,IAAI,CAAC,GAAG,cAAc,EAAE;gBACtB,0BAA0B;gBAC1B,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,oCAAoC,CAAC,CAAA;aACxF;iBAAM;gBACL,sBAAsB;gBACtB,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,gCAAgC,CAAC,CAAA;aACnF;SACF;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/socket-to-conn.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/socket-to-conn.spec.d.ts deleted file mode 100644 index ca7834908..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/socket-to-conn.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=socket-to-conn.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/socket-to-conn.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/socket-to-conn.spec.d.ts.map deleted file mode 100644 index a1baee8e2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/socket-to-conn.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"socket-to-conn.spec.d.ts","sourceRoot":"","sources":["../../test/socket-to-conn.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/socket-to-conn.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/socket-to-conn.spec.js deleted file mode 100644 index bbd6a547f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/socket-to-conn.spec.js +++ /dev/null @@ -1,326 +0,0 @@ -import { createServer, Socket } from 'net'; -import os from 'os'; -import { defaultLogger } from '@libp2p/logger'; -import { expect } from 'aegir/chai'; -import defer from 'p-defer'; -import { toMultiaddrConnection } from '../src/socket-to-conn.js'; -async function setup(opts) { - const serverListening = defer(); - const server = createServer(opts?.server); - server.listen(0, () => { - serverListening.resolve(); - }); - await serverListening.promise; - const serverSocket = defer(); - const clientSocket = defer(); - server.once('connection', (socket) => { - serverSocket.resolve(socket); - }); - const address = server.address(); - if (address == null || typeof address === 'string') { - throw new Error('Wrong socket type'); - } - const client = new Socket(opts?.client); - client.once('connect', () => { - clientSocket.resolve(client); - }); - client.connect(address.port, address.address); - return { - server, - serverSocket: await serverSocket.promise, - clientSocket: await clientSocket.promise - }; -} -describe('socket-to-conn', () => { - let server; - let clientSocket; - let serverSocket; - afterEach(async () => { - if (serverSocket != null) { - serverSocket.destroy(); - } - if (clientSocket != null) { - clientSocket.destroy(); - } - if (server != null) { - server.close(); - } - }); - it('should destroy a socket that is closed by the client', async () => { - ({ server, clientSocket, serverSocket } = await setup()); - // promise that is resolved when client socket is closed - const clientClosed = defer(); - // promise that is resolved when client socket errors - const clientErrored = defer(); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - // promise that is resolved when our outgoing socket errors - const serverErrored = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - clientSocket.once('close', () => { - clientClosed.resolve(true); - }); - clientSocket.once('error', err => { - clientErrored.resolve(err); - }); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - serverSocket.once('error', err => { - serverErrored.resolve(err); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - // close the client for writing - clientSocket.end(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket that is forcibly closed by the client', async () => { - ({ server, clientSocket, serverSocket } = await setup()); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - // promise that is resolved when our outgoing socket errors - const serverErrored = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - serverSocket.once('error', err => { - serverErrored.resolve(err); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - // close the client for reading and writing immediately - clientSocket.destroy(); - // client closed the connection - error code is platform specific - if (os.platform() === 'linux') { - await expect(serverErrored.promise).to.eventually.have.property('code', 'ERR_SOCKET_READ_TIMEOUT'); - } - else { - await expect(serverErrored.promise).to.eventually.have.property('code', 'ECONNRESET'); - } - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket that is half-closed by the client', async () => { - ({ server, clientSocket, serverSocket } = await setup({ - client: { - allowHalfOpen: true - } - })); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - // promise that is resolved when our outgoing socket errors - const serverErrored = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - serverSocket.once('error', err => { - serverErrored.resolve(err); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - // close the client for writing - clientSocket.end(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // remote stopped sending us data - await expect(serverErrored.promise).to.eventually.have.property('code', 'ERR_SOCKET_READ_TIMEOUT'); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket after sinking', async () => { - ({ server, clientSocket, serverSocket } = await setup()); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - // promise that is resolved when our outgoing socket errors - const serverErrored = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - serverSocket.once('error', err => { - serverErrored.resolve(err); - }); - // send some data between the client and server - await inboundMaConn.sink(async function* () { - yield Uint8Array.from([0, 1, 2, 3]); - }()); - // server socket should no longer be writable - expect(serverSocket.writable).to.be.false(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // remote didn't send us any data - await expect(serverErrored.promise).to.eventually.have.property('code', 'ERR_SOCKET_READ_TIMEOUT'); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket when containing MultiaddrConnection is closed', async () => { - ({ server, clientSocket, serverSocket } = await setup()); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - socketCloseTimeout: 10, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - clientSocket.once('error', () => { }); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - await inboundMaConn.close(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket by timeout when containing MultiaddrConnection is closed', async () => { - ({ server, clientSocket, serverSocket } = await setup({ - server: { - allowHalfOpen: true - } - })); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - socketCloseTimeout: 10, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - clientSocket.once('error', () => { }); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - await inboundMaConn.close(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket by timeout when containing MultiaddrConnection is closed but remote keeps sending data', async () => { - ({ server, clientSocket, serverSocket } = await setup({ - server: { - allowHalfOpen: true - } - })); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 500, - socketCloseTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - clientSocket.once('error', () => { }); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - setInterval(() => { - clientSocket.write(`some data ${Date.now()}`); - }, 10).unref(); - await inboundMaConn.close(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); - it('should destroy a socket by timeout when containing MultiaddrConnection is closed but closing remote times out', async () => { - ({ server, clientSocket, serverSocket } = await setup()); - // promise that is resolved when our outgoing socket is closed - const serverClosed = defer(); - // promise that is resolved when our outgoing socket errors - const serverErrored = defer(); - const inboundMaConn = toMultiaddrConnection(serverSocket, { - socketInactivityTimeout: 100, - socketCloseTimeout: 100, - logger: defaultLogger() - }); - expect(inboundMaConn.timeline.open).to.be.ok(); - expect(inboundMaConn.timeline.close).to.not.be.ok(); - clientSocket.once('error', () => { }); - serverSocket.once('close', () => { - serverClosed.resolve(true); - }); - serverSocket.once('error', err => { - serverErrored.resolve(err); - }); - // send some data between the client and server - clientSocket.write('hello'); - serverSocket.write('goodbye'); - // stop reading data - clientSocket.pause(); - // have to write enough data quickly enough to overwhelm the client - while (serverSocket.writableLength < 1024) { - serverSocket.write('goodbyeeeeeeeeeeeeee'); - } - await inboundMaConn.close(); - // server socket should no longer be writable - expect(serverSocket.writable).to.be.false(); - // server socket was closed for reading and writing - await expect(serverClosed.promise).to.eventually.be.true(); - // remote didn't read our data - await expect(serverErrored.promise).to.eventually.have.property('code', 'ERR_SOCKET_READ_TIMEOUT'); - // the connection closing was recorded - expect(inboundMaConn.timeline.close).to.be.a('number'); - // server socket is destroyed - expect(serverSocket.destroyed).to.be.true(); - }); -}); -//# sourceMappingURL=socket-to-conn.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/socket-to-conn.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/socket-to-conn.spec.js.map deleted file mode 100644 index be1c043ad..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/test/socket-to-conn.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"socket-to-conn.spec.js","sourceRoot":"","sources":["../../test/socket-to-conn.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAA4D,MAAM,KAAK,CAAA;AACpG,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,KAAK,UAAU,KAAK,CAAE,IAA8D;IAClF,MAAM,eAAe,GAAG,KAAK,EAAE,CAAA;IAE/B,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACzC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE;QACpB,eAAe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AAC,SAAS,CAAC,CAAA;QAE7B,oBAAoB;QACpB,YAAY,CAAC,KAAK,EAAE,CAAA;QAEpB,mEAAmE;QACnE,OAAO,YAAY,CAAC,cAAc,GAAG,IAAI,EAAE;YACzC,YAAY,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;SAC3C;QAED,MAAM,aAAa,CAAC,KAAK,EAAE,CAAA;QAE3B,6CAA6C;QAC7C,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;QAE3C,mDAAmD;QACnD,MAAM,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QAE1D,8BAA8B;QAC9B,MAAM,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAA;QAElG,sCAAsC;QACtC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;QAEtD,6BAA6B;QAC7B,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;IAC7C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/tsconfig.tsbuildinfo deleted file mode 100644 index 5ad19c0e0..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/constants.ts","../../interface/dist/src/errors.d.ts","../../../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../../../node_modules/multiformats/dist/types/src/block/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../../../node_modules/multiformats/dist/types/src/link/interface.d.ts","../../../node_modules/multiformats/dist/types/src/cid.d.ts","../../interface/dist/src/peer-id/index.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../../interface/dist/src/peer-info/index.d.ts","../../interface/dist/src/content-routing/index.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../interface/dist/src/events.d.ts","../../interface/dist/src/metrics/index.d.ts","../../interface/dist/src/peer-routing/index.d.ts","../../interface/dist/src/peer-store/index.d.ts","../../interface/dist/src/startable.d.ts","../../interface/dist/src/stream-handler/index.d.ts","../../interface/dist/src/topology/index.d.ts","../../interface/dist/src/index.d.ts","../../../node_modules/it-stream-types/dist/src/index.d.ts","../../../node_modules/uint8arraylist/dist/src/index.d.ts","../../interface/dist/src/connection/index.d.ts","../../interface/dist/src/stream-muxer/index.d.ts","../../interface/dist/src/transport/index.d.ts","../../../node_modules/@multiformats/mafmt/dist/src/index.d.ts","../../utils/dist/src/ip-port-to-multiaddr.d.ts","../src/utils.ts","../src/socket-to-conn.ts","../src/listener.ts","../src/index.ts","../../interface-compliance-tests/dist/src/index.d.ts","../../interface-compliance-tests/dist/src/transport/index.d.ts","../../logger/dist/src/index.d.ts","../../../node_modules/@types/sinonjs__fake-timers/index.d.ts","../../../node_modules/@types/sinon/index.d.ts","../test/compliance.spec.ts","../../interface/dist/src/connection-gater/index.d.ts","../../interface-compliance-tests/dist/src/mocks/connection-gater.d.ts","../../../node_modules/it-pushable/dist/src/index.d.ts","../../interface/dist/src/pubsub/index.d.ts","../../peer-collections/dist/src/map.d.ts","../../peer-collections/dist/src/set.d.ts","../../peer-collections/dist/src/list.d.ts","../../peer-collections/dist/src/index.d.ts","../../interface-internal/dist/src/connection-manager/index.d.ts","../../interface-internal/dist/src/registrar/index.d.ts","../../interface-compliance-tests/dist/src/mocks/connection-manager.d.ts","../../interface-compliance-tests/dist/src/mocks/connection.d.ts","../../interface-compliance-tests/dist/src/mocks/multiaddr-connection.d.ts","../../utils/dist/src/abstract-stream.d.ts","../../interface-compliance-tests/dist/src/mocks/muxer.d.ts","../../interface-compliance-tests/dist/src/mocks/registrar.d.ts","../../interface-compliance-tests/dist/src/mocks/upgrader.d.ts","../../interface-compliance-tests/dist/src/mocks/duplex.d.ts","../../interface-compliance-tests/dist/src/mocks/metrics.d.ts","../../interface-compliance-tests/dist/src/mocks/index.d.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/@types/chai-as-promised/index.d.ts","../../../node_modules/chai-parentheses/index.d.ts","../../../node_modules/@types/chai-subset/index.d.ts","../../../node_modules/chai-bites/index.d.ts","../../../node_modules/@types/chai-string/index.d.ts","../../../node_modules/aegir/dist/utils/chai.d.ts","../test/connection-limits.spec.ts","../test/connection.spec.ts","../test/filter.spec.ts","../../../node_modules/it-all/dist/src/index.d.ts","../../../node_modules/it-pipe/dist/src/index.d.ts","../../../node_modules/p-defer/index.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../../../node_modules/multiformats/dist/types/src/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../../../node_modules/multiformats/dist/types/src/varint.d.ts","../../../node_modules/multiformats/dist/types/src/bytes.d.ts","../../../node_modules/multiformats/dist/types/src/index.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/raw.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/json.d.ts","../../../node_modules/multiformats/dist/types/src/bases/base.d.ts","../../../node_modules/multiformats/dist/types/src/basics.d.ts","../../../node_modules/uint8arrays/dist/src/util/bases.d.ts","../../../node_modules/uint8arrays/dist/src/from-string.d.ts","../test/listen-dial.spec.ts","../test/max-connections.spec.ts","../test/socket-to-conn.spec.ts","../../../node_modules/keyv/src/index.d.ts","../../../node_modules/@types/http-cache-semantics/index.d.ts","../../../node_modules/@types/responselike/index.d.ts","../../../node_modules/@types/cacheable-request/index.d.ts","../../../node_modules/@types/ms/index.d.ts","../../../node_modules/@types/debug/index.d.ts","../../../node_modules/@types/dns-packet/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/keyv/index.d.ts","../../../node_modules/@types/linkify-it/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/lodash.random/index.d.ts","../../../node_modules/@types/lodash.range/index.d.ts","../../../node_modules/@types/mdurl/encode.d.ts","../../../node_modules/@types/mdurl/decode.d.ts","../../../node_modules/@types/mdurl/parse.d.ts","../../../node_modules/@types/mdurl/format.d.ts","../../../node_modules/@types/mdurl/index.d.ts","../../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../../node_modules/@types/markdown-it/lib/token.d.ts","../../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../../node_modules/@types/markdown-it/lib/index.d.ts","../../../node_modules/@types/markdown-it/index.d.ts","../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/mdast/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/minimist/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/multicast-dns/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/retry/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/sinon-chai/index.d.ts","../../../node_modules/@types/strip-bom/index.d.ts","../../../node_modules/@types/strip-json-comments/index.d.ts","../../../node_modules/@types/which/index.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/@types/xsalsa20/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts","../../../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"de0ba34d2384a38c30f38e87b31bd91833c69a5982ab32ec668fd7424af46849","signature":"659e694bc8a9bb4b7f9e88bb9ed5e468553bb79655be46073907782c0a230cdd"},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","4369b27ca2716a04200930b5f24fa87a6ed62d8c70f80a83270956b6b23c32ae","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"8d6138a264ddc6f94f16e99d4e117a2d6eb31b217891cf091b6437a2f114d561","affectsGlobalScope":true},"a882b74c4ba115c6e86371f3592a3accb2c50874b6fcd92a4f83d17a4d6993af","4a8722c7d7a4dac1616db1f41ad0113998ccbbbcd37af43def3fbe6b41208c83","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"0b3868d3f87c95ea73bdfab380e536843ec3573aa76233b97aac40518494ea24","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","30c2ec6abf6aaa60eb4f32fb1235531506b7961c6d1bdc7430711aec8fd85295","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"d48009cbe8a30a504031cc82e1286f78fed33b7a42abf7602c23b5547b382563","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"24ba151e213906027e2b1f5223d33575a3612b0234a0e2b56119520bbe0e594b","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","28c1fc8505da2181ee74c9fe902fac964159cfae266c4413905d50eaecea8a19","84b8cc86ad19115f2637401cdd220460a25542df478c966a5ffc5eeaf3825299",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc","176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","1bf687d978bdd6d5aff10b9eb0ff0695179f8594d4446946fd0182d6d25fa433","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","5a16be1c0b59a91ed8de2c5699b7dad5e026d0315995eb75dcdd238be68b4be5","3d0fc7bb7dd39dc9df952e0fb97874ab25fd491392a4453fa7f4e65aef307ac9",{"version":"110cfb9b1e9ee74e80ba30f09f11c2ac736d8d22f7c218bcf499d1f22cb9665f","signature":"5cf5473735a956c4a6139812db63553581775fe34d14ab097c5fcd7ca03e84f0"},{"version":"ebd480a71e66942107907a4ad6e4f1a761f0ffbbdf1fb5ef6e5a4ed85140ee81","signature":"7ca4969ce0e2c0b679f9ce44846a7a8f78f6be7c1c0199143c053fc78061d09a"},{"version":"b1c33efa61ca3b6a2af1122a4c826a20fbada9e444d5a4000d419c30865b5b9f","signature":"0d6e9983d87ca882bd160af191909bce5c1d9b22f4bcb247d914b572cbddc076"},{"version":"fb1e831d934e1434623be095caedfc37eddf0b3fa2b12c284fd3ddce3572a44a","signature":"590815e7bd28778a71732b03b4852917e18bf42670cc1931e4f95ebe99157838"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","1dd1851e9ff4cfabdaa0aabb8db2b47de6b83aeda8413b7b09be3fc47654da49","cb4b40f34fe4b1d87c530a0f3c2c1e043e338829fab8cf5cbd92a91c8c1374b8","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2",{"version":"5b9845922dbc80d6b991193a227ab78001c9fb3ba2ae2c0fe4745f1e504c97de","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"7f2cc72a16a663ab9f8d99bd5658e583251ce0c003bf80a948973e15a7ef9596","f6e125b70d7118004733e6856a90163bbeb01a4633316fc2a2aaccbfca6ded6f","fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","03e385ae2125c9aa9dead008b42a0ab20d0812c26c19ee210d84c2666113f867","83a1426ac1a9cf144141dfe10d71a68629623a7c28245c9ca0e0352bead501fd","2726c0a6a4a87fad11e6846e6b0b40b8924fbe66340adc512093c4273bc53e4e","c888daaa99fdf6c5712d98605fdcf21cbbaab756a629661a44cac44ede464d37","e044f60686dc70015a3b7e7c64ad0ac5ec5ec101a0aede0782ec077e136b6a65","a232f867897bbecfebf68df575a417af1afd9b5dd3d83fb4d59e0a133a0de93d","228dbc8825b7a45af7d416dee95c0a2162d7cf73ffddfd52357b7e548882bdaa","46507ca157c8093e9b90b1c62be468ccb4aa693eaacae464b3935f6f24ccc9ff","af9a54fd33c9b0b2c05e433a71994ae07b75a3c4adbe82bdf6de863ce0f0e340","818068f6c587f5540e5cdc7b0f2ea6c04a0b9fe11745ca60f031bf349c17ba5c","75e0c62536016dac8cc0d825742ff7cc4c0455ebc86923e47edcc19edac0997c","d5840c8f2acfef007839d4e252ad45bf87219021c81de7de5cc98646f5d99d0d","f2601f76cd8ebb45e274730c33b44897fdea4bc742cb83fd98586754f08a3398","054dda98b75dec317926dddfb103939b99cccfc8ade63d7e6a2ef2f3343d37f9","a3f9f52ce73700565c8d9ba2aa75823ab8fc8e7258a27ecb828cd4257b8f918d","ad3490364b6442ca8694fc6cd364b63a5d807651a514837cc22ef29df624bb9d","4b5603a1ccca455500cfb39517d41ec011f31ba84bb6de44473344a237d89168",{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d",{"version":"4983ba4cc9c6d768887bfe5fd618ff2954bb68206282fa4a29e7eb4d0c1df478","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"1545b3a3656685251aa8b56ae4e8ecbbd4df62284dc2874e1e5ee7bb1d6f80ff","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"2a5f80090adbdc4a135707e558af382310da2c7051c88a1c9e639577a08946e6","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"5ccc3c7f73ef48c223635cd4506f21133560de7abc4c09c623327bb1b54386dc","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6","acd5d501223e3a7cdd229b501fce5fb071937b72bd05fa33e543eb21c8ee0aba","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","88de5467cd5e4c2c1384629806d56ac1215657bddf39ef9f60a0e05beee2b131","ff5820394809bfc32a7e4586ff11b3c07327a0f4c756709aef92f1cd73d6da48","bfe2af20f3ff0579331661ef4c5d2597e0c31a7a0d760e41eaff0502bf064c4d","f52a0e53f79d7fd1c1c55a3cbda59499d4cce75f3188969024cdc286b29ad3ea","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f",{"version":"2a9a98f0db379de58db189447b3c83fb4bcf617d837690a4f69c93dd5de62f9c","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"74ed4845b57c014f3d1642ba796be1d7c2afac634325949d242d764cb2b9e6e9","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"2827c4a7415fc665be3289cfefac6a0dc9c48135bc0b63bbcc2f05d27519e134","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","5bfd23a4c8765d347e296639b75f50f4dfca445d2eb41ea0892e68b8976a0cdf","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","b8442e9db28157344d1bc5d8a5a256f1692de213f0c0ddeb84359834015a008c","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","da2b6356b84a40111aaecb18304ea4e4fcb43d70efb1c13ca7d7a906445ee0d3","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","6f294731b495c65ecf46a5694f0082954b961cf05463bea823f8014098eaffa0","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","68a0d0c508e1b6d8d23a519a8a0a3303dc5baa4849ca049f21e5bad41945e3fc","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","b03afe4bec768ae333582915146f48b161e567a81b5ebc31c4d78af089770ac9","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","4f6a12044ee6f458db11964153830abbc499e73d065c51c329ec97407f4b13dd","13e834b958fe7e9010d2161497f98916974a0618be7a773281a253a948da8b0d","dae5c8e0ca15779492744cb4071c5b3c94c2121940fbaefb43ca9a045557a0c9","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"62a8effc4dd17bbc2c05927b4ca5f67e73fdb458e203b128c041d0d70ffa6b55","22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a",{"version":"525b52b38b44420fb1758c0917e7b67cf379f7f9477d2ba7343f3d5f50a44258","affectsGlobalScope":true},"4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","dc5fa6012f710446a9ed04156d986bd81d9119c93ecb63d85c6a9d493264b5dc","f7163a5d37d21f636f6a5cd1c064ce95fada21917859a64b6cc49a8b6fd5c1a8","5aac5efd20619b522faeeb0badf250834850c605ad8c5fb91c6502a54057f413","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[61,[176,179],185,[213,215],[232,234]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[71,153],[69,70,153],[123,126,152,153,160,235,236,237],[153,206],[153],[153,239],[153,160],[123,153,160],[153,259],[153,247,249,250,251,252,253,254,255,256,257,258,259],[153,247,248,250,251,252,253,254,255,256,257,258,259],[153,248,249,250,251,252,253,254,255,256,257,258,259],[153,247,248,249,251,252,253,254,255,256,257,258,259],[153,247,248,249,250,252,253,254,255,256,257,258,259],[153,247,248,249,250,251,253,254,255,256,257,258,259],[153,247,248,249,250,251,252,254,255,256,257,258,259],[153,247,248,249,250,251,252,253,255,256,257,258,259],[153,247,248,249,250,251,252,253,254,256,257,258,259],[153,247,248,249,250,251,252,253,254,255,257,258,259],[153,247,248,249,250,251,252,253,254,255,256,258,259],[153,247,248,249,250,251,252,253,254,255,256,257,259],[153,247,248,249,250,251,252,253,254,255,256,257,258],[153,281],[153,266],[153,270,271,272],[153,269],[153,271],[153,246,267,268,273,276,278,279,280],[153,268,274,275,281],[153,274,277],[153,268,269,274,281],[153,268,281],[153,283],[153,262,263,264,265],[117,123,153,160,241],[74,153],[110,153],[111,116,144,153],[112,123,124,131,141,152,153],[112,113,123,131,153],[114,153],[115,116,124,132,153],[116,141,149,153],[117,119,123,131,153],[118,153],[119,120,153],[123,153],[121,123,153],[110,123,153],[123,124,125,141,152,153],[123,124,125,138,141,144,153],[108,153,157],[119,123,126,131,141,152,153],[123,124,126,127,131,141,149,152,153],[126,128,141,149,152,153],[74,75,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159],[123,129,153],[130,152,153,157],[119,123,131,141,153],[132,153],[133,153],[110,134,153],[135,151,153,157],[136,153],[137,153],[123,138,139,153],[138,140,153,155],[111,123,141,142,143,144,153],[111,141,143,153],[141,142,153],[144,153],[145,153],[110,141,153],[123,147,148,153],[147,148,153],[116,131,141,149,153],[150,153],[131,151,153],[111,126,137,152,153],[116,153],[141,153,154],[130,153,155],[153,156],[111,116,123,125,134,141,152,153,155,157],[141,153,158],[126,141,153,160],[153,292,331],[153,292,316,331],[153,331],[153,292],[153,292,317,331],[153,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330],[153,317,331],[153,184,206],[153,183],[123,126,128,141,149,152,153,158,160],[153,338],[123,141,153,160],[153,206,207,208,209,210,211],[153,206,207],[153,169],[63,153],[153,225,226,227,228],[66,67,153],[66,153],[64,153],[153,219],[65,153],[65,153,221],[67,153,220,221,222,223,224],[63,64,65,66,153,219],[63,64,65,153],[153,230],[153,225,229],[85,89,152,153],[85,141,152,153],[80,153],[82,85,149,152,153],[131,149,153],[80,153,160],[82,85,131,152,153],[77,78,81,84,111,123,141,152,153],[77,83,153],[81,85,111,144,152,153,160],[111,153,160],[101,111,153,160],[79,80,153,160],[85,153],[79,80,81,82,83,84,85,86,87,89,90,91,92,93,94,95,96,97,98,99,100,102,103,104,105,106,107,153],[85,92,93,153],[83,85,93,94,153],[84,153],[77,80,85,153],[85,89,93,94,153],[89,153],[83,85,88,152,153],[77,82,83,85,89,92,153],[111,141,153],[80,85,101,111,153,157,160],[153,186],[68,71,153,161,168,189,194,195],[68,153,168,169,170,171,172,195],[153,169,170],[153,187,196,197,198,200,201,202,203,204],[153,162],[68,71,153,169,170,171],[153,171,172,188,199],[68,153,167,171,195],[153,161,168,173,195],[71,153,173,180],[68,71,153,168,171,193],[153,167,171],[68,71,153,171],[68,71,153,168,169,170],[67,72,153,168],[68,71,72,73,153,161,162,163,164,165,166,167,171,173],[153,171],[65,67,153],[68,71,153],[68,72,153,168],[68,153,161,170,171,188],[153,168,169,170,171],[68,153,171],[71,153,161,168,171,172],[68,153],[153,190,191,192],[61,62,71,131,153,162,168,171,173,174,176,177,178],[61,62,71,131,153,161,162,168,171,173,176,177,179],[61,62,71,131,153,162,168,171,175,176],[71,131,132,133,153],[71,131,153,179,181,182,184],[71,131,153,161,178,179,182,205,212],[71,153,161,171,173,179,182,205,212],[71,153,173,179,182,212],[71,132,133,153,161,171,173,179,182,205,212,216,217,218,231],[71,131,153,161,179,182,205,212],[131,132,153,177,182,212,218],[153,168,169,170,171,182],[71,162,168,173,178],[71,161,162,168,171,173,179],[71,131,162,168,171],[71,131]],"referencedMap":[[174,1],[70,1],[71,2],[69,1],[238,3],[207,4],[211,4],[209,4],[206,5],[240,6],[241,7],[236,5],[242,5],[243,5],[244,5],[245,8],[246,5],[260,9],[261,9],[248,10],[249,11],[247,12],[250,13],[251,14],[252,15],[253,16],[254,17],[255,18],[256,19],[257,20],[258,21],[259,22],[282,23],[267,24],[273,25],[271,5],[270,26],[272,27],[281,28],[276,29],[278,30],[279,31],[280,32],[274,5],[275,32],[277,32],[269,32],[268,5],[284,33],[263,5],[262,5],[265,24],[266,34],[264,24],[285,5],[286,5],[287,5],[239,5],[288,35],[74,36],[75,36],[110,37],[111,38],[112,39],[113,40],[114,41],[115,42],[116,43],[117,44],[118,45],[119,46],[120,46],[122,47],[121,48],[123,49],[124,50],[125,51],[109,52],[159,5],[126,53],[127,54],[128,55],[160,56],[129,57],[130,58],[131,59],[132,60],[133,61],[134,62],[135,63],[136,64],[137,65],[138,66],[139,66],[140,67],[141,68],[143,69],[142,70],[144,71],[145,72],[146,73],[147,74],[148,75],[149,76],[150,77],[151,78],[152,79],[153,80],[154,81],[155,82],[156,83],[157,84],[158,85],[289,5],[290,5],[237,86],[291,5],[316,87],[317,88],[292,89],[295,89],[314,87],[315,87],[305,87],[304,90],[302,87],[297,87],[310,87],[308,87],[312,87],[296,87],[309,87],[313,87],[298,87],[299,87],[311,87],[293,87],[300,87],[301,87],[303,87],[307,87],[318,91],[306,87],[294,87],[331,92],[330,5],[325,91],[327,93],[326,91],[319,91],[320,91],[322,91],[324,91],[328,93],[329,93],[321,93],[323,93],[332,94],[184,95],[183,5],[333,5],[334,5],[283,5],[335,5],[336,96],[337,7],[338,5],[339,97],[340,98],[212,99],[76,5],[210,4],[208,100],[216,5],[217,101],[188,5],[169,5],[235,47],[228,102],[63,5],[229,103],[64,104],[224,5],[67,105],[219,106],[227,107],[226,107],[221,108],[222,109],[65,5],[225,110],[220,111],[66,112],[223,5],[218,5],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[170,5],[231,113],[230,114],[92,115],[99,116],[91,115],[106,117],[83,118],[82,119],[105,7],[100,120],[103,121],[85,122],[84,123],[80,124],[79,125],[102,126],[81,127],[86,128],[87,5],[90,128],[77,5],[108,129],[107,128],[94,130],[95,131],[97,132],[93,133],[96,134],[101,7],[88,135],[89,136],[98,137],[78,138],[104,139],[180,5],[187,140],[196,141],[197,142],[203,143],[205,144],[204,145],[198,146],[200,147],[201,148],[202,149],[181,150],[194,151],[195,152],[186,153],[171,154],[73,155],[62,5],[161,8],[168,156],[162,157],[68,158],[72,159],[163,160],[164,159],[189,161],[165,5],[166,157],[172,162],[167,163],[173,164],[182,165],[193,166],[192,165],[190,165],[191,165],[61,5],[179,167],[178,168],[177,169],[176,170],[185,171],[213,172],[214,173],[215,174],[232,175],[233,176],[234,177],[199,178],[175,1]],"exportedModulesMap":[[174,1],[70,1],[71,2],[69,1],[238,3],[207,4],[211,4],[209,4],[206,5],[240,6],[241,7],[236,5],[242,5],[243,5],[244,5],[245,8],[246,5],[260,9],[261,9],[248,10],[249,11],[247,12],[250,13],[251,14],[252,15],[253,16],[254,17],[255,18],[256,19],[257,20],[258,21],[259,22],[282,23],[267,24],[273,25],[271,5],[270,26],[272,27],[281,28],[276,29],[278,30],[279,31],[280,32],[274,5],[275,32],[277,32],[269,32],[268,5],[284,33],[263,5],[262,5],[265,24],[266,34],[264,24],[285,5],[286,5],[287,5],[239,5],[288,35],[74,36],[75,36],[110,37],[111,38],[112,39],[113,40],[114,41],[115,42],[116,43],[117,44],[118,45],[119,46],[120,46],[122,47],[121,48],[123,49],[124,50],[125,51],[109,52],[159,5],[126,53],[127,54],[128,55],[160,56],[129,57],[130,58],[131,59],[132,60],[133,61],[134,62],[135,63],[136,64],[137,65],[138,66],[139,66],[140,67],[141,68],[143,69],[142,70],[144,71],[145,72],[146,73],[147,74],[148,75],[149,76],[150,77],[151,78],[152,79],[153,80],[154,81],[155,82],[156,83],[157,84],[158,85],[289,5],[290,5],[237,86],[291,5],[316,87],[317,88],[292,89],[295,89],[314,87],[315,87],[305,87],[304,90],[302,87],[297,87],[310,87],[308,87],[312,87],[296,87],[309,87],[313,87],[298,87],[299,87],[311,87],[293,87],[300,87],[301,87],[303,87],[307,87],[318,91],[306,87],[294,87],[331,92],[330,5],[325,91],[327,93],[326,91],[319,91],[320,91],[322,91],[324,91],[328,93],[329,93],[321,93],[323,93],[332,94],[184,95],[183,5],[333,5],[334,5],[283,5],[335,5],[336,96],[337,7],[338,5],[339,97],[340,98],[212,99],[76,5],[210,4],[208,100],[216,5],[217,101],[188,5],[169,5],[235,47],[228,102],[63,5],[229,103],[64,104],[224,5],[67,105],[219,106],[227,107],[226,107],[221,108],[222,109],[65,5],[225,110],[220,111],[66,112],[223,5],[218,5],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[170,5],[231,113],[230,114],[92,115],[99,116],[91,115],[106,117],[83,118],[82,119],[105,7],[100,120],[103,121],[85,122],[84,123],[80,124],[79,125],[102,126],[81,127],[86,128],[87,5],[90,128],[77,5],[108,129],[107,128],[94,130],[95,131],[97,132],[93,133],[96,134],[101,7],[88,135],[89,136],[98,137],[78,138],[104,139],[180,5],[187,140],[196,141],[197,142],[203,143],[205,144],[204,145],[198,146],[200,147],[201,148],[202,149],[181,150],[194,151],[195,152],[186,153],[171,154],[73,155],[62,5],[161,8],[168,156],[162,157],[68,158],[72,159],[163,160],[164,159],[189,161],[165,5],[166,157],[172,162],[167,163],[173,164],[182,165],[193,166],[192,165],[190,165],[191,165],[179,179],[178,180],[177,181],[176,182],[199,178],[175,1]],"semanticDiagnosticsPerFile":[174,70,71,69,238,207,211,209,206,240,241,236,242,243,244,245,246,260,261,248,249,247,250,251,252,253,254,255,256,257,258,259,282,267,273,271,270,272,281,276,278,279,280,274,275,277,269,268,284,263,262,265,266,264,285,286,287,239,288,74,75,110,111,112,113,114,115,116,117,118,119,120,122,121,123,124,125,109,159,126,127,128,160,129,130,131,132,133,134,135,136,137,138,139,140,141,143,142,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,289,290,237,291,316,317,292,295,314,315,305,304,302,297,310,308,312,296,309,313,298,299,311,293,300,301,303,307,318,306,294,331,330,325,327,326,319,320,322,324,328,329,321,323,332,184,183,333,334,283,335,336,337,338,339,340,212,76,210,208,216,217,188,169,235,228,63,229,64,224,67,219,227,226,221,222,65,225,220,66,223,218,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,170,231,230,92,99,91,106,83,82,105,100,103,85,84,80,79,102,81,86,87,90,77,108,107,94,95,97,93,96,101,88,89,98,78,104,180,187,196,197,203,205,204,198,200,201,202,181,194,195,186,171,73,62,161,168,162,68,72,163,164,189,165,166,172,167,173,182,193,192,190,191,61,179,178,177,176,185,213,214,215,232,233,234,199,175],"latestChangedDtsFile":"./test/socket-to-conn.spec.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/package.json deleted file mode 100644 index b39367234..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "@libp2p/tcp", - "version": "8.0.13", - "description": "A TCP transport for libp2p", - "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-tcp#readme", - "repository": { - "type": "git", - "url": "git+https://github.com/libp2p/js-libp2p.git" - }, - "bugs": { - "url": "https://github.com/libp2p/js-libp2p/issues" - }, - "keywords": [ - "IPFS", - "TCP", - "libp2p", - "network", - "p2p", - "peer", - "peer-to-peer" - ], - "type": "module", - "types": "./dist/src/index.d.ts", - "files": [ - "src", - "dist", - "!dist/test", - "!**/*.tsbuildinfo" - ], - "exports": { - ".": { - "types": "./dist/src/index.d.ts", - "import": "./dist/src/index.js" - } - }, - "eslintConfig": { - "extends": "ipfs", - "parserOptions": { - "project": true, - "sourceType": "module" - } - }, - "scripts": { - "clean": "aegir clean", - "lint": "aegir lint", - "dep-check": "aegir dep-check", - "build": "aegir build", - "test": "aegir test -t node -t electron-main", - "test:node": "aegir test -t node --cov", - "test:electron-main": "aegir test -t electron-main" - }, - "dependencies": { - "@libp2p/interface": "^0.1.6", - "@libp2p/utils": "^4.0.7", - "@multiformats/mafmt": "^12.1.6", - "@multiformats/multiaddr": "^12.1.10", - "@types/sinon": "^17.0.0", - "stream-to-it": "^0.2.2" - }, - "devDependencies": { - "@libp2p/interface-compliance-tests": "^4.1.5", - "@libp2p/logger": "^3.1.0", - "aegir": "^41.0.2", - "it-all": "^3.0.3", - "it-pipe": "^3.0.1", - "p-defer": "^4.0.0", - "sinon": "^17.0.0", - "uint8arrays": "^4.0.6" - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/src/constants.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/src/constants.ts deleted file mode 100644 index 650150074..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/src/constants.ts +++ /dev/null @@ -1,10 +0,0 @@ -// p2p multi-address code -export const CODE_P2P = 421 -export const CODE_CIRCUIT = 290 -export const CODE_UNIX = 400 - -// Time to wait for a connection to close gracefully before destroying it manually -export const CLOSE_TIMEOUT = 500 - -// Close the socket if there is no activity after this long in ms -export const SOCKET_TIMEOUT = 5 * 60000 // 5 mins diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/src/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/src/index.ts deleted file mode 100644 index 108c97441..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/src/index.ts +++ /dev/null @@ -1,341 +0,0 @@ -/** - * @packageDocumentation - * - * A [libp2p transport](https://docs.libp2p.io/concepts/transports/overview/) based on the TCP networking stack. - * - * @example - * - * ```js - * import { tcp } from '@libp2p/tcp' - * import { multiaddr } from '@multiformats/multiaddr' - * import { pipe } from 'it-pipe' - * import all from 'it-all' - * - * // A simple upgrader that just returns the MultiaddrConnection - * const upgrader = { - * upgradeInbound: async maConn => maConn, - * upgradeOutbound: async maConn => maConn - * } - * - * const transport = tcp()() - * - * const listener = transport.createListener({ - * upgrader, - * handler: (socket) => { - * console.this.log('new connection opened') - * pipe( - * ['hello', ' ', 'World!'], - * socket - * ) - * } - * }) - * - * const addr = multiaddr('/ip4/127.0.0.1/tcp/9090') - * await listener.listen(addr) - * console.this.log('listening') - * - * const socket = await transport.dial(addr, { upgrader }) - * const values = await pipe( - * socket, - * all - * ) - * console.this.log(`Value: ${values.toString()}`) - * - * // Close connection after reading - * await listener.close() - * ``` - * - * Outputs: - * - * ```sh - * listening - * new connection opened - * Value: hello World! - * ``` - */ - -import net from 'net' -import { AbortError, CodeError } from '@libp2p/interface/errors' -import { type CreateListenerOptions, type DialOptions, symbol, type Transport, type Listener } from '@libp2p/interface/transport' -import * as mafmt from '@multiformats/mafmt' -import { CODE_CIRCUIT, CODE_P2P, CODE_UNIX } from './constants.js' -import { type CloseServerOnMaxConnectionsOpts, TCPListener } from './listener.js' -import { toMultiaddrConnection } from './socket-to-conn.js' -import { multiaddrToNetConfig } from './utils.js' -import type { ComponentLogger, Logger } from '@libp2p/interface' -import type { Connection } from '@libp2p/interface/connection' -import type { CounterGroup, Metrics } from '@libp2p/interface/metrics' -import type { AbortOptions, Multiaddr } from '@multiformats/multiaddr' -import type { Socket, IpcSocketConnectOpts, TcpSocketConnectOpts } from 'net' - -export interface TCPOptions { - /** - * An optional number in ms that is used as an inactivity timeout after which the socket will be closed - */ - inboundSocketInactivityTimeout?: number - - /** - * An optional number in ms that is used as an inactivity timeout after which the socket will be closed - */ - outboundSocketInactivityTimeout?: number - - /** - * When closing a socket, wait this long for it to close gracefully before it is closed more forcibly - */ - socketCloseTimeout?: number - - /** - * Set this property to reject connections when the server's connection count gets high. - * https://nodejs.org/api/net.html#servermaxconnections - */ - maxConnections?: number - - /** - * Parameter to specify the maximum length of the queue of pending connections - * https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - backlog?: number - - /** - * Close server (stop listening for new connections) if connections exceed a limit. - * Open server (start listening for new connections) if connections fall below a limit. - */ - closeServerOnMaxConnections?: CloseServerOnMaxConnectionsOpts - - /** - * Options passed to `net.connect` for every opened TCP socket - */ - dialOpts?: TCPSocketOptions - - /** - * Options passed to every `net.createServer` for every TCP server - */ - listenOpts?: TCPSocketOptions -} - -/** - * Expose a subset of net.connect options - */ -export interface TCPSocketOptions extends AbortOptions { - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - noDelay?: boolean - - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - keepAlive?: boolean - - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#serverlisten - */ - keepAliveInitialDelay?: number - - /** - * @see https://nodejs.org/dist/latest-v18.x/docs/api/net.html#new-netsocketoptions - */ - allowHalfOpen?: boolean -} - -export interface TCPDialOptions extends DialOptions, TCPSocketOptions { - -} - -export interface TCPCreateListenerOptions extends CreateListenerOptions, TCPSocketOptions { - -} - -export interface TCPComponents { - metrics?: Metrics - logger: ComponentLogger -} - -export interface TCPMetrics { - dialerEvents: CounterGroup -} - -class TCP implements Transport { - private readonly opts: TCPOptions - private readonly metrics?: TCPMetrics - private readonly components: TCPComponents - private readonly log: Logger - - constructor (components: TCPComponents, options: TCPOptions = {}) { - this.log = components.logger.forComponent('libp2p:tcp') - this.opts = options - this.components = components - - if (components.metrics != null) { - this.metrics = { - dialerEvents: components.metrics.registerCounterGroup('libp2p_tcp_dialer_events_total', { - label: 'event', - help: 'Total count of TCP dialer events by type' - }) - } - } - } - - readonly [symbol] = true - - readonly [Symbol.toStringTag] = '@libp2p/tcp' - - async dial (ma: Multiaddr, options: TCPDialOptions): Promise { - options.keepAlive = options.keepAlive ?? true - options.noDelay = options.noDelay ?? true - - // options.signal destroys the socket before 'connect' event - const socket = await this._connect(ma, options) - - // Avoid uncaught errors caused by unstable connections - socket.on('error', err => { - this.log('socket error', err) - }) - - const maConn = toMultiaddrConnection(socket, { - remoteAddr: ma, - socketInactivityTimeout: this.opts.outboundSocketInactivityTimeout, - socketCloseTimeout: this.opts.socketCloseTimeout, - metrics: this.metrics?.dialerEvents, - logger: this.components.logger - }) - - const onAbort = (): void => { - maConn.close().catch(err => { - this.log.error('Error closing maConn after abort', err) - }) - } - options.signal?.addEventListener('abort', onAbort, { once: true }) - - this.log('new outbound connection %s', maConn.remoteAddr) - const conn = await options.upgrader.upgradeOutbound(maConn) - this.log('outbound connection %s upgraded', maConn.remoteAddr) - - options.signal?.removeEventListener('abort', onAbort) - - if (options.signal?.aborted === true) { - conn.close().catch(err => { - this.log.error('Error closing conn after abort', err) - }) - - throw new AbortError() - } - - return conn - } - - async _connect (ma: Multiaddr, options: TCPDialOptions): Promise { - if (options.signal?.aborted === true) { - throw new AbortError() - } - - return new Promise((resolve, reject) => { - const start = Date.now() - const cOpts = multiaddrToNetConfig(ma, { - ...(this.opts.dialOpts ?? {}), - ...options - }) as (IpcSocketConnectOpts & TcpSocketConnectOpts) - - this.log('dialing %a', ma) - const rawSocket = net.connect(cOpts) - - const onError = (err: Error): void => { - const cOptsStr = cOpts.path ?? `${cOpts.host ?? ''}:${cOpts.port}` - err.message = `connection error ${cOptsStr}: ${err.message}` - this.metrics?.dialerEvents.increment({ error: true }) - - done(err) - } - - const onTimeout = (): void => { - this.log('connection timeout %a', ma) - this.metrics?.dialerEvents.increment({ timeout: true }) - - const err = new CodeError(`connection timeout after ${Date.now() - start}ms`, 'ERR_CONNECT_TIMEOUT') - // Note: this will result in onError() being called - rawSocket.emit('error', err) - } - - const onConnect = (): void => { - this.log('connection opened %a', ma) - this.metrics?.dialerEvents.increment({ connect: true }) - done() - } - - const onAbort = (): void => { - this.log('connection aborted %a', ma) - this.metrics?.dialerEvents.increment({ abort: true }) - rawSocket.destroy() - done(new AbortError()) - } - - const done = (err?: any): void => { - rawSocket.removeListener('error', onError) - rawSocket.removeListener('timeout', onTimeout) - rawSocket.removeListener('connect', onConnect) - - if (options.signal != null) { - options.signal.removeEventListener('abort', onAbort) - } - - if (err != null) { - reject(err); return - } - - resolve(rawSocket) - } - - rawSocket.on('error', onError) - rawSocket.on('timeout', onTimeout) - rawSocket.on('connect', onConnect) - - if (options.signal != null) { - options.signal.addEventListener('abort', onAbort) - } - }) - } - - /** - * Creates a TCP listener. The provided `handler` function will be called - * anytime a new incoming Connection has been successfully upgraded via - * `upgrader.upgradeInbound`. - */ - createListener (options: TCPCreateListenerOptions): Listener { - return new TCPListener({ - ...(this.opts.listenOpts ?? {}), - ...options, - maxConnections: this.opts.maxConnections, - backlog: this.opts.backlog, - closeServerOnMaxConnections: this.opts.closeServerOnMaxConnections, - socketInactivityTimeout: this.opts.inboundSocketInactivityTimeout, - socketCloseTimeout: this.opts.socketCloseTimeout, - metrics: this.components.metrics, - logger: this.components.logger - }) - } - - /** - * Takes a list of `Multiaddr`s and returns only valid TCP addresses - */ - filter (multiaddrs: Multiaddr[]): Multiaddr[] { - multiaddrs = Array.isArray(multiaddrs) ? multiaddrs : [multiaddrs] - - return multiaddrs.filter(ma => { - if (ma.protoCodes().includes(CODE_CIRCUIT)) { - return false - } - - if (ma.protoCodes().includes(CODE_UNIX)) { - return true - } - - return mafmt.TCP.matches(ma.decapsulateCode(CODE_P2P)) - }) - } -} - -export function tcp (init: TCPOptions = {}): (components: TCPComponents) => Transport { - return (components: TCPComponents) => { - return new TCP(components, init) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/src/listener.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/src/listener.ts deleted file mode 100644 index 40ffcaf87..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/src/listener.ts +++ /dev/null @@ -1,381 +0,0 @@ -import net from 'net' -import { CodeError } from '@libp2p/interface/errors' -import { TypedEventEmitter, CustomEvent } from '@libp2p/interface/events' -import { CODE_P2P } from './constants.js' -import { toMultiaddrConnection } from './socket-to-conn.js' -import { - getMultiaddrs, - multiaddrToNetConfig, - type NetConfig -} from './utils.js' -import type { TCPCreateListenerOptions } from './index.js' -import type { ComponentLogger, Logger, LoggerOptions } from '@libp2p/interface' -import type { MultiaddrConnection, Connection } from '@libp2p/interface/connection' -import type { CounterGroup, MetricGroup, Metrics } from '@libp2p/interface/metrics' -import type { Listener, ListenerEvents, Upgrader } from '@libp2p/interface/transport' -import type { Multiaddr } from '@multiformats/multiaddr' - -/** - * Attempts to close the given maConn. If a failure occurs, it will be logged - */ -async function attemptClose (maConn: MultiaddrConnection, options: LoggerOptions): Promise { - try { - await maConn.close() - } catch (err) { - options.log.error('an error occurred closing the connection', err) - } -} - -export interface CloseServerOnMaxConnectionsOpts { - /** Server listens once connection count is less than `listenBelow` */ - listenBelow: number - /** Close server once connection count is greater than or equal to `closeAbove` */ - closeAbove: number - onListenError?(err: Error): void -} - -interface Context extends TCPCreateListenerOptions { - handler?(conn: Connection): void - upgrader: Upgrader - socketInactivityTimeout?: number - socketCloseTimeout?: number - maxConnections?: number - backlog?: number - metrics?: Metrics - closeServerOnMaxConnections?: CloseServerOnMaxConnectionsOpts - logger: ComponentLogger -} - -export interface TCPListenerMetrics { - status: MetricGroup - errors: CounterGroup - events: CounterGroup -} - -enum TCPListenerStatusCode { - /** - * When server object is initialized but we don't know the listening address yet or - * the server object is stopped manually, can be resumed only by calling listen() - **/ - INACTIVE = 0, - ACTIVE = 1, - /* During the connection limits */ - PAUSED = 2, -} - -type Status = { code: TCPListenerStatusCode.INACTIVE } | { - code: Exclude - listeningAddr: Multiaddr - peerId: string | null - netConfig: NetConfig -} - -export class TCPListener extends TypedEventEmitter implements Listener { - private readonly server: net.Server - /** Keep track of open connections to destroy in case of timeout */ - private readonly connections = new Set() - private status: Status = { code: TCPListenerStatusCode.INACTIVE } - private metrics?: TCPListenerMetrics - private addr: string - private readonly log: Logger - - constructor (private readonly context: Context) { - super() - - context.keepAlive = context.keepAlive ?? true - context.noDelay = context.noDelay ?? true - - this.log = context.logger.forComponent('libp2p:tcp:listener') - this.addr = 'unknown' - this.server = net.createServer(context, this.onSocket.bind(this)) - - // https://nodejs.org/api/net.html#servermaxconnections - // If set reject connections when the server's connection count gets high - // Useful to prevent too resource exhaustion via many open connections on high bursts of activity - if (context.maxConnections !== undefined) { - this.server.maxConnections = context.maxConnections - } - - if (context.closeServerOnMaxConnections != null) { - // Sanity check options - if (context.closeServerOnMaxConnections.closeAbove < context.closeServerOnMaxConnections.listenBelow) { - throw new CodeError('closeAbove must be >= listenBelow', 'ERROR_CONNECTION_LIMITS') - } - } - - this.server - .on('listening', () => { - if (context.metrics != null) { - // we are listening, register metrics for our port - const address = this.server.address() - - if (address == null) { - this.addr = 'unknown' - } else if (typeof address === 'string') { - // unix socket - this.addr = address - } else { - this.addr = `${address.address}:${address.port}` - } - - context.metrics?.registerMetricGroup('libp2p_tcp_inbound_connections_total', { - label: 'address', - help: 'Current active connections in TCP listener', - calculate: () => { - return { - [this.addr]: this.connections.size - } - } - }) - - this.metrics = { - status: context.metrics.registerMetricGroup('libp2p_tcp_listener_status_info', { - label: 'address', - help: 'Current status of the TCP listener socket' - }), - errors: context.metrics.registerMetricGroup('libp2p_tcp_listener_errors_total', { - label: 'address', - help: 'Total count of TCP listener errors by type' - }), - events: context.metrics.registerMetricGroup('libp2p_tcp_listener_events_total', { - label: 'address', - help: 'Total count of TCP listener events by type' - }) - } - - this.metrics?.status.update({ - [this.addr]: TCPListenerStatusCode.ACTIVE - }) - } - - this.dispatchEvent(new CustomEvent('listening')) - }) - .on('error', err => { - this.metrics?.errors.increment({ [`${this.addr} listen_error`]: true }) - this.dispatchEvent(new CustomEvent('error', { detail: err })) - }) - .on('close', () => { - this.metrics?.status.update({ - [this.addr]: this.status.code - }) - - // If this event is emitted, the transport manager will remove the listener from it's cache - // in the meanwhile if the connections are dropped then listener will start listening again - // and the transport manager will not be able to close the server - if (this.status.code !== TCPListenerStatusCode.PAUSED) { - this.dispatchEvent(new CustomEvent('close')) - } - }) - } - - private onSocket (socket: net.Socket): void { - if (this.status.code !== TCPListenerStatusCode.ACTIVE) { - throw new CodeError('Server is is not listening yet', 'ERR_SERVER_NOT_RUNNING') - } - // Avoid uncaught errors caused by unstable connections - socket.on('error', err => { - this.log('socket error', err) - this.metrics?.events.increment({ [`${this.addr} error`]: true }) - }) - - let maConn: MultiaddrConnection - try { - maConn = toMultiaddrConnection(socket, { - listeningAddr: this.status.listeningAddr, - socketInactivityTimeout: this.context.socketInactivityTimeout, - socketCloseTimeout: this.context.socketCloseTimeout, - metrics: this.metrics?.events, - metricPrefix: `${this.addr} `, - logger: this.context.logger - }) - } catch (err) { - this.log.error('inbound connection failed', err) - this.metrics?.errors.increment({ [`${this.addr} inbound_to_connection`]: true }) - return - } - - this.log('new inbound connection %s', maConn.remoteAddr) - try { - this.context.upgrader.upgradeInbound(maConn) - .then((conn) => { - this.log('inbound connection upgraded %s', maConn.remoteAddr) - this.connections.add(maConn) - - socket.once('close', () => { - this.connections.delete(maConn) - - if ( - this.context.closeServerOnMaxConnections != null && - this.connections.size < this.context.closeServerOnMaxConnections.listenBelow - ) { - // The most likely case of error is if the port taken by this application is binded by - // another process during the time the server if closed. In that case there's not much - // we can do. resume() will be called again every time a connection is dropped, which - // acts as an eventual retry mechanism. onListenError allows the consumer act on this. - this.resume().catch(e => { - this.log.error('error attempting to listen server once connection count under limit', e) - this.context.closeServerOnMaxConnections?.onListenError?.(e as Error) - }) - } - }) - - if (this.context.handler != null) { - this.context.handler(conn) - } - - if ( - this.context.closeServerOnMaxConnections != null && - this.connections.size >= this.context.closeServerOnMaxConnections.closeAbove - ) { - this.pause(false).catch(e => { - this.log.error('error attempting to close server once connection count over limit', e) - }) - } - - this.dispatchEvent(new CustomEvent('connection', { detail: conn })) - }) - .catch(async err => { - this.log.error('inbound connection failed', err) - this.metrics?.errors.increment({ [`${this.addr} inbound_upgrade`]: true }) - - await attemptClose(maConn, { - log: this.log - }) - }) - .catch(err => { - this.log.error('closing inbound connection failed', err) - }) - } catch (err) { - this.log.error('inbound connection failed', err) - - attemptClose(maConn, { - log: this.log - }) - .catch(err => { - this.log.error('closing inbound connection failed', err) - this.metrics?.errors.increment({ [`${this.addr} inbound_closing_failed`]: true }) - }) - } - } - - getAddrs (): Multiaddr[] { - if (this.status.code === TCPListenerStatusCode.INACTIVE) { - return [] - } - - let addrs: Multiaddr[] = [] - const address = this.server.address() - const { listeningAddr, peerId } = this.status - - if (address == null) { - return [] - } - - if (typeof address === 'string') { - addrs = [listeningAddr] - } else { - try { - // Because TCP will only return the IPv6 version - // we need to capture from the passed multiaddr - if (listeningAddr.toString().startsWith('/ip4')) { - addrs = addrs.concat(getMultiaddrs('ip4', address.address, address.port)) - } else if (address.family === 'IPv6') { - addrs = addrs.concat(getMultiaddrs('ip6', address.address, address.port)) - } - } catch (err) { - this.log.error('could not turn %s:%s into multiaddr', address.address, address.port, err) - } - } - - return addrs.map(ma => peerId != null ? ma.encapsulate(`/p2p/${peerId}`) : ma) - } - - async listen (ma: Multiaddr): Promise { - if (this.status.code === TCPListenerStatusCode.ACTIVE || this.status.code === TCPListenerStatusCode.PAUSED) { - throw new CodeError('server is already listening', 'ERR_SERVER_ALREADY_LISTENING') - } - - const peerId = ma.getPeerId() - const listeningAddr = peerId == null ? ma.decapsulateCode(CODE_P2P) : ma - const { backlog } = this.context - - try { - this.status = { - code: TCPListenerStatusCode.ACTIVE, - listeningAddr, - peerId, - netConfig: multiaddrToNetConfig(listeningAddr, { backlog }) - } - - await this.resume() - } catch (err) { - this.status = { code: TCPListenerStatusCode.INACTIVE } - throw err - } - } - - async close (): Promise { - // Close connections and server the same time to avoid any race condition - await Promise.all([ - Promise.all(Array.from(this.connections.values()).map(async maConn => attemptClose(maConn, { - log: this.log - }))), - this.pause(true).catch(e => { - this.log.error('error attempting to close server once connection count over limit', e) - }) - ]) - } - - /** - * Can resume a stopped or start an inert server - */ - private async resume (): Promise { - if (this.server.listening || this.status.code === TCPListenerStatusCode.INACTIVE) { - return - } - - const netConfig = this.status.netConfig - - await new Promise((resolve, reject) => { - // NOTE: 'listening' event is only fired on success. Any error such as port already binded, is emitted via 'error' - this.server.once('error', reject) - this.server.listen(netConfig, resolve) - }) - - this.status = { ...this.status, code: TCPListenerStatusCode.ACTIVE } - this.log('Listening on %s', this.server.address()) - } - - private async pause (permanent: boolean): Promise { - if (!this.server.listening && this.status.code === TCPListenerStatusCode.PAUSED && permanent) { - this.status = { code: TCPListenerStatusCode.INACTIVE } - return - } - - if (!this.server.listening || this.status.code !== TCPListenerStatusCode.ACTIVE) { - return - } - - this.log('Closing server on %s', this.server.address()) - - // NodeJS implementation tracks listening status with `this._handle` property. - // - Server.close() sets this._handle to null immediately. If this._handle is null, ERR_SERVER_NOT_RUNNING is thrown - // - Server.listening returns `this._handle !== null` https://github.com/nodejs/node/blob/386d761943bb1b217fba27d6b80b658c23009e60/lib/net.js#L1675 - // - Server.listen() if `this._handle !== null` throws ERR_SERVER_ALREADY_LISTEN - // - // NOTE: Both listen and close are technically not async actions, so it's not necessary to track - // states 'pending-close' or 'pending-listen' - - // From docs https://nodejs.org/api/net.html#serverclosecallback - // Stops the server from accepting new connections and keeps existing connections. - // 'close' event is emitted only emitted when all connections are ended. - // The optional callback will be called once the 'close' event occurs. - - // We need to set this status before closing server, so other procedures are aware - // during the time the server is closing - this.status = permanent ? { code: TCPListenerStatusCode.INACTIVE } : { ...this.status, code: TCPListenerStatusCode.PAUSED } - await new Promise((resolve, reject) => { - this.server.close(err => { (err != null) ? reject(err) : resolve() }) - }) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/src/socket-to-conn.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/src/socket-to-conn.ts deleted file mode 100644 index a24b126d5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/src/socket-to-conn.ts +++ /dev/null @@ -1,200 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { ipPortToMultiaddr as toMultiaddr } from '@libp2p/utils/ip-port-to-multiaddr' -// @ts-expect-error no types -import toIterable from 'stream-to-it' -import { CLOSE_TIMEOUT, SOCKET_TIMEOUT } from './constants.js' -import { multiaddrToNetConfig } from './utils.js' -import type { ComponentLogger } from '@libp2p/interface' -import type { MultiaddrConnection } from '@libp2p/interface/connection' -import type { CounterGroup } from '@libp2p/interface/metrics' -import type { AbortOptions, Multiaddr } from '@multiformats/multiaddr' -import type { Socket } from 'net' - -interface ToConnectionOptions { - listeningAddr?: Multiaddr - remoteAddr?: Multiaddr - localAddr?: Multiaddr - socketInactivityTimeout?: number - socketCloseTimeout?: number - metrics?: CounterGroup - metricPrefix?: string - logger: ComponentLogger -} - -/** - * Convert a socket into a MultiaddrConnection - * https://github.com/libp2p/interface-transport#multiaddrconnection - */ -export const toMultiaddrConnection = (socket: Socket, options: ToConnectionOptions): MultiaddrConnection => { - const log = options.logger.forComponent('libp2p:tcp:socket') - const metrics = options.metrics - const metricPrefix = options.metricPrefix ?? '' - const inactivityTimeout = options.socketInactivityTimeout ?? SOCKET_TIMEOUT - const closeTimeout = options.socketCloseTimeout ?? CLOSE_TIMEOUT - - // Check if we are connected on a unix path - if (options.listeningAddr?.getPath() != null) { - options.remoteAddr = options.listeningAddr - } - - if (options.remoteAddr?.getPath() != null) { - options.localAddr = options.remoteAddr - } - - let remoteAddr: Multiaddr - - if (options.remoteAddr != null) { - remoteAddr = options.remoteAddr - } else { - if (socket.remoteAddress == null || socket.remotePort == null) { - // this can be undefined if the socket is destroyed (for example, if the client disconnected) - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#socketremoteaddress - throw new CodeError('Could not determine remote address or port', 'ERR_NO_REMOTE_ADDRESS') - } - - remoteAddr = toMultiaddr(socket.remoteAddress, socket.remotePort) - } - - const lOpts = multiaddrToNetConfig(remoteAddr) - const lOptsStr = lOpts.path ?? `${lOpts.host ?? ''}:${lOpts.port ?? ''}` - const { sink, source } = toIterable.duplex(socket) - - // by default there is no timeout - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#socketsettimeouttimeout-callback - socket.setTimeout(inactivityTimeout, () => { - log('%s socket read timeout', lOptsStr) - metrics?.increment({ [`${metricPrefix}timeout`]: true }) - - // only destroy with an error if the remote has not sent the FIN message - let err: Error | undefined - if (socket.readable) { - err = new CodeError('Socket read timeout', 'ERR_SOCKET_READ_TIMEOUT') - } - - // if the socket times out due to inactivity we must manually close the connection - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#event-timeout - socket.destroy(err) - }) - - socket.once('close', () => { - log('%s socket close', lOptsStr) - metrics?.increment({ [`${metricPrefix}close`]: true }) - - // In instances where `close` was not explicitly called, - // such as an iterable stream ending, ensure we have set the close - // timeline - if (maConn.timeline.close == null) { - maConn.timeline.close = Date.now() - } - }) - - socket.once('end', () => { - // the remote sent a FIN packet which means no more data will be sent - // https://nodejs.org/dist/latest-v16.x/docs/api/net.html#event-end - log('%s socket end', lOptsStr) - metrics?.increment({ [`${metricPrefix}end`]: true }) - }) - - const maConn: MultiaddrConnection = { - async sink (source) { - try { - await sink((async function * () { - for await (const buf of source) { - if (buf instanceof Uint8Array) { - yield buf - } else { - // is it faster to yield all the buffers or just one big buffer? - yield buf.subarray() - } - } - })()) - } catch (err: any) { - // If aborted we can safely ignore - if (err.type !== 'aborted') { - // If the source errored the socket will already have been destroyed by - // toIterable.duplex(). If the socket errored it will already be - // destroyed. There's nothing to do here except log the error & return. - log(err) - } - } - - // we have finished writing, send the FIN message - socket.end() - }, - - source, - - // If the remote address was passed, use it - it may have the peer ID encapsulated - remoteAddr, - - timeline: { open: Date.now() }, - - async close (options: AbortOptions = {}) { - if (socket.destroyed) { - log('%s socket was already destroyed when trying to close', lOptsStr) - return - } - - if (options.signal == null) { - const signal = AbortSignal.timeout(closeTimeout) - - options = { - ...options, - signal - } - } - - try { - log('%s closing socket', lOptsStr) - await new Promise((resolve, reject) => { - socket.once('close', () => { - // socket completely closed - log('%s socket closed', lOptsStr) - resolve() - }) - socket.once('error', (err: Error) => { - log('%s socket error', lOptsStr, err) - - // error closing socket - if (maConn.timeline.close == null) { - maConn.timeline.close = Date.now() - } - - reject(err) - }) - - // shorten inactivity timeout - socket.setTimeout(closeTimeout) - - // close writable end of the socket - socket.end() - - if (socket.writableLength > 0) { - // there are outgoing bytes waiting to be sent - socket.once('drain', () => { - log('%s socket drained', lOptsStr) - - // all bytes have been sent we can destroy the socket (maybe) before the timeout - socket.destroy() - }) - } else { - // nothing to send, destroy immediately, no need for the timeout - socket.destroy() - } - }) - } catch (err: any) { - this.abort(err) - } - }, - - abort: (err: Error) => { - log('%s socket abort due to error', lOptsStr, err) - - socket.destroy(err) - }, - - log - } - - return maConn -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/src/utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/src/utils.ts deleted file mode 100644 index 7a44af4fa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/tcp/src/utils.ts +++ /dev/null @@ -1,53 +0,0 @@ -import os from 'os' -import path from 'path' -import { multiaddr } from '@multiformats/multiaddr' -import type { Multiaddr } from '@multiformats/multiaddr' -import type { ListenOptions, IpcSocketConnectOpts, TcpSocketConnectOpts } from 'net' - -const ProtoFamily = { ip4: 'IPv4', ip6: 'IPv6' } - -export type NetConfig = ListenOptions | (IpcSocketConnectOpts & TcpSocketConnectOpts) - -export function multiaddrToNetConfig (addr: Multiaddr, config: NetConfig = {}): NetConfig { - const listenPath = addr.getPath() - - // unix socket listening - if (listenPath != null) { - if (os.platform() === 'win32') { - // Use named pipes on Windows systems. - return { path: path.join('\\\\.\\pipe\\', listenPath) } - } else { - return { path: listenPath } - } - } - - // tcp listening - return { ...config, ...addr.toOptions() } -} - -export function getMultiaddrs (proto: 'ip4' | 'ip6', ip: string, port: number): Multiaddr[] { - const toMa = (ip: string): Multiaddr => multiaddr(`/${proto}/${ip}/tcp/${port}`) - return (isAnyAddr(ip) ? getNetworkAddrs(ProtoFamily[proto]) : [ip]).map(toMa) -} - -export function isAnyAddr (ip: string): boolean { - return ['0.0.0.0', '::'].includes(ip) -} - -const networks = os.networkInterfaces() - -function getNetworkAddrs (family: string): string[] { - const addresses: string[] = [] - - for (const [, netAddrs] of Object.entries(networks)) { - if (netAddrs != null) { - for (const netAddr of netAddrs) { - if (netAddr.family === family) { - addresses.push(netAddr.address) - } - } - } - } - - return addresses -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/index.min.js deleted file mode 100644 index 605add25f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/index.min.js +++ /dev/null @@ -1,3 +0,0 @@ -(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.ChainsafeLibp2PYamux = factory()}(typeof self !== 'undefined' ? self : this, function () { -"use strict";var ChainsafeLibp2PYamux=(()=>{var ot=Object.create;var H=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var lt=Object.getOwnPropertyNames;var ut=Object.getPrototypeOf,ct=Object.prototype.hasOwnProperty;var ue=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ht=(r,e)=>{for(var t in e)H(r,t,{get:e[t],enumerable:!0})},De=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of lt(e))!ct.call(r,s)&&s!==t&&H(r,s,{get:()=>e[s],enumerable:!(n=at(e,s))||n.enumerable});return r};var ft=(r,e,t)=>(t=r!=null?ot(ut(r)):{},De(e||!r||!r.__esModule?H(t,"default",{value:r,enumerable:!0}):t,r)),dt=r=>De(H({},"__esModule",{value:!0}),r);var Te=ue((Qt,Le)=>{var W=1e3,V=W*60,G=V*60,k=G*24,mt=k*7,pt=k*365.25;Le.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return gt(r);if(t==="number"&&isFinite(r))return e.long?bt(r):wt(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function gt(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*pt;case"weeks":case"week":case"w":return t*mt;case"days":case"day":case"d":return t*k;case"hours":case"hour":case"hrs":case"hr":case"h":return t*G;case"minutes":case"minute":case"mins":case"min":case"m":return t*V;case"seconds":case"second":case"secs":case"sec":case"s":return t*W;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function wt(r){var e=Math.abs(r);return e>=k?Math.round(r/k)+"d":e>=G?Math.round(r/G)+"h":e>=V?Math.round(r/V)+"m":e>=W?Math.round(r/W)+"s":r+"ms"}function bt(r){var e=Math.abs(r);return e>=k?j(r,e,k,"day"):e>=G?j(r,e,G,"hour"):e>=V?j(r,e,V,"minute"):e>=W?j(r,e,W,"second"):r+" ms"}function j(r,e,t,n){var s=e>=t*1.5;return Math.round(r/t)+" "+n+(s?"s":"")}});var Fe=ue((Zt,Ne)=>{function yt(r){t.debug=t,t.default=t,t.coerce=f,t.disable=i,t.enable=s,t.enabled=a,t.humanize=Te(),t.destroy=R,Object.keys(r).forEach(o=>{t[o]=r[o]}),t.names=[],t.skips=[],t.formatters={};function e(o){let l=0;for(let d=0;d{if(D==="%%")return"%";S++;let L=t.formatters[_];if(typeof L=="function"){let P=c[S];D=L.call(g,P),c.splice(S,1),S--}return D}),t.formatArgs.call(g,c),(g.log||t.log).apply(g,c)}return m.namespace=o,m.useColors=t.useColors(),m.color=t.selectColor(o),m.extend=n,m.destroy=t.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(N!==t.namespaces&&(N=t.namespaces,p=t.enabled(o)),p),set:c=>{d=c}}),typeof t.init=="function"&&t.init(m),m}function n(o,l){let d=t(this.namespace+(typeof l>"u"?":":l)+o);return d.log=this.log,d}function s(o){t.save(o),t.namespaces=o,t.names=[],t.skips=[];let l,d=(typeof o=="string"?o:"").split(/[\s,]+/),N=d.length;for(l=0;l"-"+l)].join(",");return t.enable(""),o}function a(o){if(o[o.length-1]==="*")return!0;let l,d;for(l=0,d=t.skips.length;l{v.formatArgs=St;v.save=Ct;v.load=Rt;v.useColors=Et;v.storage=xt();v.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();v.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Et(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function St(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+K.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,n=0;r[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(n=t))}),r.splice(n,0,e)}v.log=console.debug||console.log||(()=>{});function Ct(r){try{r?v.storage.setItem("debug",r):v.storage.removeItem("debug")}catch{}}function Rt(){let r;try{r=v.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function xt(){try{return localStorage}catch{}}K.exports=Fe()(v);var{formatters:_t}=K.exports;_t.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Xt={};ht(Xt,{GoAwayCode:()=>I,yamux:()=>zt});var h=class extends Error{code;props;constructor(e,t,n){super(e),this.code=t,this.name=n?.name??"CodeError",this.props=n??{}}};var ce=class extends Event{detail;constructor(e,t){super(e,t),this.detail=t?.detail}},Kt=globalThis.CustomEvent??ce;var he=(r,...e)=>{try{[...e]}catch{}};var A=ft(Ue(),1);function vt(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n>>0,S=new Uint8Array(E);g!==y;){for(var x=p[g],D=0,_=E-1;(x!==0||D>>0,S[_]=x%u>>>0,x=x/u>>>0;if(x!==0)throw new Error("Non-zero carry");c=D,g++}for(var L=E-c;L!==E&&S[L]===0;)L++;for(var P=f.repeat(m);L>>0,E=new Uint8Array(y);p[m];){var S=t[p.charCodeAt(m)];if(S===255)return;for(var x=0,D=y-1;(S!==0||x>>0,E[D]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");g=x,m++}if(p[m]!==" "){for(var _=y-g;_!==y&&E[_]===0;)_++;for(var L=new Uint8Array(c+(y-_)),P=c;_!==y;)L[P++]=E[_++];return L}}}function N(p){var m=d(p);if(m)return m;throw new Error(`Non-${e} character`)}return{encode:l,decodeUnsafe:d,decode:N}}var At=vt,It=At,Oe=It;var tr=new Uint8Array(0);var ke=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var fe=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},de=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Me(this,e)}},me=class{constructor(e){this.decoders=e}or(e){return Me(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Me=(r,e)=>new me({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),pe=class{constructor(e,t,n,s){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=s,this.encoder=new fe(e,t,n),this.decoder=new de(e,t,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Pe=({name:r,prefix:e,encode:t,decode:n})=>new pe(r,e,t,n),ge=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:s}=Oe(t,e);return Pe({prefix:r,name:e,encode:n,decode:i=>ke(s(i))})},Dt=(r,e,t,n)=>{let s={};for(let o=0;o=8&&(u-=8,a[R++]=255&f>>u)}if(u>=t||255&f<<8-u)throw new SyntaxError("Unexpected end of data");return a},Lt=(r,e,t)=>{let n=e[e.length-1]==="=",s=(1<t;)a-=t,i+=e[s&u>>a];if(a&&(i+=e[s&u<Pe({prefix:e,name:r,encode(s){return Lt(s,n,t)},decode(s){return Dt(s,n,t,r)}});var We=C({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ar=C({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),lr=C({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),ur=C({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),cr=C({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),hr=C({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),fr=C({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),dr=C({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),mr=C({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ve=ge({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),wr=ge({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Ge=C({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Er=C({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Sr=C({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Cr=C({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});A.default.formatters.b=r=>r==null?"undefined":Ve.baseEncode(r);A.default.formatters.t=r=>r==null?"undefined":We.baseEncode(r);A.default.formatters.m=r=>r==null?"undefined":Ge.baseEncode(r);A.default.formatters.p=r=>r==null?"undefined":r.toString();A.default.formatters.c=r=>r==null?"undefined":r.toString();A.default.formatters.k=r=>r==null?"undefined":r.toString();A.default.formatters.a=r=>r==null?"undefined":r.toString();function Tt(r){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=r,e.destroy=()=>!0,e.extend=()=>e,e}function J(r){let e=Tt(`${r}:trace`);return A.default.enabled(`${r}:trace`)&&A.default.names.map(t=>t.toString()).find(t=>t.includes(":trace"))!=null&&(e=(0,A.default)(`${r}:trace`)),Object.assign((0,A.default)(r),{error:(0,A.default)(`${r}:error`),trace:e})}function Q(r){if(r!=null){if(typeof r[Symbol.iterator]=="function")return r[Symbol.iterator]();if(typeof r[Symbol.asyncIterator]=="function")return r[Symbol.asyncIterator]();if(typeof r.next=="function")return r}throw new Error("argument is not an iterator or iterable")}function M(){let r={};return r.promise=new Promise((e,t)=>{r.resolve=e,r.reject=t}),r}var Z=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},B=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new Z(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let t=this.head;this.head=t.next=new Z(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let t=this.tail.next;this.tail.next=null,this.tail=t,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var we=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.code=t??"ABORT_ERR"}};function ee(r={}){return Nt(t=>{let n=t.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},r)}function Nt(r,e){e=e??{};let t=e.onEnd,n=new B,s,i,a,u=M(),f=async()=>{try{return n.isEmpty()?a?{done:!0}:await new Promise((c,g)=>{i=y=>{i=null,n.push(y);try{c(r(n))}catch(E){g(E)}return s}}):r(n)}finally{n.isEmpty()&&queueMicrotask(()=>{u.resolve(),u=M()})}},R=c=>i!=null?i(c):(n.push(c),s),o=c=>(n=new B,i!=null?i({error:c}):(n.push({error:c}),s)),l=c=>{if(a)return s;if(e?.objectMode!==!0&&c?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return R({done:!1,value:c})},d=c=>a?s:(a=!0,c!=null?o(c):R({done:!0})),N=()=>(n=new B,d(),{done:!0}),p=c=>(d(c),{done:!0});if(s={[Symbol.asyncIterator](){return this},next:f,return:N,throw:p,push:l,end:d,get readableLength(){return n.size},onEmpty:async c=>{let g=c?.signal;if(g?.throwIfAborted(),n.isEmpty())return;let y,E;g!=null&&(y=new Promise((S,x)=>{E=()=>{x(new we)},g.addEventListener("abort",E)}));try{await Promise.race([u.promise,y])}finally{E!=null&&g!=null&&g?.removeEventListener("abort",E)}}},t==null)return s;let m=s;return s={[Symbol.asyncIterator](){return this},next(){return m.next()},throw(c){return m.throw(c),t!=null&&(t(c),t=void 0),{done:!0}},return(){return m.return(),t!=null&&(t(),t=void 0),{done:!0}},push:l,end(c){return m.end(c),t!=null&&(t(c),t=void 0),s},get readableLength(){return m.readableLength},onEmpty:c=>m.onEmpty(c)},s}var z="ERR_INVALID_FRAME",be="ERR_UNREQUESTED_PING",ye="ERR_NOT_MATCHING_PING",Ee="ERR_STREAM_ALREADY_EXISTS",Se="ERR_DECODE_INVALID_VERSION",Ce="ERR_BOTH_CLIENTS",Re="ERR_RECV_WINDOW_EXCEEDED",Be=new Set([z,be,ye,Ee,Se,Ce,Re]),U="ERR_INVALID_CONFIG",te="ERR_MUXER_LOCAL_CLOSED",xe="ERR_MUXER_REMOTE_CLOSED";var ze="ERR_STREAM_ABORT",Xe="ERROR_MAX_OUTBOUND_STREAMS_EXCEEDED",Ye="ERR_DECODE_IN_PROGRESS",Y=256*1024,qe=16*1024*1024;var $e={log:J("libp2p:yamux"),enableKeepAlive:!0,keepAliveInterval:3e4,maxInboundStreams:1e3,maxOutboundStreams:1e3,initialStreamWindowSize:Y,maxStreamWindowSize:qe,maxMessageSize:64*1024};function He(r){if(r.keepAliveInterval<=0)throw new h("keep-alive interval must be positive",U);if(r.maxInboundStreams<0)throw new h("max inbound streams must be larger or equal 0",U);if(r.maxOutboundStreams<0)throw new h("max outbound streams must be larger or equal 0",U);if(r.initialStreamWindowSize2**32-1)throw new h("MaxStreamWindowSize must be less than equal MAX_UINT32",U);if(r.maxMessageSize<1024)throw new h("MaxMessageSize must be greater than a kilobyte",U)}function q(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function F(r=0){return globalThis.Buffer?.alloc!=null?q(globalThis.Buffer.alloc(r)):new Uint8Array(r)}function $(r=0){return globalThis.Buffer?.allocUnsafe!=null?q(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function _e(r,e){e==null&&(e=r.reduce((s,i)=>s+i.length,0));let t=$(e),n=0;for(let s of r)t.set(s,n),n+=s.length;return q(t)}function je(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let t=0;for(let n of e)if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.push(n);else if(re(n))t+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}prepend(...e){this.prependAll(e)}prependAll(e){let t=0;for(let n of e.reverse())if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.unshift(n);else if(re(n))t+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=Ke(this.bufs,e);return t.buf[t.index]}set(e,t){let n=Ke(this.bufs,e);n.buf[n.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let n=0;n0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,t){let{bufs:n,length:s}=this._subList(e,t);return _e(n,s)}subarray(e,t){let{bufs:n,length:s}=this._subList(e,t);return n.length===1?n[0]:_e(n,s)}sublist(e,t){let{bufs:n,length:s}=this._subList(e,t),i=new r;return i.length=s,i.bufs=n,i}_subList(e,t){if(e=e??0,t=t??this.length,e<0&&(e=this.length+e),t<0&&(t=this.length+t),e<0||t>this.length)throw new RangeError("index is out of bounds");if(e===t)return{bufs:[],length:0};if(e===0&&t===this.length)return{bufs:[...this.bufs],length:this.length};let n=[],s=0;for(let i=0;i=f)continue;let R=e>=u&&eu&&t<=f;if(R&&o){if(e===u&&t===f){n.push(a);break}let l=e-u;n.push(a.subarray(l,l+(t-e)));break}if(R){if(e===0){n.push(a);continue}n.push(a.subarray(e-u));continue}if(o){if(t===f){n.push(a);break}n.push(a.subarray(0,t-u));break}n.push(a)}return{bufs:n,length:t-e}}indexOf(e,t=0){if(!re(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(t=Number(t??0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),e.length===0)return t>this.length?this.length:t;let s=n.byteLength;if(s===0)throw new TypeError("search must be at least 1 byte long");let i=256,a=new Int32Array(i);for(let l=0;l=0;d--){let N=this.get(l+d);if(n[d]!==N){o=Math.max(1,d-u[N]);break}}if(o===0)return l}return-1}getInt8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}setInt8(e,t){let n=$(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,t),this.write(n,e)}getInt16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,t)}setInt16(e,t,n){let s=F(2);new DataView(s.buffer,s.byteOffset,s.byteLength).setInt16(0,t,n),this.write(s,e)}getInt32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,t)}setInt32(e,t,n){let s=F(4);new DataView(s.buffer,s.byteOffset,s.byteLength).setInt32(0,t,n),this.write(s,e)}getBigInt64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,t)}setBigInt64(e,t,n){let s=F(8);new DataView(s.buffer,s.byteOffset,s.byteLength).setBigInt64(0,t,n),this.write(s,e)}getUint8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}setUint8(e,t){let n=$(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,t),this.write(n,e)}getUint16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,t)}setUint16(e,t,n){let s=F(2);new DataView(s.buffer,s.byteOffset,s.byteLength).setUint16(0,t,n),this.write(s,e)}getUint32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,t)}setUint32(e,t,n){let s=F(4);new DataView(s.buffer,s.byteOffset,s.byteLength).setUint32(0,t,n),this.write(s,e)}getBigUint64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,t)}setBigUint64(e,t,n){let s=F(8);new DataView(s.buffer,s.byteOffset,s.byteLength).setBigUint64(0,t,n),this.write(s,e)}getFloat32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,t)}setFloat32(e,t,n){let s=F(4);new DataView(s.buffer,s.byteOffset,s.byteLength).setFloat32(0,t,n),this.write(s,e)}getFloat64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,t)}setFloat64(e,t,n){let s=F(8);new DataView(s.buffer,s.byteOffset,s.byteLength).setFloat64(0,t,n),this.write(s,e)}equals(e){if(e==null||!(e instanceof r)||e.bufs.length!==this.bufs.length)return!1;for(let t=0;ts+i.byteLength,0)),n.length=t,n}};var b;(function(r){r[r.Data=0]="Data",r[r.WindowUpdate=1]="WindowUpdate",r[r.Ping=2]="Ping",r[r.GoAway=3]="GoAway"})(b||(b={}));var w;(function(r){r[r.SYN=1]="SYN",r[r.ACK=2]="ACK",r[r.FIN=4]="FIN",r[r.RST=8]="RST"})(w||(w={}));var Zr=Object.values(w).filter(r=>typeof r!="string"),Qe=0,I;(function(r){r[r.NormalTermination=0]="NormalTermination",r[r.ProtocolError=1]="ProtocolError",r[r.InternalError=2]="InternalError"})(I||(I={}));var O=12;var Ze=2**24;function Ft(r){if(r[0]!==Qe)throw new h("Invalid frame version",Se);return{type:r[1],flag:(r[2]<<8)+r[3],streamID:r[4]*Ze+(r[5]<<16)+(r[6]<<8)+r[7],length:r[8]*Ze+(r[9]<<16)+(r[10]<<8)+r[11]}}var ne=class{source;buffer;frameInProgress;constructor(e){this.source=Ut(e),this.buffer=new X,this.frameInProgress=!1}async*emitFrames(){for await(let e of this.source)for(this.buffer.append(e);;){let t=this.readHeader();if(t===void 0)break;let{type:n,length:s}=t;n===b.Data?(this.frameInProgress=!0,yield{header:t,readData:this.readBytes.bind(this,s)}):yield{header:t}}}readHeader(){if(this.frameInProgress)throw new h("decoding frame already in progress",Ye);if(this.buffer.length=e)break}let t=this.buffer.sublist(0,e);return this.buffer.consume(e),this.frameInProgress=!1,t}};function Ut(r){if(r[Symbol.iterator]!==void 0){let e=r[Symbol.iterator]();return e.return=void 0,{[Symbol.iterator](){return e}}}else if(r[Symbol.asyncIterator]!==void 0){let e=r[Symbol.asyncIterator]();return e.return=void 0,{[Symbol.asyncIterator](){return e}}}else throw new Error("a source must be either an iterable or an async iterable")}function ve(r){let e=new Uint8Array(O);return e[1]=r.type,e[2]=r.flag>>>8,e[3]=r.flag,e[4]=r.streamID>>>24,e[5]=r.streamID>>>16,e[6]=r.streamID>>>8,e[7]=r.streamID,e[8]=r.length>>>24,e[9]=r.length>>>16,e[10]=r.length>>>8,e[11]=r.length,e}var se=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=t??"ABORT_ERR"}};async function ie(r,e,t){if(e==null)return r;if(e.aborted)return Promise.reject(new se(t?.errorMessage,t?.errorCode));let n,s=new se(t?.errorMessage,t?.errorCode);try{return await Promise.race([r,new Promise((i,a)=>{n=()=>{a(s)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}function et(r){return r==null?!1:typeof r.then=="function"&&typeof r.catch=="function"&&typeof r.finally=="function"}function tt(r,e){let t=Q(r).return?.();et(t)&&t.catch(n=>{e.error("could not cause iterator to return",n)})}var Ot="ERR_STREAM_RESET",kt="ERR_SINK_INVALID_STATE",Mt=5e3;function Ae(r){return r==null?!1:typeof r.then=="function"&&typeof r.catch=="function"&&typeof r.finally=="function"}var oe=class{id;direction;timeline;protocol;metadata;source;status;readStatus;writeStatus;log;sinkController;sinkEnd;closed;endErr;streamSource;onEnd;onCloseRead;onCloseWrite;onReset;onAbort;sendCloseWriteTimeout;constructor(e){this.sinkController=new AbortController,this.sinkEnd=M(),this.closed=M(),this.log=e.log,this.status="open",this.readStatus="ready",this.writeStatus="ready",this.id=e.id,this.metadata=e.metadata??{},this.direction=e.direction,this.timeline={open:Date.now()},this.sendCloseWriteTimeout=e.sendCloseWriteTimeout??Mt,this.onEnd=e.onEnd,this.onCloseRead=e?.onCloseRead,this.onCloseWrite=e?.onCloseWrite,this.onReset=e?.onReset,this.onAbort=e?.onAbort,this.source=this.streamSource=ee({onEnd:t=>{t!=null?this.log.trace("source ended with error",t):this.log.trace("source ended"),this.onSourceEnd(t)}}),this.sink=this.sink.bind(this)}async sink(e){if(this.writeStatus!=="ready")throw new h(`writable end state is "${this.writeStatus}" not "ready"`,kt);try{this.writeStatus="writing";let t={signal:this.sinkController.signal};if(this.direction==="outbound"){let s=this.sendNewStream(t);Ae(s)&&await s}let n=()=>{tt(e,this.log)};try{this.sinkController.signal.addEventListener("abort",n),this.log.trace("sink reading from source");for await(let s of e){s=s instanceof Uint8Array?new X(s):s;let i=this.sendData(s,t);Ae(i)&&await i}}finally{this.sinkController.signal.removeEventListener("abort",n)}this.log.trace('sink finished reading from source, write status is "%s"',this.writeStatus),this.writeStatus==="writing"&&(this.writeStatus="closing",this.log.trace("send close write to remote"),await this.sendCloseWrite({signal:AbortSignal.timeout(this.sendCloseWriteTimeout)}),this.writeStatus="closed"),this.onSinkEnd()}catch(t){throw this.log.trace("sink ended with error, calling abort with error",t),this.abort(t),t}finally{this.log.trace("resolve sink end"),this.sinkEnd.resolve()}}onSourceEnd(e){this.timeline.closeRead==null&&(this.timeline.closeRead=Date.now(),this.readStatus="closed",e!=null&&this.endErr==null&&(this.endErr=e),this.onCloseRead?.(),this.timeline.closeWrite!=null?(this.log.trace("source and sink ended"),this.timeline.close=Date.now(),this.status!=="aborted"&&this.status!=="reset"&&(this.status="closed"),this.onEnd!=null&&this.onEnd(this.endErr),this.closed.resolve()):this.log.trace("source ended, waiting for sink to end"))}onSinkEnd(e){this.timeline.closeWrite==null&&(this.timeline.closeWrite=Date.now(),this.writeStatus="closed",e!=null&&this.endErr==null&&(this.endErr=e),this.onCloseWrite?.(),this.timeline.closeRead!=null?(this.log.trace("sink and source ended"),this.timeline.close=Date.now(),this.status!=="aborted"&&this.status!=="reset"&&(this.status="closed"),this.onEnd!=null&&this.onEnd(this.endErr),this.closed.resolve()):this.log.trace("sink ended, waiting for source to end"))}async close(e){this.log.trace("closing gracefully"),this.status="closing",await Promise.all([this.closeRead(e),this.closeWrite(e)]),await ie(this.closed.promise,e?.signal),this.status="closed",this.log.trace("closed gracefully")}async closeRead(e={}){if(this.readStatus==="closing"||this.readStatus==="closed")return;this.log.trace('closing readable end of stream with starting read status "%s"',this.readStatus);let t=this.readStatus;this.readStatus="closing",this.status!=="reset"&&this.status!=="aborted"&&this.timeline.closeRead==null&&(this.log.trace("send close read to remote"),await this.sendCloseRead(e)),t==="ready"&&(this.log.trace("ending internal source queue with %d queued bytes",this.streamSource.readableLength),this.streamSource.end()),this.log.trace("closed readable end of stream")}async closeWrite(e={}){this.writeStatus==="closing"||this.writeStatus==="closed"||(this.log.trace('closing writable end of stream with starting write status "%s"',this.writeStatus),this.writeStatus==="ready"&&(this.log.trace("sink was never sunk, sink an empty array"),await ie(this.sink([]),e.signal)),this.writeStatus==="writing"&&await new Promise((t,n)=>{queueMicrotask(()=>{this.log.trace("aborting source passed to .sink"),this.sinkController.abort(),ie(this.sinkEnd.promise,e.signal).then(t,n)})}),this.writeStatus="closed",this.log.trace("closed writable end of stream"))}abort(e){if(this.status==="closed"||this.status==="aborted"||this.status==="reset")return;this.log("abort with error",e),this.log("try to send reset to remote");let t=this.sendReset();Ae(t)&&t.catch(n=>{this.log.error("error sending reset message",n)}),this.status="aborted",this.timeline.abort=Date.now(),this._closeSinkAndSource(e),this.onAbort?.(e)}reset(){if(this.status==="closed"||this.status==="aborted"||this.status==="reset")return;let e=new h("stream reset",Ot);this.status="reset",this.timeline.reset=Date.now(),this._closeSinkAndSource(e),this.onReset?.()}_closeSinkAndSource(e){this._closeSink(e),this._closeSource(e)}_closeSink(e){this.writeStatus==="writing"&&(this.log.trace("end sink source"),this.sinkController.abort()),this.onSinkEnd(e)}_closeSource(e){this.readStatus!=="closing"&&this.readStatus!=="closed"&&(this.log.trace("ending source with %d bytes to be read by consumer",this.streamSource.readableLength),this.readStatus="closing",this.streamSource.end(e))}remoteCloseWrite(){if(this.readStatus==="closing"||this.readStatus==="closed"){this.log("received remote close write but local source is already closed");return}this.log.trace("remote close write"),this._closeSource()}remoteCloseRead(){if(this.writeStatus==="closing"||this.writeStatus==="closed"){this.log("received remote close read but local sink is already closed");return}this.log.trace("remote close read"),this._closeSink()}destroy(){if(this.status==="closed"||this.status==="aborted"||this.status==="reset"){this.log("received destroy but we are already closed");return}this.log.trace("stream destroyed"),this._closeSinkAndSource()}sourcePush(e){this.streamSource.push(e)}sourceReadableLength(){return this.streamSource.readableLength}};function Pt(r){let[e,t]=r[Symbol.asyncIterator]!=null?[r[Symbol.asyncIterator](),Symbol.asyncIterator]:[r[Symbol.iterator](),Symbol.iterator],n=[];return{peek:()=>e.next(),push:s=>{n.push(s)},next:()=>n.length>0?{done:!1,value:n.shift()}:e.next(),[t](){return this}}}var rt=Pt;function Wt(r){return r[Symbol.asyncIterator]!=null}function nt(r){return r?.then!=null}function Vt(r,e){if(Wt(r))return async function*(){for await(let u of r){let f=e(u);nt(f)&&await f,yield u}}();let t=rt(r),{value:n,done:s}=t.next();if(s===!0)return function*(){}();if(typeof e(n)?.then=="function")return async function*(){yield n;for await(let u of t){let f=e(u);nt(f)&&await f,yield u}}();let a=e;return function*(){yield n;for(let u of t)a(u),yield u}()}var st=Vt;var T;(function(r){r[r.Init=0]="Init",r[r.SYNSent=1]="SYNSent",r[r.SYNReceived=2]="SYNReceived",r[r.Established=3]="Established",r[r.Finished=4]="Finished"})(T||(T={}));var ae=class extends oe{name;state;config;_id;sendWindowCapacity;sendWindowCapacityUpdate;recvWindow;recvWindowCapacity;epochStart;getRTT;sendFrame;constructor(e){super({...e,onEnd:t=>{this.state=T.Finished,e.onEnd?.(t)}}),this.config=e.config,this._id=parseInt(e.id,10),this.name=e.name,this.state=e.state,this.sendWindowCapacity=Y,this.recvWindow=this.config.initialStreamWindowSize,this.recvWindowCapacity=this.recvWindow,this.epochStart=Date.now(),this.getRTT=e.getRTT,this.sendFrame=e.sendFrame,this.source=st(this.source,()=>{this.sendWindowUpdate()})}async sendNewStream(){}async sendData(e,t={}){for(e=e.sublist();e.byteLength!==0;){if(this.sendWindowCapacity===0&&await this.waitForSendWindowCapacity(t),this.status!=="open")return;let n=Math.min(this.sendWindowCapacity,this.config.maxMessageSize-O,e.length),s=this.getSendFlags();this.sendFrame({type:b.Data,flag:s,streamID:this._id,length:n},e.sublist(0,n)),this.sendWindowCapacity-=n,e.consume(n)}}async sendReset(){this.sendFrame({type:b.WindowUpdate,flag:w.RST,streamID:this._id,length:0})}async sendCloseWrite(){let e=this.getSendFlags()|w.FIN;this.sendFrame({type:b.WindowUpdate,flag:e,streamID:this._id,length:0})}async sendCloseRead(){}async waitForSendWindowCapacity(e={}){if(this.sendWindowCapacity>0)return;let t,n,s=()=>{this.status==="open"?n(new h("stream aborted",ze)):t()};e.signal?.addEventListener("abort",s);try{await new Promise((i,a)=>{this.sendWindowCapacityUpdate=()=>{i()},n=a,t=i})}finally{e.signal?.removeEventListener("abort",s)}}handleWindowUpdate(e){this.log?.trace("stream received window update id=%s",this._id),this.processFlags(e.flag);let t=this.sendWindowCapacity;this.sendWindowCapacity+=e.length,t===0&&e.length>0&&this.sendWindowCapacityUpdate?.()}async handleData(e,t){if(this.log?.trace("stream received data id=%s",this._id),this.processFlags(e.flag),this.recvWindowCapacity-1&&t-this.epochStart=this.recvWindow&&e===0)return;let s=this.recvWindow-this.recvWindowCapacity;this.recvWindowCapacity=this.recvWindow,this.epochStart=t,this.sendFrame({type:b.WindowUpdate,flag:e,streamID:this._id,length:s})}};var it="/yamux/1.0.0",Gt=500,le=class{protocol=it;_init;constructor(e={}){this._init=e}createStreamMuxer(e){return new Ie({...this._init,...e})}},Ie=class{protocol=it;source;sink;config;log;closeController;nextStreamID;_streams;nextPingID;activePing;rtt;client;localGoAway;remoteGoAway;numInboundStreams;numOutboundStreams;onIncomingStream;onStreamEnd;constructor(e){this.client=e.direction==="outbound",this.config={...$e,...e},this.log=this.config.log,He(this.config),this.closeController=new AbortController,he(1/0,this.closeController.signal),this.onIncomingStream=e.onIncomingStream,this.onStreamEnd=e.onStreamEnd,this._streams=new Map,this.source=ee({onEnd:()=>{this.log?.trace("muxer source ended"),this._streams.forEach(t=>{t.destroy()})}}),this.sink=async t=>{let n=()=>{let a=Q(t);if(a.return!=null){let u=a.return();Bt(u)&&u.catch(f=>{this.log?.("could not cause sink source to return",f)})}},s,i;try{let a=new ne(t);try{this.closeController.signal.addEventListener("abort",n);for await(let u of a.emitFrames())await this.handleFrame(u.header,u.readData)}finally{this.closeController.signal.removeEventListener("abort",n)}s=I.NormalTermination}catch(a){let u=a.code;Be.has(u)?(this.log?.error("protocol error in sink",a),s=I.ProtocolError):(this.log?.error("internal error in sink",a),s=I.InternalError),i=a}this.log?.trace("muxer sink ended"),i!=null?this.abort(i,s):await this.close({reason:s})},this.numInboundStreams=0,this.numOutboundStreams=0,this.nextStreamID=this.client?1:2,this.nextPingID=0,this.rtt=-1,this.log?.trace("muxer created"),this.config.enableKeepAlive&&this.keepAliveLoop().catch(t=>this.log?.error("keepalive error: %s",t)),this.ping().catch(t=>this.log?.error("ping error: %s",t))}get streams(){return Array.from(this._streams.values())}newStream(e){if(this.remoteGoAway!==void 0)throw new h("muxer closed remotely",xe);if(this.localGoAway!==void 0)throw new h("muxer closed locally",te);let t=this.nextStreamID;if(this.nextStreamID+=2,this.numOutboundStreams>=this.config.maxOutboundStreams)throw new h("max outbound streams exceeded",Xe);this.log?.trace("new outgoing stream id=%s",t);let n=this._newStream(t,e,T.Init,"outbound");return this._streams.set(t,n),this.numOutboundStreams++,n.sendWindowUpdate(),n}async ping(){if(this.remoteGoAway!==void 0)throw new h("muxer closed remotely",xe);if(this.localGoAway!==void 0)throw new h("muxer closed locally",te);if(this.activePing===void 0){let e=()=>{};this.activePing={id:this.nextPingID++,promise:new Promise((s,i)=>{let a=()=>{i(new h("muxer closed locally",te))};this.closeController.signal.addEventListener("abort",a,{once:!0}),e=()=>{this.closeController.signal.removeEventListener("abort",a),s()}}),resolve:e};let t=Date.now();this.sendPing(this.activePing.id);try{await this.activePing.promise}finally{delete this.activePing}let n=Date.now();this.rtt=n-t}else await this.activePing.promise;return this.rtt}getRTT(){return this.rtt}async close(e={}){if(this.closeController.signal.aborted)return;let t=e?.reason??I.NormalTermination;if(this.log?.trace("muxer close reason=%s",t),e.signal==null){let n=AbortSignal.timeout(Gt);he(1/0,n),e={...e,signal:n}}try{await Promise.all([...this._streams.values()].map(async n=>n.close(e))),this.sendGoAway(t),this._closeMuxer()}catch(n){this.abort(n)}}abort(e,t){if(!this.closeController.signal.aborted){t=t??I.InternalError,this.log?.error("muxer abort reason=%s error=%s",t,e);for(let n of this._streams.values())n.abort(e);this.sendGoAway(t),this._closeMuxer()}}isClosed(){return this.closeController.signal.aborted}_closeMuxer(){this.closeController.abort(),this.source.end()}_newStream(e,t,n,s){if(this._streams.get(e)!=null)throw new h("Stream already exists",Ee,{id:e});let i=new ae({id:e.toString(),name:t,state:n,direction:s,sendFrame:this.sendFrame.bind(this),onEnd:()=>{this.closeStream(e),this.onStreamEnd?.(i)},log:J(`libp2p:yamux:${s}:${e}`),config:this.config,getRTT:this.getRTT.bind(this)});return i}closeStream(e){this.client===(e%2===0)?this.numInboundStreams--:this.numOutboundStreams--,this._streams.delete(e)}async keepAliveLoop(){let e=new Promise((t,n)=>{this.closeController.signal.addEventListener("abort",n,{once:!0})});for(this.log?.trace("muxer keepalive enabled interval=%s",this.config.keepAliveInterval);;){let t;try{await Promise.race([e,new Promise(n=>{t=setTimeout(n,this.config.keepAliveInterval)})]),this.ping().catch(n=>this.log?.error("ping error: %s",n))}catch{clearInterval(t);return}}}async handleFrame(e,t){let{streamID:n,type:s,length:i}=e;if(this.log?.trace("received frame %o",e),n===0)switch(s){case b.Ping:{this.handlePing(e);return}case b.GoAway:{this.handleGoAway(i);return}default:throw new h("Invalid frame type",z,{header:e})}else switch(e.type){case b.Data:case b.WindowUpdate:{await this.handleStreamMessage(e,t);return}default:throw new h("Invalid frame type",z,{header:e})}}handlePing(e){if(e.flag===w.SYN)this.log?.trace("received ping request pingId=%s",e.length),this.sendPing(e.length,w.ACK);else if(e.flag===w.ACK)this.log?.trace("received ping response pingId=%s",e.length),this.handlePingResponse(e.length);else throw new h("Invalid frame flag",z,{header:e})}handlePingResponse(e){if(this.activePing===void 0)throw new h("ping not requested",be);if(this.activePing.id!==e)throw new h("ping doesn't match our id",ye);this.activePing.resolve()}handleGoAway(e){this.log?.trace("received GoAway reason=%s",I[e]??"unknown"),this.remoteGoAway=e;for(let t of this._streams.values())t.reset();this._closeMuxer()}async handleStreamMessage(e,t){let{streamID:n,flag:s,type:i}=e;(s&w.SYN)===w.SYN&&this.incomingStream(n);let a=this._streams.get(n);if(a===void 0){if(i===b.Data){if(this.log?.("discarding data for stream id=%s",n),t===void 0)throw new Error("unreachable");await t()}else this.log?.("frame for missing stream id=%s",n);return}switch(i){case b.WindowUpdate:{a.handleWindowUpdate(e);return}case b.Data:{if(t===void 0)throw new Error("unreachable");await a.handleData(e,t);return}default:throw new Error("unreachable")}}incomingStream(e){if(this.client!==(e%2===0))throw new h("both endpoints are clients",Ce);if(this._streams.has(e))return;if(this.log?.trace("new incoming stream id=%s",e),this.localGoAway!==void 0){this.sendFrame({type:b.WindowUpdate,flag:w.RST,streamID:e,length:0});return}if(this.numInboundStreams>=this.config.maxInboundStreams){this.log?.("maxIncomingStreams exceeded, forcing stream reset"),this.sendFrame({type:b.WindowUpdate,flag:w.RST,streamID:e,length:0});return}let t=this._newStream(e,void 0,T.SYNReceived,"inbound");this.numInboundStreams++,this._streams.set(e,t),this.onIncomingStream?.(t)}sendFrame(e,t){if(this.log?.trace("sending frame %o",e),e.type===b.Data){if(t===void 0)throw new h("invalid frame",z);this.source.push(ve(e)),this.source.push(t)}else this.source.push(ve(e))}sendPing(e,t=w.SYN){t===w.SYN?this.log?.trace("sending ping request pingId=%s",e):this.log?.trace("sending ping response pingId=%s",e),this.sendFrame({type:b.Ping,flag:t,streamID:0,length:e})}sendGoAway(e=I.NormalTermination){this.log?.("sending GoAway reason=%s",I[e]),this.localGoAway=e,this.sendFrame({type:b.GoAway,flag:0,streamID:0,length:e})}};function Bt(r){return r!=null&&typeof r.then=="function"}function zt(r={}){return()=>new le(r)}return dt(Xt);})(); -return ChainsafeLibp2PYamux})); diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/config.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/config.d.ts deleted file mode 100644 index ff55522e1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/config.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { type Logger } from '@libp2p/logger'; -export interface Config { - /** - * Used to control the log destination - * - * It can be disabled by explicitly setting to `undefined` - */ - log?: Logger; - /** - * Used to do periodic keep alive messages using a ping. - */ - enableKeepAlive: boolean; - /** - * How often to perform the keep alive - * - * measured in milliseconds - */ - keepAliveInterval: number; - /** - * Maximum number of concurrent inbound streams that we accept. - * If the peer tries to open more streams, those will be reset immediately. - */ - maxInboundStreams: number; - /** - * Maximum number of concurrent outbound streams that we accept. - * If the application tries to open more streams, the call to `newStream` will throw - */ - maxOutboundStreams: number; - /** - * Used to control the initial window size that we allow for a stream. - * - * measured in bytes - */ - initialStreamWindowSize: number; - /** - * Used to control the maximum window size that we allow for a stream. - */ - maxStreamWindowSize: number; - /** - * Maximum size of a message that we'll send on a stream. - * This ensures that a single stream doesn't hog a connection. - */ - maxMessageSize: number; -} -export declare const defaultConfig: Config; -export declare function verifyConfig(config: Config): void; -//# sourceMappingURL=config.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/config.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/config.d.ts.map deleted file mode 100644 index f936d2ec5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/config.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAIpD,MAAM,WAAW,MAAM;IACrB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,eAAe,EAAE,OAAO,CAAA;IAExB;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAA;IAE1B;;;;OAIG;IACH,uBAAuB,EAAE,MAAM,CAAA;IAE/B;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAA;IAE3B;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,aAAa,EAAE,MAS3B,CAAA;AAED,wBAAgB,YAAY,CAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAsBlD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/config.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/config.js deleted file mode 100644 index b3f7ac179..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/config.js +++ /dev/null @@ -1,37 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { logger } from '@libp2p/logger'; -import { ERR_INVALID_CONFIG, INITIAL_STREAM_WINDOW, MAX_STREAM_WINDOW } from './constants.js'; -export const defaultConfig = { - log: logger('libp2p:yamux'), - enableKeepAlive: true, - keepAliveInterval: 30000, - maxInboundStreams: 1000, - maxOutboundStreams: 1000, - initialStreamWindowSize: INITIAL_STREAM_WINDOW, - maxStreamWindowSize: MAX_STREAM_WINDOW, - maxMessageSize: 64 * 1024 -}; -export function verifyConfig(config) { - if (config.keepAliveInterval <= 0) { - throw new CodeError('keep-alive interval must be positive', ERR_INVALID_CONFIG); - } - if (config.maxInboundStreams < 0) { - throw new CodeError('max inbound streams must be larger or equal 0', ERR_INVALID_CONFIG); - } - if (config.maxOutboundStreams < 0) { - throw new CodeError('max outbound streams must be larger or equal 0', ERR_INVALID_CONFIG); - } - if (config.initialStreamWindowSize < INITIAL_STREAM_WINDOW) { - throw new CodeError('InitialStreamWindowSize must be larger or equal 256 kB', ERR_INVALID_CONFIG); - } - if (config.maxStreamWindowSize < config.initialStreamWindowSize) { - throw new CodeError('MaxStreamWindowSize must be larger than the InitialStreamWindowSize', ERR_INVALID_CONFIG); - } - if (config.maxStreamWindowSize > 2 ** 32 - 1) { - throw new CodeError('MaxStreamWindowSize must be less than equal MAX_UINT32', ERR_INVALID_CONFIG); - } - if (config.maxMessageSize < 1024) { - throw new CodeError('MaxMessageSize must be greater than a kilobyte', ERR_INVALID_CONFIG); - } -} -//# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/config.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/config.js.map deleted file mode 100644 index 1f9fe8cb1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,MAAM,EAAe,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAsD7F,MAAM,CAAC,MAAM,aAAa,GAAW;IACnC,GAAG,EAAE,MAAM,CAAC,cAAc,CAAC;IAC3B,eAAe,EAAE,IAA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arraylists-yield-chunks/yamux/dist/src/constants.d.ts deleted file mode 100644 index a9ad1e4d6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/constants.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -export declare const ERR_INVALID_FRAME = "ERR_INVALID_FRAME"; -export declare const ERR_UNREQUESTED_PING = "ERR_UNREQUESTED_PING"; -export declare const ERR_NOT_MATCHING_PING = "ERR_NOT_MATCHING_PING"; -export declare const ERR_STREAM_ALREADY_EXISTS = "ERR_STREAM_ALREADY_EXISTS"; -export declare const ERR_DECODE_INVALID_VERSION = "ERR_DECODE_INVALID_VERSION"; -export declare const ERR_BOTH_CLIENTS = "ERR_BOTH_CLIENTS"; -export declare const ERR_RECV_WINDOW_EXCEEDED = "ERR_RECV_WINDOW_EXCEEDED"; -export declare const PROTOCOL_ERRORS: Set; -export declare const ERR_INVALID_CONFIG = "ERR_INVALID_CONFIG"; -export declare const ERR_MUXER_LOCAL_CLOSED = "ERR_MUXER_LOCAL_CLOSED"; -export declare const ERR_MUXER_REMOTE_CLOSED = "ERR_MUXER_REMOTE_CLOSED"; -export declare const ERR_STREAM_RESET = "ERR_STREAM_RESET"; -export declare const ERR_STREAM_ABORT = "ERR_STREAM_ABORT"; -export declare const ERR_MAX_OUTBOUND_STREAMS_EXCEEDED = "ERROR_MAX_OUTBOUND_STREAMS_EXCEEDED"; -export declare const ERR_DECODE_IN_PROGRESS = "ERR_DECODE_IN_PROGRESS"; -/** - * INITIAL_STREAM_WINDOW is the initial stream window size. - * - * Not an implementation choice, this is defined in the specification - */ -export declare const INITIAL_STREAM_WINDOW: number; -/** - * Default max stream window - */ -export declare const MAX_STREAM_WINDOW: number; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/constants.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/constants.d.ts.map deleted file mode 100644 index 81d5aa8ae..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,sBAAsB,CAAA;AACpD,eAAO,MAAM,oBAAoB,yBAAyB,CAAA;AAC1D,eAAO,MAAM,qBAAqB,0BAA0B,CAAA;AAC5D,eAAO,MAAM,yBAAyB,8BAA8B,CAAA;AACpE,eAAO,MAAM,0BAA0B,+BAA+B,CAAA;AACtE,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAClD,eAAO,MAAM,wBAAwB,6BAA6B,CAAA;AAElE,eAAO,MAAM,eAAe,aAQ1B,CAAA;AAIF,eAAO,MAAM,kBAAkB,uBAAuB,CAAA;AACtD,eAAO,MAAM,sBAAsB,2BAA2B,CAAA;AAC9D,eAAO,MAAM,uBAAuB,4BAA4B,CAAA;AAChE,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAClD,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAClD,eAAO,MAAM,iCAAiC,wCAAwC,CAAA;AACtF,eAAO,MAAM,sBAAsB,2BAA2B,CAAA;AAE9D;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAa,CAAA;AAE/C;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAmB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/constants.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/constants.js deleted file mode 100644 index ddc95641a..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/constants.js +++ /dev/null @@ -1,36 +0,0 @@ -// Protocol violation errors -export const ERR_INVALID_FRAME = 'ERR_INVALID_FRAME'; -export const ERR_UNREQUESTED_PING = 'ERR_UNREQUESTED_PING'; -export const ERR_NOT_MATCHING_PING = 'ERR_NOT_MATCHING_PING'; -export const ERR_STREAM_ALREADY_EXISTS = 'ERR_STREAM_ALREADY_EXISTS'; -export const ERR_DECODE_INVALID_VERSION = 'ERR_DECODE_INVALID_VERSION'; -export const ERR_BOTH_CLIENTS = 'ERR_BOTH_CLIENTS'; -export const ERR_RECV_WINDOW_EXCEEDED = 'ERR_RECV_WINDOW_EXCEEDED'; -export const PROTOCOL_ERRORS = new Set([ - ERR_INVALID_FRAME, - ERR_UNREQUESTED_PING, - ERR_NOT_MATCHING_PING, - ERR_STREAM_ALREADY_EXISTS, - ERR_DECODE_INVALID_VERSION, - ERR_BOTH_CLIENTS, - ERR_RECV_WINDOW_EXCEEDED -]); -// local errors -export const ERR_INVALID_CONFIG = 'ERR_INVALID_CONFIG'; -export const ERR_MUXER_LOCAL_CLOSED = 'ERR_MUXER_LOCAL_CLOSED'; -export const ERR_MUXER_REMOTE_CLOSED = 'ERR_MUXER_REMOTE_CLOSED'; -export const ERR_STREAM_RESET = 'ERR_STREAM_RESET'; -export const ERR_STREAM_ABORT = 'ERR_STREAM_ABORT'; -export const ERR_MAX_OUTBOUND_STREAMS_EXCEEDED = 'ERROR_MAX_OUTBOUND_STREAMS_EXCEEDED'; -export const ERR_DECODE_IN_PROGRESS = 'ERR_DECODE_IN_PROGRESS'; -/** - * INITIAL_STREAM_WINDOW is the initial stream window size. - * - * Not an implementation choice, this is defined in the specification - */ -export const INITIAL_STREAM_WINDOW = 256 * 1024; -/** - * Default max stream window - */ -export const MAX_STREAM_WINDOW = 16 * 1024 * 1024; -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/constants.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/constants.js.map deleted file mode 100644 index 6995fa29b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAE5B,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAA;AACpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAA;AAC1D,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAA;AAC5D,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAA;AACpE,MAAM,CAAC,MAAM,0BAA0B,GAAG,4BAA4B,CAAA;AACtE,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAA;AAClD,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAA;AAElE,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IACrC,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,yBAAyB;IACzB,0BAA0B;IAC1B,gBAAgB;IAChB,wBAAwB;CACzB,CAAC,CAAA;AAEF,eAAe;AAEf,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAA;AACtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAA;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAA;AAClD,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAA;AAClD,MAAM,CAAC,MAAM,iCAAiC,GAAG,qCAAqC,CAAA;AACtF,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAE9D;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,GAAG,IAAI,CAAA;AAE/C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/decode.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/decode.d.ts deleted file mode 100644 index 213b19340..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/decode.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Uint8ArrayList } from 'uint8arraylist'; -import { type FrameHeader } from './frame.js'; -import type { Source } from 'it-stream-types'; -/** - * Decode a header from the front of a buffer - * - * @param data - Assumed to have enough bytes for a header - */ -export declare function decodeHeader(data: Uint8Array): FrameHeader; -/** - * Decodes yamux frames from a source - */ -export declare class Decoder { - private readonly source; - /** Buffer for in-progress frames */ - private readonly buffer; - /** Used to sanity check against decoding while in an inconsistent state */ - private frameInProgress; - constructor(source: Source); - /** - * Emits frames from the decoder source. - * - * Note: If `readData` is emitted, it _must_ be called before the next iteration - * Otherwise an error is thrown - */ - emitFrames(): AsyncGenerator<{ - header: FrameHeader; - readData?: () => Promise; - }>; - private readHeader; - private readBytes; -} -/** - * Strip the `return` method from a `Source` - */ -export declare function returnlessSource(source: Source): Source; -//# sourceMappingURL=decode.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/decode.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/decode.d.ts.map deleted file mode 100644 index e5734d620..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/decode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../src/decode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,EAAE,KAAK,WAAW,EAA2C,MAAM,YAAY,CAAA;AACtF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAM7C;;;;GAIG;AACH,wBAAgB,YAAY,CAAE,IAAI,EAAE,UAAU,GAAG,WAAW,CAU3D;AAED;;GAEG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;IAC5D,oCAAoC;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;IACvC,2EAA2E;IAC3E,OAAO,CAAC,eAAe,CAAS;gBAEnB,MAAM,EAAE,MAAM,CAAC,UAAU,GAAG,cAAc,CAAC;IAcxD;;;;;OAKG;IACK,UAAU,IAAK,cAAc,CAAC;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,CAAA;KAAE,CAAC;IA4BxG,OAAO,CAAC,UAAU;YAiBJ,SAAS;CAoBxB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAG,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAgBjE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/decode.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/decode.js deleted file mode 100644 index aaf020d66..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/decode.js +++ /dev/null @@ -1,131 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { Uint8ArrayList } from 'uint8arraylist'; -import { ERR_DECODE_INVALID_VERSION, ERR_DECODE_IN_PROGRESS } from './constants.js'; -import { FrameType, HEADER_LENGTH, YAMUX_VERSION } from './frame.js'; -// used to bitshift in decoding -// native bitshift can overflow into a negative number, so we bitshift by multiplying by a power of 2 -const twoPow24 = 2 ** 24; -/** - * Decode a header from the front of a buffer - * - * @param data - Assumed to have enough bytes for a header - */ -export function decodeHeader(data) { - if (data[0] !== YAMUX_VERSION) { - throw new CodeError('Invalid frame version', ERR_DECODE_INVALID_VERSION); - } - return { - type: data[1], - flag: (data[2] << 8) + data[3], - streamID: (data[4] * twoPow24) + (data[5] << 16) + (data[6] << 8) + data[7], - length: (data[8] * twoPow24) + (data[9] << 16) + (data[10] << 8) + data[11] - }; -} -/** - * Decodes yamux frames from a source - */ -export class Decoder { - source; - /** Buffer for in-progress frames */ - buffer; - /** Used to sanity check against decoding while in an inconsistent state */ - frameInProgress; - constructor(source) { - // Normally, when entering a for-await loop with an iterable/async iterable, the only ways to exit the loop are: - // 1. exhaust the iterable - // 2. throw an error - slow, undesirable if there's not actually an error - // 3. break or return - calls the iterable's `return` method, finalizing the iterable, no more iteration possible - // - // In this case, we want to enter (and exit) a for-await loop per chunked data frame and continue processing the iterable. - // To do this, we strip the `return` method from the iterator and can now `break` early and continue iterating. - // Exiting the main for-await is still possible via 1. and 2. - this.source = returnlessSource(source); - this.buffer = new Uint8ArrayList(); - this.frameInProgress = false; - } - /** - * Emits frames from the decoder source. - * - * Note: If `readData` is emitted, it _must_ be called before the next iteration - * Otherwise an error is thrown - */ - async *emitFrames() { - for await (const chunk of this.source) { - this.buffer.append(chunk); - // Loop to consume as many bytes from the buffer as possible - // Eg: when a single chunk contains several frames - while (true) { - const header = this.readHeader(); - if (header === undefined) { - break; - } - const { type, length } = header; - if (type === FrameType.Data) { - // This is a data frame, the frame body must still be read - // `readData` must be called before the next iteration here - this.frameInProgress = true; - yield { - header, - readData: this.readBytes.bind(this, length) - }; - } - else { - yield { header }; - } - } - } - } - readHeader() { - // Sanity check to ensure a header isn't read when another frame is partially decoded - // In practice this shouldn't happen - if (this.frameInProgress) { - throw new CodeError('decoding frame already in progress', ERR_DECODE_IN_PROGRESS); - } - if (this.buffer.length < HEADER_LENGTH) { - // not enough data yet - return; - } - const header = decodeHeader(this.buffer.subarray(0, HEADER_LENGTH)); - this.buffer.consume(HEADER_LENGTH); - return header; - } - async readBytes(length) { - if (this.buffer.length < length) { - for await (const chunk of this.source) { - this.buffer.append(chunk); - if (this.buffer.length >= length) { - // see note above, the iterator is not `return`ed here - break; - } - } - } - const out = this.buffer.sublist(0, length); - this.buffer.consume(length); - // The next frame can now be decoded - this.frameInProgress = false; - return out; - } -} -/** - * Strip the `return` method from a `Source` - */ -export function returnlessSource(source) { - if (source[Symbol.iterator] !== undefined) { - const iterator = source[Symbol.iterator](); - iterator.return = undefined; - return { - [Symbol.iterator]() { return iterator; } - }; - } - else if (source[Symbol.asyncIterator] !== undefined) { - const iterator = source[Symbol.asyncIterator](); - iterator.return = undefined; - return { - [Symbol.asyncIterator]() { return iterator; } - }; - } - else { - throw new Error('a source must be either an iterable or an async iterable'); - } -} -//# sourceMappingURL=decode.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/decode.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/decode.js.map deleted file mode 100644 index 4f017a489..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/decode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode.js","sourceRoot":"","sources":["../../src/decode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AACnF,OAAO,EAAoB,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAGtF,+BAA+B;AAC/B,qGAAqG;AACrG,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAA;AAExB;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAE,IAAgB;IAC5C,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,aAAa,EAAE;QAC7B,MAAM,IAAI,SAAS,CAAC,uBAAuB,EA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AAM,CAAC,MAAM,IAAI,MAAM,EAAE;oBAChC,sDAAsD;oBACtD,MAAK;iBACN;aACF;SACF;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;QAC1C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAE3B,oCAAoC;QACpC,IAAI,CAAC,eAAe,GAAG,KAAK,CAAA;QAE5B,OAAO,GAAG,CAAA;IACZ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAK,MAAiB;IACpD,IAAK,MAAsB,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE;QAC1D,MAAM,QAAQ,GAAI,MAAsB,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAA;QAC3D,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAA;QAC3B,OAAO;YACL,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAM,OAAO,QAAQ,CAAA,CAAC,CAAC;SACzC,CAAA;KACF;SAAM,IAAK,MAA2B,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,SAAS,EAAE;QAC3E,MAAM,QAAQ,GAAI,MAA2B,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAA;QACrE,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAA;QAC3B,OAAO;YACL,CAAC,MAAM,CAAC,aAAa,CAAC,KAAM,OAAO,QAAQ,CAAA,CAAC,CAAC;SAC9C,CAAA;KACF;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAA;KAC5E;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/encode.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/encode.d.ts deleted file mode 100644 index 22cda8ff5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/encode.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FrameHeader } from './frame.js'; -export declare function encodeHeader(header: FrameHeader): Uint8Array; -//# sourceMappingURL=encode.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/encode.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/encode.d.ts.map deleted file mode 100644 index 663e060f6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/encode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../src/encode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C,wBAAgB,YAAY,CAAE,MAAM,EAAE,WAAW,GAAG,UAAU,CAsB7D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/encode.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/encode.js deleted file mode 100644 index ef322918e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/encode.js +++ /dev/null @@ -1,19 +0,0 @@ -import { HEADER_LENGTH } from './frame.js'; -export function encodeHeader(header) { - const frame = new Uint8Array(HEADER_LENGTH); - // always assume version 0 - // frameView.setUint8(0, header.version) - frame[1] = header.type; - frame[2] = header.flag >>> 8; - frame[3] = header.flag; - frame[4] = header.streamID >>> 24; - frame[5] = header.streamID >>> 16; - frame[6] = header.streamID >>> 8; - frame[7] = header.streamID; - frame[8] = header.length >>> 24; - frame[9] = header.length >>> 16; - frame[10] = header.length >>> 8; - frame[11] = header.length; - return frame; -} -//# sourceMappingURL=encode.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/encode.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/encode.js.map deleted file mode 100644 index 2c3e44e75..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/encode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode.js","sourceRoot":"","sources":["../../src/encode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG1C,MAAM,UAAU,YAAY,CAAE,MAAmB;IAC/C,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,aAAa,CAAC,CAAA;IAE3C,0BAA0B;IAC1B,wCAAwC;IAExC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAA;IAEtB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,KAAK,CAAC,CAAA;IAC5B,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAA;IAEtB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,KAAK,EAAE,CAAA;IACjC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,KAAK,EAAE,CAAA;IACjC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAA;IAChC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAA;IAE1B,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,EAAE,CAAA;IAC/B,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,EAAE,CAAA;IAC/B,KAAK,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,CAAC,CAAA;IAC/B,KAAK,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,CAAA;IAEzB,OAAO,KAAK,CAAA;AACd,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/frame.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/frame.d.ts deleted file mode 100644 index 2ca65226f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/frame.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -export declare enum FrameType { - /** Used to transmit data. May transmit zero length payloads depending on the flags. */ - Data = 0, - /** Used to updated the senders receive window size. This is used to implement per-session flow control. */ - WindowUpdate = 1, - /** Used to measure RTT. It can also be used to heart-beat and do keep-alives over TCP. */ - Ping = 2, - /** Used to close a session. */ - GoAway = 3 -} -export declare enum Flag { - /** Signals the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate outbound. */ - SYN = 1, - /** Acknowledges the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate response. */ - ACK = 2, - /** Performs a half-close of a stream. May be sent with a data message or window update. */ - FIN = 4, - /** Reset a stream immediately. May be sent with a data or window update message. */ - RST = 8 -} -export declare const YAMUX_VERSION = 0; -export declare enum GoAwayCode { - NormalTermination = 0, - ProtocolError = 1, - InternalError = 2 -} -export declare const HEADER_LENGTH = 12; -export interface FrameHeader { - /** - * The version field is used for future backward compatibility. - * At the current time, the field is always set to 0, to indicate the initial version. - */ - version?: number; - /** The type field is used to switch the frame message type. */ - type: FrameType; - /** The flags field is used to provide additional information related to the message type. */ - flag: number; - /** - * The StreamID field is used to identify the logical stream the frame is addressing. - * The client side should use odd ID's, and the server even. - * This prevents any collisions. Additionally, the 0 ID is reserved to represent the session. - */ - streamID: number; - /** - * The meaning of the length field depends on the message type: - * * Data - provides the length of bytes following the header - * * Window update - provides a delta update to the window size - * * Ping - Contains an opaque value, echoed back - * * Go Away - Contains an error code - */ - length: number; -} -export declare function stringifyHeader(header: FrameHeader): string; -//# sourceMappingURL=frame.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/frame.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/frame.d.ts.map deleted file mode 100644 index eed8a553b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/frame.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../src/frame.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,uFAAuF;IACvF,IAAI,IAAM;IACV,2GAA2G;IAC3G,YAAY,IAAM;IAClB,0FAA0F;IAC1F,IAAI,IAAM;IACV,+BAA+B;IAC/B,MAAM,IAAM;CACb;AAED,oBAAY,IAAI;IACd,uIAAuI;IACvI,GAAG,IAAM;IACT,4IAA4I;IAC5I,GAAG,IAAM;IACT,2FAA2F;IAC3F,GAAG,IAAM;IACT,oFAAoF;IACpF,GAAG,IAAM;CACV;AAID,eAAO,MAAM,aAAa,IAAI,CAAA;AAE9B,oBAAY,UAAU;IACpB,iBAAiB,IAAM;IACvB,aAAa,IAAM;IACnB,aAAa,IAAM;CACpB;AAED,eAAO,MAAM,aAAa,KAAK,CAAA;AAE/B,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,+DAA+D;IAC/D,IAAI,EAAE,SAAS,CAAA;IACf,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,eAAe,CAAE,MAAM,EAAE,WAAW,GAAG,MAAM,CAG5D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/frame.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/frame.js deleted file mode 100644 index de1f1c83d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/frame.js +++ /dev/null @@ -1,36 +0,0 @@ -export var FrameType; -(function (FrameType) { - /** Used to transmit data. May transmit zero length payloads depending on the flags. */ - FrameType[FrameType["Data"] = 0] = "Data"; - /** Used to updated the senders receive window size. This is used to implement per-session flow control. */ - FrameType[FrameType["WindowUpdate"] = 1] = "WindowUpdate"; - /** Used to measure RTT. It can also be used to heart-beat and do keep-alives over TCP. */ - FrameType[FrameType["Ping"] = 2] = "Ping"; - /** Used to close a session. */ - FrameType[FrameType["GoAway"] = 3] = "GoAway"; -})(FrameType || (FrameType = {})); -export var Flag; -(function (Flag) { - /** Signals the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate outbound. */ - Flag[Flag["SYN"] = 1] = "SYN"; - /** Acknowledges the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate response. */ - Flag[Flag["ACK"] = 2] = "ACK"; - /** Performs a half-close of a stream. May be sent with a data message or window update. */ - Flag[Flag["FIN"] = 4] = "FIN"; - /** Reset a stream immediately. May be sent with a data or window update message. */ - Flag[Flag["RST"] = 8] = "RST"; -})(Flag || (Flag = {})); -const flagCodes = Object.values(Flag).filter((x) => typeof x !== 'string'); -export const YAMUX_VERSION = 0; -export var GoAwayCode; -(function (GoAwayCode) { - GoAwayCode[GoAwayCode["NormalTermination"] = 0] = "NormalTermination"; - GoAwayCode[GoAwayCode["ProtocolError"] = 1] = "ProtocolError"; - GoAwayCode[GoAwayCode["InternalError"] = 2] = "InternalError"; -})(GoAwayCode || (GoAwayCode = {})); -export const HEADER_LENGTH = 12; -export function stringifyHeader(header) { - const flags = flagCodes.filter(f => (header.flag & f) === f).map(f => Flag[f]).join('|'); - return `streamID=${header.streamID} type=${FrameType[header.type]} flag=${flags} length=${header.length}`; -} -//# sourceMappingURL=frame.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/frame.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/frame.js.map deleted file mode 100644 index 96ab043f8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/frame.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"frame.js","sourceRoot":"","sources":["../../src/frame.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,SASX;AATD,WAAY,SAAS;IACnB,uFAAuF;IACvF,yCAAU,CAAA;IACV,2GAA2G;IAC3G,yDAAkB,CAAA;IAClB,0FAA0F;IAC1F,yCAAU,CAAA;IACV,+BAA+B;IAC/B,6CAAY,CAAA;AACd,CAAC,EATW,SAAS,KAAT,SAAS,QASpB;AAED,MAAM,CAAN,IAAY,IASX;AATD,WAAY,IAAI;IACd,uIAAuI;IACvI,6BAAS,CAAA;IACT,4IAA4I;IAC5I,6BAAS,CAAA;IACT,2FAA2F;IAC3F,6BAAS,CAAA;IACT,oFAAoF;IACpF,6BAAS,CAAA;AACX,CAAC,EATW,IAAI,KAAJ,IAAI,QASf;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAW,CAAA;AAEpF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAA;AAE9B,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,qEAAuB,CAAA;IACvB,6DAAmB,CAAA;IACnB,6DAAmB,CAAA;AACrB,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAA;AA4B/B,MAAM,UAAU,eAAe,CAAE,MAAmB;IAClD,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACxF,OAAO,YAAY,MAAM,CAAC,QAAQ,SAAS,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,KAAK,WAAW,MAAM,CAAC,MAAM,EAAE,CAAA;AAC3G,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/index.d.ts deleted file mode 100644 index 53e2e5cb6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { YamuxMuxerInit } from './muxer.js'; -import type { StreamMuxerFactory } from '@libp2p/interface/stream-muxer'; -export { GoAwayCode } from './frame.js'; -export declare function yamux(init?: YamuxMuxerInit): () => StreamMuxerFactory; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/index.d.ts.map deleted file mode 100644 index e74ad16c9..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,wBAAgB,KAAK,CAAE,IAAI,GAAE,cAAmB,GAAG,MAAM,kBAAkB,CAE1E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/index.js deleted file mode 100644 index 9bb750727..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import { Yamux } from './muxer.js'; -export { GoAwayCode } from './frame.js'; -export function yamux(init = {}) { - return () => new Yamux(init); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/index.js.map deleted file mode 100644 index a572a9651..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,MAAM,UAAU,KAAK,CAAE,OAAuB,EAAE;IAC9C,OAAO,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/muxer.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/muxer.d.ts deleted file mode 100644 index 15b2d6221..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/muxer.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { type Pushable } from 'it-pushable'; -import { type Config } from './config.js'; -import { GoAwayCode } from './frame.js'; -import { YamuxStream } from './stream.js'; -import type { AbortOptions } from '@libp2p/interface'; -import type { StreamMuxer, StreamMuxerFactory, StreamMuxerInit } from '@libp2p/interface/stream-muxer'; -import type { Sink, Source } from 'it-stream-types'; -import type { Uint8ArrayList } from 'uint8arraylist'; -export interface YamuxMuxerInit extends StreamMuxerInit, Partial { -} -export declare class Yamux implements StreamMuxerFactory { - protocol: string; - private readonly _init; - constructor(init?: YamuxMuxerInit); - createStreamMuxer(init?: YamuxMuxerInit): YamuxMuxer; -} -export interface CloseOptions extends AbortOptions { - reason?: GoAwayCode; -} -export declare class YamuxMuxer implements StreamMuxer { - protocol: string; - source: Pushable; - sink: Sink, Promise>; - private readonly config; - private readonly log?; - /** Used to close the muxer from either the sink or source */ - private readonly closeController; - /** The next stream id to be used when initiating a new stream */ - private nextStreamID; - /** Primary stream mapping, streamID => stream */ - private readonly _streams; - /** The next ping id to be used when pinging */ - private nextPingID; - /** Tracking info for the currently active ping */ - private activePing?; - /** Round trip time */ - private rtt; - /** True if client, false if server */ - private readonly client; - private localGoAway?; - private remoteGoAway?; - /** Number of tracked inbound streams */ - private numInboundStreams; - /** Number of tracked outbound streams */ - private numOutboundStreams; - private readonly onIncomingStream?; - private readonly onStreamEnd?; - constructor(init: YamuxMuxerInit); - get streams(): YamuxStream[]; - newStream(name?: string | undefined): YamuxStream; - /** - * Initiate a ping and wait for a response - * - * Note: only a single ping will be initiated at a time. - * If a ping is already in progress, a new ping will not be initiated. - * - * @returns the round-trip-time in milliseconds - */ - ping(): Promise; - /** - * Get the ping round trip time - * - * Note: Will return 0 if no successful ping has yet been completed - * - * @returns the round-trip-time in milliseconds - */ - getRTT(): number; - /** - * Close the muxer - */ - close(options?: CloseOptions): Promise; - abort(err: Error, reason?: GoAwayCode): void; - isClosed(): boolean; - /** - * Called when either the local or remote shuts down the muxer - */ - private _closeMuxer; - /** Create a new stream */ - private _newStream; - /** - * closeStream is used to close a stream once both sides have - * issued a close. - */ - private closeStream; - private keepAliveLoop; - private handleFrame; - private handlePing; - private handlePingResponse; - private handleGoAway; - private handleStreamMessage; - private incomingStream; - private sendFrame; - private sendPing; - private sendGoAway; -} -//# sourceMappingURL=muxer.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/muxer.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/muxer.d.ts.map deleted file mode 100644 index 7170c54fe..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/muxer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"muxer.d.ts","sourceRoot":"","sources":["../../src/muxer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,KAAK,MAAM,EAA+B,MAAM,aAAa,CAAA;AAItE,OAAO,EAAqC,UAAU,EAAE,MAAM,YAAY,CAAA;AAC1E,OAAO,EAAe,WAAW,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AACtG,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAKpD,MAAM,WAAW,cAAe,SAAQ,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC;CACvE;AAED,qBAAa,KAAM,YAAW,kBAAkB;IAC9C,QAAQ,SAAoB;IAC5B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;gBAEzB,IAAI,GAAE,cAAmB;IAItC,iBAAiB,CAAE,IAAI,CAAC,EAAE,cAAc,GAAG,UAAU;CAMtD;AAED,MAAM,WAAW,YAAa,SAAQ,YAAY;IAChD,MAAM,CAAC,EAAE,UAAU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jB;;OAEG;IACG,KAAK,CAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAkCvD,KAAK,CAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI;IAsB7C,QAAQ,IAAK,OAAO;IAIpB;;OAEG;IACH,OAAO,CAAC,WAAW;IAQnB,0BAA0B;IAC1B,OAAO,CAAC,UAAU;IAuBlB;;;OAGG;IACH,OAAO,CAAC,WAAW;YASL,aAAa;YAqBb,WAAW;IA8BzB,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,YAAY;YAaN,mBAAmB;IAqCjC,OAAO,CAAC,cAAc;IAyCtB,OAAO,CAAC,SAAS;IAajB,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,UAAU;CAUnB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/muxer.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/muxer.js deleted file mode 100644 index ed71ec8f6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/muxer.js +++ /dev/null @@ -1,516 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { setMaxListeners } from '@libp2p/interface/events'; -import { logger } from '@libp2p/logger'; -import { getIterator } from 'get-iterator'; -import { pushable } from 'it-pushable'; -import { defaultConfig, verifyConfig } from './config.js'; -import { ERR_BOTH_CLIENTS, ERR_INVALID_FRAME, ERR_MAX_OUTBOUND_STREAMS_EXCEEDED, ERR_MUXER_LOCAL_CLOSED, ERR_MUXER_REMOTE_CLOSED, ERR_NOT_MATCHING_PING, ERR_STREAM_ALREADY_EXISTS, ERR_UNREQUESTED_PING, PROTOCOL_ERRORS } from './constants.js'; -import { Decoder } from './decode.js'; -import { encodeHeader } from './encode.js'; -import { Flag, FrameType, GoAwayCode } from './frame.js'; -import { StreamState, YamuxStream } from './stream.js'; -const YAMUX_PROTOCOL_ID = '/yamux/1.0.0'; -const CLOSE_TIMEOUT = 500; -export class Yamux { - protocol = YAMUX_PROTOCOL_ID; - _init; - constructor(init = {}) { - this._init = init; - } - createStreamMuxer(init) { - return new YamuxMuxer({ - ...this._init, - ...init - }); - } -} -export class YamuxMuxer { - protocol = YAMUX_PROTOCOL_ID; - source; - sink; - config; - log; - /** Used to close the muxer from either the sink or source */ - closeController; - /** The next stream id to be used when initiating a new stream */ - nextStreamID; - /** Primary stream mapping, streamID => stream */ - _streams; - /** The next ping id to be used when pinging */ - nextPingID; - /** Tracking info for the currently active ping */ - activePing; - /** Round trip time */ - rtt; - /** True if client, false if server */ - client; - localGoAway; - remoteGoAway; - /** Number of tracked inbound streams */ - numInboundStreams; - /** Number of tracked outbound streams */ - numOutboundStreams; - onIncomingStream; - onStreamEnd; - constructor(init) { - this.client = init.direction === 'outbound'; - this.config = { ...defaultConfig, ...init }; - this.log = this.config.log; - verifyConfig(this.config); - this.closeController = new AbortController(); - setMaxListeners(Infinity, this.closeController.signal); - this.onIncomingStream = init.onIncomingStream; - this.onStreamEnd = init.onStreamEnd; - this._streams = new Map(); - this.source = pushable({ - onEnd: () => { - this.log?.trace('muxer source ended'); - this._streams.forEach(stream => { - stream.destroy(); - }); - } - }); - this.sink = async (source) => { - const shutDownListener = () => { - const iterator = getIterator(source); - if (iterator.return != null) { - const res = iterator.return(); - if (isPromise(res)) { - res.catch(err => { - this.log?.('could not cause sink source to return', err); - }); - } - } - }; - let reason, error; - try { - const decoder = new Decoder(source); - try { - this.closeController.signal.addEventListener('abort', shutDownListener); - for await (const frame of decoder.emitFrames()) { - await this.handleFrame(frame.header, frame.readData); - } - } - finally { - this.closeController.signal.removeEventListener('abort', shutDownListener); - } - reason = GoAwayCode.NormalTermination; - } - catch (err) { - // either a protocol or internal error - const errCode = err.code; - if (PROTOCOL_ERRORS.has(errCode)) { - this.log?.error('protocol error in sink', err); - reason = GoAwayCode.ProtocolError; - } - else { - this.log?.error('internal error in sink', err); - reason = GoAwayCode.InternalError; - } - error = err; - } - this.log?.trace('muxer sink ended'); - if (error != null) { - this.abort(error, reason); - } - else { - await this.close({ reason }); - } - }; - this.numInboundStreams = 0; - this.numOutboundStreams = 0; - // client uses odd streamIDs, server uses even streamIDs - this.nextStreamID = this.client ? 1 : 2; - this.nextPingID = 0; - this.rtt = -1; - this.log?.trace('muxer created'); - if (this.config.enableKeepAlive) { - this.keepAliveLoop().catch(e => this.log?.error('keepalive error: %s', e)); - } - // send an initial ping to establish RTT - this.ping().catch(e => this.log?.error('ping error: %s', e)); - } - get streams() { - return Array.from(this._streams.values()); - } - newStream(name) { - if (this.remoteGoAway !== undefined) { - throw new CodeError('muxer closed remotely', ERR_MUXER_REMOTE_CLOSED); - } - if (this.localGoAway !== undefined) { - throw new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED); - } - const id = this.nextStreamID; - this.nextStreamID += 2; - // check against our configured maximum number of outbound streams - if (this.numOutboundStreams >= this.config.maxOutboundStreams) { - throw new CodeError('max outbound streams exceeded', ERR_MAX_OUTBOUND_STREAMS_EXCEEDED); - } - this.log?.trace('new outgoing stream id=%s', id); - const stream = this._newStream(id, name, StreamState.Init, 'outbound'); - this._streams.set(id, stream); - this.numOutboundStreams++; - // send a window update to open the stream on the receiver end - stream.sendWindowUpdate(); - return stream; - } - /** - * Initiate a ping and wait for a response - * - * Note: only a single ping will be initiated at a time. - * If a ping is already in progress, a new ping will not be initiated. - * - * @returns the round-trip-time in milliseconds - */ - async ping() { - if (this.remoteGoAway !== undefined) { - throw new CodeError('muxer closed remotely', ERR_MUXER_REMOTE_CLOSED); - } - if (this.localGoAway !== undefined) { - throw new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED); - } - // An active ping does not yet exist, handle the process here - if (this.activePing === undefined) { - // create active ping - let _resolve = () => { }; - this.activePing = { - id: this.nextPingID++, - // this promise awaits resolution or the close controller aborting - promise: new Promise((resolve, reject) => { - const closed = () => { - reject(new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED)); - }; - this.closeController.signal.addEventListener('abort', closed, { once: true }); - _resolve = () => { - this.closeController.signal.removeEventListener('abort', closed); - resolve(); - }; - }), - resolve: _resolve - }; - // send ping - const start = Date.now(); - this.sendPing(this.activePing.id); - // await pong - try { - await this.activePing.promise; - } - finally { - // clean-up active ping - delete this.activePing; - } - // update rtt - const end = Date.now(); - this.rtt = end - start; - } - else { - // an active ping is already in progress, piggyback off that - await this.activePing.promise; - } - return this.rtt; - } - /** - * Get the ping round trip time - * - * Note: Will return 0 if no successful ping has yet been completed - * - * @returns the round-trip-time in milliseconds - */ - getRTT() { - return this.rtt; - } - /** - * Close the muxer - */ - async close(options = {}) { - if (this.closeController.signal.aborted) { - // already closed - return; - } - const reason = options?.reason ?? GoAwayCode.NormalTermination; - this.log?.trace('muxer close reason=%s', reason); - if (options.signal == null) { - const signal = AbortSignal.timeout(CLOSE_TIMEOUT); - setMaxListeners(Infinity, signal); - options = { - ...options, - signal - }; - } - try { - await Promise.all([...this._streams.values()].map(async (s) => s.close(options))); - // send reason to the other side, allow the other side to close gracefully - this.sendGoAway(reason); - this._closeMuxer(); - } - catch (err) { - this.abort(err); - } - } - abort(err, reason) { - if (this.closeController.signal.aborted) { - // already closed - return; - } - reason = reason ?? GoAwayCode.InternalError; - // If reason was provided, use that, otherwise use the presence of `err` to determine the reason - this.log?.error('muxer abort reason=%s error=%s', reason, err); - // Abort all underlying streams - for (const stream of this._streams.values()) { - stream.abort(err); - } - // send reason to the other side, allow the other side to close gracefully - this.sendGoAway(reason); - this._closeMuxer(); - } - isClosed() { - return this.closeController.signal.aborted; - } - /** - * Called when either the local or remote shuts down the muxer - */ - _closeMuxer() { - // stop the sink and any other processes - this.closeController.abort(); - // stop the source - this.source.end(); - } - /** Create a new stream */ - _newStream(id, name, state, direction) { - if (this._streams.get(id) != null) { - throw new CodeError('Stream already exists', ERR_STREAM_ALREADY_EXISTS, { id }); - } - const stream = new YamuxStream({ - id: id.toString(), - name, - state, - direction, - sendFrame: this.sendFrame.bind(this), - onEnd: () => { - this.closeStream(id); - this.onStreamEnd?.(stream); - }, - log: logger(`libp2p:yamux:${direction}:${id}`), - config: this.config, - getRTT: this.getRTT.bind(this) - }); - return stream; - } - /** - * closeStream is used to close a stream once both sides have - * issued a close. - */ - closeStream(id) { - if (this.client === (id % 2 === 0)) { - this.numInboundStreams--; - } - else { - this.numOutboundStreams--; - } - this._streams.delete(id); - } - async keepAliveLoop() { - const abortPromise = new Promise((_resolve, reject) => { this.closeController.signal.addEventListener('abort', reject, { once: true }); }); - this.log?.trace('muxer keepalive enabled interval=%s', this.config.keepAliveInterval); - while (true) { - let timeoutId; - try { - await Promise.race([ - abortPromise, - new Promise((resolve) => { - timeoutId = setTimeout(resolve, this.config.keepAliveInterval); - }) - ]); - this.ping().catch(e => this.log?.error('ping error: %s', e)); - } - catch (e) { - // closed - clearInterval(timeoutId); - return; - } - } - } - async handleFrame(header, readData) { - const { streamID, type, length } = header; - this.log?.trace('received frame %o', header); - if (streamID === 0) { - switch (type) { - case FrameType.Ping: - { - this.handlePing(header); - return; - } - case FrameType.GoAway: - { - this.handleGoAway(length); - return; - } - default: - // Invalid state - throw new CodeError('Invalid frame type', ERR_INVALID_FRAME, { header }); - } - } - else { - switch (header.type) { - case FrameType.Data: - case FrameType.WindowUpdate: - { - await this.handleStreamMessage(header, readData); - return; - } - default: - // Invalid state - throw new CodeError('Invalid frame type', ERR_INVALID_FRAME, { header }); - } - } - } - handlePing(header) { - // If the ping is initiated by the sender, send a response - if (header.flag === Flag.SYN) { - this.log?.trace('received ping request pingId=%s', header.length); - this.sendPing(header.length, Flag.ACK); - } - else if (header.flag === Flag.ACK) { - this.log?.trace('received ping response pingId=%s', header.length); - this.handlePingResponse(header.length); - } - else { - // Invalid state - throw new CodeError('Invalid frame flag', ERR_INVALID_FRAME, { header }); - } - } - handlePingResponse(pingId) { - if (this.activePing === undefined) { - // this ping was not requested - throw new CodeError('ping not requested', ERR_UNREQUESTED_PING); - } - if (this.activePing.id !== pingId) { - // this ping doesn't match our active ping request - throw new CodeError('ping doesn\'t match our id', ERR_NOT_MATCHING_PING); - } - // valid ping response - this.activePing.resolve(); - } - handleGoAway(reason) { - this.log?.trace('received GoAway reason=%s', GoAwayCode[reason] ?? 'unknown'); - this.remoteGoAway = reason; - // If the other side is friendly, they would have already closed all streams before sending a GoAway - // In case they weren't, reset all streams - for (const stream of this._streams.values()) { - stream.reset(); - } - this._closeMuxer(); - } - async handleStreamMessage(header, readData) { - const { streamID, flag, type } = header; - if ((flag & Flag.SYN) === Flag.SYN) { - this.incomingStream(streamID); - } - const stream = this._streams.get(streamID); - if (stream === undefined) { - if (type === FrameType.Data) { - this.log?.('discarding data for stream id=%s', streamID); - if (readData === undefined) { - throw new Error('unreachable'); - } - await readData(); - } - else { - this.log?.('frame for missing stream id=%s', streamID); - } - return; - } - switch (type) { - case FrameType.WindowUpdate: { - stream.handleWindowUpdate(header); - return; - } - case FrameType.Data: { - if (readData === undefined) { - throw new Error('unreachable'); - } - await stream.handleData(header, readData); - return; - } - default: - throw new Error('unreachable'); - } - } - incomingStream(id) { - if (this.client !== (id % 2 === 0)) { - throw new CodeError('both endpoints are clients', ERR_BOTH_CLIENTS); - } - if (this._streams.has(id)) { - return; - } - this.log?.trace('new incoming stream id=%s', id); - if (this.localGoAway !== undefined) { - // reject (reset) immediately if we are doing a go away - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: id, - length: 0 - }); - return; - } - // check against our configured maximum number of inbound streams - if (this.numInboundStreams >= this.config.maxInboundStreams) { - this.log?.('maxIncomingStreams exceeded, forcing stream reset'); - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: id, - length: 0 - }); - return; - } - // allocate a new stream - const stream = this._newStream(id, undefined, StreamState.SYNReceived, 'inbound'); - this.numInboundStreams++; - // the stream should now be tracked - this._streams.set(id, stream); - this.onIncomingStream?.(stream); - } - sendFrame(header, data) { - this.log?.trace('sending frame %o', header); - if (header.type === FrameType.Data) { - if (data === undefined) { - throw new CodeError('invalid frame', ERR_INVALID_FRAME); - } - this.source.push(encodeHeader(header)); - this.source.push(data); - } - else { - this.source.push(encodeHeader(header)); - } - } - sendPing(pingId, flag = Flag.SYN) { - if (flag === Flag.SYN) { - this.log?.trace('sending ping request pingId=%s', pingId); - } - else { - this.log?.trace('sending ping response pingId=%s', pingId); - } - this.sendFrame({ - type: FrameType.Ping, - flag, - streamID: 0, - length: pingId - }); - } - sendGoAway(reason = GoAwayCode.NormalTermination) { - this.log?.('sending GoAway reason=%s', GoAwayCode[reason]); - this.localGoAway = reason; - this.sendFrame({ - type: FrameType.GoAway, - flag: 0, - streamID: 0, - length: reason - }); - } -} -function isPromise(thing) { - return thing != null && typeof thing.then === 'function'; -} -//# sourceMappingURL=muxer.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/muxer.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/muxer.js.map deleted file mode 100644 index eda0e0394..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/muxer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"muxer.js","sourceRoot":"","sources":["../../src/muxer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAe,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAiB,MAAM,aAAa,CAAA;AACrD,OAAO,EAAe,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACtE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,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libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/stream.d.ts deleted file mode 100644 index bd04f1215..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/stream.d.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { AbstractStream, type AbstractStreamInit } from '@libp2p/utils/abstract-stream'; -import { type FrameHeader } from './frame.js'; -import type { Config } from './config.js'; -import type { AbortOptions } from '@libp2p/interface'; -import type { Uint8ArrayList } from 'uint8arraylist'; -export declare enum StreamState { - Init = 0, - SYNSent = 1, - SYNReceived = 2, - Established = 3, - Finished = 4 -} -export interface YamuxStreamInit extends AbstractStreamInit { - name?: string; - sendFrame: (header: FrameHeader, body?: Uint8ArrayList) => void; - getRTT: () => number; - config: Config; - state: StreamState; -} -/** YamuxStream is used to represent a logical stream within a session */ -export declare class YamuxStream extends AbstractStream { - name?: string; - state: StreamState; - private readonly config; - private readonly _id; - /** The number of available bytes to send */ - private sendWindowCapacity; - /** Callback to notify that the sendWindowCapacity has been updated */ - private sendWindowCapacityUpdate?; - /** The number of bytes available to receive in a full window */ - private recvWindow; - /** The number of available bytes to receive */ - private recvWindowCapacity; - /** - * An 'epoch' is the time it takes to process and read data - * - * Used in conjunction with RTT to determine whether to increase the recvWindow - */ - private epochStart; - private readonly getRTT; - private readonly sendFrame; - constructor(init: YamuxStreamInit); - /** - * Send a message to the remote muxer informing them a new stream is being - * opened. - * - * This is a noop for Yamux because the first window update is sent when - * .newStream is called on the muxer which opens the stream on the remote. - */ - sendNewStream(): Promise; - /** - * Send a data message to the remote muxer - */ - sendData(buf: Uint8ArrayList, options?: AbortOptions): Promise; - /** - * Send a reset message to the remote muxer - */ - sendReset(): Promise; - /** - * Send a message to the remote muxer, informing them no more data messages - * will be sent by this end of the stream - */ - sendCloseWrite(): Promise; - /** - * Send a message to the remote muxer, informing them no more data messages - * will be read by this end of the stream - */ - sendCloseRead(): Promise; - /** - * Wait for the send window to be non-zero - * - * Will throw with ERR_STREAM_ABORT if the stream gets aborted - */ - waitForSendWindowCapacity(options?: AbortOptions): Promise; - /** - * handleWindowUpdate is called when the stream receives a window update frame - */ - handleWindowUpdate(header: FrameHeader): void; - /** - * handleData is called when the stream receives a data frame - */ - handleData(header: FrameHeader, readData: () => Promise): Promise; - /** - * processFlags is used to update the state of the stream based on set flags, if any. - */ - private processFlags; - /** - * getSendFlags determines any flags that are appropriate - * based on the current stream state. - * - * The state is updated as a side-effect. - */ - private getSendFlags; - /** - * potentially sends a window update enabling further writes to take place. - */ - sendWindowUpdate(): void; -} -//# sourceMappingURL=stream.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/stream.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/stream.d.ts.map deleted file mode 100644 index 62a15c3fd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/stream.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/stream.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAGvF,OAAO,EAAQ,KAAK,WAAW,EAA4B,MAAM,YAAY,CAAA;AAC7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,oBAAY,WAAW;IACrB,IAAI,IAAA;IACJ,OAAO,IAAA;IACP,WAAW,IAAA;IACX,WAAW,IAAA;IACX,QAAQ,IAAA;CACT;AAED,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACzD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,CAAC,MAAM,EAAE,WAAW,EAA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M,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAe9F;;OAEG;IACH,OAAO,CAAC,YAAY;IAcpB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAapB;;OAEG;IACH,gBAAgB,IAAK,IAAI;CAkC1B"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/stream.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/stream.js deleted file mode 100644 index 4b8a1f42d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/stream.js +++ /dev/null @@ -1,254 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { AbstractStream } from '@libp2p/utils/abstract-stream'; -import each from 'it-foreach'; -import { ERR_RECV_WINDOW_EXCEEDED, ERR_STREAM_ABORT, INITIAL_STREAM_WINDOW } from './constants.js'; -import { Flag, FrameType, HEADER_LENGTH } from './frame.js'; -export var StreamState; -(function (StreamState) { - StreamState[StreamState["Init"] = 0] = "Init"; - StreamState[StreamState["SYNSent"] = 1] = "SYNSent"; - StreamState[StreamState["SYNReceived"] = 2] = "SYNReceived"; - StreamState[StreamState["Established"] = 3] = "Established"; - StreamState[StreamState["Finished"] = 4] = "Finished"; -})(StreamState || (StreamState = {})); -/** YamuxStream is used to represent a logical stream within a session */ -export class YamuxStream extends AbstractStream { - name; - state; - config; - _id; - /** The number of available bytes to send */ - sendWindowCapacity; - /** Callback to notify that the sendWindowCapacity has been updated */ - sendWindowCapacityUpdate; - /** The number of bytes available to receive in a full window */ - recvWindow; - /** The number of available bytes to receive */ - recvWindowCapacity; - /** - * An 'epoch' is the time it takes to process and read data - * - * Used in conjunction with RTT to determine whether to increase the recvWindow - */ - epochStart; - getRTT; - sendFrame; - constructor(init) { - super({ - ...init, - onEnd: (err) => { - this.state = StreamState.Finished; - init.onEnd?.(err); - } - }); - this.config = init.config; - this._id = parseInt(init.id, 10); - this.name = init.name; - this.state = init.state; - this.sendWindowCapacity = INITIAL_STREAM_WINDOW; - this.recvWindow = this.config.initialStreamWindowSize; - this.recvWindowCapacity = this.recvWindow; - this.epochStart = Date.now(); - this.getRTT = init.getRTT; - this.sendFrame = init.sendFrame; - this.source = each(this.source, () => { - this.sendWindowUpdate(); - }); - } - /** - * Send a message to the remote muxer informing them a new stream is being - * opened. - * - * This is a noop for Yamux because the first window update is sent when - * .newStream is called on the muxer which opens the stream on the remote. - */ - async sendNewStream() { - } - /** - * Send a data message to the remote muxer - */ - async sendData(buf, options = {}) { - buf = buf.sublist(); - // send in chunks, waiting for window updates - while (buf.byteLength !== 0) { - // wait for the send window to refill - if (this.sendWindowCapacity === 0) { - await this.waitForSendWindowCapacity(options); - } - // check we didn't close while waiting for send window capacity - if (this.status !== 'open') { - return; - } - // send as much as we can - const toSend = Math.min(this.sendWindowCapacity, this.config.maxMessageSize - HEADER_LENGTH, buf.length); - const flags = this.getSendFlags(); - this.sendFrame({ - type: FrameType.Data, - flag: flags, - streamID: this._id, - length: toSend - }, buf.sublist(0, toSend)); - this.sendWindowCapacity -= toSend; - buf.consume(toSend); - } - } - /** - * Send a reset message to the remote muxer - */ - async sendReset() { - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: this._id, - length: 0 - }); - } - /** - * Send a message to the remote muxer, informing them no more data messages - * will be sent by this end of the stream - */ - async sendCloseWrite() { - const flags = this.getSendFlags() | Flag.FIN; - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: flags, - streamID: this._id, - length: 0 - }); - } - /** - * Send a message to the remote muxer, informing them no more data messages - * will be read by this end of the stream - */ - async sendCloseRead() { - } - /** - * Wait for the send window to be non-zero - * - * Will throw with ERR_STREAM_ABORT if the stream gets aborted - */ - async waitForSendWindowCapacity(options = {}) { - if (this.sendWindowCapacity > 0) { - return; - } - let resolve; - let reject; - const abort = () => { - if (this.status === 'open') { - reject(new CodeError('stream aborted', ERR_STREAM_ABORT)); - } - else { - // the stream was closed already, ignore the failure to send - resolve(); - } - }; - options.signal?.addEventListener('abort', abort); - try { - await new Promise((_resolve, _reject) => { - this.sendWindowCapacityUpdate = () => { - _resolve(); - }; - reject = _reject; - resolve = _resolve; - }); - } - finally { - options.signal?.removeEventListener('abort', abort); - } - } - /** - * handleWindowUpdate is called when the stream receives a window update frame - */ - handleWindowUpdate(header) { - this.log?.trace('stream received window update id=%s', this._id); - this.processFlags(header.flag); - // increase send window - const available = this.sendWindowCapacity; - this.sendWindowCapacity += header.length; - // if the update increments a 0 availability, notify the stream that sending can resume - if (available === 0 && header.length > 0) { - this.sendWindowCapacityUpdate?.(); - } - } - /** - * handleData is called when the stream receives a data frame - */ - async handleData(header, readData) { - this.log?.trace('stream received data id=%s', this._id); - this.processFlags(header.flag); - // check that our recv window is not exceeded - if (this.recvWindowCapacity < header.length) { - throw new CodeError('receive window exceeded', ERR_RECV_WINDOW_EXCEEDED, { available: this.recvWindowCapacity, recv: header.length }); - } - const data = await readData(); - this.recvWindowCapacity -= header.length; - this.sourcePush(data); - } - /** - * processFlags is used to update the state of the stream based on set flags, if any. - */ - processFlags(flags) { - if ((flags & Flag.ACK) === Flag.ACK) { - if (this.state === StreamState.SYNSent) { - this.state = StreamState.Established; - } - } - if ((flags & Flag.FIN) === Flag.FIN) { - this.remoteCloseWrite(); - } - if ((flags & Flag.RST) === Flag.RST) { - this.reset(); - } - } - /** - * getSendFlags determines any flags that are appropriate - * based on the current stream state. - * - * The state is updated as a side-effect. - */ - getSendFlags() { - switch (this.state) { - case StreamState.Init: - this.state = StreamState.SYNSent; - return Flag.SYN; - case StreamState.SYNReceived: - this.state = StreamState.Established; - return Flag.ACK; - default: - return 0; - } - } - /** - * potentially sends a window update enabling further writes to take place. - */ - sendWindowUpdate() { - // determine the flags if any - const flags = this.getSendFlags(); - // If the stream has already been established - // and we've processed data within the time it takes for 4 round trips - // then we (up to) double the recvWindow - const now = Date.now(); - const rtt = this.getRTT(); - if (flags === 0 && rtt > -1 && now - this.epochStart < rtt * 4) { - // we've already validated that maxStreamWindowSize can't be more than MAX_UINT32 - this.recvWindow = Math.min(this.recvWindow * 2, this.config.maxStreamWindowSize); - } - if (this.recvWindowCapacity >= this.recvWindow && flags === 0) { - // a window update isn't needed - return; - } - // update the receive window - const delta = this.recvWindow - this.recvWindowCapacity; - this.recvWindowCapacity = this.recvWindow; - // update the epoch start - this.epochStart = now; - // send window update - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: flags, - streamID: this._id, - length: delta - }); - } -} -//# sourceMappingURL=stream.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/stream.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/stream.js.map deleted file mode 100644 index 855e6e8fa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/src/stream.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,cAAc,EAA2B,MAAM,+BAA+B,CAAA;AACvF,OAAO,IAAI,MAAM,YAAY,CAAA;AAC7B,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAClG,OAAO,EAAE,IAAI,EAAoB,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAK7E,MAAM,CAAN,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,6CAAI,CAAA;IACJ,mDAAO,CAAA;IACP,2DAAW,CAAA;IACX,2DAAW,CAAA;IACX,qDAAQ,CAAA;AACV,CAAC,EANW,WAAW,KAAX,WAAW,QAMtB;AAUD,yEAAyE;AACzE,MAAM,OAAO,WAAY,SAAQ,cAA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;SACjF;QAED,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,UAAU,IAAI,KAAK,KAAK,CAAC,EAAE;YAC7D,+BAA+B;YAC/B,OAAM;SACP;QAED,4BAA4B;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAA;QACvD,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,UAAU,CAAA;QAEzC,yBAAyB;QACzB,IAAI,CAAC,UAAU,GAAG,GAAG,CAAA;QAErB,qBAAqB;QACrB,IAAI,CAAC,SAAS,CAAC;YACb,IAAI,EAAE,SAAS,CAAC,YAAY;YAC5B,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI,CAAC,GAAG;YAClB,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/codec.bench.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/codec.bench.d.ts deleted file mode 100644 index b4e5636f1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/codec.bench.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=codec.bench.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/codec.bench.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/codec.bench.d.ts.map deleted file mode 100644 index 73758eb99..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/codec.bench.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.bench.d.ts","sourceRoot":"","sources":["../../../test/bench/codec.bench.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/codec.bench.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/codec.bench.js deleted file mode 100644 index 84f5ae83d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/codec.bench.js +++ /dev/null @@ -1,46 +0,0 @@ -import { itBench } from '@dapplion/benchmark'; -import { decodeHeader } from '../../src/decode.js'; -import { encodeHeader } from '../../src/encode.js'; -import { Flag, FrameType } from '../../src/frame.js'; -import { decodeHeaderNaive, encodeHeaderNaive } from '../codec.util.js'; -describe('codec benchmark', () => { - for (const { encode, name } of [ - { encode: encodeHeader, name: 'encodeFrameHeader' }, - { encode: encodeHeaderNaive, name: 'encodeFrameHeaderNaive' } - ]) { - itBench({ - id: `frame header - ${name}`, - timeoutBench: 100000000, - beforeEach: () => { - return { - type: FrameType.WindowUpdate, - flag: Flag.ACK, - streamID: 0xffffffff, - length: 0xffffffff - }; - }, - fn: (header) => { - encode(header); - } - }); - } - for (const { decode, name } of [ - { decode: decodeHeader, name: 'decodeHeader' }, - { decode: decodeHeaderNaive, name: 'decodeHeaderNaive' } - ]) { - itBench({ - id: `frame header ${name}`, - beforeEach: () => { - const header = new Uint8Array(12); - for (let i = 1; i < 12; i++) { - header[i] = 255; - } - return header; - }, - fn: (header) => { - decode(header); - } - }); - } -}); -//# sourceMappingURL=codec.bench.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/codec.bench.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/codec.bench.js.map deleted file mode 100644 index 7721658d7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/codec.bench.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.bench.js","sourceRoot":"","sources":["../../../test/bench/codec.bench.ts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G,IAAI,UAAU,CAAC,EAAE,CAAC,CAAA;gBACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;oBAC3B,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;iBAChB;gBACD,OAAO,MAAM,CAAA;YACf,CAAC;YACD,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE;gBACb,MAAM,CAAC,MAAM,CAAC,CAAA;YAChB,CAAC;SACF,CAAC,CAAA;KACH;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/comparison.bench.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/comparison.bench.d.ts deleted file mode 100644 index cb9667d54..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/comparison.bench.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=comparison.bench.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/comparison.bench.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/comparison.bench.d.ts.map deleted file mode 100644 index c29eccddc..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/comparison.bench.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"comparison.bench.d.ts","sourceRoot":"","sources":["../../../test/bench/comparison.bench.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/comparison.bench.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/comparison.bench.js deleted file mode 100644 index 19512e4b7..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/comparison.bench.js +++ /dev/null @@ -1,36 +0,0 @@ -import { itBench } from '@dapplion/benchmark'; -import drain from 'it-drain'; -import { pipe } from 'it-pipe'; -import { testClientServer as testMplexClientServer } from '../mplex.util.js'; -import { testClientServer as testYamuxClientServer } from '../util.js'; -describe('comparison benchmark', () => { - for (const { impl, name } of [ - { impl: testYamuxClientServer, name: 'yamux' }, - { impl: testMplexClientServer, name: 'mplex' } - ]) { - for (const { numMessages, msgSize } of [ - { numMessages: 1, msgSize: 2 ** 6 }, - { numMessages: 1, msgSize: 2 ** 10 }, - { numMessages: 1, msgSize: 2 ** 16 }, - { numMessages: 1, msgSize: 2 ** 20 }, - { numMessages: 1000, msgSize: 2 ** 6 }, - { numMessages: 1000, msgSize: 2 ** 10 }, - { numMessages: 1000, msgSize: 2 ** 16 }, - { numMessages: 1000, msgSize: 2 ** 20 } - ]) { - itBench({ - id: `${name} send and receive ${numMessages} ${msgSize / 1024}KB chunks`, - beforeEach: () => impl({ - onIncomingStream: (stream) => { - void pipe(stream, drain).then(async () => { await stream.close(); }); - } - }), - fn: async ({ client, server }) => { - const stream = await client.newStream(); - await pipe(Array.from({ length: numMessages }, () => new Uint8Array(msgSize)), stream, drain); - } - }); - } - } -}); -//# sourceMappingURL=comparison.bench.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/comparison.bench.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/comparison.bench.js.map deleted file mode 100644 index 1c0ac643f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/bench/comparison.bench.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"comparison.bench.js","sourceRoot":"","sources":["../../../test/bench/comparison.bench.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;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CAAC,IAAI,CAAC;oBACrB,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE;wBAC3B,KAAK,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA,CAAC,CAAC,CAAC,CAAA;oBACrE,CAAC;iBACF,CAAC;gBACF,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE;oBAC/B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,EAAE,CAAA;oBACvC,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;gBAC/F,CAAC;aACF,CAAC,CAAA;SACH;KACF;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.spec.d.ts deleted file mode 100644 index 633c75388..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=codec.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.spec.d.ts.map deleted file mode 100644 index 964547815..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.spec.d.ts","sourceRoot":"","sources":["../../test/codec.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.spec.js deleted file mode 100644 index 4d61ce230..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.spec.js +++ /dev/null @@ -1,28 +0,0 @@ -import { expect } from 'aegir/chai'; -import { decodeHeader } from '../src/decode.js'; -import { encodeHeader } from '../src/encode.js'; -import { Flag, FrameType, GoAwayCode, stringifyHeader } from '../src/frame.js'; -import { decodeHeaderNaive, encodeHeaderNaive } from './codec.util.js'; -const frames = [ - { header: { type: FrameType.Ping, flag: Flag.SYN, streamID: 0, length: 1 } }, - { header: { type: FrameType.WindowUpdate, flag: Flag.SYN, streamID: 1, length: 1 } }, - { header: { type: FrameType.GoAway, flag: 0, streamID: 0, length: GoAwayCode.NormalTermination } }, - { header: { type: FrameType.Ping, flag: Flag.ACK, streamID: 0, length: 100 } }, - { header: { type: FrameType.WindowUpdate, flag: 0, streamID: 99, length: 1000 } }, - { header: { type: FrameType.WindowUpdate, flag: 0, streamID: 0xffffffff, length: 0xffffffff } }, - { header: { type: FrameType.GoAway, flag: 0, streamID: 0, length: GoAwayCode.ProtocolError } } -]; -describe('codec', () => { - for (const { header } of frames) { - it(`should round trip encode/decode header ${stringifyHeader(header)}`, () => { - expect(decodeHeader(encodeHeader(header))).to.deep.equal(header); - }); - } - for (const { header } of frames) { - it(`should match naive implementations of encode/decode for header ${stringifyHeader(header)}`, () => { - expect(encodeHeader(header)).to.deep.equal(encodeHeaderNaive(header)); - expect(decodeHeader(encodeHeader(header))).to.deep.equal(decodeHeaderNaive(encodeHeaderNaive(header))); - }); - } -}); -//# sourceMappingURL=codec.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.spec.js.map deleted file mode 100644 index 178430d09..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.spec.js","sourceRoot":"","sources":["../../test/codec.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAoB,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAChG,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAEtE,MAAM,MAAM,GAAsD;IAChE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE;IAC5E,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE;IACpF,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,iBAAiB,EAAE,EAAE;IAClG,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;IAC9E,EAA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ACH;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.util.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.util.d.ts deleted file mode 100644 index 8b9852f73..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.util.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { type FrameHeader } from '../src/frame.js'; -export declare function decodeHeaderNaive(data: Uint8Array): FrameHeader; -export declare function encodeHeaderNaive(header: FrameHeader): Uint8Array; -//# sourceMappingURL=codec.util.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.util.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.util.d.ts.map deleted file mode 100644 index 16bcea9aa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.util.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.util.d.ts","sourceRoot":"","sources":["../../test/codec.util.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAgC,MAAM,iBAAiB,CAAA;AAIhF,wBAAgB,iBAAiB,CAAE,IAAI,EAAE,UAAU,GAAG,WAAW,CAYhE;AAED,wBAAgB,iBAAiB,CAAE,MAAM,EAAE,WAAW,GAAG,UAAU,CAclE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.util.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.util.js deleted file mode 100644 index 76b3cf281..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.util.js +++ /dev/null @@ -1,28 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors'; -import { ERR_DECODE_INVALID_VERSION } from '../src/constants.js'; -import { HEADER_LENGTH, YAMUX_VERSION } from '../src/frame.js'; -// Slower encode / decode functions that use dataview -export function decodeHeaderNaive(data) { - const view = new DataView(data.buffer, data.byteOffset, data.byteLength); - if (view.getUint8(0) !== YAMUX_VERSION) { - throw new CodeError('Invalid frame version', ERR_DECODE_INVALID_VERSION); - } - return { - type: view.getUint8(1), - flag: view.getUint16(2, false), - streamID: view.getUint32(4, false), - length: view.getUint32(8, false) - }; -} -export function encodeHeaderNaive(header) { - const frame = new Uint8Array(HEADER_LENGTH); - const frameView = new DataView(frame.buffer, frame.byteOffset, frame.byteLength); - // always assume version 0 - // frameView.setUint8(0, header.version) - frameView.setUint8(1, header.type); - frameView.setUint16(2, header.flag, false); - frameView.setUint32(4, header.streamID, false); - frameView.setUint32(8, header.length, false); - return frame; -} -//# sourceMappingURL=codec.util.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.util.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.util.js.map deleted file mode 100644 index a90c06419..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/codec.util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"codec.util.js","sourceRoot":"","sources":["../../test/codec.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAoB,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEhF,qDAAqD;AAErD,MAAM,UAAU,iBAAiB,CAAE,IAAgB;IACjD,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;IAExE,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,aAAa,EAAE;QACtC,MAAM,IAAI,SAAS,CAAC,uBAAuB,EAAE,0BAA0B,CAAC,CAAA;KACzE;IACD,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QACtB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC;QAC9B,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC;QAClC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC;KACjC,CAAA;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAE,MAAmB;IACpD,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,aAAa,CAAC,CAAA;IAE3C,MAAM,SAAS,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;IAEhF,0BAA0B;IAC1B,wCAAwC;IAExC,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;IAClC,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAC1C,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAC9C,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAE5C,OAAO,KAAK,CAAA;AACd,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/compliance.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/compliance.spec.d.ts deleted file mode 100644 index dac08d9d2..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/compliance.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=compliance.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/compliance.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/compliance.spec.d.ts.map deleted file mode 100644 index dc9e71995..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/compliance.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.d.ts","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/compliance.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/compliance.spec.js deleted file mode 100644 index 0b8763a42..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/compliance.spec.js +++ /dev/null @@ -1,12 +0,0 @@ -/* eslint-env mocha */ -import tests from '@libp2p/interface-compliance-tests/stream-muxer'; -import { TestYamux } from './util.js'; -describe('compliance', () => { - tests({ - async setup() { - return new TestYamux({}); - }, - async teardown() { } - }); -}); -//# sourceMappingURL=compliance.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/compliance.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/compliance.spec.js.map deleted file mode 100644 index 9a46d97f8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/compliance.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compliance.spec.js","sourceRoot":"","sources":["../../test/compliance.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,KAAK,MAAM,iDAAiD,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,KAAK,CAAC;QACJ,KAAK,CAAC,KAAK;YACT,OAAO,IAAI,SAAS,CAAC,EAAE,CAAC,CAAA;QAC1B,CAAC;QACD,KAAK,CAAC,QAAQ,KAAK,CAAC;KACrB,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/decode.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/decode.spec.d.ts deleted file mode 100644 index 07a9f5cbd..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/decode.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const randomRanges: (length: number) => number[][]; -//# sourceMappingURL=decode.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/decode.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/decode.spec.d.ts.map deleted file mode 100644 index 1dc0b444d..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/decode.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode.spec.d.ts","sourceRoot":"","sources":["../../test/decode.spec.ts"],"names":[],"mappings":"AAoDA,eAAO,MAAM,YAAY,WAAY,MAAM,KAAG,MAAM,EAAE,EAUrD,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/decode.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/decode.spec.js deleted file mode 100644 index 0a9f2be6b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/decode.spec.js +++ /dev/null @@ -1,298 +0,0 @@ -/* eslint-disable @typescript-eslint/dot-notation */ -import { expect } from 'aegir/chai'; -import { pushable } from 'it-pushable'; -import { ERR_DECODE_IN_PROGRESS } from '../src/constants.js'; -import { Decoder } from '../src/decode.js'; -import { encodeHeader } from '../src/encode.js'; -import { Flag, FrameType, GoAwayCode } from '../src/frame.js'; -import { timeout } from './util.js'; -const frames = [ - { header: { type: FrameType.Ping, flag: Flag.SYN, streamID: 0, length: 1 } }, - { header: { type: FrameType.WindowUpdate, flag: Flag.SYN, streamID: 1, length: 1 } }, - { header: { type: FrameType.GoAway, flag: 0, streamID: 0, length: GoAwayCode.NormalTermination } }, - { header: { type: FrameType.Ping, flag: Flag.ACK, streamID: 0, length: 100 } }, - { header: { type: FrameType.WindowUpdate, flag: 0, streamID: 99, length: 1000 } }, - { header: { type: FrameType.GoAway, flag: 0, streamID: 0, length: GoAwayCode.ProtocolError } } -]; -const data = (length) => Uint8Array.from(Array.from({ length }), (_, i) => i); -const expectEqualBytes = (actual, expected, reason) => { - expect(actual instanceof Uint8Array ? actual : actual.subarray(), reason).to.deep.equal(expected instanceof Uint8Array ? expected : expected.subarray()); -}; -const expectEqualDataFrame = (actual, expected, reason = '') => { - expect(actual.header, reason + ' header').to.deep.equal(expected.header); - if (actual.data == null && expected.data != null) { - expect.fail('actual has no data but expected does'); - } - if (actual.data != null && expected.data == null) { - expect.fail('actual has data but expected does not'); - } - if (actual.data != null && expected.data != null) { - expectEqualBytes(actual.data, expected.data, reason + ' data?: string'); - } -}; -const expectEqualDataFrames = (actual, expected) => { - if (actual.length !== expected.length) { - expect.fail('actual'); - } - for (let i = 0; i < actual.length; i++) { - expectEqualDataFrame(actual[i], expected[i], String(i)); - } -}; -const dataFrame = (length) => ({ - header: { type: FrameType.Data, flag: 0, streamID: 1, length }, - data: data(length) -}); -export const randomRanges = (length) => { - const indices = []; - let i = 0; - let j = 0; - while (i < length) { - j = i; - i += Math.floor(Math.random() * length); - indices.push([j, i]); - } - return indices; -}; -describe('Decoder internals', () => { - describe('readHeader', () => { - const frame = frames[0]; - const p = pushable(); - const d = new Decoder(p); - afterEach(() => { - d['buffer'].consume(d['buffer'].length); - }); - it('should handle an empty buffer', async () => { - expect(d['buffer'].length, 'a freshly created decoder should have an empty buffer').to.equal(0); - expect(d['readHeader'](), 'an empty buffer should read no header').to.equal(undefined); - }); - it('should handle buffer length == header length', async () => { - d['buffer'].append(encodeHeader(frame.header)); - expect(d['readHeader'](), 'the decoded header should match the input').to.deep.equal(frame.header); - expect(d['buffer'].length, 'the buffer should be fully drained').to.equal(0); - }); - it('should handle buffer length < header length', async () => { - const upTo = 2; - d['buffer'].append(encodeHeader(frame.header).slice(0, upTo)); - expect(d['readHeader'](), 'an buffer that has insufficient bytes should read no header').to.equal(undefined); - expect(d['buffer'].length, 'a buffer that has insufficient bytes should not be consumed').to.equal(upTo); - d['buffer'].append(encodeHeader(frame.header).slice(upTo)); - expect(d['readHeader'](), 'the decoded header should match the input').to.deep.equal(frame.header); - expect(d['buffer'].length, 'the buffer should be fully drained').to.equal(0); - }); - it('should handle buffer length > header length', async () => { - const more = 10; - d['buffer'].append(encodeHeader(frame.header)); - d['buffer'].append(new Uint8Array(more)); - expect(d['readHeader'](), 'the decoded header should match the input').to.deep.equal(frame.header); - expect(d['buffer'].length, 'the buffer should be partially drained').to.equal(more); - }); - }); - describe('readBytes', () => { - const p = pushable(); - const d = new Decoder(p); - afterEach(() => { - d['buffer'].consume(d['buffer'].length); - }); - it('should handle buffer length == requested length', async () => { - const requested = 10; - d['buffer'].append(data(requested)); - let actual; - try { - actual = await Promise.race([timeout(1), d['readBytes'](requested)]); - } - catch (e) { - expect.fail('readBytes timed out'); - } - expectEqualBytes(actual, data(requested), 'read bytes should equal input'); - expect(d['buffer'].length, 'buffer should be drained').to.deep.equal(0); - }); - it('should handle buffer length > requested length', async () => { - const requested = 10; - d['buffer'].append(data(requested * 2)); - let actual; - try { - actual = await Promise.race([timeout(1), d['readBytes'](requested)]); - } - catch (e) { - expect.fail('readBytes timed out'); - } - expectEqualBytes(actual, data(requested), 'read bytes should equal input'); - expect(d['buffer'].length, 'buffer should be partially drained').to.deep.equal(requested); - }); - it('should handle buffer length < requested length, data available', async () => { - const requested = 10; - p.push(data(requested)); - let actual; - try { - actual = await Promise.race([timeout(10), d['readBytes'](requested)]); - } - catch (e) { - expect.fail('readBytes timed out'); - } - expectEqualBytes(actual, data(requested), 'read bytes should equal input'); - expect(d['buffer'].length, 'buffer should be drained').to.deep.equal(0); - }); - it('should handle buffer length < requested length, data not available', async () => { - const requested = 10; - p.push(data(requested - 1)); - try { - await Promise.race([timeout(10), d['readBytes'](requested)]); - expect.fail('readBytes should not resolve until the source + buffer have enough bytes'); - } - catch (e) { - } - }); - }); -}); -describe('Decoder', () => { - describe('emitFrames', () => { - let p; - let d; - beforeEach(() => { - p = pushable(); - d = new Decoder(p); - }); - it('should emit frames from source chunked by frame', async () => { - const expected = []; - for (const [i, frame] of frames.entries()) { - p.push(encodeHeader(frame.header)); - expected.push(frame); - // sprinkle in more data frames - if (i % 2 === 1) { - const df = dataFrame(i * 100); - p.push(encodeHeader(df.header)); - p.push(df.data); - expected.push(df); - } - } - p.end(); - const actual = []; - for await (const frame of d.emitFrames()) { - if (frame.readData === undefined) { - actual.push(frame); - } - else { - actual.push({ header: frame.header, data: await frame.readData() }); - } - } - expectEqualDataFrames(actual, expected); - }); - it('should emit frames from source chunked by partial frame', async () => { - const chunkSize = 5; - const expected = []; - for (const [i, frame] of frames.entries()) { - const encoded = encodeHeader(frame.header); - for (let i = 0; i < encoded.length; i += chunkSize) { - p.push(encoded.slice(i, i + chunkSize)); - } - expected.push(frame); - // sprinkle in more data frames - if (i % 2 === 1) { - const df = dataFrame(i * 100); - const encoded = Uint8Array.from([...encodeHeader(df.header), ...df.data]); - for (let i = 0; i < encoded.length; i += chunkSize) { - p.push(encoded.slice(i, i + chunkSize)); - } - expected.push(df); - } - } - p.end(); - const actual = []; - for await (const frame of d.emitFrames()) { - if (frame.readData === undefined) { - actual.push(frame); - } - else { - actual.push({ header: frame.header, data: await frame.readData() }); - } - } - expect(p.readableLength).to.equal(0); - expectEqualDataFrames(actual, expected); - }); - it('should emit frames from source chunked by multiple frames', async () => { - const expected = []; - for (let i = 0; i < frames.length; i++) { - const encoded1 = encodeHeader(frames[i].header); - expected.push(frames[i]); - i++; - const encoded2 = encodeHeader(frames[i].header); - expected.push(frames[i]); - // sprinkle in more data frames - const df = dataFrame(i * 100); - const encoded3 = Uint8Array.from([...encodeHeader(df.header), ...df.data]); - expected.push(df); - const encodedChunk = new Uint8Array(encoded1.length + encoded2.length + encoded3.length); - encodedChunk.set(encoded1, 0); - encodedChunk.set(encoded2, encoded1.length); - encodedChunk.set(encoded3, encoded1.length + encoded2.length); - p.push(encodedChunk); - } - p.end(); - const actual = []; - for await (const frame of d.emitFrames()) { - if (frame.readData === undefined) { - actual.push(frame); - } - else { - actual.push({ header: frame.header, data: await frame.readData() }); - } - } - expectEqualDataFrames(actual, expected); - }); - it('should emit frames from source chunked chaoticly', async () => { - const expected = []; - const encodedFrames = []; - for (const [i, frame] of frames.entries()) { - encodedFrames.push(encodeHeader(frame.header)); - expected.push(frame); - // sprinkle in more data frames - if (i % 2 === 1) { - const df = dataFrame(i * 100); - encodedFrames.push(encodeHeader(df.header)); - encodedFrames.push(df.data); - expected.push(df); - } - } - // create a single byte array of all frames to send - // so that we can chunk them chaoticly - const encoded = new Uint8Array(encodedFrames.reduce((a, b) => a + b.length, 0)); - let i = 0; - for (const e of encodedFrames) { - encoded.set(e, i); - i += e.length; - } - for (const [i, j] of randomRanges(encoded.length)) { - p.push(encoded.slice(i, j)); - } - p.end(); - const actual = []; - for await (const frame of d.emitFrames()) { - if (frame.readData === undefined) { - actual.push(frame); - } - else { - actual.push({ header: frame.header, data: await frame.readData() }); - } - } - expectEqualDataFrames(actual, expected); - }); - it('should error decoding frame while another decode is in progress', async () => { - const df1 = dataFrame(100); - p.push(encodeHeader(df1.header)); - p.push(df1.data); - const df2 = dataFrame(100); - p.push(encodeHeader(df2.header)); - p.push(df2.data); - try { - for await (const frame of d.emitFrames()) { - void frame; - } - expect.fail('decoding another frame before the first is finished should error'); - } - catch (e) { - expect(e.code).to.equal(ERR_DECODE_IN_PROGRESS); - } - }); - }); -}); -//# sourceMappingURL=decode.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/decode.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/decode.spec.js.map deleted file mode 100644 index 28dc7fcbf..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/decode.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode.spec.js","sourceRoot":"","sources":["../../test/decode.spec.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAiB,QAAQ,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAoB,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC/E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGnC,MAAM,MAAM,GAAsD;IAChE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE;IAC5E,EAAE,MAAM,EAAE,EAAE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1.0-uint8arraylists-yield-chunks/yamux/dist/test/mplex.util.d.ts deleted file mode 100644 index fb351e2b8..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/mplex.util.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { StreamMuxer, StreamMuxerInit } from '@libp2p/interface/stream-muxer'; -import type { Source, Transform } from 'it-stream-types'; -export declare function testYamuxMuxer(name: string, client: boolean, conf?: StreamMuxerInit): StreamMuxer; -/** - * Create a transform that can be paused and unpaused - */ -export declare function pauseableTransform(): { - transform: Transform, AsyncGenerator>; - pause: () => void; - unpause: () => void; -}; -export declare function testClientServer(conf?: StreamMuxerInit): { - client: StreamMuxer & { - pauseRead: () => void; - unpauseRead: () => void; - pauseWrite: () => void; - unpauseWrite: () => void; - }; - server: StreamMuxer & { - pauseRead: () => void; - unpauseRead: () => void; - pauseWrite: () => void; - unpauseWrite: () => void; - }; -}; -export declare function timeout(ms: number): Promise; -export declare function sleep(ms: number): Promise; -//# sourceMappingURL=mplex.util.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/mplex.util.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/mplex.util.d.ts.map deleted file mode 100644 index 608ff7d4b..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/mplex.util.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mplex.util.d.ts","sourceRoot":"","sources":["../../test/mplex.util.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAClF,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAMxD,wBAAgB,cAAc,CAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,GAAE,eAAoB,GAAG,WAAW,CAKtG;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAE,CAAC,KAAM;IAAE,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAsBxI;AAED,wBAAgB,gBAAgB,CAAE,IAAI,GAAE,eAAoB,GAAG;IAC7D,MAAM,EAAE,WAAW,GAAG;QACpB,SAAS,EAAE,MAAM,IAAI,CAAA;QACrB,WAAW,EAAE,MAAM,IAAI,CAAA;QACvB,UAAU,EAAE,MAAM,IAAI,CAAA;QACtB,YAAY,EAAE,MAAM,IAAI,CAAA;KACzB,CAAA;IACD,MAAM,EAAE,WAAW,GAAG;QACpB,SAAS,EAAE,MAAM,IAAI,CAAA;QACrB,WAAW,EAAE,MAAM,IAAI,CAAA;QACvB,UAAU,EAAE,MAAM,IAAI,CAAA;QACtB,YAAY,EAAE,MAAM,IAAI,CAAA;KACzB,CAAA;CACF,CA0BA;AAED,wBAAsB,OAAO,CAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE3D;AAED,wBAAsB,KAAK,CAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEzD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/mplex.util.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/mplex.util.js deleted file mode 100644 index e4116a596..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/mplex.util.js +++ /dev/null @@ -1,72 +0,0 @@ -import { defaultLogger } from '@libp2p/logger'; -import { mplex } from '@libp2p/mplex'; -import { duplexPair } from 'it-pair/duplex'; -import { pipe } from 'it-pipe'; -import {} from 'uint8arraylist'; -const factory = mplex()({ - logger: defaultLogger() -}); -export function testYamuxMuxer(name, client, conf = {}) { - return factory.createStreamMuxer({ - ...conf, - direction: client ? 'outbound' : 'inbound' - }); -} -/** - * Create a transform that can be paused and unpaused - */ -export function pauseableTransform() { - let resolvePausePromise; - let pausePromise; - const unpause = () => { - resolvePausePromise?.(null); - }; - const pause = () => { - pausePromise = new Promise(resolve => { - resolvePausePromise = resolve; - }); - }; - const transform = async function* (source) { - for await (const d of source) { - if (pausePromise !== undefined) { - await pausePromise; - pausePromise = undefined; - resolvePausePromise = undefined; - } - yield d; - } - }; - return { transform, pause, unpause }; -} -export function testClientServer(conf = {}) { - const pair = duplexPair(); - const client = testYamuxMuxer('libp2p:mplex:client', true, conf); - const server = testYamuxMuxer('libp2p:mplex:server', false, conf); - const clientReadTransform = pauseableTransform(); - const clientWriteTransform = pauseableTransform(); - const serverReadTransform = pauseableTransform(); - const serverWriteTransform = pauseableTransform(); - void pipe(pair[0], clientReadTransform.transform, client, clientWriteTransform.transform, pair[0]); - void pipe(pair[1], serverReadTransform.transform, server, serverWriteTransform.transform, pair[1]); - return { - client: Object.assign(client, { - pauseRead: clientReadTransform.pause, - unpauseRead: clientReadTransform.unpause, - pauseWrite: clientWriteTransform.pause, - unpauseWrite: clientWriteTransform.unpause - }), - server: Object.assign(server, { - pauseRead: serverReadTransform.pause, - unpauseRead: serverReadTransform.unpause, - pauseWrite: serverWriteTransform.pause, - unpauseWrite: serverWriteTransform.unpause - }) - }; -} -export async function timeout(ms) { - return new Promise((_resolve, reject) => setTimeout(() => { reject(new Error(`timeout after ${ms}ms`)); }, ms)); -} -export async function sleep(ms) { - return new Promise(resolve => setTimeout(() => { resolve(ms); }, ms)); -} -//# sourceMappingURL=mplex.util.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/mplex.util.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/mplex.util.js.map deleted file mode 100644 index 36f21ff9e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/mplex.util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mplex.util.js","sourceRoot":"","sources":["../../test/mplex.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAuB,MAAM,gBAAgB,CAAA;AAIpD,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACtB,MAAM,EAAE,aAAa,EAAE;CACxB,CAAC,CAAA;AAEF,MAAM,UAAU,cAAc,CAAE,IAAY,EAAE,MAAe,EAAE,OAAwB,EAAE;IACvF,OAAO,OAAO,CAAC,iBAAiB,CAAC;QAC/B,GAAG,IAAI;QACP,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;KAC3C,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,mBAA2D,CAAA;IAC/D,IAAI,YAA0C,CAAA;IAC9C,MAAM,OAAO,GAAG,GAAS,EAAE;QACzB,mBAAmB,EAAE,CAAC,IAAI,CAAC,CAAA;IAC7B,CAAC,CAAA;IACD,MAAM,KAAK,GAAG,GAAS,EAAE;QACvB,YAAY,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YACnC,mBAAmB,GAAG,OAAO,CAAA;QAC/B,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;IACD,MAAM,SAAS,GAA4C,KAAK,SAAU,CAAC,EAAE,MAAM;QACjF,IAAI,KAAK,EAAE,MAAM,CAAC,IAAI,MAAM,EAAE;YAC5B,IAAI,YAAY,KAAK,SAAS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AM,CAAC,MAAM,CAAC,MAAM,EAAE;YAC5B,SAAS,EAAE,mBAAmB,CAAC,KAAK;YACpC,WAAW,EAAE,mBAAmB,CAAC,OAAO;YACxC,UAAU,EAAE,oBAAoB,CAAC,KAAK;YACtC,YAAY,EAAE,oBAAoB,CAAC,OAAO;SAC3C,CAAC;KACH,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAE,EAAU;IACvC,OAAO,IAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,IAAI,KAAK,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAA,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAChH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,KAAK,CAAE,EAAU;IACrC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AACtE,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/muxer.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/muxer.spec.d.ts deleted file mode 100644 index 5855d5d5f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/muxer.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=muxer.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/muxer.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/muxer.spec.d.ts.map deleted file mode 100644 index cb814f4c4..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/muxer.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"muxer.spec.d.ts","sourceRoot":"","sources":["../../test/muxer.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/muxer.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/muxer.spec.js deleted file mode 100644 index 6c38a5d23..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/muxer.spec.js +++ /dev/null @@ -1,118 +0,0 @@ -/* eslint-env mocha */ -import { expect } from 'aegir/chai'; -import { duplexPair } from 'it-pair/duplex'; -import { pipe } from 'it-pipe'; -import {} from 'uint8arraylist'; -import { ERR_MUXER_LOCAL_CLOSED } from '../src/constants.js'; -import { sleep, testClientServer, testYamuxMuxer } from './util.js'; -describe('muxer', () => { - let client; - let server; - afterEach(async () => { - if (client != null) { - await client.close(); - } - if (server != null) { - await server.close(); - } - }); - it('test repeated close', async () => { - const client1 = testYamuxMuxer('libp2p:yamux:1', true); - // inspect logs to ensure its only closed once - await client1.close(); - await client1.close(); - await client1.close(); - }); - it('test client<->client', async () => { - const pair = duplexPair(); - const client1 = testYamuxMuxer('libp2p:yamux:1', true); - const client2 = testYamuxMuxer('libp2p:yamux:2', true); - void pipe(pair[0], client1, pair[0]); - void pipe(pair[1], client2, pair[1]); - client1.newStream(); - client2.newStream(); - await sleep(20); - expect(client1.isClosed()).to.equal(true); - expect(client2.isClosed()).to.equal(true); - }); - it('test server<->server', async () => { - const pair = duplexPair(); - const client1 = testYamuxMuxer('libp2p:yamux:1', false); - const client2 = testYamuxMuxer('libp2p:yamux:2', false); - void pipe(pair[0], client1, pair[0]); - void pipe(pair[1], client2, pair[1]); - client1.newStream(); - client2.newStream(); - await sleep(20); - expect(client1.isClosed()).to.equal(true); - expect(client2.isClosed()).to.equal(true); - }); - it('test ping', async () => { - ({ client, server } = testClientServer()); - server.pauseRead(); - const clientRTT = client.ping(); - await sleep(10); - server.unpauseRead(); - expect(await clientRTT).to.not.equal(0); - server.pauseWrite(); - const serverRTT = server.ping(); - await sleep(10); - server.unpauseWrite(); - expect(await serverRTT).to.not.equal(0); - }); - it('test multiple simultaneous pings', async () => { - ({ client, server } = testClientServer()); - client.pauseWrite(); - const promise = [ - client.ping(), - client.ping(), - client.ping() - ]; - await sleep(10); - client.unpauseWrite(); - const clientRTTs = await Promise.all(promise); - expect(clientRTTs[0]).to.not.equal(0); - expect(clientRTTs[0]).to.equal(clientRTTs[1]); - expect(clientRTTs[1]).to.equal(clientRTTs[2]); - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(client['nextPingID']).to.equal(1); - await client.close(); - }); - it('test go away', async () => { - ({ client, server } = testClientServer()); - await client.close(); - expect(() => { - client.newStream(); - }).to.throw().with.property('code', ERR_MUXER_LOCAL_CLOSED, 'should not be able to open a stream after close'); - }); - it('test keep alive', async () => { - ({ client, server } = testClientServer({ enableKeepAlive: true, keepAliveInterval: 10 })); - await sleep(1000); - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(client['nextPingID']).to.be.gt(2); - await client.close(); - await server.close(); - }); - it('test max inbound streams', async () => { - ({ client, server } = testClientServer({ maxInboundStreams: 1 })); - client.newStream(); - client.newStream(); - await sleep(10); - expect(server.streams.length).to.equal(1); - expect(client.streams.length).to.equal(1); - }); - it('test max outbound streams', async () => { - ({ client, server } = testClientServer({ maxOutboundStreams: 1 })); - client.newStream(); - await sleep(10); - try { - client.newStream(); - expect.fail('stream creation should fail if exceeding maxOutboundStreams'); - } - catch (e) { - expect(server.streams.length).to.equal(1); - expect(client.streams.length).to.equal(1); - } - }); -}); -//# sourceMappingURL=muxer.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/muxer.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/muxer.spec.js.map deleted file mode 100644 index 98acb04d6..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/muxer.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"muxer.spec.js","sourceRoot":"","sources":["../../test/muxer.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAuB,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAqB,MAAM,WAAW,CAAA;AAEtF,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,IAAI,MAAoB,CAAA;IACxB,IAAI,MAAoB,CAAA;IAExB,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;SACrB;QAED,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;SACrB;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;QACnC,MAAM,OAAO,GAAG,cAAc,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAA;QACtD,8CAA8C;QAC9C,MAAM,OAAO,CAAC,KAAK,EAAE,CAAA;QACrB,MAAM,OAAO,CAAC,KAAK,EAAE,CAAA;QACrB,MAAM,OAAO,CAAC,KAAK,EAAE,CAAA;IACvB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,IAAI,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AA;YACzC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;SAC1C;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/stream.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/stream.spec.d.ts deleted file mode 100644 index 2ce82973f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/stream.spec.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=stream.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/stream.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/stream.spec.d.ts.map deleted file mode 100644 index 77bed1442..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/stream.spec.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stream.spec.d.ts","sourceRoot":"","sources":["../../test/stream.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/stream.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/stream.spec.js deleted file mode 100644 index 7ecb7583c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/stream.spec.js +++ /dev/null @@ -1,198 +0,0 @@ -/* eslint-env mocha */ -import { expect } from 'aegir/chai'; -import { pipe } from 'it-pipe'; -import { pushable } from 'it-pushable'; -import { defaultConfig } from '../src/config.js'; -import { ERR_RECV_WINDOW_EXCEEDED } from '../src/constants.js'; -import { GoAwayCode } from '../src/frame.js'; -import { StreamState } from '../src/stream.js'; -import { sleep, testClientServer } from './util.js'; -describe('stream', () => { - let client; - let server; - afterEach(async () => { - if (client != null) { - await client.close(); - } - if (server != null) { - await server.close(); - } - }); - it('test send data - small', async () => { - ({ client, server } = testClientServer({ initialStreamWindowSize: defaultConfig.initialStreamWindowSize })); - const { default: drain } = await import('it-drain'); - const p = pushable(); - const c1 = client.newStream(); - await sleep(10); - const s1 = server.streams[0]; - const sendPipe = pipe(p, c1); - const recvPipe = pipe(s1, drain); - for (let i = 0; i < 10; i++) { - p.push(new Uint8Array(256)); - } - p.end(); - await Promise.all([sendPipe, recvPipe]); - // the window capacities should have refilled via window updates as received data was consumed - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(c1['sendWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(s1['recvWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - }); - it('test send data - large', async () => { - ({ client, server } = testClientServer({ initialStreamWindowSize: defaultConfig.initialStreamWindowSize })); - const { default: drain } = await import('it-drain'); - const p = pushable(); - const c1 = client.newStream(); - await sleep(10); - const s1 = server.streams[0]; - const sendPipe = pipe(p, c1); - const recvPipe = pipe(s1, drain); - // amount of data is greater than initial window size - // and each payload is also greater than the max message size - // this will payload chunking and also waiting for window updates before continuing to send - for (let i = 0; i < 10; i++) { - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - } - p.end(); - await Promise.all([sendPipe, recvPipe]); - // the window capacities should have refilled via window updates as received data was consumed - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(c1['sendWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(s1['recvWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - }); - it('test send data - large with increasing recv window size', async () => { - ({ client, server } = testClientServer({ initialStreamWindowSize: defaultConfig.initialStreamWindowSize })); - const { default: drain } = await import('it-drain'); - const p = pushable(); - const c1 = client.newStream(); - server.pauseWrite(); - void server.ping(); - await sleep(10); - server.unpauseWrite(); - const s1 = server.streams[0]; - const sendPipe = pipe(p, c1); - const recvPipe = pipe(s1, drain); - // amount of data is greater than initial window size - // and each payload is also greater than the max message size - // this will payload chunking and also waiting for window updates before continuing to send - for (let i = 0; i < 10; i++) { - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - } - p.end(); - await Promise.all([sendPipe, recvPipe]); - // the window capacities should have refilled via window updates as received data was consumed - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(c1['sendWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - // eslint-disable-next-line @typescript-eslint/dot-notation - expect(s1['recvWindowCapacity']).to.be.gte(defaultConfig.initialStreamWindowSize); - }); - it('test many streams', async () => { - ({ client, server } = testClientServer()); - for (let i = 0; i < 1000; i++) { - client.newStream(); - } - await sleep(100); - expect(client.streams.length).to.equal(1000); - expect(server.streams.length).to.equal(1000); - }); - it('test many streams - ping pong', async () => { - ({ client, server } = testClientServer({ - // echo on incoming streams - onIncomingStream: (stream) => { void pipe(stream, stream); } - })); - const numStreams = 10; - const p = []; - for (let i = 0; i < numStreams; i++) { - client.newStream(); - p.push(pushable()); - } - await sleep(100); - for (let i = 0; i < numStreams; i++) { - const s = client.streams[i]; - void pipe(p[i], s); - p[i].push(new Uint8Array(16)); - } - await sleep(100); - expect(client.streams.length).to.equal(numStreams); - expect(server.streams.length).to.equal(numStreams); - await client.close(); - }); - it('test stream close', async () => { - ({ client, server } = testClientServer()); - const c1 = client.newStream(); - await c1.close(); - await sleep(5); - expect(c1.state).to.equal(StreamState.Finished); - const s1 = server.streams[0]; - expect(s1).to.not.be.undefined(); - expect(s1.state).to.equal(StreamState.SYNReceived); - }); - it('test stream close read', async () => { - ({ client, server } = testClientServer()); - const c1 = client.newStream(); - await c1.closeRead(); - await sleep(5); - const s1 = server.streams[0]; - expect(s1).to.not.be.undefined(); - expect(s1.readStatus).to.equal('ready'); - expect(s1.writeStatus).to.equal('ready'); - }); - it('test stream close write', async () => { - ({ client, server } = testClientServer()); - const c1 = client.newStream(); - await c1.closeWrite(); - await sleep(5); - expect(c1.readStatus).to.equal('ready'); - expect(c1.writeStatus).to.equal('closed'); - const s1 = server.streams[0]; - expect(s1).to.not.be.undefined(); - expect(s1.readStatus).to.equal('closed'); - expect(s1.writeStatus).to.equal('ready'); - }); - it('test window overflow', async () => { - ({ client, server } = testClientServer({ maxMessageSize: defaultConfig.initialStreamWindowSize, initialStreamWindowSize: defaultConfig.initialStreamWindowSize })); - const { default: drain } = await import('it-drain'); - const p = pushable(); - const c1 = client.newStream(); - await sleep(10); - const s1 = server.streams[0]; - const sendPipe = pipe(p, c1); - const c1SendData = c1.sendData.bind(c1); - c1.sendData = async (data) => { - await c1SendData(data); - // eslint-disable-next-line @typescript-eslint/dot-notation - c1['sendWindowCapacity'] = defaultConfig.initialStreamWindowSize * 10; - }; - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - await sleep(10); - const recvPipe = pipe(s1, drain); - p.end(); - try { - await Promise.all([sendPipe, recvPipe]); - } - catch (e) { - expect(e.code).to.equal(ERR_RECV_WINDOW_EXCEEDED); - } - expect(client).to.have.property('remoteGoAway', GoAwayCode.ProtocolError); - expect(server).to.have.property('localGoAway', GoAwayCode.ProtocolError); - }); - it('test stream sink error', async () => { - ({ client, server } = testClientServer()); - // don't let the server respond - server.pauseRead(); - const p = pushable(); - const c1 = client.newStream(); - const sendPipe = pipe(p, c1); - // send more data than the window size, will trigger a wait - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - p.push(new Uint8Array(defaultConfig.initialStreamWindowSize)); - await sleep(10); - // the client should close gracefully even though it was waiting to send more data - await client.close(); - p.end(); - await sendPipe; - }); -}); -//# sourceMappingURL=stream.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/stream.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/stream.spec.js.map deleted file mode 100644 index 995f83f08..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/stream.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stream.spec.js","sourceRoot":"","sources":["../../test/stream.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAiB,QAAQ,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAqB,MAAM,WAAW,CAAA;AAGtE,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,IAAI,MAAoB,CAAA;IACxB,IAAI,MAAoB,CAAA;IAExB,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;SACrB;QAED,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;SACrB;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACtC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAC,EAAE,uBAAuB,EAAE,aAAa,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAA;QAC3G,MAAM,EAAE,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IAChB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/util.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/util.d.ts deleted file mode 100644 index 0a268c96f..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/util.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Yamux, YamuxMuxer, type YamuxMuxerInit } from '../src/muxer.js'; -import type { Config } from '../src/config.js'; -import type { Source, Transform } from 'it-stream-types'; -export declare const testConf: Partial; -/** - * Yamux must be configured with a client setting `client` to true - * and a server setting `client` to falsey - * - * Since the compliance tests create a dialer and listener, - * manually alternate setting `client` to true and false - */ -export declare class TestYamux extends Yamux { - createStreamMuxer(init?: YamuxMuxerInit): YamuxMuxer; -} -export declare function testYamuxMuxer(name: string, client: boolean, conf?: YamuxMuxerInit): YamuxMuxer; -/** - * Create a transform that can be paused and unpaused - */ -export declare function pauseableTransform(): { - transform: Transform, AsyncGenerator>; - pause: () => void; - unpause: () => void; -}; -export interface YamuxFixture extends YamuxMuxer { - pauseRead: () => void; - unpauseRead: () => void; - pauseWrite: () => void; - unpauseWrite: () => void; -} -export declare function testClientServer(conf?: YamuxMuxerInit): { - client: YamuxFixture; - server: YamuxFixture; -}; -export declare function timeout(ms: number): Promise; -export declare function sleep(ms: number): Promise; -//# sourceMappingURL=util.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/util.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/util.d.ts.map deleted file mode 100644 index bd692d2c1..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/util.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.d.ts","sourceRoot":"","s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"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/util.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/util.js deleted file mode 100644 index 2a3f55f27..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/util.js +++ /dev/null @@ -1,95 +0,0 @@ -import { logger } from '@libp2p/logger'; -import { duplexPair } from 'it-pair/duplex'; -import { pipe } from 'it-pipe'; -import { Yamux, YamuxMuxer } from '../src/muxer.js'; -import { Uint8ArrayList } from 'uint8arraylist'; -const isClient = (() => { - let client = false; - return () => { - const isClient = !client; - client = isClient; - return isClient; - }; -})(); -export const testConf = { - enableKeepAlive: false -}; -/** - * Yamux must be configured with a client setting `client` to true - * and a server setting `client` to falsey - * - * Since the compliance tests create a dialer and listener, - * manually alternate setting `client` to true and false - */ -export class TestYamux extends Yamux { - createStreamMuxer(init) { - const client = isClient(); - return super.createStreamMuxer({ ...testConf, ...init, direction: client ? 'outbound' : 'inbound', log: logger(`libp2p:yamux${client ? 1 : 2}`) }); - } -} -export function testYamuxMuxer(name, client, conf = {}) { - return new YamuxMuxer({ - ...testConf, - ...conf, - direction: client ? 'outbound' : 'inbound', - log: logger(name) - }); -} -/** - * Create a transform that can be paused and unpaused - */ -export function pauseableTransform() { - let resolvePausePromise; - let pausePromise; - const unpause = () => { - resolvePausePromise?.(null); - }; - const pause = () => { - pausePromise = new Promise(resolve => { - resolvePausePromise = resolve; - }); - }; - const transform = async function* (source) { - for await (const d of source) { - if (pausePromise !== undefined) { - await pausePromise; - pausePromise = undefined; - resolvePausePromise = undefined; - } - yield d; - } - }; - return { transform, pause, unpause }; -} -export function testClientServer(conf = {}) { - const pair = duplexPair(); - const client = testYamuxMuxer('libp2p:yamux:client', true, conf); - const server = testYamuxMuxer('libp2p:yamux:server', false, conf); - const clientReadTransform = pauseableTransform(); - const clientWriteTransform = pauseableTransform(); - const serverReadTransform = pauseableTransform(); - const serverWriteTransform = pauseableTransform(); - void pipe(pair[0], clientReadTransform.transform, client, clientWriteTransform.transform, pair[0]); - void pipe(pair[1], serverReadTransform.transform, server, serverWriteTransform.transform, pair[1]); - return { - client: Object.assign(client, { - pauseRead: clientReadTransform.pause, - unpauseRead: clientReadTransform.unpause, - pauseWrite: clientWriteTransform.pause, - unpauseWrite: clientWriteTransform.unpause - }), - server: Object.assign(server, { - pauseRead: serverReadTransform.pause, - unpauseRead: serverReadTransform.unpause, - pauseWrite: serverWriteTransform.pause, - unpauseWrite: serverWriteTransform.unpause - }) - }; -} -export async function timeout(ms) { - return new Promise((_resolve, reject) => setTimeout(() => { reject(new Error(`timeout after ${ms}ms`)); }, ms)); -} -export async function sleep(ms) { - return new Promise(resolve => setTimeout(() => { resolve(ms); }, ms)); -} -//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/util.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/util.js.map deleted file mode 100644 index f75486fb3..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/test/util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../../test/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,UAAU,EAAuB,MAAM,iBAAiB,CAAA;AAGxE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE;IACrB,IAAI,MAAM,GAAG,KAAK,CAAA;IAClB,OAAO,GAAG,EAAE;QACV,MAAM,QAAQ,GAAG,CA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C,WAAW,EAAE,mBAAmB,CAAC,OAAO;YACxC,UAAU,EAAE,oBAAoB,CAAC,KAAK;YACtC,YAAY,EAAE,oBAAoB,CAAC,OAAO;SAC3C,CAAC;QACF,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;YAC5B,SAAS,EAAE,mBAAmB,CAAC,KAAK;YACpC,WAAW,EAAE,mBAAmB,CAAC,OAAO;YACxC,UAAU,EAAE,oBAAoB,CAAC,KAAK;YACtC,YAAY,EAAE,oBAAoB,CAAC,OAAO;SAC3C,CAAC;KACH,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAE,EAAU;IACvC,OAAO,IAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,IAAI,KAAK,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAA,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAChH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,KAAK,CAAE,EAAU;IACrC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AACtE,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/tsconfig.tsbuildinfo deleted file mode 100644 index fd5d9b451..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/@libp2p/interface/dist/src/errors.d.ts","../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface/dist/src/peer-id/index.d.ts","../node_modules/@libp2p/logger/dist/src/index.d.ts","../src/constants.ts","../src/config.ts","../node_modules/uint8arraylist/dist/src/index.d.ts","../src/frame.ts","../node_modules/it-stream-types/dist/src/index.d.ts","../src/decode.ts","../src/encode.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/buffer/index.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@libp2p/interface/dist/src/events.d.ts","../node_modules/get-iterator/dist/src/index.d.ts","../node_modules/it-pushable/dist/src/index.d.ts","../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-info/index.d.ts","../node_modules/@libp2p/interface/dist/src/content-routing/index.d.ts","../node_modules/@libp2p/interface/dist/src/metrics/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-routing/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-store/index.d.ts","../node_modules/@libp2p/interface/dist/src/startable.d.ts","../node_modules/@libp2p/interface/dist/src/stream-handler/index.d.ts","../node_modules/@libp2p/interface/dist/src/topology/index.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/index.d.ts","../node_modules/@libp2p/interface/dist/src/transport/index.d.ts","../node_modules/@libp2p/interface/dist/src/index.d.ts","../node_modules/@libp2p/utils/dist/src/abstract-stream.d.ts","../node_modules/it-foreach/dist/src/index.d.ts","../src/stream.ts","../src/muxer.ts","../src/index.ts","../node_modules/@types/chai/index.d.ts","../node_modules/@types/chai-as-promised/index.d.ts","../node_modules/chai-parentheses/index.d.ts","../node_modules/@types/chai-subset/index.d.ts","../node_modules/chai-bites/index.d.ts","../node_modules/@types/chai-string/index.d.ts","../node_modules/aegir/dist/utils/chai.d.ts","../test/codec.util.ts","../test/codec.spec.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/index.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/stream-muxer/index.d.ts","../node_modules/it-pair/dist/src/duplex.d.ts","../node_modules/it-pipe/dist/src/index.d.ts","../test/util.ts","../test/compliance.spec.ts","../test/decode.spec.ts","../node_modules/@libp2p/mplex/dist/src/message-types.d.ts","../node_modules/@libp2p/mplex/dist/src/stream.d.ts","../node_modules/@libp2p/mplex/dist/src/mplex.d.ts","../node_modules/@libp2p/mplex/dist/src/index.d.ts","../test/mplex.util.ts","../test/muxer.spec.ts","../node_modules/it-drain/dist/src/index.d.ts","../test/stream.spec.ts","../node_modules/@dapplion/benchmark/lib/utils/mochacliexports.d.ts","../node_modules/@dapplion/benchmark/lib/types.d.ts","../node_modules/@dapplion/benchmark/lib/mochaplugin/runbenchfn.d.ts","../node_modules/@dapplion/benchmark/lib/mochaplugin/index.d.ts","../node_modules/@dapplion/benchmark/lib/index.d.ts","../test/bench/codec.bench.ts","../test/bench/comparison.bench.ts","../node_modules/keyv/src/index.d.ts","../node_modules/@types/http-cache-semantics/index.d.ts","../node_modules/@types/responselike/index.d.ts","../node_modules/@types/cacheable-request/index.d.ts","../node_modules/@types/ms/index.d.ts","../node_modules/@types/debug/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/keyv/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/mdast/index.d.ts","../node_modules/@types/minimatch/index.d.ts","../node_modules/@types/minimist/index.d.ts","../node_modules/@types/mocha/index.d.ts","../node_modules/@types/node-fetch/node_modules/form-data/index.d.ts","../node_modules/@types/node-fetch/externals.d.ts","../node_modules/@types/node-fetch/index.d.ts","../node_modules/@types/normalize-package-data/index.d.ts","../node_modules/@types/parse-json/index.d.ts","../node_modules/@types/retry/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts","../node_modules/@types/strip-bom/index.d.ts","../node_modules/@types/strip-json-comments/index.d.ts","../node_modules/@types/tunnel/index.d.ts","../node_modules/@types/ungap__structured-clone/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts","../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","cb4b40f34fe4b1d87c530a0f3c2c1e043e338829fab8cf5cbd92a91c8c1374b8",{"version":"646beeaa0e97b5d4798f01ae89b23f6b865c431891809bb33aa5b789bfc0eb23","signature":"df7d1feb50bcbe0479167c592934b29c9883c99bed4c04847e497571ea25429d"},{"version":"973516e23e7bb3b05ac9e0db11801bc769bcc1ed70779b59299d6f128570a503","signature":"c8031a5db82b240f801a5684ab693e95e1e06dc76958894fe42d35acbd446f28"},"176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d",{"version":"77b3667a04dcec1bbf3d5958cdd117e58ea93543370e019d5d2f313b33475d76","signature":"1633b84fd3346ad6500a88e7a119ac778bb6f6b2746a3b7b8164c5ef2721822f"},"c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc",{"version":"0ad343b8866b3e51c60be77174d88f7e8c9e391816f329388daf36bd42c77c10","signature":"44287337e054ff7aa53fd7ccdafce53525bf3737f1258bc5c6fb7cdb94eefbf8"},{"version":"813aef3c48ba035ef86423017092460ca5cc552336f0519f71417c0e02d57c48","signature":"de47457474d7e0c031a66c92c6809813beced704dcff00b327252dbfbd735246"},"efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","285e512c7a0db217a0599e18c462d565fa35be4a5153dd7b80bee88c83e83ddf","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"7ae9dc7dbb58cd843065639707815df85c044babaa0947116f97bdb824d07204","affectsGlobalScope":true},"7aae1df2053572c2cfc2089a77847aadbb38eedbaa837a846c6a49fb37c6e5bd","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"dea4c00820d4fac5e530d4842aed2fb20d6744d75a674b95502cbd433f88bcb0","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"b7eadc0b0cba14ab854122810f330314132c5cfdb7800fceb82d521997a1f5b0","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"2225100373ca3d63bcc7f206e1177152d2e2161285a0bd83c8374db1503a0d1f","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","4a34b074b11c3597fb2ff890bc8f1484375b3b80793ab01f974534808d5777c7",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","485ae32287d8df9e74f68a9dc96c9211a7cfe8b302717043a988a40d930330d2","fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","1bf687d978bdd6d5aff10b9eb0ff0695179f8594d4446946fd0182d6d25fa433","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1","75e0c62536016dac8cc0d825742ff7cc4c0455ebc86923e47edcc19edac0997c","c66c95ed9fcebfc20ac8a59e7ea8bf41e1a3ead0e81206515102f4ca6c54272f",{"version":"cc4246e61d1268ead1c1b05994fb8a7f2ea4b3d7a5222c9747fd83e24c0d3d4b","signature":"de6afce5d1e6f2f81a5030fee9c7400a56b3c4077c5f9699cd71294c91e525cf"},{"version":"d45c99803572149f908205cdbe67a6d8a7c035ab5437876aeb0cd0863342ffc9","signature":"067ab20bf63d65f9b724398636d5083a71fb7d8cfe80a504ce2d2fe31400eab7"},{"version":"02ba3e55572e45071b1b6380d713eb8744a64e2f93d6239eea167cecb3ff0b2b","signature":"df54eaa5ea53c6bb3a9548bc5d2f6fb22583ea3e8b936a4e8ec5acfd90422ff3"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d",{"version":"2a5f6d929c1ab7dd044e4e1f27c2219138388f6ffbec5f495ce973c9682cbb4d","signature":"e0a5e1d0a21126716c6561a24e50810c24e63a549cb06d96d6cb675512c1b31c"},{"version":"8a54db2a8b7bfa3a68970b795708c982b45f76165538e8938a1fbdd7dbcd19f9","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","89020b28796eb67824a234b2d571d51ae6f9f944efa0201901df1447ff61ea87","b1129d7c114eba7c7b155dc809d6371ef86a0738f7ca93b3efef9b796d6168d9","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6",{"version":"d9dc238dc60f9f6fac4ac03ad8d1ed44774707befe91ed1b8e42f947df4ff69f","signature":"44f9c4f61b45a644c79fe6b15e09220e78c6bf3fbb46552fcae2ca0069c02e47"},{"version":"7ec913df1f630b388fb69f560287ddc7eecc83dd57587b38a20aa83353640e0f","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"68c22a33a565cfb46edaa7632c40ed3e49fdc735898e9b46fdd334ce0747cf15","signature":"d44159b9ee3018b60e80fd577633a4e1ee533c89f1b1042ceba9e41b655baaf1"},"22c980472aeac42a88c7954c9645c5cf0c511142afd048699daf516b25f9ea2d","aabcb267f8a73a9923157af617c47e2d707481760e60967dfa836613e2b7433b","52e581f4f22812920c916ebde59bad7175b5f6cdd4d33cb3f89333621a0a465f","b136dc0a448fd836eaf575f97ed9beeafe1f09752d72b75d5d71749b13815ba5",{"version":"a50419f7eb4aa63a5f3d08de48edfe781eaac9e3b4025e9dc95a2ea1068a3f08","signature":"6fbb5def100ea00a3a0eebe436f333b7d184445d2d1c1ff15ed6d9f531e005ea"},{"version":"427f54210f631b4b29e3362abddb472d04745871579d160f10a0d0b522021fc9","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"687ec53a7422d8cf80477fffa82a2db211f724039267931642befcd4907aec26",{"version":"04bc1356353c28c93ae6bbd171bd79783a74fa9cb0ac0b3dc95f2d110e3a1d55","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"4ef576c5a52f34423f6328a6834c6fc874c6683a0626c0f21d6b2209f460dffd","7b195dbf43d2194d18627fe3e190979b5bd2f0752001193260c89b01c36460e2","7350c835566c20d980134ad870a072daa93754c6b65d602a46f2bc2e2ae12165","ee9b614565fe2e96c3202c092ea4e4bc902f51d1508bf8015d8f2275686ab040","f6f278c43d4e70fe1abb2c826a0b1c1ea7c4f6ff50b272aacdda3b39c51f4d61",{"version":"507c17c9560d122d5a84b1a9c445f1dda6bab818e816490c92cae62cc85e177a","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"6fdcba0554752fe51578f0fadbbfa35ed5d3687ca9d48d533dfd49356879ea49","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"736097ddbb2903bef918bb3b5811ef1c9c5656f2a73bd39b22a91b9cc2525e50","4340936f4e937c452ae783514e7c7bbb7fc06d0c97993ff4865370d0962bb9cf","5009c081fd8ca3fcd6f3adcd071a1c79a933a400532b897822aad0943688a1f1","22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a","4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","882057f051daf834e4d01701066e1bac2d243b0c3eda702b25874402c1e0172d","852bcf5d92d819abdf34ba0759c311b61d5dac7b9963a6c3cc4f23b025dee8f3","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[69,70,72,74,75,[183,185],193,194,[199,201],206,207,209,215,216],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[155,213],[155,211,212],[155,211],[155,210],[155],[155,178,195],[67,71,73,155,168,180],[66,155,170,180],[125,155,162],[67,155,163,168,169,170,171,172,173,174,175,176,177,179],[155,169],[64,66,155],[67,155,168],[67,155,170,180],[71,73,155,169,180],[67,155,169],[155,163,168,169,178,180],[67,155],[155,178,204],[71,155],[71,73,155,169,178,180,202,203,205],[71,155,180,181,202],[68,71,73,155,169,180],[155,168],[155,166,167],[125,128,154,155,162,217,218,219],[155,186],[155,221],[155,227],[128,154,155,162,232,233],[128,143,155,162],[76,155],[112,155],[113,118,146,155],[114,125,126,133,143,154,155],[114,115,125,133,155],[116,155],[117,118,126,134,155],[118,143,151,155],[119,121,125,133,155],[120,155],[121,122,155],[125,155],[123,125,155],[112,125,155],[125,126,127,143,154,155],[125,126,127,140,143,146,155],[110,155,159],[121,125,128,133,143,154,155],[125,126,128,129,133,143,151,154,155],[128,130,143,151,154,155],[76,77,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161],[125,131,155],[132,154,155,159],[121,125,133,143,155],[134,155],[135,155],[112,136,155],[137,153,155,159],[138,155],[139,155],[125,140,141,155],[140,142,155,157],[113,125,143,144,145,146,155],[113,143,145,155],[143,144,155],[146,155],[147,155],[112,143,155],[125,149,150,155],[149,150,155],[118,133,143,151,155],[152,155],[133,153,155],[113,128,139,154,155],[118,155],[143,155,156],[132,155,157],[155,158],[113,118,125,127,136,143,154,155,157,159],[143,155,160],[155,238,277],[155,238,262,277],[155,277],[155,238],[155,238,263,277],[155,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276],[155,263,277],[128,130,155,162],[155,282],[125,143,155,162],[155,186,187,188,189,190,191],[155,186,187],[73,155],[65,66,155],[65,155],[62,63,64,155],[87,91,154,155],[87,143,154,155],[82,155],[84,87,151,154,155],[133,151,155],[155,162],[82,155,162],[84,87,133,154,155],[79,80,83,86,113,125,143,154,155],[79,85,155],[83,87,113,146,154,155,162],[113,155,162],[103,113,155,162],[81,82,155,162],[87,155],[81,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,155],[87,94,95,155],[85,87,95,96,155],[86,155],[79,82,87,155],[87,91,95,96,155],[91,155],[85,87,90,154,155],[79,84,85,87,91,94,155],[113,143,155],[82,87,103,113,155,159,162],[61,68,69,155],[61,69,71,72,73,155],[72,155],[72,155,178,184],[61,68,69,70,71,72,73,74,75,155,163,164,165,169,178,180,183],[61,69,70,71,72,155,180,181,182],[72,74,75,155,193,214],[155,198,199,206,208,214],[72,74,75,155,192,193],[61,69,72,155],[155,196,199],[69,71,72,74,75,155,165,192,199],[68,71,73,155,178,197,198,205],[69,71,155,192,197,198,199],[69,70,71,72,155,165,183,192,198,199,208],[68,70,71,73,155,184,197,198],[68],[71,72,73],[72],[72,178,184],[70,71,72,73,165,178,180,183],[70,71,72,180,181],[73,178],[70,73,184]],"referencedMap":[[214,1],[213,2],[212,3],[211,4],[210,5],[195,5],[196,6],[169,7],[171,8],[61,5],[163,9],[180,10],[172,11],[67,12],[170,13],[173,14],[174,13],[175,5],[176,11],[178,15],[177,16],[179,17],[68,18],[205,19],[202,20],[204,21],[203,22],[181,23],[167,24],[168,25],[166,24],[220,26],[187,27],[191,27],[189,27],[186,5],[222,28],[218,5],[223,5],[224,5],[225,5],[226,9],[228,29],[229,5],[230,5],[231,5],[221,5],[233,5],[234,30],[232,31],[76,32],[77,32],[112,33],[113,34],[114,35],[115,36],[116,37],[117,38],[118,39],[119,40],[120,41],[121,42],[122,42],[124,43],[123,44],[125,45],[126,46],[127,47],[111,48],[161,5],[128,49],[129,50],[130,51],[162,52],[131,53],[132,54],[133,55],[134,56],[135,57],[136,58],[137,59],[138,60],[139,61],[140,62],[141,62],[142,63],[143,64],[145,65],[144,66],[146,67],[147,68],[148,69],[149,70],[150,71],[151,72],[152,73],[153,74],[154,75],[155,76],[156,77],[157,78],[158,79],[159,80],[160,81],[235,5],[236,5],[219,31],[237,5],[262,82],[263,83],[238,84],[241,84],[260,82],[261,82],[251,82],[250,85],[248,82],[243,82],[256,82],[254,82],[258,82],[242,82],[255,82],[259,82],[244,82],[245,82],[257,82],[239,82],[246,82],[247,82],[249,82],[253,82],[264,86],[252,82],[240,82],[277,87],[276,5],[271,86],[273,88],[272,86],[265,86],[266,86],[268,86],[270,86],[274,88],[275,88],[267,88],[269,88],[278,5],[279,5],[280,89],[281,5],[227,5],[282,5],[283,90],[284,91],[192,92],[78,5],[190,27],[188,93],[164,5],[208,5],[182,5],[197,94],[198,94],[165,5],[73,5],[217,43],[62,5],[63,95],[66,96],[64,5],[65,97],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[71,5],[94,98],[101,99],[93,98],[108,100],[85,101],[84,102],[107,103],[102,104],[105,105],[87,106],[86,107],[82,108],[81,109],[104,110],[83,111],[88,112],[89,5],[92,112],[79,5],[110,113],[109,112],[96,114],[97,115],[99,116],[95,117],[98,118],[103,103],[90,119],[91,120],[100,121],[80,122],[106,123],[70,124],[69,5],[74,125],[75,126],[72,5],[185,127],[184,128],[183,129],[215,130],[216,131],[194,132],[193,133],[200,134],[201,135],[206,136],[207,137],[209,138],[199,139]],"exportedModulesMap":[[214,1],[213,2],[212,3],[211,4],[210,5],[195,5],[196,6],[169,7],[171,8],[61,5],[163,9],[180,10],[172,11],[67,12],[170,13],[173,14],[174,13],[175,5],[176,11],[178,15],[177,16],[179,17],[68,18],[205,19],[202,20],[204,21],[203,22],[181,23],[167,24],[168,25],[166,24],[220,26],[187,27],[191,27],[189,27],[186,5],[222,28],[218,5],[223,5],[224,5],[225,5],[226,9],[228,29],[229,5],[230,5],[231,5],[221,5],[233,5],[234,30],[232,31],[76,32],[77,32],[112,33],[113,34],[114,35],[115,36],[116,37],[117,38],[118,39],[119,40],[120,41],[121,42],[122,42],[124,43],[123,44],[125,45],[126,46],[127,47],[111,48],[161,5],[128,49],[129,50],[130,51],[162,52],[131,53],[132,54],[133,55],[134,56],[135,57],[136,58],[137,59],[138,60],[139,61],[140,62],[141,62],[142,63],[143,64],[145,65],[144,66],[146,67],[147,68],[148,69],[149,70],[150,71],[151,72],[152,73],[153,74],[154,75],[155,76],[156,77],[157,78],[158,79],[159,80],[160,81],[235,5],[236,5],[219,31],[237,5],[262,82],[263,83],[238,84],[241,84],[260,82],[261,82],[251,82],[250,85],[248,82],[243,82],[256,82],[254,82],[258,82],[242,82],[255,82],[259,82],[244,82],[245,82],[257,82],[239,82],[246,82],[247,82],[249,82],[253,82],[264,86],[252,82],[240,82],[277,87],[276,5],[271,86],[273,88],[272,86],[265,86],[266,86],[268,86],[270,86],[274,88],[275,88],[267,88],[269,88],[278,5],[279,5],[280,89],[281,5],[227,5],[282,5],[283,90],[284,91],[192,92],[78,5],[190,27],[188,93],[164,5],[208,5],[182,5],[197,94],[198,94],[165,5],[73,5],[217,43],[62,5],[63,95],[66,96],[64,5],[65,97],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[71,5],[94,98],[101,99],[93,98],[108,100],[85,101],[84,102],[107,103],[102,104],[105,105],[87,106],[86,107],[82,108],[81,109],[104,110],[83,111],[88,112],[89,5],[92,112],[79,5],[110,113],[109,112],[96,114],[97,115],[99,116],[95,117],[98,118],[103,103],[90,119],[91,120],[100,121],[80,122],[106,123],[70,140],[74,141],[75,142],[185,143],[184,144],[183,145],[193,142],[206,146],[199,147]],"semanticDiagnosticsPerFile":[214,213,212,211,210,195,196,169,171,61,163,180,172,67,170,173,174,175,176,178,177,179,68,205,202,204,203,181,167,168,166,220,187,191,189,186,222,218,223,224,225,226,228,229,230,231,221,233,234,232,76,77,112,113,114,115,116,117,118,119,120,121,122,124,123,125,126,127,111,161,128,129,130,162,131,132,133,134,135,136,137,138,139,140,141,142,143,145,144,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,235,236,219,237,262,263,238,241,260,261,251,250,248,243,256,254,258,242,255,259,244,245,257,239,246,247,249,253,264,252,240,277,276,271,273,272,265,266,268,270,274,275,267,269,278,279,280,281,227,282,283,284,192,78,190,188,164,208,182,197,198,165,73,217,62,63,66,64,65,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,71,94,101,93,108,85,84,107,102,105,87,86,82,81,104,83,88,89,92,79,110,109,96,97,99,95,98,103,90,91,100,80,106,70,69,74,75,72,185,184,183,215,216,194,193,200,201,206,207,209,199],"latestChangedDtsFile":"./src/stream.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/package.json deleted file mode 100644 index 9b436b752..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/package.json +++ /dev/null @@ -1,191 +0,0 @@ -{ - "name": "@chainsafe/libp2p-yamux", - "version": "5.0.3", - "description": "Yamux stream multiplexer for libp2p", - "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/ChainSafe/js-libp2p-yamux#readme", - "repository": { - "type": "git", - "url": "git+https://github.com/ChainSafe/js-libp2p-yamux.git" - }, - "bugs": { - "url": "https://github.com/ChainSafe/js-libp2p-yamux/issues" - }, - "keywords": [ - "IPFS", - "libp2p", - "multiplexer", - "muxer", - "stream" - ], - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - }, - "type": "module", - "types": "./dist/src/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "*", - "dist/*", - "dist/src/*", - "dist/src/*/index" - ], - "src/*": [ - "*", - "dist/*", - "dist/src/*", - "dist/src/*/index" - ] - } - }, - "files": [ - "src", - "dist", - "!dist/test", - "!**/*.tsbuildinfo" - ], - "exports": { - ".": { - "types": "./dist/src/index.d.ts", - "import": "./dist/src/index.js" - }, - "./config": { - "types": "./dist/src/config.d.ts", - "import": "./dist/src/config.js" - }, - "./stream": { - "types": "./dist/src/stream.d.ts", - "import": "./dist/src/stream.js" - } - }, - "eslintConfig": { - "extends": "ipfs", - "parserOptions": { - "sourceType": "module" - }, - "ignorePatterns": [ - "src/*.d.ts" - ] - }, - "release": { - "branches": [ - "master" - ], - "plugins": [ - [ - "@semantic-release/commit-analyzer", - { - "preset": "conventionalcommits", - "releaseRules": [ - { - "breaking": true, - "release": "major" - }, - { - "revert": true, - "release": "patch" - }, - { - "type": "feat", - "release": "minor" - }, - { - "type": "fix", - "release": "patch" - }, - { - "type": "docs", - "release": "patch" - }, - { - "type": "test", - "release": "patch" - }, - { - "type": "deps", - "release": "patch" - }, - { - "scope": "no-release", - "release": false - } - ] - } - ], - [ - "@semantic-release/release-notes-generator", - { - "preset": "conventionalcommits", - "presetConfig": { - "types": [ - { - "type": "feat", - "section": "Features" - }, - { - "type": "fix", - "section": "Bug Fixes" - }, - { - "type": "chore", - "section": "Trivial Changes" - }, - { - "type": "docs", - "section": "Documentation" - }, - { - "type": "deps", - "section": "Dependencies" - }, - { - "type": "test", - "section": "Tests" - } - ] - } - } - ], - "@semantic-release/changelog", - "@semantic-release/npm", - "@semantic-release/github", - "@semantic-release/git" - ] - }, - "scripts": { - "clean": "aegir clean", - "lint": "aegir lint", - "dep-check": "aegir dep-check", - "benchmark": "benchmark dist/test/bench/*.bench.js --timeout 400000", - "build": "aegir build", - "test": "aegir test", - "test:chrome": "aegir test -t browser", - "test:chrome-webworker": "aegir test -t webworker", - "test:firefox": "aegir test -t browser -- --browser firefox", - "test:firefox-webworker": "aegir test -t webworker -- --browser firefox", - "test:node": "aegir test -t node --cov", - "test:electron-main": "aegir test -t electron-main", - "release": "aegir release", - "docs": "aegir docs" - }, - "dependencies": { - "@libp2p/interface": "next", - "@libp2p/logger": "next", - "get-iterator": "^2.0.1", - "it-foreach": "^2.0.3", - "it-pipe": "^3.0.1", - "it-pushable": "^3.2.0", - "uint8arraylist": "^2.4.3" - }, - "devDependencies": { - "@dapplion/benchmark": "^0.2.4", - "@libp2p/interface-compliance-tests": "next", - "@libp2p/mplex": "next", - "aegir": "^40.0.1", - "it-drain": "^3.0.2", - "it-pair": "^2.0.6", - "it-stream-types": "^2.0.1" - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/config.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/config.ts deleted file mode 100644 index 887e461f5..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/config.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { logger, type Logger } from '@libp2p/logger' -import { ERR_INVALID_CONFIG, INITIAL_STREAM_WINDOW, MAX_STREAM_WINDOW } from './constants.js' - -// TOOD use config items or delete them -export interface Config { - /** - * Used to control the log destination - * - * It can be disabled by explicitly setting to `undefined` - */ - log?: Logger - - /** - * Used to do periodic keep alive messages using a ping. - */ - enableKeepAlive: boolean - - /** - * How often to perform the keep alive - * - * measured in milliseconds - */ - keepAliveInterval: number - - /** - * Maximum number of concurrent inbound streams that we accept. - * If the peer tries to open more streams, those will be reset immediately. - */ - maxInboundStreams: number - - /** - * Maximum number of concurrent outbound streams that we accept. - * If the application tries to open more streams, the call to `newStream` will throw - */ - maxOutboundStreams: number - - /** - * Used to control the initial window size that we allow for a stream. - * - * measured in bytes - */ - initialStreamWindowSize: number - - /** - * Used to control the maximum window size that we allow for a stream. - */ - maxStreamWindowSize: number - - /** - * Maximum size of a message that we'll send on a stream. - * This ensures that a single stream doesn't hog a connection. - */ - maxMessageSize: number -} - -export const defaultConfig: Config = { - log: logger('libp2p:yamux'), - enableKeepAlive: true, - keepAliveInterval: 30_000, - maxInboundStreams: 1_000, - maxOutboundStreams: 1_000, - initialStreamWindowSize: INITIAL_STREAM_WINDOW, - maxStreamWindowSize: MAX_STREAM_WINDOW, - maxMessageSize: 64 * 1024 -} - -export function verifyConfig (config: Config): void { - if (config.keepAliveInterval <= 0) { - throw new CodeError('keep-alive interval must be positive', ERR_INVALID_CONFIG) - } - if (config.maxInboundStreams < 0) { - throw new CodeError('max inbound streams must be larger or equal 0', ERR_INVALID_CONFIG) - } - if (config.maxOutboundStreams < 0) { - throw new CodeError('max outbound streams must be larger or equal 0', ERR_INVALID_CONFIG) - } - if (config.initialStreamWindowSize < INITIAL_STREAM_WINDOW) { - throw new CodeError('InitialStreamWindowSize must be larger or equal 256 kB', ERR_INVALID_CONFIG) - } - if (config.maxStreamWindowSize < config.initialStreamWindowSize) { - throw new CodeError('MaxStreamWindowSize must be larger than the InitialStreamWindowSize', ERR_INVALID_CONFIG) - } - if (config.maxStreamWindowSize > 2 ** 32 - 1) { - throw new CodeError('MaxStreamWindowSize must be less than equal MAX_UINT32', ERR_INVALID_CONFIG) - } - if (config.maxMessageSize < 1024) { - throw new CodeError('MaxMessageSize must be greater than a kilobyte', ERR_INVALID_CONFIG) - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/constants.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/constants.ts deleted file mode 100644 index d28830008..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/constants.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Protocol violation errors - -export const ERR_INVALID_FRAME = 'ERR_INVALID_FRAME' -export const ERR_UNREQUESTED_PING = 'ERR_UNREQUESTED_PING' -export const ERR_NOT_MATCHING_PING = 'ERR_NOT_MATCHING_PING' -export const ERR_STREAM_ALREADY_EXISTS = 'ERR_STREAM_ALREADY_EXISTS' -export const ERR_DECODE_INVALID_VERSION = 'ERR_DECODE_INVALID_VERSION' -export const ERR_BOTH_CLIENTS = 'ERR_BOTH_CLIENTS' -export const ERR_RECV_WINDOW_EXCEEDED = 'ERR_RECV_WINDOW_EXCEEDED' - -export const PROTOCOL_ERRORS = new Set([ - ERR_INVALID_FRAME, - ERR_UNREQUESTED_PING, - ERR_NOT_MATCHING_PING, - ERR_STREAM_ALREADY_EXISTS, - ERR_DECODE_INVALID_VERSION, - ERR_BOTH_CLIENTS, - ERR_RECV_WINDOW_EXCEEDED -]) - -// local errors - -export const ERR_INVALID_CONFIG = 'ERR_INVALID_CONFIG' -export const ERR_MUXER_LOCAL_CLOSED = 'ERR_MUXER_LOCAL_CLOSED' -export const ERR_MUXER_REMOTE_CLOSED = 'ERR_MUXER_REMOTE_CLOSED' -export const ERR_STREAM_RESET = 'ERR_STREAM_RESET' -export const ERR_STREAM_ABORT = 'ERR_STREAM_ABORT' -export const ERR_MAX_OUTBOUND_STREAMS_EXCEEDED = 'ERROR_MAX_OUTBOUND_STREAMS_EXCEEDED' -export const ERR_DECODE_IN_PROGRESS = 'ERR_DECODE_IN_PROGRESS' - -/** - * INITIAL_STREAM_WINDOW is the initial stream window size. - * - * Not an implementation choice, this is defined in the specification - */ -export const INITIAL_STREAM_WINDOW = 256 * 1024 - -/** - * Default max stream window - */ -export const MAX_STREAM_WINDOW = 16 * 1024 * 1024 diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/decode.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/decode.ts deleted file mode 100644 index 8433f8f2c..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/decode.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { Uint8ArrayList } from 'uint8arraylist' -import { ERR_DECODE_INVALID_VERSION, ERR_DECODE_IN_PROGRESS } from './constants.js' -import { type FrameHeader, FrameType, HEADER_LENGTH, YAMUX_VERSION } from './frame.js' -import type { Source } from 'it-stream-types' - -// used to bitshift in decoding -// native bitshift can overflow into a negative number, so we bitshift by multiplying by a power of 2 -const twoPow24 = 2 ** 24 - -/** - * Decode a header from the front of a buffer - * - * @param data - Assumed to have enough bytes for a header - */ -export function decodeHeader (data: Uint8Array): FrameHeader { - if (data[0] !== YAMUX_VERSION) { - throw new CodeError('Invalid frame version', ERR_DECODE_INVALID_VERSION) - } - return { - type: data[1], - flag: (data[2] << 8) + data[3], - streamID: (data[4] * twoPow24) + (data[5] << 16) + (data[6] << 8) + data[7], - length: (data[8] * twoPow24) + (data[9] << 16) + (data[10] << 8) + data[11] - } -} - -/** - * Decodes yamux frames from a source - */ -export class Decoder { - private readonly source: Source - /** Buffer for in-progress frames */ - private readonly buffer: Uint8ArrayList - /** Used to sanity check against decoding while in an inconsistent state */ - private frameInProgress: boolean - - constructor (source: Source) { - // Normally, when entering a for-await loop with an iterable/async iterable, the only ways to exit the loop are: - // 1. exhaust the iterable - // 2. throw an error - slow, undesirable if there's not actually an error - // 3. break or return - calls the iterable's `return` method, finalizing the iterable, no more iteration possible - // - // In this case, we want to enter (and exit) a for-await loop per chunked data frame and continue processing the iterable. - // To do this, we strip the `return` method from the iterator and can now `break` early and continue iterating. - // Exiting the main for-await is still possible via 1. and 2. - this.source = returnlessSource(source) - this.buffer = new Uint8ArrayList() - this.frameInProgress = false - } - - /** - * Emits frames from the decoder source. - * - * Note: If `readData` is emitted, it _must_ be called before the next iteration - * Otherwise an error is thrown - */ - async * emitFrames (): AsyncGenerator<{ header: FrameHeader, readData?: () => Promise }> { - for await (const chunk of this.source) { - this.buffer.append(chunk) - - // Loop to consume as many bytes from the buffer as possible - // Eg: when a single chunk contains several frames - while (true) { - const header = this.readHeader() - if (header === undefined) { - break - } - - const { type, length } = header - if (type === FrameType.Data) { - // This is a data frame, the frame body must still be read - // `readData` must be called before the next iteration here - this.frameInProgress = true - yield { - header, - readData: this.readBytes.bind(this, length) - } - } else { - yield { header } - } - } - } - } - - private readHeader (): FrameHeader | undefined { - // Sanity check to ensure a header isn't read when another frame is partially decoded - // In practice this shouldn't happen - if (this.frameInProgress) { - throw new CodeError('decoding frame already in progress', ERR_DECODE_IN_PROGRESS) - } - - if (this.buffer.length < HEADER_LENGTH) { - // not enough data yet - return - } - - const header = decodeHeader(this.buffer.subarray(0, HEADER_LENGTH)) - this.buffer.consume(HEADER_LENGTH) - return header - } - - private async readBytes (length: number): Promise { - if (this.buffer.length < length) { - for await (const chunk of this.source) { - this.buffer.append(chunk) - - if (this.buffer.length >= length) { - // see note above, the iterator is not `return`ed here - break - } - } - } - - const out = this.buffer.sublist(0, length) - this.buffer.consume(length) - - // The next frame can now be decoded - this.frameInProgress = false - - return out - } -} - -/** - * Strip the `return` method from a `Source` - */ -export function returnlessSource (source: Source): Source { - if ((source as Iterable)[Symbol.iterator] !== undefined) { - const iterator = (source as Iterable)[Symbol.iterator]() - iterator.return = undefined - return { - [Symbol.iterator] () { return iterator } - } - } else if ((source as AsyncIterable)[Symbol.asyncIterator] !== undefined) { - const iterator = (source as AsyncIterable)[Symbol.asyncIterator]() - iterator.return = undefined - return { - [Symbol.asyncIterator] () { return iterator } - } - } else { - throw new Error('a source must be either an iterable or an async iterable') - } -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/encode.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/encode.ts deleted file mode 100644 index 6353c0091..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/encode.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { HEADER_LENGTH } from './frame.js' -import type { FrameHeader } from './frame.js' - -export function encodeHeader (header: FrameHeader): Uint8Array { - const frame = new Uint8Array(HEADER_LENGTH) - - // always assume version 0 - // frameView.setUint8(0, header.version) - - frame[1] = header.type - - frame[2] = header.flag >>> 8 - frame[3] = header.flag - - frame[4] = header.streamID >>> 24 - frame[5] = header.streamID >>> 16 - frame[6] = header.streamID >>> 8 - frame[7] = header.streamID - - frame[8] = header.length >>> 24 - frame[9] = header.length >>> 16 - frame[10] = header.length >>> 8 - frame[11] = header.length - - return frame -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/frame.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/frame.ts deleted file mode 100644 index b9f41289e..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/frame.ts +++ /dev/null @@ -1,64 +0,0 @@ -export enum FrameType { - /** Used to transmit data. May transmit zero length payloads depending on the flags. */ - Data = 0x0, - /** Used to updated the senders receive window size. This is used to implement per-session flow control. */ - WindowUpdate = 0x1, - /** Used to measure RTT. It can also be used to heart-beat and do keep-alives over TCP. */ - Ping = 0x2, - /** Used to close a session. */ - GoAway = 0x3, -} - -export enum Flag { - /** Signals the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate outbound. */ - SYN = 0x1, - /** Acknowledges the start of a new stream. May be sent with a data or window update message. Also sent with a ping to indicate response. */ - ACK = 0x2, - /** Performs a half-close of a stream. May be sent with a data message or window update. */ - FIN = 0x4, - /** Reset a stream immediately. May be sent with a data or window update message. */ - RST = 0x8, -} - -const flagCodes = Object.values(Flag).filter((x) => typeof x !== 'string') as Flag[] - -export const YAMUX_VERSION = 0 - -export enum GoAwayCode { - NormalTermination = 0x0, - ProtocolError = 0x1, - InternalError = 0x2, -} - -export const HEADER_LENGTH = 12 - -export interface FrameHeader { - /** - * The version field is used for future backward compatibility. - * At the current time, the field is always set to 0, to indicate the initial version. - */ - version?: number - /** The type field is used to switch the frame message type. */ - type: FrameType - /** The flags field is used to provide additional information related to the message type. */ - flag: number - /** - * The StreamID field is used to identify the logical stream the frame is addressing. - * The client side should use odd ID's, and the server even. - * This prevents any collisions. Additionally, the 0 ID is reserved to represent the session. - */ - streamID: number - /** - * The meaning of the length field depends on the message type: - * * Data - provides the length of bytes following the header - * * Window update - provides a delta update to the window size - * * Ping - Contains an opaque value, echoed back - * * Go Away - Contains an error code - */ - length: number -} - -export function stringifyHeader (header: FrameHeader): string { - const flags = flagCodes.filter(f => (header.flag & f) === f).map(f => Flag[f]).join('|') - return `streamID=${header.streamID} type=${FrameType[header.type]} flag=${flags} length=${header.length}` -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/index.ts deleted file mode 100644 index ade3ad883..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Yamux } from './muxer.js' -import type { YamuxMuxerInit } from './muxer.js' -import type { StreamMuxerFactory } from '@libp2p/interface/stream-muxer' -export { GoAwayCode } from './frame.js' - -export function yamux (init: YamuxMuxerInit = {}): () => StreamMuxerFactory { - return () => new Yamux(init) -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/muxer.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/muxer.ts deleted file mode 100644 index 8b4d491ed..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/muxer.ts +++ /dev/null @@ -1,598 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { setMaxListeners } from '@libp2p/interface/events' -import { logger, type Logger } from '@libp2p/logger' -import { getIterator } from 'get-iterator' -import { pushable, type Pushable } from 'it-pushable' -import { type Config, defaultConfig, verifyConfig } from './config.js' -import { ERR_BOTH_CLIENTS, ERR_INVALID_FRAME, ERR_MAX_OUTBOUND_STREAMS_EXCEEDED, ERR_MUXER_LOCAL_CLOSED, ERR_MUXER_REMOTE_CLOSED, ERR_NOT_MATCHING_PING, ERR_STREAM_ALREADY_EXISTS, ERR_UNREQUESTED_PING, PROTOCOL_ERRORS } from './constants.js' -import { Decoder } from './decode.js' -import { encodeHeader } from './encode.js' -import { Flag, type FrameHeader, FrameType, GoAwayCode } from './frame.js' -import { StreamState, YamuxStream } from './stream.js' -import type { AbortOptions } from '@libp2p/interface' -import type { Stream } from '@libp2p/interface/connection' -import type { StreamMuxer, StreamMuxerFactory, StreamMuxerInit } from '@libp2p/interface/stream-muxer' -import type { Sink, Source } from 'it-stream-types' -import type { Uint8ArrayList } from 'uint8arraylist' - -const YAMUX_PROTOCOL_ID = '/yamux/1.0.0' -const CLOSE_TIMEOUT = 500 - -export interface YamuxMuxerInit extends StreamMuxerInit, Partial { -} - -export class Yamux implements StreamMuxerFactory { - protocol = YAMUX_PROTOCOL_ID - private readonly _init: YamuxMuxerInit - - constructor (init: YamuxMuxerInit = {}) { - this._init = init - } - - createStreamMuxer (init?: YamuxMuxerInit): YamuxMuxer { - return new YamuxMuxer({ - ...this._init, - ...init - }) - } -} - -export interface CloseOptions extends AbortOptions { - reason?: GoAwayCode -} - -export class YamuxMuxer implements StreamMuxer { - protocol = YAMUX_PROTOCOL_ID - source: Pushable - sink: Sink, Promise> - - private readonly config: Config - private readonly log?: Logger - - /** Used to close the muxer from either the sink or source */ - private readonly closeController: AbortController - - /** The next stream id to be used when initiating a new stream */ - private nextStreamID: number - /** Primary stream mapping, streamID => stream */ - private readonly _streams: Map - - /** The next ping id to be used when pinging */ - private nextPingID: number - /** Tracking info for the currently active ping */ - private activePing?: { id: number, promise: Promise, resolve: () => void } - /** Round trip time */ - private rtt: number - - /** True if client, false if server */ - private readonly client: boolean - - private localGoAway?: GoAwayCode - private remoteGoAway?: GoAwayCode - - /** Number of tracked inbound streams */ - private numInboundStreams: number - /** Number of tracked outbound streams */ - private numOutboundStreams: number - - private readonly onIncomingStream?: (stream: Stream) => void - private readonly onStreamEnd?: (stream: Stream) => void - - constructor (init: YamuxMuxerInit) { - this.client = init.direction === 'outbound' - this.config = { ...defaultConfig, ...init } - this.log = this.config.log - verifyConfig(this.config) - - this.closeController = new AbortController() - setMaxListeners(Infinity, this.closeController.signal) - - this.onIncomingStream = init.onIncomingStream - this.onStreamEnd = init.onStreamEnd - - this._streams = new Map() - - this.source = pushable({ - onEnd: (): void => { - this.log?.trace('muxer source ended') - - this._streams.forEach(stream => { - stream.destroy() - }) - } - }) - - this.sink = async (source: Source): Promise => { - const shutDownListener = (): void => { - const iterator = getIterator(source) - - if (iterator.return != null) { - const res = iterator.return() - - if (isPromise(res)) { - res.catch(err => { - this.log?.('could not cause sink source to return', err) - }) - } - } - } - - let reason, error - try { - const decoder = new Decoder(source) - - try { - this.closeController.signal.addEventListener('abort', shutDownListener) - - for await (const frame of decoder.emitFrames()) { - await this.handleFrame(frame.header, frame.readData) - } - } finally { - this.closeController.signal.removeEventListener('abort', shutDownListener) - } - - reason = GoAwayCode.NormalTermination - } catch (err: unknown) { - // either a protocol or internal error - const errCode = (err as { code: string }).code - if (PROTOCOL_ERRORS.has(errCode)) { - this.log?.error('protocol error in sink', err) - reason = GoAwayCode.ProtocolError - } else { - this.log?.error('internal error in sink', err) - reason = GoAwayCode.InternalError - } - - error = err as Error - } - - this.log?.trace('muxer sink ended') - - if (error != null) { - this.abort(error, reason) - } else { - await this.close({ reason }) - } - } - - this.numInboundStreams = 0 - this.numOutboundStreams = 0 - - // client uses odd streamIDs, server uses even streamIDs - this.nextStreamID = this.client ? 1 : 2 - - this.nextPingID = 0 - this.rtt = -1 - - this.log?.trace('muxer created') - - if (this.config.enableKeepAlive) { - this.keepAliveLoop().catch(e => this.log?.error('keepalive error: %s', e)) - } - - // send an initial ping to establish RTT - this.ping().catch(e => this.log?.error('ping error: %s', e)) - } - - get streams (): YamuxStream[] { - return Array.from(this._streams.values()) - } - - newStream (name?: string | undefined): YamuxStream { - if (this.remoteGoAway !== undefined) { - throw new CodeError('muxer closed remotely', ERR_MUXER_REMOTE_CLOSED) - } - if (this.localGoAway !== undefined) { - throw new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED) - } - - const id = this.nextStreamID - this.nextStreamID += 2 - - // check against our configured maximum number of outbound streams - if (this.numOutboundStreams >= this.config.maxOutboundStreams) { - throw new CodeError('max outbound streams exceeded', ERR_MAX_OUTBOUND_STREAMS_EXCEEDED) - } - - this.log?.trace('new outgoing stream id=%s', id) - - const stream = this._newStream(id, name, StreamState.Init, 'outbound') - this._streams.set(id, stream) - - this.numOutboundStreams++ - - // send a window update to open the stream on the receiver end - stream.sendWindowUpdate() - - return stream - } - - /** - * Initiate a ping and wait for a response - * - * Note: only a single ping will be initiated at a time. - * If a ping is already in progress, a new ping will not be initiated. - * - * @returns the round-trip-time in milliseconds - */ - async ping (): Promise { - if (this.remoteGoAway !== undefined) { - throw new CodeError('muxer closed remotely', ERR_MUXER_REMOTE_CLOSED) - } - if (this.localGoAway !== undefined) { - throw new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED) - } - - // An active ping does not yet exist, handle the process here - if (this.activePing === undefined) { - // create active ping - let _resolve = (): void => {} - this.activePing = { - id: this.nextPingID++, - // this promise awaits resolution or the close controller aborting - promise: new Promise((resolve, reject) => { - const closed = (): void => { - reject(new CodeError('muxer closed locally', ERR_MUXER_LOCAL_CLOSED)) - } - this.closeController.signal.addEventListener('abort', closed, { once: true }) - _resolve = (): void => { - this.closeController.signal.removeEventListener('abort', closed) - resolve() - } - }), - resolve: _resolve - } - // send ping - const start = Date.now() - this.sendPing(this.activePing.id) - // await pong - try { - await this.activePing.promise - } finally { - // clean-up active ping - delete this.activePing - } - // update rtt - const end = Date.now() - this.rtt = end - start - } else { - // an active ping is already in progress, piggyback off that - await this.activePing.promise - } - return this.rtt - } - - /** - * Get the ping round trip time - * - * Note: Will return 0 if no successful ping has yet been completed - * - * @returns the round-trip-time in milliseconds - */ - getRTT (): number { - return this.rtt - } - - /** - * Close the muxer - */ - async close (options: CloseOptions = {}): Promise { - if (this.closeController.signal.aborted) { - // already closed - return - } - - const reason = options?.reason ?? GoAwayCode.NormalTermination - - this.log?.trace('muxer close reason=%s', reason) - - if (options.signal == null) { - const signal = AbortSignal.timeout(CLOSE_TIMEOUT) - setMaxListeners(Infinity, signal) - - options = { - ...options, - signal - } - } - - try { - await Promise.all( - [...this._streams.values()].map(async s => s.close(options)) - ) - - // send reason to the other side, allow the other side to close gracefully - this.sendGoAway(reason) - - this._closeMuxer() - } catch (err: any) { - this.abort(err) - } - } - - abort (err: Error, reason?: GoAwayCode): void { - if (this.closeController.signal.aborted) { - // already closed - return - } - - reason = reason ?? GoAwayCode.InternalError - - // If reason was provided, use that, otherwise use the presence of `err` to determine the reason - this.log?.error('muxer abort reason=%s error=%s', reason, err) - - // Abort all underlying streams - for (const stream of this._streams.values()) { - stream.abort(err) - } - - // send reason to the other side, allow the other side to close gracefully - this.sendGoAway(reason) - - this._closeMuxer() - } - - isClosed (): boolean { - return this.closeController.signal.aborted - } - - /** - * Called when either the local or remote shuts down the muxer - */ - private _closeMuxer (): void { - // stop the sink and any other processes - this.closeController.abort() - - // stop the source - this.source.end() - } - - /** Create a new stream */ - private _newStream (id: number, name: string | undefined, state: StreamState, direction: 'inbound' | 'outbound'): YamuxStream { - if (this._streams.get(id) != null) { - throw new CodeError('Stream already exists', ERR_STREAM_ALREADY_EXISTS, { id }) - } - - const stream = new YamuxStream({ - id: id.toString(), - name, - state, - direction, - sendFrame: this.sendFrame.bind(this), - onEnd: () => { - this.closeStream(id) - this.onStreamEnd?.(stream) - }, - log: logger(`libp2p:yamux:${direction}:${id}`), - config: this.config, - getRTT: this.getRTT.bind(this) - }) - - return stream - } - - /** - * closeStream is used to close a stream once both sides have - * issued a close. - */ - private closeStream (id: number): void { - if (this.client === (id % 2 === 0)) { - this.numInboundStreams-- - } else { - this.numOutboundStreams-- - } - this._streams.delete(id) - } - - private async keepAliveLoop (): Promise { - const abortPromise = new Promise((_resolve, reject) => { this.closeController.signal.addEventListener('abort', reject, { once: true }) }) - this.log?.trace('muxer keepalive enabled interval=%s', this.config.keepAliveInterval) - while (true) { - let timeoutId - try { - await Promise.race([ - abortPromise, - new Promise((resolve) => { - timeoutId = setTimeout(resolve, this.config.keepAliveInterval) - }) - ]) - this.ping().catch(e => this.log?.error('ping error: %s', e)) - } catch (e) { - // closed - clearInterval(timeoutId) - return - } - } - } - - private async handleFrame (header: FrameHeader, readData?: () => Promise): Promise { - const { - streamID, - type, - length - } = header - this.log?.trace('received frame %o', header) - - if (streamID === 0) { - switch (type) { - case FrameType.Ping: - { this.handlePing(header); return } - case FrameType.GoAway: - { this.handleGoAway(length); return } - default: - // Invalid state - throw new CodeError('Invalid frame type', ERR_INVALID_FRAME, { header }) - } - } else { - switch (header.type) { - case FrameType.Data: - case FrameType.WindowUpdate: - { await this.handleStreamMessage(header, readData); return } - default: - // Invalid state - throw new CodeError('Invalid frame type', ERR_INVALID_FRAME, { header }) - } - } - } - - private handlePing (header: FrameHeader): void { - // If the ping is initiated by the sender, send a response - if (header.flag === Flag.SYN) { - this.log?.trace('received ping request pingId=%s', header.length) - this.sendPing(header.length, Flag.ACK) - } else if (header.flag === Flag.ACK) { - this.log?.trace('received ping response pingId=%s', header.length) - this.handlePingResponse(header.length) - } else { - // Invalid state - throw new CodeError('Invalid frame flag', ERR_INVALID_FRAME, { header }) - } - } - - private handlePingResponse (pingId: number): void { - if (this.activePing === undefined) { - // this ping was not requested - throw new CodeError('ping not requested', ERR_UNREQUESTED_PING) - } - if (this.activePing.id !== pingId) { - // this ping doesn't match our active ping request - throw new CodeError('ping doesn\'t match our id', ERR_NOT_MATCHING_PING) - } - - // valid ping response - this.activePing.resolve() - } - - private handleGoAway (reason: GoAwayCode): void { - this.log?.trace('received GoAway reason=%s', GoAwayCode[reason] ?? 'unknown') - this.remoteGoAway = reason - - // If the other side is friendly, they would have already closed all streams before sending a GoAway - // In case they weren't, reset all streams - for (const stream of this._streams.values()) { - stream.reset() - } - - this._closeMuxer() - } - - private async handleStreamMessage (header: FrameHeader, readData?: () => Promise): Promise { - const { streamID, flag, type } = header - - if ((flag & Flag.SYN) === Flag.SYN) { - this.incomingStream(streamID) - } - - const stream = this._streams.get(streamID) - if (stream === undefined) { - if (type === FrameType.Data) { - this.log?.('discarding data for stream id=%s', streamID) - if (readData === undefined) { - throw new Error('unreachable') - } - await readData() - } else { - this.log?.('frame for missing stream id=%s', streamID) - } - return - } - - switch (type) { - case FrameType.WindowUpdate: { - stream.handleWindowUpdate(header); return - } - case FrameType.Data: { - if (readData === undefined) { - throw new Error('unreachable') - } - - await stream.handleData(header, readData); return - } - default: - throw new Error('unreachable') - } - } - - private incomingStream (id: number): void { - if (this.client !== (id % 2 === 0)) { - throw new CodeError('both endpoints are clients', ERR_BOTH_CLIENTS) - } - if (this._streams.has(id)) { - return - } - - this.log?.trace('new incoming stream id=%s', id) - - if (this.localGoAway !== undefined) { - // reject (reset) immediately if we are doing a go away - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: id, - length: 0 - }); return - } - - // check against our configured maximum number of inbound streams - if (this.numInboundStreams >= this.config.maxInboundStreams) { - this.log?.('maxIncomingStreams exceeded, forcing stream reset') - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: id, - length: 0 - }); return - } - - // allocate a new stream - const stream = this._newStream(id, undefined, StreamState.SYNReceived, 'inbound') - - this.numInboundStreams++ - // the stream should now be tracked - this._streams.set(id, stream) - - this.onIncomingStream?.(stream) - } - - private sendFrame (header: FrameHeader, data?: Uint8ArrayList): void { - this.log?.trace('sending frame %o', header) - if (header.type === FrameType.Data) { - if (data === undefined) { - throw new CodeError('invalid frame', ERR_INVALID_FRAME) - } - this.source.push(encodeHeader(header)) - this.source.push(data) - } else { - this.source.push(encodeHeader(header)) - } - } - - private sendPing (pingId: number, flag: Flag = Flag.SYN): void { - if (flag === Flag.SYN) { - this.log?.trace('sending ping request pingId=%s', pingId) - } else { - this.log?.trace('sending ping response pingId=%s', pingId) - } - this.sendFrame({ - type: FrameType.Ping, - flag, - streamID: 0, - length: pingId - }) - } - - private sendGoAway (reason: GoAwayCode = GoAwayCode.NormalTermination): void { - this.log?.('sending GoAway reason=%s', GoAwayCode[reason]) - this.localGoAway = reason - this.sendFrame({ - type: FrameType.GoAway, - flag: 0, - streamID: 0, - length: reason - }) - } -} - -function isPromise (thing: any): thing is Promise { - return thing != null && typeof thing.then === 'function' -} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/stream.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/stream.ts deleted file mode 100644 index a87737caa..000000000 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-yield-chunks/yamux/src/stream.ts +++ /dev/null @@ -1,302 +0,0 @@ -import { CodeError } from '@libp2p/interface/errors' -import { AbstractStream, type AbstractStreamInit } from '@libp2p/utils/abstract-stream' -import each from 'it-foreach' -import { ERR_RECV_WINDOW_EXCEEDED, ERR_STREAM_ABORT, INITIAL_STREAM_WINDOW } from './constants.js' -import { Flag, type FrameHeader, FrameType, HEADER_LENGTH } from './frame.js' -import type { Config } from './config.js' -import type { AbortOptions } from '@libp2p/interface' -import type { Uint8ArrayList } from 'uint8arraylist' - -export enum StreamState { - Init, - SYNSent, - SYNReceived, - Established, - Finished, -} - -export interface YamuxStreamInit extends AbstractStreamInit { - name?: string - sendFrame: (header: FrameHeader, body?: Uint8ArrayList) => void - getRTT: () => number - config: Config - state: StreamState -} - -/** YamuxStream is used to represent a logical stream within a session */ -export class YamuxStream extends AbstractStream { - name?: string - state: StreamState - - private readonly config: Config - private readonly _id: number - - /** The number of available bytes to send */ - private sendWindowCapacity: number - /** Callback to notify that the sendWindowCapacity has been updated */ - private sendWindowCapacityUpdate?: () => void - - /** The number of bytes available to receive in a full window */ - private recvWindow: number - /** The number of available bytes to receive */ - private recvWindowCapacity: number - - /** - * An 'epoch' is the time it takes to process and read data - * - * Used in conjunction with RTT to determine whether to increase the recvWindow - */ - private epochStart: number - private readonly getRTT: () => number - - private readonly sendFrame: (header: FrameHeader, body?: Uint8ArrayList) => void - - constructor (init: YamuxStreamInit) { - super({ - ...init, - onEnd: (err?: Error) => { - this.state = StreamState.Finished - init.onEnd?.(err) - } - }) - - this.config = init.config - this._id = parseInt(init.id, 10) - this.name = init.name - this.state = init.state - this.sendWindowCapacity = INITIAL_STREAM_WINDOW - this.recvWindow = this.config.initialStreamWindowSize - this.recvWindowCapacity = this.recvWindow - this.epochStart = Date.now() - this.getRTT = init.getRTT - - this.sendFrame = init.sendFrame - - this.source = each(this.source, () => { - this.sendWindowUpdate() - }) - } - - /** - * Send a message to the remote muxer informing them a new stream is being - * opened. - * - * This is a noop for Yamux because the first window update is sent when - * .newStream is called on the muxer which opens the stream on the remote. - */ - async sendNewStream (): Promise { - - } - - /** - * Send a data message to the remote muxer - */ - async sendData (buf: Uint8ArrayList, options: AbortOptions = {}): Promise { - buf = buf.sublist() - - // send in chunks, waiting for window updates - while (buf.byteLength !== 0) { - // wait for the send window to refill - if (this.sendWindowCapacity === 0) { - await this.waitForSendWindowCapacity(options) - } - - // check we didn't close while waiting for send window capacity - if (this.status !== 'open') { - return - } - - // send as much as we can - const toSend = Math.min(this.sendWindowCapacity, this.config.maxMessageSize - HEADER_LENGTH, buf.length) - const flags = this.getSendFlags() - - this.sendFrame({ - type: FrameType.Data, - flag: flags, - streamID: this._id, - length: toSend - }, buf.sublist(0, toSend)) - - this.sendWindowCapacity -= toSend - - buf.consume(toSend) - } - } - - /** - * Send a reset message to the remote muxer - */ - async sendReset (): Promise { - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: Flag.RST, - streamID: this._id, - length: 0 - }) - } - - /** - * Send a message to the remote muxer, informing them no more data messages - * will be sent by this end of the stream - */ - async sendCloseWrite (): Promise { - const flags = this.getSendFlags() | Flag.FIN - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: flags, - streamID: this._id, - length: 0 - }) - } - - /** - * Send a message to the remote muxer, informing them no more data messages - * will be read by this end of the stream - */ - async sendCloseRead (): Promise { - - } - - /** - * Wait for the send window to be non-zero - * - * Will throw with ERR_STREAM_ABORT if the stream gets aborted - */ - async waitForSendWindowCapacity (options: AbortOptions = {}): Promise { - if (this.sendWindowCapacity > 0) { - return - } - - let resolve: () => void - let reject: (err: Error) => void - const abort = (): void => { - if (this.status === 'open') { - reject(new CodeError('stream aborted', ERR_STREAM_ABORT)) - } else { - // the stream was closed already, ignore the failure to send - resolve() - } - } - options.signal?.addEventListener('abort', abort) - - try { - await new Promise((_resolve, _reject) => { - this.sendWindowCapacityUpdate = () => { - _resolve() - } - reject = _reject - resolve = _resolve - }) - } finally { - options.signal?.removeEventListener('abort', abort) - } - } - - /** - * handleWindowUpdate is called when the stream receives a window update frame - */ - handleWindowUpdate (header: FrameHeader): void { - this.log?.trace('stream received window update id=%s', this._id) - this.processFlags(header.flag) - - // increase send window - const available = this.sendWindowCapacity - this.sendWindowCapacity += header.length - // if the update increments a 0 availability, notify the stream that sending can resume - if (available === 0 && header.length > 0) { - this.sendWindowCapacityUpdate?.() - } - } - - /** - * handleData is called when the stream receives a data frame - */ - async handleData (header: FrameHeader, readData: () => Promise): Promise { - this.log?.trace('stream received data id=%s', this._id) - this.processFlags(header.flag) - - // check that our recv window is not exceeded - if (this.recvWindowCapacity < header.length) { - throw new CodeError('receive window exceeded', ERR_RECV_WINDOW_EXCEEDED, { available: this.recvWindowCapacity, recv: header.length }) - } - - const data = await readData() - this.recvWindowCapacity -= header.length - - this.sourcePush(data) - } - - /** - * processFlags is used to update the state of the stream based on set flags, if any. - */ - private processFlags (flags: number): void { - if ((flags & Flag.ACK) === Flag.ACK) { - if (this.state === StreamState.SYNSent) { - this.state = StreamState.Established - } - } - if ((flags & Flag.FIN) === Flag.FIN) { - this.remoteCloseWrite() - } - if ((flags & Flag.RST) === Flag.RST) { - this.reset() - } - } - - /** - * getSendFlags determines any flags that are appropriate - * based on the current stream state. - * - * The state is updated as a side-effect. - */ - private getSendFlags (): number { - switch (this.state) { - case StreamState.Init: - this.state = StreamState.SYNSent - return Flag.SYN - case StreamState.SYNReceived: - this.state = StreamState.Established - return Flag.ACK - default: - return 0 - } - } - - /** - * potentially sends a window update enabling further writes to take place. - */ - sendWindowUpdate (): void { - // determine the flags if any - const flags = this.getSendFlags() - - // If the stream has already been established - // and we've processed data within the time it takes for 4 round trips - // then we (up to) double the recvWindow - const now = Date.now() - const rtt = this.getRTT() - if (flags === 0 && rtt > -1 && now - this.epochStart < rtt * 4) { - // we've already validated that maxStreamWindowSize can't be more than MAX_UINT32 - this.recvWindow = Math.min(this.recvWindow * 2, this.config.maxStreamWindowSize) - } - - if (this.recvWindowCapacity >= this.recvWindow && flags === 0) { - // a window update isn't needed - return - } - - // update the receive window - const delta = this.recvWindow - this.recvWindowCapacity - this.recvWindowCapacity = this.recvWindow - - // update the epoch start - this.epochStart = now - - // send window update - this.sendFrame({ - type: FrameType.WindowUpdate, - flag: flags, - streamID: this._id, - length: delta - }) - } -} diff --git a/perf/runner/src/versions.ts b/perf/runner/src/versions.ts index 98681b5de..ce0e43ea1 100644 --- a/perf/runner/src/versions.ts +++ b/perf/runner/src/versions.ts @@ -50,29 +50,9 @@ export const versions: Array = [ implementation: "js-libp2p", transportStacks: ["tcp"] }, - { - id: "v1.0-native-x25519", - implementation: "js-libp2p", - transportStacks: ["tcp"] - }, { id: "v1.0-uint8arraylists-all-the-way-down", implementation: "js-libp2p", transportStacks: ["tcp"] }, - { - id: "v1.0-uint8arraylists-all-the-way-down-nagle", - implementation: "js-libp2p", - transportStacks: ["tcp"] - }, - { - id: "v1.0-uint8arraylists-yield-chunks", - implementation: "js-libp2p", - transportStacks: ["tcp"] - }, - { - id: "v1.0-uint8arraylists-yield-chunks-nagle", - implementation: "js-libp2p", - transportStacks: ["tcp"] - }, ]